A message forwarding method and network device
By establishing multiple forwarding paths between network devices, generating multiple replicated messages in each message, and using different paths for transmission, the problem of packet loss caused by unstable network links is solved and the message efficiency is improved. Transmission reliability.
Patent Information
- Application Number
- CN202110937666.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2017-09-25
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2037-09-25
AI Technical Summary
When existing network equipment forwards packets, packet loss occurs due to network link instability or interruption, resulting in poor packet transmission reliability.
By establishing multiple forwarding paths between network devices and generating multiple replicated messages in each message, each replicated message is transmitted through a different forwarding path to ensure that even if a problem occurs on one path, the messages on other paths are still can be reached and improve transmission reliability.
It effectively improves the reliability of message forwarding and ensures that even if there is a problem with one transmission path, messages from other paths can still be successfully received, avoiding message loss.
Smart Images

Figure CN113839871B_ABST
Abstract
Description
[0001] This application is a divisional application of the application filed with the China Intellectual Property Office on September 25, 2017, with application number 201710873391.1 and invention name “A method and network device for forwarding messages”. Technical Field
[0002] The present invention relates to the field of network technology, and in particular to a message forwarding method and network equipment. Background Art
[0003] Various network technologies are developing rapidly, and the transmission mode of user data in the network is usually to encapsulate and transmit it in the form of messages. The network devices in the network forward the encapsulated messages, thereby realizing the transmission of user data in the network. When forwarding messages, the network devices forward them according to the path information in the header of the message, for example, the path information can be Multi-Protocol Label Switching (MPLS). The network device receives multiple messages and transmits the multiple messages to different network devices respectively according to the path information of each message, thereby realizing a point-to-multipoint message transmission mode. For example, message A1 is transmitted to network device B1 through path 1, message A2 is transmitted to network device B2 through path 2, and message A3 is transmitted to network device B3 through path 3. Since there are various emergencies in the network links between network devices, such as network instability or sudden interruption, etc., which may cause packet loss, the reliability of this message transmission mode is relatively poor. Summary of the invention
[0004] The embodiment of the present invention provides a message forwarding method and network equipment, which can improve the reliability of message forwarding.
[0005] In a first aspect, an embodiment of the present invention provides a method for forwarding a message in a network, wherein the network includes a first network device and a second network device, and multiple forwarding paths exist between the first network device and the second network device. The first network device and the second network device may be routers or switches, etc., which are not limited in the embodiment of the present invention.
[0006] The first network device receives a first message, which includes first indication information, payload data, and a message sequence number, wherein the message sequence number may be the message sequence number of the first message in the data stream corresponding to the first message, for example, the data stream corresponding to the first message includes multiple messages, and a message sequence number is assigned to each message according to the sending order of the multiple messages, and the message sequence number of each message is not repeated. It should be noted that when each network device on the forwarding path forwards the first message, the message sequence number does not change.
[0007] The first indication information may be indication information used to instruct the first network device to generate multiple second messages according to the first message.
[0008] When the first network device determines that the first message contains the first indication information, a plurality of second messages are generated according to the first message, each of the plurality of second messages contains the payload data carried by the first message, a message sequence number and the second indication information.
[0009] The first network device may generate multiple second messages based on the first message by copying the first message to obtain multiple copy messages, then popping out unnecessary information (such as the first indication information) in each copy message, and finally pushing in the second indication information to obtain multiple second messages. Alternatively, the first network device may generate multiple second messages based on the first message by popping out unnecessary information (such as the first indication information) in the first message, then copying the popped-out first message to obtain multiple copy messages, and finally pushing in the second indication information in each copy message to obtain multiple second messages. The embodiment of the present invention does not limit the generation method of multiple second messages, and the above is only an example.
[0010] The first network device forwards the plurality of second messages to the second network device through different forwarding paths among the plurality of forwarding paths between the first network device and the second network device, for example, one forwarding path forwards one second message. The second indication information included in each of the plurality of second messages is used to instruct the second network device to discard the plurality of second messages except the first message that reaches the second network device.
[0011] Through the above technical solution, there are multiple forwarding paths between the first network device and the second network device. The first network device generates multiple second messages based on the first message, and forwards the multiple second messages to the second network device through the multiple forwarding paths. Even if there is a problem with the network link of one of the multiple forwarding paths, the second network device can also receive the second messages forwarded by other forwarding paths, thereby improving the reliability of message transmission.
[0012] In one possible design, the second message also includes path information of a forwarding path corresponding to the second message, and the path information of the forwarding path can indicate that the second message is forwarded on the forwarding path. Optionally, if the forwarding path of each of the plurality of second messages is different, the path information of the forwarding path contained in each message is different. By encapsulating the path information of the forwarding path in the second message, the transmission of the second message on multiple network links can be indicated.
[0013] In one possible design, the above-mentioned first message also includes a flow identifier of the data flow corresponding to the first message. Before generating multiple second messages, the first network device searches for path information of each forwarding path in multiple forwarding paths associated with the flow identifier, thereby encapsulating the path information of the forwarding path into the second message, wherein a second message corresponds to a forwarding path in the multiple forwarding paths.
[0014] By adopting the above method, by encapsulating the path information of the forwarding path in the second message, the transmission of the second message on multiple network links can be indicated.
[0015] In one possible design, the first indication information includes a first label, and the second indication information includes a second label, wherein the first label corresponds to a first function, and the second label corresponds to a second function. The first function is used to instruct the first network device to generate multiple second messages, for example, the first label is a copy label, and the first function is a function of copying messages. The second function is used to instruct the second network device to discard the multiple second messages except the first message that arrives at the second network, for example, the second label is a redundant label, and the second function is a function of deleting redundant messages. Among them, the path information of the forwarding path may include the MPLS label stack of the forwarding path.
[0016] By adopting the above method, labels corresponding to different functions are encapsulated in the second message, so that the network device can easily identify the label and perform corresponding operations, thereby improving operation efficiency.
[0017] In one possible design, the first indication information includes a third label, and the second indication information includes a third label, that is, the first indication information and the second indication information are the same. The third label is used to identify the data stream corresponding to the first message. Before generating multiple second messages, the first network device searches for the operation type corresponding to the third label; if the operation type corresponding to the third label is a target operation type, the first network device generates multiple second messages according to the first message. The target operation type is used to indicate that the first network device generates multiple second messages, for example, the target operation type is a copy operation. Among them, the path information of the forwarding path may include the MPLS label stack of the forwarding path.
[0018] By adopting the above manner, the third label can not only identify the data flow corresponding to the first message, but also serve as different indication information, thereby reducing the message overhead.
[0019] In one possible design, the first indication information includes first functional information corresponding to a first address in a destination address field of a sixth version of the Internet Protocol (IPv6) header of the first message, and the first address matches a network address of the first network device. The first functional information is used to instruct the first network device to generate multiple second messages, for example, the first functional information is functional information of a duplicate message.
[0020] The second message includes a Segment Routing Header (SRH), which includes path information of the forwarding path corresponding to the second message and second indication information. The path information of the forwarding path corresponding to the second message can be multiple addresses in multiple segment lists in the SRH, and the multiple addresses represent the forwarding path. The second indication information includes second functional information corresponding to the second address of the target segment list in the SRH, and the second address matches the network address of the second network device, and the target segment list is a segment list in the multiple segment lists contained in the SRH. The second functional information is used to instruct the second network device to discard the multiple second messages except the first one that arrives at the second network device, for example, the second functional information is functional information for deleting redundant messages.
[0021] By adopting the above manner, by extending the first function information and the second function information in the segment list of the SRH, the above message forwarding method can be adopted in the SRv6 protocol network to improve the reliability of message forwarding.
[0022] In one possible design, the flow identifier and message sequence number included in the second message can be encapsulated in the segment list of the SRH, for example, in the segment list corresponding to the network address of the second network device, or the flow identifier and message sequence number can be encapsulated in each segment list, which is not limited in the embodiment of the present invention. In this way, the overhead of the message header can be saved; or,
[0023] The second message also includes a Segment Routing IPv6 (SRv6) header based on IPv6, and the flow identifier and the message sequence number are encapsulated in the SRv6 header.
[0024] In a second aspect, an embodiment of the present invention provides a method for forwarding a message in a network, wherein the network includes a first network device and a second network device, and multiple forwarding paths exist between the first network device and the second network device. The first network device and the second network device may be routers or switches, etc., which are not limited in the embodiment of the present invention.
[0025] The second network device receives a second message, which is any one of a plurality of second messages generated by the first network device according to the first message. The second message includes indication information, payload data carried by the first message, and a message sequence number, which is a message sequence number of the first message in a data stream corresponding to the first message. The indication information is used to instruct the second network device to discard messages other than the first message that arrives at the second network device among the plurality of second messages.
[0026] It should be noted that the second message may be a second message generated by the first network device and processed by a network device in the forwarding path. For example, the network device in the forwarding path re-encapsulates the second message.
[0027] When the second network device determines that the second message contains the indication information, the second network device searches a message receiving table for the message sequence number carried in the second message, wherein the message receiving table is used to record the message sequence number contained in the first second message among the multiple second messages that arrives at the second network device.
[0028] If the message sequence number does not exist in the message receiving table, it means that the second network device has not received any one of the multiple second messages sent by the first network device, and the second network device stores the second message. If the message sequence number exists in the message receiving table, it means that the second message is not the first message of the multiple second messages to arrive at the second network device, and in order to avoid duplicate storage, the second network device discards the second message.
[0029] Through the above technical solution, there are multiple forwarding paths between the first network device and the second network device. The first network device forwards multiple second messages to the second network device through the multiple forwarding paths. The second network device only stores the first second message that arrives at the second network device and discards other second messages. This not only avoids repeated transmission of the same message, but also improves the reliability of message transmission.
[0030] In one possible design, the indication information may include a label, the label corresponds to a target function, and the target function is used to instruct the second network device to discard the plurality of second messages except the first message that reaches the second network device. For example, the target function is a function of deleting redundant messages.
[0031] By adopting the above method, the indication information is a label corresponding to the target function, and the network device can easily identify the label to perform corresponding operations, thereby improving operation efficiency.
[0032] In one possible design, the indication information may include a label, and the label is used to identify the data stream corresponding to the first message. Before the second network device searches for a message sequence number in the message receiving table, the second network device needs to search for an operation type corresponding to the label. If the operation type corresponding to the label is a target operation type, the second network device searches for the message sequence number in the message receiving table. The target operation type is used to instruct the second network device to discard the multiple second messages except the first message that arrives at the second network device.
[0033] In the above manner, the label can not only identify the data flow, but also serve as indication information, thereby reducing the message overhead.
[0034] In one possible design, the indication information may include target function information corresponding to a destination address in a destination address field of an IPv6 header of the second message, where the destination address matches the network address of the second network device.
[0035] In the above manner, by extending a target function information in the SRv6 protocol, the reliability of message transmission in the SRv6 protocol can be achieved.
[0036] In a possible design, the network may further include a third network device. After the second network device stores the second message, the second network device may further generate a third message based on the second message, for example, by inserting path information of the third message forwarding path into the third message. The second network device forwards the third message to the third network device.
[0037] In a third aspect, an embodiment of the present invention provides a first network device for forwarding messages in a network, the first network device having a function of implementing the behavior of the first network device in the method of the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0038] In one possible implementation, the first network device includes: a receiving unit, a generating unit and a forwarding unit, wherein the receiving unit is used to receive a first message, the first message including first indication information, payload data and a message sequence number of the first message in a data stream corresponding to the first message; the generating unit is used to determine that when the first message includes the first indication information, the first network device generates multiple second messages based on the first message, each of the multiple second messages includes the payload data, the message sequence number and the second indication information; the forwarding unit is used to forward the multiple second messages to the second network device through different forwarding paths among the multiple forwarding paths, respectively, and the second indication information is used to instruct the second network device to discard the multiple second messages except the first message that arrives at the second network device.
[0039] In another possible implementation, the first network device includes: a network interface, a memory, and a processor; wherein the network interface is used to receive or send a message. A group of program codes are stored in the memory, and the processor is used to call the program codes stored in the memory to perform the following operations: receiving a first message through the network interface, the first message including first indication information, payload data, and a message sequence number of the first message in a data stream corresponding to the first message; when determining that the first message includes the first indication information, generating multiple second messages according to the first message, each of the multiple second messages including the payload data, the message sequence number, and the second indication information; forwarding the multiple second messages to the second network device through different forwarding paths among the multiple forwarding paths, respectively, the second indication information is used to instruct the second network device to discard the multiple second messages except the first message that reaches the second network device.
[0040] In another possible implementation, the first network device includes: a main control board and an interface board. The main control board includes: a first processor and a first memory. The interface board includes: a second processor, a second memory and an interface card. The main control board and the interface board are coupled. The second memory can be used to store program code, and the second processor is used to call the program code in the second memory to perform the following operations:
[0041] The trigger interface card receives a first message, where the first message includes first indication information, payload data, and a message sequence number of the first message in a data stream corresponding to the first message.
[0042] The first memory may be used to store program codes, and the first processor is used to call the program codes in the first memory to perform the following operations:
[0043] When it is determined that the first message contains the first indication information, multiple second messages are generated according to the first message, and each message in the multiple second messages contains the payload data, the message sequence number and the second indication information.
[0044] The second processor is used to call the program code in the second memory and also perform the following operations: triggering the interface card to forward the multiple second messages to the second network device through different forwarding paths among the multiple forwarding paths, and the second indication information is used to instruct the second network device to discard the multiple second messages except the first message that arrives at the second network device.
[0045] Optionally, an inter-process communication protocol (IPC) control channel is established between the main control board and the interface board.
[0046] Based on the same inventive concept, since the principle and beneficial effects of the first network device in solving the problem can refer to the method described in the first aspect and the beneficial effects brought about, the implementation of the first network device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0047] In a fourth aspect, an embodiment of the present invention provides a second network device for message forwarding in a network, the second network device having a function of implementing the second network device behavior in the method of the second aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0048] In one possible implementation, the second network device includes: a receiving unit, a searching unit, a storage unit and a discarding unit, wherein the receiving unit is used to receive a second message, where the second message is any one of a plurality of second messages generated by the first network device based on the first message, and the second message includes indication information, payload data carried by the first message and a message sequence number of the first message in a data stream corresponding to the first message; the searching unit is used to search a message receiving table for whether the message sequence number exists when the second network device determines that the second message contains the indication information, and the message receiving table is used to record the message sequence number contained in the first message among the plurality of second messages that arrives at the second network device; the storage unit is used to store the second message if the message sequence number does not exist in the message receiving table; and the discarding unit is used to discard the second message if the message sequence number exists in the message receiving table.
[0049] In another possible implementation, the second network device includes: a network interface, a memory, and a processor; wherein the network interface is used to send and receive messages, the memory stores a group of program codes, and the processor is used to call the program codes stored in the memory to perform the following operations: receiving a second message through the network interface, the second message being any one of a plurality of second messages generated by the first network device according to the first message, the second message including indication information, payload data carried by the first message, and a message sequence number of the first message in a data stream corresponding to the first message; when it is determined that the second message contains the indication information, searching a message receiving table for whether the message sequence number exists, the message receiving table being used to record the message sequence number contained in the first message among the plurality of second messages that arrives at the second network device; if the message sequence number does not exist in the message receiving table, storing the second message;
[0050] If the message sequence number exists in the message receiving table, the second message is discarded.
[0051] In another possible implementation, the second network device includes: a main control board and an interface board. The main control board includes: a first processor and a first memory. The interface board includes: a second processor, a second memory and an interface card. The main control board and the interface board are coupled.
[0052] The second memory may be used to store program codes, and the second processor is used to call the program codes in the second memory to perform the following operations:
[0053] The trigger interface card receives a second message, where the second message is any one of multiple second messages generated by the first network device based on the first message, and the second message includes indication information, payload data carried by the first message, and a message sequence number of the first message in the data stream corresponding to the first message.
[0054] The first memory may be used to store program codes, and the first processor is used to call the program codes in the first memory to perform the following operations:
[0055] When it is determined that the second message contains the indication information, check whether the message sequence number exists in a message receiving table, and the message receiving table is used to record the message sequence number contained in the first message among the multiple second messages that arrives at the second network device; if the message sequence number does not exist in the message receiving table, store the second message; if the message sequence number exists in the message receiving table, discard the second message.
[0056] Optionally, an IPC control channel is established between the main control board and the interface board.
[0057] In a fifth aspect, an embodiment of the present invention provides a computer storage medium for storing computer software instructions used for the above-mentioned first network device or second network device, which includes a program designed for executing the above-mentioned aspects.
[0058] In a sixth aspect, an embodiment of the present invention provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method described in the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the accompanying drawings required for use in the embodiment of the present invention will be described below.
[0060] Figure 1 is a schematic diagram of an application scenario provided by an embodiment of the present invention;
[0061] Figure 2 It is a flow chart of a method for forwarding a message provided by an embodiment of the present invention;
[0062] Figure 3a is a schematic diagram of the structure of a SID provided by an embodiment of the present invention;
[0063] Figure 3b is a schematic diagram of an IPv6 header provided by an embodiment of the present invention;
[0064] Figure 3c is a schematic diagram of the structure of an SRH provided by an embodiment of the present invention;
[0065] Figure 3d is a schematic diagram of the structure of a SID provided by an embodiment of the present invention;
[0066] Figure 4 This is a scenario diagram of message forwarding provided by an embodiment of the present invention;
[0067] Figure 5 This is another scenario diagram of message forwarding provided by an embodiment of the present invention;
[0068] Figure 6 This is another scenario diagram of message forwarding provided by an embodiment of the present invention;
[0069] Figure 7 This is another scenario diagram of message forwarding provided by an embodiment of the present invention;
[0070] Figure 8 is a structural diagram of a first network device provided by an embodiment of the present invention;
[0071] Fig. 9 is a structural diagram of a second network device provided by an embodiment of the present invention;
[0072] Fig.10 It is a structural schematic diagram of a network device provided by an embodiment of the present invention;
[0073] Fig.11 It is a structural diagram of another network device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0074] The embodiments of the present invention are described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0075] The embodiment of the present invention provides a method for forwarding a message in a network and a network device based on the method, which is used to copy a first message in the network, obtain multiple second messages, and forward the multiple second messages to the same network device through multiple different parallel forwarding paths. The network device only stores the first second message that arrives at the network device, and discards the second message except the first one among the multiple second messages, so as to improve the reliability of message forwarding. Among them, the method and the network device are based on the same inventive concept. Since the principles of solving the problem by the method and the network device are similar, the implementation of the network device and the method can refer to each other, and the repeated parts will not be repeated.
[0076] Figure 1 A possible application scenario of an embodiment of the present invention is shown. In this application scenario, network device R1, network device R2, network device R3, network device R4, network device R5 and network device R6 form a physical network. Alternatively, the physical network involved in the embodiment of the present invention may only include network device R2, network device R3, network device R4 and network device R5, etc. The embodiment of the present invention does not limit the existence form of the physical network. Optionally, the physical network can be a data center network, a wireless network, a deterministic network (DetNet) or a segment routing (SR) network, etc.
[0077] The first network device in the embodiment of the present invention may be Figure 1 The network device R2 in the second network device may be Figure 1 In the network device R5, there are multiple forwarding paths between the first network device and the second network device. Figure 1 In the network architecture, network device R2 can reach network device R5 through network device R3. At the same time, network device R2 can reach network device R5 through network device R4, that is, there are two forwarding paths between network device R2 and network device R5. It can be understood that there may be other forwarding paths between network devices R2 and R5. The embodiment of the present invention only takes two forwarding paths as an example.
[0078] Optionally, for one of the forwarding paths, such as the forwarding path R2-R3-R5, the network device R2 may use an intermediate network device for forwarding (i.e. Figure 1 The message arrives at the network device R5 through the network device R3) of the network device R2, and the network device R2 can also reach the network device R5 through two or more intermediate network devices for forwarding. For example, after the message arrives at the network device R3, the network device R3 forwards the message to the network device R7, and finally the network device R7 forwards the message to the network device R5.
[0079] The network devices R1-R6 can be routers or switches, or forwarders under the network architecture of Software Defined Network (SDN). In the embodiment of the present invention, after the first network device (such as R2) receives the first message, when it is determined that the first message contains the first indication information for instructing the first network device to generate multiple second messages, multiple second messages are generated, and the multiple second messages are forwarded to the second network device (such as R5) from different forwarding paths respectively. The second network device stores the first second message that arrives at the second network device among the multiple second messages, and discards the second message except the first second message that arrives at the second network device among the multiple second messages. By adopting the above-mentioned message forwarding method, even if there are problems with the network links of some forwarding paths among the multiple forwarding paths, it will not affect the reception of the second message by the second network device, thereby improving the reliability of message forwarding.
[0080] Combination Figure 1 The application scenario shown is shown in Figure 2 , an embodiment of the present invention provides a flow chart of a method for message forwarding, the method comprising:
[0081] S10. A first network device receives a first message, where the first message includes first indication information, payload data, and a message sequence number of the first message in a data stream corresponding to the first message.
[0082] In one embodiment, the first indication information is used to indicate that the first network device generates multiple second messages according to the first message. The payload data is the user data to be transmitted. The message sequence number is the number of the first message in the corresponding data stream. For example, the data stream corresponding to the first message includes multiple messages, which are numbered according to the sending order of each message in the multiple messages. The number can be the message sequence number. The message sequence number of a message will not be changed during the process of forwarding and repackaging the message. For example, the first message is repackaged into the second message, and the message sequence number will not change, that is, the message sequence number included in the second message is the same as the message sequence number included in the first message. For another example, the second message is received by another network device and repackaged into a third message, and the message sequence number will still not be changed, that is, the message sequence number included in the third message is the same as the message sequence number included in the first message.
[0083] S11, when the first network device determines that the first message contains the first indication information, the first network device generates multiple second messages according to the first message, each of the multiple second messages contains the payload data, the message sequence number and the second indication information.
[0084] S12, the first network device forwards the multiple second messages to the second network device through different forwarding paths among the multiple forwarding paths, and the second indication information is used to instruct the second network device to discard the multiple second messages except the first message that reaches the second network device.
[0085] S13: The second network device receives a second message, where the second message is any one of a plurality of second messages generated by the first network device according to the first message.
[0086] S14, when the second network device determines that the second message contains the second indication information, the second network device searches a message receiving table for the message sequence number, wherein the message receiving table is used to record the message sequence number contained in the first second message among the multiple second messages that arrives at the second network device.
[0087] S15: If the message sequence number does not exist in the message receiving table, the second network device stores the second message.
[0088] S16: If the message sequence number exists in the message receiving table, the second network device discards the second message.
[0089] Optionally, the first network device generates multiple second messages based on the first message in the following manner: the first network device copies the first message to form multiple copy messages, and for each copy message, pops out unnecessary information in the second message (such as path information carried in the first message, first indication information, etc.) from the copy message, and then pushes in required information in the second message (such as second indication information, path information corresponding to the second message, etc.). Alternatively, the first network device pops out unnecessary information in the second message (such as path information carried in the first message, first indication information, etc.), and then copies the popped-out message to form multiple copy messages, and then pushes in required information in the second message (such as second indication information, path information corresponding to the second message, etc.) for each copy message. Alternatively, the first network device pops out unnecessary information in the second message (such as path information carried in the first message, first indication information, etc.) from the first message, and then pushes in the same information shared by all second messages (such as second indication information), and then copies the pushed message to form multiple copied messages, and for each copied message, specifically pushes in information unique to the copied message (such as path information corresponding to the second message). It should be noted that the generation method of the first network device generating multiple second messages based on the first message is not limited to the above three methods, and the above three methods are only for example.
[0090] It should be noted that the path information corresponding to the second message refers to the path information of the forwarding path corresponding to the second message. Each message is forwarded through a different forwarding path, so the path information of the forwarding path contained in each message is different. For example, if a second message is forwarded through forwarding path 1, and another second message is forwarded through forwarding path 2, then the path information of the forwarding path contained in the second message is the path information of forwarding path 1, and the path information of the forwarding path contained in the other second message is the path information of forwarding path 2.
[0091] Optionally, the path information of the forwarding path corresponding to each message may be pre-configured in the first network device. When the first network device generates multiple second messages, the path information of the forwarding path corresponding to each second message is searched from the local storage device. For example, the first network device stores the path information of each forwarding path in the multiple forwarding paths associated with the flow identifier of the data flow corresponding to the first message. The first message may also include the flow identifier of the data flow corresponding to the first message. When the first network device parses the flow identifier from the first message, the path information of the multiple forwarding paths associated with the flow identifier can be found, and the path information of the multiple forwarding paths can be respectively encapsulated into the corresponding second message. The second message may also include the flow identifier, so that the second network device can find the path information of the forwarding path corresponding to the third message after the second message is re-encapsulated according to the flow identifier.
[0092] In a first optional implementation, the first indication information may include a first label, and the second indication information may include a second label. The first label corresponds to a first function, and the first function is used to instruct the first network device to generate multiple second messages, for example, the first label is a copy label. The second label corresponds to a second function, and the second function is used to instruct the second network device to discard the multiple second messages except the first message that reaches the second network device, for example, the second label is a redundant label.
[0093] When the first network device recognizes that the top of the first message includes the first label, it generates multiple second messages according to the first message, and forwards the multiple second messages to the second network device through different forwarding paths.
[0094] Tags corresponding to different functions are encapsulated in the message to facilitate network devices to identify the tags and perform operations corresponding to the tags, thereby improving operational efficiency.
[0095] In a second optional implementation, the first indication information and the second indication information may both include a third tag, and the third tag is used to uniquely identify the data stream corresponding to the first message. Since the third tag can identify the data stream corresponding to the first message, the first message and the second message may not need to encapsulate the flow identifier to save message overhead.
[0096] The correspondence between the third tag and the operation type needs to be pre-configured in the first network device and the second network device. For example, the operation type corresponding to the third tag is configured as a target operation type in the first network device. The target operation type is used to instruct the first network device to generate multiple second messages according to the first message. Optionally, the target operation type is a copy operation type. When the first network device receives the first message and parses the top of the first message to obtain the third tag, the target operation type corresponding to the third tag is found to be a copy operation type, and then multiple second messages are generated according to the first message. The target operation type corresponding to the third tag is configured in the second network device. The target operation type is a deletion operation type, which is used to instruct the second network device to discard the multiple second messages except the first message that reaches the second network device.
[0097] By adopting the above manner, the third label can not only identify the data flow corresponding to the message, but also serve as different indication information, so there is no need to additionally encapsulate the flow identifier in the message, thereby reducing the message overhead.
[0098] Optionally, the first label, the second label and the third label are labels used in the SR network.
[0099] In a third optional implementation manner, the message forwarding method of the embodiment of the present invention can be applied to an SRv6 network, and the first indication information can include first function information corresponding to the first address in the destination address field of the IPv6 header of the first message, and the first function information can be an extended function information, and the first function information is used to instruct the first network device to generate multiple second messages, such as the first function information is a replication function. The first address matches the network address of the first network device.
[0100] The first network device generates multiple second messages based on the first message, each message including second indication information, path information of the forwarding path corresponding to the message, a message sequence number, and payload data. The second indication information may be second functional information corresponding to the second address in the SRH of the second message, the second address matches the network address of the second network device, the second functional information may be another extended functional information, and the second functional information is used to instruct the second network device to discard other messages among the multiple second messages except the first one that arrives at the second network device. For example, the second functional information is redundancy removal functional information.
[0101] like Figure 3aAs shown in the figure, the main idea of SRv6 Programming is to divide the SRv6 local segment identification (local SID) into two parts, LOC (Local) and FUNCT (Function), and each of the two parts occupies 64 bits. LOC is usually the network segment address that can be routed to the current network device, and FUNCT is usually a function corresponding to the SID, such as the current function Endpoint Function.
[0102] Optionally, the SRv6 message structure includes: Figure 3b The IPv6 header shown in Figure 3c When the information carried in the destination address field in the IPv6 header of the message matches the SRv6 local SID of the network device, and the function of FUNCT is Endpoint, the network device updates the information in the destination address field of the IPv6 header with the corresponding segment list in the SRH of the message structure, and further searches the forwarding table for the updated destination address, forwards it according to the search result, otherwise discards the message. It should be noted that the format of the destination address field in the IPv6 header is the same as Figure 3a The format of the SRv6local SID in the SRH is the same as that of the Figure 3a The format of the SRv6 local SID is the same as that in .
[0103] In the embodiment of the present invention, two new functional information in addition to the Endpoint Function are extended: the first functional information and the second functional information. The first functional information is used to instruct the first network device to generate multiple second messages, such as the first functional information is the copy functional information. The second functional information is used to instruct the second network device to discard the second message except the first one to reach the second network device, such as the second functional information is the redundancy deletion functional information.
[0104] Optionally, when the first network device receives the first message, the address in the destination address field of the message header of the first message matches the network address of the first network device, and the first function information in the destination address field is the copy function information, then the first network device copies the first message. At the same time, the first network device obtains the flow identifier of the data stream corresponding to the first message, searches for the SRH corresponding to the flow identifier, and the SRH includes the second address and the second function information corresponding to the second address, and the second address matches the network address of the second network device. At the same time, the SRH includes the path information of the forwarding path of the second message (that is, the network addresses of all network devices in the forwarding path), and the function information corresponding to the other addresses in the SRH except the second address (that is, the network address of the intermediate network device in the forwarding path) is Endpoint, that is, the intermediate network device only updates the destination address field in the SRH of the second message, and searches the forwarding table for forwarding. The first network device replaces the SRH in the copied message with the searched SRH, and updates the destination address field in the IPv6 header to obtain the second message.
[0105] Optional, if SID is used Figure 3a The first message and the second message may further include a DetNetSRv6 header, and the DetNet SRv6 header includes a flow identifier and a message sequence number. Figure 3d The encapsulation method is to encapsulate the flow ID and the message sequence number into the SID as the parameters of the function information. The first message and the second message may not include the DetNet SRv6 header, thereby saving message overhead. The FUN itself occupies 4 bits, the Flow ID occupies 28 bits, and the message sequence number SN occupies 32 bits.
[0106] By extending the first function information and the second function information, the message forwarding method can be adopted in a network supporting the SRv6 protocol to improve the reliability of message forwarding.
[0107] The first network device forwards the multiple second messages to the second network device through different forwarding paths among the multiple forwarding paths between the first network device and the second network device.
[0108] The second network device receives the second message. It should be noted that the second message received by the second network device may be different from the second message sent by the first network device. For example, there is at least one intermediate network device in the forwarding path between the first network device and the second network device. The intermediate network device will re-encapsulate the received message (for example, pop up the corresponding MPLS label), and then forward the re-encapsulated message. However, the second indication information, message sequence number, payload data, etc. are still present in the message re-encapsulated by the intermediate network device. In essence, the message is the same as the second message sent by the first network device. Therefore, the embodiments of the present invention are collectively referred to as the second message.
[0109] Here continues Figure 1 As an example, there are two forwarding paths between network device R2 and network device R5. Here, the forwarding path R2-R4-R5 is taken as an example. Network device R2 sends a second message, and the second message arrives at network device R4. Network device R4 performs corresponding encapsulation processing on the second message (such as popping up the corresponding MPLS label, or updating the information of the destination address field of the IPv6 header), and sends the encapsulated message to network device R5. In this embodiment of the present invention, the message received by network device R5 is still called the second message. The second message is essentially the same as the second message sent by network device R2, but there will be some changes after being processed by the intermediate network device R4.
[0110] The second network device parses the received second message, and when it is determined that the second message contains indication information, the second network device searches the message receiving table to see whether there is a message sequence number contained in the second message. Optionally, the indication information is used to instruct the second network device to discard the message other than the first one to reach the second network device among the multiple second messages sent by the first network device. The indication information is the same as the second indication information contained in the second message sent by the first network device. The message receiving table is used to record the message sequence number contained in the first second message to reach the second network device. For example, each time the second network device receives a message, it searches the message receiving table to see whether the message sequence number contained in the message exists. If the message sequence number exists in the message receiving table, it means that the second network device has received the message containing the message sequence number, and the second network device discards the message; if the message sequence number does not exist in the message receiving table, it means that the second network device has not yet received the message containing the message sequence number, and the second network device stores the message. Further, optionally, the second network device can also forward the message.
[0111] As an optional implementation, the indication information may include a label, and the label corresponds to a target function, and the target function is used to instruct the second network device to discard the multiple second messages except the first message that arrives at the second network device. The label here is the same as the second label contained in the second message sent by the first network device in the aforementioned first optional implementation. The target function corresponding to the label here is the same as the second function corresponding to the second label, and will not be repeated here. When the second network device recognizes that the top of the second message includes the label, it stores the first second message that arrives at the second network device, and discards the multiple second messages except the first message that arrives at the second network device.
[0112] The label corresponding to the target function is encapsulated in the second message, so that the second network device can identify the label and perform the operation corresponding to the label, thereby improving the operation efficiency.
[0113] As another optional implementation, the indication information may include a label, and the label is used to identify the data stream corresponding to the first message. The label here is the same as the third label included in the second message sent by the first network device in the aforementioned second optional implementation, and will not be repeated here. It should be noted that the correspondence between the label and the operation type needs to be configured in the second network device. When the second network device finds that the operation type corresponding to the label is the target operation type, the second network device searches the message receiving table to see whether there is a message sequence number included in the second message. Among them, the target operation type is used to instruct the second network device to discard multiple second messages sent by the first network device except the first message that reaches the second network device.
[0114] By adopting the above method, the label can not only identify the data flow corresponding to the message, but also serve as indication information, so there is no need to additionally encapsulate the flow identifier in the message, thereby reducing the message overhead.
[0115] As another optional implementation, the indication information may include target function information corresponding to the destination address in the destination address field of the IPv6 header of the second message, the destination address matches the network address of the second network device, and the target function information is used to instruct the second network device to discard the first message that reaches the second network device among the multiple second messages sent by the first network device. For the format of the IPv6 header of the second message, please refer to the third optional implementation described above, which will not be repeated here.
[0116] It should be noted that, since there may be forwarding by an intermediate network device between the first network device and the second network device, the intermediate network device will update the IPv6 header of the second message sent by the first network device according to the SRH contained in the second message sent by the first network device during the forwarding process. Therefore, there is a difference between the IPv6 header of the second message received by the second network device and the second message sent by the first network device. The information in the destination address field of the IPv6 header of the second message received by the second network device is the same as the second indication information contained in the SRH of the second message sent by the first network device.
[0117] Optionally, the network further includes a third network device, and there is at least one forwarding path between the second network device and the third network device. When the second network device fails to find the message sequence number contained in the received second message in the message receiving table, the second network device searches for the path information of the forwarding path corresponding to the flow identifier contained in the second message, encapsulates the path information in the second message, obtains the third message, and forwards the re-encapsulated third message to the third network device. The path information may include the MPLS label stack and SRH described in the above embodiment.
[0118] By extending the target function information, the above message forwarding method can be adopted in a network supporting the SRv6 protocol to improve the reliability of message forwarding.
[0119] The following will be combined with the attached Figure 4 To Attachment Figure 7 The above embodiments are described by way of example. Figure 4 To Attachment Figure 7 In this article, the flow identifier is referred to as flow ID, and the message sequence number is referred to as SN:
[0120] Optional, combined Figure 4 The scenario in which the first indication information includes the first tag and the second indication information includes the second tag is illustrated as follows: Figure 4 As shown, the scenario can be a message forwarding scenario in an MPLS segment routing (segment routing, SR) network, and the payload data can be DetNet payload data. Two fields are extended at the bottom of the SR label stack to form a DetNet header (DetNet MPLS Segment Routing Encapsulation Header), and the two fields include: flow identifier (Flow ID) and message sequence number (sequence num, SN). At the same time, three SR labels with special meanings are defined: a copy label, a redundant label, and a DetNet label.
[0121] Among them, copy label: as an instruction to copy the message, when the network device receives a DetNet message with a copy label at the top, copy the message and push it into the corresponding label stack (such as a redundant label and an MPLS label stack). DetNet redundant label: as an instruction to delete redundant messages, when the network device receives a DetNet message with a redundant label at the top, search for the Flow ID and Sequence Num of the message, store the message received for the first time, and discard the redundant message. If the message needs to be further forwarded, push the corresponding label stack (such as a DetNet label and an MPLS label stack) before forwarding, and then forward it. DetNet label: used to mark the transmitted message as belonging to a DetNet data flow, and has a DetNet header. The first label mentioned in the embodiment of the present invention may be the above-mentioned copy label, and the second label may be the above-mentioned redundant label.
[0122] A copy label stack table is configured in the first network device, and the copy label stack table is used to describe the association relationship between the Flow ID and the path information (MPLS label stack) of multiple forwarding paths corresponding to multiple second messages, and is used to push a new MPLS label stack into the second message, and the new MPLS label stack is used to indicate the forwarding path of the second message. An aggregation label stack table and a message receiving table are configured in the second network device. The aggregation label stack table is used to describe the association relationship between the Flow ID and the path information of the forwarding path corresponding to the third message, and the third message is a message after the second message that first arrives at the second network device is re-encapsulated. The aggregation label stack table is used to push a new MPLS label stack into the third message, and the new MPLS label stack is used to indicate the forwarding path of the third message. It should be noted that if the second network device will not continue to forward the second message to other network devices, it is not necessary to configure the aggregation label stack table in the second network device. The message receiving table is used to record the Flow ID and the Sequence Number. If a message corresponding to a certain Sequence Number has been received by the second network device, the second network device will record the Sequence Number in the message receiving table. If the message corresponding to the Sequence Num reaches the second network device again, the second network device will discard the message. Through the message receiving table, the second network device can filter multiple second messages sent by the first network device and only store or forward the first second message that reaches the second network device.
[0123] For details, please refer to Figure 4As shown, the first network device is R2, the second network device is R5, and the network device R1 receives a DetNet message and encapsulates it, that is, encapsulates the inflow ID1, SN10, and copy label 1001 to obtain the first message. If there is a multi-hop route between the network device R1 and the network device R2, the message also needs to be encapsulated into an MPLS label stack for indicating the forwarding path of the first message. The network device R2 receives the first message sent by the network device R1, and parses the first message, and determines that the top of the label stack of the first message is the copy label 1001, then copies the first message, pops up the copy label 1001, and pushes a new label stack to obtain two second messages, the new label stack includes a redundant label 1002 and an MPLS label stack for indicating the forwarding path of the second message, wherein the redundant label 1002 is at the bottom of the MPLS label stack.
[0124] Network device R2 sends the two second messages obtained to network device R3 and network device R4 respectively. After receiving the second messages, network devices R3 and R4 forward them according to the MPLS label at the top of the label stack of the second messages. Network device R5 receives messages with Sequence Num 10 transmitted from network devices R4 and R3 respectively. For example, if the message from network device R4 arrives first, network device R5 updates the message receiving table and pushes in a new label stack, including the DetNet label and the MPLS label stack that guides the subsequent forwarding path; when the message from network device R3 arrives again, R5 searches the message receiving table for the message sequence number SN10 that already exists, and then discards the message forwarded by network device R3. The message sent by network device R5 will eventually be transmitted to network device R7, which removes the encapsulation and obtains the payload data.
[0125] Optional, combined Figure 5 The scenario in which the first indication information and the second indication information are both third tags is illustrated by way of example. Figure 5 As shown, the scenario can be a message forwarding scenario in the MPLS SR protocol. The payload data can be DetNet payload data. A field is extended at the bottom of the SR label stack: the message sequence number (SN). At the same time, a DetNet SR label (i.e., the third label) is defined, and the DetNet SR label corresponds to the data flow one by one. The first network device and the second network device determine the type of operation to be performed on the message by identifying the DetNet SR label. The first network device can be Figure 5 The network device R2 in the second network device may be Figure 5 Network device R5 in.
[0126] A DetNet SR label operation table is configured in the first network device and the second network device. The label operation table is used to describe the operation type corresponding to the DetNet SR label. For example, in the first network device, the operation type corresponding to the DetNet SR label described in the label operation table is a copy operation, and in the second network device, the operation type corresponding to the DetNet SR label described in the label operation table is a redundant deletion operation. At the same time, the second network device configures a message receiving table. For a description of the message receiving table, please refer to Figure 4 Description, in Figure 5 DetNet SR labels are used instead of Figure 4 The FlowID in is not repeated here.
[0127] For details, please refer to Figure 5 As shown, network device R1 receives a DetNet message, encapsulates it, that is, encapsulates SN10 and DetNet12 (that is, DetNet SR label), and obtains a first message. If there is a multi-hop route between network device R1 and network device R2, the message also needs to be encapsulated with an MPLS label stack for indicating the forwarding path of the first message. Network device R2 receives the first message sent by network device R1, parses the first message, obtains the DetNet12 label included in the first message, and searches the label operation table for the target operation type corresponding to DetNet12. If the target operation type indicates a copy operation for the first message, the first message is copied and a new label stack is pushed in to obtain two second messages, and the new label stack contains an MPLS label stack for indicating the forwarding path of the second message.
[0128] Network device R2 sends the two second messages obtained to network device R3 and network device R4 respectively. After receiving the second messages, network device R3 and network device R4 forward them according to the MPLS label at the top of the label stack of the second messages. Network device R5 receives the messages transmitted from network device R4 and network device R3 respectively, searches the DetNet label operation table, and finds that the target operation type corresponding to the DetNet12 label is redundant deletion. Then network device R5 forwards the first received message and discards the repeated received message. For the specific operation process of network device R5, please refer to Figure 4 The description will not be repeated here.
[0129] Optional, combined Figure 6 and Figure 7 The scenario in which the first indication information includes the first function information in the destination address field of the IPv6 header of the first message, and the second indication information includes the second function information in the SRH of the second message is illustrated by way of example. Figure 6 and Figure 7 As shown, the scenario may be a message forwarding scenario in the SRv6 protocol, and the payload data may be DetNet payload data. The first network device may be the network device R2, and the second network device may be the network device R5.
[0130] A duplicate message SRH table is configured in the first network device, and the duplicate message SRH table is used to describe the correspondence between the flow identifier and multiple SRHs, and is used to encapsulate a new SRH for the duplicate message, thereby forming a second message. A redundant message deletion SRH table is configured in the second network device, and the redundant message deletion SRH table is used to describe the correspondence between the flow identifier and multiple SRHs, and is used to encapsulate a new SRH for the second message first received by the second network device. A message receiving table is also configured in the second network device, and the message receiving table is used to record the message sequence number contained in the second message that first arrives at the second network device.
[0131] Two types of functional information are extended at the same time: copy functional information and redundant deletion functional information. Copy functional information: When a network device receives an SRv6 message, and the destination address of the IPv6 header of the message matches the network address of the network device, and the functional information corresponding to the destination address is copy functional information, the network device copies the message, obtains the flow identifier, searches the SRH corresponding to the flow identifier in the SRH table of the copied message, replaces the SRH in the copied message with the SRH corresponding to the flow identifier in the table, and updates the destination address field of the IPv6 header, thereby forming a second message, and forwarding the message according to the information in the destination address field of the IPv6 header of the second message.
[0132] Redundancy removal function information: When a network device receives an SRv6 message, the destination address of the IPv6 header of the message matches the network address of the network device, and the function information corresponding to the destination address is redundant removal function information, the network device obtains the flow identifier and message sequence number, and searches the message receiving table for the message sequence number. If the message sequence number exists in the message receiving table, the message is discarded. If the message sequence number does not exist in the message receiving table, the redundant message SRH table is searched, and the SRH corresponding to the flow identifier in the redundant message SRH table is replaced with the SRH of the received message, and the destination address field of the IPv6 header is updated, and the message is forwarded according to the information in the destination address field.
[0133] The flow identifier and the message sequence number may be a DetNet SRv6 header encapsulated in the message, that is, the DetNet SRv6 header includes: the flow identifier and the message sequence number. Figure 6As shown, network device R1 encapsulates the message, adds a DetNet SRv6 header, an SRH, and an IPv6 header, and obtains a first message. Network device R2 receives the first message, parses the first message, determines that the destination address of the IPv6 header of the first message matches the network address of network device R2, and the function information corresponding to the destination address in the IPv6 header is a copy function, and network device R2 copies the message. Network device R2 obtains the flow identifier and message sequence number from the DetNet SRv6 header, and network device R2 finds the corresponding SRH from the copied message SRH table, and replaces the SRH of the copied message with the found SRH, and updates the IPv6 header of the copied message to obtain a second message.
[0134] The network device R2 sends the two generated second messages to the network device R3 and the network device R4 respectively. Since the function information corresponding to the network device R3 and the network device R4 is Endpoint, the network devices R3 and R4 only update the destination address field of the IPv6 header of the message according to the SRH of the message and forward it. Specifically, the updating method of updating the destination address field of the message according to the SRH of the message can be to replace the information of the destination address field with the corresponding segment list in the SRH.
[0135] Network device R5 receives messages with Sequence Num 10 transmitted from network devices R4 and R3 respectively. For example, if the message from network device R4 arrives first, network device R5 determines that the destination address in the destination address field of the message matches the network address of network device R5, and the function information corresponding to the destination address is redundant deletion function information. Network device R5 searches the message receiving table and finds that the message sequence number does not exist. Network device R5 updates the message receiving table and replaces the SRH of the received message according to the redundant message SRH table. At the same time, it updates the IPv6 header of the message and forwards it. When the message from network device R3 arrives again, R5 searches the message receiving table and finds that the message sequence number SN10 already exists. Then it discards the message forwarded by network device R3. The message sent by network device R5 will finally be transmitted to network device R7, which removes the encapsulation and obtains the payload data.
[0136] The flow identifier and message sequence number can also be encapsulated in the SRH, that is, the segment list uses Figure 3d The format is encapsulated. Figure 7 As shown in the figure, the encapsulation structure of each message is Figure 6 The encapsulation structure is different in that there is no need to add the DetNetSRv6 header, and the operation mode of each network device is the same as Figure 6 The embodiments are the same and will not be described again here.
[0137] See also Figure 8 The embodiment of the present invention provides a first network device 800 for forwarding a message in a network, the network comprising a first network device and a second network device, wherein there are multiple forwarding paths between the first network device and the second network, and the first network device comprises:
[0138] The receiving unit 801 is configured to receive a first message, where the first message includes first indication information, payload data, and a message sequence number of the first message in a data stream corresponding to the first message;
[0139] The generating unit 802 is configured to, when determining that the first message includes the first indication information, generate, by the first network device, a plurality of second messages according to the first message, each of the plurality of second messages including the payload data, the message sequence number and the second indication information;
[0140] The forwarding unit 803 is used to forward the multiple second messages to the second network device through different forwarding paths among the multiple forwarding paths, and the second indication information is used to instruct the second network device to discard the multiple second messages except the first message that reaches the second network device.
[0141] In a possible implementation, the first message further includes a flow identifier of the data flow corresponding to the first message; the first network device further includes a search unit 804;
[0142] The searching unit 804 is configured to search for path information of each forwarding path in the multiple forwarding paths associated with the flow identifier, wherein one second message corresponds to one forwarding path in the multiple forwarding paths.
[0143] In a possible implementation, the first indication information includes a first tag, and the second indication information includes a second tag, the first tag corresponds to a first function, and the second tag corresponds to a second function, the first function is used to instruct the first network device to generate multiple second messages, and the second function is used to instruct the second network device to discard the multiple second messages except for the first message that reaches the second network device;
[0144] The path information of the forwarding path includes a Multi-Protocol Label Switching (MPLS) label stack of the forwarding path.
[0145] In a possible implementation, the first indication information includes a third label, and the second indication information includes the third label, where the third label is used to identify a data flow corresponding to the first message;
[0146] The path information of the forwarding path includes an MPLS label stack of the forwarding path;
[0147] The search unit 804 is further configured to search for an operation type corresponding to the third tag;
[0148] The generating unit 802 is specifically configured to generate a plurality of second messages according to the first message if the operation type corresponding to the third tag is a target operation type, wherein the target operation type is used to instruct the first network device to generate a plurality of second messages.
[0149] In a possible implementation, the first indication information includes first function information corresponding to a first address in a destination address field of a sixth Internet Protocol IPv6 header of the first message, and the first address matches a network address of the first network device;
[0150] The second message includes a segment routing header SRH, the SRH includes path information of a forwarding path corresponding to the second message and the second indication information, the second indication information includes second function information corresponding to a second address of a target segment list in the SRH, and the second address matches a network address of the second network device.
[0151] In a possible implementation, the flow identifier and the message sequence number are encapsulated in a segment list of the SRH; or,
[0152] The second message also includes an IPv6-based segment routing protocol SRv6 header, and the flow identifier and the message sequence number are encapsulated in the SRv6 header.
[0153] The first network device 800 may be a router or a switch or a network device with a forwarding function. The first network device can implement the functions of the first network device in the aforementioned embodiment. The specific execution steps may refer to the aforementioned method embodiment, which will not be repeated here.
[0154] See also Fig. 9 The embodiment of the present invention provides a second network device 900 for message forwarding in a network, the network comprising a first network device and a second network device, wherein there are multiple forwarding paths between the first network device and the second network, and the second network device comprises:
[0155] A receiving unit 901 is configured to receive a second message, where the second message is any one of a plurality of second messages generated by the first network device according to the first message, and the second message includes indication information, payload data carried by the first message, and a message sequence number of the first message in a data stream corresponding to the first message;
[0156] A search unit 902 is used to search whether the message sequence number exists in a message receiving table when the second network device determines that the second message includes the indication information, and the message receiving table is used to record the message sequence number included in the first message of the plurality of second messages that arrives at the second network device;
[0157] A storage unit 903, configured to store the second message if the message sequence number does not exist in the message receiving table;
[0158] The discarding unit 904 is configured to discard the second message if the message sequence number exists in the message receiving table.
[0159] In a possible implementation, the indication information includes a label, the label corresponds to a target function, and the target function is used to instruct the second network device to discard the plurality of second messages except a first message that reaches the second network device.
[0160] In a possible implementation, the indication information includes a label, where the label is used to identify a data flow corresponding to the first message;
[0161] The search unit 902 is specifically used to search whether the message sequence number exists in the message receiving table if the operation type corresponding to the label is a target operation type, and the target operation type is used to instruct the second network device to discard the multiple second messages except the first message that arrives at the second network device.
[0162] In a possible implementation, the indication information includes target function information corresponding to a destination address in a destination address field of an Internet Protocol version 6 IPv6 header of the second message, and the destination address matches a network address of the second network device.
[0163] In a possible implementation, the network further includes a third network device, and the second network device further includes:
[0164] A generating unit 905, configured to generate a third message according to the second message, wherein the third message includes the payload data and the message sequence number;
[0165] The forwarding unit 906 is configured to forward the third message to the third network device.
[0166] The second network device 900 may be a router or a switch or a network device with a forwarding function. The second network device can implement the functions of the second network device in the aforementioned embodiment. The specific execution steps may refer to the aforementioned method embodiment and will not be repeated here.
[0167] See also Fig.10The embodiment of the present invention provides a network device 1000. The network device 1000 may be a router or a switch or a network device with a forwarding function. The network device 1000 can implement the functions of the first network device or the second network device in the aforementioned method embodiment. The network device 1000 includes: a processor 1001, a network interface 1002, and a memory 1003. The memory may be used to store program codes and data of the network device. The processor 1001 is used to call the program instructions in the memory 1003 to execute the method shown in the aforementioned embodiment. The specific execution steps can be referred to the aforementioned method embodiment, which will not be repeated here.
[0168] See also Fig.11 The embodiment of the present invention provides a network device 1100. The network device 1000 may be a router or a switch or a network device with a forwarding function. The network device 1000 can implement the functions of the first network device or the second network device in the aforementioned method embodiment. The network device 1100 includes: a main control board 1101 and an interface board 1102. The main control board 1101 includes: a processor 1103 and a memory 1104. The interface board 1102 includes: a processor 1105, a memory 1106 and an interface card 1107. The main control board 1101 and the interface board 1102 are coupled.
[0169] The memory 1104 may be used to store the program code of the main control board 1101 , and the processor 1103 is used to call the program code in the memory 1104 to execute corresponding message processing operations.
[0170] The memory 1106 can be used to store the program code of the interface board 1102, and the processor 1105 is used to call the program code in the memory 1106 to perform the corresponding operation of sending and receiving messages.
[0171] In a possible implementation, an inter-process communication protocol IPC control channel is established between the main control board 1101 and the interface board 1102 .
[0172] The present invention also provides a computer storage medium for storing Figure 2 The computer software instructions used by the first network device or the second network device in the illustrated embodiment include a program for executing the method illustrated in the aforementioned embodiment.
[0173] The "first" in the first network device mentioned in the embodiment of the present invention is only used as a name identifier and does not represent the first in order. The same rule applies to the "second" and "third".
[0174] The steps of the method or algorithm described in conjunction with the disclosure of the present invention may be implemented in hardware or by executing software instructions by a processor. The software instructions may be composed of corresponding software modules, which may be stored in random access memory (RAM), flash memory, read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), hard disk, mobile hard disk, optical disk or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium may also be a component of the processor. The processor and the storage medium may be located in an ASIC. In addition, the ASIC may be located in a core network interface device. Of course, the processor and the storage medium may also exist in the core network interface device as discrete components.
[0175] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention may be implemented in hardware, software, firmware, or any combination thereof. When implemented using software, the functions 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 a computer program from one place to another. The storage medium may be any available medium that a general or special-purpose computer can access.
[0176] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for forwarding a message in a network, characterized in that: The method is applied to a segment routing SRv6 network based on the sixth version of the Internet Protocol, and the method comprises: The first network device obtains a first message, where the first message includes first indication information, where the first indication information is an SRv6 segment identifier SID, and the first network device is a device in the SRv6 network; Determining, by the first network device, that the first message includes the first indication information; In response to determining that the first message includes the first indication information, the first network device obtains one or more second messages by copying the first message; The first network device forwards the one or more second messages through one or more forwarding paths.
2. The method according to claim 1, characterized in that The SRv6 SID is included in a destination address field of an IPv6 header of the first message.
3. The method according to claim 1 or 2, characterized in that: The SRv6 SID corresponds to a first function, and the first function is used to instruct the first network device to perform a copy operation on the first message.
4. The method according to claim 1 or 2, characterized in that: The payload data of each of the one or more second messages is the same as the payload data of the first message.
5. The method according to claim 1 or 2, characterized in that: The first network device obtaining the first message includes: The first network device receives the first message sent by the second network device, or, The first network device generates the first message.
6. The method according to claim 1 or 2, characterized in that: The first message includes a first segment routing header SRH.
7. The method according to claim 6, characterized in that The second message includes the first SRH and the second SRH.
8. The method according to claim 1 or 2, characterized in that: The function part Function of the SRv6 SID instructs the first network device to perform a copy operation on the first message.
9. The method according to claim 1 or 2, characterized in that: The first network device stores path information of the forwarding path, and the method further includes: The first network device obtains the path information of the forwarding path corresponding to the second message from the path information of the forwarding path stored locally.
10. The method according to claim 9, characterized in that The first network device forwarding the one or more second messages through one or more forwarding paths includes: The first network device forwards the one or more second messages by acquiring path information of a forwarding path corresponding to the second message.
11. A first network device, characterized in that: The first network device is a device in a segment routing SRv6 network based on the sixth version of the Internet Protocol, and the first network device includes: A receiving unit, configured to obtain a first message, where the first message includes first indication information, where the first indication information is an SRv6 segment identifier SID; a generating unit, configured to obtain one or more second messages by copying the first message when determining that the first message includes the first indication information; A forwarding unit is used to forward the one or more second messages through one or more forwarding paths.
12. The first network device according to claim 11, characterized in that: The SRv6 SID is included in the destination address field of the IPv6 header of the first message.
13. The first network device according to claim 11 or 12, characterized in that: The first indication information corresponds to a first function, and the first function is used to instruct the first network device to perform a copy operation on the first message.
14. The first network device according to claim 11 or 12, characterized in that: The payload data of each of the one or more second messages is the same as the payload data of the first message.
15. The first network device according to claim 11 or 12, characterized in that: The receiving unit obtaining the first message includes: The receiving unit receives the first message sent by the second network device in the SRv6 network, or, The receiving unit obtains the first message generated by the first network device.
16. The first network device according to claim 11 or 12, characterized in that: The first message includes a first segment routing header SRH.
17. The first network device according to claim 11 or 12, characterized in that: The second message includes a second SRH.
18. The first network device according to claim 17, characterized in that: The second message further includes the first SRH.
19. The first network device according to claim 11 or 12, characterized in that: The function part Function of the SRv6 SID instructs the first network device to perform a copy operation on the first message.
20. The first network device according to claim 11 or 12, characterized in that: The first network device stores path information of the forwarding path, The forwarding unit obtains the path information of the forwarding path corresponding to the second message from the path information of the forwarding path stored locally.
21. The first network device according to claim 20, characterized in that: The forwarding unit forwarding the one or more second messages through one or more forwarding paths includes: The forwarding unit forwards the one or more second messages by acquiring path information of a forwarding path corresponding to the second message.
Citation Information
Patent Citations
Message packaging method and method, device and network equipment for detecting forwarding loop
CN101764750A
Linear lossless network protective method of data network
CN103607288A
Communication method, optical module and network device
CN103840976A
Packet forwarding method and network device
CN104488235A
Message processing method and network device
CN105577536A
