Packet transmission method and device, network equipment and storage medium
By carrying tunnel information in the IPv6 extended header, the overhead and complexity caused by GRE encapsulation of SRv6 packets in different network transmissions are solved, and efficient transmission in wireless networks is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING HUAWEI DIGITAL TECH
- Filing Date
- 2025-01-02
- Publication Date
- 2026-07-03
Smart Images

Figure CN122339892A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network technology, and in particular to a message transmission method and apparatus, network device and storage medium. Background Technology
[0002] The technology for transmitting segment routing IPv6 (SRv6) packets within the same network is relatively mature. However, if SRv6 packets need to traverse different networks, such as from a fiber optic network to a wireless network, then generic routing encapsulation (GRE) tunneling technology is required.
[0003] When using GRE technology to transmit SRv6 messages, additional GRE encapsulation is required, which increases transmission overhead and complexity. Summary of the Invention
[0004] This application provides a message transmission method, apparatus, network device, and storage medium that enable messages to traverse wireless networks and other types of networks without increasing transmission overhead and complexity.
[0005] Firstly, this application provides a message transmission method. This method can be executed by a first network device. In this method, the first network device acquires a first message; obtains a second message from the first message, and sends the second message through a tunnel.
[0006] The tunnel information is carried in the Internet Protocol Version 6 (IPv6) extension header of the second message.
[0007] In the above-described scheme of this application, after the first network device obtains the first message, it determines that the message needs to be transmitted through a tunnel. At this time, a second message is generated based on the first message. The second message carries tunnel information through the IPv6 extended header, thereby carrying the content that originally needed to be added by GRE encapsulation in the IPv6 extended header. This allows the message to traverse other types of networks such as wireless networks without increasing transmission overhead and complexity.
[0008] For example, tunnel information includes tunnel type and passenger protocol type.
[0009] The second message includes an IPv6 basic header and an IPv6 extended header. The IPv6 basic header includes a source address and a destination address. The IPv6 extended header includes a first field and a second field. The first field indicates the tunnel type, and the second field indicates the passenger protocol type. The source address of the second message is the address of the first network device, and the destination address of the second message is the address of the second network device. The tunnel is configured between the first network device and the second network device.
[0010] For example, the first network device refers to the tunnel entrance device. The second network device refers to the tunnel exit device.
[0011] When the destination address of the first message is associated with a tunnel, the first network device obtains the second message based on the first message. Here, the association of the destination address of the first message with a tunnel means that transmission to that destination address requires passing through a tunnel.
[0012] In the implementation of this application, both the first and second messages are IPv6 messages, such as SRv6 messages, or even bit-indexed explicit replication Version 6 (BIERv6) messages.
[0013] In some possible implementations of this application, the first and second messages can be SRv6 messages, in which the IPv6 extended message header is a segment routing header (SRH) or a destination options header (DOH).
[0014] In this implementation, when SRv6 packets need to traverse other types of networks such as wireless networks, tunnel information can be carried through the SRH in the SRv6 packets, thus eliminating the need for additional GRE encapsulation.
[0015] In some other possible implementations of this application, the first and second messages can be BIERv6 messages, in which the IPv6 extended header is DOH.
[0016] In this implementation, when BIERv6 packets need to traverse other types of networks such as wireless networks, tunnel information can be carried through the DOH in the BIERv6 packets, thus eliminating the need for additional GRE encapsulation.
[0017] In some possible implementations of this application, the IPv6 extended header is SRH, the first field can be the flags field, and the second field can be the next header field.
[0018] The flags field typically consists of 8 bits, from 0 to 7, from which two bits can be selected to carry the tunnel type.
[0019] For example, the 6th and 7th bits are used to carry the tunnel type.
[0020] 00 indicates that the tunnel type is no tunnel type. The current second message is a standard SRv6 message or a BIERv6 message. The message can be processed in accordance with the standard message processing method.
[0021] 01 indicates that the tunnel type is tunneled. The current second message can be considered as an SRv6 message or BIERv6 message similar to GRE encapsulation. When processing the message, the GRE encapsulation processing method is followed. The passenger protocol type is determined based on the next header field, and the message is processed using the passenger protocol type.
[0022] The next header field is used to indicate the passenger's protocol type, such as IPv4, IPv6, Ethernet, etc.
[0023] In some other possible implementations of this application, the IPv6 extended header is an SRH, and at least one of the first and second fields can be an extended field in the SRH, such as the optional taglength value (Optional TLV) field in the SRH.
[0024] Optionally, the tag in the SRH can be used as an extended field of the tunnel to indicate other optional content in the tunnel information, such as tunnel extension parameters.
[0025] In some possible implementations of this application, the IPv6 extended header is a DOH, the first field can be an extension field, and the second field can be a next header field.
[0026] In DOH, extended fields can be option data fields.
[0027] In some other possible implementations of this application, the IPv6 extended header is a DOH, and the first and second fields can be extended fields.
[0028] In DOH, if extended fields are used to indicate tunnel type and / or passenger protocol type, the indication method can be referenced from SRH.
[0029] Optionally, the DOH can also use option data fields as extended fields for tunnels to indicate other optional content in the tunnel information, such as tunnel extension parameters.
[0030] In some possible implementations of this application, if the first network device receives the first packet from an interface bound to a virtual private network (VPN) instance, it looks up the routing table of the corresponding VPN instance and finds the associated VPN segment identifier (SID) as the destination address of the second packet. That is, the address of the second network device at this time is the SID of the VPN configured on the second network device.
[0031] In some other possible implementations of this application, if the first network device receives the first packet on an interface that is not bound to a VPN instance, it searches the routing table that does not correspond to the VPN and finds the associated SID as the destination address of the second packet. That is, the address of the second network device is the SID of the second network device.
[0032] The SID or VPN configured in the second network device is generated based on the address assigned by the intermediate network, which is the network between the first and second network devices.
[0033] Secondly, this application provides a message transmission method. This method can be executed by a first network device. In this method, a second network device receives a second message through a tunnel; the second network device obtains a third message based on the second message; and the second network device sends the third message.
[0034] The tunnel information is carried in the IPv6 extended header of the second message.
[0035] The third message is the second message after removing the IPv6 basic message header.
[0036] In the above-described scheme of this application, the second network device receives the second message through a tunnel. The second message carries tunnel information through the IPv6 extended header, thereby carrying the content that originally needed to be encapsulated in GRE into the IPv6 extended header. This allows the message to traverse other types of networks, such as wireless networks, without increasing transmission overhead and complexity.
[0037] For example, tunnel information includes tunnel type and passenger protocol type.
[0038] The second message includes an IPv6 basic header and an IPv6 extended header. The IPv6 basic header includes a source address and a destination address. The IPv6 extended header includes a first field and a second field. The first field indicates the tunnel type, and the second field indicates the passenger protocol type. The source address of the second message is the address of the first network device, and the destination address of the second message is the address of the second network device. The tunnel is configured between the first network device and the second network device.
[0039] For example, the first network device refers to the tunnel entrance device. The second network device refers to the tunnel exit device.
[0040] For details regarding the IPv6 extended header, the first field, and the second field, please refer to the description in the first section; they will not be repeated here.
[0041] Thirdly, this application provides a message transmission apparatus, the apparatus comprising:
[0042] The acquisition unit is used to acquire the first message;
[0043] The processing unit is used to obtain the second message from the first message;
[0044] The sending unit is used to send a second message through a tunnel, wherein the tunnel information is carried in the IPv6 extended header of the second message.
[0045] Optionally, the tunnel information includes the tunnel type and passenger agreement type;
[0046] The processing unit is configured to obtain a second message based on the first message, provided that the destination address of the first message is associated with a tunnel. The IPv6 extended message header includes a first field and a second field, wherein the first field is used to indicate the tunnel type and the second field is used to indicate the passenger protocol type.
[0047] Optionally, the IPv6 extended header is either a Segment Routing Header (SRH) or a Destination Options Header (DOH).
[0048] Optionally, the first field is a flag field or an extended field, and the second field is a next header field or an extended field.
[0049] Optionally, the tunnel is configured between the first network device and the second network device, and the destination address of the second packet is the SID of the VPN configured by the second network device. The SID of the VPN configured by the second network device is generated based on the address allocated by the intermediate network, which is the network between the first network device and the second network device.
[0050] Fourthly, this application provides a message transmission apparatus, the apparatus comprising:
[0051] The receiving unit is used to receive the second message through the tunnel, and the tunnel information is carried in the IPv6 extended header of the second message;
[0052] The processing unit is used to obtain the third message based on the second message;
[0053] The sending unit is used to send a third message.
[0054] Optionally, the tunnel information includes the tunnel type and passenger agreement type;
[0055] The IPv6 extended header includes a first field and a second field. The first field indicates the tunnel type, and the second field indicates the passenger protocol type.
[0056] Optionally, the IPv6 extended header is either a Segment Routing Header (SRH) or a Destination Options Header (DOH).
[0057] Optionally, the first field is a flag field or an extended field, and the second field is a next header field or an extended field.
[0058] Optionally, the tunnel is configured between the first network device and the second network device, and the destination address of the second packet is the SID of the VPN configured by the second network device. The SID of the VPN configured by the second network device is generated based on the address allocated by the intermediate network, which is the network between the first network device and the second network device.
[0059] Fifthly, a network device is provided. The network device includes a processor and a memory. The memory is used to store software programs and modules.
[0060] In one example, the network device may be a first network device, and accordingly, the processor implements the method of the first aspect or any possible implementation of the first aspect by running or executing software programs and / or modules stored in the memory.
[0061] In another example, the network device may be a second network device, and accordingly, the processor implements the method of the second aspect or any possible implementation of the second aspect by running or executing software programs and / or modules stored in the memory.
[0062] Optionally, the processor may be one or more, and the memory may be one or more.
[0063] Optionally, the memory may be integrated with the processor, or the memory may be separated from the processor.
[0064] In the specific implementation process, the memory can be a non-transitory memory, such as read-only memory (ROM), which can be integrated with the processor on the same chip or set on different chips. This application does not limit the type of memory or the way the memory and processor are set.
[0065] Sixthly, a computer program product is provided. The computer program product includes computer program code that, when executed by a computer, causes the computer to perform the method described in the first aspect or any possible implementation thereof, or to perform the method described in the second aspect or any possible implementation thereof.
[0066] In a seventh aspect, this application provides a computer-readable storage medium for storing program code executed by a processor, the program code including methods for implementing the first aspect or any possible implementation of the first aspect, or methods for implementing the second aspect or any possible implementation of the second aspect.
[0067] Eighthly, a chip is provided, including a processor, the processor being configured to retrieve and execute instructions stored in a memory, causing a network device on which the chip is mounted to perform the methods described in the first aspect or any possible implementation of the first aspect, or to perform the methods described in the second aspect or any possible implementation of the second aspect.
[0068] A ninth aspect provides another chip. The other chip includes an input interface, an output interface, a processor, and a memory. The input interface, the output interface, the processor, and the memory are connected via internal interconnection paths. The processor is used to execute code in the memory, and when the code is executed, the processor is used to perform the method described in the first aspect or any possible implementation of the first aspect, or to perform the method described in the second aspect or any possible implementation of the second aspect.
[0069] In a tenth aspect, a communication system is provided, comprising a first network device as described in any of the preceding claims and a second network device as described in any of the preceding claims. Attached Figure Description
[0070] Figure 1 This is a schematic diagram of the format of the basic IPv6 header provided in the embodiments of this application;
[0071] Figure 2 This is a schematic diagram of the SRH format provided in the embodiments of this application;
[0072] Figure 3 This is a schematic diagram of the DOH format provided in the embodiments of this application;
[0073] Figure 4 This is a schematic diagram of a system architecture provided in an embodiment of this application;
[0074] Figure 5 This is another system architecture diagram provided in the embodiments of this application;
[0075] Figure 6 This is a flowchart of a message transmission method provided in an embodiment of this application;
[0076] Figure 7 This is a flowchart of a message transmission method provided in an embodiment of this application;
[0077] Figure 8 This is a flowchart of a message transmission method provided in an embodiment of this application;
[0078] Figure 9 This is a block diagram of a message transmission device provided in an embodiment of this application;
[0079] Figure 10 This is a block diagram of a message transmission device provided in an embodiment of this application;
[0080] Figure 11 This is a schematic diagram of the structure of a device provided in an embodiment of this application. Detailed Implementation
[0081] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0082] This application will present various aspects, embodiments, or features relating to systems that may include multiple devices, components, modules, etc. It should be understood and appreciated that individual systems may include additional devices, components, modules, etc., and / or may not include all the devices, components, modules, etc. discussed in conjunction with the accompanying drawings. Furthermore, combinations of these approaches are also possible.
[0083] Furthermore, in the embodiments of this application, words such as "exemplarily" and "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as an "example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the term "example" is intended to present concepts in a concrete manner. In the embodiments of this application, "of," "corresponding, relevant," and "corresponding" may sometimes be used interchangeably, and it should be noted that their intended meanings are consistent unless their distinction is emphasized.
[0084] The following explains some terms and concepts involved in the embodiments of this application.
[0085] (1)SRv6
[0086] SRv6 is based on segment routing (SR) technology in the IPv6 forwarding plane. To implement SR technology based on the IPv6 forwarding plane, an SRH extension header is added to the IPv6 routing extension header. This extension header specifies an explicit IPv6 path and stores IPv6 segment list information.
[0087] An SRv6 message consists of three parts: the IPv6 basic header, the SRH, and the IPv6 payload.
[0088] Figure 1 This is a schematic diagram of the IPv6 basic packet header format provided in an embodiment of this application. For example... Figure 1 As shown, the basic IPv6 header includes version number, traffic class, flow label, payload length, next header, hop limit, source address, and destination address.
[0089] (2) GRE
[0090] GRE is a general routing encapsulation protocol that provides a mechanism to encapsulate messages of one protocol within messages of another protocol, enabling messages to be transmitted in heterogeneous networks. The channel through which heterogeneous messages are transmitted is called a tunnel.
[0091] For example, datagrams of certain network layer protocols (such as IPX, ATM, IPv6, AppleTalk, etc.) can be encapsulated so that these encapsulated datagrams can be transmitted in different networks.
[0092] In this embodiment, by reusing fields in the IPv6 extended header, the need for additional GRE encapsulation is eliminated, saving message transmission resources and reducing complexity.
[0093] (3)SRH
[0094] Figure 2 This is a schematic diagram of the SRH format provided in an embodiment of this application. For example... Figure 2 As shown, the SRH includes the next header, SRH length, routing type, number of remaining unprocessed SIDs, index of the last SID, flags, tags, and segment list.
[0095] In addition, SRH can also include extended fields, namely Optional TLV.
[0096] Table 1 below explains the meaning of each field in SRH.
[0097] Table 1
[0098]
[0099] (4) DOH
[0100] Figure 3 This is a schematic diagram of the DOH format provided in the embodiments of this application. For example... Figure 3 As shown, the DOH includes the next header, ext hdr len, option type, optdata len, and option data fields.
[0101] (5) BIERv6
[0102] BIERv6 is the IPv6 version of BIER technology. BIER is a multicast technology where edge nodes in a BIER domain are assigned a BFR-id, for example, a value between 1 and 256. These edge nodes flood their configured BIER information within the BIER domain via the Interior Gateway Protocol (IGP), providing other nodes in the BIER domain with the parameters needed to implement BIER forwarding. For example, if a node's BFR-id is non-zero, it is an edge node; if its BFR-id is zero, it is an intermediate node, i.e., a non-edge node.
[0103] (6)SID
[0104] SRv6 defines a Segment, also known as an SRv6 SID. A SID consists of three parts: a locator, function variables (args), and [other components].
[0105] locator: An identifier assigned to a network node by the network, which can be used for routing and forwarding data packets.
[0106] function: An ID value assigned by the device to local forwarding instructions. This value can be used to express the forwarding action that the device needs to perform, equivalent to the opcode of a computer instruction. In SRv6 network programming, different forwarding behaviors are expressed by different function IDs.
[0107] args: The parameters required by the forwarding instruction when it is executed. These parameters may include streams, services, or any other related variable information.
[0108] The SID in this application embodiment can be of type END, END.X, END.DT4, etc. The SID can provide routing capabilities, represent a VPN, or correspond to a specific action.
[0109] The systems and business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0110] To facilitate understanding of the technical solutions provided in the embodiments of this application, the system architecture of this application is first introduced. This system architecture includes a first network device, a second network device, and a third network device. The first network device and the second network device transmit messages through one network, while the second network device and the third network device transmit messages through another network.
[0111] For example, the first network device and the second network device transmit messages through a fiber optic network. The second network device and the third network device transmit messages through a multi-protocol label switching (MPLS) VPN network, an L3VPN network, or a mobile network, which can be a long-term evolution (LTE), 4G, 5G, or other similar networks.
[0112] Figure 4This is a schematic diagram of a system architecture provided in an embodiment of this application. See also... Figure 4 The first network device 10 is ACC1, the second network device 20 is PE1, and the third network device 30 is CPE1. There is a fiber optic network between CPE1 and ACC1, and an MPLS VPN network or LTE network between ACC1 and PE1.
[0113] Optionally, the system architecture also includes a fourth network device 40, namely... Figure 4 CPE2 is one of the PE1 and CPE2 networks. A fiber optic network can connect PE1 and CPE2.
[0114] Figure 5 This is a schematic diagram of another system architecture provided in the embodiments of this application. Figure 5 and Figure 4 The difference lies in the fact that, in scenarios such as finance and enterprises, the route from ACC1 to PE1 can pass through an MPLS VPN network or LTE network, or it can also pass through a fiber optic network path. Figure 5 The path that passes through AGG.
[0115] When a message is transmitted through an MPLS VPN network or an LTE network, the transmission method provided in this application embodiment is used. When a message is transmitted through an AGG without passing through an MPLS VPN network or an LTE network, the transmission method provided in this application embodiment is not required.
[0116] Figure 6 This is a flowchart of a message transmission method provided in an embodiment of this application. Figure 6 The method shown includes the following steps S11 to S13. Figure 6 The network deployment scenarios on which the method shown is based can optionally be as described above. Figure 4 or Figure 5 As shown, in Figure 4 or Figure 5 In the scene shown, Figure 6 The method shown can be executed by the first network device, for example by... Figure 4 or Figure 5 ACC1 is executed.
[0117] S11: The first network device obtains the first message.
[0118] The first message is an IPv6 message, such as an SRv6 message.
[0119] S12: The first network device obtains the second message based on the first message.
[0120] The second message is an IPv6 message, such as an SRv6 message. Both the first and second messages include an IPv6 base header and an IPv6 extension header. The IPv6 base header includes the source address and destination address, and the IPv6 extension header includes a first field and a second field.
[0121] S13: The first network device sends the second message through the tunnel.
[0122] In this embodiment of the application, the tunnel information is carried in the IPv6 extended header of the second message.
[0123] For example, tunnel information includes tunnel type and passenger protocol type.
[0124] In the second message, the first field is used to indicate the tunnel type, the second field is used to indicate the passenger protocol type, the source address of the second message is the address of the first network device, the destination address of the second message is the address of the second network device, and the tunnel is configured between the first network device and the second network device.
[0125] For example, the first network device refers to the tunnel entrance device. The second network device refers to the tunnel exit device.
[0126] In the above-described scheme of this application, after the first network device obtains the first message, it determines that the message needs to be transmitted through a tunnel. At this time, a second message is generated based on the first message. The second message carries tunnel information through the IPv6 extended header, thereby carrying the content that originally needed to be added by GRE encapsulation in the IPv6 extended header. This allows the message to traverse other types of networks such as wireless networks without increasing transmission overhead and complexity.
[0127] Figure 7 This is a flowchart of a message transmission method provided in an embodiment of this application. Figure 7 The method shown includes the following steps S21 to S23. Figure 7 The network deployment scenarios on which the method shown is based can optionally be as described above. Figure 4 or Figure 5 As shown, in Figure 4 or Figure 5 In the scene shown, Figure 7 The method shown can be executed by a second network device, for example by... Figure 4 or Figure 5 Execute PE1 in the middle.
[0128] S21: The second network device receives the second message through the tunnel.
[0129] The second message is an IPv6 message, such as an SRv6 message. The second message includes an IPv6 base header and an IPv6 extension header. The IPv6 base header includes the source address and the destination address, and the IPv6 extension header includes a first field and a second field.
[0130] In this embodiment of the application, the tunnel information is carried in the IPv6 extended header of the second message.
[0131] For example, tunnel information includes tunnel type and passenger protocol type.
[0132] In the second message, the first field is used to indicate the tunnel type, the second field is used to indicate the passenger protocol type, the source address of the second message is the address of the first network device, the destination address of the second message is the address of the second network device, and the tunnel is configured between the first network device and the second network device.
[0133] For example, the first network device refers to the tunnel entrance device. The second network device refers to the tunnel exit device.
[0134] S22: The second network device obtains the third message based on the second message.
[0135] The third message is the second message after removing the IPv6 basic message header.
[0136] S23: The second network device sends a third message.
[0137] In the above-described scheme of this application, the second network device receives the second message through a tunnel. The second message carries tunnel information through the IPv6 extended header, thereby carrying the content that originally needed to be encapsulated in GRE into the IPv6 extended header. This allows the message to traverse other types of networks, such as wireless networks, without increasing transmission overhead and complexity.
[0138] Figure 8 This is a flowchart of a message transmission method provided in an embodiment of this application. Figure 8 The method shown includes the following steps S31 to S37. Figure 8 The network deployment scenarios on which the method shown is based can optionally be as described above. Figure 4 or Figure 5 As shown, in Figure 4 or Figure 5 In the scene shown, Figure 8 The method shown can be executed by a first network device and a second network device, for example by... Figure 4 or Figure 5 ACC1 and PE1 are executed.
[0139] S31: The first network device obtains the first message.
[0140] The first message is an IPv6 message, such as an SRv6 message. The first message includes an IPv6 base header and an IPv6 extension header. The IPv6 base header includes the source address and the destination address, and the IPv6 extension header includes a first field and a second field.
[0141] In this embodiment of the application, step S31 may include: the first network device receiving a first message sent by the third network device.
[0142] For example, ACC1 receives the first message sent by CPE1. In this first message, the source address can be the address of user U1, and the destination address can be the address of user U2. User U1 is a user connected to CPE1, and user U2 is a user connected to CPE1.
[0143] S32: The first network device looks up the routing table.
[0144] In this embodiment of the application, step S32 may include: the first network device looking up a routing table based on the interface that received the first message.
[0145] For example, if the first network device receives the first packet from an interface bound to a VPN instance, it will look up the routing table of the corresponding VPN instance and perform address prefix matching.
[0146] In some other possible implementations of this application, if the first network device receives the first packet on an interface that is not bound to a VPN instance, then the routing table that does not correspond to the VPN is searched and address prefix matching is performed.
[0147] In this embodiment of the application, the static route or IGP route pre-configured by the first network device needs to be transmitted through a tunnel when the destination address is the SID of the second network device.
[0148] Therefore, when the destination address prefix of the first packet matches a routing entry, and that routing entry corresponds to the SID of the second network device, it will be associated with the tunnel through a pre-configured static route or IGP route. This indicates that the destination address of the first packet is associated with the tunnel, and step S33 is executed. When the address prefix does not match a routing entry that does not correspond to the SID of the second network device, it indicates that the destination address of the first packet is not associated with the tunnel, and it can be forwarded as a regular IPv6 packet.
[0149] That is, in the implementation of this application, before performing step S31, the method may further include: configuring a tunnel from the first network device to the second network device.
[0150] For example, the tunnel can be configured using static routes or IGP routes.
[0151] For example, the following code can be used to configure static routes:
[0152] interface Tunnel1
[0153] ip address unnumbered interface ACC1 SID.X
[0154] tunnel-protocol ipv6-new
[0155] destination PE1 SID.X
[0156] Wherein, Tunnel1 is the tunnel name, and ACC1 SID.X and PE1 SID.X are the SIDs of the first network device and the second network device, respectively.
[0157] For example, IGP routing configuration can be performed using Intermediate System to Intermediate System Routing Protocol Support for IPv6 (ISISv6), which will not be elaborated here.
[0158] In the implementation of this application, steps S31 to S37 constitute the data transmission phase. Prior to the data transmission phase, a route advertising phase is also included. The following example illustrates PE1 advertising a route to ACC1:
[0159] Configure a Locator on PE1. PE1 advertises the Locator network segment route corresponding to the SRv6 SID to ACC1 via the IGP protocol. ACC1 installs the route into its own IPv6 routing table. PE1 configures the VPN instance SID within the Locator scope, generating a local SID table. After receiving the route advertised by CPE2, PE1 converts the route into a BGP VPN route and advertises it to ACC1 through BGP neighbor relationships. This route carries the SRv6 VPN SID attribute, which is the VPN instance's SID. After receiving the VPN route, ACC1 cross-references it to the corresponding VPN instance routing table and forwards it to the VPN forwarding information base (FIB) of Virtual Routing and Forwarding (VRF). Then, ACC1 converts the VPN route into a regular IP route and advertises it to CPE1.
[0160] Accordingly, when looking up the routing table of a VPN instance, the FIB of the VRF is also looked up.
[0161] Of course, in other examples, PE1 may not be configured with a VPN instance, in which case it will publish regular routes instead of VPN routes.
[0162] S33: If the destination address of the first message is associated with the tunnel, the first network device obtains the second message based on the first message.
[0163] The second message is an IPv6 message, such as an SRv6 message. The second message includes an IPv6 base header and an IPv6 extension header. The IPv6 base header includes the source address and the destination address, and the IPv6 extension header includes a first field and a second field.
[0164] In the second message, the first field is used to indicate the tunnel type, the second field is used to indicate the passenger protocol type, the source address of the second message is the address of the first network device, the destination address of the second message is the address of the second network device, and the tunnel is configured between the first network device and the second network device.
[0165] The address of the first network device can be the loopback address of the first network device.
[0166] In this embodiment of the application, the IPv6 extended header is SRH or DOH.
[0167] In some possible implementations of this application, the IPv6 extended header is SRH, the first field can be the flags field, and the second field can be the next header field.
[0168] The flags field typically consists of 8 bits, from 0 to 7, from which two bits can be selected to carry the tunnel type.
[0169] For example, the 6th and 7th bits are used to carry the tunnel type.
[0170] 00 indicates that the tunnel type is no tunnel type. The current second message is a standard SRv6 message or a BIERv6 message. The message can be processed in accordance with the standard message processing method.
[0171] 01 indicates that the tunnel type is tunneled. The current second message can be considered as an SRv6 message or BIERv6 message similar to GRE encapsulation. When processing the message, the GRE encapsulation processing method is followed. The passenger protocol type is determined based on the next header field, and the message is processed using the passenger protocol type.
[0172] In other examples, other indication methods can be used, such as 10 indicating that the tunnel type is non-tunnel type, 11 indicating that the tunnel type is tunnel type, etc.
[0173] In other implementations, more (e.g., 4 bits) or fewer (e.g., 1 bit) bits can be used to represent the tunnel type.
[0174] The next header field is used to indicate the passenger's protocol type, such as IPv4, IPv6, Ethernet, etc.
[0175] In some other possible implementations of this application, the IPv6 extended header is an SRH, and at least one of the first and second fields can be an extended field in the SRH, such as the Optional TLV field in the SRH.
[0176] For example, when using the Optional TLV field to carry the tunnel type, the T of the TLV is the tunnel type, L can be 2 bits, and V is 00 or 01.
[0177] For example, when using the Optional TLV field to carry the passenger protocol type, the T of the TLV is the passenger protocol type, L can be 8 bits, and V can refer to the definition of the next header in Table 1.
[0178] Optionally, the tag in the SRH can be used as an extended field of the tunnel to indicate other optional content in the tunnel information, such as tunnel extension parameters.
[0179] In some possible implementations of this application, the IPv6 extended header is a DOH, the first field can be an extension field, and the second field can be a next header field.
[0180] In DOH, extended fields can be option data fields.
[0181] In some other possible implementations of this application, the IPv6 extended header is a DOH, and the first and second fields can be extended fields.
[0182] In DOH, if extended fields are used to indicate tunnel type and / or passenger protocol type, the indication method can be referenced from SRH.
[0183] Optionally, the DOH can also use option data fields as extended fields for tunnels to indicate other optional content in the tunnel information, such as tunnel extension parameters.
[0184] In some possible implementations of this application, if the first network device receives the first packet from an interface bound to a VPN instance, it looks up the routing table of the corresponding VPN instance and finds the associated VPN SID as the destination address of the second packet. That is, at this time, the address of the second network device is the SID of the VPN configured on the second network device.
[0185] In some other possible implementations of this application, if the first network device receives the first packet on an interface that is not bound to a VPN instance, it searches the routing table that does not correspond to the VPN and finds the associated SID as the destination address of the second packet. That is, the address of the second network device is the SID of the second network device.
[0186] In this embodiment of the application, the first network device obtains the second message based on the first message, including: writing the tunnel type and passenger protocol type into the first field and the second field of the IPv6 extended header of the first message, and modifying the source address and destination address in the base header of the first message, thereby obtaining the second message.
[0187] For example, ACC1 processes the first message to obtain the second message. The source address in the second message is the SID of ACC1, and the destination address in the second message is the SID of the VPN configured on PE1.
[0188] In this embodiment of the application, the source address in the second message is the SID of the first network device, and the destination address in the second message is the SID (VPN SID) of the second network device.
[0189] The SID of the first network device and the SID of the second network device are obtained in the following way:
[0190] The first network device / second network device obtains an address (or network segment) from the intermediate network; the first network device / second network device generates an SID based on the obtained address.
[0191] For example, an address segment is obtained from an intermediate network, a locator is allocated based on the address segment, and a SID is generated by combining the locator.
[0192] The above-described method of generating SIDs enables packets sent by the SIDs of the first network device and the second network device to better traverse the intermediate network (such as the aforementioned MPLS VPN network or LTE network) between the first and second network devices, thereby enabling the second packet to be transmitted in the tunnel.
[0193] Of course, the above description is only an example and is not intended to limit the generation of SID.
[0194] S34: The first network device sends the second message through the tunnel. The second network device receives the second message through the tunnel.
[0195] In this embodiment, intermediate nodes between the first and second network devices transmit a second message, causing the second message to travel from the first network device to the second network device. Upon receiving the message, the intermediate nodes forward it by looking up the FIB table as a normal IPv6 message.
[0196] S35: The second network device searches its local SID table based on the second packet and matches the forwarding action corresponding to the SID.
[0197] The local SID table is the local SID table generated by the second network device during the route advertising phase described in step S32.
[0198] The second network device learns from the destination address that it is a locally assigned SID, and the meaning of the SID is to decapsulate and look up the FIB of the VRF. Then it pops out the outermost IPv6 basic packet header and determines the forwarding path according to the FIB table of the VRF.
[0199] S36: The second network device obtains the third message based on the second message.
[0200] In this embodiment of the application, the second network device removes the IPv6 base header of the second message to obtain the third message.
[0201] S37: The second network device sends a third message.
[0202] In this embodiment of the application, the second network device forwards the third packet according to the forwarding path determined in step S35.
[0203] For example, PE1 sends a third message to CPE2, which then forwards it to user U2.
[0204] In this embodiment, a new IPv6 tunnel is formed based on the IPv6 scenario, combining the capabilities of IPv6 extended headers and the programmable capabilities of SRv6 SIDs. A scheme is proposed to achieve tunnel transmission in an IPv6 scenario without adding new encapsulation. This scheme can support underlay tunneling functions, achieving capabilities similar to GRE tunnels; simultaneously, this scheme, combined with SRv6 tunneling, enables overlay tunneling in VPN scenarios. Furthermore, the encapsulation overhead is low, and the scheme is simple.
[0205] Figure 9 This is a block diagram of a message transmission device provided in an embodiment of this application. This message transmission device can be implemented as all or part of a first network device through software, hardware, or a combination of both. The device is used to perform... Figure 6 or Figure 8 The message transmission method shown is illustrated. The message transmission apparatus may include: an acquisition unit 401, a processing unit 402, and a sending unit 403.
[0206] The acquisition unit 401 is used to obtain the second message through the first message.
[0207] Processing unit 402 is used to obtain the second message through the first message.
[0208] The sending unit 403 is used to send a second message through a tunnel, wherein the tunnel information is carried in the IPv6 extended header of the second message.
[0209] Optionally, the tunnel information includes the tunnel type and passenger agreement type;
[0210] Processing unit 402 is configured to obtain a second message based on the first message when the destination address of the first message is associated with a tunnel. The IPv6 extended message header includes a first field and a second field. The first field is used to indicate the tunnel type, and the second field is used to indicate the passenger protocol type.
[0211] Optionally, the IPv6 extended header is either a Segment Routing Header (SRH) or a Destination Options Header (DOH).
[0212] Optionally, the first field is a flag field or an extended field, and the second field is a next header field or an extended field.
[0213] Optionally, the tunnel is configured between the first network device and the second network device, and the destination address of the second packet is the SID of the VPN configured by the second network device. The SID of the VPN configured by the second network device is generated based on the address allocated by the intermediate network, which is the network between the first network device and the second network device.
[0214] It should be noted that the message transmission device provided in the above embodiments is only illustrated by the division of the above functional units when transmitting messages. In actual applications, the above functions can be assigned to different functional units as needed, that is, the internal structure of the device can be divided into different functional units to complete all or part of the functions described above. In addition, the message transmission device and message transmission method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0215] Figure 10 This is a block diagram of a message transmission device provided in an embodiment of this application. This message transmission device can be implemented as all or part of a second network device through software, hardware, or a combination of both. The device is used to perform... Figure 7 or Figure 8 The message transmission method shown is illustrated. The message transmission device may include: a receiving unit 501, a processing unit 502, and a sending unit 503.
[0216] The receiving unit 501 is used to receive the second message through the tunnel, and the tunnel information is carried in the IPv6 extended header of the second message.
[0217] Processing unit 502 is used to obtain a third message based on the second message.
[0218] The sending unit 503 is used to send a third message.
[0219] Optionally, the tunnel information includes the tunnel type and passenger agreement type;
[0220] The IPv6 extended header includes a first field and a second field. The first field indicates the tunnel type, and the second field indicates the passenger protocol type.
[0221] Optionally, the IPv6 extended header is either a Segment Routing Header (SRH) or a Destination Options Header (DOH).
[0222] Optionally, the first field is a flag field or an extended field, and the second field is a next header field or an extended field.
[0223] Optionally, the tunnel is configured between the first network device and the second network device, and the destination address of the second packet is the SID of the VPN configured by the second network device. The SID of the VPN configured by the second network device is generated based on the address allocated by the intermediate network, which is the network between the first network device and the second network device.
[0224] It should be noted that the message transmission device provided in the above embodiments is only illustrated by the division of the above functional units when transmitting messages. In actual applications, the above functions can be assigned to different functional units as needed, that is, the internal structure of the device can be divided into different functional units to complete all or part of the functions described above. In addition, the message transmission device and message transmission method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0225] This application also provides a communication system. The communication system may include the first network device and the second network device as described above.
[0226] Figure 11 A schematic diagram of the structure of the device 150 provided in an embodiment of this application is shown. The device 150 can be a first network device or a second network device. Figure 11 The device 150 shown is used to perform the above. Figures 6 to 8 The operations involved in any of the message transmission methods shown in the diagram. This device 150 can be implemented using a general bus architecture.
[0227] like Figure 11 As shown, device 150 includes at least one processor 151, memory 153 and at least one communication interface 154.
[0228] Processor 151 may be, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the embodiments of this application. For example, processor 151 may include an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. A PLD may be, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof. It can implement or execute the various logic blocks, modules, and circuits described in connection with the embodiments of this application. A processor may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0229] Optionally, device 150 also includes a bus. The bus is used to transfer information between the components of device 150. The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 11 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0230] Memory 153 may be, for example, read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions; random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions; electrically erasable programmable read-only memory (EEPROM); compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.); magnetic disk storage media or other magnetic storage devices; or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto. Memory 153 may exist independently and be connected to processor 151 via a bus. Memory 153 may also be integrated with processor 151.
[0231] Communication interface 154 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), or Wireless Local Area Network (WLAN). Communication interface 154 may include wired and wireless communication interfaces. Specifically, communication interface 154 may be an Ethernet interface, Fast Ethernet (FE) interface, Gigabit Ethernet (GE) interface, Asynchronous Transfer Mode (ATM) interface, WLAN interface, cellular network communication interface, or a combination thereof. The Ethernet interface may be an optical interface, an electrical interface, or a combination thereof. In this embodiment, communication interface 154 can be used by device 150 to communicate with other devices.
[0232] In a specific implementation, as one example, processor 151 may include one or more CPUs, such as Figure 11 The CPU0 and CPU1 shown are examples of processors. Each of these processors can be a single-core processor or a multi-core processor. A processor here can refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).
[0233] In a specific implementation, as one example, device 150 may include multiple processors, such as... Figure 11 The processors 151 and 155 shown are illustrated. Each of these processors can be a single-core processor or a multi-core processor. Here, "processor" can refer to one or more devices, circuits, and / or processing cores used to process data (such as computer program instructions).
[0234] In a specific implementation, as one embodiment, device 150 may further include an output device and an input device. The output device communicates with processor 151 and can display information in various ways. For example, the output device may be a liquid crystal display (LCD), a light-emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector, etc. The input device communicates with processor 151 and can receive user input in various ways. For example, the input device may be a mouse, keyboard, touchscreen device, or sensing device, etc.
[0235] In some embodiments, memory 153 is used to store program code 1510 for executing the solution of this application, and processor 151 can execute the program code 1510 stored in memory 153. That is, device 150 can implement the method provided in the method embodiment by executing program code 1510 in memory 153 through processor 151. Program code 1510 may include one or more software modules. Optionally, processor 151 itself may also store program code or instructions for executing the solution of this application.
[0236] In a specific embodiment, the device 150 of this application embodiment may correspond to the controller in the above-described method embodiments. The processor 151 in the device 150 reads instructions from the memory 153, causing... Figure 11 The device 150 shown is capable of performing all or part of the operations performed by the controller.
[0237] Specifically, processor 151 is used to acquire the first message; obtain the second message through the first message; and send the second message through the tunnel, with the tunnel information carried in the IPv6 extended header of the second message.
[0238] Alternatively, processor 151 is configured to receive a second message through a tunnel, the tunnel information of which is carried in the IPv6 extended header of the second message; obtain a third message based on the second message; and send the third message.
[0239] Other alternative implementation methods will not be described in detail here for the sake of brevity.
[0240] in, Figures 6 to 8 Each step of the message transmission method shown in any of the diagrams is completed by the integrated logic circuitry in the hardware of the processor of device 150 or by instructions in the form of software. The steps of the method disclosed in the embodiments of this application can be directly implemented by the hardware processor, or by a combination of hardware and software modules in the processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other storage media mature in the art. Since this storage medium is located in memory, the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method; to avoid repetition, these will not be described in detail here.
[0241] This application also provides a chip, including: an input interface, an output interface, a processor, and a memory. The input interface, output interface, processor, and memory are connected via internal interconnection paths. The processor is used to execute code in the memory, and when the code is executed, the processor is used to execute any of the above-described message transmission methods.
[0242] It should be understood that the aforementioned processor can be a CPU, or it can be other general-purpose processors, DSPs, ASICs, FPGAs, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. General-purpose processors can be microprocessors or any conventional processor. It is worth noting that the processor can be a processor supporting the ARM architecture.
[0243] Further, in an optional embodiment, the processor and the memory may be one or more. Optionally, the memory may be integrated with the processor, or the memory may be separately configured from the processor. The memory may include read-only memory and random access memory, and provide instructions and data to the processor. The memory may also include non-volatile random access memory. For example, the memory may also store reference blocks and target blocks.
[0244] The memory can be volatile or non-volatile, or may include both. Non-volatile memory can be ROM, PROM, EPROM, EEPROM, or flash memory. Volatile memory can be RAM, used as an external cache. Many forms of RAM are available by way of example, but not limitation. Examples include SRAM, DRAM, SDRAM, DDR SDRAM, ESDRAM, SLDRAM, and DR RAM.
[0245] In this embodiment of the application, a computer-readable storage medium is also provided, which stores computer instructions. When the computer instructions stored in the computer-readable storage medium are executed by a network device, the network device performs the message transmission method provided above.
[0246] In this embodiment of the application, a computer program product containing instructions is also provided, which, when run on a network device, causes the network device to execute the message transmission method provided above.
[0247] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive).
[0248] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0249] The above description is merely an optional embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0250] Unless otherwise defined, the technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this application pertains. The terms “first,” “second,” “third,” and similar terms used in this patent application specification and claims do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, the terms “an” or “a” and similar terms do not indicate a quantity limitation, but rather indicate the presence of at least one. The terms “comprising” or “including” and similar terms mean that the elements or objects preceding “comprising” or “including” encompass the elements or objects listed following “comprising” or “including” and their equivalents, and do not exclude other elements or objects.
[0251] The above is merely one embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method of transmitting a packet, characterized by, The method includes: The first network device acquires the first message; The first network device receives the second message through the first message; The first network device sends the second message through a tunnel, and the tunnel information is carried in the IPv6 extended header of the second message.
2. The method of claim 1, wherein, The tunnel information includes the tunnel type and passenger protocol type; The first network device receives the second message through the first message, including: When the destination address of the first message is associated with the tunnel, the first network device obtains a second message based on the first message. The IPv6 extended message header includes a first field and a second field. The first field is used to indicate the tunnel type, and the second field is used to indicate the passenger protocol type.
3. The method of claim 2, wherein, The IPv6 extended header is either a Segment Routing Header (SRH) or a Destination Options Header (DOH).
4. The method of claim 2, wherein, The first field is a flag field or an extended field, and the second field is a next header field or an extended field.
5. The method according to any one of claims 1 to 4, characterized in that, The tunnel is configured between the first network device and the second network device. The destination address of the second packet is the SID of the VPN configured by the second network device. The SID of the VPN configured by the second network device is generated based on the address allocated by the intermediate network, which is the network between the first network device and the second network device.
6. A message transmission method characterized by comprising: The method includes: The second network device receives the second packet through a tunnel, and the tunnel information of the tunnel is carried in the IPv6 extended header of the second packet; The second network device obtains the third message based on the second message; The second network device sends the third message.
7. A packet transmission apparatus characterized by comprising: The device includes: The acquisition unit is used to acquire the first message; The processing unit is used to obtain the second message from the first message; The sending unit is configured to send the second message through a tunnel, wherein the tunnel information is carried in the IPv6 extended header of the second message.
8. A message transmission method characterized by comprising: The method includes: A receiving unit is configured to receive a second message through a tunnel, wherein the tunnel information is carried in the IPv6 extended header of the second message; Processing unit, configured to obtain third message based on second message; The sending unit is used to send the third message.
9. A network device, comprising: The device includes a memory and one or more processors, the memory being used to store a computer program; the one or more processors being used to invoke the computer program in the memory, causing the network device to perform the method as described in any one of claims 1 to 5, or the method as described in claim 6.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program or instructions that, when executed by a computer, implement the method as described in any one of claims 1 to 5, or the method as described in claim 6.
11. A computer program product, characterised in that, When the computer reads and executes the computer program product, it causes the computer to perform the method as described in any one of claims 1 to 5, or the method as described in claim 6.