Message processing method and device

By parsing and reassembling IPv4 fragments in the egress device of the IPv6 tunnel, network problems caused by fragmented transmission of IPv4 messages in the IPv6 network domain are solved, ensuring that downstream network devices can execute security policies and improving network security and performance.

CN118740773APending Publication Date: 2024-10-01HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310352597.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-30
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

When IPv4 service packets are transmitted through IPv6 tunnels, they may be fragmented due to MTU restrictions, resulting in network problems when the egress edge device of the IPv6 network domain forwards them to the downstream network domain. For example, security policies and ACL policies cannot take effect, causing security problems. Hazards and cyberattacks.

Method used

In the egress device of the IPv6 tunnel, it parses the indication information in the IPv6 message and reassembles the fragments to obtain the complete IPv4 message, thereby avoiding the continued transmission of fragments to the downstream network domain and solving network problems. This method can use the flags field of SRH or the reserved field of the fragment extension header to carry indication information in the SRv6 tunnel, and multiplex the fragmentation information in the fragmentation information of the IPv4 message.

Benefits of technology

It effectively avoids network problems caused by direct transmission fragmentation, ensures that downstream network devices can execute security policies and ACL policies, and improves network security and performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118740773A_ABST
    Figure CN118740773A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a message processing method which can be applied to first network equipment serving as exit equipment of an IPv6 tunnel. A first network device can receive a first IPv6 message, the first IPv6 message comprises first indication information, and the first indication information indicates that the first IPv6 message comprises a first fragment of an IPv4 message. After a first network device receives a first IPv6 message, the first IPv6 message can be analyzed to obtain the first indication information, and correspondingly, the first fragment is recombined according to the first indication information to obtain the IPv4 message. Therefore, by utilizing the scheme, the first network equipment does not directly transmit the first fragment to the downstream network domain, but recombines the first fragment to obtain the IPv4 message, and by adopting the mode, the network problem caused by directly transmitting the first fragment to the downstream network domain can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communications, and in particular to a message processing method and device. Background Art

[0002] When using Internet Protocol Version 6 (IPv6) tunnel to transmit Internet Protocol Version 4 (IPv4) service messages, in order to prevent IPv4 service messages from being discarded due to exceeding the maximum transmission unit (MTU) supported by the network device after adding IPv6 tunnel encapsulation, the IPv4 service messages can be fragmented, and then IPv6 tunnel encapsulation can be added to each fragment. In one example, the ingress edge device of the IPv6 network domain can fragment the IPv4 service message, and then add IPv6 tunnel encapsulation to each fragment. For more information about MTU, please refer to

[0003] However, when the IPv4 service message is forwarded by the egress edge device of the IPv6 network domain to other network domains in the above manner, a series of network problems may occur. Therefore, a solution is urgently needed to solve the above problems. Summary of the invention

[0004] An embodiment of the present application provides a message processing method, in which the exit device of the IPv6 tunnel can reassemble fragments to obtain IPv4 messages, so that the fragments of the IPv4 messages are no longer transmitted to the downstream network domain. Accordingly, network problems caused by the fragments of the IPv4 messages continuing to be transmitted to the downstream network domain can be avoided.

[0005] In the first aspect, an embodiment of the present application provides a message processing method, which can be applied to a first network device as an exit device of an IPv6 tunnel. The first network device can receive a first IPv6 message, wherein the first IPv6 message includes first indication information, and the first indication information indicates that the first IPv6 message includes a first fragment of an IPv4 message. After receiving the first IPv6 message, the first network device can parse the first IPv6 message to obtain the first indication information, and accordingly, reassemble the first fragment according to the first indication information to obtain the IPv4 message. It can be seen that, using this solution, the first network device does not directly transmit the first fragment to the downstream network domain, but reassembles the first fragment to obtain the IPv4 message. In this way, network problems caused by directly transmitting the first fragment to the downstream network domain can be avoided.

[0006] In one possible implementation, the IPv6 tunnel may be an Internet Protocol Version 6 Segment Routing (SRv6) tunnel, and accordingly, the first IPv6 message may be an SRv6 message. In this case, the first IPv6 message may include a segment routing header (SRH), and the aforementioned first indication information is carried in the SRH. In this case, the first network device may parse the SRH to obtain the first indication information, and further reassemble the first fragment based on the first indication information to obtain the IPv4 message. In this way, network problems caused by directly transmitting the first fragment to the downstream network domain can be avoided.

[0007] In a possible implementation, considering that the flags field of the SRH is not currently used, the flags field in the SRH can be used to carry the first indication information. In this way, the first network device can parse the flags field of the SRH to obtain the first indication information, and further reassemble the first fragment based on the first indication information to obtain the IPv4 message. In this way, network problems caused by directly transmitting the first fragment to the downstream network domain can be avoided.

[0008] In a possible implementation, the first IPv6 message may include a fragment extension header, and the first indication information may be carried by the fragment extension header. In this way, the first network device may parse the fragment extension header to obtain the first indication information, and further reassemble the first fragment based on the first indication information to obtain the IPv4 message. In this way, network problems caused by directly transmitting the first fragment to the downstream network domain may be avoided.

[0009] In a possible implementation, considering that the reserved field in the fragment extension header is not currently used, the reserved field in the fragment extension header can be used to carry the first indication information. In this way, the first network device can parse the reserved field in the fragment extension header to obtain the first indication information, and further reassemble the first fragment based on the first indication information to obtain the IPv4 message. In this way, network problems caused by directly transmitting the first fragment to the downstream network domain can be avoided.

