TECHNICAL FIELD

This application relates to the field of communications technologies, and in particular, to a tunnel establishment method, apparatus, and system.

BACKGROUND

Resource reservation protocol-traffic engineering (RSVP-TE) is a multiprotocol label switching (MPLS)-TE tunneling technology using RSVP. After an ingress node at a portal of a tunnel completes path calculation based on a constrained shortest path first (CSPF) routing protocol, the ingress node of the tunnel generates a path message carrying label request information. The path message is sent to an egress node at an end of the tunnel hop by hopping along a path obtained through calculation by using the CSPF routing protocol, and is used by each node to obtain a label of a next-hop node from the next-hop node. During subsequent packet forwarding, a packet is forwarded based on the label of the next-hop node.

Segment routing-traffic engineering (SR-TE) is a new MPLS TE tunneling technology that uses the interior gateway protocol (IGP) or the border gateway protocol (BGP) as control signaling. A controller calculates a forwarding path for the tunnel and delivers a label stack strictly corresponding to the path to a forwarder. On an ingress node of an SR-TE tunnel, the forwarder can control a transmission path of a packet on a network based on the label stack.

In prior approaches, when network nodes are configured, some nodes support RSVP, some nodes support the SR protocol, and some nodes support both RSVP and the SR protocol. In this scenario, how the node supporting RSVP establishes a tunnel with the node supporting the SR protocol by using the node supporting both RSVP and the SR protocol needs to be researched.

SUMMARY

This application provides a tunnel establishment method, apparatus, and system, to resolve problems that arise when a node supporting an RSVP cannot establish, by using a node supporting both the RSVP and an SR protocol, a tunnel with a node supporting the SR protocol.

According to a first aspect, an embodiment of this application provides a tunnel establishment method, including: receiving, by a first network device, a first request message sent by a previous-hop network device, where the first request message is used to request to obtain a resource reservation protocol-traffic engineering RSVP-TE label of the first network device, the first request message includes path information of the to-be-established tunnel, the path information of the to-be-established tunnel is used to indicate a path of the to-be-established tunnel, the previous-hop network device is a previous-hop network device of the first network device on the path of the to-be-established tunnel, the first network device supports RSVP-TE and segment routing-traffic engineering SR-TE, and the previous-hop network device supports RSVP-TE; when the first network device determines that at least one network device in downstream network devices of the first network device on the path of the to-be-established tunnel supports SR-TE, establishing an SR-TE tunnel from the first network device to a second network device in the at least one network device, and generating a tunnel identifier used to identify the SR-TE tunnel, where the first network device is an ingress network device of the SR-TE tunnel, and the second network device is an egress network device of the SR-TE tunnel; and sending, by the first network device, a first response message to the previous-hop network device, where the first response message includes the tunnel identifier, and the tunnel identifier is used as the RSVP-TE label of the first network device.

The foregoing solution provides a tunnel establishment manner in a scenario in which an RSVP-TE tunnel traverses an SR-TE tunnel or an RSVP-TE tunnel is stitched to an SR-TE tunnel, thereby enriching a networking scenario in which an RSVP-TE node and an SR-TE node are deployed.

In a possible embodiment, the establishing an SR-TE tunnel from the first network device to a second network device in the at least one network device, and generating a tunnel identifier used to identify the SR-TE tunnel includes: obtaining, by the first network device based on the path information of the to-be-established tunnel, at least one adjacency label corresponding to every two adjacent nodes on the SR-TE tunnel between the first network device and the second network device; generating, by the first network device, a label stack list of the SR-TE tunnel based on the at least one adjacency label, and generating the tunnel identifier mapped to the label stack list; and storing, by the first network device, an association relationship between the tunnel identifier and the label stack list.

The foregoing embodiment provides a simple and effective manner of establishing an SR-TE tunnel in a scenario in which an RSVP-TE tunnel traverses an SR-TE tunnel or an RSVP-TE tunnel is stitched to an SR-TE tunnel.

In a possible embodiment, the second network device is an egress network device of the to-be-established tunnel, and none of the at least one network device supports RSVP-TE.

The foregoing embodiment indicates that this embodiment of this application is applicable to a scenario in which RSVP-TE is stitched to SR-TE.

In a possible embodiment, only the second network device in the at least one network device supports RSVP-TE, and the second network device is an intermediate network device on the to-be-established tunnel; and before the sending, by the first network device, a first response message to the previous-hop network device, the method further includes: sending, by the first network device, a second request message to the second network device through the SR-TE tunnel, where the second request message is used to request to obtain an RSVP-TE label of the second network device; and receiving, by the first network device, a second response message sent by the second network device, where the second response message includes the RSVP-TE label of the second network device.

The foregoing embodiment indicates that this embodiment of this application is further applicable to a scenario in which an RSVP-TE tunnel traverses an SR-TE tunnel.

In a possible embodiment, the method further includes: receiving, by the first network device, a packet sent by the previous-hop network device, where the packet carries the tunnel identifier; and replacing, by the first network device, the tunnel identifier in the packet with the label stack list based on the association relationship between the tunnel identifier and the label stack list, and sending an updated packet to a next-hop network device of the first network device on the to-be-established tunnel.

The foregoing embodiment provides a simple and effective manner for packet sending when an RSVP-TE tunnel traverses or is stitched to an SR-TE tunnel.

