Method for compiling traffic statistics of ipv4-over-ipv6 tunnel

By using the TOS service type field of the inner layer IPv4 message in the IPv4 over IPv6 tunnel to define the flow application and statistics through IPFIX of the IPv6 flow tag, the problem of difficulty in counting the inner layer IPv4 traffic in the tunnel in the prior art is solved, and efficient and low-consumed traffic statistics are achieved.

WO2025124384A1PCT designated stage expired Publication Date: 2025-06-19CHINA TELECOM CLOUD TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/138179
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-13
Filing Date
2024-12-10
Publication Date
2025-06-19

AI Technical Summary

Technical Problem

It is difficult for the prior art to effectively count IPv4 traffic in the inner layer of IPv4 over IPv6 tunnel. Traditional methods require unpackaging, resulting in high performance consumption of equipment and relying on IP five-tuple identification flows, which has the problem of unavailability of fields during sharding or encryption.

Method used

Use optional fields in the TOS service type of the inner layer IPv4 message to define different types of flow applications, and map different types of traffic through different mapping tags to realize traffic statistics in the inner layer segmentation dimension. At the same time, IPFIX based on IPv6 stream tags performs traffic statistics to reduce dependence on device CPU.

Benefits of technology

The fine-grained statistics of inner IPv4 traffic is realized, which reduces CPU overhead, improves statistical efficiency, and avoids the unpacking process with high equipment performance consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024138179_19062025_PF_FP_ABST
    Figure CN2024138179_19062025_PF_FP_ABST
Patent Text Reader

Abstract

The present invention relates to the field of tunnels in data communications. Disclosed is a method for compiling traffic statistics of an IPv4-over-IPv6 tunnel. The method comprises: using optional fields in a TOS of an inner-layer IPv4 message to define different types of flow applications; performing mapping of different types of traffic for different mapping labels, so as to compile traffic statistics in an inner-layer subdivided dimension and refine the granularity of the traffic statistics; and completing the compilation of the traffic statistics on the basis of IPFIX for IPv6 flow labels. Flow features of an inner-layer message are mapped onto outer-layer IPv6 flow labels, such that IPFIX can compile statistics of inner-layer IPv4 traffic by means of compiling statistics of the outer-layer IPv6 flow labels, thereby improving the statistical efficiency and reducing CPU overheads.
Need to check novelty before this filing date? Find Prior Art

Description

A traffic statistics method for IPv4overIPv6 tunnel

[0001] This application claims priority to Chinese patent application number CN202311709449.0, filed on December 13, 2023, entitled “A Traffic Statistics Method for IPv4overIPv6 Tunnel,” the entire text of which is incorporated herein by reference. Technical Field

[0002] The present invention belongs to the technical field of IPv6 transition in data communications, and in particular relates to a traffic statistics method for an IPv4 over IPv6 tunnel. Background Art

[0003] Tunneling is an encapsulation technology. It involves a network protocol encapsulating datagrams from other network protocols within its own packets and then transmitting them across the network. The path along which encapsulated datagrams travel within the network is called a tunnel. A tunnel is a virtual point-to-point connection, and both ends of the tunnel must encapsulate and decapsulate datagrams. The fundamental purpose of IPv6 is to succeed and replace IPv4, but the evolution of everything is a gradual process, and the transition from IPv4 to IPv6 is no exception. Therefore, before IPv6 completely replaces IPv4, a period of coexistence between the two protocols is inevitable. The IPv4 over IPv6 tunneling protocol encapsulates datagrams from an IPv4 network, enabling them to be transmitted across another IPv6 network. This solves the problem of two isolated IPv4 networks communicating with each other across an IPv6 backbone network. A typical networking scenario is shown in Figure 1.

[0004] Tunneling technology effectively solves the problem of IPv4 interoperability during IPv6 transition scenarios. However, it also presents some challenges. Traditional statistical techniques can only identify the outer layer of data packets, using information such as the IP quintuple to define a flow and then perform statistical analysis on that flow. However, because IPv4 packets are encapsulated within IPv6 data packets, the inner IPv4 traffic is difficult to identify and count. Tunneling technology presents significant difficulties when analyzing raw traffic.

[0005] The existing method of collecting statistics on tunnel inner layer messages mainly collects traffic statistics before the original message is encapsulated in the tunnel, which is called pre-flow statistics. Pre-flow statistics are usually collected at the client end.