[0010] In a possible implementation, the first IPv6 message includes an IPv4 header corresponding to the first fragment. In an example, the first indication information may be carried in the IPv4 header corresponding to the first fragment. In a specific example, the IPv4 header corresponding to the first fragment may include fragment information, and the first indication information may be the fragment information. In this case, there is no need to extend the IPv6 extension header to carry the first indication information, and the fragment information in the IPv4 header corresponding to the first fragment may be reused as the first indication information. Accordingly, the first network device may parse the IPv4 header corresponding to the first fragment to obtain the first indication information, and further reassemble the first fragment based on the first indication information to obtain the IPv4 message. In this way, network problems caused by directly transmitting the first fragment to a downstream network domain may be avoided.

[0011] In a possible implementation, the multiple fragments included in the IPv4 message may include a second fragment in addition to the first fragment. In this case, the first network device may also receive a second IPv6 message, the second IPv6 message includes second indication information, and the second indication information indicates that the second IPv6 message includes the second fragment of the IPv4 message. Accordingly, when the first network device reassembles the first fragment to obtain the IPv4 message, the first fragment and the second fragment may be reassembled to obtain the IPv4 message.

[0012] In a possible implementation, the first network device supports reassembling the fragments of the IPv4 message, for example, the first network device is pre-configured with a function of reassembling the fragments of the IPv4 message. Accordingly, when the first network device determines that it supports reassembling the fragments of the IPv4 message, it reassembles the first fragment to obtain the IPv4 message according to the first indication information. In this way, network problems caused by directly transmitting the first fragment to the downstream network domain can be avoided.

[0013] In the second aspect, an embodiment of the present application provides a message processing method, which can be applied to a second network device as an entry device of an IPv6 tunnel. The second network device can receive an IPv4 message and fragment the IPv4 message to obtain multiple fragments including a first fragment. After the second network device obtains the first fragment, it can obtain a first IPv6 message based on the first fragment, and the first IPv6 message includes first indication information, and the first indication information indicates that the first IPv6 message includes the first fragment of the IPv4 message. Correspondingly, after receiving the first IPv6 message, the first network device as the exit device of the IPv6 tunnel can reassemble the first fragment according to the first indication information to obtain the IPv4 message. It can be seen that by using this solution, network problems caused by the exit device of the IPv6 tunnel directly transmitting the first fragment to the downstream network domain can be avoided.

[0014] In a possible implementation manner, the first IPv6 packet includes a first segment routing header (SRH), and the first indication information is carried in the first SRH.

[0015] In a possible implementation manner, the first indication information is carried in an identification flags field of the SRH.

[0016] In a possible implementation manner, the first IPv6 message includes a fragment extension header, and the first indication information is carried in the fragment extension header.

[0017] In a possible implementation manner, the first indication information is carried in a reserved field of the slice extension header.

[0018] In a possible implementation, the first indication information is carried in an IPv4 header corresponding to the first fragment.

[0019] In a possible implementation, after receiving the IPv4 message, the second network device may determine the need to fragment the IPv4 message based on the maximum message length supported by the IPv6 tunnel. In an example, the second network device may first determine the length of the IPv6 message obtained after the IPv4 message is encapsulated in IPv6, and then determine whether the length of the obtained IPv6 message is greater than the maximum message length supported by the IPv6 tunnel. If the length of the obtained IPv6 message is greater than the maximum message length supported by the IPv6 tunnel, if the second network device directly performs IPv6 encapsulation on the IPv4 message, the encapsulated IPv6 message may be lost when it is transmitted in the IPv6 tunnel. In order to avoid this problem, the second network device, when determining that the message length of the IPv6 message obtained by encapsulating the IPv4 message exceeds the maximum message length supported by the IPv6 tunnel, fragments the IPv4 message to obtain multiple fragments. In an example, the multiple fragments may include the first fragment.

[0020] In a possible implementation manner, after obtaining the first IPv6 packet, the second network device may send the first IPv6 packet to a third network device, and the third network device may be an intermediate device of the IPv6 tunnel.

[0021] In a specific example, the third network device may be a device that applies the hierarchy of virtual private network (HoVPN) technology. In this case, if the first IPv6 message includes a first SRH and the first indication information is carried in the first SRH, the third network device may add the first indication information to the second SRH when replacing the first SRH with the second SRH, thereby obtaining a second IPv6 message. In this way, the second IPv6 message also includes the first fragment and the first indication information. Further, the third network device may forward the second IPv6 message to the first network device, which is the exit device of the IPv6 tunnel. Accordingly, the first network device may reassemble the first fragment to obtain the IPv4 message according to the first indication information carried in the second IPv6 message. In this way, network problems caused by directly transmitting the first fragment to the downstream network domain may be avoided.

[0022] In another specific example, the third network device may be a device to which the HoVPN technology is applied. In this case, if the first IPv6 message includes a first SRH, and the first indication information is carried in the first SRH. Then the third network device may first reassemble the first fragment to obtain the IPv4 message, and fragment the IPv4 message to obtain multiple fragments including the second fragment. Further, each of the multiple fragments including the second fragment may be respectively encapsulated with IPv6. Taking the second fragment as an example, the third network device may encapsulate the second fragment to obtain a third IPv6 message. The third IPv6 message may include the second fragment and the third SRH. In an embodiment of the present application, the third SRH includes a second indication information, and the second indication information is used to indicate that the third IPv6 message includes the second fragment of the IPv4 message. In addition, the third IPv6 message may also include an IPv6 header and an IPv4 header corresponding to the second fragment. As an example, after obtaining the third IPv6 message, the third network device can forward the third IPv6 message to the first network device, which is the exit device of the IPv6 tunnel. Accordingly, the first network device can reassemble the second fragment to obtain the IPv4 message based on the second indication information carried in the third IPv6 message. In this way, network problems caused by directly transmitting the first fragment to the downstream network domain can be avoided.

[0023] In a third aspect, an embodiment of the present application provides a message processing device, which is applied to a first network device, and the device includes: a receiving unit, which is used to receive a first Internet Protocol version 6 IPv6 message, wherein the first IPv6 message includes first indication information, and the first indication information indicates that the first IPv6 message includes a first fragment of an Internet Protocol version 4 IPv4 message, and the first network device is an exit device of the IPv6 tunnel; a processing unit, which is used to reassemble the first fragment according to the first indication information to obtain the IPv4 message.

[0024] In a possible implementation manner, the first IPv6 message includes a segment routing header (SRH), and the first indication information is carried in the SRH.

[0025] In a possible implementation manner, the first indication information is carried in an identification flags field of the SRH.

[0026] In a possible implementation manner, the first IPv6 message includes a fragment extension header, and the first indication information is carried in the fragment extension header.

[0027] In a possible implementation manner, the first indication information is carried in a reserved field of the slice extension header.

[0028] In a possible implementation, the first indication information is carried in an IPv4 header corresponding to the first fragment.

[0029] In a possible implementation, the receiving unit is also used to receive a second IPv6 message, the second IPv6 message includes second indication information, and the second indication information indicates that the second IPv6 message includes the second fragment of the IPv4 message; the processing unit is used to: reassemble the first fragment and the second fragment to obtain the IPv4 message.

[0030] In a possible implementation, the first network device supports reassembly of fragments of the IPv4 message.

[0031] In a fourth aspect, an embodiment of the present application provides a message processing device, which is applied to a second network device, and the device includes: a receiving unit, which is used to receive an IPv4 message, and the second network device is an entry device of an Internet Protocol version 6 IPv6 tunnel; a processing unit, which is used to fragment the IPv4 message to obtain multiple fragments including a first fragment, and obtain a first IPv6 message based on the first fragment, wherein the first IPv6 message includes first indication information, and the first indication information indicates that the first IPv6 message includes the first fragment of the IPv4 message.

[0032] In a possible implementation manner, the first IPv6 packet includes a first segment routing header (SRH), and the first indication information is carried in the first SRH.

[0033] In a possible implementation manner, the first indication information is carried in an identification flags field of the SRH.

[0034] In a possible implementation manner, the first IPv6 message includes a fragment extension header, and the first indication information is carried in the fragment extension header.

[0035] In a possible implementation manner, the first indication information is carried in a reserved field of the slice extension header.

[0036] In a possible implementation, the first indication information is carried in an IPv4 header corresponding to the first fragment.

[0037] In a possible implementation, the processing unit is further used to: before fragmenting the IPv4 message, determine that the message length of the IPv6 message obtained by encapsulating the IPv4 message exceeds the maximum message length supported by the IPv6 tunnel.

[0038] In one possible implementation, the device also includes: a sending unit, used to send the first IPv6 message to a third network device, so that the third network device replaces the first SRH in the first IPv6 message with a second SRH to obtain a second IPv6 message, wherein the second SRH includes the first indication information, and the third network device is an intermediate device of the IPv6 tunnel.

[0039] In a possible implementation, the device also includes: a sending unit, used to send the first IPv6 message to a third network device, so that the third network device reassembles the first fragment to obtain the IPv4 message, and fragments the IPv4 message to obtain a second fragment, and obtains a third IPv6 message based on the second fragment, the third IPv6 message includes a third SRH, the third SRH includes second indication information, the second indication information indicates that the third IPv6 message includes the second fragment of the IPv4 message, and the third network device is an intermediate device of the IPv6 tunnel.

[0040] In a fifth aspect, an embodiment of the present application provides a device. The device includes a processor and a memory. The memory is used to store instructions or computer programs. The processor is used to execute the instructions or computer programs in the memory, execute any one of the methods described in the first aspect above, or execute any one of the methods described in the second aspect above.

[0041] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, including instructions or a computer program, which, when executed on a computer, enables the computer to execute any of the methods described in the first aspect above, or execute any of the methods described in the second aspect above.

[0042] In the seventh aspect, an embodiment of the present application provides a computer program product comprising instructions or a computer program, which, when executed on a computer, enables the computer to execute any method described in the first aspect above, or execute any method described in the second aspect above.

[0043] In an eighth aspect, an embodiment of the present application provides a communication system, comprising: a first network device executing the method described in the first aspect and any one of the first aspect, and a second network device executing the method described in the second aspect and any one of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0045] Figure 1a A schematic diagram of an exemplary application scenario provided for an embodiment of the present application;

[0046] Figure 1b A schematic diagram of fragmenting an IPv4 message provided in an embodiment of the present application;

[0047] Figure 2 A flowchart of a message processing method provided in an embodiment of the present application;

[0048] Figure 3 A schematic diagram of the structure of a slice extension header provided in an embodiment of the present application;

[0049] Figure 4 A flowchart of another message processing method provided in an embodiment of the present application;

[0050] Figure 5 A schematic diagram of the structure of a message processing device provided in an embodiment of the present application;

[0051] Figure 6 A schematic diagram of the structure of a device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] An embodiment of the present application provides a message processing method, which can avoid network problems caused by the fragments of IPv4 messages continuing to be transmitted to the downstream network domain of the IPv6 network domain.

[0053] See also Figure 1a , which is a schematic diagram of an exemplary application scenario provided in an embodiment of the present application.

[0054] like Figure 1aAs shown, the IPv4 network domain 110 and the IPv4 network domain 130 are connected via the IPv6 network domain 120. In one example, the edge device 121 of the IPv6 network domain 120 can receive an IPv4 message from the IPv4 network domain 110, and encapsulate the IPv4 message to obtain an IPv6 message based on IPv6 encapsulation. The encapsulation of the IPv4 message, for example, can be to add an IPv6 header on the basis of the IPv4 message, and of course, an IPv6 extension header can also be added. After the edge device 121 obtains the IPv6 message based on IPv6 encapsulation, the IPv6 message can be sent to the edge device 122 of the IPv6 network domain 120. The edge device 122 can decapsulate the IPv6 to obtain an IPv4 message from which the IPv6 encapsulation is removed, and further send the IPv4 message from which the IPv6 encapsulation is removed to the network domain 130. In one example, the IPv4 message decapsulated from IPv6 can be forwarded to its destination device through the network domain 130, and its destination device can be a terminal device. In one example, the edge device 121 can be an ingress device of the IPv6 tunnel, and the edge device 122 can be an egress device of the IPv6 tunnel.

[0055] In the IPv6 network domain 120, when an IPv6 device has a large amount of data to send to another device, the data is transmitted in the form of a series of IPv6 packets. These packets can have a size less than or equal to the path MTU. Regarding MTU, reference can be made to the relevant description section in request for comments (RFC) 8201, which will not be described in detail here.

[0056] exist Figure 1aIn the scenario shown, when the edge device 121 receives an IPv4 message from the IPv4 network domain 110, it will determine whether the length of the message based on IPv6 encapsulation after adding IPv6 encapsulation to the IPv4 message is greater than the aforementioned MTU. If the length of the message based on IPv6 encapsulation is greater than the aforementioned MTU, the edge device 121 can fragment the IPv4 message to obtain multiple fragments, and add IPv6 encapsulation to the multiple fragments respectively, thereby obtaining multiple messages based on IPv6 encapsulation. Among them, "message based on IPv6 encapsulation" can also be called "IPv6 message", and the two can be used interchangeably. For example, the MTU is 1500 bytes, the length of the IPv4 message received by the edge device 121 from the IPv4 network domain 110 is 1490 bytes, and the total length of the IPv6 header and the IPv6 extension header encapsulated on the basis of the IPv4 message is greater than 10 bytes. Therefore, after adding the IPv6 header and the IPv6 extension header to the IPv4 message, the length of the obtained IPv6 message exceeds 1500 bytes. Therefore, the edge device 121 can fragment the IPv4 message.

[0057] For reference Figure 1b To understand, Figure 1b A schematic diagram of fragmenting an IPv4 message provided in an embodiment of the present application. Figure 1b As shown, the IPv4 message 130 received by the edge device 121 includes an IPv4 header 131 and a payload 132. The payload 132 may include multiple fragments. Figure 1b 4 fragments are used as an example for explanation. The edge device 121 can add IPv6 encapsulation to the 4 fragments respectively to obtain 4 IPv6 messages, namely IPv6 message 140, IPv6 message 150, IPv6 message 160 and IPv6 message 170. The structures of these 4 IPv6 messages are similar, including an IPv6 header, a fragment and an IPv4 header corresponding to the fragment. Figure 1b Although not shown in the figure, the IPv6 message may also include an IPv6 extension header. For any of the four IPv6 messages, the IPv4 header included in the IPv6 message may carry fragmentation information, for example, a fragmentation flag and an offset. Figure 1bIn the embodiment, the fragmentation information included in the four IPv4 headers, namely, the IPv4 header 141 included in the IPv6 message 140, the IPv4 header 151 included in the IPv6 message 150, the IPv4 header 161 included in the IPv6 message 160, and the IPv4 header 171 included in the IPv6 message 170, is different, and the other contents may be the same. After the edge device 121 can send the aforementioned multiple IPv6 messages including fragments to the edge device 122, the edge device 122 can decapsulate each IPv6 to obtain an IPv4 message including fragments, and further forward the IPv4 message including fragments to the IPv4 network domain 130.

[0058] However, when adopting this method, there will be some problems when the fragmented IPv4 message is transmitted in the IPv4 network domain 130.

[0059] In one example, when executing security policies, security devices such as firewall devices in IPv4 network domain 130 need to use some information that is only carried in the first fragment, such as Transmission Control Protocol (TCP) information and User Datagram Protocol (UDP) information. Therefore, the security policy can only take effect on the first fragment, but not on subsequent fragments. Accordingly, the security device cannot execute the corresponding security policy for the entire IPv4 message including multiple fragments, thereby bringing security risks, for example, attackers use subsequent fragments to launch network attacks.

[0060] In another example, if the security device reassembles the fragments to obtain a reassembled IPv4 message, and executes a corresponding security policy based on the reassembled IPv4 message, however, this method will consume more resources of the security device and have a greater impact on the performance of the security device.

[0061] In another example, when network devices such as switches in the IPv4 network domain 130 execute access control lists (ACL) policies based on quintuples, since the quintuple information is carried in the first fragment, the ACL policy can only take effect on the first fragment but not on subsequent fragments. Accordingly, the execution of the ACL policy fails, thereby causing network problems. For example, a network attacker uses subsequent fragments to launch a network attack. For another example, the flow limiting of business flows for a specific quintuple fails.

[0062] In order to solve the above problems, an embodiment of the present application provides a message processing method. Next, the message processing method provided by the embodiment of the present application is introduced in conjunction with the accompanying drawings.

[0063] See also Figure 2 , which is a flow chart of a message processing method provided in an embodiment of the present application. Figure 2 The message processing method shown can be applied to a first network device, which can be an egress device of an IPv6 tunnel. Figure 2 The method shown is applied to Figure 1a In the application scenario shown, the first network device may correspond to the edge device 122 shown in FIG. 1 .

