US-12627603-B2 - Packet transmission method, apparatus, device, and system, and storage medium
Abstract
A packet transmission method, apparatus, device, and system, and a storage medium are provided. The method includes: A first device obtains a first packet, and determines node information of a second device and node information of a third device from a node information list of the first packet by using a first part included in a destination address field of the first packet. The first device generates, based on the first packet, a second packet including the node information of the second device and a third packet including the node information of the third device. The first device sends the second packet to the second device, and sends the third packet to the third device.
Inventors
- Xuesong Geng
- Zhenbin Li
- Jingrong Xie
Assignees
- HUAWEI TECHNOLOGIES CO., LTD.
Dates
- Publication Date
- 20260512
- Application Date
- 20230620
- Priority Date
- 20201222
Claims (20)
- 1 . A method of packet transmission, comprising: obtaining, by a first device, a first packet comprising a destination address field and a node information list, wherein the node information list comprises node information of a second device and node information of a third device, and the destination address field comprises a first part; determining, by the first device, the node information of the second device and the node information of the third device from the node information list based on the first part, wherein the first part identifies a location of the node information of the second device and a location of the node information of the third device in the node information list; generating, by the first device, a second packet and a third packet based on the first packet, wherein the second packet comprises the node information of the second device, and the third packet comprises the node information of the third device; and sending, by the first device, the second packet to the second device, and sending the third packet to the third device.
- 2 . The method according to claim 1 , wherein the location of the node information of the second device in the node information list is a start location, and the location of the node information of the third device in the node information list is an end location; or the location of the node information of the second device in the node information list is the start location, and the first part further identifies an offset of the location of the node information of the third device in the node information list relative to the location of the node information of the second device in the node information list.
- 3 . The method according to claim 1 , wherein generating the second packet comprises: replicating, by the first device, the first packet based on the first part to obtain a fourth packet; and adding, by the first device, the node information of the second device to the fourth packet to obtain the second packet.
- 4 . The method according to claim 1 , wherein the first device is an ingress node on a transmission path of the first packet; and obtaining the first packet comprises: receiving, by the first device, a fifth packet, and adding the first part and a second part of the destination address field of the first packet to a destination address field of the fifth packet, to obtain the first packet, wherein the second part identifies an address of the first device.
- 5 . The method according to claim 1 , wherein the first device is an intermediate node on a transmission path of the first packet, the destination address field further comprises a second part; and the method further comprises: before generating the second packet and the third packet, determining, by the first device, that the second part matches an address of the first device.
- 6 . The method according to claim 1 , wherein the first packet is a segment routing over internet protocol version 6 (SRv6) packet, the node information list is included in a segment routing header (SRH) of the SRv6 packet, and the node information list is a segment list of the SRH; the first packet is an IPV6 packet, the node information list is included in a routing header (RH) of the IPV6 packet, and the node information list is a segment list of the RH; or the first packet is the IPV6 packet, the node information list is included in a destination options header (DOH) of the IPV6 packet, and the node information list is an address list of the DOH.
- 7 . The method according to claim 1 , wherein the first packet, the second packet, and the third packet each further comprises a first identifier that indicates a location of node information of a current packet processing device in the node information list.
- 8 . The method according to claim 1 , wherein the first packet further comprises a leaf identifier that indicates the first device is a leaf node; and the method further comprises: after obtaining the first packet, decapsulating, by the first device, the first packet based on the leaf identifier and the first part.
- 9 . The method according to claim 8 , wherein the node information list includes the leaf identifier.
- 10 . The method according to claim 4 , wherein the second part comprises a common prefix and a node identifier, the common prefix comprises a same part of node addresses in node information of packet processing devices, and the node identifier indicates a different part of the node addresses in the node information of the packet processing devices.
- 11 . A packet transmission apparatus, comprising: a processor; and a memory coupled to the processor and storing instructions, which when executed by the processor, cause the packet transmission apparatus to: obtain a first packet comprising a destination address field and a node information list, wherein the node information list comprises node information of a second device and node information of a third device, and the destination address field comprises a first part; determine the node information of the second device and the node information of the third device from the node information list based on the first part, wherein the first part identifies a location of the node information of the second device and a location of the node information of the third device in the node information list; generate a second packet and a third packet based on the first packet, wherein the second packet comprises the node information of the second device, and the third packet comprises the node information of the third device; and send the second packet to the second device, and send the third packet to the third device.
- 12 . The packet transmission apparatus according to claim 11 , wherein the location of the node information of the second device in the node information list is a start location, and the location of the node information of the third device in the node information list is an end location; or the location of the node information of the second device in the node information list is a start location and the first part further identifies an offset of the location of the node information of the third device in the node information list relative to the location of the node information of the second device in the node information list.
- 13 . The packet transmission apparatus according to claim 11 , wherein the packet transmission apparatus to generate the second packet comprises the packet transmission apparatus to replicate the first packet based on the first part to obtain a fourth packet, and add the node information of the second device to the fourth packet to obtain the second packet.
- 14 . The packet transmission apparatus according to claim 11 , wherein the packet transmission apparatus is an ingress node on a transmission path of the first packet; and the packet transmission apparatus to obtain the first packet comprises the packet transmission apparatus to: receive a fifth packet, and add the first part and a second part of the destination address field of the first packet to a destination address field of the fifth packet, to obtain the first packet, wherein the second part identifies an address of the packet transmission apparatus.
- 15 . The packet transmission apparatus according to claim 11 , wherein the packet transmission apparatus is an intermediate node on a transmission path of the first packet, the destination address field further comprises a second part; and before generating the second packet and the third packet, the packet transmission apparatus is further to: determine that the second part matches an address of the packet transmission apparatus.
- 16 . The packet transmission apparatus according to claim 11 , wherein the first packet is a segment routing over internet protocol version 6 (SRv6) packet, the node information list is included in a segment routing header (SRH) of the SRv6 packet, and the node information list is a segment list of the SRH; the first packet is an IPV6 packet, the node information list is included in a routing header (RH) of the Ipv6 packet, and the node information list is a segment list of the RH; or the first packet is the Ipv6 packet, the node information list is included in a destination options header (DOH) of the Ipv6 packet, and the node information list is an address list of the DOH.
- 17 . The packet transmission apparatus according to claim 11 , wherein the first packet, the second packet, and the third packet each further comprises a first identifier that indicates a location of node information of a current packet processing device in the node information list.
- 18 . The packet transmission apparatus according to claim 11 , wherein the first packet further comprises a leaf identifier that indicates that the packet transmission apparatus is a leaf node; and after obtaining the first packet, the packet transmission apparatus is further to decapsulate the first packet based on the leaf identifier and the first part.
- 19 . The packet transmission apparatus according to claim 18 , wherein the node information list carries the leaf identifier.
- 20 . The packet transmission apparatus according to claim 14 , wherein the second part comprises a common prefix and a node identifier, the common prefix comprises a same part of node addresses in node information of packet processing devices, and the node identifier indicates a different part of the node addresses in the node information of the packet processing devices.
Description
CROSS-REFERENCE TO RELATED APPLICATIONS This application is a continuation of International Application No. PCT/CN2021/118863, filed on Sep. 16, 2021, which claims priorities to Chinese Patent Application No. 202011528118.3, filed on Dec. 22, 2020, and Chinese Patent Application No. 202110221894.7, filed on Feb. 27, 2021. All of the aforementioned patent applications are hereby incorporated by reference in their entirety. TECHNICAL FIELD This application relates to the field of communication technologies, and in particular, to a packet transmission method, apparatus, device, and system, and a storage medium. BACKGROUND In a communication network, a communication device transmits information by transmitting a packet. With development of communication technologies, there are an increasing quantity of manners of transmitting a packet between communication devices. For example, a packet is transmitted in a segment routing over internet protocol version 6 (SRv6) scenario. For an SRv6 packet, a segment routing extension header (SRH) is inserted into an IPv6 packet, and the SRv6 packet is transmitted on a packet transmission path by using a segment list. For example, in a multicast technology, a segment identifier (SID) of the SRH is extended, and a quantity of forks of a multicast tree and a quantity of sub-tree segment identifiers are defined, to locate a location of a SID of a next node in the segment list. In addition, after a packet is replicated, SIDs of other nodes and sub-tree SIDs of other nodes are removed, to transmit the packet on the packet transmission path. However, in the segment list provided in the method, a SID corresponding to a replication node and a SID corresponding to a sub-tree obtained after the replication node performs replication are arranged together for nested encoding. As a result, an encoding structure is complex, and each node needs to process a SID after replicating a packet. Consequently, overheads in a packet transmission process are excessively high, and transmission efficiency is excessively low. SUMMARY Embodiments of this application provide a packet transmission method, apparatus, device, and system, and a storage medium, to reduce overheads in a packet transmission process and improve transmission efficiency. According to a first aspect, a packet transmission method is provided. An example in which a first device performs the method is used to describe the method. The first device obtains a first packet carrying a destination address field and anode information list. The node information list includes node information of a second device and node information of a third device. The second device and the third device are devices on a transmission path of the first packet, and may or may not be next-hop devices of the first device. For example, the first packet is an SRv6 packet, the node information list is a segment list, the node information of the second device is a SID of the second device, and the node information of the third device is a SID of the third device. The destination address field includes a first part, and the first part identifies locations of the node information of the second device and the node information of the third device in the node information list. Similarly, an example in which the first packet is an SRv6 packet is used. The first part may be implemented by defining a pointer in an argument (Args) field of a SID. That is, the first part is the pointer. The first device determines the node information of the second device and the node information of the third device from the node information list based on the first part, and generates a second packet and a third packet based on the first packet. The second packet includes the node information of the second device, and the third packet includes the node information of the third device. The first device sends the second packet to the second device, and sends the third packet to the third device. According to the packet transmission method provided in the technical solution, the first device can quickly locate, by using the first part and the node information list that are carried in the first packet, a next packet processing device, generate, based on the first packet, a packet that needs to be received by the next packet processing device, and transmit the packet. This reduces overheads in a packet transmission process and improves packet transmission efficiency. In an embodiment, the node information list may or may not include node information of the first device. When the node information list includes only node information of a packet processing device that is located after the first device on the transmission path of the first packet, space occupied by the node information list may be reduced, so that the packet transmission efficiency may also be improved. In an embodiment, the first part indicates that a location of the node information of the second device in the node information list is a