The embodiments relate to the field of data communications technologies, and in particular, to a data forwarding method and a related apparatus.
With rapid development of data communications technologies, more and more users exchange massive data information by accessing a data transmission network.
Data information is sent by a terminal device of a user to an access device of a data transmission network, and then is transmitted to a backbone network of the data transmission network via the access device. In a data information forwarding process, the data transmission network needs to determine a target forwarding path of the data information based on a service requirement of the data information. To control the data information to be forwarded based on the target forwarding path, the data transmission network needs to encapsulate a packet header for the data information at a controlled start node, where the controlled start node may be referred to as a head node, and the packet header carries the target forwarding path.
With rapid development of service requirements, a length of a target forwarding path may be greater than a maximum path length supported by a device in a data transmission network. Consequently, data information may fail to be normally transmitted in the data transmission network.
The embodiments provide a data forwarding method and a related apparatus, to resolve a problem that data information fails to be normally transmitted in a data transmission network because a target forwarding path is excessively long.
According to a first aspect, The embodiments provide a data forwarding method. The method may include:
obtaining, by a head node, to-be-forwarded data;
obtaining, by the head node, a first segment identifier (SID) list corresponding to the to-be-forwarded data, where the first SID list is generated based on SIDs of a part of nodes in a target forwarding path;
encapsulating, by the head node in front of the to-be-forwarded data, a packet header including the first SID list, to obtain a to-be-forwarded packet; and
sending, by the head node, the to-be-forwarded packet based on the first SID list.
The target forwarding path includes M nodes, the first SID list is generated based on first N nodes in the M nodes, the first SID list is replaced with a second SID list at an intermediate node, and the second SID list is generated based on an Xth node to a Yth node in the M nodes, where M is greater than N, N is greater than or equal to 1, X is greater than or equal to N, and Y is less than or equal to M.
In the solution provided in the embodiments, the M nodes related in the target forwarding path are classified into at least two subpaths, the SID list that is added by the head node in front of the to-be-forwarded data is generated based on a part of the M nodes, and a first subpath includes the first N nodes. In this way, a maximum quantity of SIDs that needs to be supported in transmission by a device in a data transmission network can be reduced, so that normal data transmission can be ensured when the target forwarding path is relatively long.
In a possible implementation, before obtaining a first SID list corresponding to the to-be-forwarded data, the method may include: receiving, by the head node, a segment routing (SR) policy sent by a controller, where the SR policy includes the first SID list; and
obtaining a first SID list corresponding to the to-be-forwarded data may include: obtaining, by the head node based on a service attribute of the to-be-forwarded data, an SR policy corresponding to the to-be-forwarded data; and determining a SID list included in the SR policy as the first SID list corresponding to the to-be-forwarded data.
In a possible implementation, obtaining a first SID list corresponding to the to-be-forwarded data may include: obtaining, by the head node, a SID of the head node, and reading a function field and a parameter argument field in the SID, where the function field is used to indicate to encapsulate, in front of the to-be-forwarded data, the packet header including the first SID list, and the argument field is used to indicate the first SID list.
In a possible implementation, the head node is connected to an ingress edge node in a DCN through a basic forwarding network;
the target forwarding path includes: the ingress edge node in the data center network (DCN), at least one SF node in the DCN, and an egress edge node in the DCN;
the first SID list is generated based on a SID of the ingress edge node in the DCN; the second SID list is generated based on the at least one SF node in the DCN and the egress edge node in the DCN; and the first SID list is replaced with the second SID list at the ingress edge node in the DCN; and
sending the to-be-forwarded packet based on the first SID list may include: sending the to-be-forwarded packet to the ingress edge node in the DCN based on the first SID list through the basic forwarding network.
In the embodiments, in a manner in which a first SID list in a plurality of SID lists includes only an edge node in the DCN, a SID of an internal node in the DCN network may be prevented from being exposed in the basic forwarding network, so that the data forwarding method provided in the embodiments may be applied to a scenario such as a telco cloud network.
In a possible implementation, the head node is connected to an ingress edge node in a first DCN subnet in a DCN through a first basic forwarding network in a basic forwarding network, and an egress edge node in the first DCN subnet is connected to an ingress edge node in a second DCN subnet in the DCN through a second basic forwarding network in the basic forwarding network;
the target forwarding path may include: the ingress edge node in the first DCN subnet, at least one SF node in the first DCN subnet, the egress edge node in the first DCN subnet, the ingress edge node in the second DCN subnet, at least one SF node in the second DCN subnet, and an egress edge node in the second DCN subnet;
the first SID list is generated based on a SID of the ingress edge node in the first DCN subnet; the first SID list is replaced with the second SID list at the ingress edge node in the first DCN subnet, and the second SID list is generated based on at least one SF node in the first DCN subnet and the egress edge node in the first DCN subnet; and the second SID list is replaced with a third SID list at the egress edge node in the first DCN subnet, and the third SID list is generated based on the ingress edge node in the second DCN subnet; and
sending the to-be-forwarded packet based on the first SID list may include: sending the to-be-forwarded packet to the ingress edge node in the first DCN subnet based on the first SID list through the first basic forwarding network.
In a possible implementation, the head node is a prefix aggregator (PRE-AGG), the first DCN subnet is an edge data center (EDC) network, the second DCN subnet is a regional data center (RDC) network, both an ingress edge node and an egress edge node in the EDC network are provider edge aggregators (PE-AGGs), and both an ingress edge node and an egress edge node in the RDC network are Data center gateways (DCGWs). For example, a SID of the ingress edge node and a SID of the egress edge node in the EDC network are a SID 1 and a SID 2 of the PE-AGGs respectively, and a SID of the ingress edge node and a SID of the egress edge node in the RDC network are a SID 1 and a SID 2 of the DCGWs respectively.
In a possible implementation, the at least one service fabric (SF) node in the first DCN subnet and the at least one SF node in the second DCN subnet are SF nodes in a telco cloud network; and
the first basic forwarding network is a metro network, and the second basic forwarding network is a core network.
In a possible implementation, an Mth node in the target forwarding path is a target node of a VPN service corresponding to the to-be-forwarded data;
encapsulating, in front of the to-be-forwarded data, a packet header including the first SID list may include:
encapsulating, in front of the to-be-forwarded data, an inner packet header including a SID of the target node;
encapsulating, in front of the inner packet header, an outer packet header including the first SID list; and
using to-be-forwarded data having the outer packet header and the inner packet header as the to-be-forwarded packet; and
sending the to-be-forwarded packet based on the first SID list may include: sending the to-be-forwarded packet based on the first SID list in the outer packet header.
In a possible implementation, the to-be-forwarded packet is an SRv6 packet.
According to a second aspect, the embodiments may provide a data forwarding method. The method may include:
receiving, by an intermediate node, a to-be-forwarded packet, where a packet header of the to-be-forwarded packet includes a first SID list;
obtaining, by the intermediate node, a second SID list corresponding to the to-be-forwarded packet;
replacing, by the intermediate node, the first SID list in the packet header with the second SID list; and
sending, by the intermediate node, the to-be-forwarded packet based on the second SID list.
The first SID list and the second SID list are separately generated based on SIDs of a part of nodes in a target forwarding path; and the target forwarding path may include M nodes, the first SID list is generated based on SIDs of an Xth node to a Yth node in the M nodes, and the second SID list is generated based on SIDs of a (Y+1)th node to a Zth node in the M nodes, where X is greater than or equal to 1, Y is greater than or equal to X, and Z is less than or equal to M.
In a possible implementation, the to-be-forwarded packet is an SRv6 packet.
In a possible implementation, the intermediate node is the Yth node in the M nodes.
In a possible implementation, before obtaining a second SID list corresponding to the to-be-forwarded packet, the method may include: receiving, by the intermediate node, an SR policy sent by a controller, where the SR policy includes the second SID list;
obtaining a second SID list corresponding to the to-be-forwarded packet may include: when an active SID in the first SID list is a SID of the intermediate node, obtaining, by the intermediate node, an operation instruction, where the operation instruction is used to instruct the intermediate node to replace the first SID list in the to-be-forwarded packet with the second SID list included in the SR policy; and determining, by the intermediate node, the second SID list included in the SR policy corresponding to the operation instruction as the second SID list corresponding to the to-be-forwarded packet; and
replacing the first SID list in the packet header with the second SID list may include: replacing the first SID list in the packet header with the second SID list based on an indication of the operation instruction.
In a possible implementation, obtaining a second SID list corresponding to the to-be-forwarded packet may include: obtaining, by the intermediate node, a SID of the intermediate node, and reading a function function field and a parameter argument field in the SID, where the function field is used to indicate to replace the first SID list with the second SID list, and the argument field is used to indicate the second SID list.
In a possible implementation, the intermediate node is an ingress edge node in a DCN, and the intermediate node is connected to a basic forwarding network;
the target forwarding path may include: the ingress edge node in the DCN, at least one SF node in the DCN, and an egress edge node in the DCN;
the first SID list is generated based on a SID of the ingress edge node in the DCN, and the second SID list is generated based on a SID of the at least one SF node in the DCN and a SID of the egress edge node in the DCN;
receiving, by an intermediate node, a to-be-forwarded packet may include: receiving, by the intermediate node through the basic forwarding network, the to-be-forwarded packet sent by a head node; and
sending the to-be-forwarded packet based on the second SID list may include: sending the to-be-forwarded packet to a first SF node in the at least one SF node in the DCN based on the second SID list through an internal node in the DCN.
In a possible implementation, the intermediate node is an egress edge node in a first DCN subnet in a DCN, and an egress edge node in the first DCN subnet is connected to an ingress edge node in a second DCN subnet in the DCN through a basic forwarding network;
the target forwarding path may include: the ingress edge node in the first DCN subnet, at least one SF node in the first DCN subnet, the egress edge node in the first DCN subnet, the ingress edge node in the second DCN subnet, at least one SF node in the second DCN subnet, and an egress edge node in the second DCN subnet;
the first SID list is generated based on the at least one SF node in the first DCN subnet and the egress edge node in the first DCN subnet;
the second SID list is generated based on the ingress edge node in the second DCN subnet, or the second SID list is generated based on the at least one SF node in the second DCN subnet and the egress edge node in the second DCN subnet;
receiving, by an intermediate node, a to-be-forwarded packet may include: receiving, by the intermediate node through an internal node in the first DCN subnet, the to-be-forwarded packet sent by a last SF node in the at least one SF node in the first DCN subnet; and
sending the to-be-forwarded packet based on the second SID list may include: sending the to-be-forwarded packet to the ingress edge node in the second DCN subnet based on the second SID list through the basic forwarding network.
In a possible implementation, the first DCN subnet is an EDC network, the second DCN subnet is an RDC network, both an ingress edge node and an egress edge node in the EDC network are PE-AGGs, and both an ingress edge node and an egress edge node in the RDC network are DCGWs; and a SID of the ingress edge node and a SID of the egress edge node in the EDC network are a SID 1 and a SID 2 of the PE-AGGs respectively, and a SID of the ingress edge node and a SID of the egress edge node in the RDC network are a SID 1 and a SID 2 of the DCGWs respectively.
In a possible implementation, at least one SF node in the EDC network and at least one SF node in the RDC network are SF nodes in a telco cloud network.
In a possible implementation, Z is less than M;
an Mth node in the target forwarding path is a target node of a VPN service corresponding to the to-be-forwarded packet;
the to-be-forwarded packet has an outer packet header and an inner packet header, where the outer packet header is encapsulated in front of the inner packet header;
the outer packet header may include the first SID list, and the inner packet header may include a SID of the target node of the VPN service;
replacing the first SID list in the packet header with the second SID list may include: replacing the first SID list in the outer packet header with the second SID list; and
sending the to-be-forwarded packet based on the second SID list may include: sending the to-be-forwarded packet based on the second SID list in the outer packet header.
According to a third aspect, the embodiments provide a data forwarding method. The method may include:
receiving, by a tail node, a to-be-forwarded packet, where a packet header of the to-be-forwarded packet includes a second SID list, and the second SID list is generated based on SIDs of a part of nodes in a target forwarding path;
removing, by the tail node, the packet header of the to-be-forwarded packet to obtain to-be-forwarded data; and
forwarding, by the tail node, the to-be-forwarded data based on a destination address of the to-be-forwarded data.
The target forwarding path includes M nodes, the second SID list is generated based on SIDs of a Zth node to an Mth node in the M nodes, the second SID list is obtained by replacing a first SID list at an intermediate node, and the first SID list is generated based on an Xth node to a Yth node in the M nodes, where Z is greater than 1 and less than or equal to M, X is greater than or equal to 1, and Y is less than or equal to Z; and a SID of the tail node is a last SID in the second SID list.
According to a fourth aspect, the embodiments provide a data forwarding method. The method may include:
receiving, by a tail node, a to-be-forwarded packet, where the to-be-forwarded packet includes an outer packet header and an inner packet header, the outer packet header includes a second SID list, the second SID list is generated based on SIDs of a part of nodes in a target forwarding path, and the inner packet header includes a SID of a target node of a VPN service corresponding to the to-be-forwarded packet;
removing, by the tail node, the outer packet header of the to-be-forwarded packet to obtain a to-be-forwarded packet; and
forwarding, by the tail node, the to-be-forwarded packet obtained by removing the outer packet header to the target node of the VPN service corresponding to the to-be-forwarded packet.
The target forwarding path may include M nodes, and the second SID list may be generated based on SIDs of an Xth node to an (M−1)th node in the M nodes, where X is greater than 1; a SID of the tail node is a last SID in the second SID list; and the target node of the VPN service is the Mth node.
According to a fifth aspect, the embodiments provide a data forwarding method. The method may include:
obtaining, by a controller, a target forwarding path, where the target forwarding path includes M nodes;
generating, by the controller, a first SID list based on SIDs of a first node to an Nth node in the M nodes;
generating, by the controller, a second SID list based on SIDs of an Xth node to a Yth node in the M nodes;
sending, by the controller, the first SID list to a head node; and
sending, by the controller, the second SID list to an intermediate node.
The intermediate node is the Nth node in the M nodes, where N is greater than or equal to 1, X is equal to N or N+1, and Y is less than or equal to M;
the head node is configured to encapsulate, in front of the to-be-forwarded data, a packet header may include the first SID list, to generate the to-be-forwarded packet; and send the to-be-forwarded packet to the intermediate node based on the first SID list; and
the intermediate node may be configured to replace the first SID list in the packet header of the to-be-forwarded packet with the second SID list, and forward the to-be-forwarded packet based on the second SID list.
In a possible implementation, sending the first SID list to a head node may include: sending an SR policy 1 to the head node, where the SR policy 1 includes the first SID list; and sending the second SID list to an intermediate node may include: sending an SR policy 2 to the intermediate node, where the SR policy 2 includes the second SID list.
In a possible implementation, Y is less than M, and an Mth node is a target node of a VPN service; and the method may further include:
sending a SID of the target node of the VPN service to the head node, where the head node is further configured to encapsulate, in front of the to-be-forwarded data, an inner packet header including the SID of the target node of the VPN service, and encapsulate, in front of the inner packet header, an outer packet header including the first SID list, to generate a to-be-forwarded packet; and send the to-be-forwarded packet to the intermediate node based on the first SID list in the outer packet header.
In a possible implementation, the controller is a DCN controller in a DCN.
According to a sixth aspect, the embodiments provide a data forwarding system. The system may include:
a head node, where the head node is configured to perform the data forwarding method according to the first aspect; and
at least one intermediate node, where the intermediate node is configured to perform the data forwarding method according to the second aspect.
In a possible implementation, the system may further include a tail node, where the tail node is configured to perform the data forwarding method according to the third aspect or the fourth aspect. The head node may be a PE-AGG, the intermediate node may be a PRE-AGG or a DCGW, and the tail node may be a DCGW.
In a possible implementation, the system may further include a controller, where the controller is configured to perform the data forwarding method according to the fifth aspect. The controller may be a DCN controller.
According to a seventh aspect, the embodiments provide a data forwarding apparatus, applied to a network system, where the network system includes a head node, an intermediate node, and a tail node, the apparatus is located on the head node, and the apparatus may include:
a receiving module, configured to receive to-be-forwarded data;
a processing module, configured to obtain a first SID list corresponding to the to-be-forwarded data, where the first SID list is generated based on SIDs of a part of nodes in a target forwarding path; and encapsulate, in front of the to-be-forwarded data, a packet header including the first SID list, to obtain a to-be-forwarded packet; and
a sending module, configured to send the to-be-forwarded packet based on the first SID list, where the target forwarding path includes M nodes, the first SID list is generated based on first N nodes in the M nodes, the first SID list is replaced with a second SID list at the intermediate node, and the second SID list is generated based on an Xth node to a Yth node in the M nodes, where M is greater than N, N is greater than or equal to 1, X is greater than or equal to N, and Y is less than or equal to M.
According to an eighth aspect, the embodiments provide a data forwarding apparatus, applied to a network system, where the network system includes a head node, an intermediate node, and a tail node, the apparatus is located on the intermediate node, and the apparatus may include:
a receiving module, configured to receive a to-be-forwarded packet, where a packet header of the to-be-forwarded packet includes a first SID list;
a processing module, configured to obtain a second SID list corresponding to the to-be-forwarded packet, and replace the first SID list in the packet header with the second SID list; and
a sending module, configured to send the to-be-forwarded packet based on the second SID list, where the first SID list and the second SID list are separately generated based on SIDs of a part of nodes in a target forwarding path; and the target forwarding path includes M nodes, the first SID list is generated based on SIDs of an Xth node to a Yth node in the M nodes, and the second SID list is generated based on SIDs of a (Y+1)th node to a Zth node in the M nodes, where X is greater than or equal to 1, Y is greater than or equal to X, and Z is less than or equal to M.
According to a ninth aspect, the embodiments provide a data forwarding apparatus, applied to a network system, where the network system includes a head node, an intermediate node, and a tail node, the apparatus is located on the tail node, and the apparatus may include:
a receiving module, configured to receive a to-be-forwarded packet, where a packet header of the to-be-forwarded packet includes a second SID list, and the second SID list is generated based on SIDs of a part of nodes in a target forwarding path;
a processing module, configured to remove the packet header of the to-be-forwarded packet to obtain to-be-forwarded data; and
a sending module, configured to forward the to-be-forwarded data based on a destination address of the to-be-forwarded data.
The target forwarding path may include M nodes, the second SID list is generated based on SIDs of a Zth node to an Mth node in the M nodes, the second SID list is obtained by replacing a first SID list at the intermediate node, and the first SID list is generated based on an Xth node to a Yth node in the M nodes, where Z is greater than 1 and less than or equal to M, X is greater than or equal to 1, and Y is less than or equal to Z; and a SID of the tail node is a last SID in the second SID list.
According to a tenth aspect, the embodiments provide a data forwarding apparatus, applied to a network system, where the network system includes a head node, an intermediate node, and a tail node, the apparatus is located on the tail node, and the apparatus may include:
a receiving module, configured to receive a to-be-forwarded packet, where the to-be-forwarded packet includes an outer packet header and an inner packet header, the outer packet header includes a second SID list, the second SID list is generated based on SIDs of a part of nodes in a target forwarding path, and the inner packet header includes a SID of a target node of a VPN service corresponding to the to-be-forwarded packet;
a processing module, configured to remove the outer packet header of the to-be-forwarded packet to obtain a to-be-forwarded packet; and
a sending module, configured to forward the to-be-forwarded packet obtained by removing the outer packet header to the target node of the VPN service corresponding to the to-be-forwarded packet, where the target forwarding path includes M nodes, and the second SID list is generated based on SIDs of an Xth node to an (M−1)th node in the M nodes, where X is greater than 1; a SID of the tail node is a last SID in the second SID list; and the target node of the VPN service is the Mth node.
According to an eleventh aspect, the embodiments provide a data forwarding apparatus, applied to a network system, where the network system includes a head node, an intermediate node, a tail node, and a controller, the apparatus is located on the controller, and the apparatus may include:
a receiving module, configured to obtain a target forwarding path, where the target forwarding path includes M nodes;
a processing module, configured to generate a first SID list based on SIDs of a first node to an Nth node in the M nodes, and generate a second SID list based on SIDs of an Xth node to a Yth node in the M nodes; and
a sending module, configured to send the first SID list to the head node, and send the second SID list to the intermediate node, where the intermediate node is the Nth node in the M nodes, N is greater than or equal to 1, X is equal to N or N+1, and Y is less than or equal to M.
In a possible implementation, the head node is configured to encapsulate, in front of to-be-forwarded data, a packet header by using the first SID list as a destination address in the packet header, to generate a to-be-forwarded packet; and send the to-be-forwarded packet to the intermediate node based on the destination address; and the intermediate node is configured to replace the first SID list in the packet header of the to-be-forwarded packet with the second SID list, and forward the to-be-forwarded packet based on a destination address in a packet header obtained through replacement.
For example, the data forwarding apparatus may be located on a controller side.
According to a twelfth aspect, the embodiments provide a node device, which may include:
one or more processors; and
a storage apparatus, configured to store one or more programs.
When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the data forwarding method according to the first aspect, the data forwarding method according to the second aspect, the data forwarding method according to the third aspect, or the data forwarding method according to the fourth aspect.
In a possible implementation, the node device may be a PRE-AGG. The node device may perform the data forwarding method according to the first aspect.
In a possible implementation, the node device may be a PE-AGG. The node device may perform the data forwarding method according to the second aspect or the data forwarding method according to the first aspect.
In a possible implementation, the node device may be a DCGW. The node device may perform the data forwarding method according to the second aspect and/or the data forwarding method according to the third aspect; or the node device may perform the data forwarding method according to the first aspect and the data forwarding method according to the third aspect.
According to a thirteenth aspect, the embodiments provide a computer-readable storage medium. The computer-readable storage medium stores instructions, and when the instructions are run on a computer, the instructions are used to perform the data forwarding method according to any one of the first aspect to the fourth aspect.
According to a fourteenth aspect, the embodiments provide a computer program. When the computer program is executed by a computer, the computer program is used to perform the data forwarding method according to any one of the first aspect to the fourth aspect.
Terms used in implementations are merely intended to explain exemplary embodiments, but are not intended to limit this application.
Solutions provided in the embodiments are used to implement a control process of transmitting to-be-forwarded data based on a preset target forwarding path in a data transmission network. In the embodiments, the data transmission network may include several nodes, and the target forwarding path may be defined as a list of node identifiers including node identifiers of at least two nodes.
A data forwarding method provided in the embodiments may be applied to a plurality of network architectures. The following separately describes, with reference to various network architectures, solutions and effects of the data forwarding method provided in the embodiments.
Based on the network architecture shown in
In an actual application, a segment routing SR technology defined by the source packet routing in networking (SPRING) working group (WG) in the internet engineering task force (IETF) may be used to implement the foregoing control manner.
SR is a tunneling technology based on a source routing forwarding mode. For one SR tunnel in the transmission network, an ingress node and an egress node of the SR tunnel may be respectively considered as the head node and the tail node in the foregoing control manner. The SR tunnel may correspond to a target forwarding path that includes at least two nodes and that is in the foregoing control manner. A basic design idea of the SR is that a per-flow status needs to be maintained only on the head node, but does not need to be maintained on the intermediate node and the tail node. The per-flow status is used by the SR tunnel to reserve a resource, such as bandwidth, for each service flow.
In the SR technology, an identifier of a node may be represented by a SID. The SID may be an instruction with topology or service semantics. The target forwarding path corresponding to the SR tunnel may be generated based on SIDs of the at least two nodes. For example, the target forwarding path may be formed by successively arranging the SIDs of the at least two nodes in a preset forwarding sequence. For example, identifiers of the head node, an intermediate node 1, an intermediate node 2, an intermediate node 3, and the tail node in the data transmission network shown in
In the SR technology, an SR data plane may be based on multi-protocol label switching (MPLS), or may be based on IPv6. The SR data plane based on multi-protocol label switching is referred to as the instantiation of SR on the MPLS data plane and the SR data plane based on IPv6 is referred to as the instantiation of SR on the IPv6 data plane (SRv6). When an SRv6 technology is used to implement the foregoing control manner, SIDs of nodes in the target forwarding path may form a SID list based on a service requirement, to indicate a forwarding path of an SRv6 tunnel defined in a manner in which SRv6 is used as a data plane. Each SID list may include at least one SID. For SRv6, a SID is a 16-bit IPv6 address in form and includes three parts: locator, function, and argument. Table 1 schematically shows a structure of a SID in an SRv6 packet.
The locator may be used for addressing that is related to routing. The function may be used to specify a function related to the SID, such as a topology function or a service function. The argument is an optional parameter, and may be used to specify a parameter for performing an operation related to the function. The function and the argument may be network programming parameters used to implement a network programming function of SRv6. The network programming function is described in the following.
It may be understood that for an SRv6 tunnel defined in an SRv6 mode, a traceroute function in common IPv6 may be used to detect a path of the SRv6 tunnel. In other words, the SID needs to support route forwarding based on a common IPv6 address on a common node other than an intermediate node in a forwarding path. In an example, if a locator part in the SID may match a network segment address in a routing table of the common node, the common node may forward the packet based on a next-hop address corresponding to the network segment address. In addition, some special nodes in SRv6 need to support an operation of modifying a SID list in an SRv6 packet header.
In the SR technology, for a packet of an SRv6 type (referred to as an SRv6 packet below), the IETF 6man WG defines that an IPv6 segment routing header (SRH) may be used to carry a SID list, to specify a forwarding path of the IPv6 packet. The SRH may be an IPv6 routing header with Routing Type=4. For example, a name of an IE corresponding to the SRH may be draft-ietf-6man-segment-routing-header-14. A loose source routing mode may be used for the SRH. That is, not all hop nodes in the forwarding path need to support and parse the SRH, and not all hop nodes in the forwarding path need to be included in the SID list in the SRH, either. In an example, the SID list in the SRH may include only one node. In some scenarios, an SRv6 tunnel packet may even not include an SRH field. For example, when a SID list that needs to be added includes a SID of only one node, the SID of the node may be added to a destination address field of a to-be-forwarded packet.
In the SR technology, before an SR tunnel is used to forward data based on a target forwarding path, the SR tunnel needs to be first established, that is, a SID of each node needs to be allocated and a SID list corresponding to the target forwarding path needs to be determined. The SID list used to establish the SR tunnel may be specified by using an explicit candidate path or a dynamic candidate path. In an example, a controller of the data transmission network may allocate a SID to each node. In another example, target forwarding paths may be planned for various types of to-be-forwarded data that arrive at the head node.
In the SR technology, when data is to be forwarded through the SRv6 tunnel defined in the SRv6 mode, nodes through which an SRv6 packet may pass in the data transmission network may be classified into the following device roles.
Non-SRv6 node: The non-SRv6 node is a node that does not support or use an SRv6 function. This type of node can only forward a common IPv6 packet. For example, this type of node does not support to forward a packet based on a SID list carried in an SRH field of a packet header. For another example, this type of node supports to forward only a to-be-forwarded packet in which an IP address in a destination address is native IPv6.
Forwarding node (Transit node): The forwarding node is a node on which the SRv6 function has been enabled. An active SID of an SRv6 packet is not installed in my local SID table on this type of node. It may be understood that a SID configured in my local SID table on a node is a SID of the node. An active SID of an SRv6 packet is a SID in a SID list carried in the SRv6 packet. The active SID is used to indicate a destination node at which the SRv6 packet is expected to arrive. When a node receives an SRv6 packet and an active SID in a SID list carried in a packet header of the SRv6 packet is not a SID of the node (that is, the active SID in the SRv6 packet is not installed), the node needs to forward the SRv6 packet based on a destination node indicated by the active SID. In this case, the node only forwards the packet without performing special processing. Therefore, the node serves as a forwarding node.
Binding SID (BSID) node: The BSID is a node on which the SRv6 function has been enabled and that uses a BSID mechanism (draft-ietf-spring-segment-routing-policy-01) to steer traffic to a new SR policy. In other words, the BSID node may be a node configured with an SR policy.
Endpoint node: The endpoint node is a node on which the SRv6 function has been enabled, and an active SID of an SRv6 packet has been installed in my local SID table on the node. It may be understood that, when a node receives an SRv6 packet and an active SID in a SID list carried in a packet header of the SRv6 packet is a SID of the node (that is, the active SID of the SRv6 packet has been installed on the node), the node needs to identify, as a new active SID, a next SID of a SID that is currently identified as the active ID and that is in the SID list carried in the SRv6 packet. Then, the current node continues to forward the SRv6 packet based on a destination node indicated by the new active SID. In this case, the node serves as an endpoint node. In other words, the endpoint node may be a node in a SID list corresponding to a target forwarding path.
It may be understood that my local SID table is used to implement an SRv6 network programming function. This table maintains all local SIDs (SIDs allocated and interpreted by the node) of the endpoint node. Based on the description in draft-filsfils-spring-srv6-network-programming-05, the SIDs in my local SID table need to be explicitly configured and generated.
It may be understood that the foregoing device roles are classified based on matching between an active SID and my local SID table in a forwarding process.
A process of forwarding to-be-forwarded data through an SRv6 tunnel may include as follows.
A head node (which may be considered as a BSID node) steers traffic to an SR policy. The head node obtains, based on a current active candidate path of the SR policy, a SID list corresponding to a specified path. Then, the head node encapsulates, in front of the to-be-forwarded data, a packet header including the SID list, to obtain a to-be-forwarded packet through encapsulation, where a first SID in the SID list is indicated as an active SID; and then forwards the to-be-forwarded packet to a downstream device by using the active SID as a destination address (DA). At any time when an SRv6 packet is forwarded through an SRv6 tunnel, there is only one active SID in a SID list of the SRv6 packet. The active SID is used to identify a SID of a next-hop node. When receiving the SRv6 packet, an intermediate node queries my local SID table based on the active SID (that is, an IPv6 DA). If a matching entry exists (that is, the active SID is a SID of the intermediate node), the intermediate node performs related processing based on a function associated with the hit local SID entry. After completing the related processing, the intermediate node updates the active SID in the SID list (for example, indicates a next SID of the current active SID in the SID list as a new active SID), and then the intermediate node forwards the SRv6 packet to a downstream node based on a destination node indicated by the updated active SID. When the SRv6 packet is forwarded to a tail node (a SID of the tail node is the same SID as the active SID and is a last SID in the SID list), the tail node may remove the packet header encapsulated in front of the to-be-forwarded data. One or more intermediate nodes (each intermediate node may be considered as an endpoint node) may exist between the head node and the tail node. One or more other nodes (which may be considered as non-SRv6 nodes or forwarding nodes) may exist between the head node and the intermediate node. One or more other nodes (which may be considered as non-SRv6 nodes or forwarding nodes) may exist between the intermediate node and the tail node.
It may be understood that, in the SR technology, an SR tunnel technology defined in an SRv6 manner has a general feature of SR. A difference between the SR tunnel technology defined in the SRv6 manner and an SR tunnel technology defined in an MPLS manner lies in that the tunnel technology defined in the SRv6 manner supports network programming With network programming, the tunnel technology defined in the SRv6 manner has powerful scalability.
In the SR technology, the function and the argument in the SID may be used as network programming parameters that support a network programming function. The network programming parameter may be used to indicate a node on a tunnel to process a packet based on a function corresponding to the network programming parameter, where the tunnel is defined in the SRv6 manner. The SR technology supports to define a plurality of types of functions.
For example, an end function may be used to implement a processing step in which an endpoint node updates an active SID and the endpoint node is indicated to forward an SRv6 packet based on an updated active SID. For example, the end function may include the following processing logic:
Another function may be a variant of the end function. It may be understood that an advantage of SRv6 network programming lies in that the function allows a plurality of extension forms. For example, an SRv6 network programming function allows logical extension in “any” form.
For another example, in the foregoing process of forwarding the to-be-forwarded data through the SRv6 tunnel, the head node in the transmission network may be a BSID node, and a network programming parameter carried in the SRv6 packet may be used to indicate the BSID node to preprocess SRv6 packet according to an SR policy corresponding to the SRv6 packet. For example, the BSID node may generate, based on a SID list corresponding to the SR policy, a packet header including the SID list, and encapsulate the packet header in front end of the to-be-forwarded data, to obtain a to-be-forwarded SRv6 packet.
In addition, an SRv6 technology that supports network programming may also be applied to a plurality of application scenarios. For example, the SRv6 technology may implement a packet forwarding control manner such as a border gateway protocol (BGP), an SR-based layer 3 VPN service (SR L3VPN), an Ethernet VPN-based layer 2 VPN service (EVPN L2VPN), an Ethernet VPN-based layer 3 VPN service (EVPN L3VPN), or a service function chain (SFC). In an example, a forwarding path that corresponds to a packet and that is defined based on the SR L3VPN may be used as a SID list, and the SID list is added to a packet header at the head node of the SRv6 tunnel.
In another embodiment, an IE name corresponding to network programming may be draft-filsfils-spring-srv6-network-programming-05.
It may be further understood that, in the SR technology, to shield topology details of a part of networks and avoid a problem of insufficient hardware chip MSD specifications, a BSID technology may be used to steer traffic to an SR policy. A BSID node is defined as a node with a special function on an SR tunnel. One or more SR policies may be preset on the BSID node, and each SR policy may correspond to one SID list. With reference to the foregoing forwarding procedure, the head node is assigned a role of the BSID node, and the head node may receive an SR policy in advance, where the SR policy includes a target forwarding path, and the SR policy may be delivered by a controller device in a network. The BSID node may encapsulate, in front of the to-be-forwarded data, a packet header including the SID list, to generate a to-be-forwarded packet. For example, the SID list may be located in an SRH field or a destination address field.
In the foregoing control manner, the SID list encapsulated by the head node in front of the to-be-forwarded data is generated based on SIDs of all nodes that need to be passed through in a complete target forwarding path. When there are a large quantity of nodes that need to be passed through, a length of the SID list is very long. For example, the complete target forwarding path may include an intermediate node 1, an intermediate node 2, an intermediate node 3, . . . , and an intermediate node 19, and a tail node. A SID list formed by SIDs of the nodes may be {SID 2; SID 3; SID 4; . . . , SID 20; SID 21}. Therefore, the BSID node and the endpoint node in the data transmission network need to support a SID list whose length is 20. It may be seen that, the implementation of the foregoing control manner has a relatively high requirement for a maximum SID depth (MSD) that needs to be supported by a device in the data transmission network. In some scenarios, when MSDs supported by some low-end devices in the data transmission network are less than a length of a SID list required in some service scenarios, data cannot be forwarded along the complete target forwarding path.
To resolve the foregoing problem, the embodiments provide the following data forwarding method.
The following uses the data transmission network shown in
To make a length of the SID list that needs to be added to to-be-forwarded data or a to-be-forwarded packet be relatively short, in an example, before the head node receives the to-be-forwarded data, on a control plane, a controller in the network may divide the target forwarding path into several segments. Division into two segments is used as an example. The SID list corresponding to the target forwarding path may be divided into a first SID list and a second SID list. Then, the controller may deliver the first SID list to the head node, and deliver the second SID list to a last node in the first SID list. The intermediate node in the interaction procedure shown in
S201: The head node receives to-be-forwarded data.
The to-be-forwarded data may be a data frame or an IP packet. For example, the data frame may be an Ethernet frame. The to-be-forwarded data may carry service attributes such as type information of a requested service and service-related parameter information. For example, the to-be-forwarded data is a video file and a file name on a server that are requested to be accessed. In an example, the head node may receive the to-be-forwarded data from another node.
S202: The head node obtains the first SID list corresponding to the to-be-forwarded data, where the first SID list is generated based on SIDs of first N nodes in M nodes in the target forwarding path, N is less than M, and N is greater than or equal to 1.
The head node may obtain, based on the service attribute of the to-be-forwarded data, an SR policy 1 corresponding to the to-be-forwarded data; and determine a SID list included in the SR policy 1 as the first SID list corresponding to the to-be-forwarded data. It may be understood that, from a perspective of a service, different service attributes may correspond to different target forwarding paths. The controller may pre-plan target forwarding paths corresponding to various service attributes, segment a target forwarding path with a relatively long length, and then, separately deliver SID lists obtained by segmenting a target forwarding path to the head node and another corresponding intermediate node by using different SR policies. The head node may store a correspondence between an SR policy and a service attribute, and when receiving to-be-forwarded data, obtain a corresponding SR policy based on a service attribute carried in the to-be-forwarded data.
In an exemplary embodiment, if N is equal to 1, the first SID list is generated based on a SID of a first node in the target forwarding path. In other words, the first SID list may include the SID of the first node in the target forwarding path. If N is greater than 1, the first SID list is generated based on SIDs of a first node to an Nth node in the target forwarding path. In other words, the first SID list may include the SIDs of the first node to the Nth node.
S203: The head node encapsulates, in front of the to-be-forwarded data, a packet header including the first SID list, to obtain a to-be-forwarded packet.
The to-be-forwarded packet obtained through encapsulation may include two parts: the packet header and the to-be-forwarded data. The packet header includes the first SID list. It may be understood that, that the packet header is encapsulated in front of the to-be-forwarded data means that the packet header is encapsulated outside the to-be-forwarded data rather than inside the to-be-forwarded data. Table 2 schematically shows the to-be-forwarded packet obtained through encapsulation.
In an implementation, when the first SID list includes only one SID, the SID may be directly used as a destination address in the packet header, and the packet header is encapsulated in front of the to-be-forwarded data. In another implementation, when the first SID list includes two or more SIDs, the SID list may be added to an SRH field in the packet header, and the packet header encapsulated with the SRH field is encapsulated in front of the to-be-forwarded data. In an exemplary embodiment, the foregoing two implementations may be used when the head node encapsulates, in front of the to-be-forwarded data, a packet header including any SID list and when the intermediate node replaces a SID list. S204: The head node sends the to-be-forwarded packet to an intermediate node based on the first SID list, where the intermediate node is the Nth node.
In an exemplary embodiment, when the SID list in the packet header includes only one SID, the SID may be located in the destination address in the packet header, and the head node may send the to-be-forwarded data to the intermediate node based on the destination address in the packet header. When the SID list in the packet header includes at least two SIDs, the SID list is added to the SRH field in the packet header. The head node needs to set a first SID that has not arrived and that is in the SID list to an active SID, and set the active SID as the destination address in the packet header, to indicate a next-hop address of the to-be-forwarded packet.
S205: The intermediate node obtains a second SID list corresponding to the to-be-forwarded packet, where the second SID list is generated based on an (N+1)th node to an Mth node in the M nodes in the target forwarding path.
When the intermediate node receives the to-be-forwarded packet, and an active SID in the first SID list in the to-be-forwarded packet is a SID of the intermediate node, the intermediate node may obtain an operation instruction matching the active SID, where the operation instruction is used to instruct the intermediate node to replace the first SID list in the to-be-forwarded packet with a second SID list included in an SR policy 2; and the intermediate node determines the second SID list included in the SR policy 2 corresponding to the operation instruction as the second SID list corresponding to the to-be-forwarded packet.
It may be understood that the operation instruction may be a processing step that matches the active SID and that is in my local SID table, for example, an operation corresponding to the SID, or may be a processing step indicated by a function field and an argument field of the active SID.
S206: The intermediate node replaces the first SID list in the packet header with the second SID list.
In an exemplary embodiment, the intermediate node may replace the first SID list in the packet header with the second SID list in two manners.
In an implementation, the intermediate node may completely replace the packet header of the received to-be-forwarded data with a new packet header. For example, an original packet header may be removed first, and then a new packet header is encapsulated, where the new packet header includes the second SID list. If the second SID list includes only one SID, the second SID list in the new packet header may be located in a destination address in the new packet header. If the second SID list includes two or more SIDs, the second SID list in the new packet header may be located in an SRH field in the new packet header, a SID of a next-hop node is set to an active SID, and the active SID is set to the destination address in the packet header. Another field in the new packet header may be filled based on a value of the field in the original packet header or generated based on an actual forwarding scenario requirement of a service. For example, the packet header may further include fields such as a source address and a flow label, and the fields may be copied or set to new values based on an actual status of a DCGW according to a local policy of the DCGW.
In another implementation, the intermediate node may alternatively replace only the SID list in the to-be-forwarded packet. When the first SID list on the head node is located in the destination address in the packet header, the intermediate node adds the second SID list to the SRH field in the packet header of the to-be-forwarded packet, sets a SID of a next-hop node to an active SID, and sets the active SID to the destination address in the packet header. When the first SID list on the head node is located in the SRH field in the packet header, the intermediate node may replace the first SID list in the SRH field in the original packet header with the second SID list, set a SID of a next-hop node to an active SID, and set the active SID to the destination address in the packet header.
S207: The intermediate node forwards the to-be-forwarded packet to the tail node based on the second SID list, where the tail node is the Mth node.
The intermediate node forwards the packet in a node list indicated by the second SID list, and finally forwards the packet to the tail node. It may be understood that, in the embodiments, when the SID of the intermediate node is an active SID, a SID of a next node at which the packet has not arrive needs to be set to an active SID, and the active SID is set to the destination address in the packet header, to indicate a next-hop address of the to-be-forwarded packet.
S208: The tail node removes the packet header of the to-be-forwarded packet to obtain the to-be-forwarded data.
In an example, both the head node and the intermediate node may be BSID nodes in an SRv6 tunnel. The intermediate node may be an endpoint node in the SRv6 tunnel. The tail node may be a last node in the target forwarding path.
In the embodiments, the M nodes related in the target forwarding path are classified into at least two subpaths, a first subpath includes the first N nodes, and a second subpath includes the (N+1)th node to the Mth node. In this way, a quantity of SIDs in a SID list in a to-be-forwarded packet that is transmitted by a device in the data transmission network may not exceed a quantity of MSDs supported by a single device. Therefore, normal data transmission can be ensured when the target forwarding path is relatively long.
In an exemplary embodiment, as shown in
S209: The tail node forwards the to-be-forwarded data based on a destination address of the to-be-forwarded data.
For example, the to-be-forwarded data may be a data frame or an IP packet, and the destination address of the to-be-forwarded data may be a destination MAC address in the data frame or a destination IP address in the IP packet. The tail node may continue to forward the to-be-forwarded data based on the destination MAC address in the data frame or the destination IP address in the IP packet.
In this embodiment, for example, as shown in
S210: The controller obtains a target forwarding path, where the target forwarding path includes M nodes.
The controller may pre-plan target forwarding paths based on various types of to-be-forwarded data that arrive at the head node. For example, the controller may plan different target forwarding paths for to-be-forwarded data that requests various services, segment each target forwarding path, and deliver a target forwarding path obtained through segmentation to a corresponding head node and intermediate node. For example, a target forwarding path that passes through several core network SF nodes in a telco cloud network may be planned for to-be-forwarded data that requests to access the internet. The to-be-forwarded data may carry a relevant service attribute identifying that a requested service is to access the internet.
S211: The controller generates a first SID list based on SIDs of a first node to an Nth node in the M nodes.
In an example, the controller may use SIDs of the intermediate node 1 and the intermediate node 2 as the first SID list, and use SIDs of the intermediate node 3 and the tail node as the second SID list. In another example, the controller may use a SID of the intermediate node 1 as the first SID list, and use SIDs of the intermediate node 2, the intermediate node 3, and the tail node as the second SID list. In another embodiment, the M nodes in the target forwarding path may alternatively be classified into three segments.
S212: The controller generates a second SID list based on SIDs of an Xth node to a Yth node in the M nodes, where X is equal to N+1.
S213: The controller sends the first SID list to the head node.
The sending the first SID list to the head node may include: sending an SR policy 1 to the head node, where the SR policy 1 includes the first SID list.
S214: The controller sends the second SID list to the intermediate node, where the intermediate node is the Nth node in the M nodes, and N is greater than or equal to 1.
The sending the second SID list to the intermediate node may include: sending an SR policy 2 to the intermediate node, where the SR policy 2 includes the second SID list.
In an exemplary embodiment, for the controller, a receiver of the first SID list may be the head node. The head node is configured to encapsulate, in front of to-be-forwarded data, a packet header including the first SID list (refer to Table 2), to generate a to-be-forwarded packet; and send the to-be-forwarded packet to the intermediate node based on the first SID list in the to-be-forwarded packet. A receiver of the second SID list may be the intermediate node. The intermediate node is configured to replace the first SID list in the packet header of the to-be-forwarded packet with the second SID list, and forward the to-be-forwarded packet based on a destination address in a packet header obtained through replacement.
In another embodiment, if three segments are obtained through division, that is, a first SID list, a second SID list, and a third SID list, the first SID list may be delivered to the head node, the second SID list is delivered to a last node in the first SID list, and the third SID list is delivered to a last node in the second SID list. In this case, the last node in the first SID list and a last node in the second SID list may be the intermediate node 1 and the intermediate node 2 respectively.
In this embodiment, the target forwarding path may alternatively be divided into more than two subpaths. For example, there may be a plurality of intermediate nodes in the data transmission network. For example, there may be three intermediate nodes.
S301: The head node receives to-be-forwarded data.
S302: The head node obtains a first SID list corresponding to the to-be-forwarded data, where the first SID list is generated based on SIDs of first N nodes in M nodes in the target forwarding path, N is less than M, and N is greater than or equal to 1.
S303: The head node encapsulates, in front of the to-be-forwarded data, a packet header including the first SID list, to obtain a to-be-forwarded packet.
S304: The head node sends the to-be-forwarded packet to the intermediate node 1 based on the first SID list, where the intermediate node 1 is an Nth node.
S305: The intermediate node 1 obtains a second SID list corresponding to the to-be-forwarded packet, where the second SID list is generated based on an (N+1)th node to an (X−1)th node in the M nodes.
S306: The intermediate node 1 replaces the first SID list in the packet header with the second SID list.
S307: The intermediate node 1 forwards the to-be-forwarded packet to the intermediate node 2 based on the second SID list, where the intermediate node 2 is the (X−1)th node.
S308: The intermediate node 2 obtains a third SID list corresponding to the to-be-forwarded packet, where the third SID list is generated based on an Xth node to a Yth node in the M nodes.
S309: The intermediate node 2 replaces the second SID list in the packet header with the third SID list.
S310: The intermediate node 2 forwards the to-be-forwarded packet to the intermediate node 3 based on the third SID list, where the intermediate node 3 is the Yth node.
S311: The intermediate node 3 obtains a fourth SID list corresponding to the to-be-forwarded packet, where the fourth SID list is generated based on a (Y+1)th node to a Zth node in the M nodes.
S312: The intermediate node 3 replaces the third SID list in the packet header with the fourth SID list.
S313: The intermediate node 3 forwards the to-be-forwarded packet to the tail node based on the fourth SID list, where the tail node is the Zth node.
S314: The tail node removes the packet header of the to-be-forwarded packet to obtain the to-be-forwarded data.
S315: The tail node forwards the to-be-forwarded data based on a destination address of the to-be-forwarded data.
Steps performed by the head node, the intermediate node, and the tail node in this embodiment may be implemented according to the implementation in the embodiment shown in
According to the data transmission method shown in any one of
The data forwarding method provided in the embodiments may be further applied to a network architecture.
In an actual application, the target transmission network in
In another embodiment, the DCN controller is configured to perform unified planning and management on the DCN.
In the network architecture shown in
Based on the network architecture shown in
It may be understood that, a difference from the metro network and the core network lies in that, the DCN is usually considered as a private network of an enterprise. In particular, an underlay network in the DCN is usually not expected to be directly exposed to the metro network and the core network. Therefore, in addition to controlling a service flow to be forwarded based on a configured SFC, a privacy requirement imposed by data forwarding also needs to be considered during SFC implementation. The privacy requirement may be summarized as the following constraint: An internal topology of a DCN and a SID of an SF node cannot be exposed to a basic forwarding network.
In addition, when the data forwarding methods shown in
It may be understood from the data forwarding methods shown in
In some scenarios of the embodiments, the head node may be connected to the ingress edge node in the DCN through a basic forwarding network.
As shown in
S601: The head node receives to-be-forwarded data.
The head node may be a PRE-AGG. In another embodiment, the head node may alternatively be a PE-AGG.
S602: The head node obtains a first SID list corresponding to the to-be-forwarded data, where the first SID list is generated based on SIDs of first N nodes in M nodes in a target forwarding path, and N is equal to 1.
The head node may obtain, based on a service attribute of the to-be-forwarded data, an SR policy 1 corresponding to the to-be-forwarded data; and determine a SID list included in the SR policy 1 as the first SID list corresponding to the to-be-forwarded data.
S603: The head node encapsulates, in front of the to-be-forwarded data, a packet header including the first SID list, to obtain a to-be-forwarded packet.
S604: The head node sends the to-be-forwarded packet to the intermediate node based on the first SID list, where the intermediate node is the ingress edge node in the DCN.
For example, the ingress edge node in the DCN may be a PRE-AGG or a DCGW.
S605: The intermediate node obtains a second SID list corresponding to the to-be-forwarded packet, where the second SID list is generated based on an (N+1)th node to an Mth node in the M nodes in the target forwarding path, and a node in the second SID list belongs to the DCN.
When an active SID in the first SID list is a SID of the intermediate node, the intermediate node may obtain a function matching the active SID, where the function is used to instruct the intermediate node to replace the first SID list in the to-be-forwarded packet with a second SID list included in an SR policy 2; and the intermediate node determines the second SID list included in the SR policy 2 corresponding to the function as the second SID list corresponding to the to-be-forwarded packet.
S606: The intermediate node replaces the first SID list in the packet header with the second SID list.
S607: The intermediate node forwards the to-be-forwarded packet to the tail node based on the second SID list, where the tail node is the Mth node.
The intermediate node forwards the packet in a node list indicated by a destination address in the packet header, and finally forwards the packet to the tail node.
S608: The tail node removes the packet header of the to-be-forwarded packet to obtain the to-be-forwarded data.
S609: The tail node forwards the to-be-forwarded data based on a destination address of the to-be-forwarded data.
In another embodiment, the DCN may further include a first DCN subnet and a second DCN subnet. The first DCN subnet may include an ingress edge node and an egress edge node in the first DCN subnet, and at least one SF node in the first DCN subnet. The second DCN subnet may include an ingress edge node and an egress edge node in the second DCN subnet, and at least one SF node in the second DCN subnet.
For example, a data forwarding process in a hierarchical DCN is similar to an interaction process in the data forwarding method shown in
It may be understood that a SID list 1 that corresponds to the SR policy 1 and that matches the head node includes only a SID of the ingress edge node in the first DCN subnet, and the ingress edge node may be a first node that is in the target forwarding path and that belongs to the first DCN subnet. A SID list 2 that corresponds to the SR policy 2 and that matches the ingress edge node (that is, the intermediate node) of the first DCN subnet includes a SID of an internal node (that is, an SF node in the target forwarding path) of the first DCN subnet and a SID of the egress edge node (that is, the intermediate node) of the first DCN subnet. A SID list 3 that corresponds to an SR policy 3 and that matches the egress edge node (that is, the intermediate node) of the first DCN subnet includes a SID of the tail node or a SID of the ingress edge node (that is, the intermediate node) of the second DCN subnet. This manner can ensure that a SID of an internal node in each hierarchical DCN subnet is not exposed to the basic forwarding network, thereby meeting a privacy requirement imposed by data forwarding when an SRv6 technology is applied to a DCN and a telco cloud network.
Steps performed by the head node, the intermediate node 1, the intermediate node 2, the intermediate node 3, and the tail node in this embodiment may be implemented according to the implementation in the embodiment shown in
Based on the foregoing data forwarding method, the embodiments may further provide a data forwarding method, where the method may be applied to a scenario in which an SRv6 tunnel carries a VPN service.
To resolve the foregoing problem, according to the data forwarding method provided in the embodiments, the packet header added by the head node in front of the to-be-forwarded data is divided into two parts: an inner packet header and an outer packet header. The inner packet header may be used to carry a SID of a VPN service, and may be referred to as a service header. The outer packet header may be used to carry a SID list related to a target forwarding path, and may be referred to as a transport header. When replacing the SID list, the intermediate node only needs to replace the SID list included in the outer packet header. When removing the packet header, the tail node may remove the outer packet header and the inner packet header. In this way, a data forwarding scenario in which an SRv6 tunnel carries a VPN service can be supported on the basis of path segment delivery.
S801: The PE 1 sends to-be-forwarded data to the head node.
For example, the to-be-forwarded data is an Ethernet frame.
S802: The head node determines that a SID of a VPN service corresponding to the to-be-forwarded data is a SID of the PE 2.
The head node may determine, based on an ingress port that receives the to-be-forwarded data, whether to transmit the to-be-forwarded data based on the VPN service, and the head node may obtain the SID of the VPN service from a controller in advance.
S803: The head node obtains a first SID list corresponding to the to-be-forwarded data.
The first SID list is generated based on first N nodes in M nodes in a target forwarding path.
S804: The head node encapsulates, in front of the to-be-forwarded data, an inner packet header including the SID of the PE 2.
The SID of the PE 2 may be located in a destination address or an SRH field in the inner packet header.
S805: The head node encapsulates, in front of the inner packet header, an outer packet header including the first SID list.
S806: The head node uses to-be-forwarded data having the outer packet header and the inner packet header as a to-be-forwarded packet.
Table 3 schematically shows the to-be-forwarded packet obtained by adding the outer packet header and the inner packet header.
S807: Send the to-be-forwarded packet to the intermediate node based on the first SID list in the outer packet header of the to-be-forwarded packet.
S808: The intermediate node obtains a second SID list corresponding to the to-be-forwarded packet.
The second SID list is generated based on an (N+1)th node to an Mth node in the M nodes in the target forwarding path.
S809: The intermediate node replaces the first SID list in the outer packet header with the second SID list.
S810: The intermediate node forwards the to-be-forwarded packet to the tail node based on the second SID list in the outer packet header, where the tail node is the Mth node.
Steps S808 to S810 are similar to steps S205 to S207.
S811: The tail node removes the outer packet header of the to-be-forwarded packet to obtain a to-be-forwarded packet, where a packet header of the obtained to-be-forwarded packet includes the SID of the VPN service.
S812: The tail node forwards the to-be-forwarded packet to the PE 2 based on the SID that is of the VPN service and that is in the to-be-forwarded packet.
S813: The PE 2 removes the packet header that is in the to-be-forwarded packet and that includes the SID of the VPN service, to obtain the to-be-forwarded data.
S814: The PE 2 forwards the to-be-forwarded data based on a destination address of the to-be-forwarded data.
In another embodiment, the tail node may alternatively remove the outer packet header and the inner packet header, and send, to the PE 2, the to-be-forwarded data obtained by removing the outer packet header and the inner packet header.
In this embodiment, there may be a plurality of intermediate nodes in the foregoing embodiment, or the intermediate nodes may be edge nodes in a plurality of DCN subnets.
In another embodiment, a pre-planned target forwarding path may alternatively include the target node of the VPN service. For example, a SID of an Mth node in the target forwarding path may be the SID of the VPN service. In this case, the second SID list may be generated based on an (N+1)th node to a Zth node in the M nodes in the target forwarding path, where Z may be equal to M−1.
Steps performed by the head node, the intermediate node, and the tail node in this embodiment may be implemented according to the implementation in the embodiment shown in
The following describes the data forwarding method provided in the embodiments by using an example in a scenario in which service flow control of a VPN service is supported in a telco cloud network deployed in a hierarchical DCN.
The following provides detailed descriptions with reference to
Based on the network architecture shown in
Step 1.1: A DCN controller automatically discovers information related to SF nodes distributed in a telco cloud network and allocates and delivers corresponding SRv6 SIDs to these SF nodes.
The SF node deployed in the telco cloud network may notify the DCN controller of identification information of the SF node in a broadcast manner and request the DCN controller to allocate a SID to the SF node.
Step 1.2: A WAN controller allocates corresponding SRv6 SIDs to devices in a metro network and a core network.
The WAN controller may be a controller in a basic forwarding network. For example, a device in the basic forwarding network may send device identification information of the device to the WAN controller and request the WAN controller to allocate a SID to the device.
Step 1.3: An orchestrator coordinates information related to the DCN controller and the WAN controller, orchestrates Topology SIDs and service SIDs in a unified manner based on a service requirement, to generate several SR policies, and delivers the SR policies to an ingress PE (PRE-AGG) of EVPN SRv6 and gateway devices of a hierarchical DC (PE-AGG/DC-GW).
In this embodiment, it may be understood that, when the DCN controller coordinates with the WAN controller, the DCN controller may determine, based on a case in which a DCN subnet is isolated by a plurality of basic forwarding subnets of the basic forwarding network, a segment forwarding path that is obtained through division and that corresponds to a target forwarding path.
For example, the orchestrator may first plan service chains based on various services in a telco cloud network, that is, lists of SIDs of SF nodes through which various types of to-be-forwarded data need to pass in a DCN. These service chains may be considered as target forwarding paths corresponding to SRv6 tunnels. Then, the orchestrator segments, by using a quantity of levels of the hierarchical DCN as a quantity of segments into which a SID list that needs to be segmented and that corresponds to the target forwarding path, using an ingress edge node in each-level DCN as a last node of each segment, and using a tail node as a last node of a last segment, the SID list corresponding to the target forwarding path. For example, three levels may correspond to three segments.
In addition, the orchestrator separately notifies a SID of a VPN service to the PRE-AGG (which may be considered as a head node).
Then, the WAN controller and the DCN controller may deliver an allocated SID and a SID list that is obtained through segmentation.
After the foregoing control procedure is performed, a SID of each node has been allocated and delivered, and an SR policy on each BSID node also has been delivered.
For example, Table 4 schematically shows planning of a SID of each node on an SRv6 tunnel.
Table 4 shows a name of each node device in the data transmission network, a SID identifier corresponding to the node device, a SID type corresponding to the SID identifier of the node device, an operation instruction corresponding to the SID identifier, a device description, and an SR policy corresponding to the SID identifier of the node device.
SID types corresponding to SID identifiers of the PRE-AGG, the PE-AGG, and the DCGW all correspond to a device whose SID type is a BSID node type. Leaf (EDC) and Leaf (RDC) respectively represent a leaf node located in the EDC network and a leaf node located in the RDC network. Leaf (EDC network) represents a node device on which an SF is deployed and that is in the EDC network. For example, two SFs such as a vIPS and a vFW are deployed on the leaf, and SIDs of the SFs are represented by the vIPS and the vFW. AC1 represents a SID of an ingress interface on the PRE-AGG, and AC2 represents a SID of an egress interface on a PE connected to an IGW.
Referring to
In the embodiments, a SID in each DCN subnet is allowed to be advertised only to a device in the DCN subnet and an edge device in the DCN subnet or a gateway device in the DCN subnet. For an EDC network, the PE-AGG is an edge device of the EDC network, and a vIPS and a vFW are SIDs of SFs deployed on a leaf node in the EDC network. Because the PE-AGG learns an internal topology structure of the EDC network, the PE-AGG may control, based on a SID that is of each SF and that is carried in a packet, the packet to successively pass through SFs in SFCs based on the SFCs indicated by a SID list in a packet header. Similarly, for an RDC network, the DCGW is a gateway device of the RDC network, and a vWOC is a SID of an SF deployed on a leaf node in the RDC network. Because the DCGW learns an internal topology structure of the RDC network, the DCGW may control, based on a SID that is of each SF and that is carried in a packet, the packet to successively pass through SFs in SFCs based on the SFCs indicated by a SID list in a packet header. In another embodiment, the DCN subnet may alternatively be a DCN subnet applied to another service other than a telco cloud, and the vIPS, the vFW, and the vWOC may alternatively be SFs that need to be accessed by another service in a telco cloud network.
It may be understood that the foregoing SIDs are planned for an EVPN SRv6 VPWS service. If other types of services, such as BGP SRv6 L3VPN, EVPN SRv6 VPLS, and EVPN SRv6 L3VPN, need to be deployed in an SRv6 tunnel manner, differentiated planning needs to be performed for SIDs on a PRE-AGG (an ingress PE of a VPN service) and a PE (an egress PE of the VPN service). In an example, SIDs of a head node and a tail node in a target forwarding path may be planned based on a requirement of another service type. The solutions of the embodiments are mainly designed for processing on a hierarchical DC gateway (a PE-AGG and a DCGW) in an edge device or a gateway device in a DCN subnet. Therefore, for a type of a service carried on an SRv6 tunnel, there is no difference in implementing the method provided in this embodiment by an intermediate node.
In this embodiment, an SR policy corresponding to each SID may be preconfigured. An SR policy corresponding to AC1 may be an SR policy 1, an SR policy corresponding to B1 may be an SR policy 2, an SR policy corresponding to B2 may be an SR policy 3, and an SR policy corresponding to B3 may be an SR policy 4.
Table 5 shows an example of the SR policies. Table 5 shows the SR policy 1 to the SR policy 4.
In the embodiments, the outer packet header may be referred to as a transport header, and an inner packet header may be referred to as a service header.
As shown in
Step 2.1: After receiving an Ethernet frame from an AC interface, a PRE-AGG steers the Ethernet frame to a corresponding SR policy 1, and encapsulates two IPv6 headers outside the Ethernet frame. A SID carried in an inner IPv6 header is AC2, and a SID carried in an outer IPv6 header is B1. An SRv6 tunnel packet obtained through encapsulation is sent to a PE-AGG.
The PRE-AGG determines, based on a case in which a requested service in the Ethernet frame is to access the internet, that an SR policy corresponding to a service attribute of the Ethernet frame is an SR policy 1, and obtains a SID list of a first segment, that is, B1. In addition, the PRE-AGG determines, according to an instruction of a DCN controller or based on a VPN service configuration of the PRE-AGG, to implement a VPWS in a manner of an SRv6-based EVPN service, and obtains a SID of a destination node of a VPN service, that is AC2, a SID of an egress port of a PE. In an example, when an ingress port of the received Ethernet frame is AC1, the PRE-AGG may determine that a to-be-forwarded packet needs to be forwarded in a manner of the VPN service and determine the SID of the destination node corresponding to the VPN service.
Step 2.2: After receiving the SRv6 tunnel packet, the PE-AGG determines that an active SID is B1 and an SR policy corresponding to B1 is an SR policy 2 and steers the received SRv6 tunnel packet to the SR policy 2 by using B1. A function configured for B1 is End.DB6. Therefore, after the outer IPv6 header is removed, an outer IPv6 header corresponding to the SR policy 2 is re-encapsulated, that is, the outer IPv6 header is replaced. Then, an SRv6 tunnel packet obtained through re-encapsulation is forwarded to an EDC network.
Step 2.3: In the EDC network, the SRv6 tunnel packet is forwarded to a vIPS and then to a vFW for processing. In this process, a leaf node may need to implement a processing procedure of an SFC proxy. After the processing in the EDC network is completed, the active SID in the SRv6 tunnel packet changes to B2, and the SRv6 tunnel packet is sent back to the PE-AGG based on B2.
Step 2.4: The PE-AGG determines that the active SID is B2 and an SR policy corresponding to B2 is an SR policy 3, steers the SRv6 tunnel packet to the SR policy 3 by using a function (End.DB6) configured for B2, processes the packet, removes the outer IPv6 header, and re-encapsulates an outer IPv6 header corresponding to the SR policy 3. Then, a first SID in the outer IPv6 header of the SRv6 tunnel packet obtained through re-encapsulation is a SID of an ingress interface of a DCGW, that is, B3. The SRv6 tunnel packet is forwarded to the DCGW based on B3.
Step 2.5: The DCGW determines that the active SID is B3 and an SR policy corresponding to B3 is an SR policy 4, steers the SRv6 tunnel packet to the SR policy 4 by using a function (End.DB6) configured for B3, processes the packet, removes the outer IPv6 header, and re-encapsulates an outer IPv6 header corresponding to the SR Policy 4. Then, an SRv6 tunnel packet obtained through re-encapsulation is forwarded to an RDC network.
Step 2.6: Processing in the RDC network is similar to that in the EDC network (Step 2.3). For example, the SRv6 tunnel packet may be forwarded to a vWOC for processing. After the processing in the RDC network is completed, the active SID in the SRv6 tunnel packet changes to B4, and the SRv6 tunnel packet is sent back to the DCGW based on B4.
Step 2.7: After receiving the SRv6 tunnel packet sent back by the RDC network, the DCGW determines that the active SID is B4; and because a function of B4 is End.DT6, after removing the outer IPv6 header, the DCGW uses a DA (that is, AC2) in the inner IPv6 header to query my local SID table, and then, forwards the packet including the inner IPv6 header to the PE.
Step 2.8: After receiving the foregoing IPv6 packet, the PE determines that the SID used as a destination address in the packet header is AC2, associates AC2 with a corresponding AC interface by using a function (End.DX2) configured for AC2, processes the packet, removes the inner IPv6 header, and sends the Ethernet frame by using the AC interface.
For details of step 2.2 to step 2.8 in this embodiment, refer to descriptions in the foregoing embodiments.
It may be understood from the foregoing embodiment that, when the method is applied to an SRv6-based L2VPN/L3VPN, two IPv6 headers (which may or may not carry an SRH) are encapsulated in front of a service packet (Ethernet/IPv4/IPv6), so that a transport layer is separated from a service layer, thereby reducing a requirement for an SRv6 MSD.
A new SRv6 function (End.DB6) is defined in the embodiments, and the function is deployed on a gateway device of a hierarchical DC (ADC/EDC/RDC/CDC). With reference to an SR BSID mechanism, topology information and service information in the hierarchical DC are shielded externally (Metro/Core Network). In this way, an SRv6 SFC is effectively implemented.
In addition, because the constraint condition described in the foregoing embodiment can be met, the method can be efficiently applied to an SR SFC scenario of a telco cloud. In addition, only an ingress PE (the PRE-AGG) and a gateway device (the PE-AGG/DCGW) in the hierarchical DC need to be slightly modified. Therefore, the implementation is simple. An SDN controller can be used to automatically generate and deliver an SR policy. This facilitates deployment. In addition, the foregoing solution supports both an SR shortest path (Best Effort, BE) mode (which refers to an optimal SR LSP calculated by an IGP by using a shortest path algorithm) and an SR traffic engineering (TE) mode, and is applicable to various SRv6 VPNs (including a BGP SRv6 L3VPN, an EVPN SRv6 L2VPN/L3VPN, and the like). The foregoing solution is widely applied.
In an implementation of this embodiment, the data forwarding apparatus 1300 may be configured to perform steps performed by the head node in the data forwarding method shown in any one of the foregoing embodiments.
The receiving module 1310 may be configured to obtain to-be-forwarded data.
The processing module 1320 may be configured to obtain a first SID list corresponding to the to-be-forwarded data, where the first SID list is generated based on SIDs of a part of nodes in a target forwarding path; and encapsulate, in front of the to-be-forwarded data, a packet header including the first SID list, to obtain a to-be-forwarded packet.
The sending module 1330 may be configured to send the to-be-forwarded packet based on the first SID list. The target forwarding path includes M nodes, the first SID list is generated based on first N nodes in the M nodes, the first SID list is replaced with a second SID list at an intermediate node, and the second SID list is generated based on an Xth node to a Yth node in the M nodes, where M is greater than N, N is greater than or equal to 1, X is greater than or equal to N, and Y is less than or equal to M.
In a possible implementation, the receiving module 1310 may be further configured to: before the first SID list corresponding to the to-be-forwarded data is obtained, receive an SR policy sent by a controller, where the SR policy includes the first SID list.
The processing module 1320 may be configured to obtain, based on a service attribute of the to-be-forwarded data, an SR policy corresponding to the to-be-forwarded data; and determine a SID list included in the SR policy as the first SID list corresponding to the to-be-forwarded data.
In a possible implementation of this embodiment, the head node is connected to an ingress edge node in a DCN through a basic forwarding network.
The target forwarding path may include: the ingress edge node in the DCN, at least one SF node in the DCN, and an egress edge node in the DCN.
The first SID list is generated based on a SID of the ingress edge node in the DCN.
The sending module 1330 may be configured to send the to-be-forwarded packet to the ingress edge node in the DCN based on the first SID list through the basic forwarding network.
In a possible implementation of this embodiment, the head node is connected to an ingress edge node in a first DCN subnet in a DCN through a first basic forwarding network in a basic forwarding network, and an egress edge node in the first DCN subnet is connected to an ingress edge node in a second DCN subnet in the DCN through a second basic forwarding network in the basic forwarding network.
The target forwarding path includes: the ingress edge node in the first DCN subnet, at least one SF node in the first DCN subnet, the egress edge node in the first DCN subnet, the ingress edge node in the second DCN subnet, at least one SF node in the second DCN subnet, and an egress edge node in the second DCN subnet.
The first SID list is generated based on a SID of the ingress edge node in the first DCN subnet.
The sending module 1330 may be configured to send the to-be-forwarded packet to the ingress edge node in the first DCN subnet based on the first SID list through the first basic forwarding network.
In a possible implementation of this embodiment, the head node is a PRE-AGG, the first DCN subnet is an EDC network, the second DCN subnet is an RDC network, both an ingress edge node and an egress edge node in the EDC network are PE-AGGs, and both an ingress edge node and an egress edge node in the RDC network are DCGWs.
In a possible implementation, the at least one SF node in the first DCN subnet and the at least one SF node in the second DCN subnet are SF nodes in a telco cloud network; and the first basic forwarding network is a metro network, and the second basic forwarding network is a core network.
In a possible implementation, an Mth node in the target forwarding path is a target node of a VPN service corresponding to the to-be-forwarded data.
The processing module 1320 may be configured to encapsulate, in front of the to-be-forwarded data, an inner packet header including a SID of the target node, and encapsulate, in front of the inner packet header, an outer packet header including the first SID list; and use to-be-forwarded data having the outer packet header and the inner packet header as the to-be-forwarded packet.
The sending module 1330 may be configured to send the to-be-forwarded packet based on the first SID list in the outer packet header.
In a possible implementation of this embodiment, the to-be-forwarded packet is an SRv6 packet.
In another implementation of this embodiment, the data forwarding apparatus 1300 may be configured to perform steps performed by the intermediate node in the data forwarding method shown in any one of the foregoing embodiments.
The receiving module 1310 may be configured to receive a to-be-forwarded packet, where a packet header of the to-be-forwarded packet includes a first SID list.
The processing module 1320 may be configured to obtain a second SID list corresponding to the to-be-forwarded packet, and replace the first SID list in the packet header with the second SID list.
The sending module 1330 may be configured to send the to-be-forwarded packet based on the second SID list. The first SID list and the second SID list are separately generated based on SIDs of a part of nodes in a target forwarding path; and the target forwarding path includes M nodes, the first SID list is generated based on SIDs of an Xth node to a Yth node in the M nodes, and the second SID list is generated based on SIDs of a (Y+1)th node to a Zth node in the M nodes, where X is greater than or equal to 1, Y is greater than or equal to X, and Z is less than or equal to M.
In a possible implementation of this embodiment, the to-be-forwarded packet may be an SRv6 packet.
In a possible implementation of this embodiment, the intermediate node may be the Yth node in the M nodes.
In a possible implementation of this embodiment, the receiving module 1310 may be configured to: before the second SID list corresponding to the to-be-forwarded packet is obtained, receive an SR policy sent by a controller, where the SR policy includes the second SID list.
The processing module 1320 may be configured to: when an active SID in the first SID list is a SID of the intermediate node, obtain a function, where the function is used to instruct the intermediate node to replace the first SID list in the to-be-forwarded packet with the second SID list included in the SR policy; determine the second SID list included in the SR policy corresponding to the function as the second SID list corresponding to the to-be-forwarded packet; and replace the first SID list in the packet header with the second SID list based on an indication of the function.
In a possible implementation of this embodiment, the intermediate node is an ingress edge node in a DCN, and the intermediate node is connected to a basic forwarding network.
The target forwarding path includes: the ingress edge node in the DCN, at least one SF node in the DCN, and an egress edge node in the DCN.
The first SID list is generated based on a SID of the ingress edge node in the DCN, and the second SID list is generated based on a SID of the at least one SF node in the DCN and a SID of the egress edge node in the DCN.
The receiving module 1310 may be configured to receive, through the basic forwarding network, the to-be-forwarded packet sent by a head node.
The sending module 1330 may be configured to send the to-be-forwarded packet to a first SF node in the at least one SF node in the DCN based on the second SID list through an internal node in the DCN.
In a possible implementation of this embodiment, the intermediate node is an egress edge node in a first DCN subnet in a DCN, and an egress edge node in the first DCN subnet is connected to an ingress edge node in a second DCN subnet in the DCN through a basic forwarding network.
The target forwarding path includes: the ingress edge node in the first DCN subnet, at least one SF node in the first DCN subnet, the egress edge node in the first DCN subnet, the ingress edge node in the second DCN subnet, at least one SF node in the second DCN subnet, and an egress edge node in the second DCN subnet.
The first SID list is generated based on the at least one SF node in the first DCN subnet and the egress edge node in the first DCN subnet.
The second SID list is generated based on the ingress edge node in the second DCN subnet.
The receiving module 1310 may be configured to receive, through an internal node in the first DCN subnet, the to-be-forwarded packet sent by a last SF node in the at least one SF node in the first DCN subnet.
The sending module 1330 may be configured to send the to-be-forwarded packet to the ingress edge node in the second DCN subnet based on the second SID list through the basic forwarding network.
In a possible implementation of this embodiment, the first DCN subnet is an EDC network, the second DCN subnet is an RDC network, both an ingress edge node and an egress edge node in the EDC network are PE-AGGs, and both an ingress edge node and an egress edge node in the RDC network are DCGWs.
In a possible implementation of this embodiment, at least one SF node in the EDC network and at least one SF node in the RDC network are SF nodes in a telco cloud network.
In a possible implementation of this implementation, Z is less than M; an Mt node in the target forwarding path is a target node of a VPN service corresponding to the to-be-forwarded packet; and the to-be-forwarded packet has an outer packet header and an inner packet header. The outer packet header is encapsulated in front of the inner packet header, and the outer packet header includes the first SID list. The inner packet header includes the target node of the VPN service.
The processing module 1320 may be configured to replace the first SID list in the outer packet header with the second SID list.
The sending module 1330 may be configured to send the to-be-forwarded packet based on the second SID list in the outer packet header.
In still another implementation of this embodiment, the data forwarding apparatus 1300 may be configured to perform steps performed by the tail node in the data forwarding method shown in any one of the foregoing embodiments.
The receiving module 1310 may be configured to receive a to-be-forwarded packet, where a packet header of the to-be-forwarded packet includes a second SID list, and the second SID list is generated based on SIDs of a part of nodes in a target forwarding path.
The processing module 1320 may be configured to remove the packet header of the to-be-forwarded packet to obtain to-be-forwarded data.
The sending module 1330 may be configured to forward the to-be-forwarded data based on a destination address of the to-be-forwarded data.
The target forwarding path includes M nodes, the second SID list is generated based on SIDs of a Zth node to an Mth node in the M nodes, the second SID list is obtained by replacing a first SID list at an intermediate node, and the first SID list is generated based on an Xth node to a Yth node in the M nodes, where Z is greater than 1 and less than or equal to M, X is greater than or equal to 1, and Y is less than or equal to Z; and a SID of the tail node is a last SID in the second SID list.
In yet another implementation of this embodiment, the data forwarding apparatus 1300 may be configured to perform steps performed by the tail node in the data forwarding method shown in any one of the foregoing embodiments.
The receiving module 1310 may be configured to receive a to-be-forwarded packet, where the to-be-forwarded packet includes an outer packet header and an inner packet header, the outer packet header includes a second SID list, the second SID list is generated based on SIDs of a part of nodes in a target forwarding path, and the inner packet header includes a SID of a target node of a VPN service corresponding to the to-be-forwarded packet.
The processing module 1320 may be configured to remove the outer packet header of the to-be-forwarded packet to obtain a to-be-forwarded packet.
The sending module 1330 may be configured to forward the to-be-forwarded packet obtained by removing the outer packet header to the target node of the VPN service corresponding to the to-be-forwarded packet. The target forwarding path includes M nodes, and the second SID list is generated based on SIDs of an Xth node to an (M−1)th node in the M nodes, where X is greater than 1. A SID of the tail node is a last SID in the second SID list. The target node of the VPN service is the Mth node.
In a further implementation of this embodiment, the data forwarding apparatus 1300 may be configured to perform steps performed by the controller in the data forwarding method shown in any one of the foregoing embodiments.
The receiving module 1310 may be configured to obtain a target forwarding path, where the target forwarding path includes M nodes.
The processing module 1320 may be configured to generate a first SID list based on SIDs of a first node to an Nth node in the M nodes, and generate a second SID list based on SIDs of an Xth node to a Yth node in the M nodes.
The sending module 1330 may be configured to send the first SID list to a head node, and send the second SID list to an intermediate node, where the intermediate node is the Nth node in the M nodes, N is greater than or equal to 1, X is equal to N or N+1, and Y is less than or equal to M.
The first SID list is used by the head node to send to-be-forwarded data received by the head node; and the second SID list is used by the intermediate node to send a to-be-forwarded packet received by the intermediate node.
In a possible implementation of this embodiment, the head node is configured to encapsulate, in front of the to-be-forwarded data, a packet header by using the first SID list as a destination address in the packet header, to generate the to-be-forwarded packet; and send the to-be-forwarded packet to the intermediate node based on the destination address; and the intermediate node is configured to replace the first SID list in the packet header of the to-be-forwarded packet with the second SID list, and forward the to-be-forwarded packet based on a destination address in a packet header obtained through replacement.
In a possible implementation of this embodiment, the sending module 1330 may be configured to send an SR policy 1 to the head node, where the SR policy 1 includes the first SID list.
The sending module 1330 may be configured to send an SR policy 2 to the intermediate node, where the SR policy 2 includes the second SID list.
In a possible implementation of this embodiment, the controller is a DCN controller in a DCN.
A node device provided in this embodiment may serve as different roles in different scenarios. For example, a same node device may serve as any one or more roles of a head node, an intermediate node, and a tail node in different SRv6 tunnels. For example, a node device 1 is a head node in a scenario 1 and is an intermediate node in a scenario 2. In addition, in one scenario, a same node device may alternatively serve as different roles. In an example, a head node and an intermediate node may be a same node device. In another example, an intermediate node and a tail node may be a same node device. In this case, the receiving module in the data forwarding apparatus is configured to perform a function of the head node may further have a function of the receiving module in the data forwarding apparatus configured to perform a function of the intermediate node. Similarly, the processing module in the data forwarding apparatus configured to perform the function of the head node may further have a function of the processing module in the data forwarding apparatus configured to perform the function of the intermediate node, and the sending module in the data forwarding apparatus configured to perform the function of the head node may further have a function of the sending module in the data forwarding apparatus configured to perform the function of the intermediate node.
In this embodiment, for detailed implementation processes of processing by the modules in the data forwarding apparatus, refer to the processing steps in the embodiments corresponding to
one or more processors 1410; and
a storage apparatus 1420, configured to store one or more programs.
When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement steps performed by the head node in the data forwarding method shown in any one of the foregoing embodiments, or steps performed by the intermediate node in the data forwarding method shown in the foregoing embodiments, or steps performed by the tail node in the data forwarding method shown in the foregoing embodiments, or steps performed by the controller in the data forwarding method shown in the foregoing embodiments.
In this embodiment, the node device may further include an interface 1430. The interface may be configured to receive to-be-forwarded data or a to-be-forwarded packet sent by another node device; or configured to send, to another node device, to-be-forwarded data or a to-be-forwarded packet processed by the node device.
In this embodiment, the processor, the storage apparatus, and the interface in the node device may be connected through a bus 1460.
In an implementation of this embodiment, the node device may be an edge device in a DCN.
In an implementation of this embodiment, the node device may be a PRE-AGG device, and may be configured to perform the steps performed by the head node in the data forwarding method shown in any one of the foregoing embodiments.
In an implementation of this embodiment, the node device may be a PE-AGG device, and may be configured to perform the steps performed by the head node in the data forwarding method shown in any one of the foregoing embodiments or may be configured to perform the steps performed by the intermediate node in the data forwarding method shown in any one of the foregoing embodiments.
In an implementation of this embodiment, the node device may be a DCGW device, and may be configured to perform the steps performed by the head node in the data forwarding method shown in any one of the foregoing embodiments or may be configured to perform the steps performed by the intermediate node in the data forwarding method shown in any one of the foregoing embodiments.
In an implementation of this embodiment, the node device may be a DCN controller device, and may be configured to perform the steps performed by the controller in the data forwarding method shown in any one of the foregoing embodiments.
The embodiments further provide a data forwarding system. The data forwarding system may include a head node and at least one intermediate node.
In a possible implementation, the system may further include a tail node.
In a possible implementation, the system may further include a controller.
The head node, the intermediate node, and the tail node may cooperate with each other to perform the steps performed by the nodes in the data forwarding method shown in any one of the foregoing embodiments. In an example, the head node may be a PE-AGG, the intermediate node may be a PRE-AGG and/or a DCGW, and the tail node may be a DCGW. In an example, the controller is a data center network controller DCN controller.
the embodiments further provide a computer-readable storage medium. The computer-readable storage medium stores instructions. When the instructions are run on a computer, the instructions are used to perform the steps related to the head node in the method embodiment shown in any one of the foregoing accompanying drawings, or configured to perform the steps related to the intermediate node in the method embodiment shown in any one of the foregoing accompanying drawings, or configured to perform the steps related to the tail node in the method embodiment shown in any one of the foregoing accompanying drawings, or configured to perform the steps related to the controller in the method embodiment shown in any one of the foregoing accompanying drawings. In a possible implementation, the computer-readable storage medium may alternatively be configured to simultaneously perform steps related to at least one of the head node, the intermediate node, and the tail node.
the embodiments provide a computer program. When the computer program is executed by a computer, the computer program is used to perform the steps related to the head node in the method embodiment shown in any one of the foregoing accompanying drawings, or configured to perform the steps related to the intermediate node in the method embodiment shown in any one of the foregoing accompanying drawings, or configured to perform the steps related to the tail node in the method embodiment shown in any one of the foregoing accompanying drawings, or configured to perform the steps related to the controller in the method embodiment shown in any one of the foregoing accompanying drawings.
All or a part of the foregoing embodiments may be implemented by using software, hardware, firmware, or any combination thereof. When software is used to implement the embodiments, the embodiments may be implemented all or partially in a form of a computer program product. The computer program product includes one or more computer instructions. When the one or more computer program instructions are loaded and executed on the computer, the procedure or functions according to the embodiments are all or partially generated. The computer may be a general-purpose computer, a dedicated computer, a computer network, or another programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or may be transmitted from a computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired (for example, a coaxial cable, an optical fiber, or a digital subscriber line) or wireless (for example, infrared, radio, or microwave) manner. The computer-readable storage medium may be any usable medium accessible by a computer, or a data storage device, such as a server or a data center, integrating one or more usable media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, a DVD), a semiconductor medium (for example, a solid-state drive Solid State Disk), or the like.
Number | Date | Country | Kind |
---|---|---|---|
201910094301.8 | Jan 2019 | CN | national |
This application is a continuation of International Application No. PCT/CN2020/071570, filed on Jan. 11, 2020, which claims priority to Chinese Patent Application No. 201910094301.8, filed on Jan. 30, 2019. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2020/071570 | Jan 2020 | US |
Child | 17386954 | US |