WO2011137836A1 - IPv4网络中传输IPv6报文的方法、终端及网关 - Google Patents
IPv4网络中传输IPv6报文的方法、终端及网关 Download PDFInfo
- Publication number
- WO2011137836A1 WO2011137836A1 PCT/CN2011/074823 CN2011074823W WO2011137836A1 WO 2011137836 A1 WO2011137836 A1 WO 2011137836A1 CN 2011074823 W CN2011074823 W CN 2011074823W WO 2011137836 A1 WO2011137836 A1 WO 2011137836A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- address
- ipv6
- ipv4
- gateway
- packet
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
- H04L61/2503—Translation of Internet protocol [IP] addresses
- H04L61/251—Translation of Internet protocol [IP] addresses between different IP versions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/2854—Wide area networks, e.g. public data networks
- H04L12/2856—Access arrangements, e.g. Internet access
- H04L12/2858—Access network architectures
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
- H04L61/2503—Translation of Internet protocol [IP] addresses
- H04L61/2592—Translation of Internet protocol [IP] addresses using tunnelling or encapsulation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2101/00—Indexing scheme associated with group H04L61/00
- H04L2101/60—Types of network addresses
- H04L2101/604—Address structures or formats
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2101/00—Indexing scheme associated with group H04L61/00
- H04L2101/60—Types of network addresses
- H04L2101/618—Details of network addresses
- H04L2101/659—Internet protocol version 6 [IPv6] addresses
Definitions
- An embodiment of the present invention provides a method, a terminal, and a gateway for transmitting an IPv6 packet in an IPv4 network, which implements IPv6 packets to traverse an IPv4 network and saves an IPv4 address.
- the embodiment of the present invention provides a method for transmitting an IPv6 packet in an IPv4 network, including:
- the IPv6 terminal obtains an IPv6 address of the terminal, and the IPv6 address includes an IPv4 address, where the IPv4 address is an IPv4 address of the gateway or an IPv4 address specified by the gateway, and the gateway is a device that connects the IPv6 network and the IPv4 network. Or the device that connects the Layer 2 network and the IPv4 network, the number of IPv6 terminals connected to the gateway is multiple, and the IPv6 addresses of all the IPv6 terminals connected to the gateway include the same IPv4 address;
- the IPv6 terminal sends the IPv6 address as a source address in an IPv6 packet and sends the IPv6 address to the gateway.
- an embodiment of the present invention provides a method for transmitting an IPv6 packet in an IPv4 network, including: The first gateway receives the IPv6 packet sent by the IPv6 terminal, and the IPv6 packet includes the destination IPv6 address. If the destination IPv6 address includes the IPv4 address, the first gateway encapsulates the IPv6 packet in the destination address. The IPv4 address of the IPv4 address is sent to the second gateway, and the IPv4 address included in the destination IPv6 address is the IPv4 address of the second gateway or the second gateway.
- the second gateway is a device connecting the IPv6 network and the IPv4 network, or a device connecting the Layer 2 network and the IPv4 network, and all IPv6 addresses of the IPv6 terminals connected to the second gateway include the same The IPv4 address.
- the embodiment of the present invention provides a terminal, including: an obtaining module, configured to acquire an IPv6 address of the terminal, where the IPv6 address includes an IPv4 address, and the IPv4 address is an IPv4 address of the gateway or is the gateway. a specified IPv4 address, where the gateway is a device that connects an IPv6 network and an IPv4 network, or a device that connects a Layer 2 network and an IPv4 network, and multiple IPv6 terminals connected to the gateway, and all connected to the gateway.
- the IPv6 address of the IPv6 terminal on the same contains the same IPv4 address;
- the sending module is configured to send the IPv6 address as a source address to the gateway in an IPv6 packet.
- a gateway including:
- a receiving module configured to receive an IPv6 packet sent by the IPv6 terminal, where the IPv6 packet includes a destination IPv6 address;
- the first encapsulating module is configured to: if the IPv6 address is included in the destination IPv6 address, the gateway encapsulates the IPv6 packet in an IPv4 packet whose destination address is the IPv4 address, and the IPv4 packet Sending to the second gateway, the IPv4 address included in the destination IPv6 address is the IPv4 address of the second gateway or the IPv4 address specified by the second gateway, and the second gateway is connected to the IPv6 network and the IPv4 network.
- the device, or a device that connects the Layer 2 network to the IPv4 network, and all IPv6 addresses of the IPv6 terminals connected to the second gateway contain the same IPv4 address.
- a method and a device for transmitting an IPv6 packet in an IPv4 network by encapsulating an IPv6 packet in an IPv4 packet, can implement an IPv6 packet to traverse an IPv4 network, and multiple IPv6 terminals are used.
- the IPv4 address of the corresponding gateway is used as the destination address of the encapsulated IPv4 packet, and multiple IPv6 terminals can be associated with the same IPv4 address to save the IPv4 address.
- FIG. 1 is a schematic flow chart of a method according to a first embodiment of the present invention
- FIG. 2 is a schematic flow chart of a method according to a second embodiment of the present invention.
- 3a is a schematic diagram of a format of an IPv6 address in an embodiment of the present invention.
- FIG. 3b is a schematic diagram of another format of an IPv6 address according to an embodiment of the present invention.
- FIG. 4 is a schematic flow chart of a method according to a third embodiment of the present invention.
- Figure 5 is a schematic structural view of a third embodiment of the present invention.
- FIG. 6 is a schematic flow chart of a method according to a fourth embodiment of the present invention.
- FIG. 7 is a schematic structural view of a fourth embodiment of the present invention.
- FIG. 8 is a schematic structural diagram of a terminal according to a fifth embodiment of the present invention.
- FIG. 9 is a schematic structural diagram of a gateway according to a sixth embodiment of the present invention.
- the technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention.
- the embodiments are a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
- An IPv6 terminal obtains an IPv6 address of the terminal, where the IPv6 address includes an IPv4 address, and the IPv4 address is an IPv4 address of the gateway or The IPv4 address specified by the gateway, where the gateway is a device that connects the IPv6 network and the IPv4 network, or a device that connects the Layer 2 network and the IPv4 network, and multiple IPv6 terminals connected to the gateway, and all connected to the The IPv6 address of the IPv6 terminal on the gateway includes the same IPv4 address.
- the IPv4 address of the gateway may be a compressed IPv4 address.
- the IPv4 address that can be assigned by the same carrier usually has the same prefix.
- the IPv4 address specified by the gateway or the gateway can be omitted from the same prefix, that is, the compressed IPv4 address is included in the IPv6 address. Since the compressed IPv4 address and the IPv4 address of the gateway are always in one-to-one correspondence in the carrier network, the compressed IPv4 address can be used as the Pv4 address of the gateway.
- the specific field in the IPv6 address may be set to a specific value, and the IPv6 address is included in the IPv6 address, that is, the IPv6 address is further included to indicate the IPv6 address.
- the address contains a specific field value for the IPv4 address.
- the IPv4 address may be included in the first 64 bits of the IPv6 address, ie, the prefix portion of the IPv6 address.
- the IPv4 address may also be included in the last 64 bits of the IPv6 address, ie, the link address portion of the IPv6 address.
- Step 12 The IPv6 terminal sends the IPv6 address as a source address in an IPv6 packet and sends the packet to the gateway.
- the IPv6 address is included in the IPv6 address
- the IPv6 packet is encapsulated in the IPv4 packet when the IPv4 network traverses the IPv4 network, so that the IPv6 packet traverses the IPv4 network. IPv4 address resource.
- FIG. 2 is a schematic flowchart of a method according to a second embodiment of the present invention, including:
- Step 21 The first gateway receives an IPv6 packet sent by the IPv6 terminal, where the IPv6 packet includes a destination IPv6 address.
- Step 22 If the destination IPv6 address includes an IPv4 address, the first gateway encapsulates the IPv6 packet in an IPv4 packet whose destination address is the IPv4 address, and sends the IPv4 packet to the IPv4 packet.
- the second gateway, the IPv4 address included in the destination IPv6 address is an IPv4 address of the second gateway or an IPv4 address specified by the second gateway, and the second gateway is a device that connects the IPv6 network and the IPv4 network. Or it is a device that connects a Layer 2 network to an IPv4 network, and all IPv6 addresses of IPv6 terminals connected to the second gateway contain the same IPv4 address.
- the first gateway encapsulates the IPv6 packet in an IPv4 packet whose destination address is the IPv4 address. Then, the compressed IPv4 address is restored, and the IPv6 packet is encapsulated in the IPv4 packet whose destination address is the restored IPv4 address.
- the IPv4 addresses that can be assigned by the same carrier usually have the same prefix.
- the IPv4 address specified by the gateway or the gateway can be omitted.
- the first gateway is omitted before the IPv4 address. The part is the same prefix as above, and the restored IPv4 address is obtained.
- the first gateway may determine, according to whether the destination IPv6 address includes the relevant indication, whether the IPv4 address is included, that is, if the destination IPv6 address includes a specific field that is used to indicate that the destination IPv6 address includes the IPv4 address. The first gateway determines that the destination IPv6 address includes an IPv4 address.
- this embodiment may further include: if the destination IPv6 address does not include an IPv4 address, the A gateway encapsulates the IPv6 packet in an IPv4 packet, and the destination IPv4 address of the IPv4 packet is an IPv4 address of the specific gateway.
- the embodiment further includes: the first gateway setting the protocol type in the packet header of the IPv4 packet to a specific value, to identify that the IPv4 packet is encapsulated IPv6 packet.
- the IPv4 address may be included in the first 64 bits of the IPv6 address. In addition, the IPv4 address may also be included in the last 64 bits of the IPv6 address.
- the IPv6 packet is encapsulated in the IPv4 packet, so that the IPv6 packet traverses the IPv4 network, and the IPv4 address of the gateway corresponding to the multiple IPv6 terminals is used as the destination address of the encapsulated IPv4 packet.
- IPv6 terminals correspond to the same IPv4 address to save IPv4 addresses.
- an IPv6 address as shown in FIG. 3a may be allocated in a PPPoE process or a Dynamic Host Configuration Protocol (DHCP) process.
- DHCP Dynamic Host Configuration Protocol
- FIG. 3a is a schematic diagram of a format of an IPv6 address according to an embodiment of the present invention.
- an IPv6 address includes: a 3-bit identification part (specifically 001), a 61-bit prefix part, and a 64-bit connection address ( Link address) section.
- the prefix part includes a global routing prefix and a subnet ID of the terminal. Routing hierarchy can be achieved by adopting global routing and subnet ID. For example, the first 24 bits of the prefix part can be set to represent the country, the next 10 bits represent the city, and the remaining bits represent the cell to achieve multiple levels of addresses.
- the link address section can contain an IPv4 address, for example, carrying an IPv4 address with 32 bits in the middle of the link address.
- the first n bits in the link address are used as an identifier (Identifier) to indicate that the IPv6 address contains an IPv4 address.
- the remaining 32-n bits of the link address are used to represent the terminal ID to distinguish different terminals corresponding to the same IPv4 address.
- the location of the IPv4 address included in FIG. 3a is not limited to the above location of the link address portion, and may be included in other locations of the link address portion, and is not limited to the link address portion, and may also be included in The rest of the IPv6 address.
- the location of an IPv4 address can be in the prefix portion of an IPv6 address.
- FIG. 3b is another schematic diagram of an IPv6 address in an embodiment of the present invention.
- the IPv6 address includes: a 3-bit identification part (specifically 001), a 61-bit prefix part, and a 64-bit link address part.
- the prefix part includes an address prefix allocated by the operator, a compressed IPv4 address, and a subnet ID. The improvement scheme of the IPv6 address is described above, and the flow of the IPv6 traversing the IPv4 network is described below.
- FIG. 4 is a schematic flowchart of a method according to a third embodiment of the present invention.
- FIG. 5 is a schematic structural diagram of a third embodiment of the present invention.
- the first terminal 51, the first gateway 52, the second gateway 53, and the second The terminal 54 wherein the first terminal 51 and the second terminal 54 are both IPv6 terminals, and the corresponding address is an IPv6 address, and all are in the format shown in FIG. 3a.
- An IPv4 network is between the first gateway 52 and the second gateway 53.
- the first terminal 51 and the first gateway 52 may be an IPv6 network or a Layer 2 network
- the second gateway 53 and the second terminal 54 may be an IPv6 network or a Layer 2 network.
- the first terminal 51 sends an IPv6 packet to the second terminal 54 as an example.
- this embodiment includes:
- Step 41 The first terminal sends an IPv6 packet to the first gateway.
- the first terminal may send the IPv6 to the first gateway. If the first terminal and the first gateway are Layer 2 networks, the Layer 2 network does not pay attention to the upper layer protocol. Therefore, the first terminal can also send the IPv6 packet to the first gateway.
- the second gateway is connected to the second terminal as an example.
- the second gateway may be connected to multiple second terminals, where the IPv6 addresses of the multiple second terminals include the first The IPv4 address of the second gateway.
- the destination IPv6 address of the IPv6 packet includes the IPv4 address of the second gateway.
- the IPv4 address included in the IPv6 address is not limited to the IPv4 address of the gateway, and may be the public network IPv4 address specified by the gateway.
- the public network IPv4 specified by the gateway needs to correspond to multiple IPv6 terminals, and The gateway has advertised the route of the specified IPv4 address in the IPv4 network.
- an IPv4 address with the IPv4 address as a gateway is taken as an example.
- Step 42 The first gateway encapsulates the IPv6 packet in an IPv4 packet, and the destination address of the IPv4 packet is an IPv4 address included in the IPv6 address.
- the IPv6 packet cannot be directly transmitted between the first gateway and the second gateway. Therefore, the IPv6 packet needs to be encapsulated.
- the IPv6 packet is encapsulated in the IPv4 packet.
- the source IPv4 address of the IPv4 packet is the IPv4 address of the first gateway
- the destination IPv4 address is the IPv4 address included in the IPv6 packet.
- the value of the protocol type in the IPv4 packet header may be set to a specific value, and the specific value indicates that the IPv4 packet is encapsulated with an IPv6 packet.
- Step 43 The first gateway sends the IPv4 packet to the second gateway.
- Step 44 The second gateway decapsulates the IPv6 packet from the IPv4 packet. After determining, by the protocol type in the IPv4 packet header, the second gateway encapsulates the IPv6 packet in the IPv4 packet, and then decapsulates the IPv6 packet from the IPv4 packet.
- the gateway adopts the encapsulation mode of the embodiment of the present invention by default, and the second gateway may also directly determine that the IPv4 packet is encapsulated with an IPv6 packet, and the IPv6 packet is decapsulated from the IPv4 packet.
- Step 45 The second gateway sends the decapsulated IPv6 packet to the second terminal.
- the first terminal sends an IPv6 packet to the second terminal as an example.
- the second terminal sends an IPv6 packet to the first terminal
- a similar process may be used. The difference is that the first terminal and the second terminal are required to interact with each other.
- the switch, the first gateway and the second gateway are interchanged.
- the second gateway encapsulates the IPv6 packet in the IPv4 packet, and the destination IPv4 address of the IPv4 packet is the IPv4 address of the first gateway.
- the second gateway sets the protocol type value of the IPv4 packet to a specific value, so that the first gateway parses the IPv6 packet from the received IPv4 packet.
- the IPv4 address of the gateway is used as the destination IPv4 address of the IPv4 packet, and the IPv4 address can be saved without increasing the consumption of the IPv4 address.
- the IPv4 address corresponding to the terminal in the same gateway you can reduce the routing cost by using only one IPv4 routing path in the IPv4 network when the multiple terminals function as the destination.
- the IPv4 address contained in the IPv6 address as the destination address in the IPv4 packet encapsulation, you can avoid the establishment and maintenance of the tunnel.
- the third embodiment takes the communication between the peers as an example, that is, the IPv6 addresses of the first terminal and the second terminal are both in the format shown in Fig. 3a. Communication between non-peers will be described below, and non-peer means that one of the two communicating terminals does not have the format shown in Fig. 3a.
- IPv6 traversing an IPv4 network when the IPv4 address is a compressed IPv4 address.
- the first terminal sends an IPv6 packet to the first gateway.
- the first terminal may send the IPv6 packet to the first gateway; if the first terminal and the first gateway are Layer 2 networks, the Layer 2 network does not pay attention to The upper layer protocol, therefore, the first terminal can also send the IPv6 packet to the first gateway.
- the second gateway may be connected to multiple second terminals, where the IPv6 addresses of the multiple second terminals include the IPv4 address of the second gateway, and the IPv4 address of the second gateway is the compressed IPv4 address.
- the destination IPv6 address of the IPv6 packet includes the IPv4 address of the second gateway.
- the IPv4 address omits the same part of the same carrier network as the compressed IPv4 address.
- the first gateway encapsulates the IPv6 packet in an IPv4 packet, and the destination address of the IPv4 packet is the IPv6 address.
- the IPv6 packet cannot be directly transmitted between the first gateway and the second gateway. Therefore, the IPv6 packet needs to be encapsulated.
- the IPv6 packet is encapsulated in the IPv4 packet.
- the source IPv4 address of the IPv4 packet is the IPv4 address of the first gateway
- the destination IPv4 address is the IPv4 address included in the IPv6 packet.
- the IPv4 address of the IPv6 packet is the compressed IPv4 address
- the first gateway restores the compressed IPv4 address, that is, the portion that is omitted in the supplement of the IPv4 address, and obtains the restored IPv4 address.
- the destination IPv4 address is the restored IPv4 address.
- the value of the protocol type in the IPv4 packet header may be set to a specific value, and the specific value indicates that the IPv4 packet is encapsulated with an IPv6 packet.
- Step 43 The first gateway sends the IPv4 packet to the second gateway.
- Step 44 The second gateway decapsulates the IPv6 packet from the IPv4 packet.
- the second gateway can determine, by using the protocol type in the IPv4 packet header, that the IPv4 packet is encapsulated with an IPv6 packet, and the IPv6 packet is decapsulated from the IPv4 packet.
- the gateway adopts the encapsulation mode of the embodiment of the present invention by default, and the second gateway may also directly determine that the IPv4 packet is encapsulated with an IPv6 packet, and the IPv6 packet is decapsulated from the IPv4 packet.
- Step 45 The second gateway sends the decapsulated IPv6 packet to the second terminal.
- the first terminal sends an IPv6 packet to the second terminal as an example.
- the second terminal sends an IPv6 packet to the first terminal
- a similar process may be used. The difference is that the first terminal and the second terminal are required to interact with each other.
- the switch, the first gateway and the second gateway are interchanged.
- the second gateway encapsulates the IPv6 packet in the IPv4 packet, and the destination IPv4 address of the IPv4 packet is the IPv4 address of the first gateway.
- the second gateway may set the protocol type value of the IPv4 packet to a specific value, so that the first gateway parses the IPv6 packet from the received IPv4 packet.
- the IPv4 address of the gateway is used as the destination IPv4 address of the IPv4 packet, and the IPv4 address can be saved without increasing the consumption of the IPv4 address.
- the IPv4 address corresponding to the terminal in the same gateway you can reduce the routing cost by using only one IPv4 routing path in the IPv4 network when the multiple terminals function as the destination.
- the IPv4 address contained in the IPv6 address as the destination address in the IPv4 packet encapsulation, you can avoid the establishment and maintenance of the tunnel.
- FIG. 6 is a schematic flowchart of a method according to a fourth embodiment of the present invention.
- FIG. 7 is a schematic structural diagram of a fourth embodiment of the present invention. Referring to FIG. 7, the first terminal 71, the first gateway 72, the third gateway 73, and the third The terminal 74, wherein the first terminal 71 and the third terminal 74 are both IPv6 terminals, and the corresponding address is an IPv6 address, but the first terminal 71
- the IPv6 address is in the format shown in FIG. 3a or FIG. 3b, and the IPv6 address of the third terminal 74 is not in the format shown in FIG. 3a or FIG. 3b.
- An IPv4 network is between the first gateway 72 and the third gateway 73.
- the first terminal 71 and the first gateway 72 may be an IPv6 network or a Layer 2 network.
- the Internet service provider Internet Service Provider
- ISP Internet Service Provider
- the third gateway may also be another specific gateway corresponding to the IPv6 address not in the format shown in FIG. 3a or FIG. 3b, and is not limited to a gateway connecting different ISPs.
- the first terminal 71 sends an IPv6 packet to the third terminal 74 as an example. Referring to FIG. 6, this embodiment includes:
- Step 61 The first terminal sends an IPv6 packet to the first gateway.
- step 41 For details, see step 41.
- Step 62 The first gateway encapsulates the IPv6 packet in an IPv4 packet, and the destination address of the IPv4 packet is an IPv4 address of the third gateway.
- a specific gateway may be set, and the specific gateway may be a gateway between the network and other networks.
- the third gateway is connected to the IPv6 network to which the first gateway belongs and the remaining IPv6 networks, Therefore, the third gateway is a specific gateway.
- the first gateway receives the IPv6 packet and obtains the IPv6 address in the IPv6 packet, it is not a map.
- the IPv6 packet is encapsulated in an IPv4 packet and sent to a specific gateway.
- the IPv4 address of the specific gateway may be set in the first gateway, so that the IPv4 address of the specific gateway is used as the destination IPv4 address when the IPv6 packet is encapsulated, and the IPv4 address of the first gateway is used as the source IPv4 address to implement the first gateway.
- the received HV6 packet is encapsulated and sent to the specific gateway.
- the value of the protocol type in the IPv4 packet header may be set to a specific value, and the specific value indicates that the IPv4 packet is encapsulated with an IPv6 packet.
- Step 63 The first gateway sends the IPv4 packet to the third gateway.
- Step 64 The third gateway decapsulates the IPv6 packet from the IPv4 packet.
- the third gateway decapsulates the IPv6 packet from the IPv4 packet.
- Step 65 The third gateway sends the decapsulated IPv6 packet to the third terminal.
- the first terminal sends an O6 message to the third terminal as an example.
- the third terminal sends an IPv6 packet to the first terminal
- a similar process may be used. The difference is that only the first terminal and the third terminal role are required.
- the interchange, first gateway and third gateway roles are interchanged.
- the third gateway encapsulates the IPv6 packet in the IPv4 packet, and the destination IPv4 address of the IPv4 packet is the first gateway.
- the IPv4 address, the source IPv4 address is the IPv4 address of the third gateway.
- the third gateway sets the protocol type value of the IPv4 packet to a specific value, so that the first gateway parses the IPv6 packet from the received IPv4 packet.
- FIG. 8 is a schematic structural diagram of a terminal according to a fifth embodiment of the present invention, including an obtaining module 81 and a sending module 82.
- the obtaining module 81 is configured to obtain an IPv6 address of the terminal, where the IPv6 address includes an IPv4 address, and the IPv4 address is a gateway.
- the IPv4 address or the IPv4 address specified for the gateway, the gateway is a device connecting the IPv6 network and the IPv4 network, or a device connecting the layer 2 network and the IPv4 network, and the IPv6 terminal connected to the gateway is multiple
- the IPv6 address of the IPv6 terminal connected to the gateway includes the same IPv4 address.
- the sending module 82 is configured to send the IPv6 address as a source address in an IPv6 packet and send the packet to the gateway.
- the IPv4 address of the gateway can be a compressed IPv4 address.
- the IPv6 address obtained by the obtaining module 81 further includes an indication that the IPv6 address is included in the IPv6 address.
- IPv4 address included in the IPv6 address obtained by the obtaining module 81 may be in the first 64 bits of the IPv6 address.
- the IPv4 address included in the IPv6 address obtained by the obtaining module 81 may also be in the last 64 bits of the IPv6 address.
- the IPv6 address is included in the IPv6 address, and the IPv6 packet is encapsulated in the IPv4 packet when the IPv4 network traverses the IPv4 network, so that the IPv6 packet traverses the IPv4 network. IPv4 address resource.
- FIG. 9 is a schematic structural diagram of a gateway according to a sixth embodiment of the present invention, including a receiving module 91 and a first encapsulating module 92.
- the receiving module 91 is configured to receive an IPv6 packet sent by an IPv6 terminal, where the IPv6 packet includes a destination IPv6 address.
- the first encapsulating module 92 is configured to: if the IPv6 address is included in the destination IPv6 address, the gateway encapsulates the IPv6 packet in an IPv4 packet whose destination address is the IPv4 address, and the IPv4 packet Sending to the second gateway, the IPv4 address included in the destination IPv6 address is the IPv4 address of the second gateway or the IPv4 address specified by the second gateway, and the second gateway is connected to the IPv6 network and the IPv4 network.
- a device, or a device that connects a Layer 2 network to an IPv4 network, and all IPv6 addresses of IPv6 terminals connected to the second gateway are included. The same IPv4 address.
- the first encapsulating module may be specifically configured to: if the IPv4 address is included in the destination IPv6 address, and the IPv4 address in the IPv6 packet received by the receiving module is a compressed IPv4 address, the compression is resumed.
- the IPv4 address is encapsulated in the IPv4 packet whose destination address is the restored IPv4 address.
- the embodiment may further include a determining module 93, where the determining module 93 is configured to determine, according to the specific field value included in the destination IPv6 address, that is used to indicate that the destination IPv6 address includes an IPv4 address, the destination IPv6.
- the address contains an IPv4 address.
- the embodiment may further include a receiving module 91 and a second encapsulating module 94, where the second encapsulating module 94 is configured to encapsulate the IPv6 packet in an IPv4 packet if the destination IPv6 address does not include an IPv4 address,
- the destination IPv4 address of the IPv4 packet is an IPv4 address of a specific gateway.
- the first encapsulating module 92 may be further configured to set a protocol type in the packet header of the IPv4 packet to a specific value, to identify that the IPv4 packet is encapsulated with an IPv6 packet.
- the IPv6 packet is encapsulated in the IPv4 packet, so that the IPv6 packet traverses the IPv4 network, and the IPv4 address of the gateway corresponding to the multiple IPv6 terminals is used as the destination address of the encapsulated IPv4 packet.
- IPv6 terminals correspond to the same IPv4 address to save IPv4 addresses.
- the foregoing program may be stored in a computer readable storage medium, and when executed, the program includes The foregoing steps of the method embodiment; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Description
IPv4 网络中传输 IPv6报文的方法、 终端及网关 本申请要求于 2010年 10月 9日提交中国专利局、 申请号为 CN 201010508123.8, 发明名称为 "IPv4网络中传输 IPv6报文的方法、 终端及网关"的中国专利申请, 以及于 2010年 11月 17日提交中国专利局、申请号为 CN 201010547912.2,发明名称为" IPv4 网 络中传输 Π 报文的方法、 终端及网关"的中国专利申请的优先权, 其全部内容通过 引用结合在本申请中。 技术领域 本发明涉及网络通信技术, 尤其涉及一种 IPv4网络中传输 IPv6报文的方法、 终端 及网关。 背景技术 由于 IPv4地址即将耗尽, 运营商需要把网络和用户切换到 IPv6。 如果把现有用以 支持 IPv4业务的网络升级为支持 IPv6, 则会投资过大, 并且可能因为网络升级而带来 不可预知的问题。 因此, 需要一种机制, 能在现有 IPv4网络中提供 IPv6业务。 目前的 IPv6报文穿越 IPv4网络的解决方案中, 是每个 IPv6地址对应一个 IPv4地址, 无法解 决 IPv4地址缺乏问题。 发明内容
本发明实施例是提供一种 IPv4网络中传输 IPv6报文的方法、终端及网关,实现 IPv6 报文穿越 IPv4网络并节省 IPv4地址。
一方面, 本发明实施例提供了一种 IPv4网络中传输 IPv6报文的方法, 包括:
IPv6终端获取本终端的 IPv6地址, 所述 IPv6地址中包含 IPv4地址, 所述 IPv4地 址为网关的 IPv4地址或者为所述网关指定的 IPv4地址, 所述网关为连接 IPv6网络与 IPv4网络的设备, 或者为连接 2层网络与 IPv4网络的设备, 连接到所述网关上的 IPv6 终端为多个, 且所有连接到所述网关上的 IPv6终端的 IPv6地址都包含相同的所述 IPv4 地址;
所述 IPv6终端将所述 IPv6地址作为源地址包含在 IPv6报文中发送给所述网关。 另一方面, 本发明实施例提供了一种 IPv4网络中传输 IPv6报文的方法, 包括:
第一网关接收 IPv6终端发送的 IPv6报文, 所述 IPv6报文中包含目的 IPv6地址; 如果所述目的 IPv6地址中包含了 IPv4地址, 所述第一网关将所述 IPv6报文封装在目 的地址为所述 IPv4地址的 IPv4报文中,并将所述 IPv4报文发送给第二网关,所述目的 IPv6 地址中包含的 IPv4地址为所述第二网关的 IPv4地址或者为所述第二网关指定的 IPv4地 址,所述第二网关为连接 IPv6网络与 IPv4网络的设备,或者为连接 2层网络与 IPv4网络的 设备, 且所有连接到第二网关上的 IPv6终端的 IPv6地址都包含相同的所述 IPv4地址。
一方面, 本发明实施例提供了一种终端, 包括: 获取模块,用于获取本终端的 IPv6地址,所述 IPv6地址中包含 IPv4地址,所述 IPv4 地址为网关的 IPv4地址或者为所述网关指定的 IPv4地址,所述网关为连接 IPv6网络与 IPv4网络的设备, 或者为连接 2层网络与 IPv4网络的设备, 连接到所述网关上的 IPv6 终端为多个, 且所有连接到所述网关上的 IPv6终端的 IPv6地址都包含相同的所述 IPv4 地址;
发送模块, 用于将所述 IPv6地址作为源地址包含在 IPv6报文中发送给所述网关。 另一方面, 本发明实施例提供了一种网关, 包括:
接收模块, 用于接收 IPv6终端发送的 IPv6报文, 所述 IPv6报文中包含目的 IPv6 地址;
第一封装模块,用于如果所述目的 IPv6地址中包含了 IPv4地址,所述网关将所述 IPv6 报文封装在目的地址为所述 IPv4地址的 IPv4报文中,并将所述 IPv4报文发送给第二网关, 所述目的 IPv6地址中包含的 IPv4地址为所述第二网关的 IPv4地址或者为所述第二网关指 定的 IPv4地址,所述第二网关为连接 IPv6网络与 IPv4网络的设备, 或者为连接 2层网络与 IPv4网络的设备, 且所有连接到第二网关上的 IPv6终端的 IPv6地址都包含相同的所述 IPv4地址。
由上述技术方案可知, 本发明实施例的 IPv4网络中传输 IPv6报文的方法及设备, 通过将 IPv6报文封装在 IPv4报文中, 可以实现 IPv6报文穿越 IPv4网络, 并且将多个 IPv6终端对应的网关的 IPv4地址作为封装后的 IPv4报文的目的地址, 可以使得多个 IPv6终端对应同一个 IPv4地址, 以节省 IPv4地址。 附图说明 为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用 的附图作一简单地介绍, 显而易见地, 下面描述中的附图是本发明的一些实施例, 对于
本领域普通技术人员来讲, 在不付出创造性劳动性的前提下, 还可以根据这些附图获得 其他的附图。
图 1为本发明第一实施例的方法流程示意图;
图 2为本发明第二实施例的方法流程示意图;
图 3a为本发明实施例中的 IPv6地址的格式示意图;
图 3b为本发明实施例中的 IPv6地址的另一格式示意图;
图 4为本发明第三实施例的方法流程示意图;
图 5为本发明第三实施例对应的结构示意图;
图 6为本发明第四实施例的方法流程示意图;
图 7为本发明第四实施例对应的结构示意图;
图 8为本发明第五实施例的终端结构示意图;
图 9为本发明第六实施例的网关结构示意图。 具体实施方式 为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本发明实施例中 的附图, 对本发明实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例 是本发明一部分实施例, 而不是全部的实施例。基于本发明中的实施例, 本领域普通技 术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范 围。
图 1为本发明第一实施例的方法流程示意图, 包括- 步骤 11 : IPv6终端获取本终端的 IPv6地址, 所述 IPv6地址中包含 IPv4地址, 所 述 IPv4地址为网关的 IPv4地址或者为所述网关指定的 IPv4地址,所述网关为连接 IPv6 网络与 IPv4网络的设备, 或者为连接 2层网络与 IPv4网络的设备, 连接到所述网关上 的 IPv6终端为多个,且所有连接到所述网关上的 IPv6终端的 IPv6地址都包含相同的所 述 IPv4地址; 可选的, 所述网关的 IPv4地址可以是压縮后的 IPv4地址。 例如, 同一运营商可以 分配的 IPv4地址通常具有相同的前缀, IPv6地址中包含的该网关的或网关指定的 IPv4 地址可以省略上述相同的前缀, 即在 IPv6地址中包含压缩后的 IPv4地址。 由于在该运 营商网络中, 压缩后的 IPv4地址与网关的 IPv4地址总是一一对应的, 因此可以用压缩 后的 IPv4地址作为网关的 Pv4地址。
可选的, 为了标识该 IPv6地址中包含 IPv4地址,可以将该 IPv6地址中的特定字段 设置为特定值后指示 IPv6地址中包含 IPv4地址,即所述 IPv6地址中还包含用于指示所 述 IPv6地址中包含 IPv4地址的特定字段值。 该 IPv4地址可以包含在所述 IPv6地址的前 64比特中,即 IPv6地址的前缀(prefix) 部分。该 IPv4地址也可以包含在所述 IPv6地址的后 64比特中,即 IPv6地址的 link address 部分。
步骤 12: 所述 IPv6终端将所述 IPv6地址作为源地址包含在 IPv6报文中发送给所 述网关。 本实施例通过在 IPv6地址中包含 IPv4地址, 可以在穿越 IPv4网络时, 将 IPv6报 文封装在 IPv4报文中,实现 IPv6报文穿越 IPv4网络;采用多个 IPv6终端对应一个 IPv4 地址, 可以节省 IPv4地址资源。
图 2为本发明第二实施例的方法流程示意图, 包括:
歩骤 21 :第一网关接收 IPv6终端发送的 IPv6报文,所述 IPv6报文中包含目的 IPv6 地址;
步骤 22: 如果所述目的 IPv6地址中包含了 IPv4地址, 所述第一网关将所述 IPv6 报文封装在目的地址为所述 IPv4地址的 IPv4报文中,并将所述 IPv4报文发送给第二网 关,所述目的 IPv6地址中包含的 IPv4地址为所述第二网关的 IPv4地址或者为所述第二 网关指定的 IPv4地址,所述第二网关为连接 IPv6网络与 IPv4网络的设备, 或者为连接 2层网络与 IPv4网络的设备, 且所有连接到第二网关上的 IPv6终端的 IPv6地址都包含 相同的 IPv4地址。
可选的, 如果所述网关的或网关指定的 IPv4地址可以是压缩后的 IPv4地址, 则所 述第一网关在将所述 IPv6报文封装在目的地址为所述 IPv4地址的 IPv4报文中时,先恢 复该压缩后的 IPv4地址, 再将 IPv6报文封装在目的地址为恢复后的 IPv4地址的 IPv4 报文中。 例如, 同一运营商可以分配的 IPv4地址通常具有相同的前缀, IPv6地址中包 含的该网关的或网关指定的 IPv4地址可以省略上述相同的前缀, 第一网关在所述 IPv4 地址前增加被省略的部分即上述相同的前缀, 得到恢复后的 IPv4地址。
可选的,第一网关可以根据目的 IPv6地址中是否包含相关的指示判断是否包含 IPv4 地址, 即, 如果所述目的 IPv6地址中包含用于指示所述目的 IPv6地址中包含了 IPv4地 址的特定字段值, 所述第一网关判断出所述目的 IPv6地址中包含了 IPv4地址。
另外, 本实施例还可以包括: 如果所述目的 IPv6地址中不包含 IPv4地址, 所述第
一网关将所述 IPv6报文封装在 IPv4报文中, 所述 IPv4报文的目的 IPv4地址为特定网 关的 IPv4地址。
为了使得第二网关能够正确解封装, 本实施例还包括: 所述第一网关将所述 IPv4 报文的报文头中的协议类型设置为特定值, 以标识所述 IPv4报文中封装有 IPv6报文。
所述 IPv4地址可以包含在所述 IPv6地址的前 64比特中。 另外, 所述 IPv4地址也 可以包含在所述 IPv6地址的后 64比特中。
本实施例通过将 IPv6报文封装在 IPv4报文中,可以实现 IPv6报文穿越 IPv4网络, 并且将多个 IPv6终端对应的网关的 IPv4地址作为封装后的 IPv4报文的目的地址,可以 使得多个 IPv6终端对应同一个 IPv4地址, 以节省 IPv4地址。
本发明实施例中, 为了使得 IPv6报文穿越 OV4网络,需要对 IPv6地址的分配进行 改进, 使得该 IPv6地址中包含 IPv4地址, 且该 IPv4地址对应多个 IPv6终端。 具体地, 可以在 PPPoE过程或者动态主机配置协议(Dynamic Host Configuration Protocol, DHCP) 过程中分配如图 3a所示的 IPv6地址。
图 3a为本发明实施例中的 IPv6地址的格式示意图, 参见图 3a, IPv6地址包括: 占 用 3比特的标识部分 (具体为 001 ) 、 占用 61比特的前缀部分, 以及占用 64位的连接 地址 (link address) 部分。 其中, 本发明实施例中, 前缀部分包括终端的全球路由前缀 和子网 ID。 通过采用全球路由和子网 ID可以实现路由层次性, 例如可以设置该前缀部 分的前 24比特表示国家、 之后的 10比特表示城市、 其余比特表示小区, 以实现地址的 多层次。 在 link address部分中可以包含 IPv4地址, 例如, 用 link address的中间部分的 32比特携带 IPv4地址。 另夕卜, 用该 link address中的前 n位作为标识 (Identifier) , 用 于表明该 IPv6地址中包含 IPv4地址。再用该 link address的剩余 32-n比特表示终端 ID, 以区分对应同一个 IPv4地址的不同的终端。
当然,可以理解的是, 图 3a中包含 IPv4地址的位置并不限于 link address部分的上 述位置, 还可以包含在该 link address部分的其他位置, 另外, 也不限于 link address部 分, 还可以包含在 IPv6地址的其余部分。
例如, IPv4地址的位置可以在 IPv6地址的 prefix部分。
图 3b为本发明实施例中的 IPv6地址的另一格式示意图。 IPv6地址包括: 占用 3比 特的标识部分(具体为 001 )、占用 61比特的前缀部分,以及占用 64位的连接地址(link address)部分。 其中, 本发明实施例中, 前缀部分包括运营商分配的地址前缀, 压缩后 的 IPv4地址和子网 ID。
上面描述了 IPv6地址的改进方案, 下面描述 IPv6穿越 IPv4网络的流程。
图 4为本发明第三实施例的方法流程示意图, 图 5为本发明第三实施例对应的结构 示意图, 参见图 5, 包括第一终端 51、第一网关 52、第二网关 53和第二终端 54, 其中, 第一终端 51和第二终端 54均是 IPv6终端,对应地址为 IPv6地址,且均为图 3a所示的 格式。 第一网关 52和第二网关 53之间为 IPv4网络。 第一终端 51和第一网关 52之间 可以为 IPv6网络或者二层网络, 第二网关 53和第二终端 54之间可以为 IPv6网络或者 二层网络。本实施例以第一终端 51向第二终端 54发送 IPv6报文为例。参见图 4, 本实 施例包括:
歩骤 41 : 第一终端向第一网关发送 IPv6报文。
如果第一终端和第一网关之间为 IPv6网络, 则第一终端可以将 IPv6发送给第一网 关; 如果第一终端和第一网关之间为二层网络, 由于二层网络不关注上层协议, 因此, 第一终端同样可以将 IPv6报文发送给第一网关。
其中, 图 5中以第二网关连接一个第二终端为例, 但是, 在实际实施时, 该第二网 关可以连接多个第二终端, 该多个第二终端的 IPv6地址中均包含该第二网关的 IPv4地 址。 当第二网关连接多个第二终端, 第一终端需要向该多个第二终端中的任一个发送 IPv6报文时, 该 IPv6报文的目的 IPv6地址中包含第二网关的 IPv4地址。 当然, IPv6 地址中包含的 IPv4地址并不限于网关的 IPv4地址, 可以为网关指定的公网 IPv4地址, 另外, 为了节省 IPv4地址, 该网关指定的公网 IPv4需要对应多个 IPv6终端, 并且, 网 关已经在 IPv4网络中发布该指定的 IPv4地址的路由。
本发明实施例中以该 IPv4地址为网关的 IPv4地址为例。
步骤 42: 第一网关将该 IPv6报文封装在 IPv4报文内, 该 IPv4报文的目的地址为 该 IPv6地址中包含的 IPv4地址。
由于第一网关和第二网关之间为 IPv4网络, 不能直接传输 IPv6报文, 因此需要对 IPv6报文进行封装, 可以将 IPv6报文作为净荷封装在 IPv4报文中。 另外, 该 IPv4报 文的源 IPv4地址为该第一网关的 IPv4地址,目的 IPv4地址为该 IPv6报文中包含的 IPv4 地址。
另外, 可以将 IPv4报文头中的协议类型的值设定为特定值, 该特定值表明该 IPv4 报文中封装有 IPv6报文。
步骤 43: 第一网关将该 IPv4报文发送给第二网关。
步骤 44: 第二网关从该 IPv4报文中解封装出 IPv6报文。
第二网关通过 IPv4报文头中的协议类型确定出该 IPv4报文中封装有 IPv6报文后, 则从该 IPv4报文中解封装出 IPv6报文。
在某些情况下, 例如网关默认采用本发明实施例的封装方式, 第二网关也可以直接 确定出该 IPv4报文中封装有 IPv6报文, 从该 IPv4报文中解封装出 IPv6报文。
步骤 45: 第二网关将解封装出的 IPv6报文发送给第二终端。
本实施例以第一终端向第二终端发送 IPv6报文为例, 当第二终端向第一终端发送 IPv6报文时也可以采用类似流程,不同点只是需要第一终端与第二终端角色互换、第一 网关和第二网关角色互换。 例如, 当第二终端发送的 IPv6报文发送到第二网关时, 第 二网关将该 IPv6报文封装在 IPv4报文中, 且该 IPv4报文的目的 IPv4地址为第一网关 的 IPv4地址。 进一步地, 第二网关将该 IPv4报文的协议类型值设定为特定值, 以便第 一网关从接收的 IPv4报文中解析出该 IPv6报文。
本实施例通过将网关的 IPv4地址作为封装 IPv6报文的 IPv4报文的目的 IPv4地址, 可以不增加 IPv4地址的消耗, 节省 IPv4地址。 通过将同一个网关下的终端对应的 IPv4 地址设置为同一个, 可以在该多个终端作为目的端时, 只需 IPv4网络中的一组 IPv4路 由路径, 降低路由开销。通过在 IPv4报文封装时将 IPv6地址中包含的 IPv4地址作为目 的地址, 可以避免对隧道的建立和维护。
第三实施例是以对等体之间的通信为例, 即第一终端和第二终端的 IPv6地址均图 3a所示的格式。下面将描述非对等体之间的通信,非对等体是指两个通信的终端中有一 个不具有图 3a所示的格式。
下面描述 IPv4地址是压缩后的 IPv4地址时, IPv6穿越 IPv4网络的流程。
第一终端向第一网关发送 IPv6报文。
如果第一终端和第一网关之间为 IPv6网络, 则第一终端可以将 IPv6报文发送给第 一网关; 如果第一终端和第一网关之间为二层网络, 由于二层网络不关注上层协议, 因 此, 第一终端同样可以将 IPv6报文发送给第一网关。
在实际实施时, 第二网关可以连接多个第二终端, 该多个第二终端的 IPv6地址中 均包含该第二网关的 IPv4地址,该第二网关的 IPv4地址为压缩后的 IPv4地址。当第二 网关连接多个第二终端, 第一终端需要向该多个第二终端中的任一个发送 IPv6报文时, 该 IPv6报文的目的 IPv6地址中包含第二网关的 IPv4地址, 该 IPv4地址省略了同一运 营商网络中相同的部分, 为压缩后的 IPv4地址。
第一网关将该 IPv6报文封装在 IPv4报文内, 该 IPv4报文的目的地址为该 IPv6地
址中包含的 IPv4地址。
由于第一网关和第二网关之间为 IPv4网络, 不能直接传输 IPv6报文, 因此需要对 IPv6报文进行封装, 可以将 IPv6报文作为净荷封装在 IPv4报文中。 另外, 该 IPv4报 文的源 IPv4地址为该第一网关的 IPv4地址,目的 IPv4地址为该 IPv6报文中包含的 IPv4 地址。 由于该 IPv6报文中包含的 IPv4地址为压缩后的 IPv4地址,第一网关先恢复该压 缩后的 IPv4地址,即在该 IPv4地址补充上省略的部分,得到恢复后的 IPv4地址,该 IPv4 报文的目的 IPv4地址为该恢复后的 IPv4地址。
另外, 可以将 IPv4报文头中的协议类型的值设定为特定值, 该特定值表明该 IPv4 报文中封装有 IPv6报文。
步骤 43: 第一网关将该 IPv4报文发送给第二网关。
步骤 44: 第二网关从该 IPv4报文中解封装出 IPv6报文。
第二网关可以通过 IPv4报文头中的协议类型确定出该 IPv4报文中封装有 IPv6报 文, 从该 IPv4报文中解封装出 IPv6报文。
在某些情况下, 例如网关默认采用本发明实施例的封装方式, 第二网关也可以直接 确定出该 IPv4报文中封装有 IPv6报文, 从该 IPv4报文中解封装出 IPv6报文。
歩骤 45: 第二网关将解封装出的 IPv6报文发送给第二终端。
本实施例以第一终端向第二终端发送 IPv6报文为例, 当第二终端向第一终端发送 IPv6报文时也可以采用类似流程,不同点只是需要第一终端与第二终端角色互换、第一 网关和第二网关角色互换。 例如, 当第二终端发送的 IPv6报文发送到第二网关时, 第 二网关将该 IPv6报文封装在 IPv4报文中, 且该 IPv4报文的目的 IPv4地址为第一网关 的 IPv4地址。 进一步地, 第二网关可以将该 IPv4报文的协议类型值设定为特定值, 以 便第一网关从接收的 IPv4报文中解析出该 IPv6报文。
本实施例通过将网关的 IPv4地址作为封装 IPv6报文的 IPv4报文的目的 IPv4地址, 可以不增加 IPv4地址的消耗, 节省 IPv4地址。 通过将同一个网关下的终端对应的 IPv4 地址设置为同一个, 可以在该多个终端作为目的端时, 只需 IPv4网络中的一组 IPv4路 由路径, 降低路由开销。通过在 IPv4报文封装时将 IPv6地址中包含的 IPv4地址作为目 的地址, 可以避免对隧道的建立和维护。
图 6为本发明第四施例的方法流程示意图, 图 7为本发明第四实施例对应的结构示 意图, 参见图 7, 包括第一终端 71、 第一网关 72、 第三网关 73和第三终端 74, 其中, 第一终端 71和第三终端 74均是 IPv6终端, 对应地址为 IPv6地址, 但是, 第一终端 71
的 IPv6地址为图 3a或图 3b所示的格式,第三终端 74的 IPv6地址不是图 3a或图 3b所 示的格式。 第一网关 72和第三网关 73之间为 IPv4网络。 第一终端 71和第一网关 72 之间可以为 IPv6网络或者二层网络, 本实施例以第三网关 73和第三终端 74之间为与 第一终端所属的互联网服务提供商 (Internet Service Provider, ISP) 不同的其余 ISP的 IPv6网络为例。 当然, 第三网关也可以为其他的对应于 IPv6地址不是图 3a或图 3b所 示的格式的特定网关, 并不限于连接不同 ISP的网关。 本实施例以第一终端 71 向第三 终端 74发送 IPv6报文为例。 参见图 6, 本实施例包括:
步骤 61 : 第一终端向第一网关发送 IPv6报文。
具体内容可以参见步骤 41。
步骤 62: 第一网关将该 IPv6报文封装在 IPv4报文内, 该 IPv4报文的目的地址为 第三网关的 IPv4地址。
在某一网络内, 可以设置特定网关, 该特定网关可以是该网络与其他网络之间的网 关, 例如, 参见图 7, 由于第三网关是连通第一网关所属的 IPv6网络与其余 IPv6网络, 因此, 该第三网关即为特定网关。
因此, 当第一网关接收到 IPv6报文, 并获取到该 IPv6报文中的 IPv6地址不是图
3a或图 3b所示的格式时, 则需要将该 IPv6报文封装在 IPv4报文中后发送给特定网关。 其中, 在第一网关内可以设置特定网关的 IPv4地址, 以便在封装 IPv6报文时将该特定 网关的 IPv4地址作为目的 IPv4地址, 将第一网关的 IPv4地址作为源 IPv4地址, 实现 第一网关将接收到的 HV6报文封装后发送给该特定网关。
另外, 可以将 IPv4报文头中的协议类型的值设定为特定值, 该特定值表明该 IPv4 报文中封装有 IPv6报文。
步骤 63: 第一网关将该 IPv4报文发送给第三网关。
歩骤 64: 第三网关从该 IPv4报文中解封装出 IPv6报文。
第三网关通过 IPv4报文头中的协议类型确定出该 IPv4报文中封装有 IPv6报文后, 则从该 IPv4报文中解封装出 IPv6报文。
歩骤 65: 第三网关将解封装出的 IPv6报文发送给第三终端。
本实施例以第一终端向第三终端发送 O 6报文为例, 当第三终端向第一终端发送 IPv6报文时也可以采用类似流程,不同点只是需要第一终端与第三终端角色互换、第一 网关和第三网关角色互换。 例如, 当第三终端发送的 IPv6报文发送到第三网关时, 第 三网关将该 IPv6报文封装在 IPv4报文中, 且该 IPv4报文的目的 IPv4地址为第一网关
的 IPv4地址, 源 IPv4地址为第三网关的 IPv4地址。 进一步地, 第三网关将该 IPv4报 文的协议类型值设定为特定值,以便第一网关从接收的 IPv4报文中解析出该 IPv6报文。
本实施例通过将网关的 IPv4地址作为目的 IPv4地址,可以不增加 IPv4地址的消耗, 节省 IPv4地址。 通过将同一个网关下的终端对应的 IPv4地址设置为同一个, 可以在该 多个终端作为目的端时, 只需 IPv4网络中的一组 IPv4路由路径, 降低路由开销。 通过 在 IPv4报文封装时将 IPv6地址中包含的 IPv4地址作为目的地址,可以避免对隧道的建 立和维护。 图 8为本发明第五实施例的终端结构示意图, 包括获取模块 81和发送模块 82; 获 取模块 81用于获取本终端的 IPv6地址, 所述 IPv6地址中包含 IPv4地址, 所述 IPv4地 址为网关的 IPv4地址或者为所述网关指定的 IPv4地址, 所述网关为连接 IPv6网络与 IPv4网络的设备, 或者为连接 2层网络与 IPv4网络的设备, 连接到所述网关上的 IPv6 终端为多个, 且所有连接到所述网关上的 IPv6终端的 IPv6地址都包含相同的所述 IPv4 地址;发送模块 82用于将所述 IPv6地址作为源地址包含在 IPv6报文中发送给所述网关。 网关的 IPv4地址可以为压縮后的 IPv4地址。 其中, 所述获取模块 81获取的 IPv6地址中还包含用于指示所述 IPv6地址中包含
IPv4地址的特定字段值。 所述获取模块 81获取的 IPv6地址中包含的 IPv4地址可以在所述 IPv6地址的前 64 比特中。 所述获取模块 81获取的 IPv6地址中包含的 IPv4地址也可以在所述 IPv6地址 的后 64比特中。 本实施例通过在 IPv6地址中包含 IPv4地址, 可以在穿越 IPv4网络时, 将 IPv6报 文封装在 IPv4报文中,实现 IPv6报文穿越 IPv4网络;采用多个 IPv6终端对应一个 IPv4 地址, 可以节省 IPv4地址资源。
图 9为本发明第六实施例的网关结构示意图,包括接收模块 91和第一封装模块 92; 接收模块 91用于接收 IPv6终端发送的 IPv6报文,所述 IPv6报文中包含目的 IPv6地址; 第一封装模块 92用于如果所述目的 IPv6地址中包含了 IPv4地址,所述网关将所述 IPv6 报文封装在目的地址为所述 IPv4地址的 IPv4报文中,并将所述 IPv4报文发送给第二网 关,所述目的 IPv6地址中包含的 IPv4地址为所述第二网关的 IPv4地址或者为所述第二 网关指定的 IPv4地址,所述第二网关为连接 IPv6网络与 IPv4网络的设备, 或者为连接 2层网络与 IPv4网络的设备, 且所有连接到第二网关上的 IPv6终端的 IPv6地址都包含
相同的所述 IPv4地址。
可选地,第一封装模块,可以具体用于如果所述目的 IPv6地址中包含了 IPv4地址, 并且所述接收模块接收的 IPv6报文中的 IPv4地址为压缩后的 IPv4地址,恢复所述压缩 后的 IPv4地址, 将所述 IPv6报文封装在目的地址为所述恢复后的 IPv4地址的 IPv4报 文中。
可选地,本实施例还可以包括确定模块 93,确定模块 93用于根据所述目的 IPv6地 址中包含的用于指示所述目的 IPv6地址中包含了 IPv4地址的特定字段值确定所述目的 IPv6地址中包含 IPv4地址。
另外,本实施例还可以包括接收模块 91和第二封装模块 94,第二封装模块 94用于 如果所述目的 IPv6地址中不包含 IPv4地址, 将所述 IPv6报文封装在 IPv4报文中, 所 述 IPv4报文的目的 IPv4地址为特定网关的 IPv4地址。
其中, 所述第一封装模块 92还可以用于将所述 IPv4报文的报文头中的协议类型设 置为特定值, 以标识所述 IPv4报文中封装有 IPv6报文。
本实施例通过将 IPv6报文封装在 IPv4报文中,可以实现 IPv6报文穿越 IPv4网络, 并且将多个 IPv6终端对应的网关的 IPv4地址作为封装后的 IPv4报文的目的地址,可以 使得多个 IPv6终端对应同一个 IPv4地址, 以节省 IPv4地址。
可以理解的是, 上述方法及设备中的相关特征可以相互参考。 另外, 上述实施例中 的"第一"、 "第二 "等是用于区分各实施例, 而并不代表各实施例的优劣。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程 序指令相关的硬件来完成, 前述的程序可以存储于计算机可读取存储介质中, 该程序在 执行时, 执行包括上述方法实施例的步骤; 而前述的存储介质包括: ROM、 RAM, 磁 碟或者光盘等各种可以存储程序代码的介质。 最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对其限制; 尽管 参照前述实施例对本发明进行了详细的说明, 本领域的普通技术人员应当理解: 其依然 可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替 换; 而这些修改或者替换, 并不使相应技术方案的本质脱离本发明各实施例技术方案的 精神和范围。
Claims
1、 一种 IPv4网络中传输 IPv6报文的方法, 其特征在于, 包括:
IPv6终端获取本终端的 IPv6地址, 所述 IPv6地址中包含 IPv4地址, 所述 IPv4地 址为网关的 IPv4地址或者为所述网关指定的 IPv4地址, 所述网关为连接 IPv6网络与 IPv4网络的设备, 或者为连接 2层网络与 IPv4网络的设备, 连接到所述网关上的 IPv6 终端为多个, 且所有连接到所述网关上的 IPv6终端的 IPv6地址都包含相同的所述 IPv4 地址; 所述 IPv6终端将所述 IPv6地址作为源地址包含在 IPv6报文中发送给所述网关。
2、根据权利要求 1所述的方法,其特征在于,所述网关的 IPv4地址为压缩后的 IPv4 地址。
3、 根据权利要求 1或 2所述的方法, 其特征在于, 所述 IPv6地址中还包含用于指 示所述 IPv6地址中包含 IPv4地址的特定字段值。
4、 一种 IPv4网络中传输 IPv6报文的方法, 其特征在于, 包括:
第一网关接收 IPv6终端发送的 IPv6报文, 所述 IPv6报文中包含目的 IPv6地址; 如果所述目的 IPv6地址中包含了 IPv4地址,所述第一网关将所述 IPv6报文封装在 目的地址为所述 IPv4地址的 IPv4报文中,并将所述 IPv4报文发送给第二网关,所述目 的 IPv6地址中包含的 IPv4地址为所述第二网关的 IPv4地址或者为所述第二网关指定的 IPv4地址, 所述第二网关为连接 IPv6网络与 IPv4网络的设备, 或者为连接 2层网络与 IPv4网络的设备, 且所有连接到第二网关上的 IPv6终端的 IPv6地址都包含相同的所述 IPv4地址。
5、根据权利要求 4所述的方法,其特征在于,所述 IPv4地址为压缩后的 IPv4地址, 所述第一网关将所述 IPv6报文封装在目的地址为所述 IPv4地址的 IPv4报文中,具体包 括- 所述第一网关恢复所述压缩后的 IPv4地址, 将所述 IPv6报文封装在目的地址为所 述恢复后的 IPv4地址的 IPv4报文中。
6、 根据权利要求 4或 5所述的方法, 其特征在于, 还包括:
所述第一网关根据所述目的 IPv6地址中包含的用于指示所述目的 IPv6地址中包含 了 IPv4地址的特定字段值确定所述目的 IPv6地址中包含 IPv4地址。
7、 根据权利要求 4所述的方法, 其特征在于, 还包括: 如果所述目的 IPv6地址中不包含 IPv4地址,所述第一网关将所述 IPv6报文封装在 IPv4报文中, 所述 IPv4报文的目的 IPv4地址为特定网关的 IPv4地址。
8、 根据权利要求 4-7任一项所述的方法, 其特征在于, 还包括:
所述第一网关将所述 IPv4报文的报文头中的协议类型设置为特定值, 以标识所述 IPv4报文中封装有 IPv6报文。
9、 一种终端, 其特征在于, 包括: 获取模块,用于获取本终端的 IPv6地址,所述 IPv6地址中包含 IPv4地址,所述 IPv4 地址为网关的 IPv4地址或者为所述网关指定的 IPv4地址,所述网关为连接 IPv6网络与 IPv4网络的设备, 或者为连接 2层网络与 IPv4网络的设备, 连接到所述网关上的 IPv6 终端为多个, 且所有连接到所述网关上的 IPv6终端的 IPv6地址都包含相同的所述 IPv4 地址;
发送模块, 用于将所述 IPv6地址作为源地址包含在 IPv6报文中发送给所述网关。
10、 根据权利要求 9所述的方法, 其特征在于, 所述网关的 IPv4地址为压缩后的 IPv4地址。
11、 根据权利要求 9或 10所述的终端, 其特征在于, 所述获取模块获取的 IPv6地 址中还包含用于指示所述 IPv6地址中包含 IPv4地址的特定字段值。
12、 一种网关, 其特征在于, 包括:
接收模块, 用于接收 IPv6终端发送的 IPv6报文, 所述 IPv6报文中包含目的 IPv6 地址;
第一封装模块,用于如果所述目的 IPv6地址中包含了 IPv4地址,将所述 IPv6报文 封装在目的地址为所述 IPv4地址的 IPv4报文中, 并将所述 IPv4报文发送给第二网关, 所述目的 IPv6地址中包含的 IPv4地址为所述第二网关的 IPv4地址或者为所述第二网关 指定的 IPv4地址,所述第二网关为连接 IPv6网络与 IPv4网络的设备,或者为连接 2层 网络与 IPv4网络的设备,且所有连接到第二网关上的 IPv6终端的 IPv6地址都包含相同 的所述 IPv4地址。
13、 根据权利要求 12所述的网关, 其特征在于, 第一封装模块, 具体用于如果所 述目的 IPv6地址中包含了 IPv4地址, 并且所述接收模块接收的 IPv6报文中的 IPv4地 址为压缩后的 IPv4地址,恢复所述压缩后的 IPv4地址,将所述 IPv6报文封装在目的地 址为所述恢复后的 IPv4地址的 HV4报文中。
14、 根据权利要求 12或 13所述的网关, 其特征在于, 还包括- 确定模块, 用于根据所述目的 IPv6地址中包含的用于指示所述目的 IPv6地址中包 含了 IPv4地址的特定字段值确定所述目的 IPv6地址中包含 IPv4地址。
15、 根据权利要求 12所述的网关, 其特征在于, 还包括- 第二封装模块,用于如果所述目的 IPv6地址中不包含 IPv4地址,将所述 IPv6报文 封装在 IPv4报文中, 所述 IPv4报文的目的 IPv4地址为特定网关的 IPv4地址。
16、 根据权利要求 12-15中任意一项所述的网关, 其特征在于, 所述第一封装模块 还用于将所述 IPv4报文的报文头中的协议类型设置为特定值, 以标识所述 IPv4报文中 封装有 IPv6报文。
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| EP11777255A EP2533478A4 (en) | 2010-10-09 | 2011-05-28 | METHOD, DEVICE AND GATEWAY FOR TRANSFERRING INTERNET PROTOCOL PACKAGES OF VERSION 6 IN AN INTERNET PROTOCOL NETWORK OF VERSION 4 |
| US13/708,716 US20130097336A1 (en) | 2010-10-09 | 2012-12-07 | Method, terminal and gateway for transmitting ipv6 packet in ipv4 network |
Applications Claiming Priority (4)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201010508123 | 2010-10-09 | ||
| CN201010508123.8 | 2010-10-09 | ||
| CN201010547912.2 | 2010-11-17 | ||
| CN2010105479122A CN102447617A (zh) | 2010-10-09 | 2010-11-17 | IPv4网络中传输IPv6报文的方法、终端及网关 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US13/708,716 Continuation US20130097336A1 (en) | 2010-10-09 | 2012-12-07 | Method, terminal and gateway for transmitting ipv6 packet in ipv4 network |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2011137836A1 true WO2011137836A1 (zh) | 2011-11-10 |
Family
ID=44903616
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2011/074823 Ceased WO2011137836A1 (zh) | 2010-10-09 | 2011-05-28 | IPv4网络中传输IPv6报文的方法、终端及网关 |
Country Status (4)
| Country | Link |
|---|---|
| US (1) | US20130097336A1 (zh) |
| EP (1) | EP2533478A4 (zh) |
| CN (1) | CN102447617A (zh) |
| WO (1) | WO2011137836A1 (zh) |
Families Citing this family (14)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103457856B (zh) * | 2012-06-05 | 2018-01-23 | 华为技术有限公司 | 报文处理方法、系统及路由设备 |
| TWI493948B (zh) * | 2012-08-22 | 2015-07-21 | 鴻海精密工業股份有限公司 | 減少網路位址表頭的系統、裝置及方法 |
| JP5907239B2 (ja) | 2014-01-31 | 2016-04-26 | 株式会社バッファロー | ネットワーク中継装置、ネットワーク中継装置が有するパケット中継処理部の動作モードを設定する方法、およびコンピュータープログラム |
| JP5967173B2 (ja) * | 2014-01-31 | 2016-08-10 | 株式会社バッファロー | ネットワーク中継装置、ネットワーク中継装置が有するパケット中継処理部の動作モードを設定する方法、およびコンピュータープログラム |
| US10798000B2 (en) * | 2014-12-22 | 2020-10-06 | Arista Networks, Inc. | Method and apparatus of compressing network forwarding entry information |
| US9680749B2 (en) | 2015-02-27 | 2017-06-13 | Arista Networks, Inc. | System and method of using an exact match table and longest prefix match table as a combined longest prefix match |
| US10015093B2 (en) | 2015-05-05 | 2018-07-03 | Dell Products L.P. | Communication transmission system for communication protocol failures |
| CN109120740B (zh) * | 2018-08-24 | 2021-05-07 | 赛尔网络有限公司 | 生成IPv6地址的服务器、系统及方法 |
| CN112787923B (zh) * | 2019-11-07 | 2024-06-21 | 华为技术有限公司 | 一种报文的处理方法,装置和系统 |
| CN110839046B (zh) * | 2019-12-03 | 2022-04-22 | 睿哲科技股份有限公司 | 多协议的互通方法和系统 |
| CN113746944B (zh) * | 2020-05-29 | 2024-05-14 | 台众计算机股份有限公司 | IPv6网点管理方法及设备 |
| CN115277274A (zh) * | 2021-04-30 | 2022-11-01 | 北京华为数字技术有限公司 | 一种建立PPPoE会话的方法、装置、系统、设备 |
| US12309114B2 (en) * | 2022-07-21 | 2025-05-20 | Tailscale Inc. | Management of communications for overlapping subnets using IPv6 addressing |
| CN116016428B (zh) * | 2022-12-21 | 2024-11-29 | 天翼安全科技有限公司 | 一种网站的IPv6升级检测方法、装置及系统 |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1711739A (zh) * | 2002-11-13 | 2005-12-21 | 汤姆森许可贸易公司 | 支持穿过网络地址转换机制的 6to4遂道协议的方法和设备 |
| CN1965515A (zh) * | 2004-06-25 | 2007-05-16 | 思科技术公司 | 用于使IPv4私有网络中的节点经由IPv6接入网络到达IPv4公共网络节点的布置 |
| WO2010004180A1 (fr) * | 2008-06-30 | 2010-01-14 | France Telecom | Procede de reception d'un paquet de donnees dans un domaine ipv6, dispositif et passerelle residentielle associes |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060083262A1 (en) * | 2004-10-14 | 2006-04-20 | Utstarcom, Inc. | Method and apparatus to facilitate use of a pool of internet protocol 6to4 address prefixes |
-
2010
- 2010-11-17 CN CN2010105479122A patent/CN102447617A/zh active Pending
-
2011
- 2011-05-28 EP EP11777255A patent/EP2533478A4/en not_active Withdrawn
- 2011-05-28 WO PCT/CN2011/074823 patent/WO2011137836A1/zh not_active Ceased
-
2012
- 2012-12-07 US US13/708,716 patent/US20130097336A1/en not_active Abandoned
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1711739A (zh) * | 2002-11-13 | 2005-12-21 | 汤姆森许可贸易公司 | 支持穿过网络地址转换机制的 6to4遂道协议的方法和设备 |
| CN1965515A (zh) * | 2004-06-25 | 2007-05-16 | 思科技术公司 | 用于使IPv4私有网络中的节点经由IPv6接入网络到达IPv4公共网络节点的布置 |
| WO2010004180A1 (fr) * | 2008-06-30 | 2010-01-14 | France Telecom | Procede de reception d'un paquet de donnees dans un domaine ipv6, dispositif et passerelle residentielle associes |
Non-Patent Citations (2)
| Title |
|---|
| B. CARPENTER.: "Connection of IPv6 Domains via IPv4 Clouds.", RFC 3056., February 2001 (2001-02-01) * |
| See also references of EP2533478A4 * |
Also Published As
| Publication number | Publication date |
|---|---|
| EP2533478A4 (en) | 2013-02-20 |
| US20130097336A1 (en) | 2013-04-18 |
| CN102447617A (zh) | 2012-05-09 |
| EP2533478A1 (en) | 2012-12-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN102447617A (zh) | IPv4网络中传输IPv6报文的方法、终端及网关 | |
| CN103534993B (zh) | 连接低功率网络域的标签交换路由选择方法和装置 | |
| US8665887B2 (en) | Number automatic routing method, updating method, withdrawing method, router and device | |
| US9578548B2 (en) | System and method for configuring multiple IP connections | |
| CN102318284B (zh) | 通过用于ipv6的动态主机配置协议(dhcpv6)扩展配置具有多个接口的主机的装置和方法 | |
| CN102904814B (zh) | 数据传输方法、源pe、目的pe和数据传输系统 | |
| WO2021000827A1 (zh) | 数据传输链路建立方法、装置以及计算机可读存储介质 | |
| CN101426004A (zh) | 三层会话的接入方法、系统及设备 | |
| WO2015003391A1 (zh) | Gre隧道实现方法、接入设备和汇聚网关 | |
| EP2227883A1 (en) | Setting up a virtual private network | |
| WO2011137842A1 (zh) | 一种基于cgn实体的数据传输方法、cgn实体、网关及系统 | |
| WO2012119390A1 (zh) | 虚拟机迁移通知方法和系统 | |
| CN102546362A (zh) | 报文处理方法、系统和用户前端设备 | |
| WO2014056412A1 (zh) | 一种报文发送的方法、路由器桥及系统 | |
| US8295289B2 (en) | Method and system for simultaneous local and EPC connectivity | |
| CN102868613A (zh) | 一种通用路由封装隧道报文发送方法和装置 | |
| CN105553810A (zh) | 一种转发专线业务报文的方法及装置 | |
| CN101499951A (zh) | 隧道配置方法、虚拟接入节点、虚拟边缘节点以及系统 | |
| WO2012136006A1 (zh) | 多归属站点内主机的路由选择方法和装置 | |
| WO2015003348A1 (zh) | Gre隧道实现方法、接入点和网关 | |
| CN101534210B (zh) | 一种设置组播ip报文优先级的方法和设备 | |
| WO2011103761A1 (zh) | 数据报文传输方法及接入设备 | |
| CN101547137A (zh) | 数据发送的方法、装置及通信设备 | |
| WO2014063606A1 (zh) | 报文转发的方法和相应设备 | |
| CN102186168B (zh) | 专用网接入方法、装置和系统 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 11777255 Country of ref document: EP Kind code of ref document: A1 |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 2011777255 Country of ref document: EP |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |