Patent ID: 8416787

Claim:
A method for implementing a layer-2 virtual private network (L2VPN) between autonomous systems, the method comprising: receiving, by a first Autonomous System Boundary Router (ASBR) of a first autonomous system (AS), a first L2VPN mapping packet; parsing, by the first ASBR, the first L2VPN mapping packet to obtain a first label carried in the first L2VPN mapping packet, applying, by the first ASBR, for a second label which is different from the first label carried in the first L2VPN mapping packet, generating, by the first ASBR, a second L2VPN mapping packet according to the second label; sending, by the first ASBR, the second L2VPN mapping packet to a second ASBR of a second AS; and recording, by the first ASBR, label switching information; wherein the first ASBR and the second ASBR belong to different service providers; wherein receiving the first L2VPN mapping packet comprises receiving the first L2VPN mapping packet sent by the second ASBR; and wherein, sending the second L2VPN mapping packet to the second ASBR comprises: sending the generated second L2VPN mapping packet to a second provider edge routing device (PE), which is in a remote session with the second ASBR; parsing, by the second PE, the second L2VPN mapping packet to obtain information of the second label, virtual circuit (VC) identifier and a type carried in the second L2VPN mapping packet; and building a L2VPN according to the information of the second label, the VC identifier and the type carried in the second L2VPN mapping packet; wherein for a point-to-point virtual private network (VPN) scenario, building the L2VPN according to the information of the second label, the VC identifier and the type carried in the second L2VPN mapping packet, comprises: determining, by the second PE, an identical VC identifier and VC type exist in the PE according to the VC identifier and the type; obtaining, by the second PE, the IP address of the second ASBR according to the remote session between the second PE and the second ASBR, searching, by the second PE, for the public network LSP according to the IP address of the second ASBR; and generating MPLS forwarding entries, wherein the MPLS forwarding entries use the ingress label of a VPN user corresponding to the VC identifier and VC type as an index and use the label carried in the second L2VPN mapping packet and the public network LSP as an egress label.