[0064] Figure 2 The message processing method shown may, for example, include the following S101 - S102 .

[0065] S101: A first network device receives a first IPv6 message, where the first IPv6 message includes first indication information, and the first indication information indicates that the first IPv6 message includes a first fragment of an IPv4 message.

[0066] The first network device may receive the first IPv6 message sent by an upstream device. The upstream device mentioned here may be an intermediate device of the IPv6 tunnel.

[0067] In one example, the IPv6 tunnel may be an SRv6 tunnel, and correspondingly, the first IPv6 message may be an SRv6 message. For this case, the first IPv6 message includes an SRH, and the first indication information may be carried by the SRH. In one example, an unused field in the SRH may be used to carry the first indication information. For example, the flags field of the SRH is not currently used, and the flags field in the SRH may be used to carry the first indication information. In another example, the SRH may be extended to extend a new field to carry the first indication information, which is not specifically limited in the embodiments of the present application.

[0068] In another example, the first IPv6 message may include a fragment extension header, and the first indication information may be carried by the fragment extension header. Figure 3 To understand, Figure 3 A schematic diagram of the structure of a slice extension header provided in an embodiment of the present application. Figure 3 As shown, the slice extension header may include: a next header, a slice offset field, an identification field, a more (M) flag, and two reserved fields. In one example, the first indication information may be carried in a reserved field of the slice extension header, for example, in Figure 3In the reserved field 301 shown. In another example, the slice extension header may be extended, and the extended field may be used to carry the first indication information, which is not specifically limited in the embodiment of the present application. Figure 3 The meaning of each field of the fragment extension header shown is not described in detail here.

[0069] As before for Figure 1b It can be seen from the description that the first IPv6 message includes an IPv4 header corresponding to the first fragment. In an example, the first indication information can be carried in the IPv4 header corresponding to the first fragment. In a specific example, the IPv4 header corresponding to the first fragment can include fragment information, and the first indication information can be the fragment information. In this case, there is no need to extend the IPv6 extension header to carry the first indication information, and the fragment information in the IPv4 header corresponding to the first fragment can be reused as the first indication information.

[0070] S102: The first network device reassembles the first fragments according to the first indication information to obtain the IPv4 message.

[0071] After receiving the first IPv6 message, the first network device may parse the first IPv6 message to obtain the first indication information, and further reassemble the first fragment based on the first indication information to obtain the IPv4 message. In one example, the first network device may reassemble multiple fragments including the first fragment to obtain the IPv4 message. In one example, the first network device may determine the order between the multiple fragments according to the fragment information carried in the IPv4 headers corresponding to the multiple fragments, and reassemble the multiple fragments according to the order to obtain the IPv4 message. The order between the multiple fragments may indicate the positions of the multiple fragments in the IPv4 message. For example, the IPv4 message includes two fragments, namely, fragment 1 and fragment 2. The order between fragment 1 and fragment 2 may be, for example, that fragment 1 is the first fragment of the IPv4 message and fragment 2 is the second fragment of the IPv4 message.

[0072] In one example, the multiple fragments included in the IPv4 message may include a second fragment in addition to the first fragment. In this case, the first network device may also receive a second IPv6 message, for example, the first network device may receive the second IPv6 message sent by an upstream device. The second IPv6 message includes second indication information, and the second indication information indicates that the second IPv6 message includes the second fragment of the IPv4 message. The carrying position of the second indication information in the second IPv6 message is the same as the carrying position of the first indication information in the first IPv6 message. For related content, please refer to the description part of the carrying position of the first indication information in the first IPv6 message, and no repeated description is made here.

[0073] Accordingly, when the first network device reassembles the first fragment to obtain the IPv4 message, in a specific implementation, it can be to reassemble the first fragment and the second fragment to obtain the IPv4 message. In a specific example, if the first network device receives the second IPv6 message before receiving the first IPv6 message, the first network device can, for example, first cache the IPv4 headers corresponding to the second fragment and the second fragment, and after receiving the first IPv6 message, read the cached second fragment, and further reassemble the first fragment and the second fragment to obtain the IPv4 message.

[0074] In one example, the first network device supports reassembling the fragments of the IPv4 message, for example, the first network device is pre-configured with the function of reassembling the fragments of the IPv4 message. Accordingly, when the first network device determines that it supports reassembling the fragments of the IPv4 message, the first network device reassembles the first fragments to obtain the IPv4 message according to the first indication information.

[0075] In one example, after the first network device reassembles the first fragment to obtain the IPv4 message, the IPv4 message can be sent to a downstream network domain. In this way, the network devices in the downstream network domain can execute corresponding policies based on the IPv4 message, such as security policies or ACL policies. Accordingly, the policies executed by the downstream network devices can take effect on the IPv4 message.

[0076] From the above description, it can be seen that using this solution, the first network device does not directly transmit the first fragment to the downstream network domain, but reassembles the first fragment to obtain the IPv4 message. In this way, network problems caused by directly transmitting the first fragment to the downstream network domain can be avoided.

[0077] The embodiment of the present application also provides a message processing method. Next, the message processing method is introduced in conjunction with the accompanying drawings.

[0078] See also Figure 4 , this figure is a flow chart of another message processing method provided in an embodiment of the present application. Figure 4 The message processing method shown in the figure can be applied to the second network device, which can be the inlet device of the IPv6 tunnel. Figure 4 The method shown is applied to Figure 1a In the application scenario shown, the first network device may correspond to the edge device 121 shown in FIG. 1 .

[0079] Figure 4 The message processing method shown may, for example, include the following S201-S203.

[0080] S201: The second network device receives an IPv4 message.

