A data packet transmission method, device and equipment
By creating messages from SRMS node receiving entries and establishing tag forwarding entries, the problem of interoperability between SR network and LDP network is solved, and efficient data packet transmission is achieved.
Patent Information
- Application Number
- CN202510213054.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-02-25
AI Technical Summary
In the existing technology, there is no effective way to solve the interoperability problem between SR networks and LDP networks, which makes data packet transmission difficult.
By creating a message in the SRMS node receiving table, obtaining the LDP label of the tail node, and selecting an unused SR label from the SRGB, a first label forwarding table entry is established to realize the forwarding of data packets from the SR network to the LDP network.
It enables interoperability between the SR network and the LDP network, reduces the workload of configuring and maintaining tag forwarding table entries, and improves transmission efficiency.
Smart Images

Figure CN119966887B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a method, apparatus and device for transmitting data messages. Background Technology
[0002] Segment Routing (SR) employs a source path selection mechanism, pre-encapsulating the SID (Segment Identifier) of the SR nodes the path will pass through in the header nodes. When a packet passes through an SR node, the SR node forwards the packet based on the packet's SID. Apart from the header nodes, other nodes do not need to maintain path state.
[0003] SR-MPLS (Segment Routing with Multi-Protocol Label Switching) refers to using SR (Segment Routing) in an MPLS network to forward packets using labels as SIDs. SR-MPLS utilizes the MPLS network for forwarding, extending and optimizing the IGP (Interior Gateway Protocol) and BGP (Border Gateway Protocol) protocols to distribute labels using these protocols.
[0004] When SR networks (also known as SR-MPLS networks) and LDP (Label Distribution Protocol) networks coexist, the interoperability between the SR and LDP networks needs to be addressed, i.e., the transmission of data packets from the SR network to the LDP network needs to be achieved. However, there is no effective method in relevant technologies for realizing this interoperability. Summary of the Invention
[0005] This application provides a method for transmitting data packets, applied to a network node, the method comprising:
[0006] Receive a first entry creation message, which includes the tunnel address of the tail node;
[0007] Obtain the Target Label Allocation Protocol (LDP) label corresponding to the tunnel address of the tail node;
[0008] Select unused target SR tags from the segmented routing global label segment SRGB;
[0009] establish a first label forwarding entry, an ingress label of the first label forwarding entry being the target SR label, and an egress label of the first label forwarding entry being the target LDP label; wherein the first label forwarding entry is used to make the network node forward a data packet of an SR network to an LDP network.
[0010] The first entry creation packet is sent by a tail node to a head node when the tail node establishes a tunnel between the tail node and the head node.
[0011] The application provides a data packet transmission device, applied to a network node, the device comprising:
[0012] A receiving module is configured to receive a first entry creation packet, the first entry creation packet comprising a tunnel address of a tail node.
[0013] A processing module is configured to obtain a target label distribution protocol (LDP) label corresponding to the tunnel address of the tail node, and select an unused target segment routing global label segment (SRGB) from the SRGB.
[0014] A establishing module is configured to establish a first label forwarding entry, an ingress label of the first label forwarding entry being the target SR label, and an egress label of the first label forwarding entry being the target LDP label; wherein the first label forwarding entry is used to make the network node forward a data packet of an SR network to an LDP network.
[0015] The first entry creation packet is sent by a tail node to a head node when the tail node establishes a tunnel between the tail node and the head node.
[0016] The application provides an electronic device, comprising a processor and a machine readable storage medium, the machine readable storage medium storing machine executable instructions capable of being executed by the processor; the processor is configured to execute the machine executable instructions to implement the data packet transmission method described above.
[0017] The application provides a computer program product, the computer program product comprising a computer program, the computer program being executed by a processor to implement the data packet transmission method described above.
[0018] The application provides a machine readable storage medium, the machine readable storage medium storing machine executable instructions capable of being executed by a processor; wherein the processor is configured to execute the machine executable instructions, and the machine executable instructions are executed to implement the data packet transmission method described above.
[0019] From the above technical solutions, in the embodiment of the present application, the SRMS node can automatically establish a label forwarding table item based on the table item creation message, and the label forwarding table item is used to make the SRMS node forward the data message of the SR network to the LDP network, so as to realize the intercommunication between the SR network and the LDP network based on the label forwarding table item. The SRMS node only needs to start the global automatic SRMS function, and the SRMS node can automatically generate the label forwarding table item on demand, which brings convenience to the configuration and maintenance of a large number of label forwarding table items. BRIEF DESCRIPTION OF DRAWINGS
[0020] Figure 1 is a flowchart of a data message transmission method in an embodiment of the present application;
[0021] Figure 2 is a schematic diagram of establishing a label forwarding table item according to a Prefix SID in an embodiment of the present application;
[0022] Figure 3A is a schematic diagram of forwarding a message in a Prefix mode in an embodiment of the present application;
[0023] Figure 3B is a schematic diagram of forwarding a message in a Prefix mode in an embodiment of the present application;
[0024] Figure 4 is a message forwarding process schematic diagram of SR to LDP in an embodiment of the present application;
[0025] Figure 5 is a network configuration schematic diagram of SR to LDP in an embodiment of the present application;
[0026] Figure 6 is a schematic diagram of an application scenario in an embodiment of the present application;
[0027] Figure 7A is a flowchart of a label forwarding table item establishment process in an embodiment of the present application;
[0028] Figure 7B is a network configuration schematic diagram of a label forwarding table item establishment process in an embodiment of the present application;
[0029] Figure 7C is a flowchart of a data message transmission method in an embodiment of the present application;
[0030] Figure 8 is a structural schematic diagram of a data message transmission device in an embodiment of the present application;
[0031] Figure 9is a hardware structure diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0032] A data packet transmission method is provided in the embodiments of the present application, which can be applied to a network node, which can be an SRMS node (Segment Routing Mapping Server), as shown in Figure 1 The method can include the following steps:
[0033] In step 101, a first table item creation packet is received, which includes a tunnel address of a tail end node. For example, the first table item creation packet is sent by the tail end node to a head end node when the tail end node establishes a tunnel between the tail end node and the head end node.
[0034] In step 102, a target LDP label corresponding to the tunnel address of the tail end node is obtained.
[0035] For example, the SRMS node can generate the target LDP label for the tunnel address of the tail end node when the SRMS node establishes an LDP neighbor with a node in the LDP network. Based on this, after obtaining the tunnel address of the tail end node from the first table item creation packet, the target LDP label corresponding to the tunnel address can be obtained.
[0036] For example, the destination address of the first table item creation packet can be a specified destination address. Based on this, in step 102, when it is learned that the destination address of the first table item creation packet is the specified destination address, the target LDP label corresponding to the tunnel address of the tail end node is obtained.
[0037] In step 103, an unused target SR label is selected from an SRGB (Segment Routing Global Block). For example, an unused SR label can be randomly selected from all SR labels of the SRGB, which is used as the target SR label.
[0038] In step 104, a first label forwarding table item is established, the entry label of the first label forwarding table item is the target SR label, and the exit label of the first label forwarding table item is the target LDP label; wherein the first label forwarding table item is used to make the SRMS node forward a data packet of the SR network to the LDP network.
[0039] In one example, after the unused target SR label is selected from the SRGB, a second table item creation packet can also be sent to the head end node, which includes the target SR label and the tunnel address of the tail end node, so that the head end node establishes a second label forwarding table item and a mapping relationship table item.
[0040] The mapping relationship table item can include a corresponding relationship between the tunnel address of the tail end node and the incoming label of the second label forwarding table item. The incoming label of the second label forwarding table item can be any SR label, and the outgoing label of the second label forwarding table item can be a target SR label. The second label forwarding table item is used to make the head end node forward the data packet of the SR network to the SRMS node.
[0041] In one example, after the first label forwarding table item is established, a first data packet sent by the head end node can also be received. The first data packet includes a target SR label. The first data packet is obtained by adding the target SR label to the second data packet after the head end node receives the second data packet and obtains the target SR label corresponding to the second data packet through the mapping relationship table item and the second label forwarding table item. For example, the target SR label is obtained by querying the mapping relationship table item through the destination IP address of the second data packet, querying the second label forwarding table item through the incoming label of the second label forwarding table item, and querying the second label forwarding table item. In this way, the first data packet can be obtained by adding the target SR label to the second data packet.
[0042] Then, the first label forwarding table item is queried through the target SR label. If the first label forwarding table item does not have an outgoing label of the SR type, it is determined whether the first label forwarding table item has an outgoing label of the LDP type. If the first label forwarding table item has a target LDP label of the LDP type, a target LDP label is added to the first data packet to obtain a third data packet. Then, the third data packet is sent to the node in the LDP network.
[0043] In one example, the table item creation packet can include, but is not limited to, an MPLS (Multi-Protocol Label Switching) echo request packet (MPLS ECHO REQUEST). The MPLS echo request packet is used to carry a FEC (Forwarding Equivalence Class) field, and the FEC field includes the tunnel address of the tail end node. The MPLS echo request packet is sent by the tail end node before the tunnel between the tail end node and the head end node is used to transmit data packets. The tunnel is established by the tail end node according to a route to the head end node when the route is received.
[0044] In one example, for each network node, if the network node establishes an LDP neighbor with a first node in the LDP network and the network node establishes an IGP neighbor with a second node in the IGP network that has SR capability and is different from the first node, it is determined that the network node is an SRMS node.
[0045] From the above technical solutions, in the embodiments of the present application, the SRMS node can automatically establish a label forwarding table item based on the table item creation message, and the label forwarding table item is used to make the SRMS node forward the data message of the SR network to the LDP network, so as to realize the intercommunication between the SR network and the LDP network based on the label forwarding table item. The SRMS node only needs to start the global automatic SRMS function, and the SRMS node can automatically generate the label forwarding table item on demand, which brings convenience to the configuration and maintenance of a large number of label forwarding table items.
[0046] The above technical solutions of the embodiments of the present application are described below in combination with specific application scenarios.
[0047] SR adopts a source path selection mechanism, and a SID of a path to be passed through by an SR node is encapsulated in a head-end node in advance. When a message passes through the SR node, the SR node can forward the message according to the SID of the message. SR-MPLS refers to using SR in an MPLS network, and using a label as a SID to forward a message. The SR-MPLS network can also be referred to as an SR network, and the content of the SR-MPLS network is described below.
[0048] According to the characteristics of the SR-MPLS network, the SR-MPLS network can directly apply the MPLS network for forwarding without the need to transform the network. In addition, the SR-MPLS network can directly use IGP protocols and BGP protocols for label distribution by extending and optimizing the IGP protocols and the BGP protocols. In addition, the SR-MPLS network can more simply realize MPLS TE (Traffic Engineering) functions and the like, and solve problems such as excessive deployment of routing protocols and complex deployment processes.
[0049] According to the basic concepts of the SR-MPLS network, an SR node: a device starting the SR-MPLS function is referred to as an SR node. An ingress node (i.e., an SR node) responsible for adding a label to a message entering the SR-MPLS network can be referred to as a source node or a head-end node. An egress node (i.e., an SR node) responsible for stripping a label from a message and forwarding the message to a destination network can be referred to as a tail node or a tail-end node. An SR node between the head-end node and the tail-end node can be referred to as an intermediate node.
[0050] Segment: used to indicate an operation performed by an SR node on an incoming message. SID: segment identifier. In the SR-MPLS network, the SID is an MPLS label, and in other networks, the SID can be an IP address or the like.
[0051] Segment Type: According to different SID allocation forms, the segment type of SR has the following two types: Prefix Segment: prefix type segment, based on the IP address prefix, the SR node of the SR-MPLS network is allocated with a SID and a forwarding table item is established. Adjacency Segment: adjacency type segment, the SR node of the SR-MPLS network is allocated with a SID for different adjacency links.
[0052] SRLSP (Segment Routing Label Switched Path): The packet is routed and forwarded by using a label as a SID, and the path passed by the packet is called SRLSP. For example, the LSP (Label Switched Path) here can refer to a label switching path.
[0053] SRGB (Segment Routing Global Block): SRGB is used for the global label range of the prefix type SID (Prefix SID) of the SR-MPLS network, the SRGB range of each SR node can be different, the label range of SRGB is determined by a label segment base value and a Range, the label segment base value represents the minimum value of the SRGB label segment, and the Range represents the number of labels.
[0054] SRLB (Segment Routing Local Block): SRLB is used for the local label range of the adjacency type SID (Adjacency SID) of the SR-MPLS network, the SRLB range of each SR node is the same, the label range of SRLB is determined by a label segment base value and a Range, the label segment base value can represent the minimum value of the SRLB label segment, and the Range can represent the number of labels.
[0055] SR-MPLS BE (MPLS Segment Routing Best Effort): SR-MPLS BE refers to an optimal SRLSP calculated by the IGP using a shortest path algorithm, and the data forwarding process is guided by a SID. The creation process and data forwarding of the SRLSP are similar to those of the LDP LSP, and the SR-MPLS BE does not need to establish a tunnel interface.
[0056] SR-MPLS TE (MPLS Segment Routing Traffic Engineering): SR-MPLS TE is a TE tunnel technology using SR as a control protocol. SR-MPLS TE is the same as SR-MPLS BE in that both need to establish an SRLSP. SR-MPLS TE is different from SR-MPLS BE in that the establishment manners of the two are different. For example, the tunnel of SR-MPLS TE can be configured manually or created by an explicit path, or calculated by a controller and then the label stack is sent to the SR node to create. On the ingress node of the SR-MPLS TE tunnel, a Tunnel interface can be created, and the SR node encapsulates the label stack for the packet, thereby controlling the transmission path of the packet in the SR-MPLS network.
[0057] For the tunnel establishment mechanism of the SR-MPLS network, if the packet needs to be forwarded by the SRLSP, the following work needs to be completed: label allocation is performed, and label information is planned for each SR node and link in the packet forwarding path. Static configuration SID or dynamic allocation SID can be used. Label forwarding table entries are established. For the SR nodes in the segment routing domain composed of the SR nodes running SR-MPLS, the local label forwarding table entries can be formed according to the allocated label information. SRLSP is established. The SRLSP can be manually configured, or dynamically established by IGP / BGP protocol or sent by a controller.
[0058] After the above steps are completed, the SRLSP can be used to forward traffic. For example, when the source node (head-end node) receives the packet of the user network, the label information on the path is encapsulated for the packet, and the packet is forwarded to the tail-end node by the SRLSP. The tail-end node receives the packet from the SRLSP, strips the label in the packet, and finds the routing table according to the destination IP address of the original packet to forward the packet.
[0059] If the SRLSP is associated with an upper-layer application, such as MPLS TE, the SRLSP can be used to forward MPLS TE traffic, and the traffic forwarding process is not limited.
[0060] For the SID allocation process of the SR-MPLS network, the SIDs can be dynamically allocated through the IGP protocol. The following describes the process of dynamically allocating the SIDs. After the IGP protocol (such as IS-IS (Intermediate system to intermediate system), OSPF (Open Shortest Path First), etc.) is extended, the SIDs can be announced in the IGP protocol packet. The dynamic allocation and announcement of the SIDs are in the form of Prefix SID and Adjacency SID.
[0061] For example, for the implementation of the Prefix SID, each SR node manually specifies a SID for the Loopback address (back address) of the SR node, and the SID is used to identify the specific SR node. In the segment routing domain composed of the SR nodes running the SR-MPLS, the Prefix SID of the SR node is announced through the IGP, and other SR nodes automatically calculate the Prefix SID of the SR node according to the received packet. When the Prefix SID of the SR node is announced, the absolute value or the index value can be announced. When the absolute value is announced, the Prefix SID and the local SRGB label segment are directly announced. In addition, when the index value is announced, a globally unique index is allocated for each SR node, that is, the prefix of each SR node corresponds to the index one by one. The SRGB label segment and the index in the segment of each SR node are announced through the IGP extension, and the SRGB base value of the SR node + the index of the prefix is the Prefix SID allocated for the prefix by the SR node.
[0062] For example, for the implementation of the Adjacency SID, the SIDs allocated for the adjacent links between the SR nodes are announced through the IGP protocol, and the SIDs are used to identify the specific adjacent link of the local node. When the SIDs are allocated, the Adjacency SIDs are allocated in the form of automatic allocation of Adjacency SIDs and manual specification of Adjacency SIDs. When the Adjacency SIDs are automatically allocated, the labels are automatically selected from the SRLB and allocated to the adjacent link. When the Adjacency SIDs are manually specified, the absolute value can be directly specified. Alternatively, the index value can be allocated for the adjacent link, and the SRLB base value of the SR node + the index of the prefix is the Adjacency SID allocated for the adjacent link by the SR node.
[0063] The label forwarding table entry establishment process for SR-MPLS networks can be based on the SID. The following explains the process of establishing label forwarding table entries based on SIDs. For example, label forwarding table entries can be established based on the Prefix SID. Label forwarding table entries established using Prefix SIDs can be divided into static label forwarding table entries and dynamic label forwarding table entries. For static label forwarding table entries, SR nodes form local label forwarding table entries based on the manually specified correspondence between the incoming label, outgoing label, and next hop. For dynamic label forwarding table entries, SR nodes flood the local sRGB and the index value of the Prefix SID assigned to the local Loopback interface address within the segmented routing domain using the IGP protocol. Other SR nodes within the segmented routing domain calculate their local label forwarding table entries based on the received information, with the incoming label being the local sRGB label segment base value + Index, and the outgoing label being the next hop's sRGB base value + Index.
[0064] For example, see Figure 2 The diagram illustrates the creation of a tag forwarding table entry based on the Prefix SID, using dynamically assigned Prefix SIDs as an example. The network administrator assigns the index value 201 to the Loopback address 1.1.1.1 / 32 on Device C. Device C then advertises this index value 201 and its local sRGB information via an IGP protocol message. For a node running IGPSR, the resulting tag forwarding table entry is as follows:
[0065] The ingress label in Device C's label forwarding table entry is 16201. Upon receiving this notification (i.e., the index value 201 and sRGB of the Device C notification), Device B creates an SRLSP label forwarding table entry with ingress and egress labels of 16201, and the next hop is Device C (i.e., pointing to the egress interface of Device C). Upon receiving this notification, Device A creates an SRLSP label forwarding table entry with ingress and egress labels of 16201, and the next hop is Device B.
[0066] For the SRLSP establishment process of the SR-MPLS network, the SRLSP can be established, and the SRLSP establishment manner includes static configuration SRLSP and dynamic establishment SRLSP. When the SRLSP is statically configured, according to the forwarding path requirement, a label stack carried by a message during forwarding is specified on a tunnel head node, each label in the label stack corresponds to a Prefix SID or an Adjacency SID, and according to the Prefix SID or the Adjacency SID, the out-label, the next hop and the like of the message can be found. When the SRLSP is dynamically established according to the IGP / BGP protocol, the SR node collects the prefix SID information in the SR-MPLS network through the IGP / BGP protocol, and according to the prefix SID information and the IGP / BGP network topology information, the shortest path to each SR node in the SR-MPLS network is calculated, and the SRLSP is established on the path. In addition, in addition to the static configuration SRLSP and the dynamic establishment SRLSP, the SRLSP can also be created by each SR node based on the configuration issued by the controller.
[0067] For the message forwarding process of the SR-MPLS network, according to different SID allocation manners, the message forwarding process of the SR-MPLS network can be divided into the following several manners: the Prefix manner, the Prefix SID allocated for a tail end node is encapsulated into a message at a head end node, and each intermediate node forwards the message by searching a label forwarding table item. The Adjacency manner, a label stack composed of the Adjacency SID allocated for an adjacent link is encapsulated into a message at a head end node, each intermediate node forwards the message according to the outermost label of the label stack to search for a next hop neighbor, and each intermediate node also needs to delete the outermost label of the label stack when forwarding the message. The Prefix / Adjacency manner, the Prefix and the Adjacency are combined to forward the message.
[0068] Referring to Figure 3A Fig. 1 shows a schematic diagram of the message forwarding process in the Prefix manner, for example, the message is forwarded in the same AS in the Prefix manner. When Device A forwards the message to Device E through the SRLSP, the out-label of the message needs to be specified as 16201, and the message forwarding process in the Prefix manner is as follows:
[0069] Device A (head node) looks up the label forwarding table item according to the incoming label 16201, judges that the next hop corresponding to the incoming label 16201 is Device B (i.e. the outgoing interface pointing to Device B), and the outgoing label is 16201 (the outgoing label can be the same as or different from the incoming label). Based on the outgoing label 16201, Device A encapsulates the label 16201 for the message and sends the modified message to the intermediate node Device B.
[0070] Device B (intermediate node) looks up the label forwarding table item according to the incoming label 16201, judges that the next hop corresponding to the incoming label 16201 is Device C (i.e. the outgoing interface pointing to Device C), and the outgoing label is 16201. Based on the outgoing label 16201, Device B replaces the incoming label 16201 of the message with the outgoing label 16201 in the label forwarding table item and sends the modified message to the intermediate node Device C.
[0071] Device C looks up the label forwarding table item according to the incoming label 16201, judges that the next hop corresponding to the incoming label 16201 is Device D, and the outgoing label is 16201. Based on the outgoing label 16201, Device C replaces the incoming label 16201 of the message with the outgoing label 16201 in the label forwarding table item and sends the modified message to Device D.
[0072] Device D looks up the label forwarding table item according to the incoming label 16201, judges that the next hop corresponding to the incoming label 16201 is Device E, and the outgoing label is 16201. Based on the outgoing label 16201, Device D replaces the incoming label 16201 of the message with the outgoing label 16201 in the label forwarding table item and sends the modified message to Device E.
[0073] After the message reaches the tail node Device E, Device E removes the label 16201 in the message, and the label forwarding process is completed. Device E continues to forward the message according to the destination IP address of the message.
[0074] Referring to Figure 3B is a schematic diagram of forwarding a message in a Prefix manner, for example, forwarding a message across AS (Autonomous System) in a Prefix manner. When Device A forwards a message to Device D through an SRLSP, the outgoing label 16201 needs to be specified for the message, and the message forwarding process is as follows:
[0075] Device A (head node) looks up the label forwarding table item according to the incoming label 16201, judges that the next hop corresponding to the incoming label 16201 is Device B (i.e. the outgoing interface pointing to Device B), and the outgoing label is 16201 (the outgoing label may be the same as or different from the incoming label). Based on the outgoing label 16201, Device A encapsulates the label 16201 for the message, and sends the modified message to the intermediate node Device B.
[0076] Device B looks up the label forwarding table item according to the incoming label 16201, judges that the next hop corresponding to the incoming label 16201 is Device C, and the outgoing label is 16201. Based on the outgoing label 16201, Device B replaces the incoming label 16201 of the message with the outgoing label 16201 in the label forwarding table item, and sends the modified message to the intermediate node Device C. Device B and Device C are located in different ASs, and implement cross-AS message forwarding.
[0077] Device C looks up the label forwarding table item according to the incoming label 16201, judges that the next hop corresponding to the incoming label 16201 is Device D, and the outgoing label is 16201. Based on the outgoing label 16201, Device C replaces the incoming label 16201 of the message with the outgoing label 16201 in the label forwarding table item, and sends the modified message to Device D.
[0078] After the message reaches the tail node Device D, Device D deletes the label 16201 in the message, and the label forwarding process is completed. Device D continues to forward the message according to the destination IP address of the message.
[0079] In one example, SR-MPLS network (SR network for short) and LDP network can also coexist. When the SR network and the LDP network coexist, the interworking between the SR network and the LDP network needs to be solved, for example, the data message of the SR network needs to be transmitted to the LDP network. However, how to realize the interworking between the SR network and the LDP network does not have an effective implementation manner in the related art.
[0080] For example, when the SR network (using the IGP protocol to advertise the SID) and the LDP network coexist, the interworking between the SR network and the LDP network needs to be solved. The interworking between the SR network and the LDP network is a technology for making the SR protocol and the LDP protocol work together in the same network, and through the technology, the SR network can be connected to the LDP network, and the MPLS forwarding between the SR network and the LDP network can be realized.
[0081] The SR network interworking with the LDP network includes the following networking modes: SR to LDP, which realizes the forwarding of data packets from the SR network to the LDP network by mapping the prefix address of the LDP network to the SID of the SR network; LDP to SR, which realizes the forwarding of data packets from the LDP network to the SR network by associating the SID of the SR network and the label of the LDP network through the IGP protocol; and SR over LDP, which realizes the interaction of data packets of the SR network across the LDP network. In this embodiment, the SR network interworking with the LDP network is the networking mode of SR to LDP, that is, the data packets need to be forwarded from the SR network to the LDP network.
[0082] In the networking mode of SR to LDP, the SRMS (Segment Routing Mapping Server) and the SRMC (Segment Routing Mapping Client) are defined. The SRMS is located in the SR network, and is configured to publish the SID instead of the LDP device that does not support SR-MPLS, to configure the mapping relationship between the prefix address and the SID on the SRMS, and to publish the mapping relationship to the SRMC. The SRMC is located in the SR network, and is configured to receive the mapping relationship between the prefix address and the SID published by the SRMS, and to create the SR-MPLS label forwarding table based on the mapping relationship between the prefix address and the SID.
[0083] Referring to FIG. 1, Figure 4 the message forwarding process in the networking mode of SR to LDP is shown. The Device B, the Device C and the Device D run the LDP protocol, the Device D distributes the label for the destination address 3.3.3.3 / 32, and the LDP label forwarding table entries are formed on the Device B and the Device C (in the table, the entry with the Type as LDP is the LDP label forwarding table entry, and in addition to the In Label and the Out Label, the LDP label forwarding table entry can also include the out interface and the like, which is not limited). Figure 4
[0084] The Device A and the Device B run the SR protocol (SR-MPLS protocol), and the SR label forwarding table entries are formed on the Device A and the Device B (in the table, the entry with the Type as SR is the SR label forwarding table entry, and in addition to the In Label and the Out Label, the SR label forwarding table entry can also include the out interface and the like). Figure 4
[0085] In the above application scenario, the SRLSP and LDP LSP mapping relationship establishment process is as follows: based on the LDP protocol, LDP label forwarding table entries are formed on Device B and Device C, as shown in Figure 4
[0086] Device B, as an SRMS node, needs to allocate a SID (i.e., a label of the SR network) for the Loopback address 3.3.3.3 / 32 on Device D, such as label 16201. When allocating the label 16201 for the Loopback address 3.3.3.3 / 32, the user statically configures the label 16201 for the Loopback address 3.3.3.3 / 32. Then, Device B can generate an SR label forwarding table entry, the in-label of the SR label forwarding table entry is 16201, the out-label of the SR label forwarding table entry is empty, and the SR label forwarding table entry does not have information such as an out-interface. In addition, when Device B generates an LDP label forwarding table entry, the LDP label forwarding table entry can also include the address 3.3.3.3 / 32, i.e., the address 3.3.3.3 / 32 corresponds to the out-label 20, which is not shown in Figure 4 .
[0087] Device B sends the notification information to Device A, the notification information includes the mapping relationship between the address 3.3.3.3 / 32 and the label 16201, Device A establishes an SR label forwarding table entry, the out-label of the SR label forwarding table entry is 16201, and the in-label of the SR label forwarding table entry is label X (label X can be the same as or different from the out-label 16201, and in Figure 4 , label X is taken as 16201 as an example). In addition to the in-label and the out-label, the SR label forwarding table entry can also include information such as an out-interface, which is an out-interface pointing to Device B.
[0088] After Device A generates the SR label forwarding table entry, it can also create a mapping relationship table entry between the address 3.3.3.3 / 32 and the in-label (i.e., label X) of the SR label forwarding table entry.
[0089] When Device A forwards a packet to Device D through the SRLSP, the packet forwarding process is as follows:
[0090] When Device A (the head-end node) receives the packet, if the destination IP address of the packet is 3.3.3.3 / 32, it can query the mapping relationship table entry through the destination IP address 3.3.3.3 / 32 to obtain the label X corresponding to the destination IP address 3.3.3.3 / 32, and encapsulate the label X for the packet, such as encapsulating the label 16201 for the packet.
[0091] Device A looks up the SR tag forwarding table entry based on the incoming tag 16201, determines that the next hop corresponding to the incoming tag 16201 is Device B (i.e., the outgoing interface pointing to Device B), and the outgoing tag is 16201. Device A encapsulates the message with tag 16201 and sends the modified message to the intermediate node Device B.
[0092] Device B searches the SR label forwarding table entry based on the incoming label 16201. Since there is no corresponding outgoing label for the incoming label 16201, Device B searches the LDP label forwarding table entry using the destination IP address of the packet, 3.3.3.3 / 32. Because the LDP label forwarding table entry includes the correspondence between address 3.3.3.3 / 32 and outgoing label 20, the outgoing label 20 can be found from the LDP label forwarding table entry.
[0093] Based on the outgoing label 20, Device B can replace the incoming label 16201 of a message with the outgoing label 20 and send the modified message to the intermediate node Device C. Clearly, since the incoming label 16201 is the label of the SR network and the outgoing label 20 is the label of the LDP network, Device B can convert the label of the SR network to the label of the LDP network, thus achieving interoperability between the SR network and the LDP network.
[0094] Device C looks up the LDP tag forwarding table entry based on the incoming tag 20, determining that the next hop corresponding to the incoming tag 20 is Device D, and the outgoing tag is 21 (in...). Figure 4 (Not shown in the image). Based on the outgoing tag 21, Device C replaces the incoming tag 20 of the message with the outgoing tag 21 and sends the modified message to Device D.
[0095] After the message reaches the tail node Device D, Device D removes label 21 from the message, thus completing the label forwarding process. Device D can then continue forwarding messages according to the destination IP address of the message.
[0096] In the SR to LDP networking mode, users need to statically configure labels for addresses on the SRMS node, which is a lot of work for users, has high manual maintenance costs, is prone to configuration errors, and has a long service interruption time.
[0097] For example, see Figure 5 The diagram shown is a network topology diagram of SR to LDP. Node 2 is an SRMS node, node 1 is a head node, and nodes 4, 5, 6, ..., N are all tail nodes.
[0098] The user statically configures a label 16201 for the Loopback address 4.4.4.4 / 32 of the node 4 at the SRMS node, and the SRMS node can generate an SR label forwarding table item, the entry label of the SR label forwarding table item being 16201, and the exit label of the SR label forwarding table item being empty. The user statically configures a label 16202 for the Loopback address 5.5.5.5 / 32 of the node 5 at the SRMS node, and the SRMS node can generate an SR label forwarding table item, the entry label of the SR label forwarding table item being 16202, and the exit label of the SR label forwarding table item being empty. The user statically configures a label 16203 for the Loopback address 6.6.6.6 / 32 of the node 6 at the SRMS node, and the SRMS node can generate an SR label forwarding table item, the entry label of the SR label forwarding table item being 16203, and the exit label of the SR label forwarding table item being empty. In this way, when a large number of tail-end nodes exist, the user needs to configure a label for the Loopback address of each tail-end node, which is laborious and costly for manual maintenance and is prone to configuration errors.
[0099] In addition, when the Loopback address of a certain tail-end node changes, for example, the Loopback address of the node 6 changes from 6.6.6.6 / 32 to 6.6.6.7 / 32, the user needs to reconfigure a label 16211 for the Loopback address 6.6.6.7 of the node 6 at the SRMS node, and the service of the node 6 is interrupted during the manual reconfiguration. Since the manual configuration takes a long time, the service is interrupted for a long time, and the user experience is poor.
[0100] In view of the above finding, an on-demand automatic mapping method is proposed in the embodiments of the present application, and the SRMS node can automatically generate a label forwarding table item on demand, which brings convenience to the configuration and maintenance of a large number of label forwarding table items.
[0101] Referring to FIG. 1, Figure 6 As shown in FIG. 1, in the SR to LDP networking mode, the network node 1 is a head-end node (also referred to as a source node), the network node 2 and the network node 3 are intermediate nodes, and the network node 4, the network node 5, the network node 6, …, and the network node N are tail-end nodes. For each node, the node can be a router, a switch, or the like.
[0102] In the network shown in FIG. 1, Figure 6 The network node 1 runs an SR protocol (SR-MPLS protocol), and the network node 1 needs to create a label forwarding table item, which is an SR label forwarding table item. The network node 3, the network node 4, the network node 5, the network node 6, …, and the network node N run an LDP protocol, and these network nodes need to create a label forwarding table item, which is an LDP label forwarding table item.
[0103] The network node 2 runs both the SR protocol and the LDP protocol, and the network node 2 needs to create a label forwarding table entry, and the label forwarding table entry is a combined label forwarding table entry, i.e., the combined label forwarding table entry includes an SR label and an LDP label, such as an incoming label is an SR label and an outgoing label is an LDP label.
[0104] In one example, for each network node, if the network node acts as an intermediate node, the network node needs to determine whether the network node is an SRMS node. If the network node is an SRMS node, when the network node creates a label forwarding table entry, the label forwarding table entry can be a combined label forwarding table entry. If the network node is not an SRMS node, when the network node creates a label forwarding table entry, the label forwarding table entry can be an SR label forwarding table entry or an LDP label forwarding table entry.
[0105] As to how to know whether the network node is an SRMS node, the following method can be used: if the network node establishes an LDP neighbor with a first node in an LDP network and the network node establishes an IGP neighbor with a second node in an IGP network which has SR capability and is different from the first node, then the network node is an SRMS node.
[0106] For example, if the network node establishes an LDP neighbor with a first node in an LDP network, and the network node establishes an IGP neighbor with a second node in an IGP network, and the second node supports SR capability, and the first node and the second node belong to different nodes, then it is determined that the network node is an SRMS node. Or,
[0107] If at least one of the above conditions is not established, it is determined that the network node is not an SRMS node. For example, if the network node does not establish an LDP neighbor with a node in an LDP network, it is determined that the network node is not an SRMS node. Or, if the network node does not establish an IGP neighbor with a node in an IGP network, it is determined that the network node is not an SRMS node. Or, although the network node establishes an IGP neighbor with a second node in an IGP network, the second node does not support SR capability, it is determined that the network node is not an SRMS node.
[0108] Referring to Figure 6 As shown, for the network node 2, the network node 2 has a neighbor relationship with the network node 1, and the network node 2 has a neighbor relationship with the network node 3, therefore, a neighbor relationship will be established between the network node 2 and the network node 1, and a neighbor relationship will be established between the network node 2 and the network node 3.
[0109] When the network node 2 establishes a neighbor relationship with the network node 1, the network node 2 and the network node 1 both support the SR protocol, and the SR protocol runs on the IGP protocol, an IGP neighbor is established between the network node 2 and the network node 1, and the IGP neighbor establishment process is not limited. Based on this, the network node 1 is a node in the IGP network (SR network), that is, the network node 2 establishes an IGP neighbor with the second node in the IGP network.
[0110] After the network node 2 establishes the IGP neighbor with the network node 1, the network node 1 can send routing information to the network node 2, and the routing information can include an SR capability indication field. If the SR capability indication field is a first value, it indicates that the network node 1 supports SR capability, that is, the network node 1 supports forwarding a packet by using a SID. If the SR capability indication field is a second value, it indicates that the network node 1 does not support SR capability, that is, the network node 1 does not support forwarding a packet by using a SID. Based on this, the network node 2 can obtain the SR capability information of the network node 1, that is, determine whether the second node supports SR capability.
[0111] When the network node 2 establishes a neighbor relationship with the network node 3, since the network node 2 and the network node 3 both support the LDP protocol, an LDP neighbor can be established between the network node 2 and the network node 3, and the LDP neighbor establishment process is not limited. Based on this, the network node 3 can be a node in the LDP network, that is, the network node 2 establishes an LDP neighbor with the first node in the LDP network.
[0112] When the network node 2 establishes the IGP neighbor with the network node 1, the network node 2 can obtain the unique identifier (denoted as unique identifier X) of the network node 1, and when the network node 2 establishes the LDP neighbor with the network node 3, the network node 2 can obtain the unique identifier (denoted as unique identifier Y) of the network node 3.
[0113] Obviously, if the unique identifier X and the unique identifier Y are the same, it indicates that the network node 2 establishes an IGP neighbor and an LDP neighbor with the same network node at the same time, and thus the first node and the second node belong to the same node. If the unique identifier X and the unique identifier Y are different, it indicates that the network node 2 establishes an IGP neighbor and an LDP neighbor with different network nodes, and thus the first node and the second node belong to different nodes.
[0114] For example, when the network node 2 establishes an IGP neighbor with the network node 1, the IGP neighbor establishment packet carries a router id, which is used as the unique identifier X. When the network node 2 establishes an LDP neighbor with the network node 3, the LDP neighbor establishment packet carries an lsr id (label switch router id), which is used as the unique identifier Y. For the same network node, the router id and the lsr id of the network node are the same.
[0115] Based on this, if the router id of the IGP neighbor and the lsr id of the LDP neighbor are the same, it can be indicated that the network node 2 establishes the IGP neighbor and the LDP neighbor with the same network node at the same time, and if the router id and the lsr id are different, it can be indicated that the network node 2 establishes the IGP neighbor and the LDP neighbor with different network nodes.
[0116] In summary, for the network node 2, the network node 2 establishes an LDP neighbor with a first node in the LDP network, the network node 2 establishes an IGP neighbor with a second node in the IGP network, the second node supports SR capability, and the first node and the second node belong to different nodes, that is, the network node 2 is an SRMS node.
[0117] Referring to Figure 6 For the network node 3, the network node 3 has a neighbor relationship with the network node 2, and the network node 3 has a neighbor relationship with the network node 4, so that the network node 3 establishes a neighbor relationship with the network node 2, and the network node 3 establishes a neighbor relationship with the network node 4.
[0118] When the network node 3 establishes a neighbor relationship with the network node 2, since the network node 3 and the network node 2 both support the LDP protocol, the network node 3 establishes an LDP neighbor with the network node 2.
[0119] When the network node 3 establishes a neighbor relationship with the network node 4, since the network node 3 and the network node 4 both support the LDP protocol, the network node 3 establishes an LDP neighbor with the network node 4.
[0120] In summary, for the network node 3, the network node 3 establishes an LDP neighbor with a first node in the LDP network, and does not establish an IGP neighbor with a second node in the IGP network, and the network node 3 is not an SRMS node.
[0121] For each network node, after learning whether the network node is an SRMS node, a flag bit can be recorded, which indicates whether the network node is an SRMS node.
[0122] On this basis, for each network node, whether the network node is an SRMS node can be known by querying the marking bit of the network node, so that each network node only needs to perform the confirmation process once, without repeatedly determining whether the network node is an SRMS node.
[0123] In the above application scenario, for the establishment process of the label forwarding table item, referring to Figure 7A , a flowchart of the label forwarding table item establishment process is shown, and the label forwarding table item establishment process can include:
[0124] Step 701: The tail-end node sends a first table item creation message to the head-end node when establishing a tunnel between the tail-end node and the head-end node, such as that the tail-end node sends the first table item creation message to the head-end node through the tunnel.
[0125] In one example, when establishing a tunnel (such as an LSP tunnel or other type of tunnel) between the tail-end node and the head-end node, if the tail-end node triggers automatic SRMS mapping, the tail-end node sends a first table item creation message to the head-end node, and creates a label forwarding table item on the SRMS node through the first table item creation message, and the label forwarding table item is used to make the SRMS node forward the data packet of the SR network to the LDP network. If the tail-end node does not trigger automatic SRMS mapping, the tail-end node does not send a first table item creation message to the head-end node.
[0126] In one example, the tail-end node can provide an automatic mode option to control under what circumstances to trigger automatic SRMS mapping through the automatic mode option. For example, the user selects "all 32-bit host routes trigger automatic SRMS mapping" through the automatic mode option, or the user selects "all tunnels trigger automatic SRMS mapping" through the automatic mode option, or the user selects "tunnels used by service iteration trigger automatic SRMS mapping" through the automatic mode option. Of course, the above are only a few examples, which are not limited.
[0127] In one example, if the user selects "all 32-bit host routes trigger automatic SRMS mapping" through the automatic mode option, when establishing a tunnel (such as an LSP tunnel) between the tail-end node and the head-end node, if the tail-end node has a 32-bit host route, the tail-end node triggers automatic SRMS mapping, and the tail-end node sends a first table item creation message to the head-end node. If the tail-end node does not have a 32-bit host route, the tail-end node does not trigger automatic SRMS mapping, and the tail-end node does not send a first table item creation message to the head-end node.
[0128] Referring to Figure 6As shown, when network node 4 establishes a tunnel between network node 4 and network node 1, network node 4 triggers automatic SRMS mapping and sends a first table item creation message to network node 1, because network node 4 has a 32-bit host route 4.4.4.4. Network node 5 triggers automatic SRMS mapping and sends a first table item creation message to network node 1, because network node 5 has a 32-bit host route 5.5.5.5, when network node 5 establishes a tunnel between network node 5 and network node 1, and so on.
[0129] In one example, if a user selects "all tunnels trigger automatic SRMS mapping" through the automatic mode option, when a tail-end node establishes a tunnel (e.g., an LSP tunnel) between the tail-end node and a head-end node, the tail-end node triggers automatic SRMS mapping (i.e., tunnel establishment trigger) and sends a first table item creation message to the head-end node.
[0130] Referring to Figure 6 As shown, when network node 4 establishes a tunnel between network node 4 and network node 1, network node 4 triggers automatic SRMS mapping and sends a first table item creation message to network node 1, because network node 4 has a 32-bit host route 4.4.4.4. Network node 5 triggers automatic SRMS mapping and sends a first table item creation message to network node 1, because network node 5 has a 32-bit host route 5.5.5.5, when network node 5 establishes a tunnel between network node 5 and network node 1, and so on.
[0131] In one example, if a user selects "tunnels used by traffic trigger automatic SRMS mapping" through the automatic mode option, when a tail-end node establishes a tunnel (e.g., an LSP tunnel) between the tail-end node and a head-end node, the tail-end node determines whether there is traffic for the tunnel, which is used to trigger the tail-end node to transmit data packets to the head-end node through the tunnel. If there is traffic for the tunnel, the tail-end node triggers automatic SRMS mapping and sends a first table item creation message to the head-end node. If there is no traffic for the tunnel, the tail-end node does not trigger automatic SRMS mapping and does not send a first table item creation message. For example, there is traffic for the tunnel means that the tunnel is used to transmit data packets when the tail-end node establishes the tunnel between the tail-end node and the head-end node, and therefore the tail-end node can send a first table item creation message to the head-end node before the tail-end node transmits data packets through the tunnel.
[0132] Referring to Figure 6As shown, the network node 4 triggers the automatic SRMS mapping when there is traffic for the tunnel on the network node 4 (i.e. the tunnel is used to transmit data packets), and sends the first table item creation packet to the network node 1 when establishing the tunnel between the network node 4 and the network node 1. The network node 5 does not trigger the automatic SRMS mapping when there is no traffic for the tunnel on the network node 5, and does not send the first table item creation packet when establishing the tunnel between the network node 5 and the network node 1. The network node 6 triggers the automatic SRMS mapping when there is traffic for the tunnel on the network node 6, and sends the first table item creation packet to the network node 1 when establishing the tunnel between the network node 6 and the network node 1. The same applies to the network node 7.
[0133] The automatic SRMS mapping is triggered when there is traffic for the tunnel, and is not triggered when there is no traffic for the tunnel, so that the automatic SRMS mapping is triggered on demand. See Figure 6 As shown, the SRMS node (the network node 2) is connected with the tail end node in the LDP domain, and is connected with the head end node in the SR domain, and the LDP domain and the SR domain are built for carrying VPN traffic, so the traffic for the tunnel can be VPN traffic, for example, the traffic for the tunnel can include but is not limited to L2VPN traffic, L3VPN traffic and EVPN traffic, and the type of the traffic is not limited.
[0134] The tail end node establishes the tunnel between the tail end node and the head end node when the tail end node receives a route to the head end node, and establishes the tunnel according to the route. For example, the network node 4 receives a route to the network node 1, parses the address 1.1.1.1 of the network node 1 from the route, and then establishes the tunnel between the tail end node and the head end node, in which the local address of the tunnel is the address 4.4.4.4 of the network node 4, and the peer address of the tunnel is the address 1.1.1.1 of the network node 1. How to establish the tunnel between the tail end node and the head end node based on the route is not limited in the embodiment.
[0135] The tail end node sends the first table item creation packet to the head end node, and uses the next hop of the tunnel (LSP tunnel) based on the optimal route forwarding (the optimal route is used for packet forwarding, and the tunnel is also forwarded based on the optimal route), so the SRMS node is on a node of the next hop of the optimal route, and thus the first table item creation packet can be transmitted to the SRMS node, so as to trigger the SRMS node to establish the label forwarding table item.
[0136] In summary, although neither the tail-end node nor the head-end node is aware of whether there is an SRMS node on the forwarding path, when the tail-end node and the head-end node establish a tunnel (the opposite end address of the tunnel is the address 1.1.1.1 of the head-end node), since there is a need for the service to iterate the tunnel (i.e. there is a data packet that needs to be sent to the address 1.1.1.1, so that the tunnel is iterated by the service), therefore, when the tunnel is formed, the tail-end node triggers automatic SRMS mapping, and the tail-end node sends a first table item creation packet to the head-end node.
[0137] In one example, when the tail-end node sends the first table item creation packet to the head-end node, the destination address of the first table item creation packet can be a specified destination address, such as 127.255.255.255 (for example, in the case of an IPv4 address, the case of an IPv64 address is similar). By setting the destination address to the specified destination address, it indicates that the first table item creation packet is used to trigger the SRMS node to establish a label forwarding table item.
[0138] When the tail-end node sends the first table item creation packet to the head-end node, the first table item creation packet further includes the tunnel address of the tail-end node, i.e. the address of the tail-end node used to create the tunnel. For example, the first table item creation packet can include an FEC field, which is used to carry the tunnel address of the tail-end node. Of course, other fields of the first table item creation packet can also be used to carry the tunnel address of the tail-end node, as long as the tunnel address is carried. For example, when network node 4 sends the first table item creation packet to the head-end node, the first table item creation packet can include the tunnel address 4.4.4.4 of network node 4. When network node 6 sends the first table item creation packet to the head-end node, the first table item creation packet can include the tunnel address 6.6.6.6 of network node 6.
[0139] In one example, when the tail-end node sends the first table item creation packet to the head-end node, the first table item creation packet can include, but is not limited to, an MPLS echo request packet (MPLS ECHO REQUEST), i.e. the label forwarding table item creation is implemented by multiplexing the MPLS echo request packet, the MPLS echo request packet is used to detect the availability of the LSP, is sent in the format of a UDP packet, the UDP port number is 3503, the MPLS echo request packet carries the FEC information that needs to be detected, is sent along the LSP, and the detection of the LSP is implemented. Of course, other types of packets can also be used as the first table item creation packet, and the type of the first table item creation packet is not limited.
[0140] Step 702, the SRMS node receives the first table item creation packet.
[0141] For example, when the tail node (e.g., network node 4) sends a first table item creation message to the head node (e.g., network node 1), network node 3, after receiving the first table item creation message, continues to send the first table item creation message to the head node since network node 3 is not an SRMS node. Network node 2, after receiving the first table item creation message, executes a subsequent label forwarding table item creation process since network node 2 is an SRMS node, i.e., the SRMS node receives the first table item creation message.
[0142] In step 703, if the destination address of the first table item creation message is a specified destination address, the SRMS node can obtain the tunnel address of the tail node from the first table item creation message.
[0143] In one example, after receiving the first table item creation message, if the destination address of the first table item creation message is not a specified destination address (e.g., 127.255.255.255), the SRMS node forwards or discards the first table item creation message, and no limitation is imposed on the process. If the destination address of the first table item creation message is a specified destination address, the SRMS node triggers an SRMS mapping process, parses the first table item creation message, and obtains the tunnel address of the tail node from the first table item creation message.
[0144] In step 704, the SRMS node obtains a target LDP label corresponding to the tunnel address of the tail node.
[0145] In one example, when the SRMS node establishes an LDP neighbor with a node in the LDP network, an LDP label (i.e., the target LDP label of the tunnel address) can be generated for the tunnel address of the tail node. On this basis, the SRMS node can obtain the target LDP label corresponding to the tunnel address of the tail node.
[0146] For example, when network node 2 (i.e., the SRMS node) establishes an LDP neighbor with network node 4 in the LDP network, network node 4 can advertise its LDP label (e.g., 1004) to network node 2 (based on the LDP protocol), so that network node 2 can store the mapping relationship between the tunnel address 4.4.4.4 of network node 4 and the LDP label 1004. When network node 2 establishes an LDP neighbor with network node 6 in the LDP network, network node 6 can advertise its LDP label (e.g., 1006) to network node 2, and network node 2 can store the mapping relationship between the tunnel address 6.6.6.6 of network node 6 and the LDP label 1006.
[0147] On this basis, in step 704, after network node 2 obtains tunnel address 4.4.4.4 of network node 4 from the first label forwarding table item creation message, network node 2 obtains target LDP label 1004 corresponding to tunnel address 4.4.4.4 by querying the mapping relationship. After network node 2 obtains tunnel address 6.6.6.6 of network node 6 from the first label forwarding table item creation message, network node 2 obtains target LDP label 1006 corresponding to tunnel address 6.6.6.6 by querying the mapping relationship.
[0148] In step 705, the SRMS node selects an unused target SR label from the SRGB.
[0149] In one example, the SRGB is used to indicate SR labels, and the label range of the SRGB is determined by a label segment base value and a Range, where the label segment base value represents the minimum value of the SRGB label segment, and the Range represents the number of labels. Based on this, the SRMS node can select an unused SR label from the SRGB as the target SR label.
[0150] For example, an unused SR label can be randomly selected from all SR labels of the SRGB as the target SR label. Alternatively, an unused SR label can be selected as the target SR label according to the order of the SR labels of the SRGB. For example, assuming that the range of the SRGB is from 16000 to 24000, and the last used SR label is 16005, 16006 is selected as the target SR label.
[0151] In step 706, the SRMS node establishes a first label forwarding table item, where the incoming label of the first label forwarding table item can be the target SR label, and the outgoing label of the first label forwarding table item can be the target LDP label.
[0152] For example, after the SRMS node receives the first label forwarding table item creation message sent by network node 4, the SRMS node determines that tunnel address 4.4.4.4 corresponds to target LDP label 1004, and selects unused SR label 16006 as the target SR label, so that the first label forwarding table item shown in Table 1 can be established. After the SRMS node receives the first label forwarding table item creation message sent by network node 6, the SRMS node determines that tunnel address 6.6.6.6 corresponds to target LDP label 1006, and selects unused SR label 16007 as the target SR label, so that the first label forwarding table item shown in Table 2 can be established. In the first label forwarding table item, in addition to the incoming label and the outgoing label, the next hop (such as the outgoing interface of network node 3) and the like can also be included, which is not limited.
[0153] Table 1
[0154] In-label (SR type) Out-label (LDP type) 16006 1004
[0155] Table 2
[0156] In-label (SR type) Out-label (LDP type) 16006 1004 16007 1006
[0157] In the first label forwarding entry, the ingress label is the SR label and the egress label is the LDP label, so that the SR to LDP is realized through the automatic mapping of the SR label to the LDP label by the first label forwarding entry.
[0158] In summary, the SRMS node can automatically generate the first label forwarding entry to realize the automatic mapping of the SR label to the LDP label without manually generating the label forwarding entry.
[0159] Step 707, the SRMS node sends a second entry creation message to the head node, and the head node receives the second entry creation message. For example, the SRMS node adds the target SR label to the first entry creation message to obtain the second entry creation message. Obviously, the destination address of the second entry creation message can be a specified destination address, and the second entry creation message can further include the tunnel address of the tail node, on the basis of which the second entry creation message can further include the target SR label.
[0160] Step 708, the head node establishes a second label forwarding entry based on the second entry creation message.
[0161] In one example, after receiving the second entry creation message sent by the network node 4, the head node obtains the target SR label (such as 16006) from the second entry creation message and establishes a second label forwarding entry (i.e., an SR label forwarding entry), the egress label of the second label forwarding entry is the target SR label, the ingress label is the label X1 (the label X1 can be the same as or different from the egress label), and the label X1 can be any SR label, and no limitation is made to the label X1. In addition to the ingress label and the egress label, the second label forwarding entry can further include the egress interface and the like, and the egress interface refers to the egress interface pointing to the network node 2. For example, referring to Table 3, an example of the second label forwarding entry is shown.
[0162] Table 3
[0163] In-label Out-label X1 16006
[0164] After generating the second label forwarding table entry, the head-end node can also create a mapping relationship table entry between the tunnel address 4.4.4.4 of the network node 4 and the ingress label (i.e., label X1) of the second label forwarding table entry, i.e., the mapping relationship table entry includes the corresponding relationship between the tunnel address of the tail-end node and the ingress label of the second label forwarding table entry. For example, the tunnel address 4.4.4.4 is obtained by the head-end node from the table entry creation message, so that the ingress label (i.e., label X1) of the second label forwarding table entry corresponds to the tunnel address 4.4.4.4 of the tail-end node.
[0165] In one example, after receiving the second table entry creation message sent by the network node 6, the head-end node establishes the second label forwarding table entry, as shown in Table 4 for an example of the second label forwarding table entry. The head-end node can also create a mapping relationship table entry between the tunnel address 6.6.6.6 of the network node 6 and the ingress label (i.e., label X2) of the second label forwarding table entry, so that the ingress label X2 corresponds to the tunnel address 6.6.6.6 of the tail-end node.
[0166] Table 4
[0167] In-label Out-label X1 16006 X2 16007
[0168] In the second label forwarding table entry, the ingress label is an SR label, and the egress label is an SR label. The second label forwarding table entry is used to make the head-end node forward the data message of the SR network to the SRMS node.
[0169] In one example, when the tunnel address of the tail-end node (e.g., the network node 6) changes (e.g., from 6.6.6.6 to 6.6.6.7), the tunnel between the tail-end node and the head-end node is re-established, the first table entry creation message is re-triggered to be sent, the above steps are repeated, the SRMS node is triggered to establish the first label forwarding table entry, and the head-end node is triggered to establish the second label forwarding table entry, so as to realize automatic establishment of the table entry when the tunnel address changes.
[0170] When the tunnel address of the network node 6 changes from 6.6.6.6 to 6.6.6.7, the route for 6.6.6.6 has been deleted, the path does not exist, the SRMS node can automatically delete the first label forwarding table entry for 6.6.6.6, or the first label forwarding table entry for 6.6.6.6 is deleted due to aging, or the first label forwarding table entry for 6.6.6.6 is not deleted, which will not affect the data message transmission process. In addition, the head-end node can automatically delete the second label forwarding table entry for 6.6.6.6, or the second label forwarding table entry for 6.6.6.6 is deleted due to aging, or the second label forwarding table entry for 6.6.6.6 is not deleted.
[0171] In one example, referring to Figure 7BAs shown in Fig. 1, it is a networking diagram of the label forwarding table item establishment process. For each network node (such as an intermediate node or a tail node), the network node can include an automatic condition satisfaction judgment module and an LSP type selection module. The automatic condition satisfaction judgment module is used to determine whether the network node is an SRMS node. For example, the automatic condition satisfaction judgment module of the network node 2 determines that the network node is an SRMS node, and triggers the execution of the label forwarding table item automatic generation. In this way, the SRMS node only needs to start the global automatic SRMS, and does not need to manually specify the address and label correspondence. The automatic condition satisfaction judgment module of the network node 3 determines that the network node is not an SRMS node.
[0172] The LSP type selection module is used to provide an automatic mode option, which controls the triggering of the automatic SRMS mapping under what circumstances. For example, the automatic mode option is selected as "all 32-bit host routes trigger automatic SRMS mapping", the automatic mode option is selected as "all tunnels trigger automatic SRMS mapping", and the automatic mode option is selected as "tunnels used by service iteration trigger automatic SRMS mapping".
[0173] For the automatic mode option of "all 32-bit host routes trigger automatic SRMS mapping", the tail node can trigger the sending of the first table item creation packet based on the 32-bit host route. For the automatic mode option of "all tunnels trigger automatic SRMS mapping", the tail node can trigger the sending of the first table item creation packet based on the tunnel. For the automatic mode option of "tunnels used by service iteration trigger automatic SRMS mapping", the tail node can determine whether the tunnel is used by service iteration. If yes, the tail node triggers the sending of the first table item creation packet.
[0174] Based on the first label forwarding table item and the second label forwarding table item, referring to Fig. 6, it is a flow diagram of a data packet transmission method. The data packet transmission method can include the following steps. Figure 7C
[0175] Step 711, the head node sends the data packet based on the second label forwarding table item.
[0176] For example, when the head-end node (e.g., network node 1) receives the second data packet, if the destination IP address of the second data packet is address 4.4.4.4, the head-end node queries the mapping relationship table item through the destination IP address 4.4.4.4 to obtain the label X1 corresponding to the destination IP address 4.4.4.4, and encapsulates the label X1 for the second data packet. The head-end node queries the second label forwarding table item (see Table 3 or Table 4) according to the entry label X1, determines the next hop (i.e., the out interface pointing to network node 2) and the out label 16006 corresponding to the entry label X1, encapsulates the label 16006 for the second data packet to obtain the first data packet, i.e., the first data packet includes the target SR label corresponding to the SRMS node. The head-end node sends the first data packet to the SRMS node,
[0177] Step 712, the SRMS node receives the first data packet sent by the head-end node.
[0178] Step 713, the SRMS node queries the first label forwarding table item through the target SR label.
[0179] Step 714, if there is no out label of the SR type in the first label forwarding table item, the SRMS node determines whether there is an out label of the LDP type in the first label forwarding table item. If yes, i.e., there is a target LDP label of the LDP type in the first label forwarding table item, step 715 can be performed, and if no, i.e., there is no out label of the LDP type in the first label forwarding table item, the first data packet can be discarded.
[0180] Step 715, the SRMS node adds a target LDP label to the first data packet to obtain a third data packet, and sends the third data packet to a node (e.g., tail-end node) in the LDP network.
[0181] In one example, after receiving the first data packet, the SRMS node obtains the target SR label 16006 (i.e., the entry label 16006) from the first data packet, and queries the first label forwarding table item (see Table 1 or Table 2) through the entry label 16006. Since there is no out label of the SR type in the first label forwarding table item, the SRMS node determines whether there is an out label of the LDP type in the first label forwarding table item. Since there is an out label of the LDP type 1004 (i.e., the out label 1004 as the target LDP label) in the first label forwarding table item, the SRMS node adds the out label 1004 (i.e., replaces the target SR label 16006) to the first data packet to obtain a third data packet, and sends the third data packet to the tail-end node.
[0182] Since the ingress label 16006 is an SR label of the SR network and the egress label 1004 is an LDP label of the LDP network, the SRMS node can convert the SR label of the SR network into the LDP label of the LDP network, thereby realizing intercommunication between the SR network and the LDP network. In summary, the first label forwarding table item is used to make the SRMS node forward the data packet of the SR network to the LDP network, thereby realizing intercommunication between the SR network and the LDP network.
[0183] After the network node 3 receives the third data packet, the network node 3 finds the egress label according to the ingress label in the LDP label forwarding table item, replaces the ingress label of the third data packet with the egress label, obtains a fourth data packet, and sends the fourth data packet to the network node 4 (i.e., the tail-end node). After the fourth data packet reaches the tail-end node, the tail-end node deletes the label in the fourth data packet, and the label forwarding process is completed.
[0184] As can be seen from the above technical solutions, in the embodiments of the present application, the SRMS node can automatically establish a label forwarding table item based on a table item creation packet, and the label forwarding table item is used to make the SRMS node forward the data packet of the SR network to the LDP network, thereby realizing intercommunication between the SR network and the LDP network based on the label forwarding table item. The SRMS node only needs to start the global automatic SRMS function, and the SRMS node can automatically generate the label forwarding table item on demand, thereby bringing convenience to the configuration and maintenance of a large number of label forwarding table items.
[0185] Based on the same application concept as the above method, the embodiments of the present application propose a data packet transmission device applied to a network node. If the network node is a segment routing mapping server (SRMS) node, referring to FIG. 8, which is a structural schematic diagram of the data packet transmission device, the device can include: Figure 8
[0186] The receiving module 81 is configured to receive a first table item creation packet, and the first table item creation packet includes a tunnel address of a tail-end node. The processing module 82 is configured to obtain a target label distribution protocol (LDP) label corresponding to the tunnel address of the tail-end node, and select an unused target SR label from a segment routing global label segment (SRGB). The establishing module 83 is configured to establish a first label forwarding table item, and the ingress label of the first label forwarding table item is the target SR label, and the egress label of the first label forwarding table item is the target LDP label. The first label forwarding table item is used to make the SRMS node forward a data packet of an SR network to an LDP network. The first table item creation packet is sent by the tail-end node to a head-end node when the tail-end node establishes a tunnel between the tail-end node and the head-end node.
[0187] In one example, the apparatus further includes a sending module configured to send a second table item creation message to the head-end node, the second table item creation message including the target SR label and a tunnel address of the tail-end node, so that the head-end node establishes a second label forwarding table item and a mapping relationship table item;
[0188] The mapping relationship table item includes a corresponding relationship between the tunnel address of the tail-end node and an in-label of the second label forwarding table item; the in-label of the second label forwarding table item is an arbitrary SR label, and an out-label of the second label forwarding table item is the target SR label; the second label forwarding table item is configured to make the head-end node forward a data packet of the SR network to the SRMS node.
[0189] In one example, the receiving module 81 is further configured to receive a first data packet sent by the head-end node, the first data packet including the target SR label; the first data packet is obtained by adding the target SR label to a second data packet after the head-end node obtains the target SR label corresponding to the second data packet through the mapping relationship table item and the second label forwarding table item; the processing module 82 is further configured to query the first label forwarding table item through the target SR label; if the first label forwarding table item does not exist an out-label of SR type, it is determined whether the first label forwarding table item exists an out-label of LDP type; if the first label forwarding table item exists the target LDP label of LDP type, a third data packet is obtained by adding the target LDP label to the first data packet; and the sending module is further configured to send the third data packet to a node in the LDP network.
[0190] In one example, the table item creation message includes an MPLS echo request message, and the MPLS echo request message includes a forwarding equivalence class (FEC) field, the FEC field being configured to carry the tunnel address of the tail-end node;
[0191] The MPLS echo request message is sent by the tail-end node before a tunnel between the tail-end node and the head-end node is used to transmit a data packet, and the tunnel is established by the tail-end node according to a route received by the tail-end node.
[0192] In one example, the processing module 81 is further configured to determine that the network node is an SRMS node if the network node establishes an LDP neighbor with a first node in the LDP network and establishes an IGP neighbor with a second node in the IGP network, the second node having SR capability and being different from the first node.
[0193] Based on the same application concept as the above method, an electronic device is provided in the embodiments of the present application, referring to Figure 9 As shown in FIG. 9, the electronic device includes a processor 91 and a machine readable storage medium 92, the machine readable storage medium 92 stores machine executable instructions which can be executed by the processor 91; the processor 91 is configured to execute the machine executable instructions to implement the data packet transmission method disclosed in the above examples of the present application.
[0194] Based on the same application concept as the above method, the embodiments of the present application further provide a machine readable storage medium, the machine readable storage medium stores a plurality of computer instructions, the computer instructions are executed by a processor to implement the data packet transmission method disclosed in the above examples of the present application.
[0195] The machine readable storage medium can be any electronic, magnetic, optical, or other physical storage device, and can contain or store information such as executable instructions, data, and the like. For example, the machine readable storage medium can be a RAM (Random Access Memory), a volatile memory, a non-volatile memory, a flash memory, a storage drive (such as a hard disk drive), a solid state drive, any type of storage disk (such as an optical disk, a DVD, etc.), or similar storage medium, or a combination thereof.
[0196] Based on the same application concept as the above method, the embodiments of the present application further provide a computer program product, the computer program product can include a computer program, the computer program is executed by a processor to implement the data packet transmission method disclosed in the above examples of the present application.
[0197] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can be in the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can be in the form of a computer program product implemented on one or more computer usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
[0198] The above only describes the embodiments of the present application and is not intended to limit the present application. Those skilled in the art can make various modifications and changes to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the scope of the claims of the present application.
Claims
1. A method for transmitting a data packet, characterized by, The method is applied to a network node, and comprises the following steps: receiving a first table item creation message, wherein the first table item creation message comprises a tunnel address of a tail-end node; obtaining a target label distribution protocol (LDP) label corresponding to the tunnel address of the tail-end node; selecting an unused target segment routing (SR) label from a segment routing global label segment (SRGB); establishing a first label forwarding table item, wherein an in-label of the first label forwarding table item is the target SR label, and an out-label of the first label forwarding table item is the target LDP label; and wherein the first label forwarding table item is used to make the network node forward a data message of an SR network to an LDP network; wherein the first table item creation message is sent by the tail-end node to a head-end node when the tail-end node establishes a tunnel between the tail-end node and the head-end node.
2. The method of claim 1, wherein after the step of selecting the unused target SR label from the SRGB, the method further comprises: sending a second table item creation message to the head-end node, wherein the second table item creation message comprises the target SR label and the tunnel address of the tail-end node, so as to make the head-end node establish a second label forwarding table item and a mapping relationship table item; wherein the mapping relationship table item comprises a corresponding relationship between the tunnel address of the tail-end node and an in-label of the second label forwarding table item; wherein the in-label of the second label forwarding table item is an arbitrary SR label, and the out-label of the second label forwarding table item is the target SR label; and wherein the second label forwarding table item is used to make the head-end node forward a data message of an SR network to the network node.
3. The method of claim 2, wherein after the step of establishing the first label forwarding table item, the method further comprises: receiving a first data message sent by the head-end node, wherein the first data message comprises the target SR label; wherein the first data message is obtained by the head-end node when the head-end node receives a second data message, by obtaining a target SR label corresponding to the second data message through the mapping relationship table item and the second label forwarding table item, and adding the target SR label to the second data message; querying the first label forwarding table item through the target SR label; if the first label forwarding table item does not exist an out-label of an SR type, determining whether the first label forwarding table item exists an out-label of an LDP type; if the first label forwarding table item exists the target LDP label of the LDP type, adding the target LDP label to the first data message to obtain a third data message; sending the third data message to a node in the LDP network.
4. The method of any one of claims 1-3, wherein the table item creation message comprises a multiprotocol label switching (MPLS) echo request message, and the MPLS echo request message comprises a forwarding equivalence class (FEC) field, and the FEC field is used to carry the tunnel address of the tail-end node. The MPLS echo request message is sent by the tail node before establishing a tunnel between the tail node and the head node. The tunnel is established by the tail node according to a route when the tail node receives the route to the head node.
5. The method according to any of claims 1 to 3, characterized in that The method further comprises: If the network node establishes an LDP neighbor with a first node in an LDP network and establishes an IGP neighbor with a second node in an IGP network, the second node has SR capability and is different from the first node, it is determined that the network node is an SRMS node.
6. A data packet transmission apparatus, characterized by comprising: The network node comprises: The receiving module is configured to receive a first table item creation message, the first table item creation message comprising a tunnel address of a tail node; The processing module is configured to obtain a target label distribution protocol (LDP) label corresponding to the tunnel address of the tail node, and select an unused target segment routing global label segment (SRG) label from a segment routing global label segment (SRG) table; The establishing module is configured to establish a first label forwarding table item, an incoming label of the first label forwarding table item being the target SR label, and an outgoing label of the first label forwarding table item being the target LDP label; wherein the first label forwarding table item is used to make the network node forward a data message of an SR network to an LDP network. The first table item creation message is sent by the tail node to the head node when the tail node establishes a tunnel between the tail node and the head node.
7. The apparatus of claim 6, wherein, The device further comprises: The sending module is configured to send a second table item creation message to the head node, the second table item creation message comprising the target SR label and the tunnel address of the tail node, so that the head node establishes a second label forwarding table item and a mapping relationship table item; The mapping relationship table item comprises a corresponding relationship between the tunnel address of the tail node and an incoming label of the second label forwarding table item; the incoming label of the second label forwarding table item is an arbitrary SR label, and the outgoing label of the second label forwarding table item is the target SR label; the second label forwarding table item is used to make the head node forward a data message of an SR network to the network node.
8. The device of claim 7, wherein The receiving module is further configured to receive a first data message sent by the head node, the first data message comprising the target SR label; wherein the first data message is obtained by adding the target SR label to a second data message after the head node obtains the target SR label corresponding to the second data message through the mapping relationship table item and the second label forwarding table item; The processing module is further configured to query the first label forwarding table item through the target SR label, and determine whether the first label forwarding table item has an outgoing label of an LDP type if the first label forwarding table item does not have an outgoing label of an SR type; if the first label forwarding table item has the target LDP label of the LDP type, add the target LDP label to the first data message to obtain a third data message; The sending module is further configured to send the third data packet to a node in the LDP network.
9. The apparatus of any of claims 6-8, wherein, The table entry creation packet comprises an MPLS echo request packet, and the MPLS echo request packet comprises a forwarding equivalence class (FEC) field, and the FEC field is used to carry a tunnel address of the tail node. The MPLS echo request packet is sent by the tail node before a tunnel between the tail node and the head node is used to transmit data packets, and the tunnel is established by the tail node according to a route to the head node. The processing module is further configured to determine that the network node is an SRMS node if the network node establishes an LDP neighbor with a first node in an LDP network and establishes an IGP neighbor with a second node in an IGP network, the second node having SR capability and being different from the first node.
10. An electronic device, comprising: comprising: a processor and a machine readable storage medium storing machine executable instructions executable by the processor; the processor is configured to execute the machine executable instructions to implement the method of any of claims 1-5.
Citation Information
Patent Citations
Label distribution protocol over segment routing
CN105075195A
A message processing method and apparatus
CN109067657A