CN108111414B - Label deployment method and device based on segment routing - Google Patents

Label deployment method and device based on segment routing Download PDF

Info

Publication number
CN108111414B
CN108111414B CN201611057919.XA CN201611057919A CN108111414B CN 108111414 B CN108111414 B CN 108111414B CN 201611057919 A CN201611057919 A CN 201611057919A CN 108111414 B CN108111414 B CN 108111414B
Authority
CN
China
Prior art keywords
label
interface
address
message
index
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
CN201611057919.XA
Other languages
Chinese (zh)
Other versions
CN108111414A (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 CN201611057919.XA priority Critical patent/CN108111414B/en
Publication of CN108111414A publication Critical patent/CN108111414A/en
Application granted granted Critical
Publication of CN108111414B publication Critical patent/CN108111414B/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/74Address processing for routing

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a label deployment method and a label deployment device based on segment routing, wherein the method comprises the following steps: determining a reference label of opposite terminal equipment connected with each interface of the network equipment; sending a first mapping relation and a second mapping relation to the network device, wherein the first mapping relation comprises a corresponding relation between the interface and the reference label, and the second mapping relation comprises a corresponding relation between the IP address of other network devices except the network device and the label index of the other network devices; and the network equipment generates a label forwarding table by using the first mapping relation and the second mapping relation, and transmits a message by using the label forwarding table. By the technical scheme, the entire network deployment of the SR can be simplified, the label management is simplified, and the label configuration error is avoided.

Description

Label deployment method and device based on segment routing
Technical Field
The present application relates to the field of communications technologies, and in particular, to a label deployment method and apparatus based on segment routing.
Background
Since SR (Segment Routing) has the advantages of simple control, short convergence time, and the like, the transmission of the packet can be realized by using the SR technology. As shown in fig. 1, is a schematic networking diagram of the SR. Assuming that a forwarding path of a message is device a, device B, device C, device D and device E, a forwarding table entry is configured on device a, a matching option of the forwarding table entry is a destination IP address of the message, an action option of the forwarding table entry is a label 1003, a label 1002, a label 1001 and a label 1000 of device E, which are sequentially encapsulated, and an egress port a1 is used to send the message. Configuring a forwarding table entry on the device B, wherein the matching option of the forwarding table entry is the label 1000 of the device B, the action option of the forwarding table entry is to remove the outermost label of the message, and the egress port B2 is used to send the message. Configuring a forwarding table entry on the device C, wherein the matching option of the forwarding table entry is the label 1001 of the device C, the action option of the forwarding table entry is to remove the outermost label of the message, and the egress port C2 is used to send the message. Configuring a forwarding table entry on the device D, wherein the matching option of the forwarding table entry is the label 1002 of the device D, the action option of the forwarding table entry is to remove the outermost label of the message, and the egress port D2 is used to send the message. Configuring a forwarding table item on the equipment E, wherein a matching option of the forwarding table item is a label 1003 of the equipment E, and an action option of the forwarding table item is to remove an outermost label of the message and process the message.
In summary, when receiving the message, the device a sequentially encapsulates the label 1003, the label 1002, the label 1001, and the label 1000 in the message, and sends the message through the egress port a 1. Device B queries the forwarding table entry through label 1000, removes the outermost label 1000 of the packet, and sends the packet through egress port B2. Device C queries the forwarding table entry through the label 1001, removes the outermost label 1001 of the message, and sends the message through the egress port C2. The device D queries the forwarding table entry through the label 1002, removes the outermost label 1002 of the message, and sends the message through the egress port D2. The device E queries the forwarding entry through the tag 1003, removes the tag 1003 at the outermost layer of the message, and processes the message, for example, forwards the message by using the destination IP address of the message.
In the above manner, tag management is complicated, and it is easy to configure the tag erroneously. For example, for a packet with a destination IP address of IP1, a label 1003 is assigned to device E, a label 1002 is assigned to device D, a label 1001 is assigned to device C, and a label 1000 is assigned to device B. For a packet with a destination IP address of IP2, a label 1007 is assigned to device E, a label 1006 is assigned to device D, a label 1005 is assigned to device C, and a label 1004 is assigned to device B. By analogy, labels need to be redistributed to each device for messages with different destination IP addresses, and label management is complex. Moreover, if the label 1002 is allocated to the device E for the packet whose destination IP address is IP2, the label configuration is wrong because the label is the same as the label allocated to the device D, which further affects the packet transmission process, and causes the packet transmission failure.
Disclosure of Invention
The application provides a label deployment method based on segment routing, which is applied to a controller and comprises the following steps:
determining a reference label of opposite terminal equipment connected with each interface of the network equipment;
sending a first mapping relation and a second mapping relation to the network device, wherein the first mapping relation comprises a corresponding relation between the interface and the reference label, and the second mapping relation comprises a corresponding relation between the IP address of other network devices except the network device and the label index of the other network devices;
and the network equipment generates a label forwarding table by using the first mapping relation and the second mapping relation and transmits a message by using the label forwarding table.
The application provides a label deployment method based on segment routing, which is applied to network equipment and comprises the following steps:
receiving a first mapping relation and a second mapping relation from a controller; the first mapping relation comprises a corresponding relation between an interface of the device and a reference label of opposite-end equipment connected with the interface; the second mapping relation comprises the corresponding relation between the IP addresses of other network equipment except the equipment and the label indexes of the other network equipment;
for each IP address included in the second mapping relation, determining an interface matched with the IP address from the first mapping relation;
inquiring a label index corresponding to the IP address from the second mapping relation, inquiring a reference label corresponding to the interface from the first mapping relation, and generating a label forwarding table by using the label index and the reference label;
and transmitting the message by utilizing the label forwarding table.
The application provides a label deployment device based on section route is applied to the controller, includes:
a determining module, configured to determine, for each interface of a network device, a reference tag of an opposite-end device connected to the interface;
a sending module, configured to send a first mapping relationship and a second mapping relationship to the network device, where the first mapping relationship includes a correspondence between the interface and the reference tag, and the second mapping relationship includes a correspondence between IP addresses of other network devices except the network device and tag indexes of the other network devices; and the network equipment generates a label forwarding table by using the first mapping relation and the second mapping relation and transmits a message by using the label forwarding table.
The application provides a label deployment device based on section route, is applied to network equipment, includes:
the receiving module is used for receiving the first mapping relation and the second mapping relation from the controller; the first mapping relation comprises a corresponding relation between an interface of the device and a reference label of opposite-end equipment connected with the interface; the second mapping relation comprises the corresponding relation between the IP addresses of other network equipment except the equipment and the label indexes of the other network equipment;
a determining module, configured to determine, for each IP address included in the second mapping relationship, an interface matching the IP address from the first mapping relationship;
a generating module, configured to query a label index corresponding to the IP address from the second mapping relationship, query a reference label corresponding to the interface from the first mapping relationship, and generate a label forwarding table by using the label index and the reference label;
and the sending module is used for transmitting the message by utilizing the label forwarding table.
Based on the technical scheme, in the embodiment of the application, the controller sends and receives the reference label and the label index on the network equipment, the network equipment generates the global label forwarding table by using the reference label and the label index, and the label forwarding table is used for transmitting the messages of all the destination IP addresses without independently distributing labels for the messages of each destination IP address, so that the whole network deployment of the SR is simplified, the label management is simplified, and the label configuration error is avoided.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments of the present application or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1 is a networking schematic of a SR;
FIG. 2 is a flow chart of a label deployment method based on segment routing according to an embodiment of the present application;
fig. 3 is a flowchart of a label deployment method based on segment routing according to another embodiment of the present application;
FIG. 4 is a schematic diagram of an application scenario in an embodiment of the present application;
FIG. 5 is a hardware block diagram of a controller in one embodiment of the present application;
FIG. 6 is a block diagram of a segment routing based tag deployment apparatus in one embodiment of the present application;
FIG. 7 is a diagram of a hardware configuration of a network device in one embodiment of the present application;
fig. 8 is a block diagram of a label deployment device based on segment routing according to an embodiment of the present application.
Detailed Description
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein is meant to encompass any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. Depending on the context, moreover, the word "if" as used may be interpreted as "at … …" or "when … …" or "in response to a determination".
Referring to fig. 2, a flowchart of a label deployment method based on segment routing proposed in the embodiment of the present application is shown, where the method may be applied to a controller, and the method may include the following steps:
step 201, for each interface of the network device, determining a reference label of the opposite terminal device connected to the interface.
In one example, the process for determining the reference label of the peer device connected to the interface may include, but is not limited to, the following: the controller obtains the label segment space supported by each network device, and determines the reference label of each network device from the label segment space supported by each network device. The controller traverses the reference labels of the opposite terminal equipment connected with the interface from the reference labels of all the network equipment.
In the process of "the controller acquires the label segment space supported by each network device", the controller may send a label space request message to each network device, receive a label space response message returned by each network device, and parse the label segment space supported by the network device from the label space response message.
In the process of determining the reference label of each network device from the label segment space supported by each network device by the controller, the label segment space supported by the network device may be a label segment containing a plurality of continuous labels, such as [10000,19999], and the controller may determine the first label (such as 10000) in the label segment space supported by the network device as the reference label of the network device. Of course, the controller may also determine any one of the tags in the tag segment space as the reference tag, which is not limited thereto.
In the process of "the controller traverses the reference label of the peer device connected to the interface from the reference labels of all the network devices", because the peer device connected to the interface is one of all the network devices, the controller may traverse the peer device connected to the interface from all the network devices, and then may determine the reference label of the peer device connected to the interface.
Step 202, sending the first mapping relationship and the second mapping relationship to the network device, so that the network device generates a label forwarding table by using the first mapping relationship and the second mapping relationship, and transmits a packet by using the label forwarding table. The first mapping relationship may include a correspondence between the interface and the reference label (i.e., a reference label of a peer device connected to the interface), and the second mapping relationship may include a correspondence between IP addresses of other network devices except the network device and label indexes of the other network devices.
In an example, after determining a reference label of a peer device connected to the interface, the controller may obtain a first mapping relationship, where the first mapping relationship includes a correspondence relationship between the interface and the reference label.
In one example, before the controller sends the first mapping relationship and the second mapping relationship to the network devices, the controller may further assign a unique tag index to each network device, and record a correspondence between an IP address of each network device and the tag index of the network device. Based on this, the controller may obtain the second mapping relationship by using a correspondence between the IP address of each network device and the tag index.
Based on the technical scheme, in the embodiment of the application, the controller sends and receives the reference label and the label index on the network equipment, the network equipment generates the global label forwarding table by using the reference label and the label index, and the label forwarding table is used for transmitting the messages of all the destination IP addresses without independently distributing labels for the messages of each destination IP address, so that the whole network deployment of the SR is simplified, the label management is simplified, and the label configuration error is avoided.
Referring to fig. 3, a flowchart of a label deployment method based on segment routing provided in the embodiment of the present application is shown, where the method may be applied to a network device, and the method may include the following steps:
step 301, receiving the first mapping relationship and the second mapping relationship from the controller.
The first mapping relationship may include a correspondence relationship between an interface of the device and a reference label of an opposite device connected to the interface. The second mapping relationship may include a correspondence relationship between IP addresses of other network devices except the local device and the tag indexes of the other network devices.
Step 302, for each IP address included in the second mapping relationship, an interface matching the IP address is determined from the first mapping relationship.
In one example, the process of "determining an interface matching the IP address from the first mapping" may include: and inquiring a local routing table through the IP address to obtain a first outgoing interface corresponding to the IP address, and determining an interface which is the same as the first outgoing interface from the first mapping relation.
Step 303, querying a label index corresponding to the IP address from the second mapping relationship, querying a reference label corresponding to the interface (i.e. the interface matching the IP address in the first mapping relationship) from the first mapping relationship, and generating a label forwarding table by using the label index and the reference label.
In one example, for a label forwarding table generated by using the label index and the reference label, the incoming label of the label forwarding table may be: the tag index is the sum of the reference tags of the device. The out-label of the label forwarding table may be: the label index is the sum of the reference labels corresponding to the interface. The outgoing interface of the label forwarding table may be the interface. For example, if the controller determines the first label in the label segment space supported by the network device as the reference label of the network device, the network device may determine the first label in the label segment space supported by the network device as the reference label of the network device.
Step 304, the message is transmitted by using the label forwarding table.
In one example, the message may include only one tag, or may include at least two tags.
If the message only contains one label, aiming at the process of transmitting the message by using a label forwarding table, after the message is received, analyzing the label carried in the message, if the label is not the sum of the label index of the device and the reference label of the device, inquiring an incoming label matched with the label from the label forwarding table, replacing the label carried in the message with an outgoing label corresponding to the incoming label, and sending the modified message through an outgoing interface corresponding to the incoming label. If the label is the sum of the label index of the equipment and the reference label of the equipment, the label carried in the message is removed, and the modified message is sent based on the destination IP address of the message.
If the message contains at least two tags, the network device can analyze the outer layer tag (i.e. the first layer tag of the message) carried in the message after receiving the message aiming at the process of transmitting the message by using the tag forwarding table. If the outer layer label is not the sum of the label index of the device and the reference label of the device, the network device may query an incoming label matched with the outer layer label from the label forwarding table, replace the outer layer label carried in the message with an outgoing label corresponding to the incoming label, and send the modified message through an outgoing interface corresponding to the incoming label. If the outer layer label is the sum of the label index of the device and the reference label of the device, the network device may remove the outer layer label carried in the message and analyze the inner layer label carried in the message (i.e. the first layer label after removing the outer layer label, and there may be a label or no label behind the inner layer label); the network equipment inquires an input label matched with the inner-layer label from the label forwarding table, replaces the inner-layer label carried in the message with an output label corresponding to the input label, sends the modified message through an output interface corresponding to the input label, and changes the original inner-layer label into an outer-layer label in the modified message.
In one example, after receiving a message not carrying a label, a network device queries an IP forwarding table through a destination IP address of the message to obtain N label indexes matching the destination IP address, where the IP forwarding table is used to maintain a corresponding relationship between the IP address and the label indexes. Or after receiving a message not carrying a label, querying a local routing table through a destination IP address of the message to obtain an outgoing interface matched with the destination IP address, and if the outgoing interface is a logical interface, querying a preset corresponding relation between the logical interface and the label index through the logical interface to obtain N label indexes matched with the logical interface. N is greater than or equal to 1.
If the N label indexes are one label index, the network equipment encapsulates a layer of labels for the message, and the labels are the sum of the label indexes and the reference labels of the equipment; if the N label indexes are at least two label indexes, the network device encapsulates a K +1 layer label for the packet, the first layer label is the sum of the first label index and a reference label of the device, the K layer label is the sum of the K label index and a reference label of the network device corresponding to the (K minus 1) th label index, wherein the value of K is each positive integer between (2 and N). For example, if N is 4, the value of K is 2, 3, 4, the layer 2 tag is the sum of the reference tags of the network devices corresponding to the 2 nd tag index and the 1 st tag index, the layer 3 tag is the sum of the reference tags of the network devices corresponding to the 3 rd tag index and the 2 nd tag index, and the layer 4 tag is the sum of the reference tags of the network devices corresponding to the 4 th tag index and the 3 rd tag index.
The network equipment transmits the message encapsulated with the label by using the label forwarding table.
Based on the technical scheme, in the embodiment of the application, the controller sends and receives the reference label and the label index on the network equipment, the network equipment generates the global label forwarding table by using the reference label and the label index, and the label forwarding table is used for transmitting the messages of all the destination IP addresses without independently distributing labels for the messages of each destination IP address, so that the whole network deployment of the SR is simplified, the label management is simplified, and the label configuration error is avoided.
The following describes the above technical solution of the embodiment of the present application with reference to the application scenario shown in fig. 4. In fig. 4, the IP address of network device 1 is 1.1.1.1, the tag segment space is [10000,19999], the IP address of network device 2 is 2.2.2, the tag segment space is [20000,29999], the IP address of network device 3 is 3.3.3.3, the tag segment space is [30000,39999], the IP address of network device 4 is 4.4.4.4, the tag segment space is [40000,49999], the IP address of network device 5 is 5.5.5.5, the tag segment space is [50000,59999], the IP address of network device 6 is 6.6.6.6, and the tag segment space is [60000,69999 ].
In one example, the label segment spaces supported by the network devices may be the same or different, and in the context of this application, the label segment spaces supported by the network devices are different for example.
Moreover, the application scenario shown in fig. 4 may be applied in an SDN network, the controller may be an SDN controller, the controller is connected to each network device separately (the connection relationship is not shown in the figure), and the controller may know the entire network topology and the next hop to which each interface of each network device is connected.
In the application scenario, the label deployment method based on segment routing includes the following steps:
step 1, a controller acquires a network topology, wherein the network topology is the connection relation of each network device.
As shown in fig. 4, one example of the network topology may be: the network device 1 is connected with the network device 2 through an interface 12, the network device 1 is connected with the network device 4 through an interface 14, the network device 2 is connected with the network device 3 through an interface 23, the network device 3 is connected with the network device 6 through an interface 36, the network device 4 is connected with the network device 5 through an interface 45, and the network device 5 is connected with the network device 6 through an interface 56.
In one example, to obtain the network topology, the controller may send a first message encapsulating a detection packet to the network device 1, where the detection packet includes the identifier of the network device 1 and the interface 12. The network device 1 parses the detection packet from the first message, and sends the detection packet from the interface 12. After receiving the detection message through the interface 21, the network device 2 encapsulates the detection message in the second message, adds the identifier of the network device 2 and the interface 21 to the second message, and sends the second message to the controller. After receiving the second message, the controller may parse the identifier and the interface 21 of the network device 2 from the second message, and parse the detection packet from the second message, where the detection packet includes the identifier and the interface 12 of the network device 1, and therefore, the controller may determine that a physical link exists between the interface 12 of the network device 1 and the interface 21 of the network device 2. In summary, after the first message encapsulating the detection packet is sent to each port of each network device, the controller may obtain the network topology.
In another example, to obtain the network topology, the controller may establish a BGP (Border Gateway Protocol) neighbor with a network device (e.g., network device 2), and network device 2 may collect the network topology and send the network topology to the controller, e.g., send the network topology to the controller via a BGP-LS (Link State) message, so that the controller obtains the network topology. For the process of collecting the network topology by the network device 2, an Open Shortest Path First (OSPF) protocol or an Intermediate System-to-Intermediate System (IS-IS) protocol may be run on each network device, and the network topology IS collected based on the OSPF protocol, the IS-IS protocol, and the like, which IS not described in detail herein.
And 2, the controller acquires the label segment space supported by each network device.
In one example, the controller may send a label space request message to network device 1, and after receiving the label space request message, network device 1 may return its own supported label segment space [10000,19999] to the controller via a label space response message, and the controller parses the label segment space [10000,19999] supported by network device 1. After each network device is processed, the controller can obtain the label segment space supported by each network device, and record the corresponding relation between the IP address of each network device and the label segment space supported by the network device. For example, the controller may record the correspondence of IP address 1.1.1.1 to tag segment space [10000,19999], IP address 2.2.2.2 to tag segment space [20000,29999], IP address 3.3.3.3 to tag segment space [30000,39999], IP address 4.4.4.4.4 to tag segment space [40000,49999], IP address 5.5.5.5 to tag segment space [50000,59999], and IP address 6.6.6.6 to tag segment space [60000,69999 ].
In an example, the tag space request message and the tag space response message may be messages of a Network Configuration Protocol (netconf), or messages of other protocols, and the message types of the tag space request message and the tag space response message are not limited.
And 3, the controller determines the reference label of each network device from the label segment space supported by each network device, for example, the first label in the label segment space is determined as the reference label of the network device.
For example, the controller determines that the reference label of the network device 1 is 10000, the reference label of the network device 2 is 20000, the reference label of the network device 3 is 30000, the reference label of the network device 4 is 40000, the reference label of the network device 5 is 50000, and the reference label of the network device 6 is 60000. Thereafter, the controller records the correspondence relationship between IP address 1.1.1.1 and reference label 10000, the correspondence relationship between IP address 2.2.2.2 and reference label 20000, the correspondence relationship between IP address 3.3.3 and reference label 30000, the correspondence relationship between IP address 4.4.4.4 and reference label 40000, the correspondence relationship between IP address 5.5.5.5 and reference label 50000, and the correspondence relationship between IP address 6.6.6.6 and reference label 60000.
And 4, the controller determines a reference label of the opposite terminal device connected with the interface of the network device.
For example, the controller determines that the peer device connected to the interface 12 of the network device 1 is the network device 2, and queries the reference label 20000 through the IP address 2.2.2.2 of the network device 2. Similarly, it is determined that the reference label of the peer device connected to interface 14 is 40000, the reference label of the peer device connected to interface 23 is 30000, the reference label of the peer device connected to interface 36 is 60000, the reference label of the peer device connected to interface 45 is 50000, and the reference label of the peer device connected to interface 56 is 60000.
And 5, the controller allocates a unique label index to each network device (namely the label index has uniqueness), and records the corresponding relation between the IP address of each network device and the label index of the network device.
For example, the controller assigns a tag index 1 to the network device 1, and records the correspondence between the IP address 1.1.1.1 and the tag index 1. The controller allocates a tag index 2 to the network device 2, and records a corresponding relationship between the IP address 2.2.2.2 and the tag index 2. The controller allocates a tag index 3 to the network device 3 and records the correspondence between the IP address 3.3.3.3 and the tag index 3. The controller allocates a tag index 4 to the network device 4 and records the correspondence between the IP address 4.4.4.4 and the tag index 4. The controller assigns a tag index 5 to the network device 5 and records the correspondence of the IP address 5.5.5.5 with the tag index 5. The controller assigns a label index 6 to the network device 6 and records the correspondence of the IP address 6.6.6.6 with the label index 6.
And 6, the controller sends the first mapping relation and the second mapping relation to each network device.
The first mapping relation transmitted to the network device 1 includes a correspondence relation between the interface 12 and the reference label 20000, and a correspondence relation between the interface 14 and the reference label 40000. The first mapping relation transmitted to the network device 2 includes a correspondence relation between the interface 23 and the reference label 30000. The first mapping relation transmitted to the network device 3 includes a correspondence relation between the interface 36 and the reference label 60000. The first mapping relation transmitted to the network device 4 includes a correspondence relation between the interface 45 and the reference label 50000. The first mapping transmitted to the network device 5 includes a correspondence between the interface 56 and the reference label 60000.
In another example, the first mapping relation sent to the network device 1 includes a correspondence relation between the interface 12, the reference label 20000, and the next hop IP address of the interface 12 (i.e. the interface IP address of the peer device connected to the interface 12, i.e. the IP address of the interface connected to the interface 12 on the network device 2, for convenience of description, this IP address is referred to as the next hop IP address), and a correspondence relation between the interface 14, the reference label 40000, and the next hop IP address of the interface 14 (i.e. the IP address of the interface connected to the interface 14 on the network device 4). Similarly, the first mapping relation sent to other network devices may also include a next hop IP address, which is not described in detail herein. In order to implement the above process, the network topology acquired by the controller may further include a next-hop IP address. For example, one example of a network topology may be: the network device 1 is connected with the network device 2 through an interface 12, and the next hop IP address of the interface 12 is 1.1.1.100; network device 1 connects to network device 4 through interface 14, and the next-hop IP address of interface 14 is 4.4.4.100, and so on.
The second mapping relation transmitted to the network device 1 includes a correspondence relation between the IP address 2.2.2.2, the reference label 20000, and the label index 2, a correspondence relation between the IP address 3.3.3.3, the reference label 30000, and the label index 3, a correspondence relation between the IP address 4.4.4.4, the reference label 40000, and the label index 4, a correspondence relation between the IP address 5.5.5.5, the reference label 50000, and the label index 5, and a correspondence relation between the IP address 6.6.6.6, the reference label 60000, and the label index 6. The second mapping relation transmitted to the network device 2 includes a correspondence relation between the IP address 1.1.1.1, the reference label 10000 and the label index 1, a correspondence relation between the IP address 3.3.3.3, the reference label 30000 and the label index 3, a correspondence relation between the IP address 4.4.4.4, the reference label 40000 and the label index 4, a correspondence relation between the IP address 5.5.5.5, the reference label 50000 and the label index 5, and a correspondence relation between the IP address 6.6.6.6, the reference label 60000 and the label index 6. By analogy, other devices are not described in detail.
In addition, the controller may also send the tag index 1 of the network device 1 to the network device 1, send the tag index 2 of the network device 2 to the network device 2, send the tag index 3 of the network device 3 to the network device 3, send the tag index 4 of the network device 4 to the network device 4, send the tag index 5 of the network device 5 to the network device 5, and send the tag index 6 of the network device 6 to the network device 6.
Step 7, after receiving the first mapping relationship and the second mapping relationship from the controller, the network device may generate a label forwarding table by using the first mapping relationship and the second mapping relationship.
In one example, for each IP address included in the second mapping, the network device determines, from the first mapping, an interface that matches the IP address. Then, the network device queries the label index corresponding to the IP address from the second mapping relationship, queries the reference label corresponding to the interface from the first mapping relationship, and generates a label forwarding table by using the label index and the reference label. The incoming label of the label forwarding table may be: the tag index is the sum of the reference tags of the device. The out-label of the label forwarding table may be: the label index is the sum of the reference labels corresponding to the interface. The outgoing interface of the label forwarding table may be the interface.
The network device may query the local routing table through the IP address in the second mapping relationship to obtain a first outgoing interface corresponding to the IP address, and resolve an interface identical to the first outgoing interface from the first mapping relationship, where the interface is an interface matched with the IP address.
In one example, when the local routing table of the network device changes, the label forwarding table may also be updated based on the changed local routing table, that is, "the network device determines an interface matching the IP address through the changed local routing table". Specifically, the network device queries the changed local routing table through the IP address in the second mapping relationship to obtain the first outgoing interface corresponding to the IP address, and analyzes the interface identical to the first outgoing interface from the first mapping relationship, and other processing is identical to the above process, which is not described again.
For example, the network device 1 may maintain the local routing table in a conventional manner, and the maintenance process is not described in detail. The network device 1 queries the local routing table through the IP address 2.2.2.2 in the second mapping relationship to obtain the outgoing interface 12 corresponding to the IP address, and the first mapping relationship includes the correspondence relationship between the interface 12 and the reference label 20000. Therefore, the interface 12 is an interface matching the IP address 2.2.2.2, and the network device 1 queries the label index 2 corresponding to the IP address 2.2.2.2 from the second mapping relationship, and queries the reference label 20000 corresponding to the interface 12 from the first mapping relationship. Therefore, the label entry of the label forwarding table is 10002 (sum of label index 2 and reference label 10000 of the device), the label exit is 20002 (sum of label index 2 and reference label 20000 corresponding to interface 12), and the interface exit is interface 12.
Similarly, after the network device 1 queries the local routing table through the IP address 3.3.3.3, the corresponding relationship between the incoming label 10003, the outgoing label 20003, and the outgoing interface 12 is recorded in the label forwarding table. After the network device 1 queries the local routing table through the IP address 4.4.4.4, the corresponding relationship between the incoming label 10004, the outgoing label 40004, and the outgoing interface 14 is recorded in the label forwarding table. After querying the local routing table through IP address 5.5.5.5, network device 1 records the corresponding relationship between entry label 10005, exit label 40005, and exit interface 14 in the label forwarding table.
After the network device 1 queries the local routing table through the IP address 6.6.6.6, because an equivalent route exists in the local routing table, that is, the IP address 6.6.6.6 corresponds to the egress interface 12 and the egress interface 14, the network device 1 records a corresponding relationship between the ingress label 10006 and the egress label 20006 on the label forwarding table and records a corresponding relationship between the ingress label 10006 and the egress label 40006 on the label forwarding table on the egress interface 14.
Similarly, network device 2 records the corresponding relationship between entry label 20003, exit label 30003 and exit interface 23 in the label forwarding table, and records the corresponding relationship between entry label 20006, exit label 30006 and exit interface 23 in the label forwarding table. The network device 3 records the correspondence between the incoming label 30006, the outgoing label 60006, and the outgoing interface 36 in the label forwarding table. Of course, in the above process, only a few examples of the label forwarding table are given, and for the processing of other situations, similar to this, the following description is not repeated.
To sum up, an example of the label forwarding table maintained by network device 1 is shown in table 1, an example of the label forwarding table maintained by network device 2 is shown in table 2, and an example of the label forwarding table maintained by network device 3 is shown in table 3, and since network device 6 is a device corresponding to IP address 6.6.6.6, the label forwarding table maintained by network device 6 is shown in table 4, which is not described again for other devices.
TABLE 1
Figure BDA0001162475560000131
Figure BDA0001162475560000141
TABLE 2
Go into label Go out label Outlet interface
20003 30003 Interface 23
20006 30006 Interface 23
TABLE 3
Go into label Go out label Outlet interface
30006 60006 Interface 36
TABLE 4
Go into label Go out label Outlet interface
60006 IP-based forwarding
And step 8, the network equipment transmits the message by using the label forwarding table.
For convenience of description, in the context of this application, taking an example that a certain PC1 under the network device 1 sends a message to a certain PC2 under the network device 6, the destination IP address of the message is the IP address of the PC 2.
In one example, an IP forwarding table may be configured on network device 1 by a user in advance. In another example, an IP forwarding table may be issued by the controller on the network device 1 in advance. The IP forwarding table is used for recording the corresponding relation between the IP network segment and the label index. The IP network segment may be a network segment to which the PC2 under the network device 6 belongs, and the label index is used to send a message to the network device 6.
If the user/controller does not control the transmission path of the packet, the tag index may be the tag index 6 of the network device 6. If the user/controller controls the transmission path of the message, assuming that the transmission path of the control message is network device 1-network device 2-network device 3-network device 6, the label index may be label index 6 of network device 6, label index 3 of network device 3; or, the tag index 6 of the network device 6, the tag index 2 of the network device 2; or, the tag index 6 of the network device 6, the tag index 3 of the network device 3, and the tag index 2 of the network device 2. Assuming that the control packet transmission path is network device 1, network device 4, network device 5, and network device 6, the label index may be label index 6 of network device 6 or label index 5 of network device 5; or, the tag index 6 of the network device 6, the tag index 4 of the network device 4; alternatively, the tag index 6 of network device 6, the tag index 5 of network device 5, and the tag index 4 of network device 4.
In practical application, when an equal cost path exists, the purpose of controlling the forwarding of the message from a certain path in the equal cost path can be achieved by controlling the transmission path of the message. For example, when a packet needs to be transmitted from the network device 1 to the network device 6, there are two equivalent paths, which are the network device 1-network device 2-network device 3-network device 6, network device 1-network device 4-network device 5-network device 6. In the embodiment of the application, the purpose of controlling the message transmission path can be achieved by controlling the label index. For example, if the control packet transmission path is network device 1-network device 2-network device 3-network device 6, the label index may be label index 6 of network device 6 or label index 3 of network device 3.
In case one, assume that the IP forwarding table records the segment to which PC2 belongs and label index 6.
After receiving the message, the network device 1 firstly queries the IP forwarding table through the destination IP address of the message (i.e., the IP address of the PC 2), finds the network segment (i.e., the network segment to which the PC2 belongs) matching the destination IP address, and parses the label index 6 from the IP forwarding table. Then, the network device 1 encapsulates a layer of label on the packet, where the label may be label index 6+ reference label 10000 of the device, that is, label 10006.
When the network device 1 needs to send the packet, the label 10006 carried in the packet is parsed, and an incoming label matching the label 10006 is queried from the label forwarding table shown in table 1. Because there are two entries corresponding to the label 10006 in table 1, and the two entries form an equivalent path, the network device 1 may replace the label 10006 carried in the packet with the outgoing label 20006, and send the modified packet through the outgoing interface 12. Alternatively, the network device 1 may replace the label 10006 carried in the packet with the outgoing label 40006, and send the modified packet through the outgoing interface 14. For convenience of description, the example that the label 10006 carried in the message is replaced by the outgoing label 20006, and the modified message is sent through the outgoing interface 12 is described.
After receiving the message, the network device 2 parses the tag 20006 carried in the message, and queries the incoming tag matching with the tag 20006 from the tag forwarding table shown in table 2. The network device 2 replaces the label 20006 carried in the message with the outgoing label 30006, and sends the modified message through the outgoing interface 23.
After receiving the message, the network device 3 parses the tag 30006 carried in the message, and queries the incoming tag matched with the tag 30006 from the tag forwarding table shown in table 3. The network device 3 replaces the label 30006 carried in the packet with the outgoing label 60006, and sends the modified packet through the outgoing interface 36.
After receiving the message, the network device 6 may remove the label from the message and send the message based on the destination IP address of the message, that is, send the message to the PC2 by using the destination IP address, because the label is the sum of the label index 6 of the network device 6 and the reference label 60000 of the network device 6.
In case two, assume that the IP forwarding table records the network segment to which PC2 belongs, label index 6, and label index 3. At least two label indexes can be recorded in the IP forwarding table, and in this example, two label indexes are taken as an example.
After receiving the message, the network device 1 firstly queries the IP forwarding table through the destination IP address of the message (i.e., the IP address of the PC 2), finds the network segment (i.e., the network segment to which the PC2 belongs) matching the destination IP address, and parses the label index 6 and the label index 3 from the IP forwarding table. Then, the network device 1 may encapsulate two layers of labels on the packet, where the outer layer label may be label index 3+ reference label 10000 of the network device, that is, the outer layer label may be label 10003. Further, the inner label may be a reference label 30000 of the network device 3 corresponding to the label index 6+ the label index 3, that is, the inner label may be a label 30006.
When the network device 1 needs to send the message, the outer layer label 10003 carried in the message is analyzed, because the outer layer label 10003 is not the sum of the label index 1 of the device and the reference label 10000 of the device, the network device 1 queries an incoming label matched with the outer layer label 10003 from the label forwarding table shown in table 1, replaces the outer layer label 10003 carried in the message with an outgoing label 20003 corresponding to the outer layer label 10003, and sends the modified message through the outgoing interface 12 corresponding to the outer layer label 10003.
After receiving the message, the network device 2 parses out the outer label 20003 carried in the message, and since the outer label 20003 is not the sum of the label index 2 of the device and the reference label 20000 of the device, the network device 2 queries the incoming label matched with the outer label 20003 from the label forwarding table shown in table 2, replaces the outer label 20003 carried in the message with the outgoing label 30003 corresponding to the outer label 20003, and sends the modified message through the outgoing interface 23 corresponding to the outer label 20003.
After receiving the message, the network device 3 parses the outer label 30003 carried in the message, and since the outer label 30003 is the sum of the label index 3 of the device and the reference label 30000 of the device, the network device 3 removes the outer label 30003 from the message, parses the inner label 30006 carried in the message, and queries the incoming label matched with the inner label 30006 from the label forwarding table shown in table 3. Then, the network device 3 replaces the inner label 30006 carried in the packet with the outgoing label 60006 corresponding to the inner label 30006, and sends the modified packet through the outgoing interface 36 corresponding to the inner label 30006.
After receiving the packet, the network device 6 only has one label left in the packet, i.e. the label 60006 described above, instead of two layers of labels. Since the label 60006 is the sum of the label index 6 of the network device 6 and the reference label 60000 of the network device 6, based on table 4, the network device 6 may remove the label from the message and send the message based on the destination IP address of the message, that is, send the message to the PC2 by using the destination IP address.
Based on the steps 1 to 8, the maintenance of the label forwarding table and the transmission of the message can be completed.
In another example, rather than maintaining an IP forwarding table on network device 1, a local routing table for network device 1 is modified, in a manner different from that described above. Specifically, for the route corresponding to the IP address of the PC2 in the local routing table, the outgoing interface is modified to be a logical interface (e.g., interface a), and the corresponding relationship between the logical interface and the label index 6 (or label index 6, label index 3) is configured. Thus, after receiving the message, the network device 1 firstly queries the local routing table through the destination IP address of the message (i.e. the IP address of the PC 2), and finds the outgoing interface matching with the destination IP address, where the outgoing interface is a logical interface, and therefore, queries the label index 6 (or the label index 6, the label index 3) corresponding to the logical interface later. The subsequent processing flow refers to the processing in the first case or the processing in the second case, and is not described herein again.
Based on the technical scheme, in the embodiment of the application, the controller sends and receives the reference label and the label index on the network equipment, the network equipment generates the global label forwarding table by using the reference label and the label index, and the label forwarding table is used for transmitting the messages of all the destination IP addresses without independently distributing labels for the messages of each destination IP address, so that the whole network deployment of the SR is simplified, the label management is simplified, and the label configuration error is avoided.
For example, assuming that network device 6 has PC2 and PC3 connected thereunder, in a conventional manner, for the IP address of PC2, the controller assigns label a1 to network device 1, label B1 to network device 2, label C1 to network device 3, and label D1 to network device 4. For the IP address of PC3, the controller assigns label a2 for network device 1, label B2 for network device 2, label C2 for network device 3, and label D2 for network device 4. By analogy, if more PCs are connected to the network device 6, labels need to be reassigned to the devices for the IP addresses of each PC, and label management is complicated. Different from the above manner, in the embodiment of the present application, no matter how many PCs are connected under the network device 6, the network device 1 may perform processing based on table 1, and similarly, the network device 2 may perform processing based on table 2, and so on, so that the controller is not required to allocate a tag to each PC, thereby simplifying the entire network deployment of the SR and simplifying the tag management.
Based on the same application concept as the method, the embodiment of the present application further provides a label deployment device based on segment routing, which is applied to a controller. The label deployment device based on the segment routing can be realized by software, or can be realized by hardware or a combination of the software and the hardware. A logical device, implemented in software for example, is formed by a processor of a controller in which the logical device is located reading corresponding computer program instructions in a non-volatile memory. From a hardware aspect, as shown in fig. 5, the controller is a hardware structure diagram of the controller, and besides the processor and the nonvolatile memory shown in fig. 5, the controller may also include other hardware, such as a forwarding chip, a network interface, and a memory, which are responsible for processing a packet; in terms of hardware architecture, the controller may also be a distributed device, possibly including multiple interface cards, to extend message processing at the hardware level.
As shown in fig. 6, a block diagram of a label deployment apparatus based on segment routing proposed in the present application is shown, where the apparatus includes:
a determining module 11, configured to determine, for each interface of a network device, a reference tag of an opposite-end device connected to the interface;
a sending module 12, configured to send a first mapping relationship and a second mapping relationship to the network device, where the first mapping relationship includes a correspondence between the interface and the reference tag, and the second mapping relationship includes a correspondence between IP addresses of other network devices except the network device and tag indexes of the other network devices; and the network equipment generates a label forwarding table by using the first mapping relation and the second mapping relation and transmits a message by using the label forwarding table.
In an example, the determining module 11 is specifically configured to obtain a label segment space supported by each network device in a process of determining a reference label of an opposite-end device connected to the interface; determining a reference label of each network device from a label segment space supported by each network device; and traversing the reference labels of the opposite terminal equipment connected with the interface from the reference labels of all the network equipment.
In one example, the label deployment device based on segment routing further includes (not shown in the figure):
the distribution module is used for distributing a unique label index to each network device before the sending module sends the first mapping relation and the second mapping relation to the network devices;
and the recording module is used for recording the corresponding relation between the IP address of each network device and the label index.
Based on the same application concept as the method, the embodiment of the present application further provides a label deployment device based on segment routing, which is applied to a network device. The label deployment device based on the segment routing can be realized by software, or can be realized by hardware or a combination of the software and the hardware. Taking a software implementation as an example, as a logical means, the device is formed by reading a corresponding computer program instruction in the nonvolatile memory through a processor of the network device where the device is located. From a hardware aspect, as shown in fig. 7, the hardware structure diagram of the network device is shown, and besides the processor and the nonvolatile memory shown in fig. 7, the network device may further include other hardware, such as a forwarding chip, a network interface, and a memory, which are responsible for processing a packet; in terms of hardware structure, the network device may also be a distributed device, and may include a plurality of interface cards, so as to perform an extension of the message processing at a hardware level.
As shown in fig. 8, a block diagram of a label deployment apparatus based on segment routing proposed in the present application is shown, where the apparatus includes:
a receiving module 21, configured to receive the first mapping relationship and the second mapping relationship from the controller; the first mapping relation comprises a corresponding relation between an interface of the device and a reference label of opposite-end equipment connected with the interface; the second mapping relation comprises the corresponding relation between the IP addresses of other network equipment except the equipment and the label indexes of the other network equipment;
a determining module 22, configured to determine, for each IP address included in the second mapping relationship, an interface matching the IP address from the first mapping relationship;
a generating module 23, configured to query, from the second mapping relationship, a label index corresponding to the IP address, query, from the first mapping relationship, a reference label corresponding to the interface, and generate a label forwarding table by using the label index and the reference label;
and the sending module 24 is configured to transmit a packet by using the label forwarding table.
The determining module 22 is specifically configured to, in the process of determining an interface matching the IP address from the first mapping relationship, query a local routing table through the IP address to obtain a first outgoing interface corresponding to the IP address, and determine an interface identical to the first outgoing interface from the first mapping relationship.
In one example, the incoming label of the label forwarding table is the sum of the label index and the reference label of the device; the output label of the label forwarding table is the sum of the label index and the reference label corresponding to the interface; and the outgoing interface of the label forwarding table is the interface.
In an example, the sending module 24 is specifically configured to, in a process of transmitting a packet by using the tag forwarding table, parse an outer tag carried in the packet after receiving the packet;
if the outer layer label is not the sum of the label index of the equipment and the reference label of the equipment, inquiring an incoming label matched with the outer layer label from a label forwarding table, replacing the outer layer label carried in the message with an outgoing label corresponding to the incoming label, and sending the modified message through an outgoing interface corresponding to the incoming label;
if the outer layer label is the sum of the label index of the equipment and the reference label of the equipment, removing the outer layer label carried in the message, and analyzing the inner layer label carried in the message; and inquiring an incoming label matched with the inner-layer label from the label forwarding table, replacing the inner-layer label carried in the message with an outgoing label corresponding to the incoming label, and sending the modified message through an outgoing interface corresponding to the incoming label.
In an example, the sending module 24 is specifically configured to, in a process of transmitting a packet by using the tag forwarding table, parse a tag carried in the packet after receiving the packet;
if the label is not the sum of the label index of the equipment and the reference label of the equipment, inquiring an incoming label matched with the label from the label forwarding table, replacing the label carried in the message with an outgoing label corresponding to the incoming label, and sending the modified message through an outgoing interface corresponding to the incoming label;
if the label is the sum of the label index of the equipment and the reference label of the equipment, the label carried in the message is removed, and the modified message is sent based on the destination IP address of the message.
In an example, the sending module 24 is further configured to, after receiving a packet without a tag, query an IP forwarding table through a destination IP address of the packet to obtain N tag indexes matched with the destination IP address, where the IP forwarding table is used to maintain a corresponding relationship between an IP address and a tag index; or after receiving a message not carrying a label, inquiring a local routing table through a destination IP address of the message to obtain an outgoing interface matched with the destination IP address, and if the outgoing interface is a logical interface, inquiring a corresponding relation between a preset logical interface and a label index through the logical interface to obtain N label indexes matched with the logical interface; n is greater than or equal to 1;
if the N label indexes are one label index, a layer of labels are packaged for the message, and the labels are the sum of the label indexes and the reference labels of the equipment; if the N label indexes are at least two label indexes, packaging a K +1 layer label for the message, wherein the first layer label is the sum of a first label index and a reference label of the device, the K layer label is the sum of a K label index and a reference label of the network device corresponding to the (K minus 1) label index, and the value of K is each positive integer between (2 and N);
and transmitting the message encapsulated with the label by using the label forwarding table.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present application can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application may be essentially or partially implemented in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute the methods described in the embodiments of the present application. Those skilled in the art will appreciate that the drawings are merely schematic representations of one preferred embodiment and that the blocks or flow diagrams in the drawings are not necessarily required to practice the present application.
Those skilled in the art will appreciate that the modules in the devices in the embodiments may be distributed in the devices in the embodiments according to the description of the embodiments, and may be correspondingly changed in one or more devices different from the embodiments. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules. The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The disclosure of the present application is only a few specific embodiments, but the present application is not limited to these, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present application.

Claims (14)

1. A label deployment method based on segment routing is applied to a controller, and is characterized in that the method comprises the following steps:
determining a reference label of opposite terminal equipment connected with each interface of the network equipment; wherein the peer device has an IP address, has a tag segment space supported, and has a unique tag index;
sending a first mapping relation and a second mapping relation to the network device, wherein the first mapping relation comprises a corresponding relation between the interface and the reference label, and the second mapping relation comprises a corresponding relation between the IP address of other network devices except the network device and the label index of the other network devices;
enabling the network equipment to generate a label forwarding table by using the first mapping relation and the second mapping relation, and transmitting a message by using the label forwarding table; for each IP address included in the second mapping relation, inquiring a local routing table through the IP address to obtain a first outgoing interface corresponding to the IP address, and determining an interface which is the same as the first outgoing interface from the first mapping relation as an interface matched with the IP address; inquiring a label index corresponding to the IP address from the second mapping relation, inquiring a reference label corresponding to the interface from the first mapping relation, and generating a label forwarding table by using the label index and the reference label; the label of the label forwarding table is the sum of the label index and the reference label of the device; the output label of the label forwarding table is the sum of the reference labels corresponding to the interfaces matched with the IP address and the label index; an output interface of the label forwarding table is an interface matched with the IP address;
the reference label is a label in a label segment space supported by the opposite terminal device, and the label segment spaces supported by different network devices are different.
2. The method of claim 1,
the process of determining the reference label of the peer device connected to the interface specifically includes:
obtaining a label segment space supported by each network device;
determining a reference label of each network device from a label segment space supported by each network device;
and traversing the reference labels of the opposite terminal equipment connected with the interface from the reference labels of all the network equipment.
3. The method of claim 1, wherein before sending the first mapping relationship and the second mapping relationship to the network device, the method further comprises:
assigning a unique tag index to each network device;
and recording the corresponding relation between the IP address of each network device and the label index.
4. A label deployment method based on segment routing is applied to network equipment and is characterized in that the network equipment has a plurality of interfaces, opposite terminal equipment connected with each interface has an IP address, the opposite terminal equipment has a label segment space supported by the opposite terminal equipment, and the opposite terminal equipment has a unique label index; the method comprises the following steps:
receiving a first mapping relation and a second mapping relation from a controller; the first mapping relation comprises a corresponding relation between an interface of the device and a reference label of opposite-end equipment connected with the interface; the second mapping relation comprises the corresponding relation between the IP addresses of other network equipment except the equipment and the label indexes of the other network equipment;
for each IP address included in the second mapping relation, determining an interface matched with the IP address from the first mapping relation; the method specifically comprises the following steps: inquiring a local routing table through the IP address to obtain a first outgoing interface corresponding to the IP address, and determining an interface which is the same as the first outgoing interface from the first mapping relation as an interface matched with the IP address;
inquiring a label index corresponding to the IP address from the second mapping relation, inquiring a reference label corresponding to the interface from the first mapping relation, and generating a label forwarding table by using the label index and the reference label; wherein, the label of the label forwarding table is the sum of the label index and the reference label of the device; the output label of the label forwarding table is the sum of the reference labels corresponding to the interfaces matched with the IP address and the label index; an output interface of the label forwarding table is an interface matched with the IP address;
transmitting a message by using the label forwarding table;
the reference label is a label in a label segment space supported by the opposite terminal device, and the label segment spaces supported by different network devices are different.
5. The method of claim 4,
the process of transmitting the packet by using the label forwarding table specifically includes:
after a message is received, analyzing an outer layer label carried in the message;
if the outer layer label is not the sum of the label index of the equipment and the reference label of the equipment, inquiring an incoming label matched with the outer layer label from a label forwarding table, replacing the outer layer label carried in the message with an outgoing label corresponding to the incoming label, and sending the modified message through an outgoing interface corresponding to the incoming label;
if the outer layer label is the sum of the label index of the equipment and the reference label of the equipment, removing the outer layer label carried in the message, and analyzing the inner layer label carried in the message; and inquiring an incoming label matched with the inner-layer label from the label forwarding table, replacing the inner-layer label carried in the message with an outgoing label corresponding to the incoming label, and sending the modified message through an outgoing interface corresponding to the incoming label.
6. The method of claim 4,
the process of transmitting the packet by using the label forwarding table specifically includes:
after receiving a message, analyzing a label carried in the message;
if the label is not the sum of the label index of the equipment and the reference label of the equipment, inquiring an incoming label matched with the label from the label forwarding table, replacing the label carried in the message with an outgoing label corresponding to the incoming label, and sending the modified message through an outgoing interface corresponding to the incoming label;
if the label is the sum of the label index of the equipment and the reference label of the equipment, the label carried in the message is removed, and the modified message is sent based on the destination IP address of the message.
7. The method of claim 5 or 6, further comprising:
after receiving a message without a label, inquiring an IP forwarding table through a destination IP address of the message to obtain N label indexes matched with the destination IP address, wherein the IP forwarding table is used for maintaining the corresponding relation between the IP address and the label indexes; or after receiving a message not carrying a label, inquiring a local routing table through a destination IP address of the message to obtain an outgoing interface matched with the destination IP address, and if the outgoing interface is a logical interface, inquiring a corresponding relation between a preset logical interface and a label index through the logical interface to obtain N label indexes matched with the logical interface; n is greater than or equal to 1;
if the N label indexes are one label index, a layer of labels are packaged for the message, and the labels are the sum of the label indexes and the reference labels of the equipment; if the N label indexes are at least two label indexes, packaging a K +1 layer label for the message, wherein the first layer label is the sum of the first label index and a reference label of the equipment, the K layer label is the sum of the K label index and the reference label of the network equipment corresponding to the K-1 label index, and the value of K is each positive integer from 2 to N;
and transmitting the message encapsulated with the label by using the label forwarding table.
8. A label deployment device based on segment routing is applied to a controller, and is characterized in that the device comprises:
a determining module, configured to determine, for each interface of a network device, a reference tag of an opposite-end device connected to the interface; wherein the peer device has an IP address, has a tag segment space supported, and has a unique tag index;
a sending module, configured to send a first mapping relationship and a second mapping relationship to the network device, where the first mapping relationship includes a correspondence between the interface and the reference tag, and the second mapping relationship includes a correspondence between IP addresses of other network devices except the network device and tag indexes of the other network devices; enabling the network equipment to generate a label forwarding table by using the first mapping relation and the second mapping relation, and transmitting a message by using the label forwarding table; for each IP address included in the second mapping relation, inquiring a local routing table through the IP address to obtain a first outgoing interface corresponding to the IP address, and determining an interface which is the same as the first outgoing interface from the first mapping relation as an interface matched with the IP address; inquiring a label index corresponding to the IP address from the second mapping relation, inquiring a reference label corresponding to the interface from the first mapping relation, and generating a label forwarding table by using the label index and the reference label; the label of the label forwarding table is the sum of the label index and the reference label of the device; the output label of the label forwarding table is the sum of the reference labels corresponding to the interfaces matched with the IP address and the label index; an output interface of the label forwarding table is an interface matched with the IP address;
the reference label is a label in a label segment space supported by the opposite terminal device, and the label segment spaces supported by different network devices are different.
9. The apparatus of claim 8,
the determining module is specifically configured to obtain a label segment space supported by each network device in a process of determining a reference label of an opposite-end device connected to the interface; determining a reference label of each network device from a label segment space supported by each network device; and traversing the reference labels of the opposite terminal equipment connected with the interface from the reference labels of all the network equipment.
10. The apparatus of claim 8, further comprising:
the distribution module is used for distributing a unique label index to each network device before the sending module sends the first mapping relation and the second mapping relation to the network devices;
and the recording module is used for recording the corresponding relation between the IP address of each network device and the label index.
11. A label deployment device based on segment routing is applied to network equipment and is characterized in that the network equipment has a plurality of interfaces, opposite terminal equipment connected with each interface has an IP address, the opposite terminal equipment has a label segment space supported by the opposite terminal equipment, and the opposite terminal equipment has a unique label index; the device comprises:
the receiving module is used for receiving the first mapping relation and the second mapping relation from the controller; the first mapping relation comprises a corresponding relation between an interface of the device and a reference label of opposite-end equipment connected with the interface; the second mapping relation comprises the corresponding relation between the IP addresses of other network equipment except the equipment and the label indexes of the other network equipment;
a determining module, configured to determine, for each IP address included in the second mapping relationship, an interface matching the IP address from the first mapping relationship; the method is specifically used for: inquiring a local routing table through the IP address to obtain a first outgoing interface corresponding to the IP address, and determining an interface which is the same as the first outgoing interface from the first mapping relation as an interface matched with the IP address;
a generating module, configured to query a label index corresponding to the IP address from the second mapping relationship, query a reference label corresponding to the interface from the first mapping relationship, and generate a label forwarding table by using the label index and the reference label; wherein, the label of the label forwarding table is the sum of the label index and the reference label of the device; the output label of the label forwarding table is the sum of the reference labels corresponding to the interfaces matched with the IP address and the label index; an output interface of the label forwarding table is an interface matched with the IP address;
the sending module is used for transmitting the message by utilizing the label forwarding table;
the reference label is a label in a label segment space supported by the opposite terminal device, and the label segment spaces supported by different network devices are different.
12. The apparatus of claim 11,
the sending module is specifically configured to, in a process of transmitting a packet by using the tag forwarding table, parse an outer-layer tag carried in the packet after receiving the packet;
if the outer layer label is not the sum of the label index of the equipment and the reference label of the equipment, inquiring an incoming label matched with the outer layer label from a label forwarding table, replacing the outer layer label carried in the message with an outgoing label corresponding to the incoming label, and sending the modified message through an outgoing interface corresponding to the incoming label;
if the outer layer label is the sum of the label index of the equipment and the reference label of the equipment, removing the outer layer label carried in the message, and analyzing the inner layer label carried in the message; and inquiring an incoming label matched with the inner-layer label from the label forwarding table, replacing the inner-layer label carried in the message with an outgoing label corresponding to the incoming label, and sending the modified message through an outgoing interface corresponding to the incoming label.
13. The apparatus of claim 11,
the sending module is specifically configured to, in a process of transmitting a packet by using the tag forwarding table, parse a tag carried in the packet after receiving the packet;
if the label is not the sum of the label index of the equipment and the reference label of the equipment, inquiring an incoming label matched with the label from the label forwarding table, replacing the label carried in the message with an outgoing label corresponding to the incoming label, and sending the modified message through an outgoing interface corresponding to the incoming label;
if the label is the sum of the label index of the equipment and the reference label of the equipment, the label carried in the message is removed, and the modified message is sent based on the destination IP address of the message.
14. The apparatus of claim 12 or 13,
the sending module is further configured to query an IP forwarding table through a destination IP address of the message after receiving the message without the tag, to obtain N tag indexes matched with the destination IP address, where the IP forwarding table is used to maintain a corresponding relationship between the IP address and the tag indexes; or after receiving a message not carrying a label, inquiring a local routing table through a destination IP address of the message to obtain an outgoing interface matched with the destination IP address, and if the outgoing interface is a logical interface, inquiring a corresponding relation between a preset logical interface and a label index through the logical interface to obtain N label indexes matched with the logical interface; n is greater than or equal to 1;
if the N label indexes are one label index, a layer of labels are packaged for the message, and the labels are the sum of the label indexes and the reference labels of the equipment; if the N label indexes are at least two label indexes, packaging a K +1 layer label for the message, wherein the first layer label is the sum of the first label index and a reference label of the equipment, the K layer label is the sum of the K label index and the reference label of the network equipment corresponding to the K-1 label index, and the value of K is each positive integer from 2 to N;
and transmitting the message encapsulated with the label by using the label forwarding table.
CN201611057919.XA 2016-11-25 2016-11-25 Label deployment method and device based on segment routing Active CN108111414B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611057919.XA CN108111414B (en) 2016-11-25 2016-11-25 Label deployment method and device based on segment routing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611057919.XA CN108111414B (en) 2016-11-25 2016-11-25 Label deployment method and device based on segment routing

Publications (2)

Publication Number Publication Date
CN108111414A CN108111414A (en) 2018-06-01
CN108111414B true CN108111414B (en) 2021-01-26

Family

ID=62205396

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611057919.XA Active CN108111414B (en) 2016-11-25 2016-11-25 Label deployment method and device based on segment routing

Country Status (1)

Country Link
CN (1) CN108111414B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109218200B (en) * 2018-11-26 2021-05-28 新华三技术有限公司 Message processing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1464703A (en) * 2002-06-19 2003-12-31 华为技术有限公司 Method for increasing IP message transferring speed
CN103516611A (en) * 2012-06-15 2014-01-15 丛林网络公司 Allocating and distributing labels for packet encapsulation
CN105684400A (en) * 2013-10-17 2016-06-15 华为技术有限公司 Method and device for establishing layer 2 virtual private network services
CN105871722A (en) * 2015-01-19 2016-08-17 中兴通讯股份有限公司 Tag structure and tag message forwarding method and device
CN106130997A (en) * 2016-06-30 2016-11-16 网宿科技股份有限公司 The method and apparatus that flow guides

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9537718B2 (en) * 2013-03-15 2017-01-03 Cisco Technology, Inc. Segment routing over label distribution protocol
CN103326918B (en) * 2013-05-17 2016-08-03 杭州华三通信技术有限公司 A kind of message forwarding method and equipment
CN108111417B (en) * 2013-08-15 2022-12-27 华为技术有限公司 Method and device for forwarding MPLS data packet

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1464703A (en) * 2002-06-19 2003-12-31 华为技术有限公司 Method for increasing IP message transferring speed
CN103516611A (en) * 2012-06-15 2014-01-15 丛林网络公司 Allocating and distributing labels for packet encapsulation
CN105684400A (en) * 2013-10-17 2016-06-15 华为技术有限公司 Method and device for establishing layer 2 virtual private network services
CN105871722A (en) * 2015-01-19 2016-08-17 中兴通讯股份有限公司 Tag structure and tag message forwarding method and device
CN106130997A (en) * 2016-06-30 2016-11-16 网宿科技股份有限公司 The method and apparatus that flow guides

Also Published As

Publication number Publication date
CN108111414A (en) 2018-06-01

Similar Documents

Publication Publication Date Title
CN112054960B (en) Path calculation method, device and equipment
US10164838B2 (en) Seamless segment routing
CN108259341B (en) Prefix label distribution method and SDN controller
CN107733799B (en) Message transmission method and device
CN103534993B (en) Connect the system of selection of Tag switching route and the device in low-power network territory
US20180191615A1 (en) Using segmentation identification to identify destination node within network environment
US20170237655A1 (en) Forwarding Data Packets In Software Defined Networks
CN107317752B (en) Method and device for forwarding data message
EP2451125B1 (en) Method and system for realizing network topology discovery
CN106878194B (en) Message processing method and device
CN106101617B (en) Message transmission method, device and system
CN110266833B (en) IP address management method and edge cluster
CN107968749B (en) Method for realizing QinQ route termination, switching chip and switch
CN103139075B (en) A kind of message transmitting method and equipment
CN104717081A (en) Gateway function realization method and device
CN110417655B (en) Method and device for forwarding data message
CN109728962A (en) A kind of method and apparatus sending message
CN111010329B (en) Message transmission method and device
US9548892B2 (en) Method and system for preventing polarization in a network
CN115442295A (en) Data transmission method, network node and storage medium
CN102792651A (en) Packet node for applying service path routing at the MAC layer
CN101771732A (en) Message processing method, device and network equipment
CN105812257A (en) Business chain router management system and use method thereof
CN110650092B (en) Data processing method and device
CN107733765B (en) Mapping method, system and related equipment

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