CN109257279B - Message forwarding method and device - Google Patents

Message forwarding method and device Download PDF

Info

Publication number
CN109257279B
CN109257279B CN201811258276.4A CN201811258276A CN109257279B CN 109257279 B CN109257279 B CN 109257279B CN 201811258276 A CN201811258276 A CN 201811258276A CN 109257279 B CN109257279 B CN 109257279B
Authority
CN
China
Prior art keywords
node
message
destination address
label
srlsp
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811258276.4A
Other languages
Chinese (zh)
Other versions
CN109257279A (en
Inventor
郭威
王伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201811258276.4A priority Critical patent/CN109257279B/en
Publication of CN109257279A publication Critical patent/CN109257279A/en
Application granted granted Critical
Publication of CN109257279B publication Critical patent/CN109257279B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/50Routing or path finding of packets in data switching networks using label swapping, e.g. multi-protocol label switch [MPLS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/50Routing or path finding of packets in data switching networks using label swapping, e.g. multi-protocol label switch [MPLS]
    • H04L45/507Label distribution
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/82Miscellaneous aspects
    • H04L47/825Involving tunnels, e.g. MPLS

Abstract

The embodiment of the application provides a message forwarding method and a message forwarding device, which are applied to a head node and comprise the steps of receiving a message; detecting whether the message information of the message is matched with preset message information; if so, acquiring an idle label from a preset label segment; determining a SID index value corresponding to an idle tag; generating a first SRLSP table item aiming at the destination address of the message according to the SID index value; the first node is a next hop node from the head node to the tail node corresponding to the destination address of the message; sending the SID index value and the destination address of the message to a first node; and forwarding the message according to the first SRLSP table entry. By applying the technical scheme provided by the embodiment of the application, the message does not need to be forwarded, an idle label is not occupied, and label resources in the MPLS SR network are saved.

Description

Message forwarding method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for forwarding a packet.
Background
SR (Segment Routing) adopts a source path selection mechanism, encapsulates in advance, at a head node, a SID (Segment Identifier) that is to pass through an intermediate node and a tail node, and when a packet passes through the intermediate node or the tail node, the intermediate node or the tail node forwards the packet according to the SID of the packet. MPLS SR (Segment Routing with Multi-Protocol Label Switching Segment Routing) refers to forwarding a packet using a Label as an SID when using an SR in an MPLS network.
Taking node a in the MPLS SR network as an example, the flow of forwarding a packet using the SR in the MPLS network includes: the controller assigns node a SID index value. After acquiring the SID index value of the node a, the node a calculates an access Label according to the SID index value and an SRGB (Segment Routing Global Block) of the node a, generates an SRLSP (SR Label Switched path) entry for the node a, and notifies the SID index value to other nodes in the MPLS network. And the other nodes calculate an in-out label and an out-label according to the SID index value and the SRGB of the other nodes, and generate an SRLSP table entry aiming at the node A, wherein the SRLSP table entry comprises the next hop node from the other nodes to the node A. After each node generates an SRLSP table aiming at the node A, when a message sent to the node A is received, the message is forwarded according to the locally generated SRLSP table.
As can be seen from the above, the controller allocates a SID index value to a node, and each node calculates a tag based on the SID index value, where the tag may include an incoming tag and/or an outgoing tag, and occupies a tag resource. However, not all the tags calculated based on the SID index values are used by the nodes to forward the packet, which results in waste of tag resources. Especially, under the condition that the SID index value configured for the node by the controller in the MPLS SR network is more, the wasted label resource is more obvious.
Disclosure of Invention
An object of the present embodiment is to provide a message forwarding method and apparatus, so as to save label resources in an MPLS SR network. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a packet forwarding method, which is applied to a head node in an MPLS SR network, and the method includes:
receiving a message;
detecting whether the message information of the message is matched with preset message information;
if so, acquiring an idle label from a preset label segment;
determining a SID index value corresponding to the idle tag;
generating a first SRLSP table item aiming at the destination address of the message according to the SID index value; the first node included in the first SRLSP table entry is a next-hop node from the head node to a tail node corresponding to a destination address of the packet;
sending the SID index value and the destination address of the message to the first node;
and forwarding the message according to the first SRLSP table entry.
In a second aspect, an embodiment of the present application provides a packet forwarding method, which is applied to a first node in an MPLS SR network, and the method includes:
receiving a SID index value and a first destination address sent by a previous hop node;
generating a first SRLSP table item aiming at the first destination address according to the SID index value; a second node included in the first SRLSP entry, where the second node is a next-hop node from the first node to a tail node corresponding to the first destination address;
and when a message with the destination address as the first destination address is received, forwarding the message according to the first SRLSP table.
In a third aspect, an embodiment of the present application provides a packet forwarding apparatus, which is applied to a head node in an MPLS SR network, where the apparatus includes:
a receiving unit, configured to receive a packet;
the detection unit is used for detecting whether the message information of the message is matched with preset message information;
the acquisition unit is used for acquiring an idle label from a preset label segment under the condition that the detection result of the detection unit is positive;
a determining unit, configured to determine a segment routing identifier SID index value corresponding to the idle label;
a generating unit, configured to generate a first segment of a routing label switching path SRLSP table entry for a destination address of the packet according to the SID index value; the first node included in the first SRLSP table entry is a next-hop node from the head node to a tail node corresponding to a destination address of the packet;
a sending unit, configured to send the SID index value and the destination address of the packet to the first node;
and the forwarding unit is used for forwarding the message according to the first SRLSP table entry.
In a fourth aspect, an embodiment of the present application provides a packet forwarding apparatus, which is applied to a first node in an MPLS SR network, and the apparatus includes:
a receiving unit, configured to receive a SID index value and a first destination address sent by a previous-hop node;
a generating unit, configured to generate a first SRLSP table entry for the first destination address according to the SID index value; a second node included in the first SRLSP entry, where the second node is a next-hop node from the first node to a tail node corresponding to the first destination address;
and the forwarding unit is used for forwarding the message according to the first SRLSP table when receiving the message with the destination address as the first destination address.
In a fifth aspect, embodiments of the present application provide a routing device, including a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: any step of the message forwarding method provided in the first aspect is implemented.
In a sixth aspect, embodiments of the present application provide a routing device, including a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: implementing any step of the message forwarding method provided in the second aspect.
In a seventh aspect, an embodiment of the present application provides a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to: any step of the message forwarding method provided in the first aspect is implemented.
In an eighth aspect, embodiments of the present application provide a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to: implementing any step of the message forwarding method provided in the second aspect.
According to the message forwarding method and device provided by the embodiment of the application, when a head node receives a message and needs to forward the message, the head node occupies an idle label, determines a SID index value corresponding to the idle label, generates a first SRLSP table entry aiming at a destination address of the message according to the SID index value, and further forwards the message according to the first SRLSP table entry. In addition, the head node sends the SID index value and the destination address of the message to the first node, so that the first node generates a second SRLSP table item aiming at the destination address of the message according to the SID index value. And if the message does not need to be forwarded, an idle label does not need to be occupied, a first SRLSP table entry does not need to be generated, and label resources in the MPLS SR network are saved. Of course, it is not necessary for any product or method of the present application to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic diagram of an MPLS SR network according to an embodiment of the present application;
fig. 2 is a first flowchart of a message forwarding method according to an embodiment of the present application;
fig. 3 is a second flowchart of a message forwarding method according to an embodiment of the present application;
fig. 4 is a first schematic structural diagram of a packet forwarding apparatus according to an embodiment of the present application;
fig. 5 is a second schematic structural diagram of a message forwarding apparatus according to an embodiment of the present application;
fig. 6 is a first schematic structural diagram of a routing device according to an embodiment of the present application;
fig. 7 is a second schematic structural diagram of a routing device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
For the sake of understanding, the words appearing in the embodiments of the present application are explained below.
And (3) node: also referred to as SR nodes, are routing devices in an MPLS SR network, i.e., routing devices that have MPLS SR functionality enabled. As in the MPLS SR network shown in fig. 1, both routing devices A, B, C and D turn on the MPLS SR function as nodes in the MPLS SR network.
Nodes in an MPLS SR network may be divided into head nodes, intermediate nodes, and tail nodes. The head node is responsible for adding a label to the message entering the MPLS SR network. The intermediate node is responsible for converting the label in the message and forwarding the message to the tail node. The tail node is responsible for stripping labels in the messages and forwarding the messages to an exit node of a destination network.
SID: in MPLS SR networks are labels.
SRLSP: and the label is used as SID to carry out SR forwarding on the message, and the path through which the message passes is called SRLSP. The SRLSP entry may include an incoming label, an outgoing label, and a next hop node.
SRGB: also called label segment, is used for the global label range of MPLS SR, and the SRGB of each node may be different or the same. The SRGB is determined by a tag segment base value and a tag range, wherein the tag segment base value represents the minimum value of the SRGB tag segment, and the tag range represents the number of tags. At present, the label section reserved for SRGB by MPLS is 16000-24000.
The MPLS SR network shown in fig. 1 is still used as an example for explanation. In fig. 1, the address of the routing device a is 1.1.1.1, the address of the routing device B is 2.2.2.2, the address of the routing device C is 3.3.3.3, and the address of the routing device C is 4.4.4.4. The SRGB for routing devices a-D are shown in table 1.
TABLE 1
Tag segment basis number Extent of label
Routing device A 16000 1000
Routing device B 17000 1000
Routing device C 18000 1000
Routing device D 19000 1000
The controller assigns a SID index value 201 to the routing device D, and assigns a SID index value 201 to the routing device D.
The routing device D calculates, according to the SID index value 201 and the SRGB of the routing device D, that the incoming label is 19000+201 to 19201, and further generates an SRLSP entry 1 for the routing device D, as shown in table 2.
TABLE 2
Destination address Go into label Next hop node Go out label
4.4.4.4 19201 -- --
The routing device D, as a tail node, advertises its SID index value 201 to its neighboring nodes (i.e., routing device C) through IGP (Interior Gateway Protocol).
The routing device C calculates 19000+201 to 19201 and 18000+201 to 18201 according to the SID index value 201, the SRGB of the routing device D, and the SRGB of the routing device C, and then generates an SRLSP entry 2 for the routing device D, as shown in table 3.
TABLE 3
Destination address Go into label Next hop node Go out label
4.4.4.4 18201 Routing device D 19201
Routing device C acts as an intermediate node and advertises the SID index value 201 of routing device D to its neighboring nodes (i.e., routing device B) via IGP.
The routing device B calculates, according to the SID index value 201, the SRGB of the routing device C and the SRGB of the routing device B, that the label is 18000+201 equals 18201, and the incoming label is 17000+201 equals 17201, and then generates an SRLSP table entry 3 for the routing device D, as shown in table 4.
TABLE 4
Destination address Go into label Next hop node Go out label
4.4.4.4 17201 Routing device C 18201
Routing device B acts as an intermediate node and advertises the SID index value 201 for routing device D to its neighboring nodes (i.e., routing device a) via IGP.
The routing device a calculates, according to the SID index value 201, the SRGB of the routing device B and the SRGB of the routing device a, that the entry label is 17000+201 equals 17201, and the entry label is 16000+201 equals 16201, and then generates an SRLSP table entry 4 for the routing device D, as shown in table 5.
TABLE 5
Destination address Go into label Next hop node Go out label
4.4.4.4 16201 Routing device B 17201
After receiving the message with the destination address of the routing device D, the routing devices A-D forward the message according to the SRLSP table entry aiming at the routing device D.
As can be seen from the above, the controller allocates a SID index value to a node, and each node calculates a tag based on the SID index value, where the tag may include an incoming tag and/or an outgoing tag, and occupies a tag resource. However, not all the tags calculated based on the SID index values are used by the nodes to forward the packet, which results in waste of tag resources. Especially, under the condition that the SID index value configured for the node by the controller in the MPLS SR network is more, the wasted label resource is more obvious.
In order to save label resources in an MPLS SR network, the embodiment of the present application provides a message forwarding method. In the method, a head node in an MPLS SR network receives a message; detecting whether the message information of the message is matched with preset message information; if so, acquiring an idle label from a preset label segment; determining a SID index value corresponding to an idle tag; generating a first Segment of Routing Label Switching Path (SRLSP) table entry aiming at a destination address of the message according to the SID index value; the first node is a next hop node from the head node to the tail node corresponding to the destination address of the message; sending the SID index value and the destination address of the message to a first node; and forwarding the message according to the first SRLSP table entry.
Therefore, in the embodiment of the application, if the message does not need to be forwarded, an idle label does not need to be occupied, a first SRLSP table entry does not need to be generated, and label resources in the MPLS SR network are saved.
The present application will be described in detail below with reference to specific examples.
Referring to fig. 2, fig. 2 is a first flowchart illustrating a message forwarding method according to an embodiment of the present application. The message forwarding method is applied to a head node in an MPLS SR network. The head node may be any node in the MPLS SR network. The message forwarding method comprises the following steps.
Step 201, receiving a message.
When the message enters the MPLS SR network, the first node receiving the message can be used as the head node.
Step 202, detecting whether the message information of the message is matched with the preset message information. If yes, go to step 203.
The head node is preset with message information for automatically generating SRLSP table entries, namely preset message information. In one embodiment, the preset message information may include: one or more of a destination IP (Internet Protocol) address, a source IP address, a destination MAC (Media Access Control) address, a source MAC address, a DSCP (Differentiated Services Code Point) value, and an identifier of a VLAN (Virtual Local Area Network).
After the head node receives the message, whether the message information of the received message is matched with the preset message information is detected, namely whether a label is occupied is judged, and an SRLSP table entry is generated. If the message information of the received message matches the preset message information, the head node determines that the message needs to be forwarded by using the SRLSP entry, that is, may occupy one label, generates an SRLSP entry, and continues to execute step 203.
And if the message information of the received message is not matched with the preset message information, the head node processes the message according to the preset message processing operation. For example, the predetermined message processing operation is a forwarding operation, and if the message information of the received message does not match the predetermined message information, the head node directly forwards the received message.
In one embodiment, the predetermined message information includes a plurality of types. When detecting whether the message information of the received message is matched with the preset message information, the head node determines that the message information of the received message is matched with the preset message information if determining that the message information of the received message is one of the preset message information. And if the preset message information does not comprise the message information of the received message, determining that the message information of the received message is not matched with the preset message information.
For example, the IP address for presetting the message information as the destination is IP1The source IP address is IP2Destination MAC address is MAC1. The head node receives the message 1, if the destination IP address of the message 1 is IP1Or the source IP address of message 1 is IP2Or the destination MAC address of message 1 is MAC1Determining that the message information of the message 1 is matched with the preset message information; otherwise, determining that the message information of the message 1 is not matched with the preset message information.
In another embodiment, the predetermined message information includes a plurality of types. When the head node detects whether the message information of the received message is matched with the preset message information, if the message information of the received message is determined to be the same as the preset message information, the message information of the received message is determined to be matched with the preset message information. And if the preset message information contains information different from the message information of the received message, determining that the message information of the received message is not matched with the preset message information.
For example, the IP address for presetting the message information as the destination is IP1The source IP address is IP2Destination MAC address is MAC1. The head node receives the message 1, if the destination IP address of the message 1 is IP1The source IP address of the message 1 is IP2And the destination MAC address of the message 1 is MAC1Then determine message 1Matching the message information with preset message information; otherwise, determining that the message information of the message 1 is not matched with the preset message information.
Step 203, acquiring an idle tag from the preset tag segment.
Wherein, the preset label segment is the SRGB of the head node. The idle label is an unoccupied label in the preset label segment. And the head node acquires the idle label from the preset label segment under the condition of determining that the message information of the received message is matched with the preset message information.
Step 204, determining the SID index value corresponding to the idle tag.
In the MPLS SR network, the label is the sum of the label segment base value and the SID index value. After the head node acquires the idle tag, the head node can determine the SID index value corresponding to the idle tag according to the sum of the tag segment base value and the SID index value.
For example, the free tag is 16201, the tag segment base value of the head node is 16000, and the tag range is 1000,. The head node may determine that the SID index value corresponding to the idle tag is 16201 and 16000 equals 201.
Step 205, according to the SID index value, generating a first SRLSP table entry for the destination address of the packet; the first node is a next hop node from the head node to the tail node corresponding to the destination address of the packet.
In this embodiment, the first node may be an intermediate node or a tail node. If one or more intermediate nodes are included between the head node and the tail node corresponding to the destination address of the message, the first node is the intermediate node. And if no intermediate node is included between the head node and the tail node corresponding to the destination address of the message, the first node is the tail node.
Take the MPLS SR network shown in fig. 1 as an example. If the routing device a receives the message 2 entering the MPLS SR network, the head node is the routing device a. If the destination address of the packet 2 is 4.4.4.4, the tail node corresponding to the destination address 4.4.4.4 is the routing device D. At this time, for the destination address 4.4.4.4, the next hop node from the head node to the tail node is the routing device B, i.e., the first node is the intermediate node.
If the destination address of the packet 2 is 2.2.2.2, the tail node corresponding to the destination address 2.2.2.2 is the routing device B. At this time, for the destination address 2.2.2.2, the next-hop node from the head node to the tail node is the routing device B, i.e., the first node is the tail node.
Taking the destination address of the message 2 as 4.4.4.4 as an example, after receiving the message 2, if the destination address 4.4.4.4 of the message 2 matches with the preset message information, the routing device a acquires an idle label from the preset label segment, for example, the acquired idle label is 16201, and determines that the SID index value corresponding to the idle label 16201 is 201. The routing device a generates an SRLSP entry 11 for the destination address 4.4.4.4 according to the SID index value 201, as shown in table 6.
TABLE 6
Destination address Go into label Next hop node Go out label
4.4.4.4 -- Routing device B 17201
Step 206, the SID index value and the destination address of the packet are sent to the first node.
In order to forward the received packet to the tail node corresponding to the destination address, the head node sends the SID index value and the destination address of the packet to the first node after determining the SID index value corresponding to the idle label. The first node is a next hop node from the head node to the tail node corresponding to the destination address of the packet.
For example, after determining the SID index value corresponding to the idle label, the head node determines, according to the learned route, a node that is the next hop from the head node to the destination address of the packet, that is, the first node. The head node sends the SID index value and the destination address of the message to the first node according to the route forwarding table entry.
In one embodiment, to ensure that the first node generates a correct second SRLSP entry, the head node carries the SID index value and the destination address of the received packet in a preset protocol packet and sends the preset protocol packet to the first node. The preset protocol message carries an automatic generation label. And the first node generates a second SRLSP table item aiming at the destination address of the message according to the SID index value and the automatic generation label. The automatic generation label is used for indicating the first node to generate a second SRLSP table item, the second SRLSP table item comprises a second node, and the second node is a next hop node from the first node to a tail node corresponding to the first destination address. In one example, if the first node is an intermediate node, the second node included in the second SRLSP entry is a tail node or an intermediate node; and if the first node is the tail node, the second node included in the second SRLSP table entry is empty.
The description is still given by way of example in step 205. If the destination address of the packet 2 is 4.4.4.4, the routing device a generates an SRLSP table entry 11 for the destination address 4.4.4, and then carries the SID index value 201 and the destination address 4.4.4 in the preset protocol packet 1 to send to the routing device B. And presetting an automatically generated label a in the protocol message 1. For destination address 4.4.4.4, the next hop node from router B to the tail node is router C. The routing device B generates an SRLSP table entry 12 for the destination address 4.4.4.4 according to the automatically generated label a, the SID index value 201, and the destination address 4.4.4 in the preset protocol packet 1, as shown in table 7.
TABLE 7
Destination address Go into label Next hop node Go out label
4.4.4.4 17201 Routing device C 18201
If the destination address of the packet 2 is 2.2.2.2, the routing device a generates an SRLSP entry 21 for the destination address 2.2.2.2, as shown in table 8.
TABLE 8
Destination address Go into label Next hop node Go out label
2.2.2.2 -- Routing device B 17201
After generating the SRLSP entry 21 for the destination address 2.2.2.2, the routing device a carries the SID index value 201 and the destination address 2.2.2.2 in the preset protocol packet 2 according to the route forwarding entry, and sends the table to the routing device B. The routing device B generates an SRLSP table entry 22 for the destination address 2.2.2.2 according to the automatically generated label a, SID index value 201, and destination address 2.2.2 in the preset protocol packet 2, as shown in table 9.
TABLE 9
Destination address Go into label Next hop node Go out label
2.2.2.2 17201 -- --
In one example, the tags are automatically generated as custom information for the user. The preset protocol packet may be an IGP packet, and the automatically generated label may add a new Prefix-SID-AD (Prefix SID analog to digital conversion) type field in the subltlv of the IGP packet.
In one embodiment, when the first node is an intermediate node, after the first node generates the second SRLSP table entry, the first node sends the SID index value and the destination address of the received packet to the second node. For example, the SID index value and the destination address of the received packet are carried in a predetermined protocol packet and sent to the second node. The operation of the second node for processing the SID index value and the destination address of the received packet may refer to the operation of the first node for processing the SID index value and the destination address of the received packet.
Step 207, forwarding the packet according to the first SRLSP entry.
In the embodiment of the application, a node occupies one label only when needing to forward a message, and an SRLSP table entry is generated. If the message does not need to be forwarded, an idle label is not occupied, and an SRLSP table entry is not generated, so that label resources in the MPLS SR network are effectively saved.
Corresponding to the above embodiment of the packet forwarding method applied to the head node, the embodiment of the present application further provides a packet forwarding method applied to the first node. The first node may be an intermediate node and may be a tail node. Referring to fig. 3, fig. 3 is a second flowchart illustrating a message forwarding method according to an embodiment of the present application. The message forwarding method is applied to a first node in an MPLS SR network and comprises the following steps.
Step 301, receive the SID index value and the first destination address sent by the previous-hop node.
The previous-hop node may be a head node, and may be an intermediate node.
In the embodiment of the application, after a head node receives a message, if it is detected that message information of the message matches preset message information, an idle tag is obtained from a preset tag segment, a SID index value corresponding to the idle tag is determined, and the SID index value and a first destination address of the message are sent to a next hop node from the head node to a tail node corresponding to the first destination address. And the next hop node sends the SID index value and the first destination address to the next hop node from the next hop node to the tail node corresponding to the first destination address until the SID index value and the first destination address are sent to the tail node corresponding to the first destination address. The first node may be any node except the head node on the path from the head node to the tail node.
Step 302, according to the SID index value, generating a first SRLSP entry for a first destination address; the first SRLSP table entry comprises a second node, and the second node is a next hop node from the first node to a tail node corresponding to the first destination address.
In the embodiment of the present application, if the first node is an intermediate node, the second node included in the second SRLSP entry is an intermediate node or a tail node; and if the first node is the tail node, the second node included in the second SRLSP table entry is empty.
Step 303, when receiving the message whose destination address is the first destination address, forwarding the message according to the first SRLSP table entry.
In the embodiment of the application, a node occupies one label only when needing to forward a message, and an SRLSP table entry is generated. If the message does not need to be forwarded, an idle label is not occupied, and an SRLSP table entry is not generated, so that label resources in the MPLS SR network are effectively saved.
In an embodiment of the present application, if the first node is an intermediate node, after receiving the SID index value and the first destination address, the first node sends the SID index value and the first destination address to the second node. For example, after receiving the SID index value and the first destination address, the first node determines a next-hop node from the head node to the first destination address, that is, the second node, according to the learned route. And the first node sends the SID index value and the first destination address to the second node according to the route forwarding table entry.
In one embodiment, to ensure that the second node generates a correct second SRLSP entry, the first node carries the SID index value and the destination address of the received packet in a preset protocol packet and sends the preset protocol packet to the second node. The preset protocol message carries an automatic generation label. And the second node generates a second SRLSP table item aiming at the destination address of the message according to the SID index value and the automatic generation label. The automatic generation label is used for indicating the second node to generate a third SRLSP table entry, the third SRLSP table entry includes a third node, and the third node is a next-hop node from the second node to a tail node corresponding to the first destination address. In one example, if the second node is an intermediate node, the third node included in the third SRLSP entry is an end node or an intermediate node; and if the second node is the tail node, the third node included in the third SRLSP table entry is empty.
Corresponding to the above embodiment of the message forwarding method applied to the head node, the embodiment of the present application further provides a message forwarding apparatus applied to the head node. Referring to fig. 4, fig. 4 is a schematic diagram of a first structure of a packet forwarding apparatus provided in this embodiment, which is applied to a head node in an MPLS SR network, and includes a receiving unit 401, a detecting unit 402, an obtaining unit 403, a determining unit 404, a generating unit 405, a sending unit 406, and a forwarding unit 407;
a receiving unit 401, configured to receive a message;
a detecting unit 402, configured to detect whether message information of a message matches preset message information;
an obtaining unit 403, configured to obtain an idle tag from the preset tag segment if a detection result of the detecting unit is yes;
a determining unit 404, configured to determine a segment routing identifier SID index value corresponding to the idle label;
a generating unit 405, configured to generate a first segment of a routing label switching path SRLSP table entry for a destination address of the packet according to the SID index value; the first node is a next hop node from the head node to the tail node corresponding to the destination address of the message;
a sending unit 406, configured to send the SID index value and the destination address of the packet to the first node;
a forwarding unit 407, configured to forward the packet according to the first SRLSP entry.
Optionally, the sending unit 406 may be specifically configured to:
carrying the SID index value and the destination address of the message in a preset protocol message and sending the preset protocol message to a first node, wherein the preset protocol message carries an automatic generation label, so that the first node generates a second SRLSP table item aiming at the destination address of the message according to the SID index value and the automatic generation label;
the automatic generation label is used for indicating the first node to generate a second SRLSP table entry, the second SRLSP table entry comprises a second node, and the second node is a next hop node from the first node to the tail node.
Optionally, the preset message information may include: one or more of destination IP address, source IP address, destination MAC address, source MAC address, DSCP value, identification of VLAN.
In the embodiment of the application, a node occupies one label only when needing to forward a message, and an SRLSP table entry is generated. If the message does not need to be forwarded, an idle label is not occupied, and an SRLSP table entry is not generated, so that label resources in the MPLS SR network are effectively saved.
Corresponding to the above embodiment of the message forwarding method applied to the first node, the embodiment of the present application further provides a message forwarding apparatus applied to the first node. Referring to fig. 5, fig. 5 is a schematic diagram of a second structure of a packet forwarding apparatus provided in this embodiment, which is applied to a first node in an MPLS SR network, and includes a receiving unit 501, a generating unit 502, and a forwarding unit 503;
a receiving unit 501, configured to receive a SID index value and a first destination address sent by a previous-hop node;
a generating unit 502, configured to generate a first SRLSP table entry for a first destination address according to the SID index value; the second node is a next hop node from the first node to a tail node corresponding to the first destination address;
a forwarding unit 503, configured to forward, when receiving a packet whose destination address is a first destination address, the packet according to the first SRLSP table entry.
Optionally, the apparatus may further include:
and a sending unit (not shown in fig. 5) configured to send the SID index value and the first destination address to the second node if the first node is not the end node corresponding to the first destination address.
Optionally, the sending unit may be specifically configured to:
carrying the SID index value and the first destination address in a preset protocol message and sending the preset protocol message to a second node, wherein the preset protocol message carries an automatic generation label, so that the second node generates a second SRLSP table item aiming at the first destination address according to the SID index value and the automatic generation label;
the automatic generation label is used for indicating the first node to generate a second SRLSP table item; the second SRLSP table entry includes a third node, and the third node is a next hop node from the second node to the tail node corresponding to the first destination address.
In the embodiment of the application, a node occupies one label only when needing to forward a message, and an SRLSP table entry is generated. If the message does not need to be forwarded, an idle label is not occupied, and an SRLSP table entry is not generated, so that label resources in the MPLS SR network are effectively saved.
Corresponding to the above message forwarding method embodiment applied to the head node, an embodiment of the present application further provides a routing device, as shown in fig. 6, including a processor 601 and a machine-readable storage medium 602, where the machine-readable storage medium 602 stores machine-executable instructions that can be executed by the processor 601. Processor 601 is caused by machine executable instructions to implement the message forwarding method described above as applied to the head node. The message forwarding method comprises the following steps:
receiving a message;
detecting whether the message information of the message is matched with preset message information;
if so, acquiring an idle label from a preset label segment;
determining a SID index value corresponding to an idle tag;
generating a first SRLSP table item aiming at the destination address of the message according to the SID index value; the first node is a next hop node from the head node to the tail node corresponding to the destination address of the message;
sending the SID index value and the destination address of the message to a first node;
and forwarding the message according to the first SRLSP table entry.
In the embodiment of the application, a node occupies one label only when needing to forward a message, and an SRLSP table entry is generated. If the message does not need to be forwarded, an idle label is not occupied, and an SRLSP table entry is not generated, so that label resources in the MPLS SR network are effectively saved.
In one embodiment, as shown in fig. 6, the routing device may further include: a communication interface 603 and a communication bus 604; the processor 601, the machine-readable storage medium 602, and the communication interface 603 complete communication with each other through the communication bus 604, and the communication interface 603 is used for communication between the routing device and other devices.
Corresponding to the above message forwarding method embodiment applied to the first node, an embodiment of the present application further provides a routing device, as shown in fig. 7, including a processor 701 and a machine-readable storage medium 702, where the machine-readable storage medium 702 stores a machine-executable instruction that can be executed by the processor 701. The processor 701 is caused by machine executable instructions to implement the message forwarding method described above as applied to the first node. The message forwarding method comprises the following steps:
receiving a SID index value and a first destination address sent by a previous hop node;
generating a first SRLSP table item aiming at the first destination address according to the SID index value; the second node is a next hop node from the first node to a tail node corresponding to the first destination address;
and when receiving a message with a first destination address as a destination address, forwarding the message according to the first SRLSP table.
In the embodiment of the application, a node occupies one label only when needing to forward a message, and an SRLSP table entry is generated. If the message does not need to be forwarded, an idle label is not occupied, and an SRLSP table entry is not generated, so that label resources in the MPLS SR network are effectively saved.
In one embodiment, as shown in fig. 7, the routing device may further include: a communication interface 703 and a communication bus 704; the processor 701, the machine-readable storage medium 702, and the communication interface 703 complete communication with each other through the communication bus 704, and the communication interface 703 is used for communication between the routing device and other devices.
Corresponding to the above embodiment of the packet forwarding method applied to the head node, an embodiment of the present application further provides a machine-readable storage medium, in which machine-executable instructions are stored, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the above packet forwarding method applied to the head node. The message forwarding method comprises the following steps:
receiving a message;
detecting whether the message information of the message is matched with preset message information;
if so, acquiring an idle label from a preset label segment;
determining a SID index value corresponding to an idle tag;
generating a first SRLSP table item aiming at the destination address of the message according to the SID index value; the first node is a next hop node from the head node to the tail node corresponding to the destination address of the message;
sending the SID index value and the destination address of the message to a first node;
and forwarding the message according to the first SRLSP table entry.
In the embodiment of the application, a node occupies one label only when needing to forward a message, and an SRLSP table entry is generated. If the message does not need to be forwarded, an idle label is not occupied, and an SRLSP table entry is not generated, so that label resources in the MPLS SR network are effectively saved.
Corresponding to the above embodiment of the message forwarding method applied to the first node, an embodiment of the present application further provides a machine-readable storage medium, in which machine-executable instructions are stored, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the above message forwarding method applied to the first node. The message forwarding method comprises the following steps:
receiving a SID index value and a first destination address sent by a previous hop node;
generating a first SRLSP table item aiming at the first destination address according to the SID index value; the second node is a next hop node from the first node to a tail node corresponding to the first destination address;
and when receiving a message with a first destination address as a destination address, forwarding the message according to the first SRLSP table.
In the embodiment of the application, a node occupies one label only when needing to forward a message, and an SRLSP table entry is generated. If the message does not need to be forwarded, an idle label is not occupied, and an SRLSP table entry is not generated, so that label resources in the MPLS SR network are effectively saved.
The communication bus may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in fig. 6 and 7, but this does not indicate only one bus or one type of bus.
The machine-readable storage medium may include a RAM (Random Access Memory) and a NVM (Non-Volatile Memory), such as at least one disk Memory. Additionally, the machine-readable storage medium may be at least one memory device located remotely from the aforementioned processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also DSPs (Digital Signal Processing), ASICs (Application Specific Integrated circuits), FPGAs (Field Programmable Gate arrays) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. Especially, for the embodiments of the message forwarding apparatus, the routing device, and the machine-readable storage medium, since they are substantially similar to the embodiments of the message forwarding method, the description is relatively simple, and for relevant points, reference may be made to the partial description of the embodiments of the message forwarding method.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (12)

1. A message forwarding method is applied to a head node in a multi-protocol label switching segment routing MPLS SR network, and the method comprises the following steps:
receiving a message;
detecting whether the message information of the message is matched with preset message information;
if so, acquiring an idle label from a preset label segment;
determining a segment routing identification (SID) index value corresponding to the idle label;
generating a first Segment of Routing Label Switching Path (SRLSP) table entry aiming at the destination address of the message according to the SID index value; the first node included in the first SRLSP table entry is a next-hop node from the head node to a tail node corresponding to a destination address of the packet;
sending the SID index value and the destination address of the message to the first node;
and forwarding the message according to the first SRLSP table entry.
2. The method of claim 1, wherein the step of sending the SID index value and the destination address of the packet to the first node comprises:
carrying the SID index value and the destination address of the message in a preset protocol message and sending the preset protocol message to a first node, wherein the preset protocol message carries an automatic generation label, so that the first node generates a second SRLSP table item aiming at the destination address of the message according to the SID index value and the automatic generation label;
the automatically generated label is used to instruct the first node to generate a second SRLSP entry, where the second SRLSP entry includes a second node, and the second node is a next-hop node from the first node to the tail node.
3. The method according to claim 1 or 2, wherein the preset message information comprises: one or more of a destination network protocol IP address, a source IP address, a destination media access control MAC address, a source MAC address, a Differentiated Services Code Point (DSCP) value, an identification of a Virtual Local Area Network (VLAN).
4. A message forwarding method is applied to a first node in a multi-protocol label switching segment routing MPLS SR network, and the method comprises the following steps:
receiving a segment routing identification (SID) index value and a first destination address sent by a head node; the SID index value is determined by the head node according to the following steps: receiving a message; detecting whether the message information of the message is matched with preset message information; if so, acquiring an idle label from a preset label segment; determining a segment routing identification (SID) index value corresponding to the idle label;
generating a second Segment of Routing Label Switching Path (SRLSP) table entry aiming at the first destination address according to the SID index value; the second SRLSP table entry includes a second node, and the second node is a next-hop node from the first node to a tail node corresponding to the first destination address;
and when a message with the destination address as the first destination address is received, forwarding the message according to the second SRLSP table entry.
5. The method of claim 4, wherein if the first node is not a tail node corresponding to the first destination address, the method further comprises:
and sending the SID index value and the first destination address to the second node.
6. The method of claim 5, wherein the step of sending the SID index value and the first destination address to the second node comprises:
carrying the SID index value and the first destination address in a preset protocol message and sending the preset protocol message to the second node, wherein the preset protocol message carries an automatic generation label, so that the second node generates a second SRLSP table item aiming at the first destination address according to the SID index value and the automatic generation label;
wherein, the automatically generated label is used for indicating the first node to generate a second SRLSP table entry; the second SRLSP table entry includes a third node, and the third node is a next-hop node from the second node to the tail node corresponding to the first destination address.
7. A packet forwarding apparatus, applied to a head node in a MPLS SR network, for multi-protocol label switching segment routing, the apparatus comprising:
a receiving unit, configured to receive a packet;
the detection unit is used for detecting whether the message information of the message is matched with preset message information;
the acquisition unit is used for acquiring an idle label from a preset label segment under the condition that the detection result of the detection unit is positive;
a determining unit, configured to determine a segment routing identifier SID index value corresponding to the idle label;
a generating unit, configured to generate a first segment of a routing label switching path SRLSP table entry for a destination address of the packet according to the SID index value; the first node included in the first SRLSP table entry is a next-hop node from the head node to a tail node corresponding to a destination address of the packet;
a sending unit, configured to send the SID index value and the destination address of the packet to the first node;
and the forwarding unit is used for forwarding the message according to the first SRLSP table entry.
8. The apparatus according to claim 7, wherein the sending unit is specifically configured to:
carrying the SID index value and the destination address of the message in a preset protocol message and sending the preset protocol message to a first node, wherein the preset protocol message carries an automatic generation label, so that the first node generates a second SRLSP table item aiming at the destination address of the message according to the SID index value and the automatic generation label;
the automatically generated label is used to instruct the first node to generate a second SRLSP entry, where the second SRLSP entry includes a second node, and the second node is a next-hop node from the first node to the tail node.
9. The apparatus according to claim 7 or 8, wherein the predetermined message information comprises: one or more of a destination network protocol IP address, a source IP address, a destination media access control MAC address, a source MAC address, a Differentiated Services Code Point (DSCP) value, an identification of a Virtual Local Area Network (VLAN).
10. A packet forwarding apparatus, applied to a first node in a multi-protocol label switching segment routing MPLS SR network, the apparatus comprising:
a receiving unit, configured to receive a segment routing identifier SID index value and a first destination address sent by a head node; the SID index value is determined by the head node according to the following steps: receiving a message; detecting whether the message information of the message is matched with preset message information; if so, acquiring an idle label from a preset label segment; determining a segment routing identification (SID) index value corresponding to the idle label;
a generating unit, configured to generate a second segment of SRLSP table entry for the first destination address according to the SID index value; the second SRLSP table entry includes a second node, and the second node is a next-hop node from the first node to a tail node corresponding to the first destination address;
and the forwarding unit is used for forwarding the message according to the second SRLSP table entry when receiving the message with the destination address as the first destination address.
11. The apparatus of claim 10, further comprising:
a sending unit, configured to send the SID index value and the first destination address to the second node if the first node is not the tail node corresponding to the first destination address.
12. The apparatus according to claim 11, wherein the sending unit is specifically configured to:
carrying the SID index value and the first destination address in a preset protocol message and sending the preset protocol message to the second node, wherein the preset protocol message carries an automatic generation label, so that the second node generates a second SRLSP table item aiming at the first destination address according to the SID index value and the automatic generation label;
wherein, the automatically generated label is used for indicating the first node to generate a second SRLSP table entry; the second SRLSP table entry includes a third node, and the third node is a next-hop node from the second node to the tail node corresponding to the first destination address.
CN201811258276.4A 2018-10-26 2018-10-26 Message forwarding method and device Active CN109257279B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811258276.4A CN109257279B (en) 2018-10-26 2018-10-26 Message forwarding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811258276.4A CN109257279B (en) 2018-10-26 2018-10-26 Message forwarding method and device

Publications (2)

Publication Number Publication Date
CN109257279A CN109257279A (en) 2019-01-22
CN109257279B true CN109257279B (en) 2021-03-26

Family

ID=65046715

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811258276.4A Active CN109257279B (en) 2018-10-26 2018-10-26 Message forwarding method and device

Country Status (1)

Country Link
CN (1) CN109257279B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111490937B (en) * 2019-01-28 2022-03-29 华为技术有限公司 Method, device and system for establishing cross-domain forwarding path
CN112714061A (en) * 2019-10-24 2021-04-27 华为技术有限公司 Routing method and device
CN111884929B (en) * 2020-07-23 2022-02-22 中国联合网络通信集团有限公司 Data forwarding method and router
CN112087387B (en) * 2020-08-14 2022-04-19 烽火通信科技股份有限公司 Network processor and data packet forwarding method
CN112671652B (en) * 2020-11-26 2022-08-30 新华三技术有限公司 Message forwarding method and device
CN113472653B (en) * 2021-05-25 2022-11-18 新华三信息安全技术有限公司 Method and device for detecting path consistency
CN113472658B (en) * 2021-06-29 2022-11-18 新华三信息安全技术有限公司 Message packaging method, message forwarding method and device
CN113691451B (en) * 2021-09-22 2022-08-19 新华三技术有限公司 Segment identifier determination method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103064794A (en) * 2013-02-04 2013-04-24 烽火通信科技股份有限公司 Method for realizing efficient multiple protocol label switching (MPLS) label management
CN104394077A (en) * 2014-12-12 2015-03-04 盛科网络(苏州)有限公司 Label searching method and device based on Hash algorithm
US9509599B2 (en) * 2014-08-04 2016-11-29 Telefonaktiebolaget L M Ericsson (Publ) Self-bootstrapping BFD session over MPLS LSP
CN107547386A (en) * 2017-06-23 2018-01-05 新华三技术有限公司 Message forwarding method and device
CN108702331A (en) * 2016-02-22 2018-10-23 思科技术公司 SR applications section is integrated with service function chain (SFC) header metadata

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103064794A (en) * 2013-02-04 2013-04-24 烽火通信科技股份有限公司 Method for realizing efficient multiple protocol label switching (MPLS) label management
US9509599B2 (en) * 2014-08-04 2016-11-29 Telefonaktiebolaget L M Ericsson (Publ) Self-bootstrapping BFD session over MPLS LSP
CN104394077A (en) * 2014-12-12 2015-03-04 盛科网络(苏州)有限公司 Label searching method and device based on Hash algorithm
CN108702331A (en) * 2016-02-22 2018-10-23 思科技术公司 SR applications section is integrated with service function chain (SFC) header metadata
CN107547386A (en) * 2017-06-23 2018-01-05 新华三技术有限公司 Message forwarding method and device

Also Published As

Publication number Publication date
CN109257279A (en) 2019-01-22

Similar Documents

Publication Publication Date Title
CN109257279B (en) Message forwarding method and device
US10700891B2 (en) Method for implementing service chain, device, and system
CN107566272B (en) Forwarding table establishing method and data forwarding method
US10880203B2 (en) Centralized segment routing dataplane based backup path validation
CN112087386B (en) Message processing method, device and system
US11108662B2 (en) Dynamic switching between edge nodes in autonomous network system
US11805010B2 (en) Signaling IP path tunnels for traffic engineering
CN110661711A (en) Method for generating label forwarding table, message sending method, device and equipment
CN111510386B (en) Method and device for processing message
CN109889441B (en) Data forwarding method and device
US10110487B1 (en) Signaling priority information for encapsulated packets
US20170195203A1 (en) Method, apparatus, and system for implementing packet loss detection
WO2015055058A1 (en) Forwarding entry generation method, forwarding node, and controller
CN109039918B (en) Message sending method and device
US20240106751A1 (en) Method and apparatus for processing detnet data packet
CN109246011B (en) Message forwarding method and device
CN108259293B (en) Message forwarding method and device
US20210281507A1 (en) Parameter notification and obtaining methods and devices, and storage medium
CN109067657B (en) Message processing method and device
CN103986654A (en) LSP generating method and device
CN107896188B (en) Data forwarding method and device
CN108259301B (en) Tunnel online method and device
US7969988B2 (en) Method and independent communications subnet for determining label-switched routes a communications subnet of this type
CN113507414B (en) Message processing method and device
CN111600798B (en) Method and equipment for sending and obtaining assertion message

Legal Events

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