[0081] The second network device may receive the IPv4 message sent by the device in the IPv4 network domain, and the IPv4 message may include an IPv4 header and a payload. Figure 1a In the scenario shown, the edge device 121 may receive the IPv4 message sent by a device in the IPv4 network domain 110 .

[0082] S202: The second network device fragments the IPv4 message to obtain multiple fragments including the first fragment.

[0083] After receiving the IPv4 message, the second network device may determine the need to fragment the IPv4 message based on the maximum message length supported by the IPv6 tunnel. In one example, the second network device may first determine the length of the IPv6 message obtained after performing IPv6 encapsulation on the IPv4 message, and then determine whether the length of the obtained IPv6 message is greater than the maximum message length supported by the IPv6 tunnel. If the length of the obtained IPv6 message is greater than the maximum message length supported by the IPv6 tunnel, if the second network device directly performs IPv6 encapsulation on the IPv4 message, the encapsulated IPv6 message may be lost when it is transmitted in the IPv6 tunnel. In order to avoid this problem, the second network device, when determining that the message length of the IPv6 message obtained by encapsulating the IPv4 message exceeds the maximum message length supported by the IPv6 tunnel, fragments the IPv4 message to obtain multiple fragments. In one example, the multiple fragments may include the first fragment.

[0084] In one example, the second network device may fragment the IPv4 message according to the maximum message length and the length of the IPv6 encapsulation, so that the length of the IPv6 message obtained after performing IPv6 encapsulation on each of the multiple fragments is less than the maximum message length. The length of the IPv6 encapsulation mentioned here may be the length of the encapsulated IPv6 header or the total length of the IPv6 header and the IPv6 extension header.

[0085] S203: The second network device obtains a first IPv6 message according to the first fragment, where the first IPv6 message includes first indication information, and the first indication information indicates that the first IPv6 message includes a first fragment of an IPv4 message.

[0086] After the second network device fragments the IPv4 message to obtain multiple fragments including the first fragment, each of the multiple fragments can be respectively encapsulated in IPv6. Taking the first fragment as an example, the second network device can encapsulate the first fragment to obtain a first IPv6 message. The first IPv6 message may include an IPv6 header, the first fragment, and an IPv4 header corresponding to the first fragment. In addition, the first IPv6 message may also include first indication information, and the first indication information may indicate that the first IPv6 message includes the first fragment.

[0087] Regarding the carrying position of the first indication information in the first IPv6 message, please refer to the above description of Figure 2 The relevant description parts in the method shown are not repeated here.

[0088] In one example, if the IPv6 tunnel is a segment routing best effort (SR-BE) tunnel, the second network device may also encapsulate the first fragment with a first SRH when encapsulating the first fragment, thereby obtaining a first IPv6 message including the first SRH. In this case, the first indication information may be carried by the first SRH.

[0089] In an example, after obtaining the first IPv6 packet, the second network device may send the first IPv6 packet to a third network device, and the third network device may be an intermediate device of the IPv6 tunnel.

[0090] In one example, the third network device can forward the first IPv6 message to the first network device, which is the exit device of the IPv6 tunnel. Accordingly, the first network device can reassemble the first fragment to obtain the IPv4 message based on the first indication information carried in the first IPv6 message. In this way, network problems caused by directly transmitting the first fragment to the downstream network domain can be avoided.

[0091] In another example, the third network device may be a device that applies the HoVPN technology. In this case, if the first IPv6 message includes the first SRH, and the first indication information is carried in the first SRH, then when the third network device replaces the first SRH with the second SRH, the first indication information may be added to the second SRH, for example, the first indication information is added to the flags field of the second SRH, thereby obtaining the second IPv6 message. In this way, the second IPv6 message also includes the first fragment and the first indication information. Further, the third network device may forward the second IPv6 message to the first network device, which is the exit device of the IPv6 tunnel. Accordingly, the first network device may reassemble the first fragment to obtain the IPv4 message according to the first indication information carried in the second IPv6 message. In this way, network problems caused by directly transmitting the first fragment to the downstream network domain may be avoided.

[0092] In another example, the third network device may be a device to which the HoVPN technology is applied. In this case, if the first IPv6 message includes a first SRH, and the first indication information is carried in the first SRH. Then the third network device may first reassemble the first fragment to obtain the IPv4 message, and fragment the IPv4 message to obtain multiple fragments including the second fragment. Further, each of the multiple fragments including the second fragment may be respectively encapsulated with IPv6. Taking the second fragment as an example, the third network device may encapsulate the second fragment to obtain a third IPv6 message. The third IPv6 message may include the second fragment and the third SRH. In an embodiment of the present application, the third SRH includes the second indication information. For example, the flags field of the third SRH is used to carry the second indication information, and the second indication information is used to indicate that the third IPv6 message includes the second fragment of the IPv4 message. In addition, the third IPv6 message may also include an IPv6 header and an IPv4 header corresponding to the second fragment, which will not be described in detail here.

[0093] After the third network device obtains the third IPv6 message, it can forward the third IPv6 message to the first network device. The first network device is the exit device of the IPv6 tunnel. Correspondingly, the first network device can reassemble the second fragment to obtain the IPv4 message according to the second indication information carried in the third IPv6 message. In this way, network problems caused by directly transmitting the first fragment to the downstream network domain can be avoided.

[0094] Based on the message processing method provided in the above embodiments, the embodiments of the present application also provide a corresponding message processing device.

[0095] See also Figure 5 , which is a structural diagram of a message processing device provided in an embodiment of the present application. Figure 5 The message processing device 500 shown includes a receiving unit 501 and a processing unit 502 .