[0006] Problems with existing technologies:

[0007] 1. Traffic statistics in the network are usually analyzed on the gateway of the backbone network, which leads to the inner layer of the tunnel.

[0008] It's difficult to count traffic encapsulated in an IPv4 over IPv6 tunnel. Traffic statistics are impossible when the traffic reaches the backbone network gateway, and the IP five-tuple of the inner IPv4 traffic is difficult to identify. To count the inner traffic, you need to decapsulate it, define flows using the IP tuple, and then identify and count them. In real-world applications, few vendors use this method of decapsulating traffic before counting, as it significantly impacts device performance.

[0009] 2. The traditional method for IPv6 traffic classification still defines flows using the IP five-tuple. This approach increases device overhead and requires checking the values ​​of the Layer 4 header. Traditionally, flow classification is based on the five-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 through the IPv6 extension header chain may be inefficient. If traffic classification relies solely on the IP layer header, the processing burden on the device CPU will be reduced, improving performance. Summary of the Invention

[0010] The technical problem to be solved by the present invention is to provide a traffic statistics method for IPv4overIPv6 tunnel in response to the shortcomings of the background technology; it uses the optional field in the TOS service type of the inner IPv4 message to define different types of flow applications, maps different types of traffic to different mapping labels, realizes traffic statistics of the inner layer subdivision dimension, and refines the granularity of traffic statistics.

[0011] The present invention adopts the following technical solutions to solve the above technical problems:

[0012] A method for counting traffic in an IPv4overIPv6 tunnel comprises the following steps:

[0013] Step 1: Use the optional fields in the TOS of the inner IPv4 packet to define different types of flow applications;

[0014] Step 2: Map different types of traffic based on different mapping tags, which are used for traffic statistics in the inner subdivision dimension and refine the granularity of traffic statistics;

[0015] Step 3: Complete traffic statistics based on IPFIX of IPv6 flow labels.

[0016] As a further preferred embodiment of the traffic statistics method of the IPv4 over IPv6 tunnel of the present invention, in step 1, the inner layer subdivision flow definition process specifically includes the following steps:

[0017] Step 2.1: After receiving the IPv4 packet, the dual-stack gateway checks the route to the tunnel and performs tunnel encapsulation.

[0018] Step 2.2: decapsulate the tunnel encapsulation and restore the inner IPv4 packet;

[0019] In step 2.3, the TOS service type field is modified by defining the last two bits, which are not defined in the RFC standard, as the mapping label.

[0020] As a further preferred embodiment of the traffic statistics method of the IPv4overIPv6 tunnel of the present invention, in step 2, in step 2.2, the first 4 bytes of the original IPv4 header, wherein the service type field occupies 1 byte, are defined, and the first 6 bits are defined as DSCP for traffic marking and quality of service services; the last 2 bits are CU reserved fields.

[0021] As a further preferred solution of the traffic statistics method of the IPv4overIPv6 tunnel of the present invention, in step 2.3, the mapping label Mapping Label includes 2 bits for marking 4 types of traffic.

[0022] As a further preferred solution of the traffic statistics method of the IPv4 over IPv6 tunnel of the present invention, the inner IPv4 message mapping process is as follows:

[0023] In step 2.1, the flow label is assigned through inner message mapping. The flow label is a flow label.

[0024] In step 2.2, after the IPv4 traffic is routed into the tunnel, it is encapsulated in the outer IPv6 layer. During encapsulation, the outer IPv6 flow label is assigned the 20-bit hash value previously recorded in the cache table. After the different types of inner IPv4 traffic are mapped to the outer IPv6 flow label, the flow label of the outer IPv6 header is counted to complete the statistics of the inner packets.

[0025] As a further preferred solution of the traffic statistics method of the IPv4 over IPv6 tunnel of the present invention, in step 2.1, Flow Label assignment is performed by inner layer message mapping, specifically as follows:

[0026] When statistics are configured on all inner IPv4 traffic on a dual-stack gateway, the protocol stack assigns the ML value in the IP header of all inner IPv4 packets to ML=00, which represents all inner IPv4 traffic.

[0027] The protocol stack extracts the IP quintuple of IPv4 traffic (source address, destination address, source port, destination port, and transport protocol type) and hashes it into a 20-bit value, which is then stored in the cache.

[0028] After IPv4 traffic is routed into the tunnel, it is encapsulated in an outer IPv6 layer. During encapsulation, the outer IPv6 flow label is assigned the 20-bit hash value previously recorded in the cache table.

