Traffic statistics method for ipv4 over ipv6 tunnel
By utilizing optional fields and mapping labels of the TOS service type in IPv4 over IPv6 tunnels, the problem of difficult statistics of inner IPv4 traffic is solved, achieving efficient traffic statistics and identification, and reducing device performance consumption.
Patent Information
- Application Number
- CN202311709449.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-13
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2043-12-13
Smart Images

Figure CN117857400B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of IPv6 transition technology in data communication, and particularly relates to a traffic statistics method for IPv4 over IPv6 tunnels. Background Technology
[0002] Tunneling is an encapsulation technique, a network protocol that encapsulates data packets from other network protocols within its own packets for transmission over the network. The path along which the encapsulated data packets travels is called a tunnel. A tunnel is a virtual point-to-point connection, and both ends of the tunnel require encapsulation and decapsulation of data packets. The fundamental purpose of IPv6 is to inherit from and replace IPv4, but the evolution of anything is a gradual process, and the transition from IPv4 to IPv6 is no exception. Therefore, before IPv6 completely replaces IPv4, these two protocols inevitably need a period of coexistence. The IPv4 over IPv6 tunneling protocol encapsulates data packets from an IPv4 network, enabling these encapsulated data packets to be transmitted in another IPv6 network. This solves the problem of two isolated IPv4 networks communicating with each other in an IPv6 backbone network. A typical network scenario is shown in the attached diagram. Figure 1 ;
[0003] Tunneling technology effectively solves the problem of IPv4 interoperability in IPv6 transition scenarios. However, it also introduces some challenges. Traditional statistical techniques can only identify the outer layer of data packets, defining a flow using information such as the IP 5-tuple, and then performing statistical identification on that flow. Because IPv4 packets are encapsulated within IPv6 data packets, the inner layer of IPv4 traffic is difficult to identify and statistically analyze. Tunneling technology presents numerous difficulties when performing statistical analysis on raw traffic.
[0004] Existing methods for statistical analysis of packets within a tunnel primarily involve performing traffic statistics before the original packets are encapsulated within the tunnel—a process known as pre-flow analysis. Pre-flow analysis is typically conducted at the client-side.
[0005] Problems with existing technology:
[0006] 1. Network traffic statistics are typically performed at the backbone network gateway. This makes it difficult to analyze the raw traffic within the tunnel after IPv4 over IPv6 tunnel encapsulation. Traffic analysis is impossible at the backbone gateway because the IP 5-tuple of the inner IPv4 traffic is difficult to identify. To analyze the inner traffic, the encapsulation needs to be removed, and the flow defined using the IP tuple needs to be identified and analyzed. In practical applications, almost no vendors use this method of removing encapsulation before analysis because it consumes significant resources on the equipment.
[0007] 2. Traditional methods for classifying IPv6 flows still define flows using the IP 5-tuple. This increases device overhead, requiring the lookup of Layer 4 header values. Traditionally, flow classification is based on a 5-tuple of source address, destination address, source port, destination port, and transport protocol type. However, due to fragmentation or encryption, some of these fields may be unavailable, or locating them via the IPv6 extended header chain may be inefficient. If traffic classification relied solely on the IP layer header, it would reduce the processing load on the device's CPU and improve performance. Summary of the Invention
[0008] The technical problem to be solved by the present invention is to provide a traffic statistics method for IPv4 over IPv6 tunnels to address the shortcomings of the prior art. It uses optional fields in the TOS service type of the inner IPv4 packet to define different types of flow applications, and maps different types of traffic for different mapping tags, thereby realizing traffic statistics with inner layer subdivision and refining the granularity of traffic statistics.
[0009] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0010] A traffic statistics method for IPv4 over IPv6 tunnels, specifically including the following steps;
[0011] Step 1: Define different types of flow applications using the optional fields in the TOS of the inner IPv4 packet;
[0012] Step 2: Map different types of traffic to different mapping tags for traffic statistics in the inner subdivision dimension, and refine the granularity of traffic statistics.
[0013] Step 3: Perform traffic statistics based on IPv6 flow labels using IPFIX.
[0014] As a further preferred embodiment of the traffic statistics method for IPv4 over IPv6 tunnels of the present invention, the inner layer subdivision flow definition process in step 1 specifically includes the following steps;
[0015] Step 2.1: After receiving an IPv4 packet, the dual-stack gateway looks up the route to enter the tunnel and performs tunnel encapsulation.
[0016] Step 2.2: Decapsulate the tunnel encapsulation to restore the inner IPv4 packet;
[0017] Step 2.3: Modify the TOS service type field by defining the last two bits, which are not defined in the RFC standard, as a mapping label.
[0018] As a further preferred embodiment of the traffic statistics method for IPv4 over IPv6 tunnels of the present invention, in step 2, in step 2.2, the first 4 bytes of the original IPv4 header, of which the service type field occupies 1 byte, the service type field is defined, the first 6 bits are defined as DSCP, used for traffic marking and quality of service services; the last 2 bits are CU reserved fields.
[0019] As a further preferred embodiment of the traffic statistics method for IPv4 over IPv6 tunnels of the present invention, in step 2.3, the mapping label contains 2 bits for marking 4 types of traffic.
[0020] As a further preferred embodiment of the traffic statistics method for IPv4 over IPv6 tunnels of the present invention, the inner IPv4 packet mapping process is as follows:
[0021] Step 2.1: Assign Flow Label values through inner message mapping; where Flow Label is the traffic label.
[0022] Step 2.2: After the IPv4 traffic enters the tunnel, it undergoes outer IPv6 encapsulation. During encapsulation, the outer IPv6 flow label is assigned the 20-bit hash value previously recorded in the cache table. This completes the mapping of different types of inner IPv4 traffic to the outer IPv6 flow label. By performing statistics on the flow label of the outer IPv6 header, the statistics of the inner packets can be completed.
[0023] As a further preferred embodiment of the traffic statistics method for IPv4 over IPv6 tunnels of the present invention, in step 2.1, the Flow Label is assigned through inner packet mapping, as follows:
[0024] Configure the dual-stack gateway to count all IPv4 traffic in the inner layer. The protocol stack will assign a value to the ML flag in the IP header of all IPv4 packets in the inner layer, assigning a value of ML=00; where ML=00 represents all IPv4 traffic in the inner layer.
[0025] The protocol stack extracts the IP 5-tuple of IPv4 traffic, namely source address, destination address, source port, destination port and transport protocol type, and hashes it into a 20-bit value, which is then recorded in the cache.
[0026] After IPv4 traffic enters the tunnel after routing, it undergoes outer IPv6 encapsulation. During encapsulation, the outer IPv6 flow label is assigned a 20-bit hash value previously recorded in the cache table.
[0027] As a further preferred embodiment of the traffic statistics method for IPv4 over IPv6 tunnels of the present invention, in step 2.1, the Flow Label is assigned through inner packet mapping. Specifically, the dual-stack gateway is configured to perform statistics on the inner raw IPv4 traffic. The protocol stack assigns a value to the ML flag in the IP header of all inner IPv4 packets, assigning a value of ML=01; where ML=01 represents the inner raw IP traffic.
[0028] At this point, the protocol stack extracts the source address and destination address values from the IP 5-tuple of the IPv4 traffic and hashes them into a 20-bit value, which is then recorded in the cache.
[0029] After the IPv4 traffic is routed into the tunnel, it undergoes outer IPv6 encapsulation. During encapsulation, the outer IPv6 flow label is assigned the 20-bit hash value previously recorded in the cache table.
[0030] As a further preferred embodiment of the traffic statistics method for IPv4 over IPv6 tunnels of the present invention, in step 2.1, the Flow Label is assigned by mapping the inner packet. Specifically, when the dual-stack gateway is configured to count the TCP traffic of the inner IPv4, the protocol stack will assign a value to the ML flag in the IP header of all inner IPv4 packets, assigning a value of ML=10; where ML=10 represents the TCP traffic of the inner layer.
[0031] At this point, the protocol stack extracts the values of the source address, destination address, source port, destination port, and TCP protocol number from the IP 5-tuple of the IPv4 traffic and hashes them into a 20-bit value, which is then recorded in the cache.
[0032] After the IPv4 traffic is routed into the tunnel, it undergoes outer IPv6 encapsulation. During encapsulation, the outer IPv6 flow label is assigned the 20-bit hash value previously recorded in the cache table.
[0033] As a further preferred embodiment of the traffic statistics method for IPv4 over IPv6 tunnels of the present invention, in step 2.1, the Flow Label is assigned by mapping the inner packet. Specifically, when the dual-stack gateway is configured to count the UDP traffic of the inner IPv4, the protocol stack will assign a value to the ML flag in the IP header of all inner IPv4 packets, assigning a value of ML=11; where ML=11 represents the inner UDP traffic.
[0034] At this point, the protocol stack extracts the values of the source address, destination address, source port, destination port, and UDP protocol number from the IP 5-tuple of the IPv4 traffic and hashes them into a 20-bit value, which is then recorded in the cache.
[0035] After the IPv4 traffic is routed into the tunnel, it undergoes outer IPv6 encapsulation. During encapsulation, the outer IPv6 flow label is assigned the 20-bit hash value previously recorded in the cache table. This completes the mapping of different types of inner IPv4 traffic to the outer IPv6 flow label. By performing statistics on the flow label of the outer IPv6 header, the statistics of the inner packets can be completed.
[0036] As a further preferred embodiment of the traffic statistics method for IPv4 over IPv6 tunnels of the present invention, step 3, the IPFIX traffic statistics process based on IPv6 flow labels, specifically includes the following steps:
[0037] Step 3.1: The dual-stack gateway assigns values to ML according to different configuration requirements and performs flow tag mapping based on the assigned values;
[0038] Step 3.2: Count the inner IPv4 TCP traffic of the IPv4 over IPv6 tunnel. The dual-stack gateway first assigns ML to 10, and then hashes the inner IPv4 IP 5-tuple and maps it to the outer IPv6 flow label during encapsulation.
[0039] Step 3.3: When IPFIX is enabled on the interface of the dual-stack gateway, the IPFIX module treats different flow labels as different TCP traffic for statistics, and generates active and inactive flows based on the outer IPv6 flow labels. When the flow ages, it is reported in Netflow format to the NMS network management site for statistical analysis.
[0040] Compared with the prior art, the present invention, employing the above technical solution, has the following technical effects:
[0041] 1. This invention utilizes the optional fields in the TOS service type of the inner IPv4 packet to define different types of flow applications, and maps different types of traffic for different mapping tags, realizing traffic statistics with inner-layer subdivision dimensions and refining the granularity of traffic statistics; at the same time, for the statistics of tunnel traffic, only the outer IPv6 flow tag is needed, which improves the statistical efficiency and greatly reduces the CPU overhead.
[0042] 2. This invention maps the flow characteristics of inner packets to the outer IPv6 flow labels, enabling IPFIX to count the inner IPv4 traffic by counting the outer IPv6 flow labels, thus improving statistical efficiency and reducing CPU overhead.
[0043] 3. This invention utilizes the last two reserved fields of the TOS field to define the Mapping Label and designs a Mapping Label code table to perform fine-grained classification of inner IPv4 traffic, thus refining the granularity of traffic statistics.
[0044] 4. This invention proposes a mapping approach and implementation scheme for inner IPv4 packet flow characteristics, which maps IPv6 flow labels through the inner IP quintuple;
[0045] 5. This invention proposes a new method for analyzing the inner original packets of IPv4 over IPv6 tunnel traffic statistics, enabling the gateway to identify traffic using only the outer IPv6 header, thereby improving identification efficiency and reducing CPU overhead. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 This is a schematic diagram of the IPv4 over IPv6 tunnel networking of the present invention;
[0048] Figure 2 This invention relates to the IPv4 over IPv6 tunnel encapsulation process;
[0049] Figure 3 This invention relates to the process of decapsulating IPv4 over IPv6 tunnels;
[0050] Figure 4 This is the packet structure of the first 4 bytes of the IPv4 header of this invention;
[0051] Figure 5 This is the modified IPv4 header structure of the present invention, consisting of the first 4 bytes.
[0052] Figure 6 This is the Mapping Label code table of the present invention;
[0053] Figure 7 This is the IPv6 packet structure of the present invention;
[0054] Figure 8 This is a schematic diagram of the network topology for inner-layer packet statistics of IPv4 over IPv6 tunnel traffic according to the present invention;
[0055] Figure 9This invention relates to the dual-stack gateway IPFIX module utilizing the outer IPv6 flow label statistics process. Detailed Implementation
[0056] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings:
[0057] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention. The present invention will be described in detail below with reference to the accompanying drawings and preferred embodiments. The purpose and effects of the present invention will become clearer. It should be understood that the specific embodiments described herein are merely illustrative of the present invention and are not intended to limit the present invention.
[0058] This invention discloses a traffic statistics method for IPv4 over IPv6 tunnels. It proposes a method for mapping inner IPv4 packets to outer IPv6 flow labels within an IPv4 over IPv6 tunnel. Furthermore, by utilizing optional fields in the TOS (Type of Service) of the inner IPv4 packet to define different types of flow applications, different types of traffic are mapped for different mapping labels, achieving finer-grained traffic statistics at the inner layer. Moreover, tunnel traffic statistics only require the outer IPv6 flow labels, improving statistical efficiency and significantly reducing CPU overhead.
[0059] By utilizing the last two reserved fields of the TOS field, a Mapping Label was defined, and a Mapping Label code table was designed to perform fine-grained classification of inner IPv4 traffic, thus refining the granularity of traffic statistics.
[0060] A mapping approach and implementation scheme for inner IPv4 packet flow features are proposed, and IPv6 flow label mapping is performed through the inner IP quintuple;
[0061] A novel method for analyzing the inner raw packets of IPv4 over IPv6 tunnel traffic is proposed, enabling the gateway to identify traffic using only the outer IPv6 header, thus improving identification efficiency and reducing CPU overhead.
[0062] IPv4 stands for Internet Protocol Version 4.
[0063] IPv6 stands for Internet Protocol Version 6.
[0064] IPFIX stands for IP Flow Information Export.
[0065] NSM stands for Network Management Station.
[0066] TOS stands for Type of Service.
[0067] DSCP stands for Differentiated Services Code Point.
[0068] Specific embodiments of the present invention are as follows:
[0069] The reserved field of the Tos field in the inner IPv4 packet is used to define the segmentation flow mapping switch, and different values represent different types of traffic for mapping;
[0070] The inner IPv4 quintuple hashes out a 20-bit value, which is then mapped to the outer IPv6 flow label.
[0071] The IPFIX protocol uses IPv6 flow labels for traffic statistics;
[0072] The inner layer subdivision flow definition process is as follows: IPv4 over IPv6 tunneling technology encapsulates IPv4 packets within IPv6 packets, enabling the transmission of IPv4 isolated packets within an IPv6 backbone network. The dual-stack gateway in the backbone network performs IPv4 and IPv6 encapsulation and decapsulation. Upon receiving an IPv4 packet, the dual-stack gateway looks up the route to the tunnel and performs tunnel encapsulation. The encapsulation process is shown in the attached diagram. Figure 2 As shown in the attached diagram. When the traffic reaches the tunnel endpoint, it needs to be decapsulated to restore the inner IPv4 packet. The decapsulation process is as follows. Figure 3 As shown.
[0073] The first 4 bytes of the original IP header are shown in the attached image. Figure 4 As shown, the Type of Service (TOS) field occupies one byte. RFC2474 defines the TOS field, assigning the first six bits to DSCP for traffic marking and Quality of Service (QoS) services. The last two bits are the CU (currently unused) reserved field. This solution modifies the TOS field by defining the last two bits, which are not defined in the RFC standard, as a Mapping Label, as shown in the attached diagram. Figure 5This adds a mapping label to the IP header, indicating the flow type. On a dual-stack gateway, different types of traffic can be mapped to outer IPv6 flow labels based on the specific scenario. Since the mapping label only has 2 bits, it can only mark four types of traffic. Specifically, ML=00 represents all inner IPv4 traffic, ML=01 represents inner raw IP traffic, ML=10 represents inner TCP traffic, and ML=11 represents inner UDP traffic. The mapping label definition is attached. Figure 6 As shown;
[0074] The inner IPv4 packet mapping process is as follows: The main significance of mapping the inner packet to the outer packet is that when performing traffic statistics, only the outer IPv6 header needs to be checked to perform flow statistics, thus eliminating the need to continue decapsulating the packet.
[0075] The outer IPv6 header structure is shown in the attached image. Figure 7 As shown, the last 20 bits of the first 4 bytes are the FlowLabel field, the flow label field.
[0076] The IETF (Institute of Electronics and Information Technology) has not yet specified how this field should be used, but only recommends its use for flow labeling. The proposed solution here assigns the Flow Label value through inner packet mapping.
[0077] When configuring statistics for all inner-layer IPv4 traffic on a dual-stack gateway, the protocol stack assigns a value of ML=00 to the ML flag in the IP header of all inner-layer IPv4 packets. At this time, the protocol stack extracts the IP 5-tuple of the IPv4 traffic—source address, destination address, source port, destination port, and transport protocol type—and hashes it into a 20-bit value, recording this value in the cache. After the IPv4 traffic is routed into the tunnel, it undergoes outer IPv6 encapsulation. During encapsulation, the outer IPv6 flow label is assigned the 20-bit hash value previously recorded in the cache table.
[0078] When configuring statistics for the inner layer of raw IPv4 traffic on a dual-stack gateway, the protocol stack assigns a value to the ML flag in the IP header of all inner IPv4 packets, setting it to ML=01. At this time, the protocol stack extracts the source and destination address values from the IP 5-tuple of the IPv4 traffic and hashes them into a 20-bit value, recording this value in the cache. After the IPv4 traffic is routed into the tunnel, it undergoes outer IPv6 encapsulation. During encapsulation, the outer IPv6 flow label is assigned the 20-bit hash value previously recorded in the cache table.
[0079] When configuring statistics on inner IPv4 TCP traffic on a dual-stack gateway, the protocol stack assigns a value of ML (Multi-Level Count) to the IP header of all inner IPv4 packets, setting it to ML=10. At this time, the protocol stack extracts the values of the source address, destination address, source port, destination port, and TCP protocol number from the IP 5-tuple of the IPv4 traffic and hashes them into a 20-bit value, recording this value in the cache. After the IPv4 traffic is routed into the tunnel, it undergoes outer IPv6 encapsulation. During encapsulation, the outer IPv6 flow label is assigned the 20-bit hash value previously recorded in the cache table.
[0080] When configuring statistics on inner IPv4 UDP traffic on a dual-stack gateway, the protocol stack assigns a value of ML=11 to the ML flag in the IP header of all inner IPv4 packets. At this time, the protocol stack extracts the values of the source address, destination address, source port, destination port, and UDP protocol number from the IP 5-tuple of the IPv4 traffic and hashes them into a 20-bit value, recording this value in the cache. After the IPv4 traffic is routed into the tunnel, it undergoes outer IPv6 encapsulation. During encapsulation, the outer IPv6 flow label is assigned the 20-bit hash value previously recorded in the cache table. This completes the mapping of different types of inner IPv4 traffic to the outer IPv6 flow label. Statistics on inner packets can be completed simply by counting the flow labels in the outer IPv6 header, improving statistical efficiency.
[0081] The IPFIX traffic statistics process based on IPv6 flow labels is as follows: In the IPv4 over IPv6 tunnel scenario, the five-tuple of the inner IPv4 packet is mapped to the outer IPv6 flow label. In this way, the dual-stack gateway only needs to perform statistical analysis on the IPv6 flow label to analyze the statistical situation of different traffic.
[0082] IPFIX stands for IP Flow Information eXport, which outputs IP flow information. The main principle of IPFIX is to upload IPFIX templates to the Network Management Station (NSM) for traffic analysis based on traffic aging. IPFIX traffic monitoring and analysis capabilities can be applied to network and application monitoring, network planning, security analysis, traffic billing, and network traffic engineering. Typical application scenarios are shown in the attached figure. Figure 8 As shown.
[0083] The dual-stack gateway assigns values to the ML (Flow Flow Information) class and maps flow labels based on these values, according to different configuration requirements. For example, if a customer wants to statistically analyze the inner IPv4 TCP traffic of an IPv4 over IPv6 tunnel, the dual-stack gateway first assigns a value of 10 to the ML class. Simultaneously, it hashes the inner IPv4 IP 5-tuple and maps it to the outer IPv6 flow label during encapsulation. When IPFIX is enabled on the dual-stack gateway's interface, IPFIX outputs flow information (IP). The IPFIX module treats different flow labels as different TCP traffic for statistical analysis, generating active and inactive flows based on the outer IPv6 flow label. When flows age, they are reported in Netflow format to the NMS (Network Management System) for statistical analysis. The entire process is illustrated in the attached diagram. Figure 9 As shown.
[0084] This invention proposes a novel embodiment of a traffic statistics method for IPv4 over IPv6 tunnels. The main method involves mapping the flow characteristics of inner packets to outer IPv6 flow labels, enabling IPFIX to count the inner IPv4 traffic by analyzing the outer IPv6 flow labels. This improves statistical efficiency and reduces CPU overhead.
[0085] This invention utilizes the last two reserved fields of the TOS field to define the Mapping Label and designs a Mapping Label code table to perform fine-grained classification of inner IPv4 traffic, thus refining the granularity of traffic statistics.
[0086] This invention proposes a mapping approach and implementation scheme for inner IPv4 packet flow features, which maps IPv6 flow tags through the inner IP quintuple;
[0087] This invention proposes a novel method for analyzing the inner raw packets of IPv4 over IPv6 tunnel traffic statistics. This method enables gateways to identify traffic using only the outer IPv6 header, thereby improving identification efficiency and reducing CPU overhead.
[0088] It will be understood by those skilled in the art that the above descriptions are merely preferred examples of the invention and are not intended to limit the invention. Although the invention has been described in detail with reference to the foregoing examples, those skilled in the art can still modify the technical solutions described in the foregoing examples or make equivalent substitutions for some of the technical features. All modifications and equivalent substitutions made within the spirit and principles of the invention should be included within the scope of protection of the invention. All technical features in this embodiment can be freely combined according to actual needs.
[0089] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for traffic statistics of IPv4 over IPv6 tunnel, characterized in that: Specifically comprising the following steps: Step 1, using the optional field in the TOS of the inner layer IPv4 message to define different types of flow application; Step 2, mapping different types of traffic for different inner layer IPV4 message mapping labels, for inner layer dimension traffic statistics, refining the granularity of traffic statistics; Step 3, based on IPv6 flow label IPFIX to complete traffic statistics; In step 1, using the optional field in the TOS of the inner layer IPv4 message to define different types of flow application, specifically comprising the following steps: Step 1.1, after receiving the IPv4 message, the dual stack gateway checks the route into the tunnel, and performs tunnel encapsulation; Step 1.2, the TOS service type field is modified, and the last 2 bits which are not defined in the RFC standard are defined as mapping label Mapping Label; The first 4 bytes of the original IPv4 header, wherein the service type field occupies 1 byte, the service type field is defined, the first 6 bit positions are defined as DSCP for traffic marking and quality of service service; the last 2 bit positions are CU reserved fields; DSCP is the differentiated service code point; Mapping Label contains 2 bits, which are used to mark 4 types of traffic; In step 2, the inner layer IPv4 message mapping process is as follows: Step 2.1, extract the five-tuple of IPv4 traffic and hash it into a 20-bit value, and record the value in the cache; Step 2.2, assign Flow Label by inner message mapping; wherein Flow Label is traffic label; After the IPv4 traffic is routed into the tunnel, outer layer IPv6 encapsulation is performed, and the outer layer IPv6 flow label is assigned as the 20-bit hash value recorded in the cache table during encapsulation; completing the mapping of different types of IPv4 traffic in the inner layer to the flow label of the outer layer IPv6, the flow label of the outer layer IPv6 header can be counted to complete the statistics of the inner layer message.
2. The method of traffic statistics of IPv4 over IPv6 tunnel according to claim 1, characterized in that: In step 2.2, Flow Label is assigned by inner message mapping, as follows: Configure the protocol stack on the dual stack gateway to count all IPv4 traffic in the inner layer, and assign the ML value in the IP header of all IPv4 messages in the inner layer, ML=00; wherein ML=00 represents all inner layer IPv4 traffic; The protocol stack extracts the IP five-tuple of IPv4 traffic, including source address, destination address, source port, destination port and transmission protocol type value, and hashes it into a 20-bit value, and records the value in the cache.
3. The method for IPv4 over IPv6 tunnel traffic statistics of claim 1, wherein: In step 2.2, Flow Label is assigned by inner message mapping, as follows: Configure the protocol stack on the dual stack gateway to count all IPv4 traffic in the inner layer, and assign the ML value in the IP header of all IPv4 messages in the inner layer, ML=00; wherein ML=00 represents all inner layer IPv4 traffic; The protocol stack extracts the values of the source address and the destination address in the IP quintuple of the IPv4 traffic and hashes them into a 20-bit number, and records the number in the cache.
4. The method for IPv4 over IPv6 tunnel traffic statistics of claim 1, wherein: In step 2.2, the Flow Label is assigned by means of inner-layer message mapping, and the specific assignment is as follows: when the dual-stack gateway is configured to count the inner-layer IPv4 TCP traffic, the protocol stack marks the ML in the IP header of all inner-layer IPv4 messages and assigns ML=10; wherein ML=10 represents the inner-layer TCP traffic. The protocol stack extracts the values of the source address, the destination address, the source port, the destination port and the TCP protocol number in the IP quintuple of the IPv4 traffic and hashes them into a 20-bit number, and records the number in the cache.
5. The method for IPv4 over IPv6 tunnel traffic statistics of claim 1, wherein: In step 2.2, the Flow Label is assigned by means of inner-layer message mapping, and the specific assignment is as follows: when the dual-stack gateway is configured to count the inner-layer IPv4 UDP traffic, the protocol stack marks the ML in the IP header of all inner-layer IPv4 messages and assigns ML=11; wherein ML=11 represents the inner-layer UDP traffic. The protocol stack extracts the values of the source address, the destination address, the source port, the destination port and the UDP protocol number in the IP quintuple of the IPv4 traffic and hashes them into a 20-bit number, and records the number in the cache.
Citation Information
Patent Citations
Traffic statistics control method, device and system
CN110703817A
Traffic statistics method and device, gateway equipment and storage medium
CN112565018A