In a possible embodiment, when only the second network device in the at least one network device supports RSVP-TE, and the second network device is the intermediate network device on the to-be-established tunnel, after the first network device replaces the tunnel identifier in the packet with the label stack list, the method further includes: encapsulating, by the first network device, the RSVP-TE label of the second network device at the bottom of the label stack list in the packet.

The foregoing embodiment provides another simple and effective manner for packet sending when an RSVP-TE tunnel traverses an SR-TE tunnel.

According to a second aspect, an embodiment of this application provides a tunnel establishment method, including: sending, by a network device, a request message to a next-hop network device on a to-be-established tunnel, where the request message is used to request to obtain a resource reservation protocol-traffic engineering RSVP-TE label of the next-hop network device, the first request message includes path information of the to-be-established tunnel, the path information of the to-be-established tunnel is used to indicate a path of the to-be-established tunnel, the next-hop network device is a next-hop network device of the network device on the path of the to-be-established tunnel, the network device supports RSVP-TE, and the next-hop network device supports RSVP-TE and segment routing-traffic engineering SR-TE; and receiving, by the network device, a response message sent by the next-hop network device, where the response message includes a tunnel identifier used as the RSVP-TE label of the network device, and the tunnel identifier is used to identify an SR-TE tunnel established by the next-hop network device on the path of the to-be-established tunnel.

The foregoing solution provides a tunnel establishment manner in a scenario in which an RSVP-TE tunnel traverses an SR-TE tunnel or an RSVP-TE tunnel is stitched to an SR-TE tunnel, thereby enriching a networking scenario in which an RSVP-TE node and an SR-TE node are deployed.

In a possible embodiment, the method further includes: when the network device sends a packet to the next-hop network device, adding the tunnel identifier used as the RSVP-TE label of the next-hop network device to the packet, and sending the packet to the next-hop network device.

The foregoing embodiment provides a packet sending manner in a scenario in which an RSVP-TE tunnel traverses an SR-TE tunnel or an RSVP-TE tunnel is stitched to an SR-TE tunnel.

According to a third aspect, based on a same inventive concept as the method embodiment of the first aspect, an embodiment of this application provides a tunnel establishment apparatus. The apparatus is applied to the first network device in the first aspect, in other words, the apparatus may be the first network device, or may be a chip that can be applied to the first network device. The apparatus has a function of implementing the embodiments in the first aspect. The function may be implemented by hardware, or may be implemented by hardware by executing corresponding software. The hardware or the software includes one or more modules corresponding to the foregoing functions.

According to a fourth aspect, based on a same inventive concept as the method embodiment provided in the second aspect, an embodiment of this application provides a tunnel establishment apparatus. The apparatus is applied to the network device in the second aspect, in other words, the apparatus may be the network device, or may be a chip that can be applied to the network device. The apparatus has a function of implementing the embodiments in the first aspect. The function may be implemented by hardware, or may be implemented by hardware by executing corresponding software. The hardware or the software includes one or more modules corresponding to the foregoing functions.

According to a fifth aspect, an embodiment of this application provides an apparatus, including a processor and a memory, where the memory is configured to store an instruction. When the apparatus runs, the processor executes the instruction stored in the memory, so that the apparatus performs the tunnel establishment method in any one of the first aspect or the embodiments of implementation methods of the first aspect. It should be noted that the memory may be integrated into the processor, or may be independent of the processor. The apparatus may further include a bus. The processor is coupled to the memory by using the bus. The memory may include a read-only memory and a random access memory. When the apparatus needs to run, a basic input/output system cured in the read-only memory or a bootloader system in an embedded system is used for startup, so that the apparatus enters a normal running state. After entering the normal running state, the apparatus runs an application program and an operating system in the random access memory, so that the processor performs the method in any one of the first aspect or the possible implementation embodiments of the first aspect.

According to a sixth aspect, an embodiment of this application provides an apparatus, including a processor and a memory, where the memory is configured to store an instruction. When the apparatus runs, the processor executes the instruction stored in the memory, so that the apparatus performs the tunnel establishment method in any one of the second aspect or the embodiments of implementation methods of the second aspect. It should be noted that the memory may be integrated into the processor, or may be independent of the processor. The apparatus may further include a bus. The processor is coupled to the memory by using the bus. The memory may include a read-only memory and a random access memory. When the apparatus needs to run, a basic input/output system cured in the read-only memory or a bootloader system in an embedded system is used for startup, so that the apparatus enters a normal running state. After entering the normal running state, the apparatus runs an application program and an operating system in the random access memory, so that the processor performs the method in any one of the second aspect or the possible implementation embodiments of the second aspect.

According to a seventh aspect, an embodiment of this application further provides a system, including the first network device in the third aspect or the fifth aspect and the network device in the fourth aspect or the sixth aspect. In a possible embodiment, the system may further include another network device that interacts with the above two types of network devices in the solution provided in the embodiments of this application, for example, another network device on the path of the to-be-established tunnel.

According to an eighth aspect, an embodiment of this application further provides a readable storage medium, where the readable storage medium stores a program or an instruction, and when the program or the instruction runs on a computer, the tunnel establishment method in any one of the foregoing aspects is performed.

According to a ninth aspect, an embodiment of this application further provides a computer program product including an instruction. When the computer program product runs on a computer, the computer is enabled to perform the tunnel establishment method in any one of the foregoing aspects.

In addition, for technical effects brought by any embodiment in the third to the ninth aspects, refer to technical effects brought by embodiments of different implementations in the first aspect to the second aspect. Details are not described herein.

