A packet forwarding method, comprising:
- sending, by a source node in a first Segment Routing Multi-Protocol Label Switching (SR-MPLS) domain, a packet to a destination node in a second SR-MPLS domain based on a segment routing policy (SR-Policy), wherein an SR-Policy segment list of the packet comprises a Binding Segment Identifier (BSID) in an MPLS label form, for the packet passes through an SRv6 domain between the first SR-MPLS domain and the second SR-MPLS domain;
- after receiving the packet, replacing, by a first border node, a BSID in an MPLS label form with an SRv6-Policy which destination address is a second border node, and forwarding the packet based on the SRv6-Policy, wherein the first border node is a border node between the first SR-MPLS domain and the SRv6 domain, and the second border node is a border node between the SRv6 domain and the second SR-MPLS domain;
- after receiving the packet, decapsulating, the second border node, the IPv6 header and the extension header of the packet according to the behavior indication information carried in the SR-Policy, performing lookup in the MPLS label forwarding table according to the MPLS label, so as to forward the packet within the second SR-MPLS domain until the packet is forwarded to the destination node;
- wherein before the source node sends the packet to the destination node based on the SR Policy, the method further comprises:
- sending, by a controller, an SR-Policy which destination address is the destination node of the second SR-MPLS domain to the source node, wherein the SR-Policy comprises a SR-Policy segment list for reaching the destination node;
- wherein before the source node sends the packet to the destination node based on the SR Policy information, the method further comprises:
- sending, by the controller, the SRv6-Policy which destination address is the second border node to the first border node, the SRv6-Policy comprises the SRv6-Policy segment list for reaching the second border node and the behavior indication information Endpoint with Decapsulation and MPLS Table Lookup Segment Identifier (End. DM SID) of the second border node, the behavior indication information End. DM SID of the second border node refer to decapsulate the IPv6 header and the extension header of the IPv6 header, and perform MPLS label forwarding table lookup according to the MPLS label to forward the packet;
- wherein the behavior indication information is a Sub-TLV defined in an SR-Policy tunnel attribute:
- End. DM SID Sub-TLV, and the End. DM SID Sub-TLV is used for identifying the forwarding behavior of the node, when a specific node sends a BGP SRv6 Policy to the node, End. DM SID sub-TLV is extended, and this field carries the End. DM SID sub-TL V of the SRv6 Policy destination node;
- when the SRv6 Policy carries the BSID in the MPLS label form, the End. DM SID Sub-TLV is also carried.