[0029] As a further preferred embodiment of the traffic statistics method of the IPv4 over IPv6 tunnel of the present invention, in step 2.1, Flow Label is assigned by means of inner-layer message mapping. Specifically, statistics on the inner-layer bare IPv4 traffic are configured on the dual-stack gateway. The protocol stack assigns a mark to ML in the IP header of all inner-layer IPv4 messages, and assigns a value of ML=01; wherein ML=01 represents the inner-layer bare IP traffic.

[0030] At this point, the protocol stack extracts the source and destination address values ​​from the IP quintuple of the IPv4 traffic and hashes them into a 20-bit value, which is then stored in the cache.

[0031] After the IPv4 traffic is routed into the tunnel, it is encapsulated in an outer IPv6 layer. During encapsulation, the outer IPv6 flow label is assigned the 20-bit hash value previously recorded in the cache table.

[0032] As a further preferred embodiment of the traffic statistics method of the IPv4overIPv6 tunnel of the present invention, in step 2.1, Flow Label is assigned by inner layer message mapping. Specifically, when the inner layer IPv4 TCP traffic statistics are configured on the dual stack gateway, the protocol stack assigns the ML value in the IP header of all inner layer IPv4 messages to ML=10; wherein ML=10 represents the inner layer TCP traffic;

[0033] At this point, the protocol stack extracts the source address, destination address, source port, destination port, and TCP protocol number from the IP quintuple of the IPv4 traffic and hashes them into a 20-bit value, which is then recorded in the cache.

[0034] After the IPv4 traffic is routed into the tunnel, it is encapsulated in an outer IPv6 layer. During encapsulation, the outer IPv6 flow label is assigned the 20-bit hash value previously recorded in the cache table.

[0035] As a further preferred embodiment of the traffic statistics method of the IPv4overIPv6 tunnel of the present invention, in step 2.1, Flow Label assignment is performed by inner layer message mapping. Specifically, when statistics on the UDP traffic of the inner layer IPv4 are configured on the dual stack gateway, the protocol stack assigns a mark to the ML in the IP header of all inner layer IPv4 messages, and assigns a value of ML=11; wherein ML=11 represents the inner layer UDP traffic;

[0036] At this point, the protocol stack extracts the source address, destination address, source port, destination port, and UDP protocol number from the IP quintuple of the IPv4 traffic and hashes them into a 20-bit value, which is then recorded in the cache.

[0037] After the IPv4 traffic is routed into the tunnel, it is encapsulated in the outer IPv6 layer. During the encapsulation, the outer IPv6 flow label is assigned the 20-bit hash value previously recorded in the cache table. After the different types of inner IPv4 traffic are mapped to the outer IPv6 flow label, the statistics of the inner message can be completed by counting the flow label of the outer IPv6 header.

[0038] As a further preferred embodiment of the traffic statistics method of the IPv4 over IPv6 tunnel of the present invention, in step 3, the IPFIX traffic statistics process based on the IPv6 flow label specifically includes the following steps:

[0039] In step 3.1, the dual-stack gateway assigns a value to the ML according to different configuration requirements and performs flow label mapping based on the assigned value;

[0040] In step 3.2, the inner IPv4 TCP traffic of the IPv4 over IPv6 tunnel is counted. The dual-stack gateway first assigns ML to 10 and hashes the inner IPv4 five-tuple and maps it to the outer IPv6 flow label during encapsulation.

[0041] In step 3.3, when IPFIX is enabled on the interface of the dual-stack gateway, the IPFIX module counts different flow labels as different TCP flows, and generates active and inactive flows based on the outer IPv6 flow label; when the flow ages, it is reported in Netflow format and reported to the NMS network management station for statistical analysis.

[0042] Compared with the prior art, the present invention adopts the above technical solution and has the following technical effects:

[0043] 1. The present invention uses the optional field in the TOS service type of the inner IPv4 message to define different types of flow applications, and maps different types of traffic to different mapping labels, thereby realizing traffic statistics in the inner layer subdivision dimension and refining the granularity of traffic statistics. At the same time, statistics on tunnel traffic only rely on the outer IPv6 flow label, which improves statistical efficiency and greatly reduces CPU overhead.

[0044] 2. The present invention maps the flow characteristics of the inner layer message to the outer layer IPv6 flow label, so that IPFIX statistics of the outer layer IPv6 flow label can count the inner layer IPv4 traffic, thereby improving statistical efficiency and reducing CPU overhead;

