WO2018010519A1 - Method and apparatus for establishing multicast tunnel - Google Patents

Method and apparatus for establishing multicast tunnel Download PDF

Info

Publication number
WO2018010519A1
WO2018010519A1 PCT/CN2017/088633 CN2017088633W WO2018010519A1 WO 2018010519 A1 WO2018010519 A1 WO 2018010519A1 CN 2017088633 W CN2017088633 W CN 2017088633W WO 2018010519 A1 WO2018010519 A1 WO 2018010519A1
Authority
WO
WIPO (PCT)
Prior art keywords
label
identifier
forwarding device
forwarding
path
Prior art date
Application number
PCT/CN2017/088633
Other languages
French (fr)
Chinese (zh)
Inventor
谢经荣
刘毅松
张军林
王东
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2018010519A1 publication Critical patent/WO2018010519A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4633Interconnection of networks using encapsulation techniques, e.g. tunneling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/50Routing or path finding of packets in data switching networks using label swapping, e.g. multi-protocol label switch [MPLS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/80Actions related to the user profile or the type of traffic
    • H04L47/806Broadcast or multicast traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/82Miscellaneous aspects
    • H04L47/825Involving tunnels, e.g. MPLS

Definitions

  • the present application relates to the field of communications, and in particular, to a method and apparatus for establishing a multicast tunnel.
  • a multicast virtual private network can implement multicast forwarding by using an aggregate tunnel.
  • Multiple MVPNs can use the same aggregation tunnel to implement multicast forwarding. This requires configuring corresponding labels for different VPNs on the forwarding devices included in the aggregation tunnel to implement multiple aggregation tunnels for multiple VPNs.
  • the label space on the forwarding device included in the aggregation tunnel needs to store N context labels in addition to the global label space.
  • N context labels
  • the forwarding device uses linear forwarding, it needs to generate hundreds of millions of forwarding entries according to the labels contained in the label space. This makes it impossible for the forwarding device to use a linear table to save and find labels.
  • the operation of finding the forwarding entry matching the label in the packet is heavy, and the cost on the forwarding plane is relatively large. .
  • the embodiment of the present application provides a method and an apparatus for establishing a multicast tunnel, which helps reduce the cost of the forwarding plane and improve the forwarding efficiency.
  • the first aspect provides a method for establishing a multicast tunnel, where the method includes:
  • the first forwarding device sends a request message to the second forwarding device, where the request message includes the information of the label block and the identifier of the path, the information of the label block is used to indicate the size of the label block, and the identifier of the path is used to identify the identifier a tunnel corresponding to the virtual private network VPN between the first forwarding device and the second forwarding device, where the first forwarding device is an upstream device of the second forwarding device;
  • the first forwarding device obtains a forwarding entry corresponding to the tunnel according to the identifier of the first label and the path.
  • the first forwarding device may obtain a forwarding entry that can implement a linear search according to a start label of the label block sent by the second forwarding device, such as the first label, and the identifier of the path.
  • a forwarding entry that can implement a linear search according to a start label of the label block sent by the second forwarding device, such as the first label, and the identifier of the path.
  • the method provided in this embodiment of the present application is applicable to an MVPN scenario.
  • the tunnel is a P2MP tunnel, or the tunnel is a P2P tunnel. If the tunnel is a P2MP tunnel, the first forwarding device is a PE device, the second forwarding device is a P device, or the first forwarding device and the second forwarding device are both PE devices. If the tunnel is a P2P tunnel, the first forwarding device and the second forwarding device are both PE devices.
  • the request message may be a path path message, and a session field of the path message may carry information of the label block.
  • the response message may be a resource reservation protocol RSVP message, and the session field of the RSVP message may carry the identifier of the first label and the path.
  • the method further includes: the first forwarding device determines a tunnel corresponding to the VPN, and the first forwarding device obtains information about the label block according to the tunnel corresponding to the VPN, The information of the tag block is determined by the number of VPNs corresponding to the tunnel.
  • the first forwarding device obtains, according to the identifier of the first label and the path, a forwarding entry corresponding to the tunnel, where the first forwarding device obtains a group according to the identifier of the path.
  • the identifier of the multicast the identifier of the multicast is used to identify the multicast forwarding information corresponding to the path, and the first forwarding device obtains the identifier of the outbound interface according to the identifier of the path, where the outbound interface is the An interface that communicates with the second forwarding device on the first forwarding device; the first forwarding device obtains the forwarding entry according to the first label, the identifier of the multicast, and the identifier of the outbound interface,
  • the forwarding entry includes a second label, an identifier of the multicast, and an identifier of the outbound interface, where the second label is a label obtained according to the first label and an offset, and the offset is The value corresponds to the VPN.
  • the value of the second tag is determined by the value of the offset
  • the value of the offset is determined by the VPN. Determine, for example, the correspondence between the values of the VPN and the offset can be established.
  • the value of the second tag corresponds to the VPN.
  • the method further includes: the first forwarding device receives the first packet from the VPN, and obtains an identifier of the VPN; the first forwarding device according to the forwarding entry, the first The packet and the identifier of the VPN are obtained, and the second packet is sent to the second forwarding device, where the second packet is a multicast packet that is sent to the second forwarding device by using the tunnel.
  • the first forwarding device may obtain the identifier of the VPN according to the interface that receives the first packet.
  • the first packet may carry information related to the VPN, and the first forwarding device may obtain the identifier of the VPN according to the information related to the VPN in the first packet.
  • the first forwarding device obtains the second packet according to the forwarding entry, the first packet, and the identifier of the VPN, and sends the second packet to the second forwarding device, where: the first The forwarding device obtains the value of the offset corresponding to the VPN according to the correspondence and the identifier of the VPN, where the correspondence includes the identifier of the VPN and the value of the offset; the first forwarding device is configured according to Transmitting the entry and the value of the offset to obtain an identifier of the third label and the outbound interface, where the third label is a label obtained according to the first label and the value of the offset,
  • the egress interface is configured to communicate with the second forwarding device, and the first forwarding device sends the second packet to the second forwarding device according to the identifier of the egress interface, where the second packet includes The first message and the third tag are described.
  • the third label is a label corresponding to the VPN obtained according to the value of the offset.
  • the third tag may be the same as the second tag.
  • a method for establishing a multicast tunnel includes:
  • the second forwarding device receives the request message sent by the first forwarding device, where the second forwarding device is the downstream device of the first forwarding device, and the request message includes the information of the label block and the identifier of the path, where the label block
  • the information is used to indicate the size of the label block, and the identifier of the path is used to identify a tunnel corresponding to the virtual private network VPN;
  • the second forwarding device Determining, by the second forwarding device, the first label according to the information of the label block, where the first label is a start label of the label block determined according to the information of the label block;
  • the second forwarding device sends a response message to the first forwarding device, where the response message includes the identifier of the first label and the path.
  • the method further includes: obtaining, by the second forwarding device, an entry corresponding to the tunnel according to the identifier of the first label and the path, where the entry includes a second label,
  • the second tag is a tag obtained according to the first tag and the offset, and the value of the offset corresponds to a VPN.
  • the second forwarding device obtains an entry corresponding to the tunnel according to the identifier of the first label and the path, where the second forwarding device obtains the multicast according to the identifier of the path.
  • the identifier of the multicast is used to identify the multicast forwarding information corresponding to the path, and the second forwarding device obtains the entry according to the first label and the identifier of the multicast.
  • the entry includes the second tag and the identifier of the multicast.
  • the entry further includes information of the label block.
  • the forwarding entry obtained by the first forwarding device is used to guide the forwarding entry
  • the entry obtained by the second forwarding device is used to locate the forwarding entry
  • a first forwarding device where the first forwarding device includes:
  • a first sending unit configured to send a request message to the second forwarding device, where the request message includes the information of the label block and the identifier of the path, where the information of the label block is used to indicate the size of the label block, and the identifier of the path is used by And identifying, by the first forwarding device, the tunnel corresponding to the virtual private network VPN, the first forwarding device is an upstream device of the second forwarding device;
  • a first receiving unit configured to receive a response message sent by the second forwarding device, where the response message includes a first label and an identifier of the path, where the first label is determined according to information of the label block The starting label of the label block;
  • a first obtaining unit configured to obtain, according to the identifier of the first label and the path, a forwarding entry corresponding to the tunnel.
  • the first forwarding device further includes:
  • a determining unit configured to determine a tunnel corresponding to the VPN
  • a second obtaining unit configured to obtain information about the label block according to the tunnel corresponding to the VPN, where information of the label block is determined by a number of VPNs corresponding to the tunnel.
  • the first obtaining unit is specifically configured to:
  • an identifier of the multicast where the identifier of the multicast is used to identify multicast forwarding information corresponding to the path;
  • the forwarding entry Obtaining, according to the first label, the identifier of the multicast, and the identifier of the outbound interface, the forwarding entry, where the forwarding entry includes a second label, the identifier of the multicast, and the outbound interface
  • the second tag is a tag obtained according to the first tag and an offset, and the value of the offset corresponds to a VPN.
  • the first forwarding device further includes:
  • a second receiving unit configured to receive a first packet from the VPN, and obtain an identifier of the VPN
  • a third obtaining unit configured to obtain a second packet according to the forwarding entry, the first packet, and the identifier of the VPN, where the second packet is sent to the second by using the tunnel Forwarding multicast packets of the device;
  • the second sending unit is configured to send the second packet to the second forwarding device.
  • the third obtaining unit is specifically configured to:
  • the second sending unit is configured to send the second packet to the second forwarding device according to the identifier of the outbound interface, where the second packet includes the first packet and the third packet label.
  • a second forwarding device where the second forwarding device includes:
  • a receiving unit configured to receive a request message sent by the first forwarding device, where the second forwarding device is a downstream device of the first forwarding device, where the request message includes information of a label block and an identifier of a path, where the label block The information is used to indicate the size of the label block, and the identifier of the path is used to identify a tunnel corresponding to the virtual private network VPN;
  • An obtaining unit configured to obtain, according to the information of the label block, a first label, where the first label is a starting label of the label block determined according to information of the label block;
  • a sending unit configured to send a response message to the first forwarding device, where the response message includes the identifier of the first label and the path.
  • the second forwarding device further includes:
  • a second obtaining unit configured to obtain, according to the identifier of the first label and the path, an entry corresponding to the tunnel, where the entry includes a second label, and the second label is according to the first The label obtained from the tag and the offset, the value of the offset corresponding to the VPN.
  • the second obtaining unit is specifically configured to:
  • an identifier of the multicast where the identifier of the multicast is used to identify multicast forwarding information corresponding to the path;
  • the entry further includes information of the label block.
  • the second forwarding device provided by the fourth aspect may also adopt the method provided by the first aspect or any possible implementation manner of the first aspect, to obtain a forwarding entry, that is, the second forwarding device may forward to another A device that requests a tag that matches the information of the tag block.
  • the second forwarding device may be the same device as the first forwarding device provided by the third aspect, or may be different from the first forwarding device provided by the third aspect.
  • a first forwarding device comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface pass through the communication bus Connected, the memory is for storing a program; the processor reads the executable instructions included in the program from the memory, and performs the method provided by the first aspect or any one of the implementation manners of the first aspect.
  • a second forwarding device comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface pass through the communication bus Connection
  • the memory is used to store a program; the processor reads the executable instructions included in the program from the memory, and performs the method provided by any one of the second aspect or the second aspect.
  • FIG. 1 is a schematic diagram of a network scenario.
  • FIG. 2(a) is a schematic diagram of a network scenario according to an embodiment of the present application.
  • FIG. 2(b) is a flowchart of a method for establishing a multicast tunnel according to an embodiment of the present application.
  • FIG. 3(a) is a schematic diagram of another network scenario provided by an embodiment of the present application.
  • FIG. 3(b) is a flowchart of a method for establishing a multicast tunnel according to an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of a first forwarding device according to an embodiment of the present disclosure.
  • FIG. 5 is a schematic structural diagram of a second forwarding device according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of a first forwarding device according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram of a second forwarding device according to an embodiment of the present disclosure.
  • site 1, site3, and site5 belong to a virtual private network (VPN) 1, and site2, site4, and site6 belong to VPN 2.
  • Site1 and site2 communicate with PE1.
  • PE1 can communicate with PE2 and PE3 through P.
  • PE2 communicates with site3 and site4.
  • PE4 communicates with site5 and site6.
  • a point-to-multipoint (P2MP) forwarding path can be formed between PE1, PE2, and PE3.
  • VPN1 and VPN2 can share the forwarding path of P2MP between PE1, PE2, and PE3.
  • Two mutually associated label configuration tables are configured on PE1, P, PE2, and PE3.
  • One of the two associated label configuration tables includes a mapping between a tunnel label and a VPN label
  • another label configuration table includes a correspondence between the VPN label and the outbound interface.
  • the PE1 may send a P2MP label to the P according to the pre-configured P2MP forwarding path, where the P2MP label is a tunnel label corresponding to the forwarding path of the P2MP.
  • P can forward the P2MP label from PE1 to PE2 and PE3 according to the pre-configured P2MP forwarding path.
  • PE1 After receiving the first packet from site1 of VPN1, PE1 determines the P2MP label. Based on the P2MP and the two interrelated label configuration tables, the PE1 obtains the VPN1 label and the outbound interface on PE1. The PE1 tunnels the first packet to obtain a second packet. The second packet includes the first packet, a P2MP label, and a VPN1 label. PE1 sends the second packet to P through the outbound interface on PE1. After receiving the second packet, the P obtains the outbound interface on the VPNn label and the P according to the configured two associated label configuration tables and the P2MP labels included in the second packet. P obtains a third packet according to the VPNn label and the second packet. The third packet includes the VPNn label, the P2MP label, and the first packet.
  • the number of outbound interfaces on the P obtained by P is N, and P copies the third packet to obtain N third packets.
  • the P sends the Nth third packet through the N outgoing interfaces, and the outbound interface on each P is used to send the third packet.
  • the PE2 determines an outbound interface for communicating with the site3 of the VPN1 according to the P2MP label and the VPNn label.
  • the PE2 can send the first packet included in the third packet to the site 4 through the outbound interface.
  • the method for the first packet to be sent by the PE3 to the site 5 of the VPN1 is the same as the method for the PE2 to send the first packet to the site 3 of the VPN1, and details are not described herein.
  • the first forwarding device sends a request message to the second forwarding device, where the request message includes the information of the label block and the identifier of the path, where the information of the label block is used to indicate the size of the label block, and the identifier of the path a tunnel corresponding to the virtual private network VPN between the first forwarding device and the second forwarding device, where the first forwarding device is an upstream device of the second forwarding device; and the first forwarding device receives a response message sent by the second forwarding device, where the response message includes a first label and an identifier of the path, where the first label is a start label of the label block determined according to information of the label block; The first forwarding device obtains a forwarding entry corresponding to the tunnel according to the identifier of the first label and the path.
  • the method provided by the embodiment of the present application does not need to store N+1 label spaces on each forwarding device, and can implement linear search without increasing
  • FIG. 2(a) is a schematic diagram of a network scenario according to an embodiment of the present application.
  • PE1 establishes a P2MP tunnel with PE2 and PE3 through P.
  • Site1, site3, and site5 belong to VPN1, and site2, site4, and site6 belong to VPN2.
  • Site1 and site2 communicate with PE1.
  • PE2 communicates with site3 and site4.
  • PE3 communicates with site5 and site6.
  • VPN1 and VPN2 can share P2MP tunnels between PE1, PE2, and PE3.
  • FIG. 2(b) is a flowchart of a method for establishing a multicast tunnel according to an embodiment of the present application. The method for establishing a multicast tunnel provided by the embodiment of the present application is described below with reference to FIG. 2(a) and FIG. 2(b).
  • the PE1 sends a first request message to the P.
  • the first request message includes information of a label block and an identifier of a path.
  • the information of the tag block is used to indicate the size of the tag block.
  • the identifier of the path is used to identify a P2MP tunnel.
  • the P2MP tunnel is a tunnel between PE1, PE2, and PE3.
  • the P2MP tunnel is a tunnel shared by VPN1 and VPN2.
  • PE1 is the upstream device of P and P is the downstream device of PE1.
  • PE1 may obtain information about the label block according to the number of VPNs to which the site with which it communicates. As shown in Figure 2(a), site1 and site2 belong to VPN1 and VPN2, respectively. According to VPN1 and VPN2, PE1 obtains a tag block size of 2. The PE1 can also obtain the identifier of the path according to the VPN1 and the VPN2, that is, the VPN2 and the VPN2 share the P2MP tunnel corresponding to the identifier of the path.
  • the PE1 may obtain the first request message according to the information of the label block and the identifier of the path.
  • the first request message is used to allocate a label corresponding to the P2MP tunnel to the P request.
  • the first request message may be an extended path message.
  • the extended path message may be extended to a session attribute (session_attribute) field in a label request (label_request) included in the path message in the RFC 3209, where the session_attribute field carries information of the label block.
  • the PE1 can obtain the outgoing interface of the communication with the P1 on the PE1 according to the Constraint Shortest Path First (CSPF) or the traffic engineering database (TEDB), that is, the identifier of the first outgoing interface.
  • CSPF Constraint Shortest Path First
  • TDB traffic engineering database
  • the PE1 may send the first request message to the P through the first outbound interface.
  • the first tag is a start tag of the tag block determined by the P according to the information of the tag block.
  • P may select a label block corresponding to the information of the label block from its configured global label space, and obtain a start label of the label block, such as LB1 in FIG. 2(a), and LB1 is P.
  • a label corresponding to the information of the label block The starting tag of the block.
  • P sends a first response message to PE1.
  • P may obtain a first response message according to the identifier of the first label and the path.
  • the first response message includes the first tag and an identifier of the path.
  • the first response message may be a resource reservation protocol message (RSVP message), and the RSVP message may carry the identifier of the first label and the path.
  • RSVP message resource reservation protocol message
  • the P may obtain the first entry according to the identifier of the first label and the path.
  • P may obtain one or more forwarding entries used to guide forwarding according to the first entry.
  • the P obtains the first entry according to the identifier of the first label and the path, and the P obtains a multicast identifier according to the identifier of the path, where the identifier of the multicast is used to identify the identifier.
  • a multicast forwarding information corresponding to the path P obtaining, according to the first label, a second label, where the second label is a label obtained according to the first label and an offset, the offset The value corresponds to the VPN;
  • the P obtains the first entry according to the second label and the identifier of the multicast, where the first entry includes the second label and the identifier of the multicast.
  • the identifier of the multicast that is obtained by the P according to the identifier of the path belongs to the optional content.
  • the identifier of the multicast in the first entry is replaced by the identifier of the path.
  • P may generate a second entry on the control plane, and then generate the first entry in the forwarding plane according to the second entry.
  • P may generate a second entry on the control plane according to the identifier of the first label and the path, where the second entry includes the identifier of the first label and the path.
  • the second entry further includes information about the label block, such as blocksize in FIG. 2(a).
  • the second entry can be expressed as:
  • InLabelBase ⁇ assigned by P> represents the first label allocated by P, that is, LB1 in FIG. 2(a). Session indicates the identity of the path.
  • P the first label allocated by P
  • Session indicates the identity of the path.
  • P may generate a first entry on the forwarding plane according to the second entry.
  • the first entry can be expressed as:
  • InLabelBase ⁇ assigned by P> represents the first label allocated by P, that is, LB1 in FIG. 2(a). Offset represents the offset. InLabelBase ⁇ assigned by P>+offset represents the second tag.
  • the MID indicates the identifier of the multicast, and the MID corresponds to the Session.
  • the PE1 obtains the first forwarding entry according to the first response message.
  • the PE1 obtains the first forwarding entry according to the first response message, and the PE1 obtains a multicast identifier according to the identifier of the path, where the identifier of the multicast is used to identify the path corresponding to the path.
  • the multicast forwarding information is obtained by the PE1 according to the identifier of the path, and the first outbound interface is an interface that communicates with the P1 on the PE1; the PE1 is based on the first label and the multicast And identifying, by the identifier of the first outbound interface, the first forwarding entry, where the first forwarding entry includes the second label, the identifier of the multicast, and an identifier of the first outbound interface.
  • the identifier of the multicast that is obtained by the PE1 according to the identifier of the path belongs to the optional content.
  • the identifier of the multicast in the first forwarding entry is replaced by the identifier of the path.
  • the PE1 may generate a second forwarding entry on the control plane, and then generate the first forwarding entry on the forwarding plane according to the second forwarding entry.
  • the PE1 may generate a second forwarding entry on the control plane according to the first label and the identifier of the path included in the first response message, where the second forwarding entry includes the first label, The identifier of the first outgoing interface and the identifier of the path.
  • PE1 can obtain the identifier of the first outgoing interface by using 201.
  • the second forwarding entry may be expressed as:
  • the Session represents the identifier of the path.
  • OutLabelBase ⁇ assigned by P> indicates the first label assigned by P, that is, LB1 in FIG. 2(a).
  • OutInterface ⁇ to P> indicates the identifier of the first outgoing interface.
  • PE1 may generate a first forwarding entry on the forwarding plane according to the second forwarding entry.
  • the first forwarding entry may be expressed as:
  • the MID indicates the identifier of the multicast, and the MID corresponds to the Session.
  • OutLabelBase ⁇ assigned by P> indicates the first label assigned by P, that is, LB1 in FIG. 2(a). Offset represents the offset.
  • OutLabelBase ⁇ assigned by P>+offset represents the second tag.
  • OutInterface ⁇ to P> indicates the identifier of the first outgoing interface.
  • the second request message includes information of the tag block and an identifier of the path.
  • the information of the label block included in the second request message is the same as the information of the label block included in the first request message, such as blocksize in FIG. 2(a).
  • the identifier of the path included in the second request message is the same as the identifier of the path included in the first request message.
  • P may obtain the second request message according to the information of the label block and the identifier of the path.
  • the second request message is used to request the PE2 to allocate a label corresponding to the P2MP tunnel.
  • the second request message may be an extended path message.
  • the extended path message may be extended to a session_attribute field in a label_request included in the path message in the RFC 3209, where the session_attribute field carries information of the label block.
  • P can obtain an outbound interface on P that can communicate with PE2 according to CSPF or TEDB, that is, an identifier of the second outgoing interface.
  • the P may send the second request message to the PE2 by using the second outbound interface.
  • PE2 allocates a third label.
  • the third label is a starting label of the label block determined by the PE2 according to the information of the label block.
  • the PE2 can select a label block corresponding to the information of the label block from the configured global label space, and obtain a start label of the label block, as shown in FIG. 2(a), LB2, and LB2 is a PE2 and a label.
  • the global label space configured on PE2 is different from the global label space configured on P2.
  • the PE2 sends a second response message to the P.
  • PE2 may obtain a second response message according to the identifier of the third label and the path.
  • the second response message includes the third tag and an identifier of the path.
  • the second response message may be an RSVP message, and the RSVP message is further configured to carry the identifier of the third label and the path.
  • PE2 obtains the third entry.
  • the PE2 may obtain the third entry according to the identifier of the third label and the path.
  • the third entry includes a fourth tag and the identifier of the multicast.
  • the fourth tag is a tag obtained according to the third tag and the offset, and the offset corresponds to a VPN.
  • the PE2 obtains the third entry according to the identifier of the third label and the path, and the PE2 obtains the identifier of the multicast according to the identifier of the path, where the identifier of the multicast is used to identify the identifier.
  • the multicast forwarding information corresponding to the path; the PE2 obtains the fourth label according to the third label and the offset; and the PE2 obtains the first label according to the fourth label and the identifier of the multicast
  • the third entry includes the fourth tag and the identifier of the multicast.
  • the identifier of the multicast that is obtained by the PE2 according to the identifier of the path belongs to the optional content.
  • the identifier of the multicast in the third entry is replaced by the identifier of the path.
  • PE2 may generate a fourth entry in the control plane, and generate the third entry in the forwarding plane according to the fourth entry.
  • the PE2 may generate a fourth entry on the control plane according to the identifier of the third label and the path, where the fourth entry includes the identifier of the third label and the path.
  • the fourth entry can be expressed as:
  • the InLabelBase ⁇ assigned by PE2> indicates the third label allocated by the PE2, that is, LB2 in FIG. 2(a). Session indicates the identity of the path.
  • the foregoing is only one representation of the fourth item, and the specific embodiment of the present application is not limited.
  • PE2 may generate a third entry on the forwarding plane according to the fourth entry.
  • the third entry can be expressed as:
  • the InLabelBase ⁇ assigned by PE2> indicates the third label allocated by the PE2, that is, LB2 in FIG. 2(a). Offset represents the offset. InLabelBase ⁇ assigned by PE2>+offset represents the fourth tag.
  • the MID indicates the identifier of the multicast, and the MID corresponds to the Session.
  • the P obtains a third forwarding entry according to the second response message.
  • the P obtains the third forwarding entry according to the second response message, and the P obtains the identifier of the multicast according to the identifier of the path, and obtains the second outgoing interface according to the identifier of the path.
  • the third forwarding entry is obtained according to the third label, the identifier of the multicast, and the identifier of the second outbound interface, where the third forwarding entry includes a fourth label, the group The identifier of the broadcast and the identifier of the second outgoing interface.
  • the identifier of the multicast that is obtained by the P according to the identifier of the path belongs to the optional content.
  • the identifier of the multicast in the third forwarding entry is replaced by the identifier of the path.
  • the P may generate a fourth forwarding entry on the control plane, and generate the third forwarding entry on the forwarding plane according to the fourth forwarding entry.
  • the P may generate a fourth forwarding entry on the control plane according to the third label included in the second response message and the identifier of the path, where the fourth forwarding entry includes the third label, The identifier of the second outgoing interface and the identifier of the path.
  • the P may obtain the identifier of the second outbound interface by 206.
  • the fourth forwarding entry may be expressed as:
  • the Session represents the identifier of the path.
  • OutLabelBase ⁇ assigned by PE2> indicates the third label allocated by PE2, that is, LB2 in FIG. 2(a).
  • OutInterface ⁇ to PE2> indicates the identifier of the second outgoing interface.
  • P may generate a third forwarding entry on the forwarding plane according to the fourth forwarding entry.
  • the third forwarding The entry can be expressed as:
  • the MID indicates the identifier of the multicast, and the MID corresponds to the Session.
  • OutLabelBase ⁇ assigned by PE2> indicates the third label allocated by PE2, that is, LB2 in FIG. 2(a). Offset represents the offset.
  • OutLabelBase ⁇ assigned by PE2>+offset represents the fourth tag.
  • OutInterface ⁇ to PE2> indicates the identifier of the second outgoing interface.
  • P sends a third request message to PE3.
  • the method of obtaining the third request message by P is the same as the method of obtaining the second request message by P in 206.
  • the third request message includes information of the tag block and an identifier of the path.
  • the third request message is used to request the PE3 to allocate a label corresponding to the P2MP tunnel.
  • P can obtain the outbound interface of communication with PE3 on P, that is, the identifier of the third interface, according to CSPF or TEDB. P may send the third request message to PE3 through the third interface.
  • PE3 assigns a fifth label.
  • the fifth tag may be LB3 in FIG. 2(a).
  • the global label space configured on PE3 is different from the global label space configured on PE.
  • the global label space configured on PE3 is different from the global label space configured on PE2.
  • the PE3 sends a third response message to the P.
  • the method for the PE3 to obtain the third response message is the same as the method for the PE2 to obtain the second response message in 208, and details are not described herein again.
  • the third response message includes the fifth tag and an identifier of the path.
  • PE3 obtains the fifth entry.
  • the fifth entry includes a sixth label and an identifier of the multicast.
  • the sixth tag is a tag obtained according to the fifth tag and the offset.
  • the method of obtaining the fifth entry by PE3 is the same as the method of obtaining the third entry by PE2 in 209.
  • the identifier of the multicast in the fifth entry may be replaced by an identifier of the path.
  • the PE3 may generate a sixth entry in the control plane, and generate the fifth entry in the forwarding plane according to the sixth entry.
  • the PE3 may generate a sixth entry on the control plane according to the fifth label and the identifier of the path, where the sixth entry includes the fifth label and the identifier of the path.
  • the sixth entry can be expressed as:
  • the InLabelBase ⁇ assigned by PE3> indicates the fifth label allocated by the PE3, that is, LB3 in FIG. 2(a). Session indicates the identity of the path.
  • the foregoing is only one representation of the sixth item, and the specific embodiment of the present application is not limited.
  • PE3 may generate a fifth entry on the forwarding plane according to the sixth entry.
  • the fifth entry can be expressed as:
  • the InLabelBase ⁇ assigned by PE3> indicates the fifth label allocated by the PE3, that is, LB3 in FIG. 2(a). Offset represents the offset. InLabelBase ⁇ assigned by PE3>+offset represents the sixth tag.
  • the MID indicates the identifier of the multicast, and the MID corresponds to the Session.
  • the P obtains a fifth forwarding entry according to the third response message.
  • the fifth forwarding entry includes the sixth label, the identifier of the multicast, and an identifier of the third outgoing interface.
  • the method of obtaining the fifth forwarding entry by P is the same as the method of obtaining the third forwarding entry by P in 210.
  • the identifier of the multicast in the fifth forwarding entry may be replaced by an identifier of the path.
  • the P may generate a sixth forwarding entry on the control plane, and generate the fifth forwarding entry on the forwarding plane according to the sixth forwarding entry.
  • the P may generate the sixth forwarding entry on the control plane according to the fifth label and the identifier of the path included in the third response message, where the sixth forwarding entry includes the fifth The label, the identifier of the third outbound interface, and the identifier of the path.
  • P may obtain the identifier of the third outbound interface by 211.
  • the sixth forwarding entry may be expressed as:
  • the Session represents the identifier of the path.
  • OutLabelBase ⁇ assigned by PE3> indicates the fifth label assigned by PE3, that is, LB3 in FIG. 2(a).
  • OutInterface ⁇ to PE3> indicates the identifier of the third outgoing interface.
  • P may generate the fifth forwarding entry on the forwarding plane according to the sixth forwarding entry.
  • the fifth forwarding entry may be expressed as:
  • the MID indicates the identifier of the multicast, and the MID corresponds to the Session.
  • OutLabelBase ⁇ assigned by PE3> indicates the fifth label assigned by PE3, that is, LB3 in FIG. 2(a). Offset represents the offset.
  • OutLabelBase ⁇ assigned by PE3>+offset represents the sixth tag.
  • OutInterface ⁇ to PE3> indicates the identifier of the third outgoing interface.
  • 204 in Embodiment 1 may be performed after 202, such as 204 between 202 and 203, or 204 after 203.
  • 205 may be performed after 203, such as 205 may be performed between 203 and 204, or 205 and 204 may be performed simultaneously, or 205 may be performed after 204.
  • 206 may be performed after 201, such as 206 may be performed between 201 and 202, or 206 may be performed between 202 and 203, or 206 may be performed between 203 and 204, or 206 may be performed after 204.
  • 209 may be performed after 207, such as 209 may be performed between 207 and 208, or 209 may be performed after 208.
  • 210 may be performed after 208, such as 210 may be performed between 208 and 209, or 210 may be performed concurrently with 209.
  • 211 may be performed after 201, such as 211 may be performed concurrently with 206, or 211 may be performed prior to 206.
  • 214 may be performed after 212, such as 214 may be performed between 212 and 213, or 214 may be performed after 213.
  • 215 may be performed after 213, such as 215 may be performed between 213 and 214, or 215 may be performed concurrently with 214.
  • the device included in the P2MP tunnel can forward the packet by using the corresponding entry in FIG. 2(b).
  • the forwarding flow of the message will be described below with reference to FIG. 2(a) and FIG. 2(b).
  • PE1 receives the first packet from site1.
  • the PE1 may determine, according to the port that receives the first packet, that the first packet is from VPN1, that is, site1 belongs to VPN1.
  • the correspondence between the VPN and the offset is stored on the PE1, and the PE1 can obtain the value of the offset corresponding to the VPN1 according to the corresponding relationship, for example, the number of the offset corresponding to the VPN1.
  • the value is 1.
  • PE1 determines that the multicast identifier is the MID. Based on the MID, PE1 obtains the first forwarding entry.
  • the value of the second label in the first forwarding entry is the sum of the values of LB1 and offset, that is, LB1+1, where LB1 is the first label allocated by P, and 1 is the value of offset.
  • the PE1 obtains the second packet according to the values of the first packet and the second label.
  • the second packet includes a value of the first packet and the second label.
  • the PE1 sends the second packet to the P by using the identifier of the first outbound interface.
  • P receives the second message from PE1.
  • the P determines that the first label is LB1 according to the value of the second label included in the second packet, such as LB1+1, P, and determines that the value of the offset is 1.
  • LB1 P can find the first entry that matches LB1, and obtain the multicast identifier as MID.
  • the P obtains two forwarding entries according to the MID, which are a third forwarding entry and a fifth forwarding entry, respectively. After determining that there are two forwarding entries, the P needs to copy the first packet included in the received second packet, that is, obtain two first packets.
  • the value of the fourth label in the third forwarding entry obtained by P is the sum of the value of the third label and the offset, that is, LB2+1, where LB2 is the third label allocated by PE2.
  • the third packet includes values of the first packet and the fourth label.
  • the P sends the third packet to the PE2 by using the identifier of the second egress interface included in the third forwarding entry.
  • the value of the sixth label in the fifth forwarding entry obtained by P is the sum of the value of the fifth label and the offset, that is, LB3+1, where LB3 is the fifth label allocated by PE3.
  • the P obtains the fourth packet according to the value of the second packet and the sixth label.
  • the fourth packet includes values of the first packet and the sixth label.
  • the P sends the fourth packet to the PE3 by using the identifier of the third outbound interface that is included in the fifth forwarding entry.
  • PE2 receives the third message from P.
  • the PE2 determines that the value of the offset is 1 according to the value of the fourth label in the third packet.
  • the PE2 obtains the first packet from the third packet.
  • the PE2 determines that the first packet corresponds to VPN1 according to the value of the offset.
  • the PE2 sends the first packet to the site 3 belonging to the VPN1 through the interface that communicates with the site3.
  • PE3 receives the fourth message from P.
  • the PE3 determines that the value of the offset is 1 according to the value of the sixth label in the fourth packet.
  • the PE3 obtains the first packet from the fourth packet.
  • the PE3 determines that the first packet corresponds to VPN1 according to the value of the offset.
  • the PE3 sends the first packet to the site 5 that belongs to VPN1 through the interface that communicates with the site 5.
  • Site 2 of VPN2 sends a fifth packet to PE1.
  • the method for the PE1 to send the fifth packet to the site 4 connected to the PE2 through the P is the same as the method for the PE1 to send the first packet to the site 3 connected to the PE2 through the P.
  • the method of sending the fifth packet to the site 6 connected to the PE3 through the P1 is the same as the method of transmitting the first packet to the site 5 connected to the PE3 through the P1.
  • the traffic forwarding method of VPN2 will not be described here.
  • each offset corresponds to one VPN
  • each VPN corresponds to one P2MP tunnel
  • each P2MP tunnel corresponds to one MID.
  • the P2MP tunnel can be a logical tunnel.
  • the PE1 as the first forwarding device can transmit the blocksize to the P as the second forwarding device, and obtain the LB1 from the P as the second forwarding device.
  • the PE1 does not need to store N+1 label spaces.
  • Only the LB1 and the offset corresponding to the VPN can be used to forward packets. This helps reduce the cost on the forwarding plane and implement linear lookup.
  • the P as the first forwarding device can send the blocksize to the PE2 as the second forwarding device, and obtain the LB2 from the PE2 as the second forwarding device.
  • the P does not need to store N+1 label spaces. Only the LB2 and the offset corresponding to the VPN can be used to forward packets, which helps reduce the cost on the forwarding plane and implement linear lookup.
  • FIG. 3(a) is a schematic diagram of another network scenario provided by an embodiment of the present application.
  • PE1 Establish a P2P tunnel with PE2, PE3, and PE4.
  • Site1, site6, and site8 belong to VPN1.
  • Site5 belongs to VPN2.
  • Site7 and site9 belong to VPN3.
  • Site1, site2, and site3 communicate with PE1.
  • PE2 communicates with site4 and site5.
  • PE3 communicates with site6 and site7.
  • PE4 communicates with site8 and site9.
  • VPN1 and VPN2 can share P2P tunnels between PE1 and PE2.
  • VPN1 and VPN3 can share the P2P tunnel between PE1 and PE3, and can also share the P2P tunnel between PE1 and PE4.
  • FIG. 3(b) is a flowchart of a method for establishing a multicast tunnel according to an embodiment of the present application. The method for establishing a multicast tunnel provided by the embodiment of the present application is described below with reference to FIG. 3(a) and FIG. 3(b).
  • PE1 sends a first request message to PE2.
  • the first request message includes information of a label block and an identifier of the first path.
  • the information of the tag block is used to indicate the size of the tag block.
  • the identifier of the first path is used to identify a first P2P tunnel, and the first P2P tunnel is a P2P tunnel between PE1 and PE2.
  • PE1 is the upstream device of PE2, and PE2 is the downstream device of PE1.
  • PE1 may obtain the information of the label block according to the number of VPNs to which the site with which it communicates. As shown in FIG. 3(a), PE1 can determine the size of the label block to be 3 according to the number of VPNs.
  • the PE1 may obtain the first request message according to the information of the label block and the identifier of the first path.
  • the first request message is used to request the PE2 to allocate a label corresponding to the first P2MP tunnel.
  • the first request message may be an extended path message.
  • the extended path message may be extended to a session_attribute field in a label_request included in the path message in the RFC 3209, where the session_attribute field carries information of the label block.
  • PE1 can obtain the outgoing interface of PE1 and PE2 according to CSPF or TEDB, that is, the identifier of the first outgoing interface.
  • the PE1 may send the first request message to the PE2 by using the first outbound interface.
  • PE2 allocates a first label.
  • the first label is a starting label of the label block determined by the PE2 according to the information of the label block.
  • the PE2 can select a label block corresponding to the information of the label block from the configured global label space, and obtain a start label of the label block, as shown in FIG. 3(a), LB1, and LB1 is a PE2 and a label.
  • the start tag of the tag block corresponding to the information of the tag block.
  • the PE2 sends a first response message to the PE1.
  • the PE2 may obtain the first response message according to the identifier of the first label and the first path.
  • the first response message includes an identifier of the first tag and the first path.
  • the first response message may be an RSVP message, and the RSVP message may carry the identifier of the first label and the first path.
  • PE2 obtains the first entry.
  • the PE2 can obtain the first entry according to the identifier of the first label and the first path.
  • the PE2 obtains the first entry according to the identifier of the first label and the first path, and the PE2 obtains the first identifier according to the identifier of the first path, where the first identifier is used to identify the a multicast forwarding information corresponding to the first path;
  • the PE2 obtains a second label according to the first label, where the second label is a label obtained according to the first label and an offset, the offset
  • the value corresponds to the VPN;
  • the PE2 obtains the first entry according to the second label and the first identifier, and the first entry includes the second label and the first identifier.
  • the PE2 obtains that the first identifier belongs to the optional content according to the identifier of the first path, and the first identifier in the first entry may be replaced by the identifier of the first path.
  • the PE2 may generate a second entry in the control plane, and generate the first entry in the forwarding plane according to the second entry.
  • the PE2 may generate a second entry on the control plane according to the identifier of the first label and the first path.
  • the second entry includes the first tag and an identifier of the first path.
  • the second entry can be expressed as:
  • the InLabelBase ⁇ assigned by PE2> indicates the first label allocated by the PE2, that is, LB1 in FIG. 3(a).
  • Session 1 represents the identifier of the first path.
  • PE2 may generate a first entry on the forwarding plane according to the second entry.
  • the first entry can be expressed as:
  • the InLabelBase ⁇ assigned by PE2> indicates the first label allocated by the PE2, that is, LB1 in FIG. 3(a). Offset represents the offset. InLabelBase ⁇ assigned by PE2>+offset represents the second tag. ID1 represents the first identifier, and ID1 corresponds to Session1. The above is only one manifestation of the first entry, and the specific embodiment of the present application is not limited.
  • the PE1 obtains the first forwarding entry according to the first response message.
  • the PE1 obtains the first forwarding entry according to the first response message, and the PE1 obtains the first identifier according to the identifier of the first path, and the PE1 obtains the identifier according to the identifier of the first path.
  • the first forwarding entry is obtained by the PE1 according to the first label, the first identifier, and the identifier of the first outgoing interface, where the first forwarding entry includes the first a second label, the first identifier, and an identifier of the first outgoing interface.
  • the PE1 obtains that the first identifier belongs to the optional content according to the identifier of the first path, and the first identifier in the first forwarding entry may be replaced by the identifier of the first path.
  • the PE1 may generate a second forwarding entry on the control plane, and then generate the first forwarding entry on the forwarding plane according to the second forwarding entry.
  • the PE1 may generate a second forwarding entry on the control plane according to the identifier of the first label and the first path that is included in the first response message, where the second forwarding entry includes the first a label, an identifier of the first outbound interface, and an identifier of the first path.
  • PE1 can obtain the identifier of the first outgoing interface by using 301.
  • the second forwarding entry may be expressed as:
  • Session1 represents the identifier of the first path.
  • OutLabelBase ⁇ assigned by PE2> indicates the first label assigned by PE2, that is, LB1 in FIG. 3(a).
  • OutInterface ⁇ to PE2> indicates the identifier of the first outgoing interface.
  • PE1 may generate a first forwarding entry on the forwarding plane according to the second forwarding entry.
  • the first forwarding entry may be expressed as:
  • ID1 represents the first identifier, and ID1 corresponds to Session1.
  • OutLabelBase ⁇ assigned by PE2> indicates the first label assigned by PE2, that is, LB1 in FIG. 3(a). Offset represents the offset.
  • OutLabelBase ⁇ assigned by PE2>+offset represents the second tag.
  • OutInterface ⁇ to PE2> indicates the identifier of the first outgoing interface.
  • the PE1 sends a second request message to the PE3.
  • the second request message includes information of the label block and an identifier of the second path.
  • the second The information of the tag block may be blocksize in FIG. 3(a).
  • the identifier of the second path is used to identify a second P2P tunnel, and the second P2P tunnel is a P2P tunnel between PE1 and PE3.
  • the PE1 may obtain the second request message according to the information of the label block and the identifier of the second path.
  • the second request message is used to request the PE3 to allocate a label corresponding to the second P2P tunnel.
  • the second request message may be an extended path message.
  • the extended path message may be extended to a session_attribute field in a label_request included in the path message in the RFC 3209, where the session_attribute field carries information of the label block.
  • PE1 can obtain the outbound interface that communicates with PE3 on PE1 according to CSPF or TEDB, that is, the identifier of the second interface.
  • the PE1 may send the second request message to the PE3 by using the second interface.
  • PE3 assigns a third label.
  • the third label is a starting label of the label block determined by the PE3 according to the information of the label block.
  • the PE3 may select a label block corresponding to the information of the label block from the configured global label space, and obtain a start label of the label block, as shown in FIG. 3(a), LB2, and LB2 is a PE3.
  • the global label space configured on PE3 is different from the global label space configured on PE2.
  • the PE3 sends a second response message to the PE1.
  • the PE3 may obtain a second response message according to the identifier of the third label and the second path.
  • the second response message includes an identifier of the third tag and the second path.
  • the second response message may be an RSVP message, and the RSVP message may carry the identifier of the third label and the second path.
  • PE3 obtains the third entry.
  • the PE3 may obtain the third entry according to the identifier of the third label and the second path.
  • the third entry includes a fourth tag and a second identity.
  • the fourth tag is a tag obtained according to the third tag and the offset, and the offset corresponds to a VPN.
  • the second identifier is used to identify multicast forwarding information corresponding to the identifier of the second path.
  • the PE3 obtains the third entry according to the identifier of the third label and the second path, and the PE3 obtains the second identifier according to the identifier of the second path; Obtaining the fourth label according to the third label and the offset; the third entry is obtained by the PE3 according to the fourth label and the second identifier, and the third entry includes the fourth label And the second identifier.
  • the PE3 obtains the second identifier as an optional content according to the identifier of the second path, and the second identifier in the third entry may be replaced by the identifier of the second path.
  • the PE3 may generate a fourth entry in the control plane, and generate the third entry in the forwarding plane according to the fourth entry.
  • the PE3 may generate a fourth entry on the control plane according to the identifier of the third label and the second path, where the fourth entry includes the identifier of the third label and the second path.
  • the fourth entry can be expressed as:
  • the InLabelBase ⁇ assigned by PE3> indicates the third label allocated by the PE3, that is, LB2 in FIG. 3(a).
  • Session 2 represents the identifier of the second path.
  • PE3 may generate a third entry on the forwarding plane according to the fourth entry.
  • the third entry can be expressed as:
  • the InLabelBase ⁇ assigned by PE3> indicates the third label allocated by the PE3, that is, LB2 in FIG. 3(a). Offset represents the offset. InLabelBase ⁇ assigned by PE3>+offset represents the fourth tag. ID2 represents the second identifier, and ID2 corresponds to Session2.
  • the foregoing is only one representation of the third item, and the specific embodiment of the present application is not limited.
  • the PE1 obtains a third forwarding entry according to the second response message.
  • the PE1 obtains the third forwarding entry according to the second response message, the PE1 obtains the second identifier according to the identifier of the second path, and the PE1 obtains the identifier according to the identifier of the second path.
  • the third forwarding entry is obtained according to the third label, the second identifier, and the identifier of the second outbound interface, where the third forwarding entry includes the first The identifier of the four labels, the second identifier, and the second outbound interface.
  • the PE1 obtains the second identifier as an optional content according to the identifier of the second path, and the second identifier in the third forwarding entry may be replaced by the identifier of the second path.
  • the PE1 may generate a fourth forwarding entry on the control plane, and generate the third forwarding entry on the forwarding plane according to the fourth forwarding entry.
  • the PE1 may generate a fourth forwarding entry on the control plane according to the identifier of the third label and the second path included in the second response message, where the fourth forwarding entry includes the third a label, an identifier of the second outbound interface, and an identifier of the second path.
  • PE1 may obtain the identifier of the second outbound interface by using 306.
  • the fourth forwarding entry may be expressed as:
  • Session 2 represents the identifier of the second path.
  • OutLabelBase ⁇ assigned by PE3> indicates the third label allocated by PE3, that is, LB2 in FIG. 3(a).
  • OutInterface ⁇ to PE3> indicates the identifier of the second outgoing interface.
  • PE1 may generate a third forwarding entry on the forwarding plane according to the fourth forwarding entry.
  • the third forwarding entry may be expressed as:
  • ID2 represents the second identifier, and ID2 corresponds to Session2.
  • OutLabelBase ⁇ assigned by PE3> indicates the third label allocated by PE3, that is, LB2 in FIG. 3(a). Offset represents the offset.
  • OutLabelBase ⁇ assigned by PE3>+offset represents the fourth tag.
  • OutInterface ⁇ to PE3> indicates the identifier of the second outgoing interface. The foregoing is only one representation of the third forwarding entry, and the specific embodiment of the present application is not limited.
  • the PE1 sends a third request message to the PE4.
  • the method for the PE1 to obtain the third request message is the same as the method for the PE1 to obtain the second request message.
  • the third request message includes information of the tag block and an identifier of the third path.
  • the identifier of the third path is used to identify a third P2P tunnel.
  • the third P2P tunnel is a P2P tunnel between PE1 and PE3.
  • the third request message is used to request the PE4 to allocate a label corresponding to the third P2P tunnel.
  • PE1 can obtain the outbound interface of PE1 and PE4 according to CSPF or TEDB, that is, the identifier of the third interface.
  • the PE1 may send the third request message to the PE4 through the third interface.
  • PE4 assigns a fifth label.
  • the fifth The tag can be LB3 in Figure 3(a).
  • the global label space configured on PE4 is different from the global label space configured on PE2.
  • the global label space configured on PE4 is different from the global label space configured on PE3.
  • the PE4 sends a third response message to the PE1.
  • the method for the PE4 to obtain the third response message is the same as the method for the PE3 to obtain the second response message in 308, and details are not described herein again.
  • the third response message includes an identifier of the fifth tag and the third path.
  • PE4 obtains the fifth entry.
  • the fifth entry includes a sixth tag and a third identifier.
  • the sixth tag is a tag obtained according to the fifth tag and the offset.
  • the method in which PE4 obtains the fifth entry is the same as the method in which 309 PE3 obtains the third entry.
  • the third identifier is used to identify multicast forwarding information corresponding to the third path.
  • the third identifier in the fifth entry may be replaced by the identifier of the third path.
  • the PE4 may generate a sixth entry in the control plane, and generate the fifth entry in the forwarding plane according to the sixth entry.
  • the PE4 may generate a sixth entry on the control plane according to the identifier of the fifth label and the third path, where the sixth entry includes the identifier of the fifth label and the third path.
  • the sixth entry can be expressed as:
  • the InLabelBase ⁇ assigned by PE4> indicates the fifth label allocated by the PE4, that is, LB3 in FIG. 3(a). Session 3 represents the identity of the third path.
  • the foregoing is only one representation of the sixth item, and the specific embodiment of the present application is not limited.
  • PE4 may generate a fifth entry on the forwarding plane according to the sixth entry.
  • the fifth entry can be expressed as:
  • the InLabelBase ⁇ assigned by PE4> indicates the fifth label allocated by the PE4, that is, LB3 in FIG. 3(a). Offset represents the offset. InLabelBase ⁇ assigned by PE4>+offset represents the sixth tag. ID3 represents the third identifier, and ID3 corresponds to Session3.
  • the foregoing is only one representation of the fifth item, and the specific embodiment of the present application is not limited.
  • the PE1 obtains a fifth forwarding entry according to the third response message.
  • the fifth forwarding entry includes an identifier of the sixth label, the third identifier, and the third outbound interface, where the sixth label is a label obtained according to the fifth label and the offset.
  • the identifier of the third outbound interface is used to identify the interface on PE1 that communicates with PE4.
  • the method for the PE1 to obtain the fifth forwarding entry is the same as the method for the PE1 to obtain the third forwarding entry in 310.
  • the third identifier in the fifth forwarding entry may be replaced by the identifier of the third path.
  • the PE1 may generate a sixth forwarding entry on the control plane, and generate the fifth forwarding entry on the forwarding plane according to the sixth forwarding entry.
  • the PE1 may generate the sixth forwarding entry on the control plane according to the fifth label and the identifier of the third path that are included in the third response message, where the sixth forwarding entry includes the a fifth label, an identifier of the third outbound interface, and an identifier of the third path.
  • PE1 can obtain the identifier of the third outbound interface by using 311.
  • the sixth forwarding entry may be expressed as:
  • Session 3 represents the identifier of the path.
  • OutLabelBase ⁇ assigned by PE4> indicates the fifth label assigned by PE4, that is, LB3 in FIG. 3(a).
  • OutInterface ⁇ to PE4> indicates the identifier of the third outgoing interface.
  • PE1 may generate the fifth forwarding entry on the forwarding plane according to the sixth forwarding entry.
  • the fifth forwarding entry may be expressed as:
  • ID3 represents the third identifier, and ID3 corresponds to Session3.
  • OutLabelBase ⁇ assigned by PE4> indicates the fifth label assigned by PE4, that is, LB3 in FIG. 3(a). Offset represents the offset.
  • OutLabelBase ⁇ assigned by PE4>+offset represents the sixth tag.
  • OutInterface ⁇ to PE4> indicates the identifier of the third outgoing interface. The foregoing is only one representation of the fifth forwarding entry, and the specific embodiment of the present application is not limited.
  • 301, 306, and 311 in the second embodiment can be executed at the same time, or 301, 306, and 311 can be executed in any order, which is not limited in this embodiment.
  • 304 may be performed after 302, 305 may be performed after 303, 304 and 305 may be performed simultaneously, or 304 may be performed later than 305.
  • 309 may be performed after 307, 310 may be performed after 308, 309 and 310 may be performed simultaneously, or 309 may be performed later than 310.
  • 314 may be performed after 312, 315 may be performed after 313, 314 and 315 may be performed simultaneously, or 314 may be performed later than 315.
  • each node forms a corresponding entry or forwarding entry on the forwarding plane according to the method provided in the second embodiment.
  • the forwarding entries formed on the forwarding plane of PE1 are as follows:
  • ID11 indicates the value of ID1 when the offset is 1
  • ID12 indicates the value of ID1 when the offset is 2.
  • ID21 indicates the value of ID2 when the offset is 1
  • ID23 indicates the value of ID2 when the offset is 3.
  • ID31 indicates the value of ID3 when the offset is 1, and ID33 indicates the value of ID3 when the offset is 3.
  • the entries formed on the forwarding plane of PE2 are as follows:
  • ID11 indicates the value of ID1 when the offset is 1
  • ID12 indicates the value of ID1 when the offset is 2.
  • the entries formed on the forwarding plane of PE3 are as follows:
  • ID21 indicates the value of ID2 when the offset is 1
  • ID23 indicates the value of ID2 when the offset is 3.
  • the entries formed on the forwarding plane of PE4 are as follows:
  • ID31 indicates the value of ID3 when the offset is 1
  • ID33 indicates the value of ID3 when the offset is 3.
  • PE1, PE2, PE3, or PE4 can use the corresponding entry in Figure 3 (b) to implement packet forwarding.
  • the forwarding process of the packet will be described below with reference to FIG. 3(a).
  • PE1 receives the first packet from site1.
  • the PE1 may determine, according to the port that receives the first packet, that the first packet is from VPN1, that is, site1 belongs to VPN1.
  • the correspondence between the VPN and the offset is stored on the PE1.
  • the PE1 can obtain the value of the offset corresponding to the VPN1 according to the corresponding relationship. For example, the value of the offset corresponding to the VPN1 is 1.
  • PE1 determines that there are VPN1 sites on PE2, PE3, and PE4, and PE1 obtains ID11, ID21, and ID31.
  • the PE1 obtains the first forwarding entry, the third forwarding entry, and the fifth forwarding entry according to the ID11, the ID21, and the ID31, that is, the forwarding entry formed by the offset 1 formed on the PE1.
  • the value of the second label in the first forwarding entry is LB1+1, where LB1 is the first label assigned by PE2, and 1 is the value of offset.
  • the value of the fourth label in the third forwarding entry is LB2+1, where LB2 is the third label allocated by PE3.
  • the value of the sixth label in the fifth forwarding entry is LB3+1, where LB3 is the fifth label allocated by PE3.
  • the PE1 obtains the second packet according to the values of the first packet and the second label.
  • the second packet includes a value of the first packet and the second label.
  • the PE1 sends the second packet to the PE2 by using the identifier of the first outgoing interface.
  • the PE1 obtains the third packet according to the values of the first packet and the fourth label.
  • the third packet includes values of the first packet and the fourth label.
  • the PE1 sends the third packet to the PE3 by using the identifier of the second outbound interface.
  • the PE1 obtains the fourth packet according to the values of the first packet and the sixth label.
  • the fourth packet includes values of the first packet and the sixth label.
  • the PE1 sends the fourth packet to the PE4 by using the identifier of the third outbound interface.
  • PE2 receives the second packet from PE1.
  • the PE2 determines that the value of the offset is 1 according to the value of the second label in the second packet.
  • the PE2 obtains the first packet from the second packet.
  • the PE2 determines that the first packet corresponds to VPN1 according to the value of the offset.
  • the PE2 sends the first packet to the site 4 belonging to the VPN1 through the interface that communicates with the site 4.
  • the method for the PE3 to send the first packet to the site 6 is the same as the method for the PE2 to send the first packet to the site 4.
  • the method for the PE4 to send the first packet to the site 8 is the same as the method for the PE2 to send the first packet to the site 4.
  • the PE1 as the first forwarding device may send the blocksize to the PE2, the PE3, and the PE4 as the second forwarding device, and obtain the start as the label block from the one or more PE devices that are the second forwarding device.
  • Labels such as LB1, LB2, and LB3.
  • the PE1 does not need to store N+1 label spaces. Only the LB1, LB2, LB3, and the offset corresponding to the VPN can be forwarded to the corresponding VPN, which helps reduce the forwarding plane. The cost and implementation of a linear lookup table.
  • FIG. 4 is a schematic structural diagram of a first forwarding device according to an embodiment of the present disclosure.
  • the first forwarding device provided by the embodiment of the present application may be PE1 or P in FIG. 2(a), and may also be PE1 in FIG. 3(a).
  • the first forwarding device provided by the embodiment of the present application is described below with reference to FIG. 4 .
  • the first forwarding device includes a first sending unit 401, a first receiving unit 402, and a first obtaining unit 403.
  • the first sending unit 401 is configured to send a request message to the second forwarding device, where the request message includes information of a label block and an identifier of a path, where information of the label block is used to indicate a size of the label block, where the path is The identifier is used to identify a tunnel corresponding to the virtual private network VPN between the first forwarding device and the second forwarding device, where the first The transmitting device is an upstream device of the second forwarding device.
  • the first receiving unit 402 is configured to receive a response message sent by the second forwarding device, where the response message includes a first label and an identifier of the path, where the first label is determined according to information of the label block.
  • the starting tag of the tag block is configured to receive a response message sent by the second forwarding device, where the response message includes a first label and an identifier of the path, where the first label is determined according to information of the label block.
  • the starting tag of the tag block is configured to receive a response message sent by the second forwarding device, where the response message includes a first label and an identifier of the path, where the first label is determined according to information of the label block.
  • the starting tag of the tag block is configured to receive a response message sent by the second forwarding device, where the response message includes a first label and an identifier of the path, where the first label is determined according to information of the label block.
  • the starting tag of the tag block is configured to receive a response message sent by the second forwarding device, where the response message
  • the first obtaining unit 403 is configured to obtain, according to the identifier of the first label and the path, a forwarding entry corresponding to the tunnel.
  • the first forwarding device further includes: a determining unit 404 and a second obtaining unit 405.
  • the determining unit 404 is configured to determine a tunnel corresponding to the VPN.
  • the second obtaining unit 405 is configured to obtain information about the label block according to the tunnel corresponding to the VPN, where the information of the label block is determined by the number of VPNs corresponding to the tunnel.
  • the first obtaining unit 403 is specifically configured to: obtain an identifier of the multicast according to the identifier of the path, where the identifier of the multicast is used to identify multicast forwarding information corresponding to the path; An identifier of the path, where the identifier of the outbound interface is obtained, where the outbound interface is an interface that communicates with the second forwarding device on the first forwarding device; according to the first label, the identifier of the multicast, and the outgoing An identifier of the interface, where the forwarding entry is obtained, where the forwarding entry includes a second label, the identifier of the multicast, and an identifier of the outbound interface, where the second label is based on the first label and the offset The obtained label, the value of the offset corresponding to the VPN.
  • the first forwarding device further includes: a second receiving unit 406, a third obtaining unit 407, and a second sending unit 408.
  • the second receiving unit 406 is configured to receive the first packet from the VPN, and obtain an identifier of the VPN.
  • the third obtaining unit 407 is configured to obtain a second packet according to the forwarding entry, the first packet, and the identifier of the VPN, where the second packet is sent to the The multicast packet of the second forwarding device.
  • the second sending unit 408 is configured to send the second packet to the second forwarding device.
  • the third obtaining unit 407 is specifically configured to: obtain a value of the offset corresponding to the VPN according to the correspondence and the identifier of the VPN, where the correspondence includes the identifier of the VPN and the partial a value of the shift amount; obtaining, according to the forwarding entry and the value of the offset, an identifier of the third label and the outbound interface, where the third label is a value according to the first label and the offset Obtaining a label, the egress interface is configured to communicate with the second forwarding device, and the second sending unit is configured to send the second packet to the second forwarding device according to the identifier of the egress interface.
  • the second packet includes the first packet and the third label.
  • the first forwarding device provided by the embodiment of the present application may be configured to obtain a linear search according to a start label of a label block sent by the second forwarding device, such as a first label and an identifier of the path.
  • Forwarding entries compared to the usual upstream-assigned mode, help reduce the forwarding cost required by the forwarding plane to support the upstream-assigned mode, and also help reduce storage space and improve forwarding efficiency.
  • the number of the forwarding entries obtained by the first forwarding device is smaller than the forwarding entry formed according to the 1+N label space, and the first forwarding device does not need to save 1+N label spaces, which helps to reduce The occupation of storage space.
  • FIG. 5 is a schematic structural diagram of a second forwarding device according to an embodiment of the present disclosure.
  • the second forwarding device provided by the embodiment of the present application may be P, PE2 or PE3 in FIG. 2(a), and may also be PE2, PE3 or PE4 in FIG. 3(a). If the first forwarding device is PE1 of FIG. 2(a), the second forwarding device may be P of FIG. 2(a). If the first forwarding device is P of FIG. 2(a), the second forwarding device may be PE2 or PE3 of FIG. 2(a).
  • the second forwarding device provided in the embodiment of the present application is described below with reference to FIG.
  • the second forwarding device includes: a receiving unit 501, a first obtaining unit 502, and a sending unit 503.
  • the receiving unit 501 is configured to receive a request message sent by the first forwarding device, where the second forwarding device is The downstream device of the first forwarding device, the request message includes information of a label block and an identifier of a path, the information of the label block is used to indicate a size of the label block, and the identifier of the path is used to identify a virtual private network VPN. Tunnel.
  • the first obtaining unit 502 is configured to obtain, according to the information of the label block, a first label, where the first label is a starting label of the label block determined according to information of the label block.
  • the sending unit 503 is configured to send a response message to the first forwarding device, where the response message includes the identifier of the first label and the path.
  • the second forwarding device further includes a second obtaining unit 504.
  • the second obtaining unit 504 is configured to obtain, according to the identifier of the first label and the path, an entry corresponding to the tunnel, where the entry includes a second label, and the second label is according to the The first tag and the offset obtained tag, the value of the offset corresponding to the VPN.
  • the second obtaining unit 504 is specifically configured to: obtain an identifier of the multicast according to the identifier of the path, where the identifier of the multicast is used to identify multicast forwarding information corresponding to the path; And obtaining, by the first label and the identifier of the multicast, the entry, where the entry includes the second label and the identifier of the multicast.
  • the second forwarding device may allocate the first label to the first forwarding device according to the information of the label block sent by the first forwarding device.
  • the second forwarding device reserves a label block that matches the information of the label block according to the information of the label block.
  • the second forwarding device can obtain an entry matching the two parameters according to the offset and the first label carried in the packet from the first forwarding device, so as to be based on the group in the entry.
  • the identifier of the broadcast is obtained, and the label required for sending the packet to the other forwarding device is obtained, so that the second forwarding device does not need to save 1+N label spaces, which helps reduce the occupation of the storage space.
  • FIG. 6 is a schematic structural diagram of a first forwarding device according to an embodiment of the present disclosure.
  • the first forwarding device provided in this embodiment may be the same as the first forwarding device in FIG.
  • the first forwarding device includes a processor 601, a memory 602, and a communication interface 603.
  • the processor 601, the memory 602, and the communication interface 603 are connected by a communication bus 604.
  • the processor 601 may be an NP.
  • the processor 601 may be a central processing unit (CPU).
  • the memory 602 is used to store programs.
  • the processor 601 performs the following operations in accordance with executable instructions included in the program read from the memory 602.
  • the processor 601 sends a request message to the second forwarding device by using the communication interface 603, where the request message includes the information of the label block and the identifier of the path, where the information of the label block is used to indicate the size of the label block.
  • the identifier of the path is used to identify a tunnel corresponding to the virtual private network VPN between the first forwarding device and the second forwarding device, and the first forwarding device is an upstream device of the second forwarding device.
  • the processor 601 receives, by using the communication interface 603, a response message sent by the second forwarding device, where the response message includes a first label and an identifier of the path, where the first label is according to the label block.
  • the information identifies the starting tag of the tag block.
  • the processor 601 obtains a forwarding entry corresponding to the tunnel according to the identifier of the first label and the path.
  • the processor 601 further determines a tunnel corresponding to the VPN, and the processor 601 further obtains information about the label block according to the tunnel corresponding to the VPN, where the information of the label block is Determined by the number of VPNs corresponding to the tunnel.
  • the processor 601 may obtain a multicast identifier according to the identifier of the path, where the identifier of the multicast is used to identify multicast forwarding information corresponding to the path, and the processor 601 may be configured according to the The identifier of the path is obtained, and the outbound interface is an interface that communicates with the second forwarding device on the first forwarding device;
  • the processor 601 may obtain the forwarding entry according to the first label, the identifier of the multicast, and the identifier of the outbound interface, where the forwarding entry includes a second label, the identifier of the multicast, and
  • the identifier of the outbound interface, the second label is a label obtained according to the first label and an offset, and the value of the offset corresponds to a VPN.
  • the processor 601 further receives the first packet from the VPN by using the communication interface 603, and obtains an identifier of the VPN; the processor 601 is further configured to: according to the forwarding entry, the first a packet and the identifier of the VPN, the second packet is obtained, where the second packet is a multicast packet sent to the second forwarding device by using the tunnel; The communication interface 603 sends the second packet to the second forwarding device.
  • the processor 601 may obtain the value of the offset corresponding to the VPN according to the correspondence and the identifier of the VPN, where the correspondence includes the identifier of the VPN and the value of the offset;
  • the processor 601 may obtain, according to the forwarding entry and the value of the offset, an identifier of the third label and the outbound interface, where the third label is according to the first label and the offset a value obtained by the interface, the outbound interface is configured to communicate with the second forwarding device, and the processor 601 sends the identifier to the second forwarding device by using the communication interface 603 according to the identifier of the outgoing interface.
  • a second packet where the second packet includes the first packet and the third label.
  • the forwarding entry generated by the first forwarding device in the control plane of the embodiment of the present application may be stored in the memory of the processor 601. If the first forwarding device further includes a forwarding chip, the forwarding entry generated by the first forwarding device on the forwarding plane may be stored in the forwarding chip. If the first forwarding device does not include the forwarding chip, the forwarding entry generated by the first forwarding device on the forwarding plane may be stored in the memory or the memory 602 of the processor 601.
  • FIG. 7 is a schematic structural diagram of a second forwarding device according to an embodiment of the present disclosure.
  • the second forwarding device shown in FIG. 7 can be the same as the second forwarding device shown in FIG. 5.
  • the first forwarding device includes a processor 701, a memory 702, and a communication interface 703.
  • the processor 701, the memory 702, and the communication interface 703 are connected by a communication bus 704. If the second forwarding device shown in FIG. 7 is a switch in the network, the processor 701 may be an NP. If the second forwarding device shown in FIG. 7 is a router, the processor 701 may be a CPU.
  • the memory 702 is used to store programs.
  • the processor 701 performs the following operations in accordance with executable instructions included in the program read from the memory 702.
  • the processor 701 receives the request message sent by the first forwarding device by using the communication interface 703, the second forwarding device is a downstream device of the first forwarding device, and the request message includes information and path of the label block.
  • the identifier of the label block is used to indicate the size of the label block, and the identifier of the path is used to identify a tunnel corresponding to the virtual private network VPN.
  • the processor 701 obtains a first label according to the information of the label block, where the first label is a start label of the label block determined according to information of the label block.
  • the processor 701 sends a response message to the first forwarding device by using the communication interface 703, where the response message includes the identifier of the first label and the path.
  • the processor 701 further obtains, according to the identifier of the first label and the path, an entry corresponding to the tunnel, where the entry includes a second label, where the second label is a The first tag and the offset obtained tag, the value of the offset corresponding to the VPN.
  • the processor 701 obtains a multicast identifier according to the identifier of the path, where the identifier of the multicast is used to identify multicast forwarding information corresponding to the path, and the processor 701 is configured according to the foregoing. And obtaining, by the label and the identifier of the multicast, the entry, where the entry includes the second label and the identifier of the multicast.
  • the forwarding entry or entry generated by the first forwarding device in the control plane of the embodiment of the present application may be stored in the memory of the processor 701. If the first forwarding device further includes a forwarding chip, the first forwarding device is on the forwarding plane. The generated forwarding entry or entry can be saved in the forwarding chip. If the first forwarding device does not include a forwarding chip, the forwarding entry or entry generated by the first forwarding device on the forwarding plane may be stored in the memory or the memory 702 of the processor 701.

Abstract

The present application provides a method for establishing a multicast tunnel, capable of reducing the costs of a forwarding plane and improving the forwarding efficiency. The method comprises: a first forwarding device sends a request message to a second forwarding device, the request message comprising label block information and a path identifier, the label block information being used for representing the size of a label block, the path identifier being used for identifying a tunnel, between the first forwarding device and the second forwarding device, corresponding to a virtual private network (VPN), the first forwarding device being an upstream device of the second forwarding device; the first forwarding device receives a response message sent by the second forwarding device, the response message comprising a first label and the path identifier, the first label being an initial label of the label block determined according to the label block information; the first forwarding device obtains a forwarding entry corresponding to the tunnel according to the first label and the path identifier.

Description

一种建立组播隧道的方法和装置Method and device for establishing multicast tunnel
本申请要求于2016年7月12日提交中国专利局、申请号为CN 201610546280.5、发明名称为“一种建立组播隧道的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application, filed on July 12, 2016, with the application number of CN 201610546280.5, entitled "A Method and Apparatus for Establishing a Multicast Tunnel", the entire contents of which are incorporated by reference. In this application.
技术领域Technical field
本申请涉及通信领域,尤其涉及一种建立组播隧道的方法和装置。The present application relates to the field of communications, and in particular, to a method and apparatus for establishing a multicast tunnel.
背景技术Background technique
组播虚拟专用网(multicast virtual private network,MVPN)可采用聚合隧道(aggregate tunnel)实现组播转发。多个MVPN可采用同一个聚合隧道实现组播转发,这就需要在聚合隧道包含的转发设备上针对不同的VPN配置相应的标签,以实现多个VPN共用一条聚合隧道。A multicast virtual private network (MVPN) can implement multicast forwarding by using an aggregate tunnel. Multiple MVPNs can use the same aggregation tunnel to implement multicast forwarding. This requires configuring corresponding labels for different VPNs on the forwarding devices included in the aggregation tunnel to implement multiple aggregation tunnels for multiple VPNs.
目前,在针对不同的VPN配置标签的过程中,如果采用上游指定(upstream-assigned)的方式配置标签,聚合隧道包含的转发设备上的标签空间除了存储全局标签空间,还需要存储N个上下文标签(context-label)所决定的标签空间,总的标签空间的标签数变成了20bit*(1+N),即100万个标签。而转发设备若采用线性转发,则根据标签空间包含的标签需要生成上亿条转发表项,这使得转发设备无法采用线性表来保存和查找标签。换句话说,在利用报文中的标签和生成的转发表项对报文进行转发的过程中,查找与报文中的标签匹配的转发表项的操作较为繁重,转发面上的代价较大。Currently, in the process of configuring labels for different VPNs, if the label is configured in the upstream-assigned manner, the label space on the forwarding device included in the aggregation tunnel needs to store N context labels in addition to the global label space. (context-label) The label space determined by the total label space becomes 20bit*(1+N), that is, 1 million labels. If the forwarding device uses linear forwarding, it needs to generate hundreds of millions of forwarding entries according to the labels contained in the label space. This makes it impossible for the forwarding device to use a linear table to save and find labels. In other words, in the process of forwarding a packet by using the label in the packet and the generated forwarding entry, the operation of finding the forwarding entry matching the label in the packet is heavy, and the cost on the forwarding plane is relatively large. .
发明内容Summary of the invention
有鉴于此,本申请实施例提供一种建立组播隧道的方法和装置,有助于降低转发面的成本和提高转发效率。In view of this, the embodiment of the present application provides a method and an apparatus for establishing a multicast tunnel, which helps reduce the cost of the forwarding plane and improve the forwarding efficiency.
本申请实施例提供的技术方案如下。The technical solutions provided by the embodiments of the present application are as follows.
第一方面,提供了一种建立组播隧道的方法,所述方法包括:The first aspect provides a method for establishing a multicast tunnel, where the method includes:
第一转发设备向第二转发设备发送请求消息,所述请求消息包括标签块的信息和路径的标识,所述标签块的信息用于表示标签块的大小,所述路径的标识用于标识所述第一转发设备与所述第二转发设备间与虚拟专用网VPN对应的隧道,所述第一转发设备是所述第二转发设备的上游设备;The first forwarding device sends a request message to the second forwarding device, where the request message includes the information of the label block and the identifier of the path, the information of the label block is used to indicate the size of the label block, and the identifier of the path is used to identify the identifier a tunnel corresponding to the virtual private network VPN between the first forwarding device and the second forwarding device, where the first forwarding device is an upstream device of the second forwarding device;
所述第一转发设备接收所述第二转发设备发送的响应消息,所述响应消息包括第一标签和所述路径的标识,所述第一标签是根据所述标签块的信息确定的所述标签块的起始标签;Receiving, by the first forwarding device, a response message sent by the second forwarding device, where the response message includes a first label and an identifier of the path, where the first label is determined according to information of the label block. The starting tag of the tag block;
所述第一转发设备根据所述第一标签和所述路径的标识,获得与所述隧道对应的转发表项。The first forwarding device obtains a forwarding entry corresponding to the tunnel according to the identifier of the first label and the path.
本申请实施例提供的方法中,第一转发设备可根据第二转发设备发送的标签块的起始标签,比如第一标签,以及所述路径的标识,获得能够实现线性查找的转发表项,相对于通常的upstream-assigned的方式来说,有助于降低转发面支持upstream-assigned方式所需的转发成本,还有助于降低存储空间和提高转发效率。 In the method provided by the embodiment of the present application, the first forwarding device may obtain a forwarding entry that can implement a linear search according to a start label of the label block sent by the second forwarding device, such as the first label, and the identifier of the path. Compared with the usual upstream-assigned mode, it helps to reduce the forwarding cost required by the forwarding plane to support the upstream-assigned mode, and also helps to reduce storage space and improve forwarding efficiency.
可选地,本申请实施例提供的方法可应用于MVPN场景中。所述隧道为P2MP隧道,或者所述隧道为P2P隧道。若所述隧道为P2MP隧道,则所述第一转发设备为PE设备,所述第二转发设备为P设备,或者所述第一转发设备和所述第二转发设备均为PE设备。若所述隧道为P2P隧道,则所述第一转发设备和所述第二转发设备均为PE设备。Optionally, the method provided in this embodiment of the present application is applicable to an MVPN scenario. The tunnel is a P2MP tunnel, or the tunnel is a P2P tunnel. If the tunnel is a P2MP tunnel, the first forwarding device is a PE device, the second forwarding device is a P device, or the first forwarding device and the second forwarding device are both PE devices. If the tunnel is a P2P tunnel, the first forwarding device and the second forwarding device are both PE devices.
可选地,所述请求消息可为路径path消息,所述path消息的session字段可携带所述标签块的信息。所述响应消息可为资源预留协议RSVP消息,所述RSVP消息的session字段可携带所述第一标签和所述路径的标识。Optionally, the request message may be a path path message, and a session field of the path message may carry information of the label block. The response message may be a resource reservation protocol RSVP message, and the session field of the RSVP message may carry the identifier of the first label and the path.
可选地,所述方法还包括:所述第一转发设备确定与所述VPN对应的隧道;所述第一转发设备根据所述与所述VPN对应的隧道,获得所述标签块的信息,所述标签块的信息由所述隧道对应的VPN的数量所确定。Optionally, the method further includes: the first forwarding device determines a tunnel corresponding to the VPN, and the first forwarding device obtains information about the label block according to the tunnel corresponding to the VPN, The information of the tag block is determined by the number of VPNs corresponding to the tunnel.
可选地,所述第一转发设备根据所述第一标签和所述路径的标识,获得与所述隧道对应的转发表项包括:所述第一转发设备根据所述路径的标识,获得组播的标识,所述组播的标识用于标识所述路径所对应的组播转发信息;所述第一转发设备根据所述路径的标识,获得出接口的标识,所述出接口为所述第一转发设备上与所述第二转发设备通信的接口;所述第一转发设备根据所述第一标签、所述组播的标识和所述出接口的标识,获得所述转发表项,所述转发表项包括第二标签、所述组播的标识和所述出接口的标识,所述第二标签为根据所述第一标签和偏移量获得的标签,所述偏移量的数值与VPN对应。Optionally, the first forwarding device obtains, according to the identifier of the first label and the path, a forwarding entry corresponding to the tunnel, where the first forwarding device obtains a group according to the identifier of the path. The identifier of the multicast, the identifier of the multicast is used to identify the multicast forwarding information corresponding to the path, and the first forwarding device obtains the identifier of the outbound interface according to the identifier of the path, where the outbound interface is the An interface that communicates with the second forwarding device on the first forwarding device; the first forwarding device obtains the forwarding entry according to the first label, the identifier of the multicast, and the identifier of the outbound interface, The forwarding entry includes a second label, an identifier of the multicast, and an identifier of the outbound interface, where the second label is a label obtained according to the first label and an offset, and the offset is The value corresponds to the VPN.
本申请实施例提供的方法中,在所述第一标签的数值确定的情况下,所述第二标签的数值由所述偏移量的数值来确定,而所述偏移量的数值由VPN确定,比如可建立VPN和偏移量的数值的对应关系。这样,在所述第一标签的数值确定的情况下,所述第二标签的数值与VPN对应。In the method provided by the embodiment of the present application, in the case that the value of the first tag is determined, the value of the second tag is determined by the value of the offset, and the value of the offset is determined by the VPN. Determine, for example, the correspondence between the values of the VPN and the offset can be established. Thus, in the case where the value of the first tag is determined, the value of the second tag corresponds to the VPN.
可选地,所述方法还包括:所述第一转发设备接收来自所述VPN的第一报文,并获得VPN的标识;所述第一转发设备根据所述转发表项、所述第一报文和所述VPN的标识,获得第二报文并发送至所述第二转发设备,所述第二报文为通过所述隧道发送至所述第二转发设备的组播报文。Optionally, the method further includes: the first forwarding device receives the first packet from the VPN, and obtains an identifier of the VPN; the first forwarding device according to the forwarding entry, the first The packet and the identifier of the VPN are obtained, and the second packet is sent to the second forwarding device, where the second packet is a multicast packet that is sent to the second forwarding device by using the tunnel.
可选地,所述第一转发设备可根据接收所述第一报文的接口,获得所述VPN的标识。或者,所述第一报文中可携带与所述VPN相关的信息,所述第一转发设备可根据所述第一报文中的与所述VPN相关的信息,获得所述VPN的标识。Optionally, the first forwarding device may obtain the identifier of the VPN according to the interface that receives the first packet. Alternatively, the first packet may carry information related to the VPN, and the first forwarding device may obtain the identifier of the VPN according to the information related to the VPN in the first packet.
可选地,所述第一转发设备根据所述转发表项、所述第一报文和所述VPN的标识,获得第二报文并发送至所述第二转发设备包括:所述第一转发设备根据对应关系和所述VPN的标识,获得所述VPN对应的偏移量的数值,所述对应关系包括所述VPN的标识和所述偏移量的数值;所述第一转发设备根据所述转发表项和所述偏移量的数值,获得第三标签和出接口的标识,所述第三标签为根据所述第一标签和所述偏移量的数值获得的标签,所述出接口用于与所述第二转发设备通信;所述第一转发设备根据所述出接口的标识,向所述第二转发设备发送所述第二报文,所述第二报文包括所述第一报文和所述第三标签。Optionally, the first forwarding device obtains the second packet according to the forwarding entry, the first packet, and the identifier of the VPN, and sends the second packet to the second forwarding device, where: the first The forwarding device obtains the value of the offset corresponding to the VPN according to the correspondence and the identifier of the VPN, where the correspondence includes the identifier of the VPN and the value of the offset; the first forwarding device is configured according to Transmitting the entry and the value of the offset to obtain an identifier of the third label and the outbound interface, where the third label is a label obtained according to the first label and the value of the offset, The egress interface is configured to communicate with the second forwarding device, and the first forwarding device sends the second packet to the second forwarding device according to the identifier of the egress interface, where the second packet includes The first message and the third tag are described.
本申请实施例提供的方法中,所述第三标签是根据所述偏移量的数值获得的与VPN对应的标签。在所述第一标签和所述偏移量的数值确定的情况下,所述第三标签可以与所述第二标签相同。In the method provided by the embodiment of the present application, the third label is a label corresponding to the VPN obtained according to the value of the offset. In the case where the first tag and the value of the offset are determined, the third tag may be the same as the second tag.
第二方面,提供了一种建立组播隧道的方法,所述方法包括: In a second aspect, a method for establishing a multicast tunnel is provided, where the method includes:
第二转发设备接收第一转发设备发送的请求消息,所述第二转发设备是所述第一转发设备的下游设备,所述请求消息包括标签块的信息和路径的标识,所述标签块的信息用于表示标签块的大小,所述路径的标识用于标识与虚拟专用网VPN对应的隧道;The second forwarding device receives the request message sent by the first forwarding device, where the second forwarding device is the downstream device of the first forwarding device, and the request message includes the information of the label block and the identifier of the path, where the label block The information is used to indicate the size of the label block, and the identifier of the path is used to identify a tunnel corresponding to the virtual private network VPN;
所述第二转发设备根据所述标签块的信息,获得第一标签,所述第一标签是根据所述标签块的信息确定的所述标签块的起始标签;Determining, by the second forwarding device, the first label according to the information of the label block, where the first label is a start label of the label block determined according to the information of the label block;
所述第二转发设备向所述第一转发设备发送响应消息,所述响应消息包括所述第一标签和所述路径的标识。The second forwarding device sends a response message to the first forwarding device, where the response message includes the identifier of the first label and the path.
可选地,所述方法还包括:所述第二转发设备根据所述第一标签和所述路径的标识,获得与所述隧道对应的表项,所述表项包括第二标签,所述第二标签是根据所述第一标签和偏移量获得的标签,所述偏移量的数值与VPN对应。Optionally, the method further includes: obtaining, by the second forwarding device, an entry corresponding to the tunnel according to the identifier of the first label and the path, where the entry includes a second label, The second tag is a tag obtained according to the first tag and the offset, and the value of the offset corresponds to a VPN.
可选地,所述第二转发设备根据所述第一标签和所述路径的标识,获得与所述隧道对应的表项包括:所述第二转发设备根据所述路径的标识,获得组播的标识,所述组播的标识用于标识所述路径所对应的组播转发信息;所述第二转发设备根据所述第一标签和所述组播的标识,获得所述表项,所述表项包括所述第二标签和所述组播的标识。Optionally, the second forwarding device obtains an entry corresponding to the tunnel according to the identifier of the first label and the path, where the second forwarding device obtains the multicast according to the identifier of the path. The identifier of the multicast is used to identify the multicast forwarding information corresponding to the path, and the second forwarding device obtains the entry according to the first label and the identifier of the multicast. The entry includes the second tag and the identifier of the multicast.
可选地,所述表项还包括所述标签块的信息。Optionally, the entry further includes information of the label block.
本申请实施例提供的方法中,所述第一转发设备获得的转发表项是用来指导转发的表项,所述第二转发设备获得的表项是用来定位转发表项的表项。In the method provided by the embodiment of the present application, the forwarding entry obtained by the first forwarding device is used to guide the forwarding entry, and the entry obtained by the second forwarding device is used to locate the forwarding entry.
第三方面,提供了一种第一转发设备,所述第一转发设备包括:In a third aspect, a first forwarding device is provided, where the first forwarding device includes:
第一发送单元,用于向第二转发设备发送请求消息,所述请求消息包括标签块的信息和路径的标识,所述标签块的信息用于表示标签块的大小,所述路径的标识用于标识所述第一转发设备与所述第二转发设备间与虚拟专用网VPN对应的隧道,所述第一转发设备是所述第二转发设备的上游设备;a first sending unit, configured to send a request message to the second forwarding device, where the request message includes the information of the label block and the identifier of the path, where the information of the label block is used to indicate the size of the label block, and the identifier of the path is used by And identifying, by the first forwarding device, the tunnel corresponding to the virtual private network VPN, the first forwarding device is an upstream device of the second forwarding device;
第一接收单元,用于接收所述第二转发设备发送的响应消息,所述响应消息包括第一标签和所述路径的标识,所述第一标签是根据所述标签块的信息确定的所述标签块的起始标签;a first receiving unit, configured to receive a response message sent by the second forwarding device, where the response message includes a first label and an identifier of the path, where the first label is determined according to information of the label block The starting label of the label block;
第一获得单元,用于根据所述第一标签和所述路径的标识,获得与所述隧道对应的转发表项。And a first obtaining unit, configured to obtain, according to the identifier of the first label and the path, a forwarding entry corresponding to the tunnel.
可选地,所述第一转发设备还包括:Optionally, the first forwarding device further includes:
确定单元,用于确定与所述VPN对应的隧道;a determining unit, configured to determine a tunnel corresponding to the VPN;
第二获得单元,用于根据所述与所述VPN对应的隧道,获得所述标签块的信息,所述标签块的信息由所述隧道对应的VPN的数量所确定。And a second obtaining unit, configured to obtain information about the label block according to the tunnel corresponding to the VPN, where information of the label block is determined by a number of VPNs corresponding to the tunnel.
可选地,所述第一获得单元具体用于:Optionally, the first obtaining unit is specifically configured to:
根据所述路径的标识,获得组播的标识,所述组播的标识用于标识所述路径所对应的组播转发信息;Obtaining, according to the identifier of the path, an identifier of the multicast, where the identifier of the multicast is used to identify multicast forwarding information corresponding to the path;
根据所述路径的标识,获得出接口的标识,所述出接口为所述第一转发设备上与所述第二转发设备通信的接口;Obtaining an identifier of the outbound interface according to the identifier of the path, where the outbound interface is an interface that communicates with the second forwarding device on the first forwarding device;
根据所述第一标签、所述组播的标识和所述出接口的标识,获得所述转发表项,所述转发表项包括第二标签、所述组播的标识和所述出接口的标识,所述第二标签为根据所述第一标签和偏移量获得的标签,所述偏移量的数值与VPN对应。Obtaining, according to the first label, the identifier of the multicast, and the identifier of the outbound interface, the forwarding entry, where the forwarding entry includes a second label, the identifier of the multicast, and the outbound interface And identifying, the second tag is a tag obtained according to the first tag and an offset, and the value of the offset corresponds to a VPN.
可选地,所述第一转发设备还包括: Optionally, the first forwarding device further includes:
第二接收单元,用于接收来自所述VPN的第一报文,并获得VPN的标识;a second receiving unit, configured to receive a first packet from the VPN, and obtain an identifier of the VPN;
第三获得单元,用于根据所述转发表项、所述第一报文和所述VPN的标识,获得第二报文,所述第二报文为通过所述隧道发送至所述第二转发设备的组播报文;a third obtaining unit, configured to obtain a second packet according to the forwarding entry, the first packet, and the identifier of the VPN, where the second packet is sent to the second by using the tunnel Forwarding multicast packets of the device;
第二发送单元,用于发送所述第二报文至所述第二转发设备。The second sending unit is configured to send the second packet to the second forwarding device.
可选地,所述第三获得单元具体用于:Optionally, the third obtaining unit is specifically configured to:
根据对应关系和所述VPN的标识,获得所述VPN对应的偏移量的数值,所述对应关系包括所述VPN的标识和所述偏移量的数值;And obtaining, according to the correspondence relationship and the identifier of the VPN, a value of the offset corresponding to the VPN, where the correspondence includes the identifier of the VPN and a value of the offset;
根据所述转发表项和所述偏移量的数值,获得第三标签和出接口的标识,所述第三标签为根据所述第一标签和所述偏移量的数值获得的标签,所述出接口用于与所述第二转发设备通信;Obtaining, according to the forwarding entry and the value of the offset, an identifier of the third label and the outbound interface, where the third label is a label obtained according to the first label and the value of the offset, Declaring an interface for communicating with the second forwarding device;
所述第二发送单元具体用于根据所述出接口的标识,向所述第二转发设备发送所述第二报文,所述第二报文包括所述第一报文和所述第三标签。The second sending unit is configured to send the second packet to the second forwarding device according to the identifier of the outbound interface, where the second packet includes the first packet and the third packet label.
第四方面,提供了一种第二转发设备,所述第二转发设备包括:In a fourth aspect, a second forwarding device is provided, where the second forwarding device includes:
接收单元,用于接收第一转发设备发送的请求消息,所述第二转发设备是所述第一转发设备的下游设备,所述请求消息包括标签块的信息和路径的标识,所述标签块的信息用于表示标签块的大小,所述路径的标识用于标识与虚拟专用网VPN对应的隧道;a receiving unit, configured to receive a request message sent by the first forwarding device, where the second forwarding device is a downstream device of the first forwarding device, where the request message includes information of a label block and an identifier of a path, where the label block The information is used to indicate the size of the label block, and the identifier of the path is used to identify a tunnel corresponding to the virtual private network VPN;
获得单元,用于根据所述标签块的信息,获得第一标签,所述第一标签是根据所述标签块的信息确定的所述标签块的起始标签;An obtaining unit, configured to obtain, according to the information of the label block, a first label, where the first label is a starting label of the label block determined according to information of the label block;
发送单元,用于向所述第一转发设备发送响应消息,所述响应消息包括所述第一标签和所述路径的标识。And a sending unit, configured to send a response message to the first forwarding device, where the response message includes the identifier of the first label and the path.
可选地,所述第二转发设备还包括:Optionally, the second forwarding device further includes:
第二获得单元,用于根据所述第一标签和所述路径的标识,获得与所述隧道对应的表项,所述表项包括第二标签,所述第二标签为根据所述第一标签和偏移量获得的标签,所述偏移量的数值与VPN对应。a second obtaining unit, configured to obtain, according to the identifier of the first label and the path, an entry corresponding to the tunnel, where the entry includes a second label, and the second label is according to the first The label obtained from the tag and the offset, the value of the offset corresponding to the VPN.
可选地,所述第二获得单元具体用于:Optionally, the second obtaining unit is specifically configured to:
根据所述路径的标识,获得组播的标识,所述组播的标识用于标识所述路径所对应的组播转发信息;Obtaining, according to the identifier of the path, an identifier of the multicast, where the identifier of the multicast is used to identify multicast forwarding information corresponding to the path;
根据所述第一标签和所述组播的标识,获得所述表项,所述表项包括所述第一标签和所述组播的标识。Obtaining the entry according to the first label and the identifier of the multicast, where the entry includes the first label and the identifier of the multicast.
可选地,所述表项还包括所述标签块的信息。Optionally, the entry further includes information of the label block.
可选地,第四方面提供的第二转发设备也可采用第一方面或第一方面任一可能的实现方式提供的方法,获得转发表项,即所述第二转发设备可向另一转发设备,请求与标签块的信息匹配的标签。换句话说,所述第二转发设备可以与第三方面提供的第一转发设备是同一设备,也可与第三方面提供的第一转发设备是不同的设备。Optionally, the second forwarding device provided by the fourth aspect may also adopt the method provided by the first aspect or any possible implementation manner of the first aspect, to obtain a forwarding entry, that is, the second forwarding device may forward to another A device that requests a tag that matches the information of the tag block. In other words, the second forwarding device may be the same device as the first forwarding device provided by the third aspect, or may be different from the first forwarding device provided by the third aspect.
第五方面,提供了一种第一转发设备,所述第一转发设备包括:处理器、存储器、通信接口和通信总线,所述处理器、所述存储器和所述通信接口通过所述通讯总线连接,所述存储器用于存储程序;所述处理器从所述存储器中读取所述程序包括的可执行指令,执行上述第一方面或第一方面的任意一种实现方式提供的方法。In a fifth aspect, a first forwarding device is provided, the first forwarding device comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface pass through the communication bus Connected, the memory is for storing a program; the processor reads the executable instructions included in the program from the memory, and performs the method provided by the first aspect or any one of the implementation manners of the first aspect.
第六方面,提供了一种第二转发设备,所述第二转发设备包括:处理器、存储器、通信接口和通信总线,所述处理器、所述存储器和所述通信接口通过所述通信总线连接,所 述存储器用于存储程序;所述处理器从所述存储器中读取所述程序包括的可执行指令,执行上述第二方面或第二方面的任意一种实现方式提供的方法。In a sixth aspect, a second forwarding device is provided, the second forwarding device comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface pass through the communication bus Connection The memory is used to store a program; the processor reads the executable instructions included in the program from the memory, and performs the method provided by any one of the second aspect or the second aspect.
附图说明DRAWINGS
图1为一种网络场景示意图。FIG. 1 is a schematic diagram of a network scenario.
图2(a)为本申请实施例提供的一种网络场景示意图。FIG. 2(a) is a schematic diagram of a network scenario according to an embodiment of the present application.
图2(b)为本申请实施例提供的建立组播隧道的方法流程图。FIG. 2(b) is a flowchart of a method for establishing a multicast tunnel according to an embodiment of the present application.
图3(a)为本申请实施例提供的另一种网络场景示意图。FIG. 3(a) is a schematic diagram of another network scenario provided by an embodiment of the present application.
图3(b)为本申请实施例提供的建立组播隧道的方法流程图。FIG. 3(b) is a flowchart of a method for establishing a multicast tunnel according to an embodiment of the present application.
图4为本申请实施例提供的第一转发设备的结构示意图。FIG. 4 is a schematic structural diagram of a first forwarding device according to an embodiment of the present disclosure.
图5为本申请实施例提供的第二转发设备的结构示意图。FIG. 5 is a schematic structural diagram of a second forwarding device according to an embodiment of the present disclosure.
图6为本申请实施例提供的第一转发设备的结构示意图。FIG. 6 is a schematic structural diagram of a first forwarding device according to an embodiment of the present disclosure.
图7为本申请实施例提供的第二转发设备的结构示意图。FIG. 7 is a schematic structural diagram of a second forwarding device according to an embodiment of the present disclosure.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述。The technical solutions in the embodiments of the present application will be clearly described below with reference to the accompanying drawings in the embodiments of the present application.
如图1所示的网络中,站点(site)1、site3和site5属于虚拟专用网(virtual private network,VPN)1,site2、site4和site6属于VPN2。site1和site2与PE1通信。PE1可通过P,与PE2和PE3进行通信。PE2与site3和site4通信。PE4与site5和site6通信。PE1、PE2和PE3之间可形成一点到多点(point-to-multipoint,P2MP)的转发路径。VPN1和VPN2可共享PE1、PE2和PE3之间的P2MP的转发路径。In the network shown in Figure 1, site 1, site3, and site5 belong to a virtual private network (VPN) 1, and site2, site4, and site6 belong to VPN 2. Site1 and site2 communicate with PE1. PE1 can communicate with PE2 and PE3 through P. PE2 communicates with site3 and site4. PE4 communicates with site5 and site6. A point-to-multipoint (P2MP) forwarding path can be formed between PE1, PE2, and PE3. VPN1 and VPN2 can share the forwarding path of P2MP between PE1, PE2, and PE3.
PE1、P、PE2和PE3上分别配置有两个相互关联的标签配置表。所述两个相互关联的标签配置表中的一个标签配置表包括隧道标签和VPN标签的对应关系,另一个标签配置表包括VPN标签和出接口的对应关系。PE1可根据预先配置的P2MP的转发路径,向P发送P2MP标签,该P2MP标签是与所述P2MP的转发路径对应的隧道标签。P可根据预先配置的P2MP的转发路径,向PE2和PE3转发来自PE1的P2MP标签。Two mutually associated label configuration tables are configured on PE1, P, PE2, and PE3. One of the two associated label configuration tables includes a mapping between a tunnel label and a VPN label, and another label configuration table includes a correspondence between the VPN label and the outbound interface. The PE1 may send a P2MP label to the P according to the pre-configured P2MP forwarding path, where the P2MP label is a tunnel label corresponding to the forwarding path of the P2MP. P can forward the P2MP label from PE1 to PE2 and PE3 according to the pre-configured P2MP forwarding path.
PE1接收到来自VPN1的site1的第一报文后,确定P2MP标签。PE1根据P2MP和配置的两个相互关联的标签配置表,获得VPN1标签和PE1上的出接口。PE1在所述第一报文上进行隧道封装,获得第二报文。所述第二报文包括所述第一报文、P2MP标签和VPN1标签。PE1通过PE1上的出接口,向P发送所述第二报文。P接收到所述第二报文后,根据配置的两个相互关联的标签配置表和所述第二报文中包括的P2MP标签,获得VPNn标签和P上的出接口。P根据VPNn标签和所述第二报文,获得第三报文。所述第三报文包括所述VPNn标签、所述P2MP标签和所述第一报文。P获得的P上的出接口的数量为N,则P对所述第三报文进行复制,获得N个第三报文。P通过N个出接口,发送所述N个所述第三报文,所述每个P上的出接口可用于发送一个所述第三报文。PE2接收到所述第三报文后,根据所述P2MP标签和所述VPNn标签,确定与VPN1的site3通信的出接口。PE2可通过所述出接口,向site4发送所述第三报文包括的所述第一报文。PE3向VPN1的site5发送所述第一报文的方法与PE2向VPN1的site3发送所述第一报文的方法相同,在此不再赘述。After receiving the first packet from site1 of VPN1, PE1 determines the P2MP label. Based on the P2MP and the two interrelated label configuration tables, the PE1 obtains the VPN1 label and the outbound interface on PE1. The PE1 tunnels the first packet to obtain a second packet. The second packet includes the first packet, a P2MP label, and a VPN1 label. PE1 sends the second packet to P through the outbound interface on PE1. After receiving the second packet, the P obtains the outbound interface on the VPNn label and the P according to the configured two associated label configuration tables and the P2MP labels included in the second packet. P obtains a third packet according to the VPNn label and the second packet. The third packet includes the VPNn label, the P2MP label, and the first packet. The number of outbound interfaces on the P obtained by P is N, and P copies the third packet to obtain N third packets. The P sends the Nth third packet through the N outgoing interfaces, and the outbound interface on each P is used to send the third packet. After receiving the third packet, the PE2 determines an outbound interface for communicating with the site3 of the VPN1 according to the P2MP label and the VPNn label. The PE2 can send the first packet included in the third packet to the site 4 through the outbound interface. The method for the first packet to be sent by the PE3 to the site 5 of the VPN1 is the same as the method for the PE2 to send the first packet to the site 3 of the VPN1, and details are not described herein.
上述标签分配方法中,网络中的P2MP的转发路径上的设备均需要保存两个相互关 联的标签配置表,在进行报文转发过程中采用线性查找时生成的转发表项的数量增加了转发设备的负担,查找与报文中的标签匹配的转发表项的操作较为繁重,转发面上的代价较大。In the above label allocation method, devices on the forwarding path of the P2MP in the network need to save two mutual relations. The number of forwarding entries generated by the linear lookup process in the packet forwarding table increases the burden on the forwarding device. The operation of finding the forwarding entry matching the label in the packet is heavy. The cost is greater.
针对上述问题,提出了一种建立组播隧道的方法。该方法中,第一转发设备向第二转发设备发送请求消息,所述请求消息包括标签块的信息和路径的标识,所述标签块的信息用于表示标签块的大小,所述路径的标识用于标识所述第一转发设备与所述第二转发设备间与虚拟专用网VPN对应的隧道,所述第一转发设备是所述第二转发设备的上游设备;所述第一转发设备接收所述第二转发设备发送的响应消息,所述响应消息包括第一标签和所述路径的标识,所述第一标签是根据所述标签块的信息确定的所述标签块的起始标签;所述第一转发设备根据所述第一标签和所述路径的标识,获得与所述隧道对应的转发表项。本申请实施例提供的方法无需在每个转发设备上存储N+1个标签空间,并且能够在不增加转发面上的代价的前提下,实现线性查找。该方法可通过以下几种实施例实现。Aiming at the above problems, a method for establishing a multicast tunnel is proposed. In the method, the first forwarding device sends a request message to the second forwarding device, where the request message includes the information of the label block and the identifier of the path, where the information of the label block is used to indicate the size of the label block, and the identifier of the path a tunnel corresponding to the virtual private network VPN between the first forwarding device and the second forwarding device, where the first forwarding device is an upstream device of the second forwarding device; and the first forwarding device receives a response message sent by the second forwarding device, where the response message includes a first label and an identifier of the path, where the first label is a start label of the label block determined according to information of the label block; The first forwarding device obtains a forwarding entry corresponding to the tunnel according to the identifier of the first label and the path. The method provided by the embodiment of the present application does not need to store N+1 label spaces on each forwarding device, and can implement linear search without increasing the cost on the forwarding plane. This method can be implemented by the following embodiments.
实施例一 Embodiment 1
图2(a)为本申请实施例提供的一种网络场景示意图。图2(a)所示的网络中,PE1通过P,与PE2和PE3建立P2MP隧道。site1、site3和site5属于VPN1,site2、site4和site6属于VPN2。site1和site2与PE1通信。PE2与site3和site4通信。PE3与site5和site6通信。VPN1和VPN2可共享PE1、PE2和PE3之间的P2MP隧道。FIG. 2(a) is a schematic diagram of a network scenario according to an embodiment of the present application. In the network shown in Figure 2(a), PE1 establishes a P2MP tunnel with PE2 and PE3 through P. Site1, site3, and site5 belong to VPN1, and site2, site4, and site6 belong to VPN2. Site1 and site2 communicate with PE1. PE2 communicates with site3 and site4. PE3 communicates with site5 and site6. VPN1 and VPN2 can share P2MP tunnels between PE1, PE2, and PE3.
图2(b)为本申请实施例提供的建立组播隧道的方法流程图。下面结合图2(a)和图2(b),对本申请实施例提供的建立组播隧道的方法进行说明。FIG. 2(b) is a flowchart of a method for establishing a multicast tunnel according to an embodiment of the present application. The method for establishing a multicast tunnel provided by the embodiment of the present application is described below with reference to FIG. 2(a) and FIG. 2(b).
201,PE1向P发送第一请求消息。201. The PE1 sends a first request message to the P.
其中,所述第一请求消息包括标签块的信息和路径的标识。所述标签块的信息用于表示标签块的大小。所述路径的标识用于标识P2MP隧道。所述P2MP隧道是PE1、PE2和PE3之间的隧道。所述P2MP隧道是VPN1和VPN2所共享的隧道。PE1是P的上游设备,P是PE1的下游设备。The first request message includes information of a label block and an identifier of a path. The information of the tag block is used to indicate the size of the tag block. The identifier of the path is used to identify a P2MP tunnel. The P2MP tunnel is a tunnel between PE1, PE2, and PE3. The P2MP tunnel is a tunnel shared by VPN1 and VPN2. PE1 is the upstream device of P and P is the downstream device of PE1.
举例说明,PE1可根据与其通信的site所属的VPN的数量获得所述标签块的信息。如图2(a)所示,site1和site2分别属于VPN1和VPN2。PE1可根据VPN1和VPN2,获得标签块的大小为2。PE1还可根据VPN1和VPN2,获得所述路径的标识,即VPN1和VPN2共享所述路径的标识对应的P2MP隧道。For example, PE1 may obtain information about the label block according to the number of VPNs to which the site with which it communicates. As shown in Figure 2(a), site1 and site2 belong to VPN1 and VPN2, respectively. According to VPN1 and VPN2, PE1 obtains a tag block size of 2. The PE1 can also obtain the identifier of the path according to the VPN1 and the VPN2, that is, the VPN2 and the VPN2 share the P2MP tunnel corresponding to the identifier of the path.
举例说明,PE1可根据所述标签块的信息和所述路径的标识,获得所述第一请求消息。所述第一请求消息用于向P请求分配与所述P2MP隧道对应的标签。所述第一请求消息可以是扩展后的路径消息(path message)。所述扩展后的path message可是对RFC3209中的path message包括的标签请求(label_request)中的会话属性(session_attribute)字段进行扩展,所述session_attribute字段携带所述标签块的信息。For example, the PE1 may obtain the first request message according to the information of the label block and the identifier of the path. The first request message is used to allocate a label corresponding to the P2MP tunnel to the P request. The first request message may be an extended path message. The extended path message may be extended to a session attribute (session_attribute) field in a label request (label_request) included in the path message in the RFC 3209, where the session_attribute field carries information of the label block.
举例说明,PE1可根据约束最短路径优先(Constraint Shortest Path First,CSPF)或流量工程数据库(traffic engineering database,TEDB),获得PE1上与P通信的出接口,即第一出接口的标识。PE1可通过所述第一出接口,向P发送所述第一请求消息。For example, the PE1 can obtain the outgoing interface of the communication with the P1 on the PE1 according to the Constraint Shortest Path First (CSPF) or the traffic engineering database (TEDB), that is, the identifier of the first outgoing interface. The PE1 may send the first request message to the P through the first outbound interface.
202,P分配第一标签。202, P assigns the first label.
举例说明,所述第一标签是P根据所述标签块的信息确定的所述标签块的起始标签。P可从其配置的全局(global)标签空间中选择与所述标签块的信息对应的标签块,并获得所述标签块的起始标签,如图2(a)中的LB1,LB1是P上与所述标签块的信息对应的标 签块的起始标签。For example, the first tag is a start tag of the tag block determined by the P according to the information of the tag block. P may select a label block corresponding to the information of the label block from its configured global label space, and obtain a start label of the label block, such as LB1 in FIG. 2(a), and LB1 is P. a label corresponding to the information of the label block The starting tag of the block.
203,P向PE1发送第一响应消息。203. P sends a first response message to PE1.
举例说明,P可根据所述第一标签和所述路径的标识,获得第一响应消息。所述第一响应消息包括所述第一标签和所述路径的标识。所述第一响应消息可以是资源预留协议消息(RSVP message),所述RSVP message中可携带所述第一标签和所述路径的标识。For example, P may obtain a first response message according to the identifier of the first label and the path. The first response message includes the first tag and an identifier of the path. The first response message may be a resource reservation protocol message (RSVP message), and the RSVP message may carry the identifier of the first label and the path.
204,P获得第一表项。204, P obtains the first entry.
其中,P可根据所述第一标签和所述路径的标识,获得第一表项。P可根据所述第一表项获得用来指导转发的一个或多个转发表项。The P may obtain the first entry according to the identifier of the first label and the path. P may obtain one or more forwarding entries used to guide forwarding according to the first entry.
举例说明,P根据所述第一标签和所述路径的标识,获得所述第一表项包括:P根据所述路径的标识,获得组播的标识,所述组播的标识用于标识所述路径所对应的组播转发信息;P根据所述第一标签,获得第二标签,所述第二标签为根据所述第一标签和和偏移量获得的标签,所述偏移量的数值与VPN对应;P根据所述第二标签和所述组播的标识,获得所述第一表项,所述第一表项包括所述第二标签和所述组播的标识。其中,P根据所述路径的标识获得组播的标识属于可选地内容,相应的,所述第一表项中的所述组播的标识被所述路径的标识替换。For example, the P obtains the first entry according to the identifier of the first label and the path, and the P obtains a multicast identifier according to the identifier of the path, where the identifier of the multicast is used to identify the identifier. a multicast forwarding information corresponding to the path; P obtaining, according to the first label, a second label, where the second label is a label obtained according to the first label and an offset, the offset The value corresponds to the VPN; the P obtains the first entry according to the second label and the identifier of the multicast, where the first entry includes the second label and the identifier of the multicast. The identifier of the multicast that is obtained by the P according to the identifier of the path belongs to the optional content. Correspondingly, the identifier of the multicast in the first entry is replaced by the identifier of the path.
可选地,P可在控制面生成第二表项,再根据所述第二表项在转发面生成所述第一表项。Optionally, P may generate a second entry on the control plane, and then generate the first entry in the forwarding plane according to the second entry.
举例说明,P可根据所述第一标签和所述路径的标识,在控制面生成第二表项,所述第二表项包括所述第一标签和所述路径的标识。可选地,所述第二表项还包括所述标签块的信息,如图2(a)中的blocksize。所述第二表项可表示为:For example, P may generate a second entry on the control plane according to the identifier of the first label and the path, where the second entry includes the identifier of the first label and the path. Optionally, the second entry further includes information about the label block, such as blocksize in FIG. 2(a). The second entry can be expressed as:
(InLabelBase<assigned by P>,Session)(InLabelBase<assigned by P>, Session)
其中,InLabelBase<assigned by P>表示P分配的所述第一标签,即图2(a)中的LB1。Session表示所述路径的标识。上述仅是所述第二表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。Wherein, InLabelBase<assigned by P> represents the first label allocated by P, that is, LB1 in FIG. 2(a). Session indicates the identity of the path. The foregoing is only one representation of the second item, and the specific embodiment of the present application is not limited.
举例说明,P可根据所述第二表项,在转发面生成第一表项。所述第一表项可表示为:For example, P may generate a first entry on the forwarding plane according to the second entry. The first entry can be expressed as:
(InLabelBase<assigned by P>+offset,MID)(InLabelBase<assigned by P>+offset, MID)
其中,InLabelBase<assigned by P>表示P分配的所述第一标签,即图2(a)中的LB1。offset表示偏移量。InLabelBase<assigned by P>+offset表示所述第二标签。MID表示所述组播的标识,MID与Session对应。上述仅是所述第一表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。Wherein, InLabelBase<assigned by P> represents the first label allocated by P, that is, LB1 in FIG. 2(a). Offset represents the offset. InLabelBase<assigned by P>+offset represents the second tag. The MID indicates the identifier of the multicast, and the MID corresponds to the Session. The above is only one manifestation of the first entry, and the specific embodiment of the present application is not limited.
205,PE1根据所述第一响应消息,获得第一转发表项。205. The PE1 obtains the first forwarding entry according to the first response message.
举例说明,PE1根据所述第一响应消息,获得所述第一转发表项包括:PE1根据所述路径的标识,获得组播的标识,所述组播的标识用于标识所述路径所对应的组播转发信息;PE1根据所述路径的标识,获得第一出接口的标识,所述第一出接口为PE1上与P通信的接口;PE1根据所述第一标签、所述组播的标识和所述第一出接口的标识,获得所述第一转发表项,所述第一转发表项包括所述第二标签、所述组播的标识和所述第一出接口的标识。其中,PE1根据所述路径的标识获得组播的标识属于可选地内容,相应的,所述第一转发表项中的所述组播的标识被所述路径的标识替换。For example, the PE1 obtains the first forwarding entry according to the first response message, and the PE1 obtains a multicast identifier according to the identifier of the path, where the identifier of the multicast is used to identify the path corresponding to the path. The multicast forwarding information is obtained by the PE1 according to the identifier of the path, and the first outbound interface is an interface that communicates with the P1 on the PE1; the PE1 is based on the first label and the multicast And identifying, by the identifier of the first outbound interface, the first forwarding entry, where the first forwarding entry includes the second label, the identifier of the multicast, and an identifier of the first outbound interface. The identifier of the multicast that is obtained by the PE1 according to the identifier of the path belongs to the optional content. Correspondingly, the identifier of the multicast in the first forwarding entry is replaced by the identifier of the path.
可选地,PE1可在控制面生成第二转发表项,再根据所述第二转发表项在转发面生成所述第一转发表项。 Optionally, the PE1 may generate a second forwarding entry on the control plane, and then generate the first forwarding entry on the forwarding plane according to the second forwarding entry.
举例说明,PE1可根据所述第一响应消息包括的所述第一标签和所述路径的标识,在控制面生成第二转发表项,所述第二转发表项包括所述第一标签、所述第一出接口的标识和所述路径的标识。PE1可通过201获得所述第一出接口的标识。所述第二转发表项可表示为:For example, the PE1 may generate a second forwarding entry on the control plane according to the first label and the identifier of the path included in the first response message, where the second forwarding entry includes the first label, The identifier of the first outgoing interface and the identifier of the path. PE1 can obtain the identifier of the first outgoing interface by using 201. The second forwarding entry may be expressed as:
(Session,OutLabelBase<assigned by P>,OutInterface<to P>)(Session, OutLabelBase<assigned by P>, OutInterface<to P>)
其中,Session表示所述路径的标识。OutLabelBase<assigned by P>表示P分配的所述第一标签,即图2(a)中的LB1。OutInterface<to P>表示所述第一出接口的标识。上述仅是所述第二转发表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。Wherein, the Session represents the identifier of the path. OutLabelBase<assigned by P> indicates the first label assigned by P, that is, LB1 in FIG. 2(a). OutInterface<to P> indicates the identifier of the first outgoing interface. The foregoing is only one representation of the second forwarding entry, and the specific embodiment of the present application is not limited.
举例说明,PE1可根据所述第二转发表项,在转发面生成第一转发表项。所述第一转发表项可表示为:For example, PE1 may generate a first forwarding entry on the forwarding plane according to the second forwarding entry. The first forwarding entry may be expressed as:
(MID,OutLabelBase<assigned by P>+offset,OutInterface<to P>)(MID, OutLabelBase<assigned by P>+offset,OutInterface<to P>)
其中,MID表示所述组播的标识,MID与Session对应。OutLabelBase<assigned by P>表示P分配的所述第一标签,即图2(a)中的LB1。offset表示偏移量。OutLabelBase<assigned by P>+offset表示所述第二标签。OutInterface<to P>表示所述第一出接口的标识。上述仅是所述第一转发表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。The MID indicates the identifier of the multicast, and the MID corresponds to the Session. OutLabelBase<assigned by P> indicates the first label assigned by P, that is, LB1 in FIG. 2(a). Offset represents the offset. OutLabelBase<assigned by P>+offset represents the second tag. OutInterface<to P> indicates the identifier of the first outgoing interface. The foregoing is only one representation of the first forwarding entry, and the specific embodiment of the present application is not limited.
206,P向PE2发送第二请求消息。206: P sends a second request message to PE2.
举例说明,所述第二请求消息包括所述标签块的信息和所述路径的标识。所述第二请求消息包括的标签块的信息与所述第一请求消息包括的标签块的信息相同,如图2(a)中的blocksize。所述第二请求消息包括的路径的标识与所述第一请求消息包括的路径的标识相同。For example, the second request message includes information of the tag block and an identifier of the path. The information of the label block included in the second request message is the same as the information of the label block included in the first request message, such as blocksize in FIG. 2(a). The identifier of the path included in the second request message is the same as the identifier of the path included in the first request message.
举例说明,P可根据所述标签块的信息和所述路径的标识,获得所述第二请求消息。所述第二请求消息用于向PE2请求分配与所述P2MP隧道对应的标签。所述第二请求消息可以是扩展后的path message。所述扩展后的path message可是对RFC3209中的path message包括的label_request中的session_attribute字段进行扩展,所述session_attribute字段携带所述标签块的信息。For example, P may obtain the second request message according to the information of the label block and the identifier of the path. The second request message is used to request the PE2 to allocate a label corresponding to the P2MP tunnel. The second request message may be an extended path message. The extended path message may be extended to a session_attribute field in a label_request included in the path message in the RFC 3209, where the session_attribute field carries information of the label block.
举例说明,P可根据CSPF或TEDB,获得P上能够与PE2通信的出接口,即第二出接口的标识。P可通过所述第二出接口,向PE2发送所述第二请求消息。For example, P can obtain an outbound interface on P that can communicate with PE2 according to CSPF or TEDB, that is, an identifier of the second outgoing interface. The P may send the second request message to the PE2 by using the second outbound interface.
207,PE2分配第三标签。207, PE2 allocates a third label.
举例说明,所述第三标签是PE2根据所述标签块的信息确定的所述标签块的起始标签。PE2可从其配置的global标签空间中选择与所述标签块的信息对应的标签块,并获得所述标签块的起始标签,如图2(a)中的LB2,LB2是PE2上与所述标签块的信息对应的标签块的起始标签。其中,PE2上配置的global标签空间与P上配置的global标签空间不相同。For example, the third label is a starting label of the label block determined by the PE2 according to the information of the label block. The PE2 can select a label block corresponding to the information of the label block from the configured global label space, and obtain a start label of the label block, as shown in FIG. 2(a), LB2, and LB2 is a PE2 and a label. The start tag of the tag block corresponding to the information of the tag block. The global label space configured on PE2 is different from the global label space configured on P2.
208,PE2向P发送第二响应消息。208. The PE2 sends a second response message to the P.
举例说明,PE2可根据所述第三标签和所述路径的标识,获得第二响应消息。所述第二响应消息包括所述第三标签和所述路径的标识。所述第二响应消息可以是RSVP message,所述RSVP message还用于携带所述第三标签和所述路径的标识。For example, PE2 may obtain a second response message according to the identifier of the third label and the path. The second response message includes the third tag and an identifier of the path. The second response message may be an RSVP message, and the RSVP message is further configured to carry the identifier of the third label and the path.
209,PE2获得第三表项。209, PE2 obtains the third entry.
其中,PE2可根据所述第三标签和所述路径的标识,获得所述第三表项。所述第三表项包括第四标签和所述组播的标识。所述第四标签是根据所述第三标签和所述偏移量获得的标签,所述偏移量与VPN对应。 The PE2 may obtain the third entry according to the identifier of the third label and the path. The third entry includes a fourth tag and the identifier of the multicast. The fourth tag is a tag obtained according to the third tag and the offset, and the offset corresponds to a VPN.
举例说明,PE2根据所述第三标签和所述路径的标识,获得所述第三表项包括:PE2根据所述路径的标识,获得组播的标识,所述组播的标识用于标识所述路径所对应的组播转发信息;PE2根据所述第三标签和所述偏移量,获得所述第四标签;PE2根据所述第四标签和所述组播的标识,获得所述第三表项,所述第三表项包括所述第四标签和所述组播的标识。其中,PE2根据所述路径的标识获得组播的标识属于可选地内容,相应的,所述第三表项中的所述组播的标识被所述路径的标识替换。For example, the PE2 obtains the third entry according to the identifier of the third label and the path, and the PE2 obtains the identifier of the multicast according to the identifier of the path, where the identifier of the multicast is used to identify the identifier. The multicast forwarding information corresponding to the path; the PE2 obtains the fourth label according to the third label and the offset; and the PE2 obtains the first label according to the fourth label and the identifier of the multicast The third entry includes the fourth tag and the identifier of the multicast. The identifier of the multicast that is obtained by the PE2 according to the identifier of the path belongs to the optional content. Correspondingly, the identifier of the multicast in the third entry is replaced by the identifier of the path.
可选地,PE2可在控制面生成第四表项,再根据所述第四表项在转发面生成所述第三表项。Optionally, PE2 may generate a fourth entry in the control plane, and generate the third entry in the forwarding plane according to the fourth entry.
举例说明,PE2可根据所述第三标签和所述路径的标识,在控制面生成第四表项,所述第四表项包括所述第三标签和所述路径的标识。所述第四表项可表示为:For example, the PE2 may generate a fourth entry on the control plane according to the identifier of the third label and the path, where the fourth entry includes the identifier of the third label and the path. The fourth entry can be expressed as:
(InLabelBase<assigned by PE2>,Session)(InLabelBase<assigned by PE2>, Session)
其中,InLabelBase<assigned by PE2>表示PE2分配的所述第三标签,即图2(a)中的LB2。Session表示所述路径的标识。上述仅是所述第四表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。The InLabelBase<assigned by PE2> indicates the third label allocated by the PE2, that is, LB2 in FIG. 2(a). Session indicates the identity of the path. The foregoing is only one representation of the fourth item, and the specific embodiment of the present application is not limited.
举例说明,PE2可根据所述第四表项,在转发面生成第三表项。所述第三表项可表示为:For example, PE2 may generate a third entry on the forwarding plane according to the fourth entry. The third entry can be expressed as:
(InLabelBase<assigned by PE2>+offset,MID)(InLabelBase<assigned by PE2>+offset, MID)
其中,InLabelBase<assigned by PE2>表示PE2分配的所述第三标签,即图2(a)中的LB2。offset表示偏移量。InLabelBase<assigned by PE2>+offset表示所述第四标签。MID表示所述组播的标识,MID与Session对应。上述仅是所述第三表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。The InLabelBase<assigned by PE2> indicates the third label allocated by the PE2, that is, LB2 in FIG. 2(a). Offset represents the offset. InLabelBase<assigned by PE2>+offset represents the fourth tag. The MID indicates the identifier of the multicast, and the MID corresponds to the Session. The foregoing is only one representation of the third item, and the specific embodiment of the present application is not limited.
210,P根据所述第二响应消息,获得第三转发表项。210. The P obtains a third forwarding entry according to the second response message.
举例说明,P根据所述第二响应消息,获得第三转发表项包括:P根据所述路径的标识,获得所述组播的标识;P根据所述路径的标识,获得第二出接口的标识;P根据所述第三标签、所述组播的标识和所述第二出接口的标识,获得所述第三转发表项,所述第三转发表项包括第四标签、所述组播的标识和所述第二出接口的标识。其中,P根据所述路径的标识获得组播的标识属于可选地内容,相应的,所述第三转发表项中的所述组播的标识被所述路径的标识替换。For example, the P obtains the third forwarding entry according to the second response message, and the P obtains the identifier of the multicast according to the identifier of the path, and obtains the second outgoing interface according to the identifier of the path. The third forwarding entry is obtained according to the third label, the identifier of the multicast, and the identifier of the second outbound interface, where the third forwarding entry includes a fourth label, the group The identifier of the broadcast and the identifier of the second outgoing interface. The identifier of the multicast that is obtained by the P according to the identifier of the path belongs to the optional content. Correspondingly, the identifier of the multicast in the third forwarding entry is replaced by the identifier of the path.
可选地,P可在控制面生成第四转发表项,再根据所述第四转发表项在转发面生成所述第三转发表项。Optionally, the P may generate a fourth forwarding entry on the control plane, and generate the third forwarding entry on the forwarding plane according to the fourth forwarding entry.
举例说明,P可根据所述第二响应消息包括的所述第三标签和所述路径的标识,在控制面生成第四转发表项,所述第四转发表项包括所述第三标签、所述第二出接口的标识和所述路径的标识。其中,P可通过206获得所述第二出接口的标识。所述第四转发表项可表示为:For example, the P may generate a fourth forwarding entry on the control plane according to the third label included in the second response message and the identifier of the path, where the fourth forwarding entry includes the third label, The identifier of the second outgoing interface and the identifier of the path. The P may obtain the identifier of the second outbound interface by 206. The fourth forwarding entry may be expressed as:
(Session,OutLabelBase<assigned by PE2>,OutInterface<to PE2>)(Session, OutLabelBase<assigned by PE2>, OutInterface<to PE2>)
其中,Session表示所述路径的标识。OutLabelBase<assigned by PE2>表示PE2分配的所述第三标签,即图2(a)中的LB2。OutInterface<to PE2>表示所述第二出接口的标识。上述仅是所述第四转发表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。Wherein, the Session represents the identifier of the path. OutLabelBase<assigned by PE2> indicates the third label allocated by PE2, that is, LB2 in FIG. 2(a). OutInterface<to PE2> indicates the identifier of the second outgoing interface. The foregoing is only one representation of the fourth forwarding entry, and the specific embodiment of the present application is not limited.
举例说明,P可根据所述第四转发表项,在转发面生成第三转发表项。所述第三转发 表项可表示为:For example, P may generate a third forwarding entry on the forwarding plane according to the fourth forwarding entry. The third forwarding The entry can be expressed as:
(MID,OutLabelBase<assigned by PE2>+offset,OutInterface<to PE2>)(MID, OutLabelBase<assigned by PE2>+offset, OutInterface<to PE2>)
其中,MID表示所述组播的标识,MID与Session对应。OutLabelBase<assigned by PE2>表示PE2分配的所述第三标签,即图2(a)中的LB2。offset表示偏移量。OutLabelBase<assigned by PE2>+offset表示所述第四标签。OutInterface<to PE2>表示所述第二出接口的标识。上述仅是所述第三转发表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。The MID indicates the identifier of the multicast, and the MID corresponds to the Session. OutLabelBase<assigned by PE2> indicates the third label allocated by PE2, that is, LB2 in FIG. 2(a). Offset represents the offset. OutLabelBase<assigned by PE2>+offset represents the fourth tag. OutInterface<to PE2> indicates the identifier of the second outgoing interface. The foregoing is only one representation of the third forwarding entry, and the specific embodiment of the present application is not limited.
211,P向PE3发送第三请求消息。211. P sends a third request message to PE3.
举例说明,P获得所述第三请求消息的方法与206中P获得所述第二请求消息的方法相同。所述第三请求消息包括所述标签块的信息和所述路径的标识。所述第三请求消息用于向PE3请求分配与所述P2MP隧道对应的标签。For example, the method of obtaining the third request message by P is the same as the method of obtaining the second request message by P in 206. The third request message includes information of the tag block and an identifier of the path. The third request message is used to request the PE3 to allocate a label corresponding to the P2MP tunnel.
举例说明,P可根据CSPF或TEDB,获得P上与PE3通信的出接口,即第三接口的标识。P可通过所述第三接口,向PE3发送所述第三请求消息。For example, P can obtain the outbound interface of communication with PE3 on P, that is, the identifier of the third interface, according to CSPF or TEDB. P may send the third request message to PE3 through the third interface.
212,PE3分配第五标签。212, PE3 assigns a fifth label.
举例说明,所述PE3分配所述第五标签的方法与207相同,在此不再赘述。所述第五标签可以为图2(a)中的LB3。其中,PE3上配置的global标签空间与P上配置的global标签空间不相同,PE3上配置的global标签空间与PE2上配置的global标签空间不相同。For example, the method for allocating the fifth label by the PE3 is the same as that of the 207, and details are not described herein again. The fifth tag may be LB3 in FIG. 2(a). The global label space configured on PE3 is different from the global label space configured on PE. The global label space configured on PE3 is different from the global label space configured on PE2.
213,PE3向P发送第三响应消息。213. The PE3 sends a third response message to the P.
举例说明,PE3获得所述第三响应消息的方法与208中PE2获得所述第二响应消息的方法相同,在此不再赘述。所述第三响应消息包括所述第五标签和所述路径的标识。For example, the method for the PE3 to obtain the third response message is the same as the method for the PE2 to obtain the second response message in 208, and details are not described herein again. The third response message includes the fifth tag and an identifier of the path.
214,PE3获得第五表项。214, PE3 obtains the fifth entry.
举例说明,所述第五表项包括第六标签和所述组播的标识。所述第六标签是根据所述第五标签和所述偏移量获得的标签。PE3获得所述第五表项的方法与209中PE2获得所述第三表项的方法相同。可选地,所述第五表项中的所述组播的标识可被所述路径的标识替换。For example, the fifth entry includes a sixth label and an identifier of the multicast. The sixth tag is a tag obtained according to the fifth tag and the offset. The method of obtaining the fifth entry by PE3 is the same as the method of obtaining the third entry by PE2 in 209. Optionally, the identifier of the multicast in the fifth entry may be replaced by an identifier of the path.
可选地,PE3可在控制面生成第六表项,再根据所述第六表项在转发面生成所述第五表项。Optionally, the PE3 may generate a sixth entry in the control plane, and generate the fifth entry in the forwarding plane according to the sixth entry.
举例说明,PE3可根据所述第五标签和所述路径的标识,在控制面生成第六表项,所述第六表项包括所述第五标签和所述路径的标识。所述第六表项可表示为:For example, the PE3 may generate a sixth entry on the control plane according to the fifth label and the identifier of the path, where the sixth entry includes the fifth label and the identifier of the path. The sixth entry can be expressed as:
(InLabelBase<assigned by PE3>,Session)(InLabelBase<assigned by PE3>, Session)
其中,InLabelBase<assigned by PE3>表示PE3分配的所述第五标签,即图2(a)中的LB3。Session表示所述路径的标识。上述仅是所述第六表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。The InLabelBase<assigned by PE3> indicates the fifth label allocated by the PE3, that is, LB3 in FIG. 2(a). Session indicates the identity of the path. The foregoing is only one representation of the sixth item, and the specific embodiment of the present application is not limited.
举例说明,PE3可根据所述第六表项,在转发面生成第五表项。所述第五表项可表示为:For example, PE3 may generate a fifth entry on the forwarding plane according to the sixth entry. The fifth entry can be expressed as:
(InLabelBase<assigned by PE3>+offset,MID)(InLabelBase<assigned by PE3>+offset, MID)
其中,InLabelBase<assigned by PE3>表示PE3分配的所述第五标签,即图2(a)中的LB3。offset表示偏移量。InLabelBase<assigned by PE3>+offset表示所述第六标签。MID表示所述组播的标识,MID与Session对应。上述仅是所述第五表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。 The InLabelBase<assigned by PE3> indicates the fifth label allocated by the PE3, that is, LB3 in FIG. 2(a). Offset represents the offset. InLabelBase<assigned by PE3>+offset represents the sixth tag. The MID indicates the identifier of the multicast, and the MID corresponds to the Session. The foregoing is only one representation of the fifth item, and the specific embodiment of the present application is not limited.
215,P根据所述第三响应消息,获得第五转发表项。215. The P obtains a fifth forwarding entry according to the third response message.
其中,所述第五转发表项包括所述第六标签、所述组播的标识和所述第三出接口的标识。P获得所述第五转发表项的方法与210中P获得所述第三转发表项的方法相同。可选地,所述第五转发表项中的所述组播的标识可被所述路径的标识替换。The fifth forwarding entry includes the sixth label, the identifier of the multicast, and an identifier of the third outgoing interface. The method of obtaining the fifth forwarding entry by P is the same as the method of obtaining the third forwarding entry by P in 210. Optionally, the identifier of the multicast in the fifth forwarding entry may be replaced by an identifier of the path.
可选地,P可在控制面生成第六转发表项,再根据所述第六转发表项在转发面生成所述第五转发表项。Optionally, the P may generate a sixth forwarding entry on the control plane, and generate the fifth forwarding entry on the forwarding plane according to the sixth forwarding entry.
举例说明,P可根据所述第三响应消息包括的所述第五标签和所述路径的标识,在控制面生成所述第六转发表项,所述第六转发表项包括所述第五标签、所述第三出接口的标识和所述路径的标识。P可通过211获得所述第三出接口的标识。所述第六转发表项可表示为:For example, the P may generate the sixth forwarding entry on the control plane according to the fifth label and the identifier of the path included in the third response message, where the sixth forwarding entry includes the fifth The label, the identifier of the third outbound interface, and the identifier of the path. P may obtain the identifier of the third outbound interface by 211. The sixth forwarding entry may be expressed as:
(Session,OutLabelBase<assigned by PE3>,OutInterface<to PE3>)(Session, OutLabelBase<assigned by PE3>, OutInterface<to PE3>)
其中,Session表示所述路径的标识。OutLabelBase<assigned by PE3>表示PE3分配的所述第五标签,即图2(a)中的LB3。OutInterface<to PE3>表示所述第三出接口的标识。上述仅是所述第六转发表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。Wherein, the Session represents the identifier of the path. OutLabelBase<assigned by PE3> indicates the fifth label assigned by PE3, that is, LB3 in FIG. 2(a). OutInterface<to PE3> indicates the identifier of the third outgoing interface. The foregoing is only one representation of the sixth forwarding entry, and the specific embodiment of the present application is not limited.
举例说明,P可根据所述第六转发表项,在转发面生成所述第五转发表项。所述第五转发表项可表示为:For example, P may generate the fifth forwarding entry on the forwarding plane according to the sixth forwarding entry. The fifth forwarding entry may be expressed as:
(MID,OutLabelBase<assigned by PE3>+offset,OutInterface<to PE3>)(MID, OutLabelBase<assigned by PE3>+offset, OutInterface<to PE3>)
其中,MID表示所述组播的标识,MID与Session对应。OutLabelBase<assigned by PE3>表示PE3分配的所述第五标签,即图2(a)中的LB3。offset表示偏移量。OutLabelBase<assigned by PE3>+offset表示所述第六标签。OutInterface<to PE3>表示所述第三出接口的标识。上述仅是所述第五转发表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。The MID indicates the identifier of the multicast, and the MID corresponds to the Session. OutLabelBase<assigned by PE3> indicates the fifth label assigned by PE3, that is, LB3 in FIG. 2(a). Offset represents the offset. OutLabelBase<assigned by PE3>+offset represents the sixth tag. OutInterface<to PE3> indicates the identifier of the third outgoing interface. The foregoing is only one representation of the fifth forwarding entry, and the specific embodiment of the present application is not limited.
实施例一中的204可在202之后执行,比如204在202和203之间执行,或者204在203之后执行。205可在203之后执行,比如205可在203与204之间执行,或者205与204同时执行,或者205在204之后执行。206可在201之后执行,比如206可在201与202之间执行,或者206在202与203之间执行,或者206在203和204之间执行,或者206在204之后执行。209可在207之后执行,比如209可在207和208之间执行,或者209在208之后执行。210可在208之后执行,比如210可在208和209之间执行,或者210可与209同时执行。211可在201之后执行,比如211可与206同时执行,或者211可在206之前执行。214可在212之后执行,比如214可在212和213之间执行,或者214在213之后执行。215可在213之后执行,比如215可在213和214之间执行,或者215可与214同时执行。以上只是对可能的实现方式的举例说明,本申请实施例对此不进行限定。204 in Embodiment 1 may be performed after 202, such as 204 between 202 and 203, or 204 after 203. 205 may be performed after 203, such as 205 may be performed between 203 and 204, or 205 and 204 may be performed simultaneously, or 205 may be performed after 204. 206 may be performed after 201, such as 206 may be performed between 201 and 202, or 206 may be performed between 202 and 203, or 206 may be performed between 203 and 204, or 206 may be performed after 204. 209 may be performed after 207, such as 209 may be performed between 207 and 208, or 209 may be performed after 208. 210 may be performed after 208, such as 210 may be performed between 208 and 209, or 210 may be performed concurrently with 209. 211 may be performed after 201, such as 211 may be performed concurrently with 206, or 211 may be performed prior to 206. 214 may be performed after 212, such as 214 may be performed between 212 and 213, or 214 may be performed after 213. 215 may be performed after 213, such as 215 may be performed between 213 and 214, or 215 may be performed concurrently with 214. The foregoing is only an example of a possible implementation, which is not limited in this embodiment of the present application.
本申请实施例提供的方法中,P2MP隧道包含的设备,如图2(a)中的PE1、P、PE2或PE3,可利用图2(b)中的相应表项实现报文的转发。下面结合图2(a)和图2(b),对报文的转发流程进行说明。In the method provided by the embodiment of the present application, the device included in the P2MP tunnel, such as PE1, P, PE2, or PE3 in FIG. 2(a), can forward the packet by using the corresponding entry in FIG. 2(b). The forwarding flow of the message will be described below with reference to FIG. 2(a) and FIG. 2(b).
PE1接收到来自site1的第一报文。PE1可根据接收所述第一报文的端口,确定所述第一报文来自VPN1,即site1属于VPN1。PE1上存储有VPN和offset的对应关系,PE1可根据所述对应关系,获得与VPN1对应的offset的数值,比如与VPN1对应的offset的数 值为1。PE1根据offset的数值,确定组播的标识是MID。PE1根据MID,获得第一转发表项。所述第一转发表项中第二标签的数值为LB1与offset的数值之和,即LB1+1,其中,LB1为P分配的第一标签,1为offset的数值。PE1根据所述第一报文和所述第二标签的数值,获得第二报文。所述第二报文包括所述第一报文和所述第二标签的数值。PE1通过所述第一出接口的标识,向P发送所述第二报文。PE1 receives the first packet from site1. The PE1 may determine, according to the port that receives the first packet, that the first packet is from VPN1, that is, site1 belongs to VPN1. The correspondence between the VPN and the offset is stored on the PE1, and the PE1 can obtain the value of the offset corresponding to the VPN1 according to the corresponding relationship, for example, the number of the offset corresponding to the VPN1. The value is 1. Based on the value of the offset, PE1 determines that the multicast identifier is the MID. Based on the MID, PE1 obtains the first forwarding entry. The value of the second label in the first forwarding entry is the sum of the values of LB1 and offset, that is, LB1+1, where LB1 is the first label allocated by P, and 1 is the value of offset. The PE1 obtains the second packet according to the values of the first packet and the second label. The second packet includes a value of the first packet and the second label. The PE1 sends the second packet to the P by using the identifier of the first outbound interface.
P接收来自PE1的第二报文。P根据所述第二报文包括的第二标签的数值,如LB1+1,P确定所述第一标签为LB1,还确定offset的数值为1。P可根据LB1,查找与LB1匹配的第一表项,获得组播的标识为MID。P根据MID获得两条转发表项,分别是第三转发表项和第五转发表项。P在确定有两条转发表项后,需要对接收到的所述第二报文包括的第一报文进行复制,即获得两条第一报文。P receives the second message from PE1. The P determines that the first label is LB1 according to the value of the second label included in the second packet, such as LB1+1, P, and determines that the value of the offset is 1. According to LB1, P can find the first entry that matches LB1, and obtain the multicast identifier as MID. The P obtains two forwarding entries according to the MID, which are a third forwarding entry and a fifth forwarding entry, respectively. After determining that there are two forwarding entries, the P needs to copy the first packet included in the received second packet, that is, obtain two first packets.
P获得的第三转发表项中的第四标签的数值为第三标签与offset的数值之和,即LB2+1,其中,LB2为PE2分配的第三标签。P根据所述第二报文和所述第四标签的数值,获得第三报文。所述第三报文包括所述第一报文和所述第四标签的数值。P通过所述第三转发表项包括的第二出接口的标识,向PE2发送所述第三报文。The value of the fourth label in the third forwarding entry obtained by P is the sum of the value of the third label and the offset, that is, LB2+1, where LB2 is the third label allocated by PE2. P: Obtain a third packet according to the values of the second packet and the fourth label. The third packet includes values of the first packet and the fourth label. The P sends the third packet to the PE2 by using the identifier of the second egress interface included in the third forwarding entry.
P获得的第五转发表项中的第六标签的数值为第五标签与offset的数值之和,即LB3+1,其中,LB3为PE3分配的第五标签。P根据所述第二报文和所述第六标签的数值,获得第四报文。所述第四报文包括所述第一报文和所述第六标签的数值。P通过所述第五转发表项包括的第三出接口的标识,向PE3发送所述第四报文。The value of the sixth label in the fifth forwarding entry obtained by P is the sum of the value of the fifth label and the offset, that is, LB3+1, where LB3 is the fifth label allocated by PE3. The P obtains the fourth packet according to the value of the second packet and the sixth label. The fourth packet includes values of the first packet and the sixth label. The P sends the fourth packet to the PE3 by using the identifier of the third outbound interface that is included in the fifth forwarding entry.
PE2接收到来自P的第三报文。PE2根据所述第三报文中所述第四标签的数值,确定offset的数值为1。PE2从所述第三报文中获得所述第一报文。PE2根据offset的数值,确定所述第一报文对应VPN1。PE2通过与site3通信的接口,向属于VPN1的site3发送所述第一报文。PE2 receives the third message from P. The PE2 determines that the value of the offset is 1 according to the value of the fourth label in the third packet. The PE2 obtains the first packet from the third packet. The PE2 determines that the first packet corresponds to VPN1 according to the value of the offset. The PE2 sends the first packet to the site 3 belonging to the VPN1 through the interface that communicates with the site3.
PE3接收到来自P的第四报文。PE3根据所述第四报文中所述第六标签的数值,确定offset的数值为1。PE3从所述第四报文中获得所述第一报文。PE3根据offset的数值,确定所述第一报文对应VPN1。PE3通过与site5通信的接口,向属于VPN1的site5发送所述第一报文。PE3 receives the fourth message from P. The PE3 determines that the value of the offset is 1 according to the value of the sixth label in the fourth packet. The PE3 obtains the first packet from the fourth packet. The PE3 determines that the first packet corresponds to VPN1 according to the value of the offset. The PE3 sends the first packet to the site 5 that belongs to VPN1 through the interface that communicates with the site 5.
VPN2的site2向PE1发送第五报文。PE1通过P,向连接PE2的site4发送所述第五报文的方法,与上述PE1通过P,向连接PE2的site3发送所述第一报文的方法相同。PE1通过P,向连接PE3的site6发送所述第五报文的方法,与上述PE1通过P,向连接PE3的site5发送所述第一报文的方法相同。在此不再对VPN2的流量转发方法进行赘述。 Site 2 of VPN2 sends a fifth packet to PE1. The method for the PE1 to send the fifth packet to the site 4 connected to the PE2 through the P is the same as the method for the PE1 to send the first packet to the site 3 connected to the PE2 through the P. The method of sending the fifth packet to the site 6 connected to the PE3 through the P1 is the same as the method of transmitting the first packet to the site 5 connected to the PE3 through the P1. The traffic forwarding method of VPN2 will not be described here.
本申请实施例中,每个offset对应一个VPN,每个VPN对应一个P2MP隧道,每个P2MP隧道对应一个MID。其中,P2MP隧道可以是逻辑隧道。作为第一转发设备的PE1可向作为第二转发设备的P发送blocksize,从作为第二转发设备的P获得LB1。作为第一转发设备的PE1无需存储N+1个标签空间,只需要根据LB1和与VPN对应的offset,就可实现报文的转发,有助于降低转发面上的代价和实现线性查表。同理,作为第一转发设备的P可向作为第二转发设备的PE2发送blocksize,从作为第二转发设备的PE2获得LB2。作为第一转发设备的P无需存储N+1个标签空间,只需要根据LB2和与VPN对应的offset,就可实现报文的转发,有助于降低转发面上的代价和实现线性查表。In this embodiment, each offset corresponds to one VPN, and each VPN corresponds to one P2MP tunnel, and each P2MP tunnel corresponds to one MID. The P2MP tunnel can be a logical tunnel. The PE1 as the first forwarding device can transmit the blocksize to the P as the second forwarding device, and obtain the LB1 from the P as the second forwarding device. As the first forwarding device, the PE1 does not need to store N+1 label spaces. Only the LB1 and the offset corresponding to the VPN can be used to forward packets. This helps reduce the cost on the forwarding plane and implement linear lookup. Similarly, the P as the first forwarding device can send the blocksize to the PE2 as the second forwarding device, and obtain the LB2 from the PE2 as the second forwarding device. As the first forwarding device, the P does not need to store N+1 label spaces. Only the LB2 and the offset corresponding to the VPN can be used to forward packets, which helps reduce the cost on the forwarding plane and implement linear lookup.
实施例二 Embodiment 2
图3(a)为本申请实施例提供的另一种网络场景示意图。图3(a)所示的网络中,PE1 与PE2、PE3和PE4建立P2P隧道。site1、site6和site8属于VPN1。site5属于VPN2。site7和site9属于VPN3。site1、site2和site3与PE1通信。PE2与site4和site5通信。PE3与site6和site7通信。PE4与site8和site9通信。VPN1和VPN2可共享PE1与PE2间的P2P隧道。VPN1和VPN3可共享PE1与PE3间的P2P隧道,还可共享PE1和PE4间的P2P隧道。FIG. 3(a) is a schematic diagram of another network scenario provided by an embodiment of the present application. In the network shown in Figure 3(a), PE1 Establish a P2P tunnel with PE2, PE3, and PE4. Site1, site6, and site8 belong to VPN1. Site5 belongs to VPN2. Site7 and site9 belong to VPN3. Site1, site2, and site3 communicate with PE1. PE2 communicates with site4 and site5. PE3 communicates with site6 and site7. PE4 communicates with site8 and site9. VPN1 and VPN2 can share P2P tunnels between PE1 and PE2. VPN1 and VPN3 can share the P2P tunnel between PE1 and PE3, and can also share the P2P tunnel between PE1 and PE4.
图3(b)为本申请实施例提供的建立组播隧道的方法流程图。下面结合图3(a)和图3(b),对本申请实施例提供的建立组播隧道的方法进行说明。FIG. 3(b) is a flowchart of a method for establishing a multicast tunnel according to an embodiment of the present application. The method for establishing a multicast tunnel provided by the embodiment of the present application is described below with reference to FIG. 3(a) and FIG. 3(b).
301,PE1向PE2发送第一请求消息。301. PE1 sends a first request message to PE2.
其中,所述第一请求消息包括标签块的信息和第一路径的标识。所述标签块的信息用于表示标签块的大小。所述第一路径的标识用于标识第一P2P隧道,所述第一P2P隧道为PE1与PE2之间的P2P隧道。PE1是PE2的上游设备,PE2是PE1的下游设备。PE1可根据与其通信的site所属的VPN的数量获得所述标签块的信息。如图3(a)所示,PE1可根据VPN的数量确定标签块的大小为3。The first request message includes information of a label block and an identifier of the first path. The information of the tag block is used to indicate the size of the tag block. The identifier of the first path is used to identify a first P2P tunnel, and the first P2P tunnel is a P2P tunnel between PE1 and PE2. PE1 is the upstream device of PE2, and PE2 is the downstream device of PE1. PE1 may obtain the information of the label block according to the number of VPNs to which the site with which it communicates. As shown in FIG. 3(a), PE1 can determine the size of the label block to be 3 according to the number of VPNs.
举例说明,PE1可根据所述标签块的信息和所述第一路径的标识,获得所述第一请求消息。所述第一请求消息用于向PE2请求分配与所述第一P2MP隧道对应的标签。所述第一请求消息可以是扩展后的path message。所述扩展后的path message可是对RFC3209中的path message包括的label_request中的session_attribute字段进行扩展,所述session_attribute字段携带所述标签块的信息。For example, the PE1 may obtain the first request message according to the information of the label block and the identifier of the first path. The first request message is used to request the PE2 to allocate a label corresponding to the first P2MP tunnel. The first request message may be an extended path message. The extended path message may be extended to a session_attribute field in a label_request included in the path message in the RFC 3209, where the session_attribute field carries information of the label block.
举例说明,PE1可根据CSPF或TEDB,获得PE1上与PE2通信的出接口,即第一出接口的标识。PE1可通过所述第一出接口,向PE2发送所述第一请求消息。For example, PE1 can obtain the outgoing interface of PE1 and PE2 according to CSPF or TEDB, that is, the identifier of the first outgoing interface. The PE1 may send the first request message to the PE2 by using the first outbound interface.
302,PE2分配第一标签。302. PE2 allocates a first label.
举例说明,所述第一标签是PE2根据所述标签块的信息确定的所述标签块的起始标签。PE2可从其配置的global标签空间中选择与所述标签块的信息对应的标签块,并获得所述标签块的起始标签,如图3(a)中的LB1,LB1是PE2上与所述标签块的信息对应的标签块的起始标签。For example, the first label is a starting label of the label block determined by the PE2 according to the information of the label block. The PE2 can select a label block corresponding to the information of the label block from the configured global label space, and obtain a start label of the label block, as shown in FIG. 3(a), LB1, and LB1 is a PE2 and a label. The start tag of the tag block corresponding to the information of the tag block.
303,PE2向PE1发送第一响应消息。303. The PE2 sends a first response message to the PE1.
举例说明,PE2可根据所述第一标签和所述第一路径的标识,获得所述第一响应消息。所述第一响应消息包括所述第一标签和所述第一路径的标识。所述第一响应消息可以是RSVP message,RSVP message可携带所述第一标签和所述第一路径的标识。For example, the PE2 may obtain the first response message according to the identifier of the first label and the first path. The first response message includes an identifier of the first tag and the first path. The first response message may be an RSVP message, and the RSVP message may carry the identifier of the first label and the first path.
304,PE2获得第一表项。304, PE2 obtains the first entry.
其中,PE2可根据所述第一标签和所述第一路径的标识,获得第一表项。PE2根据所述第一标签和所述第一路径的标识,获得所述第一表项包括:PE2根据所述第一路径的标识,获得第一标识,所述第一标识用于标识所述第一路径所对应的组播转发信息;PE2根据所述第一标签,获得第二标签,所述第二标签为根据所述第一标签和和偏移量获得的标签,所述偏移量的数值与VPN对应;PE2根据所述第二标签和所述第一标识,获得所述第一表项,所述第一表项包括所述第二标签和所述第一标识。其中,PE2根据所述第一路径的标识获得所述第一标识属于可选的内容,所述第一表项中的所述第一标识可用所述第一路径的标识替换。The PE2 can obtain the first entry according to the identifier of the first label and the first path. The PE2 obtains the first entry according to the identifier of the first label and the first path, and the PE2 obtains the first identifier according to the identifier of the first path, where the first identifier is used to identify the a multicast forwarding information corresponding to the first path; the PE2 obtains a second label according to the first label, where the second label is a label obtained according to the first label and an offset, the offset The value corresponds to the VPN; the PE2 obtains the first entry according to the second label and the first identifier, and the first entry includes the second label and the first identifier. The PE2 obtains that the first identifier belongs to the optional content according to the identifier of the first path, and the first identifier in the first entry may be replaced by the identifier of the first path.
可选地,PE2可在控制面生成第二表项,再根据所述第二表项在转发面生成所述第一表项。Optionally, the PE2 may generate a second entry in the control plane, and generate the first entry in the forwarding plane according to the second entry.
举例说明,PE2可根据所述第一标签和所述第一路径的标识,在控制面生成第二表项, 所述第二表项包括所述第一标签和所述第一路径的标识。所述第二表项可表示为:For example, the PE2 may generate a second entry on the control plane according to the identifier of the first label and the first path. The second entry includes the first tag and an identifier of the first path. The second entry can be expressed as:
(InLabelBase<assigned by PE2>,Session1)(InLabelBase<assigned by PE2>, Session1)
其中,InLabelBase<assigned by PE2>表示PE2分配的所述第一标签,即图3(a)中的LB1。Session1表示所述第一路径的标识。上述仅是所述第二表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。The InLabelBase<assigned by PE2> indicates the first label allocated by the PE2, that is, LB1 in FIG. 3(a). Session 1 represents the identifier of the first path. The foregoing is only one representation of the second item, and the specific embodiment of the present application is not limited.
举例说明,PE2可根据所述第二表项,在转发面生成第一表项。所述第一表项可表示为:For example, PE2 may generate a first entry on the forwarding plane according to the second entry. The first entry can be expressed as:
(InLabelBase<assigned by PE2>+offset,ID1)(InLabelBase<assigned by PE2>+offset, ID1)
其中,InLabelBase<assigned by PE2>表示PE2分配的所述第一标签,即图3(a)中的LB1。offset表示偏移量。InLabelBase<assigned by PE2>+offset表示所述第二标签。ID1表示所述第一标识,ID1与Session1对应。上述仅是所述第一表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。The InLabelBase<assigned by PE2> indicates the first label allocated by the PE2, that is, LB1 in FIG. 3(a). Offset represents the offset. InLabelBase<assigned by PE2>+offset represents the second tag. ID1 represents the first identifier, and ID1 corresponds to Session1. The above is only one manifestation of the first entry, and the specific embodiment of the present application is not limited.
305,PE1根据所述第一响应消息,获得第一转发表项。305. The PE1 obtains the first forwarding entry according to the first response message.
举例说明,PE1根据所述第一响应消息,获得第一转发表项包括:PE1根据所述第一路径的标识,获得所述第一标识;PE1根据所述第一路径的标识,获得所述第一出接口的标识;PE1根据所述第一标签、所述第一标识和所述第一出接口的标识,获得所述第一转发表项,所述第一转发表项包括所述第二标签、所述第一标识和所述第一出接口的标识。其中,PE1根据所述第一路径的标识获得所述第一标识属于可选的内容,所述第一转发表项中的所述第一标识可用所述第一路径的标识替换。For example, the PE1 obtains the first forwarding entry according to the first response message, and the PE1 obtains the first identifier according to the identifier of the first path, and the PE1 obtains the identifier according to the identifier of the first path. The first forwarding entry is obtained by the PE1 according to the first label, the first identifier, and the identifier of the first outgoing interface, where the first forwarding entry includes the first a second label, the first identifier, and an identifier of the first outgoing interface. The PE1 obtains that the first identifier belongs to the optional content according to the identifier of the first path, and the first identifier in the first forwarding entry may be replaced by the identifier of the first path.
可选地,PE1可在控制面生成第二转发表项,再根据所述第二转发表项在转发面生成所述第一转发表项。Optionally, the PE1 may generate a second forwarding entry on the control plane, and then generate the first forwarding entry on the forwarding plane according to the second forwarding entry.
举例说明,PE1可根据所述第一响应消息包括的所述第一标签和所述第一路径的标识,在控制面生成第二转发表项,所述第二转发表项包括所述第一标签、所述第一出接口的标识和所述第一路径的标识。PE1可通过301获得所述第一出接口的标识。所述第二转发表项可表示为:For example, the PE1 may generate a second forwarding entry on the control plane according to the identifier of the first label and the first path that is included in the first response message, where the second forwarding entry includes the first a label, an identifier of the first outbound interface, and an identifier of the first path. PE1 can obtain the identifier of the first outgoing interface by using 301. The second forwarding entry may be expressed as:
(Session1,OutLabelBase<assigned by PE2>,OutInterface<to PE2>)(Session1, OutLabelBase<assigned by PE2>, OutInterface<to PE2>)
其中,Session1表示所述第一路径的标识。OutLabelBase<assigned by PE2>表示PE2分配的所述第一标签,即图3(a)中的LB1。OutInterface<to PE2>表示所述第一出接口的标识。上述仅是所述第二转发表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。Wherein, Session1 represents the identifier of the first path. OutLabelBase<assigned by PE2> indicates the first label assigned by PE2, that is, LB1 in FIG. 3(a). OutInterface<to PE2> indicates the identifier of the first outgoing interface. The foregoing is only one representation of the second forwarding entry, and the specific embodiment of the present application is not limited.
举例说明,PE1可根据所述第二转发表项,在转发面生成第一转发表项。所述第一转发表项可表示为:For example, PE1 may generate a first forwarding entry on the forwarding plane according to the second forwarding entry. The first forwarding entry may be expressed as:
(ID1,OutLabelBase<assigned by PE2>+offset,OutInterface<to PE2>)(ID1, OutLabelBase<assigned by PE2>+offset, OutInterface<to PE2>)
其中,ID1表示所述第一标识,ID1与Session1对应。OutLabelBase<assigned by PE2>表示PE2分配的所述第一标签,即图3(a)中的LB1。offset表示偏移量。OutLabelBase<assigned by PE2>+offset表示所述第二标签。OutInterface<to PE2>表示所述第一出接口的标识。上述仅是所述第一转发表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。ID1 represents the first identifier, and ID1 corresponds to Session1. OutLabelBase<assigned by PE2> indicates the first label assigned by PE2, that is, LB1 in FIG. 3(a). Offset represents the offset. OutLabelBase<assigned by PE2>+offset represents the second tag. OutInterface<to PE2> indicates the identifier of the first outgoing interface. The foregoing is only one representation of the first forwarding entry, and the specific embodiment of the present application is not limited.
306,PE1向PE3发送第二请求消息。306. The PE1 sends a second request message to the PE3.
举例说明,所述第二请求消息包括所述标签块的信息和第二路径的标识。所述第二所 述标签块的信息可以是图3(a)中的blocksize。所述第二路径的标识用于标识第二P2P隧道,所述第二P2P隧道为PE1与PE3之间的P2P隧道。For example, the second request message includes information of the label block and an identifier of the second path. The second The information of the tag block may be blocksize in FIG. 3(a). The identifier of the second path is used to identify a second P2P tunnel, and the second P2P tunnel is a P2P tunnel between PE1 and PE3.
举例说明,PE1可根据所述标签块的信息和所述第二路径的标识,获得所述第二请求消息。所述第二请求消息用于向PE3请求分配与所述第二P2P隧道对应的标签。所述第二请求消息可以是扩展后的path message。所述扩展后的path message可是对RFC3209中的path message包括的label_request中的session_attribute字段进行扩展,所述session_attribute字段携带所述标签块的信息。For example, the PE1 may obtain the second request message according to the information of the label block and the identifier of the second path. The second request message is used to request the PE3 to allocate a label corresponding to the second P2P tunnel. The second request message may be an extended path message. The extended path message may be extended to a session_attribute field in a label_request included in the path message in the RFC 3209, where the session_attribute field carries information of the label block.
举例说明,PE1可根据CSPF或TEDB,获得PE1上与PE3通信的出接口,即第二接口的标识。PE1可通过所述第二接口,向PE3发送所述第二请求消息。For example, PE1 can obtain the outbound interface that communicates with PE3 on PE1 according to CSPF or TEDB, that is, the identifier of the second interface. The PE1 may send the second request message to the PE3 by using the second interface.
307,PE3分配第三标签。307, PE3 assigns a third label.
举例说明,所述第三标签是PE3根据所述标签块的信息确定的所述标签块的起始标签。PE3可从其配置的global标签空间中选择与所述标签块的信息对应的标签块,并获得所述标签块的起始标签,如图3(a)中的LB2,LB2是PE3上与所述标签块的信息对应的标签块的起始标签。其中,PE3上配置的global标签空间与PE2上配置的global标签空间不相同。For example, the third label is a starting label of the label block determined by the PE3 according to the information of the label block. The PE3 may select a label block corresponding to the information of the label block from the configured global label space, and obtain a start label of the label block, as shown in FIG. 3(a), LB2, and LB2 is a PE3. The start tag of the tag block corresponding to the information of the tag block. The global label space configured on PE3 is different from the global label space configured on PE2.
308,PE3向PE1发送第二响应消息。308. The PE3 sends a second response message to the PE1.
举例说明,PE3可根据所述第三标签和所述第二路径的标识,获得第二响应消息。所述第二响应消息包括所述第三标签和所述第二路径的标识。所述第二响应消息可以是RSVP message,所述RSVP message可携带所述第三标签和所述第二路径的标识。For example, the PE3 may obtain a second response message according to the identifier of the third label and the second path. The second response message includes an identifier of the third tag and the second path. The second response message may be an RSVP message, and the RSVP message may carry the identifier of the third label and the second path.
309,PE3获得第三表项。309, PE3 obtains the third entry.
其中,PE3可根据所述第三标签和所述第二路径的标识,获得所述第三表项。所述第三表项包括第四标签和第二标识。所述第四标签是根据所述第三标签和所述偏移量获得的标签,所述偏移量与VPN对应。所述第二标识用于标识所述第二路径的标识对应的组播转发信息。The PE3 may obtain the third entry according to the identifier of the third label and the second path. The third entry includes a fourth tag and a second identity. The fourth tag is a tag obtained according to the third tag and the offset, and the offset corresponds to a VPN. The second identifier is used to identify multicast forwarding information corresponding to the identifier of the second path.
举例说明,PE3根据所述第三标签和所述第二路径的标识,获得所述第三表项包括:PE3根据所述第二路径的标识,获得所述第二标识;PE3根据所述第三标签和所述偏移量,获得所述第四标签;PE3根据所述第四标签和所述第二标识,获得所述第三表项,所述第三表项包括所述第四标签和所述第二标识。其中,PE3根据所述第二路径的标识获得所述第二标识属于可选的内容,所述第三表项中的所述第二标识可用所述第二路径的标识替换。For example, the PE3 obtains the third entry according to the identifier of the third label and the second path, and the PE3 obtains the second identifier according to the identifier of the second path; Obtaining the fourth label according to the third label and the offset; the third entry is obtained by the PE3 according to the fourth label and the second identifier, and the third entry includes the fourth label And the second identifier. The PE3 obtains the second identifier as an optional content according to the identifier of the second path, and the second identifier in the third entry may be replaced by the identifier of the second path.
可选地,PE3可在控制面生成第四表项,再根据所述第四表项在转发面生成所述第三表项。Optionally, the PE3 may generate a fourth entry in the control plane, and generate the third entry in the forwarding plane according to the fourth entry.
举例说明,PE3可根据所述第三标签和所述第二路径的标识,在控制面生成第四表项,所述第四表项包括所述第三标签和所述第二路径的标识。所述第四表项可表示为:For example, the PE3 may generate a fourth entry on the control plane according to the identifier of the third label and the second path, where the fourth entry includes the identifier of the third label and the second path. The fourth entry can be expressed as:
(InLabelBase<assigned by PE3>,Session2)(InLabelBase<assigned by PE3>, Session2)
其中,InLabelBase<assigned by PE3>表示PE3分配的所述第三标签,即图3(a)中的LB2。Session2表示所述第二路径的标识。上述仅是所述第四表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。The InLabelBase<assigned by PE3> indicates the third label allocated by the PE3, that is, LB2 in FIG. 3(a). Session 2 represents the identifier of the second path. The foregoing is only one representation of the fourth item, and the specific embodiment of the present application is not limited.
举例说明,PE3可根据所述第四表项,在转发面生成第三表项。所述第三表项可表示为: For example, PE3 may generate a third entry on the forwarding plane according to the fourth entry. The third entry can be expressed as:
(InLabelBase<assigned by PE3>+offset,ID2)(InLabelBase<assigned by PE3>+offset, ID2)
其中,InLabelBase<assigned by PE3>表示PE3分配的所述第三标签,即图3(a)中的LB2。offset表示偏移量。InLabelBase<assigned by PE3>+offset表示所述第四标签。ID2表示所述第二标识,ID2与Session2对应。上述仅是所述第三表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。The InLabelBase<assigned by PE3> indicates the third label allocated by the PE3, that is, LB2 in FIG. 3(a). Offset represents the offset. InLabelBase<assigned by PE3>+offset represents the fourth tag. ID2 represents the second identifier, and ID2 corresponds to Session2. The foregoing is only one representation of the third item, and the specific embodiment of the present application is not limited.
310,PE1根据所述第二响应消息,获得第三转发表项。310. The PE1 obtains a third forwarding entry according to the second response message.
举例说明,PE1根据所述第二响应消息,获得第三转发表项包括:PE1根据所述第二路径的标识,获得所述第二标识;PE1根据所述第二路径的标识,获得所述第二出接口的标识;PE1根据所述第三标签、所述第二标识和所述第二出接口的标识,获得所述第三转发表项,所述第三转发表项包括所述第四标签、所述第二标识和所述第二出接口的标识。其中,PE1根据所述第二路径的标识获得所述第二标识属于可选的内容,所述第三转发表项中的所述第二标识可用所述第二路径的标识替换。For example, the PE1 obtains the third forwarding entry according to the second response message, the PE1 obtains the second identifier according to the identifier of the second path, and the PE1 obtains the identifier according to the identifier of the second path. The third forwarding entry is obtained according to the third label, the second identifier, and the identifier of the second outbound interface, where the third forwarding entry includes the first The identifier of the four labels, the second identifier, and the second outbound interface. The PE1 obtains the second identifier as an optional content according to the identifier of the second path, and the second identifier in the third forwarding entry may be replaced by the identifier of the second path.
可选地,PE1可在控制面生成第四转发表项,再根据所述第四转发表项在转发面生成所述第三转发表项。Optionally, the PE1 may generate a fourth forwarding entry on the control plane, and generate the third forwarding entry on the forwarding plane according to the fourth forwarding entry.
举例说明,PE1可根据所述第二响应消息包括的所述第三标签和所述第二路径的标识,在控制面生成第四转发表项,所述第四转发表项包括所述第三标签、所述第二出接口的标识和所述第二路径的标识。PE1可通过306获得所述第二出接口的标识。所述第四转发表项可表示为:For example, the PE1 may generate a fourth forwarding entry on the control plane according to the identifier of the third label and the second path included in the second response message, where the fourth forwarding entry includes the third a label, an identifier of the second outbound interface, and an identifier of the second path. PE1 may obtain the identifier of the second outbound interface by using 306. The fourth forwarding entry may be expressed as:
(Session2,OutLabelBase<assigned by PE3>,OutInterface<to PE3>)(Session2, OutLabelBase<assigned by PE3>, OutInterface<to PE3>)
其中,Session2表示所述第二路径的标识。OutLabelBase<assigned by PE3>表示PE3分配的所述第三标签,即图3(a)中的LB2。OutInterface<to PE3>表示所述第二出接口的标识。上述仅是所述第四转发表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。Wherein, Session 2 represents the identifier of the second path. OutLabelBase<assigned by PE3> indicates the third label allocated by PE3, that is, LB2 in FIG. 3(a). OutInterface<to PE3> indicates the identifier of the second outgoing interface. The foregoing is only one representation of the fourth forwarding entry, and the specific embodiment of the present application is not limited.
举例说明,PE1可根据所述第四转发表项,在转发面生成第三转发表项。所述第三转发表项可表示为:For example, PE1 may generate a third forwarding entry on the forwarding plane according to the fourth forwarding entry. The third forwarding entry may be expressed as:
(ID2,OutLabelBase<assigned by PE3>+offset,OutInterface<to PE3>)(ID2, OutLabelBase<assigned by PE3>+offset, OutInterface<to PE3>)
其中,ID2表示所述第二标识,ID2与Session2对应。OutLabelBase<assigned by PE3>表示PE3分配的所述第三标签,即图3(a)中的LB2。offset表示偏移量。OutLabelBase<assigned by PE3>+offset表示所述第四标签。OutInterface<to PE3>表示所述第二出接口的标识。上述仅是所述第三转发表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。ID2 represents the second identifier, and ID2 corresponds to Session2. OutLabelBase<assigned by PE3> indicates the third label allocated by PE3, that is, LB2 in FIG. 3(a). Offset represents the offset. OutLabelBase<assigned by PE3>+offset represents the fourth tag. OutInterface<to PE3> indicates the identifier of the second outgoing interface. The foregoing is only one representation of the third forwarding entry, and the specific embodiment of the present application is not limited.
311,PE1向PE4发送第三请求消息。311. The PE1 sends a third request message to the PE4.
举例说明,PE1获得所述第三请求消息的方法与306中PE1获得所述第二请求消息的方法相同。所述第三请求消息包括所述标签块的信息和第三路径的标识。所述第三路径的标识用于标识第三P2P隧道。所述第三P2P隧道为PE1与PE3之间的P2P隧道。所述第三请求消息用于向PE4请求分配与第三P2P隧道对应的标签。For example, the method for the PE1 to obtain the third request message is the same as the method for the PE1 to obtain the second request message. The third request message includes information of the tag block and an identifier of the third path. The identifier of the third path is used to identify a third P2P tunnel. The third P2P tunnel is a P2P tunnel between PE1 and PE3. The third request message is used to request the PE4 to allocate a label corresponding to the third P2P tunnel.
举例说明,PE1可根据CSPF或TEDB,获得PE1上与PE4通信的出接口,即第三接口的标识。PE1可通过所述第三接口,向PE4发送所述第三请求消息。For example, PE1 can obtain the outbound interface of PE1 and PE4 according to CSPF or TEDB, that is, the identifier of the third interface. The PE1 may send the third request message to the PE4 through the third interface.
312,PE4分配第五标签。312, PE4 assigns a fifth label.
举例说明,所述PE4分配所述第五标签的方法与307相同,在此不再赘述。所述第五 标签可以为图3(a)中的LB3。其中,PE4上配置的global标签空间与PE2上配置的global标签空间不相同,PE4上配置的global标签空间与PE3上配置的global标签空间不相同。For example, the method for allocating the fifth label by the PE4 is the same as that of the 307, and details are not described herein again. The fifth The tag can be LB3 in Figure 3(a). The global label space configured on PE4 is different from the global label space configured on PE2. The global label space configured on PE4 is different from the global label space configured on PE3.
313,PE4向PE1发送第三响应消息。313. The PE4 sends a third response message to the PE1.
举例说明,PE4获得所述第三响应消息的方法与308中PE3获得所述第二响应消息的方法相同,在此不再赘述。所述第三响应消息包括所述第五标签和所述第三路径的标识。For example, the method for the PE4 to obtain the third response message is the same as the method for the PE3 to obtain the second response message in 308, and details are not described herein again. The third response message includes an identifier of the fifth tag and the third path.
314,PE4获得第五表项。314, PE4 obtains the fifth entry.
举例说明,所述第五表项包括第六标签和第三标识。所述第六标签是根据所述第五标签和所述偏移量获得的标签。PE4获得所述第五表项的方法与309中PE3获得所述第三表项的方法相同。所述第三标识用于标识与所述第三路径对应的组播转发信息。可选地,所述第五表项中的所述第三标识可被所述第三路径的标识替换。For example, the fifth entry includes a sixth tag and a third identifier. The sixth tag is a tag obtained according to the fifth tag and the offset. The method in which PE4 obtains the fifth entry is the same as the method in which 309 PE3 obtains the third entry. The third identifier is used to identify multicast forwarding information corresponding to the third path. Optionally, the third identifier in the fifth entry may be replaced by the identifier of the third path.
可选地,PE4可在控制面生成第六表项,再根据所述第六表项在转发面生成所述第五表项。Optionally, the PE4 may generate a sixth entry in the control plane, and generate the fifth entry in the forwarding plane according to the sixth entry.
举例说明,PE4可根据所述第五标签和所述第三路径的标识,在控制面生成第六表项,所述第六表项包括所述第五标签和所述第三路径的标识。所述第六表项可表示为:For example, the PE4 may generate a sixth entry on the control plane according to the identifier of the fifth label and the third path, where the sixth entry includes the identifier of the fifth label and the third path. The sixth entry can be expressed as:
(InLabelBase<assigned by PE4>,Session3)(InLabelBase<assigned by PE4>, Session3)
其中,InLabelBase<assigned by PE4>表示PE4分配的所述第五标签,即图3(a)中的LB3。Session3表示所述第三路径的标识。上述仅是所述第六表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。The InLabelBase<assigned by PE4> indicates the fifth label allocated by the PE4, that is, LB3 in FIG. 3(a). Session 3 represents the identity of the third path. The foregoing is only one representation of the sixth item, and the specific embodiment of the present application is not limited.
举例说明,PE4可根据所述第六表项,在转发面生成第五表项。所述第五表项可表示为:For example, PE4 may generate a fifth entry on the forwarding plane according to the sixth entry. The fifth entry can be expressed as:
(InLabelBase<assigned by PE4>+offset,ID3)(InLabelBase<assigned by PE4>+offset, ID3)
其中,InLabelBase<assigned by PE4>表示PE4分配的所述第五标签,即图3(a)中的LB3。offset表示偏移量。InLabelBase<assigned by PE4>+offset表示所述第六标签。ID3表示所述第三标识,ID3与Session3对应。上述仅是所述第五表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。The InLabelBase<assigned by PE4> indicates the fifth label allocated by the PE4, that is, LB3 in FIG. 3(a). Offset represents the offset. InLabelBase<assigned by PE4>+offset represents the sixth tag. ID3 represents the third identifier, and ID3 corresponds to Session3. The foregoing is only one representation of the fifth item, and the specific embodiment of the present application is not limited.
315,PE1根据所述第三响应消息,获得第五转发表项。315. The PE1 obtains a fifth forwarding entry according to the third response message.
其中,所述第五转发表项包括第六标签、所述第三标识和第三出接口的标识,所述第六标签为根据所述第五标签和所述偏移量获得的标签,所述第三出接口的标识用于标识PE1上与PE4通信的接口。PE1获得所述第五转发表项的方法与310中PE1获得所述第三转发表项的方法相同。可选地,所述第五转发表项中的所述第三标识可被所述第三路径的标识替换。The fifth forwarding entry includes an identifier of the sixth label, the third identifier, and the third outbound interface, where the sixth label is a label obtained according to the fifth label and the offset. The identifier of the third outbound interface is used to identify the interface on PE1 that communicates with PE4. The method for the PE1 to obtain the fifth forwarding entry is the same as the method for the PE1 to obtain the third forwarding entry in 310. Optionally, the third identifier in the fifth forwarding entry may be replaced by the identifier of the third path.
可选地,PE1可在控制面生成第六转发表项,再根据所述第六转发表项在转发面生成所述第五转发表项。Optionally, the PE1 may generate a sixth forwarding entry on the control plane, and generate the fifth forwarding entry on the forwarding plane according to the sixth forwarding entry.
举例说明,PE1可根据所述第三响应消息包括的所述第五标签和所述第三路径的标识,在控制面生成所述第六转发表项,所述第六转发表项包括所述第五标签、所述第三出接口的标识和所述第三路径的标识。PE1可通过311获得所述第三出接口的标识。所述第六转发表项可表示为:For example, the PE1 may generate the sixth forwarding entry on the control plane according to the fifth label and the identifier of the third path that are included in the third response message, where the sixth forwarding entry includes the a fifth label, an identifier of the third outbound interface, and an identifier of the third path. PE1 can obtain the identifier of the third outbound interface by using 311. The sixth forwarding entry may be expressed as:
(Session3,OutLabelBase<assigned by PE4>,OutInterface<to PE4>)(Session3, OutLabelBase<assigned by PE4>, OutInterface<to PE4>)
其中,Session3表示所述路径的标识。OutLabelBase<assigned by PE4>表示PE4分配的所述第五标签,即图3(a)中的LB3。OutInterface<to PE4>表示所述第三出接口的标识。 上述仅是所述第六转发表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。Wherein, Session 3 represents the identifier of the path. OutLabelBase<assigned by PE4> indicates the fifth label assigned by PE4, that is, LB3 in FIG. 3(a). OutInterface<to PE4> indicates the identifier of the third outgoing interface. The foregoing is only one representation of the sixth forwarding entry, and the specific embodiment of the present application is not limited.
举例说明,PE1可根据所述第六转发表项,在转发面生成所述第五转发表项。所述第五转发表项可表示为:For example, PE1 may generate the fifth forwarding entry on the forwarding plane according to the sixth forwarding entry. The fifth forwarding entry may be expressed as:
(ID3,OutLabelBase<assigned by PE4>+offset,OutInterface<to PE4>)(ID3, OutLabelBase<assigned by PE4>+offset, OutInterface<to PE4>)
其中,ID3表示所述第三标识,ID3与Session3对应。OutLabelBase<assigned by PE4>表示PE4分配的所述第五标签,即图3(a)中的LB3。offset表示偏移量。OutLabelBase<assigned by PE4>+offset表示所述第六标签。OutInterface<to PE4>表示所述第三出接口的标识。上述仅是所述第五转发表项的一种表现形式,本申请实施例对其具体的表现形式不进行限定。ID3 represents the third identifier, and ID3 corresponds to Session3. OutLabelBase<assigned by PE4> indicates the fifth label assigned by PE4, that is, LB3 in FIG. 3(a). Offset represents the offset. OutLabelBase<assigned by PE4>+offset represents the sixth tag. OutInterface<to PE4> indicates the identifier of the third outgoing interface. The foregoing is only one representation of the fifth forwarding entry, and the specific embodiment of the present application is not limited.
实施例二中的301、306和311可同时执行,或者301、306和311可以按照任意顺序执行,本实施例对此不进行限定。304可在302之后执行,305可在303之后执行,304与305可同时执行,或者304可晚于305执行。309可在307之后执行,310可在308之后执行,309和310可同时执行,或者309可晚于310执行。314可在312之后执行,315可在313之后执行,314与315可同时执行,或者314可晚于315执行。以上只是对可能的实现方式的举例说明,本申请实施例对此不进行限定。301, 306, and 311 in the second embodiment can be executed at the same time, or 301, 306, and 311 can be executed in any order, which is not limited in this embodiment. 304 may be performed after 302, 305 may be performed after 303, 304 and 305 may be performed simultaneously, or 304 may be performed later than 305. 309 may be performed after 307, 310 may be performed after 308, 309 and 310 may be performed simultaneously, or 309 may be performed later than 310. 314 may be performed after 312, 315 may be performed after 313, 314 and 315 may be performed simultaneously, or 314 may be performed later than 315. The foregoing is only an example of a possible implementation, which is not limited in this embodiment of the present application.
本申请实施例中各个节点根据实施例二提供的方法,在转发面上形成相应的表项或转发表项。In the embodiment of the present application, each node forms a corresponding entry or forwarding entry on the forwarding plane according to the method provided in the second embodiment.
PE1的转发面上形成的转发表项如下:The forwarding entries formed on the forwarding plane of PE1 are as follows:
(ID11<offset=1>,OutLabelBase<assigned by PE2>+offset,OutInterface<to PE2>);(ID11<offset=1>, OutLabelBase<assigned by PE2>+offset, OutInterface<to PE2>);
(ID12<offset=2>,OutLabelBase<assigned by PE2>+offset,OutInterface<to PE2>);(ID12<offset=2>, OutLabelBase<assigned by PE2>+offset, OutInterface<to PE2>);
(ID21<offset=1>,OutLabelBase<assigned by PE3>+offset,OutInterface<to PE3>);(ID21<offset=1>, OutLabelBase<assigned by PE3>+offset, OutInterface<to PE3>);
(ID23<offset=3>,OutLabelBase<assigned by PE3>+offset,OutInterface<to PE3>);(ID23<offset=3>, OutLabelBase<assigned by PE3>+offset, OutInterface<to PE3>);
(ID31<offset=1>,OutLabelBase<assigned by PE4>+offset,OutInterface<to PE4>);(ID31<offset=1>, OutLabelBase<assigned by PE4>+offset, OutInterface<to PE4>);
(ID33<offset=3>,OutLabelBase<assigned by PE4>+offset,OutInterface<to PE4>);(ID33<offset=3>, OutLabelBase<assigned by PE4>+offset, OutInterface<to PE4>);
上述PE1获得的转发表项中,ID11表示offset为1的情况下ID1的取值,ID12表示offset为2的情况下ID1的取值。ID21表示offset为1的情况下ID2的取值,ID23表示offset为3的情况下ID2的取值。ID31表示offset为1的情况下ID3的取值,ID33表示offset为3的情况下ID3的取值。In the forwarding entry obtained by the PE1, ID11 indicates the value of ID1 when the offset is 1, and ID12 indicates the value of ID1 when the offset is 2. ID21 indicates the value of ID2 when the offset is 1, and ID23 indicates the value of ID2 when the offset is 3. ID31 indicates the value of ID3 when the offset is 1, and ID33 indicates the value of ID3 when the offset is 3.
PE2的转发面上形成的表项如下:The entries formed on the forwarding plane of PE2 are as follows:
(InLabelBase<assigned by PE2>+offset,ID11<offset=1>)(InLabelBase<assigned by PE2>+offset, ID11<offset=1>)
(InLabelBase<assigned by PE2>+offset,ID12<offset=2>)(InLabelBase<assigned by PE2>+offset, ID12<offset=2>)
上述PE2获得的表项中,ID11表示offset为1的情况下ID1的取值,ID12表示offset为2的情况下ID1的取值。Among the entries obtained by the above PE2, ID11 indicates the value of ID1 when the offset is 1, and ID12 indicates the value of ID1 when the offset is 2.
PE3的转发面上形成的表项如下:The entries formed on the forwarding plane of PE3 are as follows:
(InLabelBase<assigned by PE3>+offset,ID21<offset=1>)(InLabelBase<assigned by PE3>+offset, ID21<offset=1>)
(InLabelBase<assigned by PE3>+offset,ID23<offset=3>)(InLabelBase<assigned by PE3>+offset, ID23<offset=3>)
上述PE3获得的表项中,ID21表示offset为1的情况下ID2的取值,ID23表示offset为3的情况下ID2的取值。Among the entries obtained by the above PE3, ID21 indicates the value of ID2 when the offset is 1, and ID23 indicates the value of ID2 when the offset is 3.
PE4的转发面上形成的表项如下: The entries formed on the forwarding plane of PE4 are as follows:
(InLabelBase<assigned by PE4>+offset,ID31<offset=1>)(InLabelBase<assigned by PE4>+offset, ID31<offset=1>)
(InLabelBase<assigned by PE4>+offset,ID33<offset=3>)(InLabelBase<assigned by PE4>+offset, ID33<offset=3>)
上述PE4获得的表项中,ID31表示offset为1的情况下ID3的取值,ID33表示offset为3的情况下ID3的取值。Among the entries obtained by the above PE4, ID31 indicates the value of ID3 when the offset is 1, and ID33 indicates the value of ID3 when the offset is 3.
本申请实施例提供的方法中,如图3(a)中的PE1、PE2、PE3或PE4,可利用图3(b)中的相应表项实现报文的转发。下面结合图3(a),对报文的转发流程进行说明。In the method provided by the embodiment of the present application, as shown in Figure 3 (a), PE1, PE2, PE3, or PE4 can use the corresponding entry in Figure 3 (b) to implement packet forwarding. The forwarding process of the packet will be described below with reference to FIG. 3(a).
PE1接收到来自site1的第一报文。PE1可根据接收所述第一报文的端口,确定所述第一报文来自VPN1,即site1属于VPN1。PE1上存储有VPN和offset的对应关系,PE1可根据所述对应关系,获得与VPN1对应的offset的数值,比如与VPN1对应的offset的数值为1。PE1根据offset的数值,确定PE2、PE3和PE4上均有VPN1的site,PE1获得ID11、ID21和ID31。PE1根据ID11、ID21和ID31,获得第一转发表项、第三转发表项和第五转发表项,即上述PE1上形成的offset为1的转发表项。所述第一转发表项中第二标签的数值为LB1+1,其中,LB1为PE2分配的第一标签,1为offset的数值。所述第三转发表项中第四标签的数值为LB2+1,其中,LB2为PE3分配的第三标签。所述第五转发表项中第六标签的数值为LB3+1,其中,LB3为PE3分配的第五标签。PE1 receives the first packet from site1. The PE1 may determine, according to the port that receives the first packet, that the first packet is from VPN1, that is, site1 belongs to VPN1. The correspondence between the VPN and the offset is stored on the PE1. The PE1 can obtain the value of the offset corresponding to the VPN1 according to the corresponding relationship. For example, the value of the offset corresponding to the VPN1 is 1. Based on the value of the offset, PE1 determines that there are VPN1 sites on PE2, PE3, and PE4, and PE1 obtains ID11, ID21, and ID31. The PE1 obtains the first forwarding entry, the third forwarding entry, and the fifth forwarding entry according to the ID11, the ID21, and the ID31, that is, the forwarding entry formed by the offset 1 formed on the PE1. The value of the second label in the first forwarding entry is LB1+1, where LB1 is the first label assigned by PE2, and 1 is the value of offset. The value of the fourth label in the third forwarding entry is LB2+1, where LB2 is the third label allocated by PE3. The value of the sixth label in the fifth forwarding entry is LB3+1, where LB3 is the fifth label allocated by PE3.
PE1根据所述第一报文和所述第二标签的数值,获得第二报文。所述第二报文包括所述第一报文和所述第二标签的数值。PE1通过所述第一出接口的标识,向PE2发送所述第二报文。PE1根据所述第一报文和所述第四标签的数值,获得第三报文。所述第三报文包括所述第一报文和所述第四标签的数值。PE1通过所述第二出接口的标识,向PE3发送所述第三报文。PE1根据所述第一报文和所述第六标签的数值,获得第四报文。所述第四报文包括所述第一报文和所述第六标签的数值。PE1通过所述第三出接口的标识,向PE4发送所述第四报文。The PE1 obtains the second packet according to the values of the first packet and the second label. The second packet includes a value of the first packet and the second label. The PE1 sends the second packet to the PE2 by using the identifier of the first outgoing interface. The PE1 obtains the third packet according to the values of the first packet and the fourth label. The third packet includes values of the first packet and the fourth label. The PE1 sends the third packet to the PE3 by using the identifier of the second outbound interface. The PE1 obtains the fourth packet according to the values of the first packet and the sixth label. The fourth packet includes values of the first packet and the sixth label. The PE1 sends the fourth packet to the PE4 by using the identifier of the third outbound interface.
PE2接收到来自PE1的第二报文。PE2根据所述第二报文中所述第二标签的数值,确定offset的数值为1。PE2从所述第二报文中获得所述第一报文。PE2根据offset的数值,确定所述第一报文对应VPN1。PE2通过与site4通信的接口,向属于VPN1的site4发送所述第一报文。PE2 receives the second packet from PE1. The PE2 determines that the value of the offset is 1 according to the value of the second label in the second packet. The PE2 obtains the first packet from the second packet. The PE2 determines that the first packet corresponds to VPN1 according to the value of the offset. The PE2 sends the first packet to the site 4 belonging to the VPN1 through the interface that communicates with the site 4.
PE3向site6发送所述第一报文的方法与PE2向site4发送所述第一报文的方法按相同。PE4向site8发送所述第一报文的方法与PE2向site4发送所述第一报文的方法相同。The method for the PE3 to send the first packet to the site 6 is the same as the method for the PE2 to send the first packet to the site 4. The method for the PE4 to send the first packet to the site 8 is the same as the method for the PE2 to send the first packet to the site 4.
本申请实施例中,作为第一转发设备的PE1可向作为第二转发设备的PE2、PE3、和PE4发送blocksize,从作为第二转发设备的一个或多个PE设备获得作为标签块的起始标签,比如LB1、LB2和LB3。作为第一转发设备的PE1无需存储N+1个标签空间,只需要根据LB1、LB2、LB3和与VPN对应的offset,就可实现报文转发至相应的VPN,有助于降低转发面上的代价和实现线性查表。In the embodiment of the present application, the PE1 as the first forwarding device may send the blocksize to the PE2, the PE3, and the PE4 as the second forwarding device, and obtain the start as the label block from the one or more PE devices that are the second forwarding device. Labels, such as LB1, LB2, and LB3. As the first forwarding device, the PE1 does not need to store N+1 label spaces. Only the LB1, LB2, LB3, and the offset corresponding to the VPN can be forwarded to the corresponding VPN, which helps reduce the forwarding plane. The cost and implementation of a linear lookup table.
图4为本申请实施例提供的第一转发设备的结构示意图。本申请实施例提供的第一转发设备可以是图2(a)中的PE1或P,还可是图3(a)中的PE1。下面结合图4,对本申请实施例提供的第一转发设备进行说明。FIG. 4 is a schematic structural diagram of a first forwarding device according to an embodiment of the present disclosure. The first forwarding device provided by the embodiment of the present application may be PE1 or P in FIG. 2(a), and may also be PE1 in FIG. 3(a). The first forwarding device provided by the embodiment of the present application is described below with reference to FIG. 4 .
所述第一转发设备包括第一发送单元401、第一接收单元402和第一获得单元403。The first forwarding device includes a first sending unit 401, a first receiving unit 402, and a first obtaining unit 403.
所述第一发送单元401用于向第二转发设备发送请求消息,所述请求消息包括标签块的信息和路径的标识,所述标签块的信息用于表示标签块的大小,所述路径的标识用于标识所述第一转发设备与所述第二转发设备间与虚拟专用网VPN对应的隧道,所述第一转 发设备是所述第二转发设备的上游设备。The first sending unit 401 is configured to send a request message to the second forwarding device, where the request message includes information of a label block and an identifier of a path, where information of the label block is used to indicate a size of the label block, where the path is The identifier is used to identify a tunnel corresponding to the virtual private network VPN between the first forwarding device and the second forwarding device, where the first The transmitting device is an upstream device of the second forwarding device.
所述第一接收单元402用于接收所述第二转发设备发送的响应消息,所述响应消息包括第一标签和所述路径的标识,所述第一标签是根据所述标签块的信息确定的所述标签块的起始标签。The first receiving unit 402 is configured to receive a response message sent by the second forwarding device, where the response message includes a first label and an identifier of the path, where the first label is determined according to information of the label block. The starting tag of the tag block.
所述第一获得单元403用于根据所述第一标签和所述路径的标识,获得与所述隧道对应的转发表项。The first obtaining unit 403 is configured to obtain, according to the identifier of the first label and the path, a forwarding entry corresponding to the tunnel.
可选地,所述第一转发设备还包括:确定单元404和第二获得单元405。所述确定单元404用于确定与所述VPN对应的隧道。所述第二获得单元405用于根据所述与所述VPN对应的隧道,获得所述标签块的信息,所述标签块的信息由所述隧道对应的VPN的数量所确定。Optionally, the first forwarding device further includes: a determining unit 404 and a second obtaining unit 405. The determining unit 404 is configured to determine a tunnel corresponding to the VPN. The second obtaining unit 405 is configured to obtain information about the label block according to the tunnel corresponding to the VPN, where the information of the label block is determined by the number of VPNs corresponding to the tunnel.
举例说明,所述第一获得单元403具体用于:根据所述路径的标识,获得组播的标识,所述组播的标识用于标识所述路径所对应的组播转发信息;根据所述路径的标识,获得出接口的标识,所述出接口为所述第一转发设备上与所述第二转发设备通信的接口;根据所述第一标签、所述组播的标识和所述出接口的标识,获得所述转发表项,所述转发表项包括第二标签、所述组播的标识和所述出接口的标识,所述第二标签为根据所述第一标签和偏移量获得的标签,所述偏移量的数值与VPN对应。For example, the first obtaining unit 403 is specifically configured to: obtain an identifier of the multicast according to the identifier of the path, where the identifier of the multicast is used to identify multicast forwarding information corresponding to the path; An identifier of the path, where the identifier of the outbound interface is obtained, where the outbound interface is an interface that communicates with the second forwarding device on the first forwarding device; according to the first label, the identifier of the multicast, and the outgoing An identifier of the interface, where the forwarding entry is obtained, where the forwarding entry includes a second label, the identifier of the multicast, and an identifier of the outbound interface, where the second label is based on the first label and the offset The obtained label, the value of the offset corresponding to the VPN.
可选地,所述第一转发设备还包括:第二接收单元406、第三获得单元407和第二发送单元408。所述第二接收单元406用于接收来自所述VPN的第一报文,并获得VPN的标识。所述第三获得单元407用于根据所述转发表项、所述第一报文和所述VPN的标识,获得第二报文,所述第二报文为通过所述隧道发送至所述第二转发设备的组播报文。所述第二发送单元408用于发送所述第二报文至所述第二转发设备。Optionally, the first forwarding device further includes: a second receiving unit 406, a third obtaining unit 407, and a second sending unit 408. The second receiving unit 406 is configured to receive the first packet from the VPN, and obtain an identifier of the VPN. The third obtaining unit 407 is configured to obtain a second packet according to the forwarding entry, the first packet, and the identifier of the VPN, where the second packet is sent to the The multicast packet of the second forwarding device. The second sending unit 408 is configured to send the second packet to the second forwarding device.
举例说明,所述第三获得单元407具体用于:根据对应关系和所述VPN的标识,获得所述VPN对应的偏移量的数值,所述对应关系包括所述VPN的标识和所述偏移量的数值;根据所述转发表项和所述偏移量的数值,获得第三标签和出接口的标识,所述第三标签为根据所述第一标签和所述偏移量的数值获得的标签,所述出接口用于与所述第二转发设备通信;所述第二发送单元具体用于根据所述出接口的标识,向所述第二转发设备发送所述第二报文,所述第二报文包括所述第一报文和所述第三标签。For example, the third obtaining unit 407 is specifically configured to: obtain a value of the offset corresponding to the VPN according to the correspondence and the identifier of the VPN, where the correspondence includes the identifier of the VPN and the partial a value of the shift amount; obtaining, according to the forwarding entry and the value of the offset, an identifier of the third label and the outbound interface, where the third label is a value according to the first label and the offset Obtaining a label, the egress interface is configured to communicate with the second forwarding device, and the second sending unit is configured to send the second packet to the second forwarding device according to the identifier of the egress interface. The second packet includes the first packet and the third label.
本申请实施例提供的第一转发设备,所述第一转发设备可根据第二转发设备发送的标签块的起始标签,比如第一标签,以及所述路径的标识,获得能够实现线性查找的转发表项,相对于通常的upstream-assigned的方式来说,有助于降低转发面支持upstream-assigned方式所需的转发成本,还有助于降低存储空间和提高转发效率。所述第一转发设备所获得的转发表项的数量小于通常的根据1+N个标签空间形成的转发表项,且所述第一转发设备无需保存1+N个标签空间,有助于降低存储空间的占用。The first forwarding device provided by the embodiment of the present application may be configured to obtain a linear search according to a start label of a label block sent by the second forwarding device, such as a first label and an identifier of the path. Forwarding entries, compared to the usual upstream-assigned mode, help reduce the forwarding cost required by the forwarding plane to support the upstream-assigned mode, and also help reduce storage space and improve forwarding efficiency. The number of the forwarding entries obtained by the first forwarding device is smaller than the forwarding entry formed according to the 1+N label space, and the first forwarding device does not need to save 1+N label spaces, which helps to reduce The occupation of storage space.
图5为本申请实施例提供的第二转发设备的结构示意图。本申请实施例提供的第二转发设备可以是图2(a)中的P、PE2或PE3,还可是图3(a)中的PE2、PE3或PE4。若第一转发设备是图2(a)的PE1,则所述第二转发设备可以是图2(a)的P。若所述第一转发设备是图2(a)的P,则所述第二转发设备可以是图2(a)的PE2或PE3。下面结合图5,对本申请实施例提供的第二转发设备进行说明。FIG. 5 is a schematic structural diagram of a second forwarding device according to an embodiment of the present disclosure. The second forwarding device provided by the embodiment of the present application may be P, PE2 or PE3 in FIG. 2(a), and may also be PE2, PE3 or PE4 in FIG. 3(a). If the first forwarding device is PE1 of FIG. 2(a), the second forwarding device may be P of FIG. 2(a). If the first forwarding device is P of FIG. 2(a), the second forwarding device may be PE2 or PE3 of FIG. 2(a). The second forwarding device provided in the embodiment of the present application is described below with reference to FIG.
所述第二转发设备包括:接收单元501、第一获得单元502和发送单元503。The second forwarding device includes: a receiving unit 501, a first obtaining unit 502, and a sending unit 503.
所述接收单元501用于接收第一转发设备发送的请求消息,所述第二转发设备是所述 第一转发设备的下游设备,所述请求消息包括标签块的信息和路径的标识,所述标签块的信息用于表示标签块的大小,所述路径的标识用于标识与虚拟专用网VPN对应的隧道。The receiving unit 501 is configured to receive a request message sent by the first forwarding device, where the second forwarding device is The downstream device of the first forwarding device, the request message includes information of a label block and an identifier of a path, the information of the label block is used to indicate a size of the label block, and the identifier of the path is used to identify a virtual private network VPN. Tunnel.
所述第一获得单元502用于根据所述标签块的信息,获得第一标签,所述第一标签是根据所述标签块的信息确定的所述标签块的起始标签。The first obtaining unit 502 is configured to obtain, according to the information of the label block, a first label, where the first label is a starting label of the label block determined according to information of the label block.
所述发送单元503用于向所述第一转发设备发送响应消息,所述响应消息包括所述第一标签和所述路径的标识。The sending unit 503 is configured to send a response message to the first forwarding device, where the response message includes the identifier of the first label and the path.
可选地,所述第二转发设备还包括第二获得单元504。所述第二获得单元504用于根据所述第一标签和所述路径的标识,获得与所述隧道对应的表项,所述表项包括第二标签,所述第二标签为根据所述第一标签和偏移量获得的标签,所述偏移量的数值与VPN对应。Optionally, the second forwarding device further includes a second obtaining unit 504. The second obtaining unit 504 is configured to obtain, according to the identifier of the first label and the path, an entry corresponding to the tunnel, where the entry includes a second label, and the second label is according to the The first tag and the offset obtained tag, the value of the offset corresponding to the VPN.
举例说明,所述第二获得单元504具体用于:根据所述路径的标识,获得组播的标识,所述组播的标识用于标识所述路径所对应的组播转发信息;根据所述第一标签和所述组播的标识,获得所述表项,所述表项包括所述第二标签和所述组播的标识。For example, the second obtaining unit 504 is specifically configured to: obtain an identifier of the multicast according to the identifier of the path, where the identifier of the multicast is used to identify multicast forwarding information corresponding to the path; And obtaining, by the first label and the identifier of the multicast, the entry, where the entry includes the second label and the identifier of the multicast.
本申请实施例提供的第二转发设备,所述第二转发设备可根据第一转发设备发送的标签块的信息,为所述第一转发设备分配第一标签。所述第二转发设备根据所述标签块的信息,预留了与所述标签块的信息匹配的标签块。所述第二转发设备根据来自所述第一转发设备的报文所携带的offset和所述第一标签,就能够获得与上述两个参数匹配的表项,以便根据所述表项中的组播的标识,获得向其他转发设备发送报文所需的标签,这样所述第二转发设备无需保存1+N个标签空间,有助于降低存储空间的占用。In the second forwarding device provided by the embodiment of the present application, the second forwarding device may allocate the first label to the first forwarding device according to the information of the label block sent by the first forwarding device. The second forwarding device reserves a label block that matches the information of the label block according to the information of the label block. The second forwarding device can obtain an entry matching the two parameters according to the offset and the first label carried in the packet from the first forwarding device, so as to be based on the group in the entry. The identifier of the broadcast is obtained, and the label required for sending the packet to the other forwarding device is obtained, so that the second forwarding device does not need to save 1+N label spaces, which helps reduce the occupation of the storage space.
图6为本申请实施例提供的第一转发设备的结构示意图。本实施例提供的第一转发设备可以与图4的第一转发设备相同。所述第一转发设备包括处理器601、存储器602和通信接口603。所述处理器601、所述存储器602和所述通信接口603通过通信总线604连接。若图6所示的第一转发设备是网络中的交换机,则所述处理器601可以是NP。若图6所示的第一转发设备是路由器,则所述处理器601可以是中央处理器(central processing unit,CPU)。所述存储器602用于存储程序。FIG. 6 is a schematic structural diagram of a first forwarding device according to an embodiment of the present disclosure. The first forwarding device provided in this embodiment may be the same as the first forwarding device in FIG. The first forwarding device includes a processor 601, a memory 602, and a communication interface 603. The processor 601, the memory 602, and the communication interface 603 are connected by a communication bus 604. If the first forwarding device shown in FIG. 6 is a switch in the network, the processor 601 may be an NP. If the first forwarding device shown in FIG. 6 is a router, the processor 601 may be a central processing unit (CPU). The memory 602 is used to store programs.
处理器601根据从存储器602中读取的程序所包括的可执行指令,执行如下操作。The processor 601 performs the following operations in accordance with executable instructions included in the program read from the memory 602.
所述处理器601通过所述通信接口603,向第二转发设备发送请求消息,所述请求消息包括标签块的信息和路径的标识,所述标签块的信息用于表示标签块的大小,所述路径的标识用于标识所述第一转发设备与所述第二转发设备间与虚拟专用网VPN对应的隧道,所述第一转发设备是所述第二转发设备的上游设备。The processor 601 sends a request message to the second forwarding device by using the communication interface 603, where the request message includes the information of the label block and the identifier of the path, where the information of the label block is used to indicate the size of the label block. The identifier of the path is used to identify a tunnel corresponding to the virtual private network VPN between the first forwarding device and the second forwarding device, and the first forwarding device is an upstream device of the second forwarding device.
所述处理器601通过所述通信接口603,接收所述第二转发设备发送的响应消息,所述响应消息包括第一标签和所述路径的标识,所述第一标签是根据所述标签块的信息确定的所述标签块的起始标签。The processor 601 receives, by using the communication interface 603, a response message sent by the second forwarding device, where the response message includes a first label and an identifier of the path, where the first label is according to the label block. The information identifies the starting tag of the tag block.
所述处理器601根据所述第一标签和所述路径的标识,获得与所述隧道对应的转发表项。The processor 601 obtains a forwarding entry corresponding to the tunnel according to the identifier of the first label and the path.
可选地,所述处理器601还确定与所述VPN对应的隧道;所述处理器601还根据所述与所述VPN对应的隧道,获得所述标签块的信息,所述标签块的信息由所述隧道对应的VPN的数量所确定。Optionally, the processor 601 further determines a tunnel corresponding to the VPN, and the processor 601 further obtains information about the label block according to the tunnel corresponding to the VPN, where the information of the label block is Determined by the number of VPNs corresponding to the tunnel.
举例说明,所述处理器601可根据所述路径的标识,获得组播的标识,所述组播的标识用于标识所述路径所对应的组播转发信息;所述处理器601可根据所述路径的标识,获得出接口的标识,所述出接口为所述第一转发设备上与所述第二转发设备通信的接口;所 述处理器601可根据所述第一标签、所述组播的标识和所述出接口的标识,获得所述转发表项,所述转发表项包括第二标签、所述组播的标识和所述出接口的标识,所述第二标签为根据所述第一标签和偏移量获得的标签,所述偏移量的数值与VPN对应。For example, the processor 601 may obtain a multicast identifier according to the identifier of the path, where the identifier of the multicast is used to identify multicast forwarding information corresponding to the path, and the processor 601 may be configured according to the The identifier of the path is obtained, and the outbound interface is an interface that communicates with the second forwarding device on the first forwarding device; The processor 601 may obtain the forwarding entry according to the first label, the identifier of the multicast, and the identifier of the outbound interface, where the forwarding entry includes a second label, the identifier of the multicast, and The identifier of the outbound interface, the second label is a label obtained according to the first label and an offset, and the value of the offset corresponds to a VPN.
可选地,所述处理器601还通过所述通信接口603,接收来自所述VPN的第一报文,并获得VPN的标识;所述处理器601还根据所述转发表项、所述第一报文和所述VPN的标识,获得第二报文,所述第二报文为通过所述隧道发送至所述第二转发设备的组播报文;所述处理器601还通过所述通信接口603,发送所述第二报文至所述第二转发设备。Optionally, the processor 601 further receives the first packet from the VPN by using the communication interface 603, and obtains an identifier of the VPN; the processor 601 is further configured to: according to the forwarding entry, the first a packet and the identifier of the VPN, the second packet is obtained, where the second packet is a multicast packet sent to the second forwarding device by using the tunnel; The communication interface 603 sends the second packet to the second forwarding device.
举例说明,所述处理器601可根据对应关系和所述VPN的标识,获得所述VPN对应的偏移量的数值,所述对应关系包括所述VPN的标识和所述偏移量的数值;所述处理器601可根据所述转发表项和所述偏移量的数值,获得第三标签和出接口的标识,所述第三标签为根据所述第一标签和所述偏移量的数值获得的标签,所述出接口用于与所述第二转发设备通信;所述处理器601根据所述出接口的标识,通过所述通信接口603,向所述第二转发设备发送所述第二报文,所述第二报文包括所述第一报文和所述第三标签。For example, the processor 601 may obtain the value of the offset corresponding to the VPN according to the correspondence and the identifier of the VPN, where the correspondence includes the identifier of the VPN and the value of the offset; The processor 601 may obtain, according to the forwarding entry and the value of the offset, an identifier of the third label and the outbound interface, where the third label is according to the first label and the offset a value obtained by the interface, the outbound interface is configured to communicate with the second forwarding device, and the processor 601 sends the identifier to the second forwarding device by using the communication interface 603 according to the identifier of the outgoing interface. a second packet, where the second packet includes the first packet and the third label.
举例说明,本申请实施例的第一转发设备在控制面生成的转发表项可保存在处理器601的内存中。若所述第一转发设备还包括转发芯片,则所述第一转发设备在转发面生成的转发表项,可保存在转发芯片中。若所述第一转发设备不包括转发芯片,则所述第一转发设备在转发面生成的转发表项,可保存在处理器601的内存或存储器602中。For example, the forwarding entry generated by the first forwarding device in the control plane of the embodiment of the present application may be stored in the memory of the processor 601. If the first forwarding device further includes a forwarding chip, the forwarding entry generated by the first forwarding device on the forwarding plane may be stored in the forwarding chip. If the first forwarding device does not include the forwarding chip, the forwarding entry generated by the first forwarding device on the forwarding plane may be stored in the memory or the memory 602 of the processor 601.
图7为本申请实施例提供的第二转发设备的结构示意图。图7所示的第二转发设备可以与图5所示的第二转发设备相同。所述第一转发设备包括处理器701、存储器702和通信接口703。所述处理器701、所述存储器702和所述通信接口703通过通信总线704连接。若图7所示的第二转发设备是网络中的交换机,则所述处理器701可以是NP。若图7所示的第二转发设备是路由器,则所述处理器701可以是CPU。所述存储器702用于存储程序。FIG. 7 is a schematic structural diagram of a second forwarding device according to an embodiment of the present disclosure. The second forwarding device shown in FIG. 7 can be the same as the second forwarding device shown in FIG. 5. The first forwarding device includes a processor 701, a memory 702, and a communication interface 703. The processor 701, the memory 702, and the communication interface 703 are connected by a communication bus 704. If the second forwarding device shown in FIG. 7 is a switch in the network, the processor 701 may be an NP. If the second forwarding device shown in FIG. 7 is a router, the processor 701 may be a CPU. The memory 702 is used to store programs.
处理器701根据从存储器702中读取的程序所包括的可执行指令,执行如下操作。The processor 701 performs the following operations in accordance with executable instructions included in the program read from the memory 702.
所述处理器701通过所述通信接口703,接收第一转发设备发送的请求消息,所述第二转发设备是所述第一转发设备的下游设备,所述请求消息包括标签块的信息和路径的标识,所述标签块的信息用于表示标签块的大小,所述路径的标识用于标识与虚拟专用网VPN对应的隧道。The processor 701 receives the request message sent by the first forwarding device by using the communication interface 703, the second forwarding device is a downstream device of the first forwarding device, and the request message includes information and path of the label block. The identifier of the label block is used to indicate the size of the label block, and the identifier of the path is used to identify a tunnel corresponding to the virtual private network VPN.
所述处理器701根据所述标签块的信息,获得第一标签,所述第一标签是根据所述标签块的信息确定的所述标签块的起始标签。The processor 701 obtains a first label according to the information of the label block, where the first label is a start label of the label block determined according to information of the label block.
所述处理器701通过所述通信接口703,向所述第一转发设备发送响应消息,所述响应消息包括所述第一标签和所述路径的标识。The processor 701 sends a response message to the first forwarding device by using the communication interface 703, where the response message includes the identifier of the first label and the path.
可选地,所述处理器701还根据所述第一标签和所述路径的标识,获得与所述隧道对应的表项,所述表项包括第二标签,所述第二标签为根据所述第一标签和偏移量获得的标签,所述偏移量的数值与VPN对应。Optionally, the processor 701 further obtains, according to the identifier of the first label and the path, an entry corresponding to the tunnel, where the entry includes a second label, where the second label is a The first tag and the offset obtained tag, the value of the offset corresponding to the VPN.
举例说明,所述处理器701根据所述路径的标识,获得组播的标识,所述组播的标识用于标识所述路径所对应的组播转发信息;所述处理器701根据所述第一标签和所述组播的标识,获得所述表项,所述表项包括所述第二标签和所述组播的标识。For example, the processor 701 obtains a multicast identifier according to the identifier of the path, where the identifier of the multicast is used to identify multicast forwarding information corresponding to the path, and the processor 701 is configured according to the foregoing. And obtaining, by the label and the identifier of the multicast, the entry, where the entry includes the second label and the identifier of the multicast.
举例说明,本申请实施例的第一转发设备在控制面生成的转发表项或表项可保存在处理器701的内存中。若所述第一转发设备还包括转发芯片,则所述第一转发设备在转发面 生成的转发表项或表项,可保存在转发芯片中。若所述第一转发设备不包括转发芯片,则所述第一转发设备在转发面生成的转发表项或表项,可保存在处理器701的内存或存储器702中。For example, the forwarding entry or entry generated by the first forwarding device in the control plane of the embodiment of the present application may be stored in the memory of the processor 701. If the first forwarding device further includes a forwarding chip, the first forwarding device is on the forwarding plane. The generated forwarding entry or entry can be saved in the forwarding chip. If the first forwarding device does not include a forwarding chip, the forwarding entry or entry generated by the first forwarding device on the forwarding plane may be stored in the memory or the memory 702 of the processor 701.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质可以是下述介质中的至少一种:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。It can be understood by those skilled in the art that all or part of the steps of implementing the foregoing method embodiments may be performed by hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, and when executed, the program includes The steps of the foregoing method embodiments; and the foregoing storage medium may be at least one of the following: a ROM, a RAM, a magnetic disk, or an optical disk, and the like, which can store program codes.
最后应说明的是:以上实施例仅用以示例性说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请及本申请带来的有益效果进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请权利要求的范围。 Finally, it should be noted that the above embodiments are only used to exemplify the technical solutions of the present application, and are not limited thereto; although the beneficial effects brought by the present application and the present application are described in detail with reference to the foregoing embodiments, the field A person skilled in the art should understand that the technical solutions described in the foregoing embodiments may be modified or equivalently replaced in some of the technical features; and the modifications or substitutions do not deviate from the essence of the corresponding technical solutions. The scope of the claims.

Claims (16)

  1. 一种建立组播隧道的方法,其特征在于,所述方法包括:A method for establishing a multicast tunnel, the method comprising:
    第一转发设备向第二转发设备发送请求消息,所述请求消息包括标签块的信息和路径的标识,所述标签块的信息用于表示标签块的大小,所述路径的标识用于标识所述第一转发设备与所述第二转发设备间与虚拟专用网VPN对应的隧道,所述第一转发设备是所述第二转发设备的上游设备;The first forwarding device sends a request message to the second forwarding device, where the request message includes the information of the label block and the identifier of the path, the information of the label block is used to indicate the size of the label block, and the identifier of the path is used to identify the identifier a tunnel corresponding to the virtual private network VPN between the first forwarding device and the second forwarding device, where the first forwarding device is an upstream device of the second forwarding device;
    所述第一转发设备接收所述第二转发设备发送的响应消息,所述响应消息包括第一标签和所述路径的标识,所述第一标签是根据所述标签块的信息确定的所述标签块的起始标签;Receiving, by the first forwarding device, a response message sent by the second forwarding device, where the response message includes a first label and an identifier of the path, where the first label is determined according to information of the label block. The starting tag of the tag block;
    所述第一转发设备根据所述第一标签和所述路径的标识,获得与所述隧道对应的转发表项。The first forwarding device obtains a forwarding entry corresponding to the tunnel according to the identifier of the first label and the path.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method of claim 1 further comprising:
    所述第一转发设备确定与所述VPN对应的隧道;The first forwarding device determines a tunnel corresponding to the VPN;
    所述第一转发设备根据所述与所述VPN对应的隧道,获得所述标签块的信息,所述标签块的信息由所述隧道对应的VPN的数量所确定。The information of the label block is obtained by the first forwarding device according to the tunnel corresponding to the VPN, and the information of the label block is determined by the number of VPNs corresponding to the tunnel.
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一转发设备根据所述第一标签和所述路径的标识,获得与所述隧道对应的转发表项包括:The method according to claim 1 or 2, wherein the first forwarding device obtains a forwarding entry corresponding to the tunnel according to the identifier of the first label and the path, including:
    所述第一转发设备根据所述路径的标识,获得组播的标识,所述组播的标识用于标识所述路径所对应的组播转发信息;The first forwarding device obtains a multicast identifier according to the identifier of the path, where the identifier of the multicast is used to identify multicast forwarding information corresponding to the path.
    所述第一转发设备根据所述路径的标识,获得出接口的标识,所述出接口为所述第一转发设备上与所述第二转发设备通信的接口;The first forwarding device obtains an identifier of the outbound interface according to the identifier of the path, where the outbound interface is an interface that communicates with the second forwarding device on the first forwarding device;
    所述第一转发设备根据所述第一标签、所述组播的标识和所述出接口的标识,获得所述转发表项,所述转发表项包括第二标签、所述组播的标识和所述出接口的标识,所述第二标签为根据所述第一标签和偏移量获得的标签,所述偏移量的数值与VPN对应。The first forwarding device obtains the forwarding entry according to the first label, the identifier of the multicast, and the identifier of the outbound interface, where the forwarding entry includes a second label, and the identifier of the multicast And an identifier of the outbound interface, where the second label is a label obtained according to the first label and an offset, and the value of the offset corresponds to a VPN.
  4. 根据权利要求1至3任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 3, wherein the method further comprises:
    所述第一转发设备接收来自所述VPN的第一报文,并获得VPN的标识;Receiving, by the first forwarding device, the first packet from the VPN, and obtaining an identifier of the VPN;
    所述第一转发设备根据所述转发表项、所述第一报文和所述VPN的标识,获得第二报文并发送至所述第二转发设备,所述第二报文为通过所述隧道发送至所述第二转发设备的组播报文。The first forwarding device obtains the second packet according to the forwarding entry, the first packet, and the identifier of the VPN, and sends the second packet to the second forwarding device, where the second packet is a The multicast packet sent by the tunnel to the second forwarding device.
  5. 根据权利要求4所述的方法,其特征在于,所述第一转发设备根据所述转发表项、所述第一报文和所述VPN的标识,获得第二报文并发送至所述第二转发设备包括:The method according to claim 4, wherein the first forwarding device obtains a second packet according to the forwarding entry, the first packet, and the identifier of the VPN, and sends the packet to the first The second forwarding device includes:
    所述第一转发设备根据对应关系和所述VPN的标识,获得所述VPN对应的偏移量的数值,所述对应关系包括所述VPN的标识和所述偏移量的数值;The first forwarding device obtains a value of the offset corresponding to the VPN according to the correspondence relationship and the identifier of the VPN, where the correspondence includes the identifier of the VPN and the value of the offset;
    所述第一转发设备根据所述转发表项和所述偏移量的数值,获得第三标签和出接口的标识,所述第三标签为根据所述第一标签和所述偏移量的数值获得的标签,所述出接口用于与所述第二转发设备通信;The first forwarding device obtains an identifier of the third label and the outbound interface according to the forwarding entry and the value of the offset, where the third label is according to the first label and the offset a value obtained label for communicating with the second forwarding device;
    所述第一转发设备根据所述出接口的标识,向所述第二转发设备发送所述第二报文,所述第二报文包括所述第一报文和所述第三标签。The first forwarding device sends the second packet to the second forwarding device according to the identifier of the outbound interface, where the second packet includes the first packet and the third label.
  6. 一种建立组播隧道的方法,其特征在于,所述方法包括:A method for establishing a multicast tunnel, the method comprising:
    第二转发设备接收第一转发设备发送的请求消息,所述第二转发设备是所述第一转发 设备的下游设备,所述请求消息包括标签块的信息和路径的标识,所述标签块的信息用于表示标签块的大小,所述路径的标识用于标识与虚拟专用网VPN对应的隧道;The second forwarding device receives the request message sent by the first forwarding device, where the second forwarding device is the first forwarding device. a downstream device of the device, the request message includes information of a label block and an identifier of a path, where the information of the label block is used to indicate a size of the label block, and the identifier of the path is used to identify a tunnel corresponding to the virtual private network VPN;
    所述第二转发设备根据所述标签块的信息,获得第一标签,所述第一标签是根据所述标签块的信息确定的所述标签块的起始标签;Determining, by the second forwarding device, the first label according to the information of the label block, where the first label is a start label of the label block determined according to the information of the label block;
    所述第二转发设备向所述第一转发设备发送响应消息,所述响应消息包括所述第一标签和所述路径的标识。The second forwarding device sends a response message to the first forwarding device, where the response message includes the identifier of the first label and the path.
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:The method of claim 6 wherein the method further comprises:
    所述第二转发设备根据所述第一标签和所述路径的标识,获得与所述隧道对应的表项,所述表项包括第二标签,所述第二标签为根据所述第一标签和偏移量获得的标签,所述偏移量的数值与VPN对应。The second forwarding device obtains an entry corresponding to the tunnel according to the identifier of the first label and the path, where the entry includes a second label, and the second label is according to the first label And the offset obtained label, the value of the offset corresponding to the VPN.
  8. 根据权利要求7所述的方法,其特征在于,所述第二转发设备根据所述第一标签和所述路径的标识,获得与所述隧道对应的表项包括:The method according to claim 7, wherein the second forwarding device obtains an entry corresponding to the tunnel according to the identifier of the first label and the path, including:
    所述第二转发设备根据所述路径的标识,获得组播的标识,所述组播的标识用于标识所述路径所对应的组播转发信息;The second forwarding device obtains a multicast identifier according to the identifier of the path, where the identifier of the multicast is used to identify multicast forwarding information corresponding to the path.
    所述第二转发设备根据所述第一标签和所述组播的标识,获得所述表项,所述表项包括所述第二标签和所述组播的标识。The second forwarding device obtains the entry according to the first label and the identifier of the multicast, where the entry includes the second label and the identifier of the multicast.
  9. 一种第一转发设备,其特征在于,所述第一转发设备包括:A first forwarding device, where the first forwarding device includes:
    第一发送单元,用于向第二转发设备发送请求消息,所述请求消息包括标签块的信息和路径的标识,所述标签块的信息用于表示标签块的大小,所述路径的标识用于标识所述第一转发设备与所述第二转发设备间与虚拟专用网VPN对应的隧道,所述第一转发设备是所述第二转发设备的上游设备;a first sending unit, configured to send a request message to the second forwarding device, where the request message includes the information of the label block and the identifier of the path, where the information of the label block is used to indicate the size of the label block, and the identifier of the path is used by And identifying, by the first forwarding device, the tunnel corresponding to the virtual private network VPN, the first forwarding device is an upstream device of the second forwarding device;
    第一接收单元,用于接收所述第二转发设备发送的响应消息,所述响应消息包括第一标签和所述路径的标识,所述第一标签是根据所述标签块的信息确定的所述标签块的起始标签;a first receiving unit, configured to receive a response message sent by the second forwarding device, where the response message includes a first label and an identifier of the path, where the first label is determined according to information of the label block The starting label of the label block;
    第一获得单元,用于根据所述第一标签和所述路径的标识,获得与所述隧道对应的转发表项。And a first obtaining unit, configured to obtain, according to the identifier of the first label and the path, a forwarding entry corresponding to the tunnel.
  10. 根据权利要求9所述的第一转发设备,其特征在于,所述第一转发设备还包括:The first forwarding device according to claim 9, wherein the first forwarding device further comprises:
    确定单元,用于确定与所述VPN对应的隧道;a determining unit, configured to determine a tunnel corresponding to the VPN;
    第二获得单元,用于根据所述与所述VPN对应的隧道,获得所述标签块的信息,所述标签块的信息由所述隧道对应的VPN的数量所确定。And a second obtaining unit, configured to obtain information about the label block according to the tunnel corresponding to the VPN, where information of the label block is determined by a number of VPNs corresponding to the tunnel.
  11. 根据权利要求9或10所述的第一转发设备,其特征在于,所述第一获得单元具体用于:The first forwarding device according to claim 9 or 10, wherein the first obtaining unit is specifically configured to:
    根据所述路径的标识,获得组播的标识,所述组播的标识用于标识所述路径所对应的组播转发信息;Obtaining, according to the identifier of the path, an identifier of the multicast, where the identifier of the multicast is used to identify multicast forwarding information corresponding to the path;
    根据所述路径的标识,获得出接口的标识,所述出接口为所述第一转发设备上与所述第二转发设备通信的接口;Obtaining an identifier of the outbound interface according to the identifier of the path, where the outbound interface is an interface that communicates with the second forwarding device on the first forwarding device;
    根据所述第一标签、所述组播的标识和所述出接口的标识,获得所述转发表项,所述转发表项包括第二标签、所述组播的标识和所述出接口的标识,所述第二标签为根据所述第一标签和偏移量获得的标签,所述偏移量的数值与VPN对应。Obtaining, according to the first label, the identifier of the multicast, and the identifier of the outbound interface, the forwarding entry, where the forwarding entry includes a second label, the identifier of the multicast, and the outbound interface And identifying, the second tag is a tag obtained according to the first tag and an offset, and the value of the offset corresponds to a VPN.
  12. 根据权利要求9至11任一项所述的第一转发设备,其特征在于,所述第一转发设 备还包括:The first forwarding device according to any one of claims 9 to 11, wherein the first forwarding device Also included are:
    第二接收单元,用于接收来自所述VPN的第一报文,并获得VPN的标识;a second receiving unit, configured to receive a first packet from the VPN, and obtain an identifier of the VPN;
    第三获得单元,用于根据所述转发表项、所述第一报文和所述VPN的标识,获得第二报文,所述第二报文为通过所述隧道发送至所述第二转发设备的组播报文;a third obtaining unit, configured to obtain a second packet according to the forwarding entry, the first packet, and the identifier of the VPN, where the second packet is sent to the second by using the tunnel Forwarding multicast packets of the device;
    第二发送单元,用于发送所述第二报文至所述第二转发设备。The second sending unit is configured to send the second packet to the second forwarding device.
  13. 根据权利要求12所述的方法,其特征在于,所述第三获得单元具体用于:The method according to claim 12, wherein the third obtaining unit is specifically configured to:
    根据对应关系和所述VPN的标识,获得所述VPN对应的偏移量的数值,所述对应关系包括所述VPN的标识和所述偏移量的数值;And obtaining, according to the correspondence relationship and the identifier of the VPN, a value of the offset corresponding to the VPN, where the correspondence includes the identifier of the VPN and a value of the offset;
    根据所述转发表项和所述偏移量的数值,获得第三标签和出接口的标识,所述第三标签为根据所述第一标签和所述偏移量的数值获得的标签,所述出接口用于与所述第二转发设备通信;Obtaining, according to the forwarding entry and the value of the offset, an identifier of the third label and the outbound interface, where the third label is a label obtained according to the first label and the value of the offset, Declaring an interface for communicating with the second forwarding device;
    所述第二发送单元具体用于根据所述出接口的标识,向所述第二转发设备发送所述第二报文,所述第二报文包括所述第一报文和所述第三标签。The second sending unit is configured to send the second packet to the second forwarding device according to the identifier of the outbound interface, where the second packet includes the first packet and the third packet label.
  14. 一种第二转发设备,其特征在于,所述第二转发设备包括:A second forwarding device, where the second forwarding device includes:
    接收单元,用于接收第一转发设备发送的请求消息,所述第二转发设备是所述第一转发设备的下游设备,所述请求消息包括标签块的信息和路径的标识,所述标签块的信息用于表示标签块的大小,所述路径的标识用于标识与虚拟专用网VPN对应的隧道;a receiving unit, configured to receive a request message sent by the first forwarding device, where the second forwarding device is a downstream device of the first forwarding device, where the request message includes information of a label block and an identifier of a path, where the label block The information is used to indicate the size of the label block, and the identifier of the path is used to identify a tunnel corresponding to the virtual private network VPN;
    第一获得单元,用于根据所述标签块的信息,获得第一标签,所述第一标签是根据所述标签块的信息确定的所述标签块的起始标签;a first obtaining unit, configured to obtain, according to information of the label block, a first label, where the first label is a starting label of the label block determined according to information of the label block;
    发送单元,用于向所述第一转发设备发送响应消息,所述响应消息包括所述第一标签和所述路径的标识。And a sending unit, configured to send a response message to the first forwarding device, where the response message includes the identifier of the first label and the path.
  15. 根据权利要求14所述的第二转发设备,其特征在于,所述第二转发设备还包括:The second forwarding device according to claim 14, wherein the second forwarding device further comprises:
    第二获得单元,用于根据所述第一标签和所述路径的标识,获得与所述隧道对应的表项,所述表项包括第二标签,所述第二标签为根据所述第一标签和偏移量获得的标签,所述偏移量的数值与VPN对应。a second obtaining unit, configured to obtain, according to the identifier of the first label and the path, an entry corresponding to the tunnel, where the entry includes a second label, and the second label is according to the first The label obtained from the tag and the offset, the value of the offset corresponding to the VPN.
  16. 根据权利要求15所述的第二转发设备,其特征在于,所述第二获得单元具体用于:The second forwarding device according to claim 15, wherein the second obtaining unit is specifically configured to:
    根据所述路径的标识,获得组播的标识,所述组播的标识用于标识所述路径所对应的组播转发信息;Obtaining, according to the identifier of the path, an identifier of the multicast, where the identifier of the multicast is used to identify multicast forwarding information corresponding to the path;
    根据所述第一标签和所述组播的标识,获得所述表项,所述表项包括所述第二标签和所述组播的标识。 Obtaining the entry according to the first label and the identifier of the multicast, where the entry includes the second label and the identifier of the multicast.
PCT/CN2017/088633 2016-07-12 2017-06-16 Method and apparatus for establishing multicast tunnel WO2018010519A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610546280.5A CN106209559B (en) 2016-07-12 2016-07-12 A kind of method and apparatus for establishing Multicast Tunnel
CN201610546280.5 2016-07-12

Publications (1)

Publication Number Publication Date
WO2018010519A1 true WO2018010519A1 (en) 2018-01-18

Family

ID=57477873

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/088633 WO2018010519A1 (en) 2016-07-12 2017-06-16 Method and apparatus for establishing multicast tunnel

Country Status (2)

Country Link
CN (1) CN106209559B (en)
WO (1) WO2018010519A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108337148B (en) * 2018-02-07 2019-10-18 北京百度网讯科技有限公司 For obtaining the method and device of information
CN110224935B (en) 2018-03-02 2020-10-23 华为技术有限公司 Method and device for processing multicast data message
US10587937B2 (en) * 2018-04-09 2020-03-10 Futurewei Technologies, Inc. Packet and optical integration
CN111526079B (en) * 2020-03-31 2023-10-13 新华三技术有限公司 Method and device for establishing tunnel

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006002598A1 (en) * 2004-06-30 2006-01-12 Huawei Technologies Co., Ltd. A vpn system of a hybrid-site hybrid backbone network and an implementing method thereof
US7848335B1 (en) * 2005-10-27 2010-12-07 Juniper Networks, Inc. Automatic connected virtual private network
CN102938734A (en) * 2012-11-26 2013-02-20 杭州华三通信技术有限公司 Tunnel selection method and PE (Provider Edge) in MPLS (Multiprotocol Label Switching) network
WO2013154813A1 (en) * 2012-04-13 2013-10-17 Nicira, Inc. Extension of logical networks across layer 3 virtual private networks
US9100213B1 (en) * 2011-06-08 2015-08-04 Juniper Networks, Inc. Synchronizing VPLS gateway MAC addresses
CN105515992A (en) * 2014-09-26 2016-04-20 杭州华三通信技术有限公司 Method and device for processing flow table items of VXLAN network

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4192446B2 (en) * 2001-06-29 2008-12-10 株式会社日立製作所 Communication service transaction method and communication system
CN103269315B (en) * 2013-04-27 2016-03-30 华为技术有限公司 Label distribution method, device, System and Network equipment
KR20140134998A (en) * 2013-05-15 2014-11-25 삼성전자주식회사 Method and apparatus for enhanceing voice service performance in communication system
CN104954265B (en) * 2014-03-25 2018-06-15 华为技术有限公司 Send the method and interchanger of multicast message
CN104780090B (en) * 2015-04-27 2018-10-26 新华三技术有限公司 Method, apparatus, the PE equipment of VPN multicast transmissions

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006002598A1 (en) * 2004-06-30 2006-01-12 Huawei Technologies Co., Ltd. A vpn system of a hybrid-site hybrid backbone network and an implementing method thereof
US7848335B1 (en) * 2005-10-27 2010-12-07 Juniper Networks, Inc. Automatic connected virtual private network
US9100213B1 (en) * 2011-06-08 2015-08-04 Juniper Networks, Inc. Synchronizing VPLS gateway MAC addresses
WO2013154813A1 (en) * 2012-04-13 2013-10-17 Nicira, Inc. Extension of logical networks across layer 3 virtual private networks
CN102938734A (en) * 2012-11-26 2013-02-20 杭州华三通信技术有限公司 Tunnel selection method and PE (Provider Edge) in MPLS (Multiprotocol Label Switching) network
CN105515992A (en) * 2014-09-26 2016-04-20 杭州华三通信技术有限公司 Method and device for processing flow table items of VXLAN network

Also Published As

Publication number Publication date
CN106209559B (en) 2019-05-07
CN106209559A (en) 2016-12-07

Similar Documents

Publication Publication Date Title
EP3624408B1 (en) Method for generating forwarding table entry, controller, and network device
EP3863245A1 (en) Supporting multicast communications
Aggarwal et al. BGP encodings and procedures for multicast in MPLS/BGP IP VPNs
EP2945330B1 (en) Route management method, route method, network controller and router
WO2015165311A1 (en) Method for transmitting data packet and provider edge device
CN107026796B (en) VPN route notification method, data flow forwarding method and related equipment
WO2018010519A1 (en) Method and apparatus for establishing multicast tunnel
US11381883B2 (en) Dynamic designated forwarder election per multicast stream for EVPN all-active homing
EP2991284B1 (en) Method and device used in ethernet virtual private network
WO2017124709A1 (en) Method of establishing traffic engineering tunnel and device
WO2015192501A1 (en) Address information publishing method and apparatus
WO2014194711A1 (en) Packet processing method, device label processing method, and device
WO2013182061A1 (en) Network label distribution method, device and system
WO2020108587A1 (en) Data processing method, controller and forwarding device
WO2009015594A1 (en) A method, system and device for configuring the operations, administrator and maintenance property
WO2013139270A1 (en) Method, device, and system for implementing layer3 virtual private network
US11296997B2 (en) SDN-based VPN traffic scheduling method and SDN-based VPN traffic scheduling system
US10225091B2 (en) Method for implementing point-to-multipoint multicast, network node, and system
US20140241351A1 (en) Dynamic determination of the root node of an mldp tunnel
WO2019205836A1 (en) Data packet forwarding method and apparatus
US10193800B2 (en) Service label routing in a network
WO2017080440A1 (en) Routing table updating method, evpn control device, and evpn system
WO2013159694A1 (en) Label distribution method, device and system
WO2011147341A1 (en) Method and network device for distributing multi-protocol label switching labels
CN106230730B (en) Multicast transmission method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17826857

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17826857

Country of ref document: EP

Kind code of ref document: A1