[0096] In one example, the message processing device 500 can be applied to a first communication device to perform the steps performed by the first communication device provided in the above method embodiment. The first network device is an egress device of an Internet Protocol version 6 IPv6 tunnel. For this case:

[0097] The receiving unit 501 is used to receive a first Internet Protocol version 6 IPv6 message, wherein the first IPv6 message includes first indication information, and the first indication information indicates that the first IPv6 message includes a first fragment of an Internet Protocol version 4 IPv4 message.

[0098] The processing unit 502 is used to reassemble the first fragments to obtain the IPv4 message according to the first indication information.

[0099] In a possible implementation manner, the first IPv6 message includes a segment routing header (SRH), and the first indication information is carried in the SRH.

[0100] In a possible implementation manner, the first indication information is carried in an identification flags field of the SRH.

[0101] In a possible implementation manner, the first IPv6 message includes a fragment extension header, and the first indication information is carried in the fragment extension header.

[0102] In a possible implementation manner, the first indication information is carried in a reserved field of the slice extension header.

[0103] In a possible implementation, the first indication information is carried in an IPv4 header corresponding to the first fragment.

[0104] In one possible implementation, the receiving unit is also used to receive a second IPv6 message, wherein the second IPv6 message includes second indication information, and the second indication information indicates that the second IPv6 message includes the second fragment of the IPv4 message; the processing unit 502 is used to: reassemble the first fragment and the second fragment to obtain the IPv4 message.

[0105] In a possible implementation, the first network device supports reassembly of fragments of the IPv4 message.

[0106] In another example, the message processing device 500 can be applied to a second communication device to perform the steps performed by the second communication device provided in the above method embodiment. The second network device is an entry device of an Internet Protocol version 6 IPv6 tunnel. For this case:

[0107] The receiving unit 501 is used to receive an IPv4 message;

[0108] The processing unit 502 is used to fragment the IPv4 message to obtain multiple fragments including a first fragment, and to obtain a first IPv6 message based on the first fragment, wherein the first IPv6 message includes first indication information, and the first indication information indicates that the first IPv6 message includes the first fragment of the IPv4 message.

[0109] In a possible implementation manner, the first IPv6 packet includes a first segment routing header (SRH), and the first indication information is carried in the first SRH.

[0110] In a possible implementation manner, the first indication information is carried in an identification flags field of the SRH.

[0111] In a possible implementation manner, the first IPv6 message includes a fragment extension header, and the first indication information is carried in the fragment extension header.

[0112] In a possible implementation manner, the first indication information is carried in a reserved field of the slice extension header.

[0113] In a possible implementation, the first indication information is carried in an IPv4 header corresponding to the first fragment.

[0114] In a possible implementation, the processing unit 502 is further used to: before fragmenting the IPv4 message, determine that the message length of the IPv6 message obtained by encapsulating the IPv4 message exceeds the maximum message length supported by the IPv6 tunnel.

[0115] In one possible implementation, the device 500 also includes: a sending unit, used to send the first IPv6 message to a third network device, so that the third network device replaces the first SRH in the first IPv6 message with a second SRH to obtain a second IPv6 message, wherein the second SRH includes the first indication information, and the third network device is an intermediate device of the IPv6 tunnel.

[0116] In a possible implementation, the device 500 also includes: a sending unit, used to send the first IPv6 message to a third network device, so that the third network device reassembles the first fragment to obtain the IPv4 message, and fragments the IPv4 message to obtain a second fragment, and obtains a third IPv6 message based on the second fragment, the third IPv6 message includes a third SRH, the third SRH includes second indication information, the second indication information indicates that the third IPv6 message includes the second fragment of the IPv4 message, and the third network device is an intermediate device of the IPv6 tunnel.

[0117] Regarding the specific implementation of each unit of the device 500, reference may be made to the relevant description part of the above method embodiment, and a repeated description will not be made here.

[0118] It should be noted that the hardware structure of the message processing device 500 mentioned above can be as follows: Figure 6 The structure shown, Figure 6 A schematic diagram of the structure of a device provided in an embodiment of the present application.

[0119] See also Figure 6 As shown, the device 600 includes: a processor 610, a communication interface 620 and a memory 630. The number of the processor 610 in the device 600 can be one or more. Figure 6 In the embodiment of the present application, the processor 610, the communication interface 620 and the memory 630 may be connected via a bus system or other means, wherein: Figure 6 The connection via bus system 640 is taken as an example.

[0120] The processor 610 may be a central processing unit (CPU), a network processor (NP) or a combination of a CPU and a NP. The processor 610 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0121] The memory 630 may include a volatile memory (English: volatile memory), such as a random-access memory (RAM); the memory 630 may also include a non-volatile memory (English: non-volatile memory), such as a flash memory (English: flash memory), a hard disk drive (HDD) or a solid-state drive (SSD); the memory 630 may also include a combination of the above-mentioned types of memory. The memory 630 may, for example, store one or more fragments (such as the first fragment and / or the second fragment) included in the IPv4 message.

[0122] Optionally, the memory 630 stores an operating system and a program, an executable module or a data structure, or a subset thereof, or an extended set thereof, wherein the program may include various operating instructions for implementing various operations. The operating system may include various system programs for implementing various basic services and processing hardware-based tasks. The processor 610 may read the program in the memory 630 to implement the message processing method provided in the embodiment of the present application.

[0123] The bus system 640 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus system 640 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0124] An embodiment of the present application also provides a computer-readable storage medium, including instructions or computer programs, which, when executed on a computer, enable the computer to execute the message processing method provided in the above embodiments.

[0125] An embodiment of the present application also provides a computer program product including instructions or a computer program, which, when executed on a computer, enables the computer to execute the message processing method provided in the above embodiment.