[0045] 3. This invention uses the last two reserved bits of the TOS field to define a Mapping Label and designs a Mapping Label code table to finely classify inner IPv4 traffic and refine the granularity of traffic statistics.

[0046] 4. The present invention proposes a mapping idea and implementation plan for the inner IPv4 message flow characteristics, and performs IPv6 flow label mapping through the inner IP quintuple;

[0047] 5. The present invention proposes a new method for counting inner original messages of IPv4 over IPv6 tunnel traffic, so that the gateway only needs the outer IPv6 header to identify the traffic, thereby improving the identification efficiency and reducing the CPU overhead. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.

[0049] FIG1 is a schematic diagram of an IPv4 over IPv6 tunnel networking according to the present invention;

[0050] FIG2 is an IPv4 over IPv6 tunnel encapsulation process of the present invention;

[0051] FIG3 is an IPv4 over IPv6 tunnel decapsulation process of the present invention;

[0052] FIG4 is a message structure of the first 4 bytes of the IPv4 header of the present invention;

[0053] FIG5 is a diagram showing the first 4 bytes of the IPv4 header after modification of the present invention;

[0054] FIG6 is a Mapping Label code table of the present invention;

[0055] FIG7 is an IPv6 message structure of the present invention;

[0056] 8 is a schematic diagram of the present invention, IPv4 over IPv6 tunnel traffic inner layer message statistics network;

[0057] FIG9 is a diagram of the statistical process of the dual-stack gateway IPFIX module of the present invention using the outer IPv6 flow label. DETAILED DESCRIPTION

[0058] The technical solution of the present invention is further described in detail below with reference to the accompanying drawings:

[0059] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. The present invention is described in detail below based on the drawings and preferred embodiments. The purpose and effect of the present invention will become more clear. It should be understood that the specific embodiments described here are only used to explain the present invention and are not used to limit the present invention.

[0060] The present invention provides a method for traffic statistics in an IPv4 over IPv6 tunnel. A method for mapping an inner IPv4 message to an outer IPv6 flow label in an IPv4 over IPv6 tunnel is proposed. At the same time, the optional fields in the TOS service type of the inner IPv4 message are used to define different types of flow applications. Different types of traffic are mapped to different mapping labels, thereby achieving traffic statistics in the inner layer's subdivided dimensions and refining the granularity of traffic statistics. At the same time, statistics on tunnel traffic only rely on the outer IPv6 flow label, which improves statistical efficiency and greatly reduces CPU overhead.

[0061] The last two reserved bits of the TOS field are used to define mapping labels and design a mapping label code table to fine-tune the classification of inner IPv4 traffic and refine the granularity of traffic statistics.

[0062] The paper proposes a mapping strategy and implementation plan for the inner IPv4 packet flow characteristics, and uses the inner IP quintuple to map the IPv6 flow label.

[0063] A new method for counting inner original packets in IPv4 over IPv6 tunnel traffic is proposed. This method allows gateways to identify traffic using only the outer IPv6 header, improving identification efficiency and reducing CPU overhead.

[0064] IPv4 is the Internet Protocol Version 4, the full spelling is Internet Protocol Version 4;

[0065] IPv6 is the Internet Protocol Version 6, the full spelling is Internet Protocol Version 6;

[0066] IPFIX stands for IP Flow Information Export.

[0067] NSM stands for Network Management Station.

[0068] TOS stands for Type of Service.

[0069] DSCP stands for Differentiated Services Code Point.

[0070] Specific embodiments of the present invention are as follows:

[0071] The reserved field of the ToS field of the inner IPv4 packet is used to define the flow mapping switch. Different values ​​represent different types of traffic for mapping.

[0072] The inner IPv4 quintuple is hashed to produce a 20-bit value, which is mapped to the outer IPv6 flow label.

[0073] The IPFIX protocol uses IPv6 flow labels to perform traffic statistics;

[0074] The inner-layer flow segmentation definition process is as follows: IPv4 over IPv6 tunneling technology encapsulates IPv4 packets within IPv6 packets, enabling transmission across isolated IPv4 networks within an IPv6 backbone network. The dual-stack gateway in the backbone network performs IPv4 and IPv6 encapsulation and decapsulation. After receiving an IPv4 packet, the dual-stack gateway routes the packet into the tunnel and performs tunnel encapsulation. The encapsulation process is shown in Figure 2. At the tunnel endpoint, the traffic is decapsulated to restore the inner IPv4 packet. The decapsulation process is shown in Figure 3.

