Abstract:
A method, a system, and an apparatus for implementing a layer-2 virtual private network (L2VPN) between autonomous systems (ASs) are disclosed. The method includes: receiving a first L2VPN mapping packet from a first AS; parsing the first L2VPN mapping packet to obtain a first label carried in the first L2VPN mapping packet, applying for a second label which is different from the first label carried in the first L2VPN mapping packet, and generating a second L2VPN mapping packet according to the second label; and sending the second L2VPN mapping packet to a second AS. When multiple VPN users need to establish a multi-protocol label switching (MPLS) L2VPN between ASs, the MPLS L2VPN can be established between ASs through the technical solution under the present invention as long as a link exists between the ASs, thus providing high extensibility, high security, and convenient management of the inter-AS L2VPN.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    This application is a continuation of International Application No. PCT/CN2009/071284, filed on Apr. 15, 2009, which claims priority to Chinese Patent Application No. 200810097220.5, filed on May 6, 2008, both of which are hereby incorporated by reference in their entireties. 
     
    
     FIELD OF THE INVENTION 
       [0002]    The present invention relates to communication technologies, and in particular, to a method, a system, and an apparatus for implementing a Layer 2 virtual private network (L2VPN) between autonomous systems. 
       BACKGROUND OF THE INVENTION 
       [0003]    A virtual private network (VPN) is a virtual private communication network set up by an Internet service provider (ISP) or a network service provider (NSP) on a public network. A multi-protocol label switching (MPLS) L2VPN provides L2VPN services based on an MPLS network so that a service provider (SP) can deploy L2VPN services on an MPLS network. 
         [0004]    As shown in  FIG. 1 , a basic model of the MPLS L2VPN includes: a provider edge routing device (PE), a customer edge routing device (CE), an attachment circuit (AC), a packet switched network (PSN) tunnel, and a pseudo wire (PW). The AC is a logical link between the CE and the PE. The PW is an encapsulated bearer channel on the PE, set up by a signaling protocol, and identified by a virtual circuit (VC) identifier and a VC type. 
         [0005]    In actual network applications, multiple devices of one VPN user may connect to the VPN from different autonomous systems (ASs) in different cities, and the ASs may belong to a single SP or different SPs. The VPN interconnecting different ASs needs to adopt an inter-AS VPN solution. 
         [0006]    Three solutions are currently available for implementing a MPLS VPN between ASs: Option A, Option B, and Option C, respectively. In Option A, sub-interfaces are used between different ASs. However, only a limited number of sub-interfaces can be supported by an autonomous system boundary router (ASBR), and, therefore, Option A is not well extensible. In Option B, MPLS forwarding is applied between different ASs, and the ASBR does not need to support the sub-interfaces. Therefore, Option B is more extensible than Option A. Option C is seldom used due to the reasons such as management inconvenience and lack of security. 
         [0007]    MPLS L2VPNs can be classified into two types: point-to-point VPN and point-to-multipoint VPN. Currently, label distribution protocol (LDP) is used as a signaling protocol to transmit layer-2 information and VC labels. With the LDP, only Option A and Option C can be used to implement the VPN between ASs. 
         [0008]    It is assumed that CE 1  and CE 2  belong to users of a first local VPN (VPN 1 ), and that CE 3  and CE 4  belong to users of a second local VPN (VPN 2 ). If Option A is adopted to implement the MPLS VPN between ASs, an interface (generally, a sub-interface) on the ASBR needs to be allocated to each of a user of the VPN 1  and a user of the VPN 2 , and the intra-AS PW is extended only to these sub-interfaces. L2VPN mapping packets and VC labels are forwarded between different ASBRs according to the sub-interfaces. 
         [0009]    Option A has the following drawbacks: a sub-interface on the ASBR needs to be allocated to each VPN user. Because some interfaces do not support sub-interfaces, and the number of sub-interfaces that can be supported by an interface is limited, it is not convenient to add users massively, and thus the network is not well extensible. Moreover, too many sub-interfaces lead to management difficulties and slow startup of devices. 
         [0010]    It is still assumed that CE 1  and CE 2  belong to users of the VPN 1 , and that CE 3  and CE 4  belong to users of the VPN 2 . If Option C is adopted to implement the MPLS VPN between ASs, a first AS (AS 1 ) needs to learn the route in a second AS (AS 2 ) and set up a tunnel to the AS 2 ; and AS 2  needs to learn the route in the AS 1  and set up a tunnel to the AS 1  as well. 
         [0011]    Option C has the following drawbacks: 
         [0012]    (1) An AS needs to learn the route in other ASs and set up a tunnel to other ASs, and the user needs to take the problems of management inconvenience and lack of security into consideration. 
         [0013]    (2) More tunnels need to be set up in an AS. In addition to the tunnels set up according to the route in this AS, more tunnels need to be set up according to the route in other ASs. 
         [0014]    (3) Users hardly accept the Option C due to management inconvenience and lack of security. 
         [0015]    It is found that some SPs hope to use Option B to implement the MPLS L2VPN between ASs. However, current art does not have implementation plans that support Option B in MPLS L2VPN. 
       SUMMARY OF THE INVENTION 
       [0016]    The embodiments of the present invention provide a method, a system, and an apparatus for implementing L2VPN between ASs, and this method uses Option B to implement LDP-based MPLS L2VPN between ASs. 
         [0017]    An embodiment of the present invention provides a method for implementing a L2VPN between ASs. The method includes:
       receiving a first L2VPN mapping packet from a first AS;   parsing the first L2VPN mapping packet to obtain a first label carried in the first L2VPN mapping packet,   applying for a second label which is different from the first label carried in the first L2VPN mapping packet,   generating a second L2VPN mapping packet according to the second label; and   sending the second L2VPN mapping packet to a second AS.       
 
         [0023]    The embodiment of the present invention also provides a system for implementing the L2VPN between ASs. The system includes:
       a first provider edge routing device (PE), configured to send a first L2VPN mapping packet;   a first ASBR, configured to receive and parse the first L2VPN mapping packet sent by the first PE, obtain a first label carried in the first L2VPN mapping packet, apply for a second label which is different from the first label carried in the first L2VPN mapping packet, generate a second L2VPN mapping packet according to the second label, and send the second L2VPN mapping packet, wherein the first PE and the first ASBR belong to a first AS;   a second ASBR, configured to receive and parse the second L2VPN mapping packet sent by the first ASBR, obtain the second label carried in the second L2VPN mapping packet, apply for a third label which is different from the second label carried in the second L2VPN mapping packet, generate a third L2VPN mapping packet according to the third label, and send the third L2VPN mapping packet, wherein the second ASBR belongs to a second AS; and   a second PE, configured to receive and parse the third L2VPN mapping packet sent by the second ASBR, obtain information of the third label, a VC identifier and a type carried in the third L2VPN mapping packet, and establish an L2VPN according to the information of the third label, the VC identifier and the type carried in the third L2VPN mapping packet, wherein the second PE and the second ASBR belong to the second AS.       
 
         [0028]    The embodiment of the present invention further provides an ASBR. The ASBR includes:
       a receiving module, configured to receive a first L2VPN mapping packet;   a parsing module, configured to parse the first L2VPN mapping packet received by the receiving module, and obtain a first label carried in the mapping packet;   a label applying module, configured to apply for a second label which is different from the first label obtained by the parsing module;   a packet generating module, configured to generate a second L2VPN mapping packet according to the second label applied for by the label applying module; and   a sending module, configured to send the second L2VPN mapping packet generated by the packet generating module.       
 
         [0034]    The embodiment of the present invention also provides a PE. The PE includes:
       a receiving module, configured to receive an L2VPN mapping packet sent by an ASBR;   a parsing module, configured to parse the L2VPN mapping packet received by the receiving module, and obtain information of a third label, a VC identifier and a type carried in the L2VPN mapping packet; and   a L2VPN establishing module, configured to establish an L2VPN according to the information of the third label, the VC identifier and the type carried in the L2VPN mapping packet obtained by the parsing module.       
 
         [0038]    Compared with the prior art, the embodiments of the present invention provide the following benefits: The ASBR receives and parses the L2VPN mapping packet from the first AS, obtains the first label carried in the mapping packet, applies for a second label which is different from the first label carried in the mapping packet, generates a second L2VPN mapping packet according to the second label, and sends the second L2VPN mapping packet to a second AS. Through the technical solutions provided by the present invention, when multiple VPN users need to establish MPLS L2VPN between ASs, if a link exists between the ASs, the MPLS L2VPN can be established between ASs, without the need of learning the routes in other ASs or establishing a tunnel according to the routes in other ASs. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0039]      FIG. 1  shows a basic model of a MPLS L2VPN according to the prior art; 
           [0040]      FIG. 2  is a flowchart of a method for implementing L2VPN between ASs, according to an embodiment of the invention; 
           [0041]      FIG. 3  is a signaling flowchart of a method for implementing L2VPN between ASs, according to an embodiment of the invention; 
           [0042]      FIG. 4  shows a networking structure according to an embodiment of the invention; 
           [0043]      FIG. 5  is a signaling flowchart of a method for implementing L2VPN between ASs, according to another embodiment of the invention; 
           [0044]      FIG. 6  shows a networking structure according to another embodiment of the invention; 
           [0045]      FIG. 7  shows a structure of a system for implementing L2VPN between ASs, according to an embodiment of the invention; 
           [0046]      FIG. 8  shows a structure of an ASBR according to an embodiment of the invention; 
           [0047]      FIG. 9  shows a structure of a PE according to an embodiment of the invention; and 
           [0048]      FIG. 10  shows a structure of a PE according to another embodiment of the invention. 
       
    
    
     DETAILED DESCRIPTION OF THE EMBODIMENTS 
       [0049]    The embodiments of the present invention provide a method for implementing L2VPN between ASs, and this method uses Option B to implement LDP-based MPLS L2VPN between ASs. The present invention is detailed below with references to accompanying drawings and exemplary embodiments. 
         [0050]      FIG. 2  is a flowchart of a method for implementing L2VPN between ASs according to an embodiment of the present invention. The method includes: 
         [0051]      201 : Receiving a first L2VPN mapping packet. Before receiving the first L2VPN mapping report, a first ASBR establishes an LDP remote session with a second ASBR, and establishes a LDP remote session with a first PE in a first AS that covers the first ASBR. The first ASBR and the second ASBR belong to different SPs. 
         [0052]      202 : Parsing the first L2VPN mapping packet to obtain a first label carried in the first L2VPN mapping packet, applying for a second label which is different from the first label carried in the first L2VPN mapping packet, and generating a second L2VPN mapping packet according to the second label. 
         [0053]      203 : Sending the second L2VPN mapping packet, and recording label switching information. 
         [0054]    After receiving the first L2VPN mapping packet sent by the first PE in the first AS that covers the first ASBR, the first ASBR sends the generated second L2VPN mapping packet to the second ASBR. The first ASBR and the second ASBR belong to different SPs. In this case, after the label switching information is recorded, the first ASBR uses the second label as an ingress label, and uses the first label carried in the first L2VPN mapping packet and a public network label switching path (LSP) as an egress label to generate MPLS forwarding entries. 
         [0055]    Alternatively, after receiving the first L2VPN mapping packet sent by the second ASBR, the first ASBR sends the generated second L2VPN mapping packet to the first PE which is in a remote session with the first ASBR. In this case, after the label switching information is recorded, the first ASBR uses the second label as an ingress label and uses the first label carried in the first L2VPN mapping packet as an egress label to generate MPLS forwarding entries. 
         [0056]    After the generated second L2VPN mapping packet is sent to the first PE which is in a remote session with the first ASBR, the first PE parses the second L2VPN mapping packet to obtain information of the second label a VC identifier and a type carried in the second L2VPN mapping packet; and establishes an L2VPN according to information of the second label the VC identifier and the type carried in the second L2VPN mapping packet. An example is given below. 
         [0057]    In a point-to-point VPN scenario, after the first PE determines that an identical VC identifier and type exist in the first PE according to the information of the VC identifier and the type, the first PE obtains the IP address of the first ASBR according to the remote session between the first PE and the first ASBR, searches for the public network LSP according to the IP address of the first ASBR, and generates MPLS forwarding entries. The MPLS forwarding entries use the ingress label of a VPN user corresponding to the information of the VC identifier and the type as an index, and use the label carried in the second L2VPN mapping packet and the public network LSP as an egress label. 
         [0058]    In a point-to-multipoint VPN scenario, after the first PE, according to information of the VC identifier and the type, determines that an identical VC identifier and an identical VC type exist in the first PE, it obtains the IP address of the first ASBR according to the established remote session between the first PE and the first ASBR, searches for the public network LSP according to the IP address of the first ASBR, and generates MPLS forwarding entries with media access control (MAC). The MPLS forwarding entries use a destination MAC address as an index and use the label carried in the second L2VPN mapping packet and the public network LSP as an egress label. 
         [0059]      FIG. 3  is a signaling flowchart of a method for implementing L2VPN between ASs in a first embodiment of the present invention. The first embodiment deals with the method for establishing MPLS L2VPN between ASs in a point-to-point VPN scenario.  FIG. 4  shows a networking structure of the first embodiment of the present invention. As shown in  FIG. 4 , a CE 1  and a CE 2  need to form a VPN 1 , and a CE 3  and a CE 4  need to form a VPN 2 . The first embodiment showcases that a MPLS L2VPN is established between the CE 1  and the CE 2 . The method includes: 
         [0060]      301 : A LDP remote session is established between the PE 1  and the ASBR 1 , a LDP remote session is established between the ASBR 1  and the ASBR 2 , and a LDP remote session is established between the ASBR 2  and the PE 2 , respectively. 
         [0061]      302 : After configuring the L2VPN, the PE 1  sends a first L2VPN mapping packet to the ASBR 1 . The first L2VPN mapping packet carries the information such as a VC identifier, a type, and a label L 1 , etc. 
         [0062]      303 : After receiving the first L2VPN mapping packet, the ASBR 1  parses the packet to obtain the label L 1 , obtains the IP address of the PE 1  according to the remote session, searches out the public network LSP, applies for a new label L 2 , and generates MPLS forwarding entries by using the label L 2  as an ingress label and using the label L 1  and the public network LSP as an egress label, and, at the same time, re-encapsulates the information such as label L 2 , the VC identifier and the type into a second L2VPN mapping packet which is then sent to the ASBR 2 . 
         [0063]      304 : After receiving the second L2VPN mapping packet, the ASBR 2  parses the second L2VPN mapping packet to obtain the label L 2 , applies for a new label L 3 , and generates MPLS forwarding entries by using the label L 3  as an ingress label and using the label L 2  as an egress label, and, at the same time, re-encapsulates the information such as the label L 3 , the VC identifier and the type into a third L2VPN mapping packet which is then sent to the PE 2 . 
         [0064]    Step  305 : After receiving the third L2VPN mapping packet, the PE 2  parses the third L2VPN mapping packet to obtain the information such as the label L 3 , the VC identifier and the type. Afterwards, according to the VC identifier and type, the PE 2  judges whether an identical VC identifier and an identical VC type exist in the PE 2 . If an identical VC identifier and an identical VC type exist in the PE 2 , the PE 2  obtains the IP address of the ASBR 2  according to the remote session, searches out the public network LSP according to the IP address of the ASBR 2 , and generates MPLS forwarding entries by using the ingress label of local users as an index and using the label L 3  and the public network LSP as an egress label. In this way, a PW is established between the PE 2  and the PE 1  successfully. The PE 2  transmits the traffic of the CE 2  to the PE 1  transparently through the PW, and then the PE 1  sends the traffic to the CE 1 . 
         [0065]    In the reverse direction, the PW between the PE 1  and the PE 2  is established in the same way. 
         [0066]    A VPN 2  user may also use the foregoing method to establish two PWs between the PE 3  and the PE 4 . The VPN 1  user and the VPN 2  user share a link between the ASBR 1  and the ASBR 2 , but the label of the VPN 1  user is different from the label of the VPN 2  user. 
         [0067]      FIG. 5  is a signaling flowchart of a method for implementing L2VPN between ASs in a second embodiment of the present invention. The second embodiment deals with the method for establishing a MPLS L2VPN between ASs in a point-to-multipoint VPN scenario.  FIG. 6  shows a networking structure of the second embodiment of the invention. As shown in  FIG. 6 , CE 1 , CE 2  and CE 3  belong to the same VPN; CE 1  and CE 3  access AS 1 ; CE 2  accesses AS 2 ; and an MPLS L2VPN is established between the AS 1  and the AS 2 . The establishing process includes: 
         [0068]      501 : LDP remote sessions are established between the ASBR 1  and the PE 1 , PE 3 , respectively, an LDP remote session is established between the ASBR 1  and the ASBR 2 , and an LDP remote session is established between the ASBR 2  and the PE 2 . 
         [0069]      502 : After configuring the L2VPN, the PE 1  sends a first L2VPN mapping packet to the ASBR 1 . The first L2VPN mapping packet carries the information such as a VC identifier, a type, a label L 1 , and so on. 
         [0070]      503 : After configuring the L2VPN, the PE 3  sends a second L2VPN mapping packet to the ASBR 1 . The second L2VPN mapping packet carries the information such as a VC identifier, a type, a label L 2 , and so on. Because the PE 1  and the PE 3  belong to the same VPN, the VC identifier and the VC type of PE 3  are identical to the VC identifier and the VC type of the PE 1 , but the label of the PE 3  may be different from the label of the PE 1 . 
         [0071]      504 : After receiving the first L2VPN mapping packet and the second L2VPN mapping packet, the ASBR 1  parses the packets to obtain the labels L 1  and L 2 , obtains the IP addresses of the PE 1  and the PE 3  according to the remote session, searches out the public network LSP, applies for a new label L 3  (corresponding to the VPN from the PE 1 ) and a new label L 4  (corresponding to the VPN from the PE 3 ), and generates MPLS forwarding entries to the PE 1  and the PE 3 , respectively, by using the label L 3 /L 4  as an ingress label and, using the label L 1 /L 2  and the public network LSP as an egress label, and, at the same time, re-encapsulates the information such as the label L 3 /L 4 , the VC identifier, the type and so on into a third L2VPN mapping packet which is then sent to the ASBR 2 . 
         [0072]      505 : After receiving the third L2VPN mapping packet, the ASBR 2  parses the third L2VPN mapping packet to obtain the label L 3 /L 4 , applies for a new label L 5 /L 6 , and generates MPLS forwarding entries by using the L 5 /L 6  as an ingress label and using the L 3 /L 4  as an egress label, and at the same time, re-encapsulates the information such as the label L 5 /L 6 , the VC identifier, the type and so on into a fourth L2VPN mapping packet which is then sent to the PE 2 . If a remote session is already established between the ASBR 2  and other PEs in the AS, it is necessary to send the fourth L2VPN mapping packet to such PEs. 
         [0073]      506 : After receiving the fourth L2VPN mapping packet, the PE 2  parses the fourth L2VPN mapping packet to obtain the information such as the label L 5 /L 6 , the VC identifier the type and so on. Afterward, according to the VC identifier and the VC type, the PE 2  judges whether an identical VC identifier and an identical VC type exist in the PE 2 . If an identical VC identifier and an identical VC type exist in the PE 2 , the PE 2  obtains the IP address of the ASBR 2  according to the remote session, searches out the public network LSP according to the IP address of the ASBR 2 , and generates MPLS forwarding entries through MAC learning. The MPLS forwarding entries use the destination MAC address as an index and use the label L 5 /L 6  and the public network LSP as an egress label. 
         [0074]    In this way, a PW is established between the PE 2  and the PE 1 /PE 3  successfully. The PE 2  transmits the traffic of the CE 2  to the PE 1  or the PE 3  transparently through the PW which is selected according to whether the destination MAC address is CE 1  or CE 3 . More specifically, the traffic from the CE 2  to the PE 1  is transmitted through the PW corresponding to the L 5 , and the traffic from the CE 2  to the CE 3  is transmitted through the PW corresponding to the L 6 . Afterward, the PE 1  sends the traffic to the CE 1 , or the PE 3  sends the traffic to the CE 3 . 
         [0075]    In the reverse direction, the PW between the PE 1 /PE 3  and the PE 2  is established in the same way. 
         [0076]    In the foregoing method for implementing L2VPN between ASs, when multiple VPN users need to establish MPLS L2VPN between ASs, as long as a link exists between the ASs, the MPLS L2VPN can be established between the ASs, without the need of learning the route in other ASs or setting up a tunnel according to the route in other ASs. The extensibility bottleneck involved in the existing Option A that requires multiple links or multiple sub-interfaces is overcome. Moreover, the management is more convenient, and the security is higher, thus avoiding the security and management problems in Option C. 
         [0077]      FIG. 7  shows a structure of a system for implementing L2VPN between ASs according to an embodiment of the present invention. The system includes: 
         [0078]    a first PE  71 , configured to send a first L2VPN mapping packet; 
         [0079]    a first ASBR  72 , configured to: receive and parse the first L2VPN mapping packet sent by the first PE  71 , obtain a first label carried in the first L2VPN mapping packet, apply for a second label which is different from the first label carried in the first L2VPN mapping packet, generate a second L2VPN mapping packet according to the second label, send the second L2VPN mapping packet, and record label switching information, wherein the first PE  71  and the first ASBR  72  belong to the same AS; 
         [0080]    a second ASBR  73 , configured to: receive and parse the second L2VPN mapping packet sent by the first ASBR  72 , obtain the second label carried in the second L2VPN mapping packet, apply for a third label which is different from the second label carried in the second L2VPN mapping packet, generate a third L2VPN mapping packet according to the third label, send the third L2VPN mapping packet, and record the label switching information; and 
         [0081]    a second PE  74 , configured to: receive and parse the third L2VPN mapping packet sent by the second ASBR  73 , obtain the information of the third label, a VC identifier and a type carried in the third L2VPN mapping packet, and establish an L2VPN according to the information of the third label, the VC identifier and the type carried in the third L2VPN mapping packet. 
         [0082]    When using the foregoing system for implementing L2VPN between ASs, the first PE  71  sends the first L2VPN mapping packet to the first ASBR  72 , the first ASBR  72  belonging to the same AS which the first PE  71  is located in. After receiving the first L2VPN mapping packet sent by the first PE  71 , the first ASBR  72  parses the first L2VPN mapping packet to obtain the first label carried in the first L2VPN mapping packet, applies for a second label which is different from the first label carried in the first L2VPN mapping packet, generates a second L2VPN mapping packet according to the second label, sends the second L2VPN mapping packet to the second ASBR  73 , and records label switching information. The details of recording the label switching information may be: using the second label as an ingress label and using the first label carried in the first L2VPN mapping packet and the public network LSP as an egress label to generate MPLS forwarding entries. 
         [0083]    After receiving the second L2VPN mapping packet sent by the first ASBR  72 , the second ASBR  73  parses the second L2VPN mapping packet to obtain the second label carried in the second L2VPN mapping packet, applies for a third label which is different from the second label carried in the second L2VPN mapping packet, generates a third L2VPN mapping packet according to the third label, sends the third L2VPN mapping packet to the second PE  74  which is in a remote session with the second ASBR  73 , and records the label switching information. In this case, the details of recording the label switching information may be: using the third label as an ingress label and using the second label carried in the second L2VPN mapping packet as an egress label to generate MPLS forwarding entries. 
         [0084]    After receiving the third L2VPN mapping packet sent by the second ASBR  73 , the second PE  74  parses the third L2VPN mapping packet to obtain the information of the third label, the VC identifier and the type carried in the third L2VPN mapping packet, and establishes an L2VPN according to the information of the third label, the VC identifier and the type carried in the third L2VPN mapping packet. 
         [0085]      FIG. 8  shows a structure of an ASBR in an embodiment of the present invention. The ASBR includes: 
         [0086]    a receiving module  81 , configured to receive a first L2VPN mapping packet; 
         [0087]    a parsing module  82 , configured to parse the first L2VPN mapping packet received by the receiving module  81 , and obtain a first label carried in the first L2VPN mapping packet; 
         [0088]    a label applying module  83 , configured to apply for a second label which is different from the first label obtained by the parsing module  82 ; 
         [0089]    a packet generating module  84 , configured to generate a second L2VPN mapping packet according to the second label applied for by the label applying module  83 ; and 
         [0090]    a sending module  85 , configured to send the second L2VPN mapping packet generated by the packet generating module  84 , and record label switching information. 
         [0091]    After the receiving module  81  receives the first L2VPN mapping packet sent by the PE in the AS that covers the ASBR, the sending module  85  sends the generated second L2VPN mapping packet to a second ASBR. In this case, after the label switching information is recorded, the ASBR uses the second label applied for by the label applying module  83  as an ingress label and uses the first label carried in the first L2VPN mapping packet received by the receiving module  81  and the public network LSP as an egress label to generate MPLS forwarding entries. 
         [0092]    Alternatively, after the receiving module  81  receives the first L2VPN mapping packet sent by the second ASBR, the sending module  85  sends the generated second L2VPN mapping packet to the PE which is in a remote session with the ASBR. In this case, after the label switching information is recorded, the ASBR uses the second label applied for by the label applying module  83  as an ingress label and uses the first label carried in the first L2VPN mapping packet received by the receiving module  81  as an egress label to generate MPLS forwarding entries. 
         [0093]    The ASBR may further include a session establishing module  86 , configured to establish an LDP remote session with a second ASBR and establish an LDP remote session with a PE in the AS that covers the ASBR. In this way, the ASBR can receive the first L2VPN mapping packet sent by the PE in the AS that covers the ASBR, and can receive the first L2VPN mapping packet sent by the second ASBR. 
         [0094]      FIG. 9  shows a structure of a PE in an embodiment of the present invention. The PE includes: 
         [0095]    a receiving module  91 , configured to receive an L2VPN mapping packet sent by an ASBR; 
         [0096]    a parsing module  92 , configured to parse the L2VPN mapping packet received by the receiving module  91 , and obtain a label, a VC identifier, and a VC type carried in the L2VPN mapping packet; and 
         [0097]    an L2VPN establishing module  93 , configured to establish an L2VPN according to the label, the VC identifier and the VC type carried in the L2VPN mapping packet obtained by the parsing module  92 . 
         [0098]    The L2VPN establishing module  93  may further include a point-to-point establishing sub-module  931 , configured to: in a point-to-point VPN scenario, after the PE determines that an identical VC identifier and VC type exist in the PE according to the VC identifier and VC type, obtain the IP address of the ASBR according to the remote session between the PE and the ASBR, search for the public network LSP according to the IP address of the ASBR, and generate MPLS forwarding entries, wherein the MPLS forwarding entries use the ingress label of the VPN user corresponding to the VC identifier and VC type as an index and use the label carried in the L2VPN mapping packet and the public network LSP as an egress label. 
         [0099]    As shown in  FIG. 10 , in another embodiment of the present invention, the L2VPN establishing module  93  may further include: a point-to-multipoint establishing sub-module  932 , configured to: in a point-to-multipoint VPN scenario, after the PE determines that an identical VC identifier and an identical VC type exist in the PE according to the VC identifier and the VC type, obtain the IP address of the ASBR according to the remote session between the PE and the ASBR, search for the public network LSP according to the IP address of the ASBR, and generate MPLS forwarding entries with a MAC address, wherein the MPLS forwarding entries use the destination MAC address as an index and use the label carried in the L2VPN mapping packet and the public network LSP as an egress label. 
         [0100]    After reading the descriptions of the foregoing embodiments, those skilled in the art are clearly aware that the present invention may be implemented through hardware, or through software in addition to a necessary universal hardware platform. Therefore, the technical solutions under the present invention may be embodied as a software product. The software product may be stored in a non-volatile storage medium (such as a CD-ROM, a USB disk, or a mobile hard disk), and may include several instructions that enable a computer device (such as a personal computer, a server, or a network device) to perform the methods provided in the embodiments of the present invention. 
         [0101]    The above descriptions are merely exemplary embodiments of the present invention and not intended to limit the scope of the present invention. Any modifications, equivalent replacements, or improvements made without departing from the spirit and principle of the present invention should fall within the scope of the present invention.