[0126] An embodiment of the present application also provides a communication system, which includes: a first network device and a second network device that execute the message processing method provided by the above method embodiment.

[0127] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0128] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0129] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical business division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0130] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0131] In addition, each business unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software business units.

[0132] If the integrated unit is implemented in the form of a software business unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0133] Those skilled in the art will appreciate that in one or more of the above examples, the services described in the present invention may be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, the services may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. Storage media may be any available media that can be accessed by a general-purpose or special-purpose computer.

[0134] The above specific implementation modes further describe the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation modes of the present invention.

[0135] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A message processing method, It is characterized in that The method comprises: The first network device receives a first Internet Protocol version 6 IPv6 message, wherein the first IPv6 message includes first indication information, wherein the first indication information indicates that the first IPv6 message includes a first fragment of an Internet Protocol version 4 IPv4 message, and the first network device is an egress device of an IPv6 tunnel; The first network device reassembles the first fragments to obtain the IPv4 message according to the first indication information.

2. The method according to claim 1, It is characterized in that The first IPv6 message includes a segment routing header SRH, and the first indication information is carried in the SRH.

3. The method according to claim 2, It is characterized in that The first indication information is carried in the flags field of the SRH.

4. The method according to claim 1, It is characterized in that The first IPv6 message includes a fragment extension header, and the first indication information is carried in the fragment extension header.

5. The method according to claim 4, It is characterized in that The first indication information is carried in a reserved field of the slice extension header.

6. The method according to claim 1, It is characterized in that The first indication information is carried in the IPv4 header corresponding to the first fragment.

7. The method according to any one of claims 1 to 6, It is characterized in that The method further comprises: The first network device receives a second IPv6 message, where the second IPv6 message includes second indication information, and the second indication information indicates that the second IPv6 message includes the second fragment of the IPv4 message; The reassembling of the first fragment to obtain the IPv4 message includes: The first fragment and the second fragment are reassembled to obtain the IPv4 message.

8. The method according to any one of claims 1 to 7, It is characterized in that The first network device supports reassembly of fragments of the IPv4 message.

9. A message processing method, It is characterized in that The method comprises: The second network device receives the IPv4 message, and the second network device is an entry device of the Internet Protocol version 6 IPv6 tunnel; The second network device fragments the IPv4 message to obtain a plurality of fragments including the first fragment; The second network device obtains a first IPv6 message according to the first fragment, wherein the first IPv6 message includes first indication information, and the first indication information indicates that the first IPv6 message includes a first fragment of an IPv4 message.

10. The method according to claim 9, It is characterized in that The first IPv6 message includes a first segment routing header SRH, and the first indication information is carried in the first SRH.

11. The method according to claim 10, It is characterized in that The first indication information is carried in the flags field of the SRH.

12. The method according to claim 9, It is characterized in that The first IPv6 message includes a fragment extension header, and the first indication information is carried in the fragment extension header.

13. The method according to claim 12, It is characterized in that The first indication information is carried in a reserved field of the slice extension header.

14. The method according to claim 9, It is characterized in that The first indication information is carried in the IPv4 header corresponding to the first fragment.

15. The method according to any one of claims 9 to 14, It is characterized in that Before the second network device fragments the IPv4 message, the method further includes: The second network device determines that the message length of the IPv6 message obtained by encapsulating the IPv4 message exceeds the maximum message length supported by the IPv6 tunnel.

16. The method according to claim 10 or 11, It is characterized in that The method further comprises: The second network device sends the first IPv6 message to the third network device, so that the third network device replaces the first SRH in the first IPv6 message with a second SRH to obtain a second IPv6 message, wherein the second SRH includes the first indication information, and the third network device is an intermediate device of the IPv6 tunnel.

17. The method according to claim 10 or 11, It is characterized in that The method further comprises: The second network device sends the first IPv6 message to the third network device, so that the third network device reassembles the first fragment to obtain the IPv4 message, fragments the IPv4 message to obtain the second fragment, and obtains the third IPv6 message according to the second fragment, the third IPv6 message includes a third SRH, the third SRH includes second indication information, the second indication information indicates that the third IPv6 message includes the second fragment of the IPv4 message, and the third network device is an intermediate device of the IPv6 tunnel.

18. A message processing device, It is characterized in that Applied to a first network device, the apparatus comprises: A receiving unit, configured to receive a first Internet Protocol version 6 IPv6 message, wherein the first IPv6 message includes first indication information, wherein the first indication information indicates that the first IPv6 message includes a first fragment of an Internet Protocol version 4 IPv4 message, and the first network device is an egress device of an IPv6 tunnel; A processing unit is used to reassemble the first fragment to obtain the IPv4 message according to the first indication information.

19. A message processing device, It is characterized in that Applied to a second network device, the apparatus comprises: A receiving unit, configured to receive an IPv4 message, wherein the second network device is an entry device of an Internet Protocol version 6 IPv6 tunnel; A processing unit is used to fragment the IPv4 message to obtain multiple fragments including a first fragment, and to obtain a first IPv6 message based on the first fragment, wherein the first IPv6 message includes first indication information, and the first indication information indicates that the first IPv6 message includes the first fragment of the IPv4 message.

20. A device, It is characterized in that include: Processor and memory; The memory is used to store instructions or computer programs; The processor is used to execute the instructions or computer programs to perform the method according to any one of claims 1 to 17.

21. A computer-readable storage medium, It is characterized in that The method comprises instructions or computer programs, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 17.

22. A communication system, It is characterized in that The communication system comprises: A first network device that executes the method described in any one of claims 1 to 8 above, and a second network device that executes the method described in any one of claims 9 to 17 above.