[0075] The first 4 bytes of the original IP header are shown in Figure 4, where the service type field occupies a total of 1 byte. RFC2474 defines the service type field and defines the first 6 bits as DSCP, which is used for traffic marking and quality of service. The last 2 bits are the CU reserved field (CU, currently unused). In this solution, the TOS (Type of Service) field is modified, mainly by defining the last 2 bits that are not defined in the RFC standard as Mapping Label, as shown in Figure 5. In this way, there is a mapping label Mapping Label in the IP header to mark the flow type. On the dual-stack gateway, different types of traffic can be mapped to the outer IPv6 flow label according to the actual scenario. Since the Mapping Label has only 2 bits, it can only mark 4 types of traffic. Among them, ML=00 represents all inner IPv4 traffic, ML=01 represents inner bare IP traffic, ML=10 represents inner TCP traffic, and ML=11 represents inner UDP traffic. The Mapping Label code table definition is shown in Figure 6;

[0076] The inner IPv4 message mapping process is as follows: The main significance of mapping the inner message to the outer layer is that when performing traffic statistics, only the outer IPv6 header needs to be checked to perform traffic statistics, and there is no need to continue to decapsulate the inner layer.

[0077] The outer IPv6 header structure is shown in FIG7 , where the last 20 bits of the first 4 bytes are the Flow Label field.

[0078] The IETF standardization committee has not yet clearly defined how to use this field; it only recommends using it for traffic labeling. The solution here is to assign flow labels through inner packet mapping.

[0079] When statistics are configured on all inner IPv4 traffic on a dual-stack gateway, the protocol stack assigns the ML value in the IP header of all inner IPv4 packets to ML = 00. The protocol stack then extracts the IP quintuple of the IPv4 traffic—source address, destination address, source port, destination port, and transport protocol type—and hashes it into a 20-bit value, which it then stores in a cache. After the IPv4 traffic is routed into the tunnel, it undergoes outer IPv6 encapsulation, assigning the outer IPv6 flow label the same hash value previously stored in the cache.

[0080] When statistics are configured for inner raw IPv4 traffic on a dual-stack gateway, the protocol stack assigns the ML value 01 to the IP header of all inner IPv4 packets. The protocol stack then extracts the source and destination address values ​​from the IP quintuple of the IPv4 traffic and hashes them into a 20-bit value, which is then stored in the cache. After the IPv4 traffic is routed into the tunnel, it undergoes outer IPv6 encapsulation, assigning the outer IPv6 flow label the same hash value previously stored in the cache.

[0081] When statistics are configured for inner IPv4 TCP traffic on a dual-stack gateway, the protocol stack assigns an ML value of 10 to the IP header of all inner IPv4 packets. The protocol stack then extracts the IP quintuple of the IPv4 traffic—source address, destination address, source port, destination port, and TCP protocol number—and hashes it into a 20-bit value, which it then stores in a cache. After the IPv4 traffic is routed into the tunnel, it undergoes outer IPv6 encapsulation, assigning the outer IPv6 flow label the same hash value previously stored in the cache.

[0082] When configuring statistics on the UDP traffic of the inner IPv4 on the dual-stack gateway, the protocol stack will assign a value of ML to the IP header of all the inner IPv4 packets, and assign a value of ML=11. At this time, the protocol stack extracts the value of the source address, destination address, source port, destination port, and UDP protocol number in the IP quintuple of the IPv4 traffic and hashes it into a 20-bit value, and records the value in the cache. After the IPv4 traffic is routed into the tunnel, it is encapsulated in the outer IPv6 layer. 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 flow label of the outer IPv6. Statistics on the inner packets can be completed by only counting the flow label of the outer IPv6 header, which improves statistical efficiency.

[0083] The IPFIX traffic statistics process based on IPv6 flow labels is as follows: In the IPv4 over IPv6 tunnel scenario, the inner IPv4 packet's five-tuple 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 statistics of different traffic flows.

[0084] IPFIX stands for IP Flow Information eXport, which translates to IP flow information export. The main principle of IPFIX is to upload IPFIX templates to the Network Management Station (NSM) for flow analysis based on traffic aging. IPFIX flow monitoring and analysis capabilities can be applied to network and application monitoring, network planning, security analysis, traffic billing, and network traffic engineering. A typical application scenario is shown in Figure 8.

