









技术领域technical field
本申请涉及通信领域,尤其涉及一种报文发送的方法和装置。The present application relates to the field of communications, and in particular to a method and device for sending messages.
背景技术Background technique
当网络出现链路故障后,网络节点(即网络设备,例如路由器(router,RT))保存的路由需要进行收敛。网络中可以运行内部网关协议(Interior Gateway Protocol,IGP)或边界网关协议(Border Gateway Protocol,BGP)。如图1所示,当RT1与RT7之间的链路发生故障后,RT1到RT7的路由由原来的RT1->RT7收敛为RT1->RT2->RT7,RT2到RT7的路由由原来的RT2->RT1->RT7收敛为RT2->RT3->RT7,以此类推,直至收敛到RT7。在上述收敛过程中,如果网络节点间的收敛性能存在差异,会导致收敛环路(收敛微环)问题。例如,如果RT2的收敛速度比RT1的收敛速度慢,那么就会在RT1和RT2间形成环路,即RT1将需要发送给RT7的报文转发给RT2后,由于RT2收敛较慢,RT2接收到RT1发送的报文后,会根据收敛前的流量转发路径(即路径RT2-RT1-RT7)转发该报文,即重新将该报文发送给RT1,形成环路。When a link failure occurs in the network, the routes saved by the network nodes (that is, network devices, such as routers (RTs)) need to be converged. An Interior Gateway Protocol (Interior Gateway Protocol, IGP) or a Border Gateway Protocol (Border Gateway Protocol, BGP) may run in the network. As shown in Figure 1, when the link between RT1 and RT7 fails, the route from RT1 to RT7 converges from the original RT1->RT7 to RT1->RT2->RT7, and the route from RT2 to RT7 is changed from the original RT2 ->RT1->RT7 converges to RT2->RT3->RT7, and so on until it converges to RT7. In the above convergence process, if there is a difference in convergence performance among network nodes, it will cause a convergence loop (convergence micro-loop) problem. For example, if the convergence speed of RT2 is slower than that of RT1, a loop will be formed between RT1 and RT2, that is, after RT1 forwards the packet to RT7 to RT2, because RT2 converges slowly, RT2 receives After RT1 sends the packet, it will forward the packet according to the traffic forwarding path before convergence (that is, the path RT2-RT1-RT7), that is, resend the packet to RT1, forming a loop.
相关技术中,可以采用分段路由(segment routing,SR)技术解决收敛环路问题。如图2所示,假设RT1与RT7之间的链路发生故障,RT1收敛后,可以根据转发需求为原本需要通过故障链路转发的报文重新确定一条转发路径(label switching path,LSP),并将该转发路径对应的标签栈添加在待转发的报文中。其中,该标签栈包括LSP经过的链路信息,例如链路分段标识(segment identification,SID)。该标签栈例如可以是{1001,1002,1003,1004,1005},其中,1001是RT2和RT3之间的邻居段标签(adjacency segment identifier,Adj-SID),Adj-SID也可以称为链路标签,1002是RT3和RT4之间的链路标签,1003是RT4和RT5之间的链路标签,1004是RT5和RT6之间的链路标签,1005是RT6和RT7之间的链路标签。这样,经过RT1转发到RT7的流量可以按照RT1压入的标签栈进行转发,而不依赖其他网络节点(例如,RT2)的收敛,从而避免出现收敛环路问题。In related technologies, a segment routing (segment routing, SR) technology may be used to solve the convergence loop problem. As shown in Figure 2, assuming that the link between RT1 and RT7 fails, after RT1 converges, it can re-determine a forwarding path (label switching path, LSP) for the packets that originally need to be forwarded through the faulty link according to the forwarding requirements. And add the label stack corresponding to the forwarding path to the message to be forwarded. Wherein, the label stack includes link information passed by the LSP, such as link segment identification (segment identification, SID). The label stack may be, for example, {1001, 1002, 1003, 1004, 1005}, where 1001 is an adjacency segment identifier (Adj-SID) between RT2 and RT3, and Adj-SID may also be called a
但是,受硬件能力限制,每个网络节点的标签栈能力是有限的,即每个网络节点的标签栈中能够压入的标签的层数是有限制的(比如2层、3层、6层或10层等)。转发路径越长时,标签栈就会越长(也可以称为越深),当标签栈的长度超过网络节点的标签栈能力后,标签栈就无法压入,即无法根据标签栈转发报文。例如,如图2所示,当转发路径对应的标签栈包括5层标签时,而RT1的标签栈能力是3层时,RT1无法根据标签栈转发报文。However, limited by hardware capabilities, the label stack capability of each network node is limited, that is, the number of layers of labels that can be pushed into the label stack of each network node is limited (such as 2 layers, 3 layers, 6 layers or 10 layers, etc.). The longer the forwarding path, the longer the label stack (also called the deeper). When the length of the label stack exceeds the label stack capacity of the network node, the label stack cannot be pushed in, that is, the packet cannot be forwarded according to the label stack. . For example, as shown in Figure 2, when the label stack corresponding to the forwarding path includes 5 layers of labels, and the label stack capability of RT1 is 3 layers, RT1 cannot forward packets according to the label stack.
发明内容Contents of the invention
本申请实施例提供一种报文发送的方法和装置,能够缩短报文的标签栈的长度,在网络设备的标签栈能力不变的情况下,可以支持更多的场景(例如可以支持较长的转发路径的场景)。The embodiment of the present application provides a method and device for sending a message, which can shorten the length of the label stack of the message, and can support more scenarios (for example, it can support longer forwarding path scenario).
第一方面,本申请实施例提供一种报文发送的方法,包括:第一网络节点确定用于转发报文的第一转发路径不可用;响应于确定第一转发路径不可用,第一网络节点确定用于转发报文的第二转发路径;第一网络节点在报文中添加对应第二转发路径的标签栈,标签栈包括第二网络节点的节点标签,且标签栈不包括第一网络节点与第二网络节点之间的链路的链路标签,或标签栈不包括第一网络节点与第二网络节点之间的网络节点的节点标签,第一网络节点与第二网络节点之间的最短路径不包括第一转发路径,第二网络节点为第二转发路径上的网络节点;第一网络节点发送添加了标签栈的报文。In the first aspect, the embodiment of the present application provides a method for sending a message, including: the first network node determines that the first forwarding path used to forward the message is unavailable; in response to determining that the first forwarding path is unavailable, the first network node The node determines the second forwarding path for forwarding the message; the first network node adds a label stack corresponding to the second forwarding path to the message, the label stack includes the node label of the second network node, and the label stack does not include the first network node The link label of the link between the node and the second network node, or the label stack does not include the node label of the network node between the first network node and the second network node, between the first network node and the second network node The shortest path does not include the first forwarding path, and the second network node is a network node on the second forwarding path; the first network node sends a message with a label stack added.
基于本申请实施例提供的方法,可以根据标签栈中第二网络节点的节点标签将报文转发至第二网络节点,无需在标签栈中添加第一网络节点至第二网络节点之间的一个或多个链路标签或节点标签,可以缩短标签栈的长度,在网络设备的标签栈能力不变的情况下,可以支持更多的场景(例如可以支持较长的转发路径的场景)。Based on the method provided by the embodiment of the present application, the message can be forwarded to the second network node according to the node label of the second network node in the label stack, without adding a node between the first network node and the second network node in the label stack or multiple link labels or node labels, the length of the label stack can be shortened, and more scenarios can be supported (for example, the scenario of a longer forwarding path can be supported) under the condition that the label stack capability of the network device remains unchanged.
在一种可能的实现方式中,用于转发报文的第一转发路径不可用包括以下至少一种:第一转发路径的最小链路开销大于等于预设阈值;或者第一转发路径发生故障;或者第一转发路径发生拥塞。In a possible implementation manner, the unavailability of the first forwarding path for forwarding packets includes at least one of the following: the minimum link overhead of the first forwarding path is greater than or equal to a preset threshold; or the first forwarding path fails; Or the first forwarding path is congested.
在一种可能的实现方式中,第二网络节点是M个网络节点中与第一网络节点相隔最远的网络节点,M个网络节点分别位于第二转发路径上,且第一网络节点分别到M个网络节点中的每个网络节点之间的最短路径都不包括第一转发路径,M为大于或等于1的整数。可以理解的是,第二网络节点是M个网络节点中与第一网络节点距离最远的网络节点,即第二网络节点是M个网络节点中与第一网络节点相隔网络节点跳数最多的网络节点,由于标签栈不包括第一网络节点与第二网络节点之间的链路的链路标签或节点标签,可以较大程度缩短标签栈的长度。In a possible implementation manner, the second network node is the network node farthest from the first network node among the M network nodes, and the M network nodes are respectively located on the second forwarding path, and the first network node respectively goes to The shortest path between each of the M network nodes does not include the first forwarding path, and M is an integer greater than or equal to 1. It can be understood that the second network node is the network node that is farthest from the first network node among the M network nodes, that is, the second network node is the network node that is separated from the first network node by the largest number of hops among the M network nodes For the network node, since the label stack does not include link labels or node labels of links between the first network node and the second network node, the length of the label stack can be shortened to a large extent.
在一种可能的实现方式中,第二转发路径包括第三网络节点,第三网络节点是第二转发路径中第二网络节点的下一跳网络节点,该方法还包括:第一网络节点确定第二网络节点与第三网络节点之间的最小链路开销是否大于第一网络节点与第三网络节点之间的最小链路开销;当第二网络节点与第三网络节点之间的最小链路开销大于第一网络节点与第三网络节点之间的最小链路开销时,标签栈还包括第二网络节点与第三网络节点之间的链路标签。这是由于当第二网络节点与第三网络节点之间的最小链路开销大于第一网络节点与第三网络节点之间的最小链路开销时,第二网络节点与第三网络节点之间的直连链路并非第二网络节点与第三网络节点之间的最短路径,由于第二网络节点可能还未收敛或还未获知网络中的链路发生了故障,因此第二网络节点自主确定的第二网络节点与第三网络节点之间的最短路径可能包括故障链路,导致环路问题。因此需要在标签栈中添加第二网络节点与第三网络节点之间的链路标签,这样,第二网络节点可以根据第二网络节点与第三网络节点之间的链路标签将报文发送至第三网络节点,避免环路问题。In a possible implementation manner, the second forwarding path includes a third network node, and the third network node is a next-hop network node of the second network node in the second forwarding path, and the method further includes: the first network node determining Whether the minimum link cost between the second network node and the third network node is greater than the minimum link cost between the first network node and the third network node; when the minimum link cost between the second network node and the third network node When the path cost is greater than the minimum link cost between the first network node and the third network node, the label stack further includes the link label between the second network node and the third network node. This is because when the minimum link cost between the second network node and the third network node is greater than the minimum link cost between the first network node and the third network node, the connection between the second network node and the third network node The direct link of is not the shortest path between the second network node and the third network node, because the second network node may not have converged or has not learned that the link in the network has failed, so the second network node independently determines The shortest path between the second network node and the third network node may include a faulty link, causing a loop problem. Therefore, it is necessary to add the link label between the second network node and the third network node in the label stack, so that the second network node can send the message according to the link label between the second network node and the third network node to the third network node to avoid loop problems.
在一种可能的实现方式中,第二转发路径包括第三网络节点,第三网络节点是第二转发路径中第二网络节点的下一跳网络节点,该方法还包括:第一网络节点确定第二网络节点与第三网络节点之间的最小链路开销是否小于等于第一网络节点与第三网络节点之间的最小链路开销;当第二网络节点与第三网络节点之间的最小链路开销小于等于第一网络节点与第三网络节点之间的最小链路开销时,标签栈不包括第二网络节点与第三网络节点之间的链路标签。这是由于当第二网络节点与第三网络节点之间的最小链路开销小于等于第一网络节点与第三网络节点之间的最小链路开销时,第二网络节点与第三网络节点之间的直连链路是第二网络节点与第三网络节点之间的最短路径,第二网络节点可以自主(即根据自身的路径规划)将报文发送至第三网络节点,因此无需在标签栈中添加第二网络节点与第三网络节点之间的链路标签。In a possible implementation manner, the second forwarding path includes a third network node, and the third network node is a next-hop network node of the second network node in the second forwarding path, and the method further includes: the first network node determining Whether the minimum link cost between the second network node and the third network node is less than or equal to the minimum link cost between the first network node and the third network node; when the minimum link cost between the second network node and the third network node When the link cost is less than or equal to the minimum link cost between the first network node and the third network node, the label stack does not include the link label between the second network node and the third network node. This is because when the minimum link cost between the second network node and the third network node is less than or equal to the minimum link cost between the first network node and the third network node, the connection between the second network node and the third network node The direct link between is the shortest path between the second network node and the third network node, and the second network node can autonomously (that is, according to its own path planning) send the message to the third network node, so there is no need to A link label between the second network node and the third network node is added to the stack.
在一种可能的实现方式中,第二转发路径包括第四网络节点,第四网络节点是第二转发路径中第三网络节点的下一跳网络节点,该方法还包括:第一网络节点确定第三网络节点与第四网络节点之间的最小链路开销是否大于第一网络节点与第四网络节点之间的最小链路开销;第三网络节点与第四网络节点之间的最小链路开销大于第一网络节点与第四网络节点之间的最小链路开销时,标签栈还包括第三网络节点与第四网络节点之间的链路标签。In a possible implementation manner, the second forwarding path includes a fourth network node, and the fourth network node is a next-hop network node of the third network node in the second forwarding path, and the method further includes: the first network node determining Whether the minimum link cost between the third network node and the fourth network node is greater than the minimum link cost between the first network node and the fourth network node; the minimum link cost between the third network node and the fourth network node When the cost is greater than the minimum link cost between the first network node and the fourth network node, the label stack further includes a link label between the third network node and the fourth network node.
在一种可能的实现方式中,第二转发路径包括第四网络节点,第四网络节点是第二转发路径中第三网络节点的下一跳网络节点,该方法还包括:第一网络节点确定第三网络节点与第四网络节点之间的最小链路开销是否小于等于第一网络节点与第四网络节点之间的最小链路开销;第三网络节点与第四网络节点之间的最小链路开销小于等于第一网络节点与第四网络节点之间的最小链路开销时,标签栈不包括第三网络节点与第四网络节点之间的链路标签。In a possible implementation manner, the second forwarding path includes a fourth network node, and the fourth network node is a next-hop network node of the third network node in the second forwarding path, and the method further includes: the first network node determining Whether the minimum link cost between the third network node and the fourth network node is less than or equal to the minimum link cost between the first network node and the fourth network node; the minimum link cost between the third network node and the fourth network node When the path cost is less than or equal to the minimum link cost between the first network node and the fourth network node, the label stack does not include the link label between the third network node and the fourth network node.
在一种可能的实现方式中,当标签栈不包括第二网络节点与第三网络节点之间的链路标签,且标签栈包括第三网络节点与第四网络节点之间的链路标签时,标签栈还包括第三网络节点的节点标签。这是由于第二网络节点可能无法识别第三网络节点与第四网络节点之间的链路标签,当报文转发至第二网络节点时,第二网络节点无法根据第三网络节点与第四网络节点之间的链路标签确定如何发送报文。因此需要在标签栈中添加第三网络节点的节点标签,以便第二网络节点将报文发送给第三网络节点,由第三网络节点根据第三网络节点与第四网络节点之间的链路标签将报文转发给第四网络节点。In a possible implementation manner, when the label stack does not include a link label between the second network node and the third network node, and the label stack includes a link label between the third network node and the fourth network node , the label stack further includes node labels of the third network nodes. This is because the second network node may not be able to recognize the link label between the third network node and the fourth network node. When the packet is forwarded to the second network node, the second network node cannot Link labels between network nodes determine how messages are sent. Therefore, it is necessary to add the node label of the third network node in the label stack, so that the second network node can send the message to the third network node, and the third network node can The label forwards the packet to the fourth network node.
第二方面,本申请实施例提供一种第一网络节点,包括:确定单元,用于确定用于转发报文的第一转发路径不可用;确定单元,还用于响应于确定第一转发路径不可用,确定用于转发报文的第二转发路径;处理单元,用于在报文中添加对应第二转发路径的标签栈,标签栈包括第二网络节点的节点标签,且标签栈不包括第一网络节点与第二网络节点之间的链路的链路标签,或标签栈不包括第一网络节点与第二网络节点之间的网络节点的节点标签,第一网络节点与第二网络节点之间的最短路径不包括第一转发路径,第二网络节点为第二转发路径上的网络节点;发送单元,用于发送添加了标签栈的报文。In a second aspect, the embodiment of the present application provides a first network node, including: a determining unit configured to determine that the first forwarding path used to forward packets is unavailable; the determining unit is also configured to respond to determining the first forwarding path Unavailable, determining a second forwarding path for forwarding the message; a processing unit, configured to add a label stack corresponding to the second forwarding path to the message, the label stack includes the node label of the second network node, and the label stack does not include The link label of the link between the first network node and the second network node, or the label stack does not include the node label of the network node between the first network node and the second network node, the first network node and the second network node The shortest path between nodes does not include the first forwarding path, and the second network node is a network node on the second forwarding path; a sending unit, configured to send a message with a label stack added.
在一种可能的实现方式中,用于转发报文的第一转发路径不可用包括以下至少一种:第一转发路径的最小链路开销大于等于预设阈值;或者第一转发路径发生故障;或者第一转发路径发生拥塞。In a possible implementation manner, the unavailability of the first forwarding path for forwarding packets includes at least one of the following: the minimum link overhead of the first forwarding path is greater than or equal to a preset threshold; or the first forwarding path fails; Or the first forwarding path is congested.
在一种可能的实现方式中,第二网络节点是M个网络节点中与第一网络节点相隔最远的网络节点,M个网络节点分别位于第二转发路径上,且第一网络节点分别到M个网络节点中的每个网络节点之间的最短路径都不包括第一转发路径,M为大于或等于1的整数。In a possible implementation manner, the second network node is the network node farthest from the first network node among the M network nodes, and the M network nodes are respectively located on the second forwarding path, and the first network node respectively goes to The shortest path between each of the M network nodes does not include the first forwarding path, and M is an integer greater than or equal to 1.
在一种可能的实现方式中,第二转发路径包括第三网络节点,第三网络节点是第二转发路径中第二网络节点的下一跳网络节点,确定单元还用于:确定第二网络节点与第三网络节点之间的最小链路开销是否大于第一网络节点与第三网络节点之间的最小链路开销;当第二网络节点与第三网络节点之间的最小链路开销大于第一网络节点与第三网络节点之间的最小链路开销时,标签栈还包括第二网络节点与第三网络节点之间的链路标签。In a possible implementation manner, the second forwarding path includes a third network node, and the third network node is a next-hop network node of the second network node in the second forwarding path, and the determining unit is further configured to: determine the second network node Whether the minimum link cost between the node and the third network node is greater than the minimum link cost between the first network node and the third network node; when the minimum link cost between the second network node and the third network node is greater than When the link overhead between the first network node and the third network node is the minimum, the label stack further includes a link label between the second network node and the third network node.
在一种可能的实现方式中,第二转发路径包括第三网络节点,第三网络节点是第二转发路径中第二网络节点的下一跳网络节点,确定单元还用于:确定第二网络节点与第三网络节点之间的最小链路开销是否小于等于第一网络节点与第三网络节点之间的最小链路开销;当第二网络节点与第三网络节点之间的最小链路开销小于等于第一网络节点与第三网络节点之间的最小链路开销时,标签栈不包括第二网络节点与第三网络节点之间的链路标签。In a possible implementation manner, the second forwarding path includes a third network node, and the third network node is a next-hop network node of the second network node in the second forwarding path, and the determining unit is further configured to: determine the second network node Whether the minimum link overhead between the node and the third network node is less than or equal to the minimum link overhead between the first network node and the third network node; when the minimum link overhead between the second network node and the third network node When it is less than or equal to the minimum link cost between the first network node and the third network node, the label stack does not include the link label between the second network node and the third network node.
在一种可能的实现方式中,第二转发路径包括第四网络节点,第四网络节点是第二转发路径中第三网络节点的下一跳网络节点,确定单元还用于:确定第三网络节点与第四网络节点之间的最小链路开销是否大于第一网络节点与第四网络节点之间的最小链路开销;第三网络节点与第四网络节点之间的最小链路开销大于第一网络节点与第四网络节点之间的最小链路开销时,标签栈还包括第三网络节点与第四网络节点之间的链路标签。In a possible implementation manner, the second forwarding path includes a fourth network node, and the fourth network node is a next-hop network node of the third network node in the second forwarding path, and the determining unit is further configured to: determine the third network node Whether the minimum link overhead between the node and the fourth network node is greater than the minimum link overhead between the first network node and the fourth network node; the minimum link overhead between the third network node and the fourth network node is greater than the first When the link overhead between the first network node and the fourth network node is the minimum, the label stack further includes the link label between the third network node and the fourth network node.
在一种可能的实现方式中,第二转发路径包括第四网络节点,第四网络节点是第二转发路径中第三网络节点的下一跳网络节点,确定单元还用于:确定第三网络节点与第四网络节点之间的最小链路开销是否小于等于第一网络节点与第四网络节点之间的最小链路开销;第三网络节点与第四网络节点之间的最小链路开销小于等于第一网络节点与第四网络节点之间的最小链路开销时,标签栈不包括第三网络节点与第四网络节点之间的链路标签。In a possible implementation manner, the second forwarding path includes a fourth network node, and the fourth network node is a next-hop network node of the third network node in the second forwarding path, and the determining unit is further configured to: determine the third network node Whether the minimum link overhead between the node and the fourth network node is less than or equal to the minimum link overhead between the first network node and the fourth network node; the minimum link overhead between the third network node and the fourth network node is less than When equal to the minimum link cost between the first network node and the fourth network node, the label stack does not include the link label between the third network node and the fourth network node.
在一种可能的实现方式中,当标签栈不包括第二网络节点与第三网络节点之间的链路标签,且标签栈包括第三网络节点与第四网络节点之间的链路标签时,标签栈还包括第三网络节点的节点标签。In a possible implementation manner, when the label stack does not include a link label between the second network node and the third network node, and the label stack includes a link label between the third network node and the fourth network node , the label stack further includes node labels of the third network nodes.
第三方面,本申请还提供了一种通信装置,该通信装置可以是第一网络节点或芯片。该通信装置包括处理器,用于实现上述第一方面提供的任意一种方法。该通信装置还可以包括存储器,用于存储程序指令和数据,存储器可以是集成在该通信装置内的存储器,或设置在该通信装置外的片外存储器。该存储器与该处理器耦合,该处理器可以调用并执行该存储器中存储的程序指令,用于实现上述第一方面提供的任意一种方法。该存储器可以设置在处理器中,或该存储器与处理器独立设置。该通信装置还可以包括收发器(通信接口/接口电路),该收发器用于该通信装置与其它设备(例如,第一网络节点的下一跳网络节点)进行通信。In a third aspect, the present application further provides a communication device, where the communication device may be a first network node or a chip. The communications device includes a processor, configured to implement any one of the methods provided in the foregoing first aspect. The communication device may also include a memory for storing program instructions and data, and the memory may be a memory integrated in the communication device, or an off-chip memory provided outside the communication device. The memory is coupled to the processor, and the processor can call and execute program instructions stored in the memory to implement any one of the methods provided in the first aspect above. The memory can be set in the processor, or the memory can be set independently from the processor. The communication device may further include a transceiver (communication interface/interface circuit), which is used for the communication device to communicate with other devices (eg, the next-hop network node of the first network node).
第四方面,本申请提供一种计算机可读存储介质,包括指令,当其在计算机上运行时,使得计算机执行上述第一方面提供的任意一种方法。In a fourth aspect, the present application provides a computer-readable storage medium, including instructions, which, when run on a computer, cause the computer to execute any one of the methods provided in the first aspect above.
第五方面,本申请提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面提供的任意一种方法。In a fifth aspect, the present application provides a computer program product including instructions, which, when run on a computer, cause the computer to execute any one of the methods provided in the first aspect above.
第六方面,本申请提供了一种芯片系统,该芯片系统包括处理器,还可以包括存储器,用于实现上述第一方面提供的任意一种方法。该芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。In a sixth aspect, the present application provides a system-on-a-chip, where the system-on-a-chip includes a processor and may further include a memory, configured to implement any one of the methods provided in the first aspect above. The system-on-a-chip may consist of chips, or may include chips and other discrete devices.
第七方面,本申请提供了一种报文发送的系统,包括第一网络节点和第二网络节点,其中:第一网络节点用于确定用于转发报文的第一转发路径不可用;响应于确定第一转发路径不可用,确定用于转发报文的第二转发路径;在报文中添加对应第二转发路径的标签栈;标签栈包括第二网络节点的节点标签,且标签栈不包括第一网络节点与第二网络节点之间的链路的链路标签,或标签栈不包括第一网络节点与第二网络节点之间的网络节点的节点标签,第一网络节点与第二网络节点之间的最短路径不包括第一转发路径,第二网络节点为第二转发路径上的网络节点;向第二网络节点发送添加了标签栈的报文;第二网络节点接收添加了标签栈的报文,并根据所述标签栈发送所述报文。In a seventh aspect, the present application provides a system for sending messages, including a first network node and a second network node, wherein: the first network node is used to determine that the first forwarding path used to forward the message is unavailable; the response Determining that the first forwarding path is unavailable, determining a second forwarding path for forwarding the message; adding a label stack corresponding to the second forwarding path to the message; the label stack includes the node label of the second network node, and the label stack does not Including link labels of links between the first network node and the second network node, or the label stack does not include node labels of the network nodes between the first network node and the second network node, the first network node and the second network node The shortest path between network nodes does not include the first forwarding path, and the second network node is a network node on the second forwarding path; sends a message with a label stack added to the second network node; stack, and send the message according to the label stack.
附图说明Description of drawings
图1为现有技术中的一种网络架构的示意图;FIG. 1 is a schematic diagram of a network architecture in the prior art;
图2为现有技术中的又一种网络架构的示意图;FIG. 2 is a schematic diagram of another network architecture in the prior art;
图3为本申请实施例提供的一种网络架构示意图;FIG. 3 is a schematic diagram of a network architecture provided by an embodiment of the present application;
图4为本申请实施例提供的一种第一网络节点的结构示意图;FIG. 4 is a schematic structural diagram of a first network node provided by an embodiment of the present application;
图5为本申请实施例提供的一种报文发送的方法适用的信号示意图;FIG. 5 is a schematic diagram of signals applicable to a method for sending a message provided in an embodiment of the present application;
图6为本申请实施例提供的又一种网络架构示意图;FIG. 6 is a schematic diagram of another network architecture provided by the embodiment of the present application;
图7为本申请实施例提供的一种RT1的最短路径树的示意图;FIG. 7 is a schematic diagram of a shortest path tree of RT1 provided by an embodiment of the present application;
图8为本申请实施例提供的又一种网络架构示意图;FIG. 8 is a schematic diagram of another network architecture provided by the embodiment of the present application;
图9为本申请实施例提供的又一种网络架构示意图;FIG. 9 is a schematic diagram of another network architecture provided by an embodiment of the present application;
图10为本申请实施例提供的又一种第一网络节点的结构示意图。FIG. 10 is a schematic structural diagram of another first network node provided by an embodiment of the present application.
具体实施方式Detailed ways
本申请实施例提供一种报文发送的方法,可以应用于自治网络系统中,例如应用于IGP网络中。示例性的,可以应用于IGP网络中出现链路故障或拥塞等场景中。The embodiment of the present application provides a method for sending a message, which can be applied to an autonomous network system, for example, an IGP network. Exemplarily, it may be applied to scenarios such as link failure or congestion in an IGP network.
如图3所示,为本申请实施例提供的一种网络架构示意图。该网络架构可以包括第一网络节点、第六网络节点以及其他网络节点(例如,网络节点1-网络节点5)。As shown in FIG. 3 , it is a schematic diagram of a network architecture provided by the embodiment of the present application. The network architecture may include a first network node, a sixth network node and other network nodes (eg, network node 1 - network node 5).
当第一网络节点确定用于转发报文的第一转发路径不可用时,响应于确定第一转发路径不可用,第一网络节点确定用于转发报文的第二转发路径。示例性的,第一转发路径可以包括第一网络节点与第六网络节点之间的链路,当该链路发生故障时,第一网络节点确定用于转发报文的第二转发路径,该第二转发路径可以包括转发节点1-转发节点5之间的链路,即第一网络节点可以通过转发节点1-转发节点5将报文转发到第六网络节点。第一网络节点可以在报文中添加对应第二转发路径的标签栈,以便转发节点1-转发节点5可以根据该标签栈转发报文。When the first network node determines that the first forwarding path for forwarding packets is unavailable, in response to determining that the first forwarding path is unavailable, the first network node determines a second forwarding path for forwarding packets. Exemplarily, the first forwarding path may include a link between the first network node and the sixth network node, and when the link fails, the first network node determines a second forwarding path for forwarding the message, the The second forwarding path may include a link between forwarding node 1 -forwarding node 5 , that is, the first network node may forward the message to the sixth network node through forwarding node 1 -forwarding node 5 . The first network node may add a label stack corresponding to the second forwarding path to the message, so that forwarding node 1 - forwarding node 5 can forward the message according to the label stack.
受硬件能力限制,每个网络节点的标签栈能力是有限的,即每个网络节点的标签栈中能够压入的标签的层数是有限制的(比如可压入的标签为2层、3层、6层或10层等,即可压入2个标签,3个标签、6个标签或10个标签等)。转发路径越长时,标签栈就会越长(越深),当标签栈的长度超过网络节点的标签栈能力后,网络节点将无法正确处理包含该标签栈的报文。Limited by hardware capabilities, the label stack capability of each network node is limited, that is, the number of layers of labels that can be pushed into the label stack of each network node is limited (for example, the labels that can be pushed are 2 layers, 3 layers, etc.) layer, 6 layers or 10 layers, etc., you can press 2 labels, 3 labels, 6 labels or 10 labels, etc.). The longer the forwarding path, the longer (deeper) the label stack will be. When the length of the label stack exceeds the label stack capability of the network node, the network node will not be able to correctly process the message containing the label stack.
本申请实施例提供一种报文发送的方法,包括:第一网络节点确定用于转发报文的第一转发路径不可用;响应于确定第一转发路径不可用,第一网络节点确定用于转发报文的第二转发路径;第一网络节点在报文中添加对应第二转发路径的标签栈,标签栈包括第二网络节点的节点标签,且标签栈不包括第一网络节点与第二网络节点之间的链路的链路标签,或标签栈不包括第一网络节点与第二网络节点之间的节点的节点标签,第一网络节点与第二网络节点之间的最短路径不包括第一转发路径,第二网络节点为第二转发路径上的节点;第一网络节点发送添加了标签栈的报文。An embodiment of the present application provides a method for sending a message, including: the first network node determines that the first forwarding path used to forward the message is unavailable; in response to determining that the first forwarding path is unavailable, the first network node determines the Forwarding the second forwarding path of the message; the first network node adds a label stack corresponding to the second forwarding path in the message, the label stack includes the node label of the second network node, and the label stack does not include the first network node and the second forwarding path The link label of the link between the network nodes, or the label stack does not include the node label of the node between the first network node and the second network node, and the shortest path between the first network node and the second network node does not include In the first forwarding path, the second network node is a node on the second forwarding path; the first network node sends a packet with a label stack added.
基于本申请实施例提供的方法,可以根据标签栈中第二网络节点的节点标签将报文转发至第二网络节点,无需在标签栈中添加第一网络节点至第二网络节点之间的一个或多个链路标签或节点标签,可以缩短标签栈的长度,在网络设备的标签栈能力不变的情况下,可以支持更多的场景(例如可以支持较长的转发路径的场景)。Based on the method provided by the embodiment of the present application, the message can be forwarded to the second network node according to the node label of the second network node in the label stack, without adding a node between the first network node and the second network node in the label stack or multiple link labels or node labels, the length of the label stack can be shortened, and more scenarios can be supported (for example, the scenario of a longer forwarding path can be supported) under the condition that the label stack capability of the network device remains unchanged.
本申请实施例图3中的第一网络节点可以由一个设备实现,也可以是一个设备内的一个功能模块,本申请实施例对此不作具体限定。可以理解的是,上述功能既可以是硬件设备中的网络元件,也可以是在专用硬件上运行的软件功能,或者是平台(例如,云平台)上实例化的虚拟化功能,或者是芯片系统。本申请实施例中,芯片系统可以由芯片构成,也可以包含芯片和其他分立器件。The first network node in FIG. 3 of the embodiment of the present application may be implemented by a device, or may be a functional module in a device, which is not specifically limited in the embodiment of the present application. It can be understood that the above functions can be network elements in hardware devices, software functions running on dedicated hardware, or virtualization functions instantiated on platforms (for example, cloud platforms), or chip system . In the embodiment of the present application, the system-on-a-chip may be composed of chips, or may include chips and other discrete devices.
例如,用于实现本申请实施例提供的第一网络节点的功能的装置可以通过图4中的装置400来实现。图4所示为本申请实施例提供的装置400的硬件结构示意图。该装置400中包括至少一个处理器401,用于实现本申请实施例提供的第一网络节点的功能。装置400中还可以包括总线402以及至少一个通信接口404。装置400中还可以包括存储器403。For example, the apparatus for implementing the function of the first network node provided in the embodiment of the present application may be implemented by the
在本申请实施例中,处理器可以是中央处理器(central processing unit,CPU),通用处理器、网络处理器(network processor,NP)、数字信号处理器(digital signalprocessing,DSP)、微处理器、微控制器、可编程逻辑器件(programmable logic device,PLD)或它们的任意组合。处理器还可以是其它任意具有处理功能的装置,例如电路、器件或软件模块。In the embodiment of the present application, the processor may be a central processing unit (central processing unit, CPU), a general purpose processor, a network processor (network processor, NP), a digital signal processor (digital signal processing, DSP), a microprocessor , a microcontroller, a programmable logic device (programmable logic device, PLD), or any combination thereof. The processor may also be any other device with processing functions, such as a circuit, device or software module.
总线402可用于在上述组件之间传送信息。A bus 402 may be used to communicate information between the components described above.
通信接口404,用于与其他设备或通信网络通信,如以太网,无线接入网(radioaccess network,RAN),无线局域网(wireless local area networks,WLAN)等。通信接口404可以是接口、电路、收发器或者其它能够实现通信的装置,本申请不做限制。通信接口404可以和处理器401耦合。本申请实施例中的耦合是装置、单元或模块之间的间接耦合或通信连接,可以是电性,机械或其它的形式,用于装置、单元或模块之间的信息交互。The
在本申请实施例中,存储器可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,也可以与处理器耦合,例如通过总线402。存储器也可以和处理器集成在一起。In the embodiment of the present application, the memory may be a read-only memory (read-only memory, ROM) or other types of static storage devices capable of storing static information and instructions, a random access memory (random access memory, RAM) or a memory capable of storing Other types of dynamic storage devices for information and instructions can also be electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or Other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disc storage medium or other magnetic storage device, or can be used to carry or store desired information in the form of instructions or data structures program code and any other medium that can be accessed by a computer, but is not limited to this. The memory can exist independently or be coupled with the processor, such as through the bus 402 . Memory can also be integrated with the processor.
其中,存储器403用于存储程序指令,并可以由处理器401来控制执行,从而实现本申请下述实施例提供的方法。处理器401用于调用并执行存储器403中存储的指令,从而实现本申请下述实施例提供的方法。Wherein, the
可选的,本申请实施例中的计算机执行指令也可以称之为应用程序代码,本申请实施例对此不作具体限定。Optionally, the computer-executed instructions in the embodiments of the present application may also be referred to as application program codes, which is not specifically limited in the embodiments of the present application.
可选地,存储器403可以包括于处理器401中。Optionally, the
在具体实现中,作为一种实施例,处理器401可以包括一个或多个CPU,例如图4中的CPU0和CPU1。In a specific implementation, as an embodiment, the
在具体实现中,作为一种实施例,装置400可以包括多个处理器,例如图4中的处理器401和处理器405。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the
上述的装置400可以是一个通用设备或者是一个专用设备。在具体实现中,第一网络节点400可以是路由器、支持路由协议的交换设备(交换机)、网桥、网关或有图4中类似结构的设备。本申请实施例不限定装置400的类型。The above-mentioned
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. In order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with basically the same function and effect. Those skilled in the art can understand that words such as "first" and "second" do not limit the number and execution order, and words such as "first" and "second" do not necessarily limit the difference.
为了便于理解,以下结合附图对本申请实施例提供的报文发送的方法进行具体介绍。For ease of understanding, the method for sending a message provided in the embodiment of the present application will be specifically introduced below with reference to the accompanying drawings.
如图5所示,本申请实施例提供一种报文发送的方法,包括:As shown in Figure 5, the embodiment of the present application provides a method for sending a message, including:
501、第一网络节点确定用于转发报文的第一转发路径不可用。501. The first network node determines that a first forwarding path used to forward a packet is unavailable.
其中,第一转发路径不可用包括以下至少一种:第一转发路径的最小链路开销大于等于预设阈值;或者,第一转发路径发生故障;或者,第一转发路径发生拥塞。Wherein, the unavailability of the first forwarding path includes at least one of the following: the minimum link cost of the first forwarding path is greater than or equal to a preset threshold; or, the first forwarding path fails; or, the first forwarding path is congested.
502、响应于确定第一转发路径不可用,第一网络节点确定用于转发报文的第二转发路径。502. In response to determining that the first forwarding path is unavailable, the first network node determines a second forwarding path for forwarding the packet.
示例性的,假设第一转发路径包括第一网络节点与第六网络节点之间的直连链路,当第一网络设备确定第一网络节点与第六网络节点之间的直连链路发生故障后,可以进行故障收敛(简称为收敛)。收敛是指第一网络节点发现链路故障后,根据相关算法(例如,Dijkstra算法)更新自身的路由表或最短路径树(short path tree,SPT),以排除故障链路对后续流量转发过程的影响。收敛后的第一网络节点可以为待转发至第六网络节点的报文重新确定转发路径,即第二转发路径。或者,转发路径也可以称为收敛路径,本申请不做限定。上述待发送至第六网络节点的报文可以是第一网络节点从其他网络节点接收到的报文,也可以是第一网络节点生成的报文,本申请不做限定。Exemplarily, assuming that the first forwarding path includes a direct link between the first network node and the sixth network node, when the first network device determines that the direct link between the first network node and the sixth network node occurs After a fault, fault convergence (abbreviated as convergence) can be performed. Convergence means that after the first network node discovers a link failure, it updates its own routing table or shortest path tree (SPT) according to a related algorithm (for example, Dijkstra algorithm) to eliminate the influence of the faulty link on the subsequent traffic forwarding process. Influence. The converged first network node may redetermine a forwarding path, that is, a second forwarding path, for the message to be forwarded to the sixth network node. Alternatively, the forwarding path may also be called a convergence path, which is not limited in this application. The foregoing message to be sent to the sixth network node may be a message received by the first network node from other network nodes, or may be a message generated by the first network node, which is not limited in this application.
示例性的,如图6所示,假设网络中设置有7个路由器(图6中的R1至R7),每个路由器为一个网络节点,以第一网络节点为RT1,第六网络节点为RT7为例,当RT1确定RT1与RT7之间的直连链路发生故障后,可以重新为待转发至RT7的报文(报文)确定转发路径,即第二转发路径。也就是放弃RT1与RT7之间的直连链路,通过其他网络节点将报文转发至RT7。示例性的,RT1确定的第二转发路径可以为RT1->RT2->RT3->RT4->RT5->RT6->RT7。Exemplarily, as shown in FIG. 6 , it is assumed that there are seven routers (R1 to R7 in FIG. 6 ) in the network, each router is a network node, the first network node is RT1, and the sixth network node is RT7 For example, after RT1 determines that the direct link between RT1 and RT7 fails, it may re-determine a forwarding path for a message (message) to be forwarded to RT7, that is, a second forwarding path. That is, the direct link between RT1 and RT7 is abandoned, and the message is forwarded to RT7 through other network nodes. Exemplarily, the second forwarding path determined by RT1 may be RT1->RT2->RT3->RT4->RT5->RT6->RT7.
另外,第一网络节点确定自身的直连链路以外的链路发生故障后,也可以进行故障收敛,并为第一网络节点上原本需要经过故障链路的报文确定第二转发路径。示例性的,如图6所示,以第一网络节点为RT2,第六网络节点为RT7,故障链路为RT1与RT7之间的链路为例,当RT2确定RT1与RT7之间的直连链路发生故障后,可以重新为待转发至RT7的报文确定转发路径(第二转发路径)。示例性的,第二转发路径可以为RT2->RT3->RT4->RT5->RT6->RT7。In addition, after the first network node determines that a link other than its own direct link fails, it may also perform fault convergence, and determine a second forwarding path for messages on the first network node that originally need to pass through the faulty link. Exemplarily, as shown in FIG. 6, taking the first network node as RT2, the sixth network node as RT7, and the faulty link as the link between RT1 and RT7 as an example, when RT2 determines that the direct link between RT1 and RT7 After a link fails, a forwarding path (second forwarding path) may be re-determined for the message to be forwarded to the RT7. Exemplarily, the second forwarding path may be RT2->RT3->RT4->RT5->RT6->RT7.
503、第一网络节点在报文中添加对应第二转发路径的标签栈。503. The first network node adds a label stack corresponding to the second forwarding path to the packet.
其中,标签栈包括第二网络节点的节点标签,且标签栈不包括第一网络节点与第二网络节点之间的链路的链路标签,或标签栈不包括第一网络节点与第二网络节点之间的节点的节点标签,第一网络节点与第二网络节点之间的最短路径不包括第一转发路径,第二网络节点为第二转发路径上的节点。Wherein, the label stack includes the node label of the second network node, and the label stack does not include the link label of the link between the first network node and the second network node, or the label stack does not include the first network node and the second network node Node labels of nodes between nodes, the shortest path between the first network node and the second network node does not include the first forwarding path, and the second network node is a node on the second forwarding path.
在一种可能的设计中,第二网络节点是M个网络节点中与第一网络节点相隔最远的网络节点,M个网络节点分别位于第二转发路径上,且第一网络节点分别到M个网络节点中的每个网络节点之间的最短路径都不包括第一转发路径,M为大于或等于1的整数。In a possible design, the second network node is the network node farthest from the first network node among the M network nodes, and the M network nodes are respectively located on the second forwarding path, and the first network node goes to M The shortest path between each of the network nodes does not include the first forwarding path, and M is an integer greater than or equal to 1.
由于第一网络节点分别与M个网络节点之间的最短路径不包括第一转发路径,因此该M个网络节点是不受不可用的第一转发路径影响的网络节点。第二网络节点是M个网络节点中与第一网络节点距离最远的网络节点,即第二网络节点是M个网络节点中与第一网络节点相隔网络节点跳数最多的网络节点。Since the shortest paths between the first network node and the M network nodes respectively do not include the first forwarding path, the M network nodes are network nodes not affected by the unavailable first forwarding path. The second network node is the network node farthest from the first network node among the M network nodes, that is, the second network node is the network node separated from the first network node by the largest number of network node hops among the M network nodes.
示例性的,仍如图6所示,以第一网络节点为RT1,第六网络节点为RT7,第一转发路径包括RT1与RT7之间的直连链路为例,M个网络节点可以包括RT2、RT3和RT4。这是由于对于RT2来说,无论RT1到RT7的直连链路是否故障,RT1到RT2的最短路径都不受影响,为RT1->RT2。对于RT3来说,无论RT1到RT7的直连链路是否故障,RT1到RT3的最短路径都不受影响,为RT1->RT2->RT3。对于RT4来说,无论RT1到RT7的直连链路是否故障,RT1到RT4的最短路径都不受影响,为RT1->RT2->RT3->RT4。在RT2、RT3和RT4中,RT4距离RT1最远,即RT4与RT1相隔的网络节点跳数最多,为两跳,因此第二网络节点可以是RT4。Exemplarily, as shown in FIG. 6, taking the first network node as RT1, the sixth network node as RT7, and the first forwarding path including a direct link between RT1 and RT7 as an example, the M network nodes may include RT2, RT3, and RT4. This is because for RT2, no matter whether the direct link from RT1 to RT7 fails, the shortest path from RT1 to RT2 is not affected, which is RT1->RT2. For RT3, no matter whether the direct link from RT1 to RT7 fails, the shortest path from RT1 to RT3 is not affected, which is RT1->RT2->RT3. For RT4, no matter whether the direct link from RT1 to RT7 fails, the shortest path from RT1 to RT4 is not affected, which is RT1->RT2->RT3->RT4. Among RT2, RT3 and RT4, RT4 is the farthest from RT1, that is, the number of network node hops between RT4 and RT1 is the largest, which is two hops, so the second network node may be RT4.
或者,也可以认为M个网络节点包括第一网络节点收敛前的最短路径树中不包括故障链路的边上的全部网络节点,第二网络节点是上述不包括故障链路的边的叶子网络节点。示例性的,如图7所示,为RT1在故障收敛前对应的最短路径树,该最短路径树包括两条边,两条边的根网络节点都为RT1,两条边的叶子网络节点分别为RT4和RT5,由于叶子网络节点为RT4的边不包括故障链路,因此RT1可以确定M个网络节点包括RT2、RT3和RT4,第二网络节点是RT4。Alternatively, it can also be considered that the M network nodes include all network nodes on the edges that do not include the faulty link in the shortest path tree before the convergence of the first network node, and the second network node is the above-mentioned leaf network that does not include the edge of the faulty link node. Exemplarily, as shown in Figure 7, it is the shortest path tree corresponding to RT1 before the fault converges, the shortest path tree includes two edges, the root network node of the two edges is RT1, and the leaf network nodes of the two edges are respectively For RT4 and RT5, since the edge of the leaf network node RT4 does not include a faulty link, RT1 can determine that the M network nodes include RT2, RT3 and RT4, and the second network node is RT4.
第一网络节点确定第二网络节点之后,可以将第二网络节点的节点标签添加至(即压入)标签栈。这样,可以根据第二网络节点的节点标签将报文转发至第二网络节点,而无需在标签栈中压入第一网络节点与第二网络节点之间的一个或多个链路标签或节点标签,从而可以达到缩短标签栈的目的。After the first network node determines the second network node, it may add (that is, push) the node label of the second network node to the label stack. In this way, the message can be forwarded to the second network node according to the node label of the second network node, without pushing one or more link labels or nodes between the first network node and the second network node in the label stack label, so that the purpose of shortening the label stack can be achieved.
进一步的,若第二转发路径在第二网络节点之后还包括其他网络节点,第一网络节点可以从第二网络节点开始逐跳探测,确定标签栈是否需要包括其他链路标签或节点标签。Further, if the second forwarding path includes other network nodes after the second network node, the first network node may start hop-by-hop detection from the second network node to determine whether the label stack needs to include other link labels or node labels.
可选的,若第二转发路径包括第三网络节点,第三网络节点是第二转发路径中第二网络节点的下一跳网络节点,第一网络节点可以确定第二网络节点与第三网络节点之间的最小链路开销是否小于第一网络节点与第三网络节点之间的最小链路开销以及第一网络节点与第二网络节点之间的最小链路开销的和。其中,第二网络节点与第三网络节点之间的最小链路开销是指第二网络节点与第三网络节点之间的直连链路的最小开销,第一网络节点与第三网络节点之间的最小链路开销是指第一网络节点与第三网络节点之间的最短路径所包括的全部链路的开销,第一网络节点与第二网络节点之间的最小链路开销是指第一网络节点与第二网络节点之间的最短路径所包括的全部链路的开销。Optionally, if the second forwarding path includes a third network node, and the third network node is the next-hop network node of the second network node in the second forwarding path, the first network node may determine the connection between the second network node and the third network node. Whether the minimum link cost between nodes is smaller than the sum of the minimum link cost between the first network node and the third network node and the minimum link cost between the first network node and the second network node. Wherein, the minimum link overhead between the second network node and the third network node refers to the minimum overhead of the direct link between the second network node and the third network node, and the minimum link overhead between the first network node and the third network node The minimum link cost between the first network node and the third network node refers to the cost of all links included in the shortest path between the first network node and the second network node, and the minimum link cost between the first network node and the second network node refers to the Costs of all links included in the shortest path between a network node and a second network node.
由于第一网络节点与第二网络节点之间的最小链路开销大于0,因此,第二网络节点与第三网络节点之间的最小链路开销是否小于第一网络节点与第三网络节点之间的最小链路开销以及第一网络节点与第二网络节点之间的最小链路开销的和,可以简化为第二网络节点与第三网络节点之间的最小链路开销是否小于等于第一网络节点与第三网络节点之间的最小链路开销。这样,第一网络节点可以确定第二网络节点与第三网络节点之间的最小链路开销是否小于等于第一网络节点与第三网络节点之间的最小链路开销(或者第一网络节点可以确定第二网络节点与第三网络节点之间的最小链路开销是否大于第一网络节点与第三网络节点之间的最小链路开销),简化了运算过程,节省运算开销。Since the minimum link cost between the first network node and the second network node is greater than 0, whether the minimum link cost between the second network node and the third network node is smaller than that between the first network node and the third network node The sum of the minimum link overhead between the first network node and the second network node can be simplified as whether the minimum link overhead between the second network node and the third network node is less than or equal to the first Minimum link overhead between the network node and the third network node. In this way, the first network node may determine whether the minimum link cost between the second network node and the third network node is less than or equal to the minimum link cost between the first network node and the third network node (or the first network node may Determining whether the minimum link cost between the second network node and the third network node is greater than the minimum link cost between the first network node and the third network node), simplifies the operation process and saves operation cost.
当第二网络节点与第三网络节点之间的最小链路开销小于等于第一网络节点与第三网络节点之间的最小链路开销时,标签栈不包括第二网络节点与第三网络节点之间的链路标签。这是由于当第二网络节点与第三网络节点之间的最小链路开销小于等于第一网络节点与第三网络节点之间的最小链路开销时,第二网络节点与第三网络节点之间的直连链路是第二网络节点与第三网络节点之间的最短路径,第二网络节点可以自主(即根据自身的路径规划)将报文发送至第三网络节点,因此无需在标签栈中添加第二网络节点与第三网络节点之间的链路标签。When the minimum link cost between the second network node and the third network node is less than or equal to the minimum link cost between the first network node and the third network node, the label stack does not include the second network node and the third network node Link labels between. This is because when the minimum link cost between the second network node and the third network node is less than or equal to the minimum link cost between the first network node and the third network node, the connection between the second network node and the third network node The direct link between is the shortest path between the second network node and the third network node, and the second network node can autonomously (that is, according to its own path planning) send the message to the third network node, so there is no need to A link label between the second network node and the third network node is added to the stack.
当第二网络节点与第三网络节点之间的最小链路开销大于第一网络节点与第三网络节点之间的最小链路开销时,标签栈还包括第二网络节点与第三网络节点之间的链路标签。这是由于当第二网络节点与第三网络节点之间的最小链路开销大于第一网络节点与第三网络节点之间的最小链路开销时,第二网络节点与第三网络节点之间的直连链路并非第二网络节点与第三网络节点之间的最短路径,由于第二网络节点可能还未收敛或还未获知网络中的链路发生了故障,因此第二网络节点自主确定的第二网络节点与第三网络节点之间的最短路径可能包括故障链路,导致环路问题。因此需要在标签栈中添加第二网络节点与第三网络节点之间的链路标签,这样,第二网络节点可以根据第二网络节点与第三网络节点之间的链路标签将报文发送至第三网络节点,避免环路问题。When the minimum link cost between the second network node and the third network node is greater than the minimum link cost between the first network node and the third network node, the label stack further includes the link between the second network node and the third network node Link label between. This is because when the minimum link cost between the second network node and the third network node is greater than the minimum link cost between the first network node and the third network node, the connection between the second network node and the third network node The direct link of is not the shortest path between the second network node and the third network node, because the second network node may not have converged or has not learned that the link in the network has failed, so the second network node independently determines The shortest path between the second network node and the third network node may include a faulty link, causing a loop problem. Therefore, it is necessary to add the link label between the second network node and the third network node in the label stack, so that the second network node can send the message according to the link label between the second network node and the third network node to the third network node to avoid loop problems.
示例性的,如图8所示,以第一网络节点为RT1,第二网络节点为RT4,第三网络节点为RT5为例,若RT4与RT5之间的直连链路的链路开销为1000,而RT1与RT5之间的最小链路开销为30(网络收敛前,RT1与RT5之间的最短路径可以是RT1->RT7->RT6->RT5),此时RT4与RT5之间的直连链路并非RT4与RT5之间的最短路径,当报文转发到RT4时,由于RT4可能还未收敛或者还未获知RT1与RT7之间的链路发生故障,因此RT4可能通过RT4->RT3->RT2->RT1->RT7(该转发路径的最小链路开销小于1000)转发报文,这样,在RT3与RT4之间会造成环路,即RT3将报文转发至RT4后,RT4又会将报文转发给RT3。因此需要在标签栈中添加RT4与RT5之间的链路标签,这样,RT4可以根据RT4与RT5之间的链路标签将报文发送至RT5,避免环路问题。Exemplarily, as shown in FIG. 8, taking the first network node as RT1, the second network node as RT4, and the third network node as RT5 as an example, if the link cost of the direct link between RT4 and RT5 is 1000, and the minimum link cost between RT1 and RT5 is 30 (before network convergence, the shortest path between RT1 and RT5 can be RT1->RT7->RT6->RT5), at this time the link between RT4 and RT5 The direct link is not the shortest path between RT4 and RT5. When the packet is forwarded to RT4, because RT4 may not have converged or has not learned that the link between RT1 and RT7 has failed, RT4 may pass RT4-> RT3->RT2->RT1->RT7 (the minimum link cost of the forwarding path is less than 1000) forwards the message, so that a loop will be formed between RT3 and RT4, that is, after RT3 forwards the message to RT4, RT4 The message will be forwarded to RT3 again. Therefore, it is necessary to add the link label between RT4 and RT5 in the label stack, so that RT4 can send the message to RT5 according to the link label between RT4 and RT5, so as to avoid the loop problem.
可选的,若第二转发路径还包括第四网络节点,第四网络节点是第二转发路径中第三网络节点的下一跳网络节点,第一网络节点确定第三网络节点与第四网络节点之间的最小链路开销是否大于第一网络节点与第四网络节点之间的最小链路开销(或者第一网络节点确定第三网络节点与第四网络节点之间的最小链路开销是否小于等于第一网络节点与第四网络节点之间的最小链路开销)。其中,第三网络节点与第四网络节点之间的最小链路开销是指第三网络节点与第四网络节点之间的直连链路的最小开销,第一网络节点与第四网络节点之间的最小链路开销是指第一网络节点与第四网络节点之间的最短路径所包括的全部链路的开销。Optionally, if the second forwarding path further includes a fourth network node, the fourth network node is the next-hop network node of the third network node in the second forwarding path, and the first network node determines the connection between the third network node and the fourth network node. Whether the minimum link cost between nodes is greater than the minimum link cost between the first network node and the fourth network node (or the first network node determines whether the minimum link cost between the third network node and the fourth network node is less than or equal to the minimum link overhead between the first network node and the fourth network node). Wherein, the minimum link overhead between the third network node and the fourth network node refers to the minimum overhead of the direct link between the third network node and the fourth network node, and the minimum link overhead between the first network node and the fourth network node The minimum link cost between the first network node and the fourth network node refers to the cost of all links included in the shortest path between the first network node and the fourth network node.
当第三网络节点与第四网络节点之间的最小链路开销小于等于第一网络节点与第四网络节点之间的最小链路开销时,标签栈不包括第三网络节点与第四网络节点之间的链路标签。当第三网络节点与第四网络节点之间的最小链路开销大于第一网络节点与第四网络节点之间的最小链路开销时,标签栈还包括第三网络节点与第四网络节点之间的链路标签。When the minimum link cost between the third network node and the fourth network node is less than or equal to the minimum link cost between the first network node and the fourth network node, the label stack does not include the third network node and the fourth network node Link labels between. When the minimum link cost between the third network node and the fourth network node is greater than the minimum link cost between the first network node and the fourth network node, the label stack further includes the link between the third network node and the fourth network node Link label between.
可选的,若标签栈不包括第二网络节点与第三网络节点之间的节点标签,但包括第三网络节点与第四网络节点之间的链路标签,标签栈还可以包括第三网络节点的节点标签。这是由于第二网络节点可能无法识别第三网络节点与第四网络节点之间的链路标签,当报文转发至第二网络节点时,第二网络节点无法根据第三网络节点与第四网络节点之间的链路标签确定如何发送报文。因此需要在标签栈中添加第三网络节点的节点标签,以便第二网络节点将报文发送给第三网络节点,由第三网络节点根据第三网络节点与第四网络节点之间的链路标签将报文转发给第四网络节点。Optionally, if the label stack does not include the node label between the second network node and the third network node, but includes the link label between the third network node and the fourth network node, the label stack may also include the third network node The node label for the node. This is because the second network node may not be able to recognize the link label between the third network node and the fourth network node. When the packet is forwarded to the second network node, the second network node cannot Link labels between network nodes determine how messages are sent. Therefore, it is necessary to add the node label of the third network node in the label stack, so that the second network node can send the message to the third network node, and the third network node can The label forwards the packet to the fourth network node.
可选的,若存在第五网络节点,第五网络节点是第二转发路径中第四网络节点的下一跳网络节点,可以确定标签栈是否包括第四网络节点与第五网络节点之间的链路标签,以此类推,直到探测到第二转发路径中的最后一跳网络节点(例如,第六网络节点)为止。具体过程可以参考上文中的相关描述,在此不做赘述。Optionally, if there is a fifth network node, and the fifth network node is the next-hop network node of the fourth network node in the second forwarding path, it may be determined whether the label stack includes Link labels, and so on, until the last hop network node (for example, the sixth network node) in the second forwarding path is detected. For the specific process, reference may be made to the relevant description above, and details are not repeated here.
下面结合具体场景对标签栈的生成过程进行说明。The following describes the generation process of the label stack in combination with specific scenarios.
在一些实施例中,如图6所示,以第一网络节点为RT1为例,RT1确定第二网络节点为RT4,并可以将RT4的节点标签压入标签栈。而后RT1可以从RT4开始逐跳探测,确定RT4与RT5之间的最小链路开销是否满足公式(1):In some embodiments, as shown in FIG. 6 , taking the first network node as RT1 as an example, RT1 determines that the second network node is RT4, and may push the node label of RT4 into the label stack. Then RT1 can start hop-by-hop detection from RT4 to determine whether the minimum link overhead between RT4 and RT5 satisfies formula (1):
RT4->RT5(cost)<RT4->RT1(cost)+RT1->RT5(cost)(1)RT4->RT5(cost)<RT4->RT1(cost)+RT1->RT5(cost)(1)
其中,RT4->RT5(cost)表示RT4与RT5之间的最小链路开销,即RT4与RT5之间的直连链路的最小开销,该直连链路的最小链路开销可以是RT1基于收敛前的路由信息确定的;RT4->RT1(cost)表示RT4与RT1之间的最小链路开销,即RT4与RT1之间的最短路径包括的链路的开销,且RT4与RT1之间的最小链路开销是RT1基于收敛前的路由信息确定的;RT1->RT5(cost)表示RT1与RT5之间的最小链路开销,即RT1与RT5之间的最短路径包括的链路的开销;且该RT1与RT5之间的最小链路开销是RT1基于收敛前的路由信息确定的。Among them, RT4->RT5(cost) represents the minimum link cost between RT4 and RT5, that is, the minimum cost of the direct link between RT4 and RT5, the minimum link cost of the direct link can be based on RT1 The routing information before convergence is determined; RT4->RT1(cost) indicates the minimum link cost between RT4 and RT1, that is, the cost of the link included in the shortest path between RT4 and RT1, and the cost between RT4 and RT1 The minimum link cost is determined by RT1 based on the routing information before convergence; RT1->RT5(cost) indicates the minimum link cost between RT1 and RT5, that is, the cost of the links included in the shortest path between RT1 and RT5; And the minimum link cost between RT1 and RT5 is determined by RT1 based on routing information before convergence.
由于公式(1)中RT4->RT1(cost)大于0,因此公式(1)可以简化公式(2):Since RT4->RT1(cost) in formula (1) is greater than 0, formula (1) can simplify formula (2):
RT4->RT5(cost)<=RT1->RT5(cost) (2)RT4->RT5(cost)<=RT1->RT5(cost) (2)
若满足公式(2),标签栈中不压入RT4与RT5之间的链路标签。若不满足公式(2),标签栈中压入RT4与RT5之间的链路标签。If formula (2) is satisfied, no link label between RT4 and RT5 is pushed into the label stack. If formula (2) is not satisfied, the link label between RT4 and RT5 is pushed into the label stack.
如图6所示,RT4与RT5之间的最小链路开销是10,RT1根据收敛前的路径信息确定RT1到RT5之间的最短路径是RT1->RT7->RT6->RT5,即RT1到RT5之间的最小链路开销包括RT1与RT7之间的直连链路的最小开销、RT7与RT6之间的直连链路的最小开销以及RT6与RT5之间的直连链路的最小开销,即RT1到RT5之间的最小链路开销是10+10+10=30,10<=30,满足公式(2),因此RT4与RT5之间的链路标签可以不压入标签栈。As shown in Figure 6, the minimum link cost between RT4 and RT5 is 10, and RT1 determines that the shortest path between RT1 and RT5 is RT1->RT7->RT6->RT5 according to the path information before convergence, that is, RT1 to RT5 The minimum link overhead between RT5 includes the minimum overhead of the direct link between RT1 and RT7, the minimum overhead of the direct link between RT7 and RT6, and the minimum overhead of the direct link between RT6 and RT5 , that is, the minimum link overhead between RT1 and RT5 is 10+10+10=30, 10<=30, which satisfies the formula (2), so the link label between RT4 and RT5 may not be pushed into the label stack.
而后,RT1可以继续探测RT5到RT6,确定是否满足RT5->RT6(cost)<=RT1->RT6(cost),由于10<=20,因此标签栈中可以不压入RT5与RT6之间的链路标签。RT1继续探测RT6到RT7,确定是否满足RT6->RT7(cost)<=RT1->RT7(cost),由于10<=10,因此标签栈中不压入RT6与RT7之间的链路标签。最终,标签栈中只需要压入RT4的节点标签,相比现有技术,标签中需要包括{1001,1002,1003,1004,1005}等五层链路标签,本申请实施例中,标签栈中仅需要一层节点标签,大大缩短了标签栈的长度。Then, RT1 can continue to detect RT5 to RT6 to determine whether RT5->RT6(cost)<=RT1->RT6(cost), because 10<=20, so the label stack can not be pushed into between RT5 and RT6 link label. RT1 continues to detect RT6 to RT7 to determine whether RT6->RT7(cost)<=RT1->RT7(cost). Since 10<=10, the link label between RT6 and RT7 is not pushed into the label stack. Finally, only the node labels of RT4 need to be pushed into the label stack. Compared with the existing technology, the labels need to include five-layer link labels such as {1001, 1002, 1003, 1004, 1005}. In the embodiment of this application, the label stack Only one layer of node labels is needed in the network, which greatly shortens the length of the label stack.
如图8所示,以第一网络节点为RT1为例,RT1确定第二网络节点为RT4,并可以将RT4的节点标签压入标签栈。而后RT1可以探测RT4到RT5,确定是否满足RT4->RT5(cost)<=RT1->RT5(cost);由于RT4->RT5(cost)是1000,RT1->RT5(cost)是30,不满足RT4->RT5(cost)<=RT1->RT5(cost);因此标签栈中压入RT4与RT5之间的链路标签。而后,RT1可以继续探测RT5到RT6,确定是否满足RT5->RT6(cost)<=RT1->RT6(cost),由于10<=20,因此标签栈中不压入RT5与RT6之间的链路标签。继续探测RT6到RT7,确定是否满足RT6->RT7(cost)<=RT1->RT7(cost),由于10<=10,因此标签栈中不压入RT6与RT7之间的链路标签。最终,标签栈中需要压入RT4的节点标签以及RT4与RT5之间的链路标签,相比现有技术,标签中需要包括{1001,1002,1003,1004,1005}等五层链路标签,本申请实施例中,标签栈中仅需要两层标签(一层节点标签和一层链路标签),缩短了标签栈的长度。As shown in FIG. 8 , taking the first network node as RT1 as an example, RT1 determines that the second network node is RT4, and may push the node label of RT4 into the label stack. Then RT1 can detect RT4 to RT5 to determine whether RT4->RT5(cost)<=RT1->RT5(cost); since RT4->RT5(cost) is 1000, RT1->RT5(cost) is 30, no RT4->RT5(cost)<=RT1->RT5(cost); therefore, the link label between RT4 and RT5 is pushed into the label stack. Then, RT1 can continue to detect RT5 to RT6 to determine whether RT5->RT6(cost)<=RT1->RT6(cost), since 10<=20, the link between RT5 and RT6 is not pushed into the label stack road label. Continue to detect RT6 to RT7 to determine whether RT6->RT7(cost)<=RT1->RT7(cost), since 10<=10, the link label between RT6 and RT7 is not pushed into the label stack. Finally, the node label of RT4 and the link label between RT4 and RT5 need to be pushed into the label stack. Compared with the existing technology, the label needs to include five layers of link labels such as {1001, 1002, 1003, 1004, 1005} , in the embodiment of the present application, only two layers of labels (one layer of node labels and one layer of link labels) are required in the label stack, which shortens the length of the label stack.
在另一种可能的设计中,如图9所示,以第一网络节点为RT1为例,RT1可以先生成第二转发路径的完整标签栈,该完整标签栈包括第二转发路径中每条链路的链路标签。例如,该完整标签栈可以包括{1001,1002,1003,1004,1005};其中,1001是RT2和RT3之间的链路标签,1002是RT3和RT4之间的链路标签,1003是RT4和RT5之间的链路标签,1004是RT5和RT6之间的链路标签,1005是RT6和RT7之间的链路标签。In another possible design, as shown in Figure 9, taking the first network node as RT1 as an example, RT1 can first generate a complete label stack of the second forwarding path, and the complete label stack includes each The link label for the link. For example, the complete label stack may include {1001, 1002, 1003, 1004, 1005}; where 1001 is the link label between RT2 and RT3, 1002 is the link label between RT3 and RT4, and 1003 is the link label between RT4 and RT4. The link label between RT5, 1004 is the link label between RT5 and RT6, and 1005 is the link label between RT6 and RT7.
RT1确定第二网络节点为RT4后,可以将RT1至RT4之间的链路标签替换为RT4的节点标签。例如,可以将标签栈中的1001和1002替换为4000,其中,4000是RT4的节点标签。After RT1 determines that the second network node is RT4, the link label between RT1 and RT4 may be replaced with the node label of RT4. For example, 1001 and 1002 in the label stack can be replaced with 4000, where 4000 is the node label of RT4.
相比现有技术的标签栈需要包括转发路径中每个链路的链路标签,本申请通过采用节点标签替代链路标签的方式来压缩标签栈,使得标签栈尽可能短,在网络设备的标签栈能力不变的情况下,可以支持更多的场景(例如可以支持较长的转发路径的场景)。Compared with the label stack in the prior art, which needs to include the link label of each link in the forwarding path, this application compresses the label stack by replacing the link label with the node label, so that the label stack is as short as possible, and the Under the condition that the capability of the label stack remains unchanged, more scenarios can be supported (for example, a scenario with a longer forwarding path can be supported).
而后RT1可以探测RT4到RT5,确定是否满足RT4->RT5(cost)<=RT1->RT5(cost);由于10<=30,因此可以从标签栈中删除RT4与RT5之间的链路标签。而后,RT1可以继续探测RT5到RT6,确定是否满足RT5->RT6(cost)<=RT1->RT6(cost),由于10<=20,因此可以从标签栈中删除RT5与RT6之间的链路标签。继续探测RT6到RT7,确定是否满足RT6->RT7(cost)<=RT1->RT7(cost),由于10<=10,因此可以从标签栈中删除RT6与RT7之间的链路标签。最终标签栈只包括RT4的节点标签,相比现有技术,标签中需要包括{1001,1002,1003,1004,1005}等五层链路标签,本申请实施例中,标签栈中仅需要一层节点标签,大大缩短了标签栈的长度。Then RT1 can detect RT4 to RT5 to determine whether RT4->RT5(cost)<=RT1->RT5(cost); since 10<=30, the link label between RT4 and RT5 can be deleted from the label stack . Then, RT1 can continue to detect RT5 to RT6 to determine whether RT5->RT6(cost)<=RT1->RT6(cost), since 10<=20, the link between RT5 and RT6 can be deleted from the label stack road label. Continue to detect RT6 to RT7 to determine whether RT6->RT7(cost)<=RT1->RT7(cost), since 10<=10, the link label between RT6 and RT7 can be deleted from the label stack. The final label stack only includes RT4 node labels. Compared with the existing technology, the labels need to include five-layer link labels such as {1001, 1002, 1003, 1004, 1005}. In the embodiment of this application, only one Layer node labels greatly shorten the length of the label stack.
504、第一网络节点发送添加了标签栈的报文。504. The first network node sends the packet to which the label stack is added.
第一网络节点向第二转发路径中第一网络节点的下一跳网络节点发送报文。该报文携带标签栈,该标签栈即第二转发路径对应的标签栈。The first network node sends the packet to the next-hop network node of the first network node in the second forwarding path. The message carries a label stack, and the label stack is the label stack corresponding to the second forwarding path.
示例性的,如图6所示,以第一网络节点为RT1为例,RT1可以向第二转发路径中RT1的下一跳网络节点(即RT2)发送报文,报文携带标签栈{4000},4000是第二网络节点(RT4)的节点标签。Exemplarily, as shown in FIG. 6, taking the first network node as RT1 as an example, RT1 may send a message to the next-hop network node (ie, RT2) of RT1 in the second forwarding path, and the message carries a label stack {4000 }, 4000 is the node label of the second network node (RT4).
RT2接收到报文后,根据标签栈中的节点标签4000确定需要将报文转发至节点标签4000对应的网络节点(即RT4),根据自身的最短路径树,或者通过查找路由表,RT2可以确定下一跳网络节点为RT3,然后向RT3发送报文。After receiving the message, RT2 determines according to the
类似的,RT3接收到报文后,根据标签栈中的节点标签4000确定需要将报文转发至节点标签4000对应的网络节点(即RT4),根据自身的最短路径树,RT3可以确定下一跳网络节点为RT4,然后向RT4发送报文。Similarly, after RT3 receives the message, it determines according to the
RT4接收到报文后,删除(弹出)节点标签4000,并识别出报文的目的地址(第六网络节点,即RT7),RT4可以根据自身的最短路径树,确定下一跳网络节点为RT5,然后向RT5发送报文。可选的,报文的目的地址可以封装在网络协议(Internet Protocol,IP)层,标签栈可以封装在多协议标签交换(multiprotocol label switching,MPLS)层,当删除MPLS层中的节点标签后,IP层中的目的地址会露出,从而RT4可以识别出报文的目的地址。After receiving the message, RT4 deletes (pops up) the
RT5接收到报文后,识别出报文的目的地址(RT7),根据自身的最短路径树,RT5可以确定下一跳网络节点为RT6,然后向RT6发送报文。After receiving the message, RT5 recognizes the destination address of the message (RT7), and according to its own shortest path tree, RT5 can determine that the next-hop network node is RT6, and then sends a message to RT6.
RT6接收到报文后,识别出报文的目的地址(RT7),根据自身的最短路径树,RT6可以确定下一跳网络节点为RT7,然后向RT7发送报文,从而RT7可以接收到报文。After receiving the message, RT6 recognizes the destination address of the message (RT7). According to its own shortest path tree, RT6 can determine that the next-hop network node is RT7, and then send the message to RT7, so that RT7 can receive the message .
基于本申请实施例提供的方法,第一网络节点确定用于转发报文的第一转发路径不可用时,可以重新确定用于转发报文的第二转发路径;第一网络节点在报文中添加对应第二转发路径的标签栈,标签栈包括第二网络节点的节点标签,且标签栈不包括第一网络节点与第二网络节点之间的链路的链路标签,或标签栈不包括第一网络节点与第二网络节点之间的节点的节点标签,第一网络节点与第二网络节点之间的最短路径不包括第一转发路径,第二网络节点为第二转发路径上的节点;第一网络节点发送添加了标签栈的报文。这样一来,可以根据标签栈中第二网络节点的节点标签将报文转发至第二网络节点,无需在标签栈中添加第一网络节点至第二网络节点之间的一个或多个链路标签或节点标签,可以缩短标签栈的长度,在网络设备的标签栈能力不变的情况下,可以支持更多的场景(例如可以支持较长的转发路径的场景)。Based on the method provided by the embodiment of the present application, when the first network node determines that the first forwarding path for forwarding the message is unavailable, it can re-determine the second forwarding path for forwarding the message; the first network node adds Corresponding to the label stack of the second forwarding path, the label stack includes the node label of the second network node, and the label stack does not include the link label of the link between the first network node and the second network node, or the label stack does not include the second network node. A node label of a node between a network node and a second network node, the shortest path between the first network node and the second network node does not include the first forwarding path, and the second network node is a node on the second forwarding path; The first network node sends the message to which the label stack is added. In this way, the message can be forwarded to the second network node according to the node label of the second network node in the label stack, without adding one or more links between the first network node and the second network node in the label stack Labels or node labels can shorten the length of the label stack, and can support more scenarios (for example, scenarios that can support a longer forwarding path) under the condition that the label stack capability of the network device remains unchanged.
上述本申请提供的实施例中,从第一网络节点,以及第一网络节点与其他网络节点之间交互的角度对本申请实施例提供的方法进行了介绍。为了实现上述本申请实施例提供的方法中的各功能,第一网络节点可以包括硬件结构和/或软件模块,以硬件结构、软件模块、或硬件结构加软件模块的形式来实现上述各功能。上述各功能中的某个功能以硬件结构、软件模块、还是硬件结构加软件模块的方式来执行,取决于技术方案的特定应用和设计约束条件。In the above embodiments provided in the present application, the methods provided in the embodiments of the present application are introduced from the perspective of the first network node and the interaction between the first network node and other network nodes. In order to implement the functions in the method provided by the above embodiments of the present application, the first network node may include a hardware structure and/or a software module, and implement the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether one of the above-mentioned functions is executed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.
在采用对应各个功能划分各个功能模块的情况下,图10示出了上述实施例中所涉及的装置的一种可能的结构示意图,该装置可以为第一网络节点10,第一网络节点10包括:确定单元1001、处理单元1002和发送单元1003。在本申请实施例中,确定单元1001,用于确定用于转发报文的第一转发路径不可用;确定单元1001,还用于响应于确定第一转发路径不可用,确定用于转发报文的第二转发路径;处理单元1002,用于在报文中添加对应第二转发路径的标签栈,标签栈包括第二网络节点的节点标签,且标签栈不包括第一网络节点与第二网络节点之间的链路的链路标签,或标签栈不包括第一网络节点与第二网络节点之间的网络节点的节点标签,第一网络节点与第二网络节点之间的最短路径不包括第一转发路径,第二网络节点为第二转发路径上的网络节点;发送单元1003,用于发送添加了标签栈的报文。In the case of dividing each functional module corresponding to each function, FIG. 10 shows a possible structural diagram of the device involved in the above embodiment. The device may be a
在图5所示的方法实施例中,确定单元1001可以用于支持第一网络节点执行图5中的过程501和502。处理单元1002用于支持第一网络节点执行图5中的过程503。发送单元1003用于支持第一网络节点执行图5中的过程504。In the method embodiment shown in FIG. 5 , the determining
其中,确定单元1001和处理单元1002可以是图4中的处理器401和/或处理器405。发送单元1003可以是图4中的通信接口404。Wherein, the determining
本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,另外,在本申请各个实施例中的各功能模块可以集成在一个处理器中,也可以是单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。示例性地,在本申请实施例中,接收单元和发送单元可以集成至收发单元中。The division of modules in the embodiments of the present application is schematic, and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present application can be integrated into a processing In the controller, it can also be physically present separately, or two or more modules can be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. Exemplarily, in the embodiment of the present application, the receiving unit and the sending unit may be integrated into the transceiver unit.
本申请实施例提供的方法中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、网络设备、用户设备或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机可以存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,数字视频光盘(digital video disc,DVD))、或者半导体介质(例如,固态硬盘(solid state drives,SSD))等。The methods provided in the embodiments of the present application may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, all or part of the processes or functions according to the embodiments of the present invention will be generated. The computer may be a general purpose computer, a special purpose computer, a computer network, network equipment, user equipment or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media. The available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a digital video disc (digital video disc, DVD)), or a semiconductor medium (for example, a solid state drive (solid state drives, SSD) )wait.
显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请的范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Apparently, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the scope of the present application. In this way, if the modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and equivalent technologies, the present application also intends to include these modifications and variations.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010427453.8ACN113691446B (en) | 2020-05-19 | 2020-05-19 | Method and device for sending message |
| PCT/CN2021/093168WO2021233168A1 (en) | 2020-05-19 | 2021-05-11 | Method and device for sending packet |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010427453.8ACN113691446B (en) | 2020-05-19 | 2020-05-19 | Method and device for sending message |
| Publication Number | Publication Date |
|---|---|
| CN113691446A CN113691446A (en) | 2021-11-23 |
| CN113691446Btrue CN113691446B (en) | 2023-02-10 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202010427453.8AActiveCN113691446B (en) | 2020-05-19 | 2020-05-19 | Method and device for sending message |
| Country | Link |
|---|---|
| CN (1) | CN113691446B (en) |
| WO (1) | WO2021233168A1 (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110324242A (en)* | 2018-03-29 | 2019-10-11 | 华为技术有限公司 | Message sending method, network node and system |
| CN110661700A (en)* | 2018-06-30 | 2020-01-07 | 华为技术有限公司 | A method, device and system for processing transmission path failure |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106161246B (en)* | 2016-06-15 | 2019-09-06 | 新华三技术有限公司 | The implementation method and device of alternate routing |
| US10404600B2 (en)* | 2017-09-12 | 2019-09-03 | Google Llc | Mechanism and apparatus for path protection when using compressed segment routing label stacks |
| CN107547371A (en)* | 2017-09-28 | 2018-01-05 | 新华三技术有限公司 | A kind of message forwarding method and device |
| CN109889441B (en)* | 2019-03-21 | 2021-05-14 | 新华三技术有限公司 | Data forwarding method and device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110324242A (en)* | 2018-03-29 | 2019-10-11 | 华为技术有限公司 | Message sending method, network node and system |
| CN110661700A (en)* | 2018-06-30 | 2020-01-07 | 华为技术有限公司 | A method, device and system for processing transmission path failure |
| Title |
|---|
| "R3-192426 - Next-hop Identifier for Packet Forwarding in IAB Networks".《3GPP tsg_ran\wg3_iu》.2019,* |
| Huawei.R3-183190 "Destination Address and Forwarding Path based Routing for IAB".《3GPP tsg_ran\WG3_Iu》.2018,* |
| Publication number | Publication date |
|---|---|
| WO2021233168A1 (en) | 2021-11-25 |
| CN113691446A (en) | 2021-11-23 |
| Publication | Publication Date | Title |
|---|---|---|
| JP7389838B2 (en) | Interior gateway protocol flooding minimization | |
| US11032197B2 (en) | Reroute detection in segment routing data plane | |
| CN108337157B (en) | A method and node for transmitting messages in a network | |
| US9998368B2 (en) | Zone routing system | |
| US7957306B2 (en) | Providing reachability information in a routing domain of an external destination address in a data communications network | |
| CN114531395B (en) | Method, device and system for advertising processing capability of network device | |
| JP7479489B2 (en) | Packet transmission method, device, and system | |
| WO2021174985A1 (en) | Sr policy issuing method and apparatus and sr policy receiving method and apparatus | |
| WO2020135395A1 (en) | Notification method and device for prefix identifier of cross-interior gateway protocol | |
| CN112702263B (en) | Methods and devices for forwarding messages | |
| WO2021057530A1 (en) | Method, apparatus and system for determining mapping relationship between routing prefix and segment identification | |
| CN113366804A (en) | Method and system for preventing micro-loops during network topology changes | |
| EP3811575B1 (en) | Area abstraction extensions to routing protocols | |
| WO2023098703A1 (en) | Path notification method, topology algorithm combination generation method, path calculation method, data transmission method, electronic device, and computer-readable storage medium | |
| WO2017162202A1 (en) | Link state information processing | |
| US7496644B2 (en) | Method and apparatus for managing a network component change | |
| WO2015120602A1 (en) | Network path computation method, apparatus and system | |
| CN111224870A (en) | Fault repairing method, equipment and storage medium in SR-MPLS Anycast scene | |
| CN113691446B (en) | Method and device for sending message | |
| CN118923097A (en) | Fat tree based network failure recovery | |
| CN114041279B (en) | Systems and methods for abstracting IGP partitions | |
| CN115225562A (en) | Routing update method, device and system | |
| CN115208829A (en) | Message processing method and network equipment | |
| CN114629834B (en) | Communication method and device | |
| CN116648885B (en) | Routing transmission method and device |
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |