Network Packet Conversion Method
Through hardware table field design and ASIC, packet conversion of IPv4 to IPv6 network is realized, which solves the problem of high computing resources consumed in the existing technology and realizes efficient hardware accelerated conversion.
Patent Information
- Application Number
- CN202111201183.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-15
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2041-10-15
AI Technical Summary
The existing IPv4 to IPv6 network conversion technology mainly relies on software processing, which leads to high cost of computing resources and is difficult to accelerate hardware through circuit lookup tables.
It adopts hardware table field design, including content lookup table, control lookup table and forwarding mapping rule table, and realizes packet conversion between IPv4 and IPv6 networks through specific application integrated circuits (ASICs). It supports MAP-T and MAP-E methods, and directly performs hardware acceleration.
It improves the efficiency of IPv4 to IPv6 network conversion, reduces the consumption of computing resources, and realizes hardware acceleration of packet conversion.
Smart Images

Figure CN115996211B_ABST
Abstract
Description
Technical Field
[0001] The present application discloses a method for converting packets between networks, in particular a network packet conversion method that uses a lookup table in a circuit to perform packet conversion. Background Art
[0002] The current network address (IP: Internet Protocol) format of IPv4 (Internet Protocol Version 4) uses a 32-bit length. The number of network addresses that can be provided is 2 to the 32nd power. After distribution, it is no longer sufficient. Therefore, the IPv6 protocol (Internet Protocol Version 6) has been developed. The network address format of IPv6 uses a 128-bit length, and the number of addresses it can provide far exceeds that of IPv4. As the IPv6 protocol gradually becomes popular, the network world has entered an era of coexistence of IPv4 and IPv6. Therefore, the demand for network packets to be transmitted between IPv4 and IPv6 networks is also increasing.
[0003] According to the current solution, the conversion method from IPv4 to IPv6 network can be through translation or tunnel methods. Two technologies have been developed in the prior art, including a method for mapping addresses and ports using translation (mapping of address and port using translation (MAP-T) RFC 7599) and a method for mapping addresses and ports with encapsulation (mapping of address and port with encapsulation (MAP-E) RFC 7597). These two emerging technologies are the ways to convert IPv4 network to IPv6 network. Among them, MAP-T directly translates the original IPv4 header into an IPv6 header, and MAP-E uses an IPv6 tunnel to traverse the IPv6 network.
[0004] However, whether it is MAP-T or MAP-E, generally it is achieved through software, so a large amount of computing resources will be consumed during operation, and high-performance hardware cooperation is required. Summary of the Invention
[0005] The present application proposes a network packet conversion method and system, in which the design and setting of table fields are applied to achieve the purpose of converting IPv4 network packets to IPv6 network (upstream) or converting IPv6 network packets to IPv4 network (downstream). It is applicable to the method for mapping addresses and ports using translation (MAP-T) and the method for mapping addresses and ports with encapsulation (MAP-E), and can be implemented through a circuit system, such as directly processed by a specific application integrated circuit (ASIC), to provide an accelerated processing solution.
[0006] The proposed circuit system can be applied to network devices, where the firmware is designed with hardware table fields to implement the conversion of packets under Internet Protocol Version 4 (IPv4 packets) to packets under Internet Protocol Version 6 (IPv6 packets). According to the embodiments of the network packet conversion method executed therein, in this upstream process, several lookup tables are first determined, such as the content lookup table, the control lookup table, and the forwarding mapping rule table. Thus, the length field of the IPv6 packet header recorded in the content lookup table can be inserted into the IPv4 packet header prefix. The length field of the IPv6 packet header recorded in the control lookup table can be used to update the length field of the IPv6 packet header inserted into the IPv4 packet header prefix. Then, whether to specify the forwarding mapping rule table is used to determine the destination host network address in the IPv6 packet. After that, the part of the IPv4 packet that composes the destination host network address in the IPv6 packet is updated, and the conversion of the IPv4 packet to the IPv6 packet is completed.
[0007] Preferably, in the method, according to the requirements of IPv4 packet routing, it is determined that the output interface uses a method of encapsulation to map addresses and ports (MAP-E) or a method of translation to map addresses and ports (MAP-T).
[0008] Preferably, the content lookup table stores the converted IPv6 packet headers inserted using the method of translation to map addresses and ports and the method of encapsulation to map addresses and ports; the control lookup table is used to determine the field control that needs to be updated after adding the IPv6 packet header; the forwarding mapping rule table is used to determine the conversion of the destination host network address of the upstream IPv6 packet, as well as the conversion of the source host network address and the destination host network address of the downstream IPv4 packet.
[0009] According to another embodiment of the proposed circuit system, it is possible to implement the conversion of packets under Internet Protocol Version 6 (IPv6 packets) to packets under Internet Protocol Version 4 (IPv4 packets) with the hardware table fields designed in the firmware. In the downstream network packet conversion method process, that is, according to the virtual local area network and a destination host network address recorded in the IPv6 packet header, it is determined to use a method of encapsulation to map addresses and ports (MAP-E) or a method of translation to map addresses and ports (MAP-T). Then, according to a control lookup table and the form of the IPv6 packet, the header to be converted to the IPv4 packet is determined, and the step of converting the IPv6 packet to the IPv4 packet is completed.
[0010] In the method of using encapsulation to map addresses and ports, according to the control lookup table associated with the method of using encapsulation to map addresses and ports, when the form of the IPv6 packet is a packet with an outer IPv6 network protocol and an inner IPv4 network protocol encapsulation, the header of the outer IPv6 network protocol is removed.
[0011] On the other hand, in the method of using translation to map addresses and ports, that is, according to the control lookup table associated with the method of using translation to map addresses and ports, when the IPv6 packet is in the form of a packet encapsulated by a single-layer IPv6 communication protocol, that is, the header in the IPv6 packet is taken out and an IPv4 header is inserted.
[0012] To enable a further understanding of the features and technical content of the present invention, please refer to the following detailed description and drawings of the present invention. However, the provided drawings are only for reference and illustration and are not used to limit the present invention. Description of the Drawings
[0013] Figure 1 Shows one of the packet format examples for converting an IPv4 to an IPv6 destination host network address;
[0014] Figure 2 Shows another example of the packet format for converting an IPv4 to an IPv6 destination host network address;
[0015] Figure 3 Shows an example of the conversion representation for converting an IPv4 to an IPv6 destination host network address according to the prefix length;
[0016] Figure 4 Shows the flow of the embodiment of the method for converting uplink and downlink network packets;
[0017] Figure 5 Shows an embodiment of the circuit system for executing the network packet conversion method;
[0018] Figure 6 Shows a flowchart of an embodiment of the network packet conversion method implemented by using the method of encapsulation to map addresses and ports (MAP-E) for uplink packets;
[0019] Figure 7 Shows a flowchart of an embodiment of the network packet conversion method implemented by using the method of translation to map addresses and ports (MAP-T) for uplink packets;
[0020] Figure 8 Shows a flowchart of an embodiment of the network packet conversion method implemented by using the method of encapsulation to map addresses and ports (MAP-E) for downlink packets;
[0021] Figure 9 Shows a flowchart of an embodiment of the network packet conversion method implemented by using the method of translation to map addresses and ports (MAP-T) for downlink packets.
[0022] Symbol Explanation:
[0023] 500: Circuit System
[0024] 50: Network device
[0025] 501: Local area network communication module
[0026] 502: Wide area network communication module
[0027] 511: IPv4 network
[0028] 512: IPv6 network
[0029] Up and down network packet conversion process of steps S401 - S413
[0030] Packet conversion process for uplink packets using MAP - E of steps S601 - S619
[0031] Packet conversion process for uplink packets using MAP - T of steps S701 - S719
[0032] Packet conversion process for downlink packets using MAP - E of steps S801 - S805
[0033] Packet conversion process for downlink packets using MAP - T of steps S901 - S913 Detailed implementation manners
[0034] The following are specific embodiments to illustrate the implementation manners of the present invention. Those skilled in the art can understand the advantages and effects of the present invention from the content disclosed in this specification. The present invention can be implemented or applied through other different specific embodiments, and various details in this specification can also be modified and changed based on different viewpoints and applications without departing from the concept of the present invention. Additionally, the drawings of the present invention are only for simple schematic illustration and are not drawn according to actual dimensions, hereby stated. The following implementation manners will further detail the relevant technical content of the present invention, but the disclosed content is not used to limit the protection scope of the present invention.
[0035] It should be understood that although terms such as "first", "second", "third", etc. may be used in this article to describe various components or signals, these components or signals should not be limited by these terms. These terms are mainly used to distinguish one component from another, or one signal from another. Additionally, the term "or" used in this article should, depending on the actual situation, possibly include any one or a combination of multiple of the associated listed items.
[0036] The two technologies of MAP-T and MAP-E, which are known to convert packets between IPv4 and IPv6 networks, both use software to parse and convert the packet format. In particular, the conversions performed by these two technologies must dynamically perform the conversion of the source host network address (SIP) and the destination host network address (DIP) following the transport layer (L4) communication port (such as TCP / UDP communication port). Therefore, it is difficult to simply perform hardware acceleration through circuit lookup table processing.
[0037] In order to improve the drawback that the known technologies for converting packets between IPv4 and IPv6 networks, such as the method of using translation to map addresses and ports (MAP-T) and the method of using encapsulation to map addresses and ports (MAP-E), require a large amount of computing resources, this application proposes a network packet conversion method and system. The technology mainly realizes the technology of mutual packet conversion (upstream and downstream) between IPv4 and IPv6 networks through the design and setting of table fields, covering the design and setting of table fields for both MAP-E and MAP-T methods, so that both upstream and downstream packets can be directly hardware-accelerated through circuit systems such as application-specific integrated circuits (ASIC).
[0038] In the network packet conversion method proposed in this application, hardware conversion rules are designed. An IPv6 packet header (header) after MAP-T / MAP-E insertion conversion is stored through a content lookup table, and the field control to be updated after adding the IPv6 packet header is determined through a control lookup table. Additionally, according to a forwarding mapping rule table (FMR table), the conversion of the destination host network address (DIP) of the MAP-E / MAP-T upstream (IPv4 to IPv6) IPv6 packet, and the conversion of the source host network address (SIP) and the destination host network address (DIP) of the MAP-T downstream (IPv6 to IPv4) IPv4 packet are determined.
[0039] The network packet conversion method specifically supports the known packet formats of MAP-E / MAP-T. The technical concept mainly includes the establishment of a content lookup table, a control lookup table, and a forwarding mapping rule table, as well as the logical design for automatic update of the required fields of the packet.
[0040] Define several lookup tables used in the network packet conversion method below. The content table recorded in the circuit system is related to MAP-T / MAP-E for the interface. The interface is a combination of network address (IP address) and communication port related information, which can be used to determine the MAP-E / MAP-T conversion method adopted. For example, taking the IPv4 packet as an example for the content of the interface, the content recorded in the following IPv4 header is also the interface information used to query the relevance and determine whether to adopt MAP-T or MAP-E:
[0041] L3 Destination IP: 10.10.10.10 = 0x0a0a0a0a
[0042] L3 Source IP: 11.11.11.11 = 0x0b0b0b0b
[0043] L4 Destination Port: 0x1234
[0044] L4 Source Port: 0x5678
[0045] The content lookup table is used to store the basic IPv6 format. If translation or encapsulation is to be performed and the mapped address and port (MAP-T / MAP-E) are inserted into the converted IPv6 packet header, it can be used as the basis for modifying the control table. The content lookup table includes a 40-byte IPv6 packet header. An example of the content lookup table is: Destination IP: 0000:0001:0002:0003:0004:0005:0006:0007:0008.
[0046] The control table is also related to the interface (a combination of network address and communication port and other related information), and is used to determine the field control that needs to be updated after adding the IPv6 packet header, and set the behavior executed after adding the header of the content lookup table to the packet. An example of the control table is as follows.
[0047] An example of the control lookup table for MAP-E:
[0048] control.len = 40
[0049] control.format = MAP-E type
[0050] control.ipv6_len_diff = 0
[0051] Example of control lookup for MAP-T:
[0052] control.len = 40
[0053] control.format = MAP-T type
[0054] control.ipv6_len_diff = 0
[0055] contorl.mapt_l4_sum_recalculate = 1
[0056] control.mapt_prefix_len = 64
[0057] Fields defined in the control lookup table include:
[0058] Format: Records whether the entry of the incoming packet is in MAP-T format (MAP-T type format) or MAP-E format (MAP-E type format).
[0059] Length (len): Records the length of the IPv6 header in the content lookup table.
[0060] IPv6 length difference (ipv6_len_diff): Records the length of the inserted IPv6 header, used to update the above IPv6 header length field.
[0061] MAP-T prefix length (mapt_prefix_len): Records the length of the MAP-T (method of using translation to map addresses and ports) prefix.
[0062] MAP-T draft version (mapt_draft_ver): Records whether the IPv6 source host network address (ipv6.sip) of the MAP-T's own version uses the draft version of the Request for Comments (RFC).
[0063] MAP-T recalculate the fourth layer checksum (mapt_l4_sum_recalculate): Indicates that MAP-T recalculates the fourth layer (L4) checksum, and the checksum needs to be recalculated using the pseudo IP in the inserted IPv6 header.
[0064] The Forwarding Mapping Rule table (FMR table) is used to determine the conversion of the MAP-E / MAP-T uplink IPv6 destination host network address (DIP) and the conversion of the MAP-T downlink IPv4 source host network address (SIP) and destination host network address (DIP). An example of the forwarding mapping rule table is as follows:
[0065] FMR.ipv6_address_prefix64 = 0123:4567:89ab:cdef
[0066] FMR.PSID_refill = 1
[0067] FMR.PSID_start_offset = 2
[0068] FMR.PSDI_end_offset = 9
[0069] FMR.draft_ver = 0
[0070] The fields defined in the forwarding mapping rule table include:
[0071] IPv6 packet prefix address (ipv6_address_prefix64): It contains the IPv6 prefix rule (rule-ipv6-prefix) and the identifier (EA-bits) for marking users, with a total of 64 bits. The EA-bits consist of the IPv4 subnet identifier and the port set identifier (PSID), and are used to uniquely mark different users.
[0072] Port set identifier start offset (PSID_start_offset): Records the starting position of the port set identifier (PSID) in the 16 bits of the fourth-layer transport protocol destination port (L4 Dport).
[0073] Port set identifier end offset (PSID_end_offset): Records the ending position of the port set identifier in the 16 bits of the fourth-layer transport protocol destination port.
[0074] Port set identifier refill (PSID_refill): Records whether to dynamically modify the port set identifier field in the IPv6 destination host network address (DIP) in the packet.
[0075] End user IPv6 prefix (end_user_ipv6_prefix): Records the length of the Ipv6 prefix bits and the identifier (EA-bits) for marking users.
[0076] Draft version (draft_ver): Records the version indicating whether the remote version uses a Request for Comments (RFC) draft.
[0077] The above port setting identifier can be retrieved from the start and end positions of the Layer 4 transport protocol destination port (L4 Dport) according to the port setting identifier start offset (PSID_start_offset) and the port setting identifier end offset (PSID_end_offset). If the port setting identifier length (PSID length) is 0, the re-filled port setting identifier (PSID_refill) is set to 0.
[0078] For example, when the draft version (draft_ver) is 1 (draft_ver = 1), the composition of the IPv6 destination host network address (DIP) is as Figure 1 shown, where the prefix records the IPv6 address, v4(32) represents the IPv4 destination host network address, and PSID records the port setting identifier. Figure 1 This shows an example of the packet format for converting from IPv4 to the IPv6 destination host network address.
[0079] When the draft version (draft_ver) is 0 (draft_ver = 0), the composition of the IPv6 destination host network address (DIP) is as shown in another example of the packet format Figure 2 as shown.
[0080] If the forwarding mapping rule table (FMRtable) is not specified in the method of translating to map addresses and ports (MAP-T), the conversion is defined in the format of the default mapping rule (DMR). The IPv6 packet format will then be converted according to the different MAP-T prefix lengths (mapt_prefix_len) in the control lookup table. As Figure 3 shown in the example of the conversion from IPv4 to the IPv6 destination host network address according to the prefix length, which records the prefix, suffix, and the network address under the fourth-generation communication protocol. This allows the network packet conversion method to use this default mapping rule to convert IPv4 network packets to the IPv6 network when the forwarding mapping rule table is not specified.
[0081] Figure 4 Shows the implementation example process of the uplink and downlink network packet conversion method, that is, the circuit system performs packet conversion between the IPv4 and IPv6 network protocols (step S401), which includes the uplink process of converting IPv4 network packets to IPv6 network packets and the downlink process of converting IPv6 network packets to IPv4 network packets.
[0082] In the upstream process, the content lookup table, control lookup table, and forwarding mapping rule table can be determined first. According to the content recorded in the content lookup table, for an IPv4 packet, the length field of the IPv6 header is inserted into the IPv4 header prefix (step S403). Then, according to the control lookup table, the length field of the IPv6 header is inserted to update the length field of the IPv6 header inserted into the IPv4 header prefix (step S405). Next, the destination host network address in the IPv6 packet can be determined according to whether the forwarding mapping rule table is specified (step S407). After that, the part of the IPv4 packet in the destination host network address field of the IPv6 packet is updated (step S409), that is, the step of converting to an IPv6 packet is completed. The relevant embodiment process can be referred to Figure 6 and Figure 7 .
[0083] In the downstream process, according to the information in the data stream to be processed, such as the virtual local area network (VLAN) and the destination host network address (DIP) recorded in the IPv6 header, it is determined to adopt the method of using encapsulation to map addresses and ports (MAP-E) or the method of using translation to map addresses and ports (MAP-T) (step S411). Then, according to the control lookup table and the IPv6 packet format, the header of the IPv4 packet to be converted is determined (step S413), that is, the step of converting the IPv6 packet to an IPv4 packet is completed. The embodiment process shown in Figure 8 and Figure 9 can be referred to.
[0084] Figure 5 A circuit system for executing the method is shown. The icon circuit system 500 is, for example, a packet processing circuit provided in the network device 50, such as a circuit system implemented by an application-specific integrated circuit (ASIC). The firmware is designed with MAP-E / MAP-T hardware table fields, such as the content lookup table, control lookup table, and forwarding mapping rule table described in the above embodiments, so as to implement the packet conversion of the upstream (which can be defined as the conversion from the IPv4 network 511 to the IPv6 network 512) and downstream (which can be defined as the conversion from the IPv6 network 512 to the IPv4 network 511) of the packet, and can be directly processed and accelerated by the hardware circuit system.
[0085] When the commonly used IPv4 network 511 is switched to the IPv6 network 512, according to an embodiment, the IPv4 network 511 can operate in a local area network (LAN), and the IPv6 network 512 can be applied in a wide area network (WAN). A circuit system 500, such as a router, performs packet routing. It is provided with a LAN communication module 501 that connects to the IPv4 network 511 (including computer hosts, servers, and network devices therein) to process LAN packets; and a WAN communication module 502 that connects to the IPv6 network 512 (including computer hosts, servers, and network devices therein) to process WAN packets.
[0086] Based on the above-mentioned embodiment processes, circuit systems, and field definitions in various lookup tables, the following lists embodiments of implementing the IPv6 / IPv4 uplink and downlink packet conversion processes using the MAP-E and MAP-T methods, and reference can be made to the Figure 1 、 Figure 2 and Figure 3 listed header implementation examples.
[0087] [Embodiment of the MAP-E for the Uplink Process]
[0088] According to the network packet conversion mechanism proposed above, continue to refer to Figure 6 the embodiment process of the network packet conversion method for uplink packets (referring to the conversion of packets under the IPv4 network protocol to packets under the IPv6 network protocol) implemented by using the method of encapsulation to map addresses and ports (MAP-E). The process is preferably executed by a circuit system such as an ASIC.
[0089] At the beginning, as in step S601, according to the original IPv4 packet routing, it is determined that the output interface will use the method of encapsulation to map addresses and ports (MAP-E). According to the requirements of the IPv4 packet routing, the data stream of this network packet is specified to be associated with the content lookup table, control lookup table, and forwarding mapping rule table (FMR table). Then, as in step S603, the IPv6 header length field recorded in the content lookup table is inserted into the IPv4 header prefix.
[0090] In step S605, the IPv6 header length field (header.len) is inserted according to the control lookup table to update the IPv6 header length field inserted into the IPv4 header prefix (which can be expressed as ipv6.len = control.ipv6_len_diff + ipv4.len). In the process implemented by MAP-E here, the forwarding mapping rule table (FMR table) is specified as an optional item. In step S607, it is judged whether the forwarding mapping rule table is specified. If not specified (No), as in step S609, it means that there is no need to modify the destination host network address (DIP) in the header; on the contrary, if the forwarding mapping rule table is specified (Yes), then step S611 is performed, and the destination host network address in the IPv6 packet prefix field to be converted is updated according to the IPv6 packet prefix address (ipv6_address_prefix64) recorded in the specified forwarding mapping rule table.
[0091] In the subsequent step S613, it is judged whether the port setting identifier refill (PSID_refill) in the forwarding mapping rule table is 0. If it is 0 (Yes), it means that the port setting identifier length (PSID length) is 0. As in step S615, that is, there is no need to dynamically modify the port setting identifier field in the destination host network address (DIP) in the IPv6 packet; on the contrary, if the port setting identifier refill in the forwarding mapping rule table is not 0, then step S617 is executed, and the port setting identifier is dynamically modified in the port setting identifier field of the destination host network address in the IPv6 packet according to the port setting identifier obtained from the two field information of the port setting identifier start offset (PSID_start_offset) and the port setting identifier end offset (PSID_end_offset) in the forwarding mapping rule table. The position of the port setting identifier is different according to the value of the draft version (draft_ver) in the forwarding mapping rule table. Refer to Figure 1 (draft_ver = 1) and Figure 2 (draft_ver = 0) as shown.
[0092] Finally, regardless of whether the port setting identifier field in the destination host network address in the IPv6 packet is modified, in step S619, the part of the IPv4 packet that makes up the destination host network address in the IPv6 packet is further updated, that is, the conversion of the IPv4 to IPv6 uplink packet is completed.
[0093] [MAP-T Embodiment of Uplink Process]
[0094] Figure 7 Describe an example process of a network packet conversion method for uplink packets (referring to the conversion of IPv4 network packets to IPv6 networks) implemented using the method of translating and mapping addresses and ports (MAP-T).
[0095] At the beginning, as in step S701, according to the original IPv4 packet routing, determine that the output interface is to use the method of translation to map addresses and ports (MAP-T), and at the same time specify the associated content lookup table, control lookup table, and forwarding mapping rule table (FMR table) for this packet data stream. Then, as in step S703, insert the IPv6 header length recorded in the content lookup table into the IPv4 header prefix. Again, as in step S705, update the IPv6 header length field according to the length field of the inserted IPv6 header recorded in the control lookup table.
[0096] Similarly, the forwarding mapping rule table in this example is also an optional item. In step S707, it is judged whether to specify the forwarding mapping rule table. If the forwarding mapping rule table is not specified, as in step S709, modify the destination host network address in the IPv6 packet according to the MAP-T prefix length (mapt_prefix_len) field of the control lookup table in the default mapping rule table (DMR table) and the destination host network address in the IPv4 packet. Different from the MAP-T prefix length field in the above control lookup table, this step is due to the different positions of the modification of the destination host network address for IPv6.
[0097] On the contrary, if the forwarding mapping rule table is specified, as in step S711, update the prefix of the destination host network address in the IPv6 packet according to the IPv6 packet prefix address (ipv6_address_prefix64) field in the forwarding mapping rule table. In the subsequent step (step S713), it will also be judged whether to dynamically modify the port setting identifier field in the destination host network address in the IPv6 packet according to whether the port setting identifier refill (PSID_refill) in the mapping rule table is 0. For reference, Figure 7 Steps S713 to S717 are not elaborated here. Finally, similarly, regardless of whether to modify the port setting identifier field in the destination host network address in the IPv6 packet, further complete the part of the IPv4 packet that updates the destination host network address in the IPv6 packet in step S715, and in step S717, determine whether to update (or not update) the checksum of the fourth-layer transport protocol (L4) according to the MAP-T recalculate fourth-layer checksum (mapt_l4_sum_recalculate) field in the control lookup table. Finally, as in step S719, remove the original IPv4 header part, and the conversion of the IPv4 to IPv6 uplink packet is completed.
[0098] [MAP-E Embodiment of the Downlink Process]
[0099] Another embodiment is as follows Figure 8 and Figure 9 the conversion process for the downlink packet (referring to the conversion of a packet under the IPv6 network protocol to a packet under the IPv4 network protocol) described in the embodiment. Among them Figure 8 it describes an embodiment process of a network packet conversion method for downlink packets using the method of mapping addresses and ports by encapsulation (MAP-E).
[0100] In this example, according to the virtual local area network (vlan) and the destination host network address (DIP) recorded in the IPv6 header, the method of mapping addresses and ports by encapsulation (MAP-E) is determined (step S801). At this time, according to the control lookup table associated with MAP-E, in the MAP-E packet processing method, when the IPv6 packet form is to encapsulate one packet into another packet (IPinIP), in this example, it refers to a packet with an outer layer of the IPv6 network protocol and an inner layer of the IPv4 network protocol encapsulated. Then, the header of the outer layer IPv6 of this packet is removed (step S803), that is, the IPv6 packet is converted into an IPv4 packet, and a transfer step is performed on the IPv4 for which the IPv6 header has been removed (step S805).
[0101] [Example of MAP-T for Downlink Process]
[0102] Figure 9 It describes an embodiment process of a network packet conversion method for downlink packets using the method of mapping addresses and ports by translation (MAP-T).
[0103] Examples of the DIP of IPv6, the adopted DMR and FMR, and the control lookup table in this example are as follows:
[0104] -IPv6 Destination Address:
[0105] 0123:4567:89ab:cdef:0000:0b0b:0b0b:009e
[0106] DMR
[0107] -IPv6 Source Address: 0000:0001:0002:0003:000a:0a0a:0a06:0007
[0108] FMR
[0109] -IPv6 Source Address: 0123:4567:89ab:cdef:0004:0a0a:0a0a:008d
[0110] Control lookup table:
[0111] control.mapt_prefix_len = 64
[0112] control_mapt_draft_ver = 0
[0113] Transmission mapping rule table:
[0114] FMR[0]:
[0115] Ipv6_address_prefix64: 0123:4567:89ab:cdef
[0116] end_user_ipv6_prefix: 64
[0117] draft_ver = 0
[0118] FMR[1]:
[0119] Ipv6_address_prefix64: 0123:4567:89ab:cdef
[0120] end_user_ipv6_prefix: 32
[0121] draf_ver = 1
[0122] Based on the virtual local area network (VLAN) and the destination host network address (DIP) in the IPv6 packet header encapsulated by the IPv6 network protocol in the network packet, determine the method of using translation to map addresses and ports (MAP-T) to perform the conversion of IPv6 packets to IPv4 packets (step S901). At this time, according to the control lookup table associated with MAP-T, in the MAP-T packet processing method, when the IPv6 packet form is a packet encapsulated by a single-layer IPv6 network protocol, remove (pop) the IPv6 packet header in the packet and insert (insert) the IPv4 packet header (step S903). It should be noted here that in the downstream data flow processing process of converting IPv6 packets to IPv4 packets, the source host network address (SIP) and destination host network address (DIP) in the IPv4 header must be inserted according to the following rules.
[0123] The processing of the source host network address (SIP) is as follows. When converting to the IPv4 network protocol, the source host network address (SIP) needs to be inserted into the packet header. The source host network address of the original IPv6 packet is compared with all the records in the forwarding mapping rule table (FMR table), such as the IPv6 packet prefix address (ipv6_address_prefix64) and the end-user IPv6 prefix (end_user_ipv6_prefix) recorded in the forwarding mapping rule table, to perform the longest prefix match (step S905). It should be noted here that the longest prefix match is an algorithm for route selection in a router, that is, to select the path in the routing table that matches the most entries in the destination address header prefix.
[0124] This is to determine whether the process has a successful match (step S907). If there is a match (yes), then refer to this forwarding mapping rule table and obtain the source host network address of the IPv4 packet according to the draft version (draft_ver) therein (step S909). Refer to Figure 1 and Figure 2 for the packet header example.
[0125] Conversely, if there is no successful match (no), it means that the default mapping rule table (DMR table) needs to be used to convert the source host network address of the IPv4 packet (step S911), that is, use the MAP-T prefix length (mapt_prefix_len) in the control lookup table to obtain the source host network address of the IPv4 packet according to the default mapping rule table description (such as Figure 3 example).
[0126] Take an example. If the source host network address is: 0123:4567:89ab:cdef:0004:0a0a:0a0a:008d, check the forwarding mapping rule table. Compare with FMR[0] in the above-listed table, and all 64 bits match. Compare with FMR[1], and all 32 bits also match, indicating that both FMR[0] and FMR[1] are found in the table. At this time, according to the longest prefix match principle, FMR[0] has more matching bits, so select FMR[0]. According to FMR[0].draft_ver = 0, refer to Figure 2 to obtain the source host network address of IPv4: SIP = 0x0a0a0a0a = 10.10.10.10.
[0127] In one example, if the source host network address is: 0000:0001:0002:0003:000a:0a0a:0a06:0007 (IPv6), when the forwarding mapping rule table is not successfully matched, the source host network address is converted back to IPv4 using the default mapping rule. According to Figure 3 , control.mapt_prefix_len = 64, it can be known that the converted source host network address of IPv4 is: 0x0a0a0a0a = 10.10.10.10.
[0128] Next is the processing for the destination host network address (DIP). In the process of down-converting to the IPv4 network, the composition of the IPv4 destination host network address in the destination host network address recorded in the original IPv6 packet header is identified according to the MAP-T draft version (mapt_draft_ver) in the control lookup table (step S913), that is, referring to Figure 1 and Figure 2 shown in the example. In this way, the step of converting the IPv6 packet to the IPv4 packet is completed.
[0129] Taking an example, the destination host network address is: 0123:4567:89ab:cdef:0000:0b0b:0b0b:009e. According to the MAP-T draft version (mapt_draft_ver = 0) in the control lookup table, referring to Figure 2 the example, the destination host network address of the IPv4 packet can be obtained: DIP = 0x0b0b0b0b = 11.11.11.11.
[0130] In summary, according to the uplink and downlink packet conversion processes of MAP-E / MAP-T described in the embodiments of the above network packet conversion method, the method can be implemented by circuitry or software, and preferably can be run in the firmware of an application-specific integrated circuit (ASIC) implemented by a single-chip system (SoC). Among them, the main design is a hardware table design for performing the uplink packet conversion of the current general IPv4 to IPv6 network protocol. Among them, it mainly includes the generation method of IPv4 to IPv6, which is to control the generation of the basic IPv6 packet header through the content lookup table plus the field design of the control lookup table, and the method of using translation to map addresses and ports (MAP-T) or the method of using encapsulation to map addresses and ports (MAP-E) can be adopted through the field design of the forwarding mapping rule table (FMR table) to perform the conversion of the IPv6 destination host network address (DIP) in the uplink packet, and MAP-T is used to perform the conversion of the IPv6 to IPv4 source host network address (SIP) and destination host network address (DIP) for the downlink packet to collectively execute the control of draft version compatibility.
[0131] The content disclosed above is only a preferred and feasible embodiment of the present invention, and does not limit the protection scope of the claims of the present invention. Therefore, all equivalent technical changes made by using the content of the specification and drawings of the present invention are included in the protection scope of the claims of the present invention.
Claims
1. A network packet conversion method for converting an IPv4 packet into an IPv6 packet, characterized in that, Including: Inserting the length field of an IPv6 header recorded in a content lookup table into a prefix of an IPv4 header; Inserting the length field of the IPv6 header according to the record in a control lookup table to update the length field of the IPv6 header inserted into the prefix of the IPv4 header; Determining a destination host network address in the IPv6 packet according to whether a forwarding mapping rule table is specified; and Updating the part of the IPv4 packet that makes up the destination host network address in the IPv6 packet, i.e., completing the conversion of the IPv4 packet to the IPv6 packet; In the step of determining the destination host network address in the IPv6 packet, if the forwarding mapping rule table is specified, updating the destination host network address of the IPv6 packet according to the IPv6 packet prefix address field recorded in the forwarding mapping rule table.
2. The network packet conversion method according to claim 1, characterized in that According to the output interface determined by the IPv4 packet routing, adopt a method of using encapsulation to map addresses and ports or a method of using translation to map addresses and ports.
3. The network packet conversion method according to claim 2, wherein In the method of using encapsulation to map addresses and ports, in the step of determining the destination host network address in the IPv6 packet, if the forwarding mapping rule table is not specified, there is no need to modify the destination host network address in the IPv6 header.
4. The network packet conversion method according to claim 3, characterized in that, In the step of determining the destination host network address of the IPv6 packet, further determine a port setting identifier field of the destination host network address, where: Judging whether a refill port setting identifier in the forwarding mapping rule table is 0. If it is 0, there is no need to dynamically modify the port setting identifier field in the destination host network address of the IPv6 packet; and If the refill port setting identifier in the forwarding mapping rule table is not 0, dynamically modify the port setting identifier field in the destination host network address of the IPv6 packet according to the port setting identifier obtained from the information of two fields, namely, a port setting identifier offset start and a port setting identifier offset end, in the forwarding mapping rule table.
5. The network packet conversion method according to claim 2, wherein In the method of using translation to map addresses and ports, in the step of determining the destination host network address in the IPv6 packet, if the forwarding mapping rule table is not specified, modify the destination host network address in the IPv6 packet according to the prefix length field of the method of using translation to map addresses and ports in a control lookup table in a default mapping rule table and the destination host network address in the IPv4 packet.
6. The network packet conversion method according to claim 5, wherein In the step of determining the destination host network address of the IPv6 packet, further determine a port setting identifier field of the destination host network address, where: Judging whether a refill port setting identifier in the forwarding mapping rule table is 0. If it is 0, there is no need to dynamically modify the port setting identifier field in the destination host network address of the IPv6 packet; and If the refill port setting identifier in the forwarding mapping rule table is not 0, dynamically modify the port setting identifier field in the destination host network address of the IPv6 packet according to the port setting identifier obtained from the information of two fields, namely, a port setting identifier offset start and a port setting identifier offset end, in the forwarding mapping rule table.
7. The network packet conversion method according to claim 5, characterized in that, When the original IPv4 header part in the IPv6 header is removed, the step of converting the IPv4 packet into the IPv6 packet is completed.
8. The network packet conversion method according to any one of claims 1 to 7, characterized in that, The content lookup table stores a method of using translation to map addresses and ports and a method of using encapsulation to map addresses and ports, and inserts the converted IPv6 header. The control lookup table is used to determine the field control that needs to be updated after adding the IPv6 header; the forwarding mapping rule table is used to determine the conversion of the destination host network address of the upstream IPv6 packet, and the conversion of the source host network address and the destination host network address of the downstream IPv4 packet.
9. A network packet conversion method for converting an IPv6 packet into an IPv4 packet, characterized in that, Including: Determine whether to use a method of using encapsulation to map addresses and ports or a method of using translation to map addresses and ports according to a virtual local area network and a destination host network address recorded in an IPv6 header. And According to a control lookup table, determine the header for converting to an IPv4 packet according to the form of the IPv6 packet, and complete the step of converting the IPv6 packet into the IPv4 packet; in the method of using encapsulation to map addresses and ports, that is, according to the control lookup table associated with the method of using encapsulation to map addresses and ports, when the form of the IPv6 packet is a packet with the IPv6 network protocol on the outer layer and the IPv4 network protocol encapsulated on the inner layer, remove the header of the IPv6 network protocol on the outer layer.
Citation Information
Patent Citations
Network system for communicating between different IP versions with multiple translators
US20090304026A1
Stateless Protocol Translation
US20130235871A1