[0085] The dual-stack gateway assigns a value to ML based on different configuration requirements and performs flow label mapping based on the assigned value. For example, if a customer wants to count the inner IPv4 TCP traffic of an IPv4 over IPv6 tunnel, the dual-stack gateway first assigns a value to ML of 10, hashes the inner IPv4 IP five-tuple, and maps it to the outer IPv6 flow label during encapsulation. When IPFIX is enabled on the interface of the dual-stack gateway, IPFIX outputs data flow information (IP Flow Information Export, IP). The IPFIX module counts different flow labels as different TCP flows and generates active and inactive flows based on the outer IPv6 flow label. When the flow ages, it is reported in Netflow format and reported to the NMS network management site for statistical analysis. The entire process is shown in Figure 9.

[0086] This invention proposes a new embodiment, which relates to a method for traffic statistics in an IPv4 over IPv6 tunnel. This method primarily maps the flow characteristics of inner packets onto outer IPv6 flow labels, enabling IPFIX statistics on the outer IPv6 flow labels to include the inner IPv4 traffic, thereby improving statistical efficiency and reducing CPU overhead.

[0087] The present invention uses the last two reserved fields of the TOS field to define the Mapping Label and designs a Mapping Label code table to finely classify the inner IPv4 traffic and refine the granularity of traffic statistics.

[0088] The present invention proposes a mapping idea and implementation scheme for the inner IPv4 message flow characteristics, and performs IPv6 flow label mapping through the inner IP quintuple;

[0089] The present invention proposes a new method for counting inner layer original messages of IPv4 over IPv6 tunnel traffic, so that the gateway only needs the outer layer IPv6 header to identify the traffic, thereby improving the identification efficiency and reducing the CPU overhead.

[0090] Those skilled in the art will understand that the above descriptions are merely preferred embodiments of the invention and are not intended to limit the invention. Although the invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art will still be able to modify the technical solutions described in the aforementioned embodiments or substitute equivalents for some of the technical features. Any modifications, equivalent substitutions, etc. made within the spirit and principles of the invention shall be included within the scope of protection of the invention. All technical features in this embodiment may be freely combined according to actual needs.

[0091] Finally, it should be noted that the above 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 aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for counting traffic in an IPv4overIPv6 tunnel, characterized in that: The specific steps include: Step 1, define different types of flow applications using the optional fields in the TOS of the inner IPv4 message; Step 2: Map different types of traffic for different mapping labels, which are used for traffic statistics of inner subdivision dimensions and refine the granularity of traffic statistics; Step 3: Complete traffic statistics based on IPFIX of IPv6 flow labels.

2. The method for counting traffic in an IPv4overIPv6 tunnel according to claim 1, characterized in that: In step 1, the inner layer segmentation flow definition process includes the following steps: Step 2.1: After receiving the IPv4 message, the dual-stack gateway checks the route into the tunnel and performs tunnel encapsulation; Step 2.2, decapsulate the tunnel encapsulation and restore the inner IPv4 message; Step 2.3, modify the TOS service type field and define the last two bits that are not defined in the RFC standard as the mapping label.

3. The method for counting traffic of an IPv4 over IPv6 tunnel according to claim 1, characterized in that: 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, define the service type field, and define the first 6 bits as DSCP, which is used for traffic marking and quality of service; the last 2 bits are CU reserved fields; DSCP is the Differentiated Services Code Point.

4. The method for counting traffic of an IPv4 over IPv6 tunnel according to claim 1, characterized in that: In step 2.3, the mapping label contains 2 bits, which are used to mark 4 types of traffic.

5. The method for counting traffic of an IPv4 over IPv6 tunnel according to claim 1, characterized in that: The inner IPv4 message mapping process is as follows: Step 2.1, assigning Flow Label by inner message mapping; Flow Label is a flow label; Step 2.2: After the IPv4 traffic is routed into the tunnel, it is encapsulated in the outer IPv6 layer. During encapsulation, the outer IPv6 flow label is assigned the 20-bit hash value previously recorded in the cache table. The different types of inner IPv4 traffic are mapped to the outer IPv6 flow labels. Statistics on the flow labels of the outer IPv6 header can complete the statistics of the inner messages.

6. The method for counting traffic of an IPv4 over IPv6 tunnel according to claim 5, characterized in that: In step 2.1, flow labels are assigned by inner message mapping, as follows: When statistics are configured on all inner IPv4 traffic on the dual-stack gateway, the protocol stack will assign a value of ML to the IP header of all inner IPv4 packets, with the value being ML=00. ML=00 represents all inner IPv4 traffic. The protocol stack extracts the IP quintuple of IPv4 traffic, namely the 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. After the IPv4 traffic is routed into the tunnel, it is encapsulated in the outer IPv6 layer. During encapsulation, the outer IPv6 flow label is assigned the 20-bit hash value previously recorded in the cache table.

7. The method for counting traffic of an IPv4 over IPv6 tunnel according to claim 5, characterized in that: In step 2.1, the Flow Label is assigned by inner layer message mapping. Specifically, the inner layer bare IPv4 traffic is counted on the dual stack gateway. The protocol stack assigns a value of ML in the IP header of all inner layer IPv4 messages to ML=01. ML=01 represents the inner layer bare IP traffic. At this time, the protocol stack extracts the source address and destination address values ​​in the IP quintuple of the IPv4 traffic and hashes them into a 20-bit value, which is recorded in the cache. After the IPv4 traffic is routed into the tunnel, it is encapsulated in the outer IPv6 layer. During encapsulation, the outer IPv6 flow label is assigned the 20-bit hash value previously recorded in the cache table.

8. The method for counting traffic of an IPv4 over IPv6 tunnel according to claim 5, characterized in that: In step 2.1, the Flow Label is assigned by inner layer message mapping. Specifically, when the statistics of the inner layer IPv4 TCP flow are configured on the dual stack gateway, the protocol stack will assign the ML value in the IP header of all inner layer IPv4 messages to ML=10; where ML=10 represents the inner layer TCP flow; At this time, the protocol stack extracts the values ​​of the source address, destination address, source port, destination port, and TCP protocol number in the IP quintuple of the IPv4 traffic and hashes them into a 20-bit value, and records the value in the cache; After the IPv4 traffic is routed into the tunnel, it is encapsulated in the outer IPv6 layer. During encapsulation, the outer IPv6 flow label is assigned the 20-bit hash value previously recorded in the cache table.

9. The method for counting traffic of an IPv4 over IPv6 tunnel according to claim 5, characterized in that: In step 2.1, the Flow Label is assigned by inner layer message mapping. Specifically, when the statistics of the inner layer IPv4 UDP traffic are configured on the dual stack gateway, the protocol stack will assign the ML value in the IP header of all inner layer IPv4 messages to ML=11. Among them, ML=11 represents the inner layer UDP traffic. At this time, the protocol stack extracts the values ​​of the source address, destination address, source port, destination port, and UDP protocol number in the IP quintuple of the IPv4 traffic and hashes them into a 20-bit value, and records the value in the cache; After the IPv4 traffic is routed into the tunnel, it is encapsulated in the outer IPv6 layer. During encapsulation, the outer IPv6 flow label is assigned the 20-bit hash value previously recorded in the cache table. After the different types of inner IPv4 traffic are mapped to the outer IPv6 flow label, the statistics of the inner message can be completed by counting the flow label of the outer IPv6 header.

10. The method for counting traffic of an IPv4 over IPv6 tunnel according to claim 1, characterized in that: In step 3, the IPFIX flow statistics process based on IPv6 flow labels specifically includes the following steps: Step 3.1: The dual-stack gateway assigns a value to ML according to different configuration requirements and performs flow label mapping based on the assigned value; 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 hashes the inner IPv4 IP quintuple and maps it to the outer IPv6 flow label during encapsulation. Step 3.3, when IPFIX is enabled on the interface of the dual-stack gateway, the IPFIX module counts different flow labels as different TCP flows and generates active flows and inactive flows based on the outer IPv6 flow label; When the flow ages, it is reported in Netflow format and sent to the NMS network management site for statistical analysis.

Citation Information

Patent Citations

  • Message screening device and method in IPFIX output device

    CN103916289A

  • Statistical method and system for virtual machine traffic in cloud network

    CN116055341A

  • Traffic statistical method for IPv4overIPv6 tunnel

    CN117857400A

  • System and method for traffic analysis

    JP2017098907A

  • PRESERVING QUALITY OF SERVICE (QoS) MARKINGS FOR DOWNSTREAM FLOWS

    US20220368640A1