# BGP Multihoming for VPWS Overview

BGP multihoming enables you to connect a customer site to two or more PE routers to provide redundant connectivity while preventing the formation of layer 2 loops in the service provider’s network. The redundant connectivity maintains the VPWS service and traffic forwarding to and from the multihomed site in the event of a PE router-to-CE device link failure, the failure of a PE router, or an MPLS reachability failure between the local PE router and a remote PE router. A redundant PE router can begin providing service to the customer site as soon as the failure is detected. BGP multihoming is very similar for both VPLS and VPWS, with only minor differences in behavior between the two L2VPN types. Multihoming is not applicable for VPWS local cross-connects because the local and remote CE devices are connected to the same PE.

When a CE device connects to multiple PE routers, each of these routers advertises reachability for the multihomed site. The other PE routers in the network use a BGP path selection process to select only one of the advertising routers to which they send traffic destined for the CE device. This path selection process eliminates layer 2 loops in the VPWS network.

| Best Practice: To prevent the creation of layer 2 loops due to a misconfiguration or temporary loops during a topology change and subsequent convergence, we recommend that you employ the Spanning Tree Protocol (STP) on your CE devices.

You specify on each PE router connected to the CE device in the VPWS that the site is multihomed and you configure a priority. The priority serves as a site preference and is propagated by BGP in the local-preference attribute.

You configure the same site ID (sometimes referred to as a VE ID) on these connected PE routers. Each of these routers then advertises reachability for the multihomed site; the VPWS NLRI contains the site ID. The site ID shared by the connected PE routers should be different than the site IDs configured on the remote PE routers in the VPWS network; if the site ID is not different, then the pseudowire will be in a site collision state. The remote routers then use the site ID to identify where to forward traffic destined for the customer site.

Although the site ID is the same for all connected PE routers, the block offset, label range, and route distinguisher can be different for each PE router. The BGP path selection process uses the block offset and label range only to determine whether a layer 2 advertisement is relevant to the multihomed customer site. A route distinguisher is helpful to uniquely identify a particular PE router when you are troubleshooting a network.

The PE routers run the BGP path selection process on the locally originated and received layer 2 route advertisements to establish that the routes are suitable for advertisements to other peers, such as route reflectors. For this selection process, the routes advertise different prefixes, distinguished by the site ID, block offset, and route distinguisher.

The remote PE routers then run a modified selection process on these selected routes for L2VPN multihoming. Because all the prefixes advertised by multihomed local PE routers share the same site ID, the set of routes advertised for a multihomed site effectively consists of multiple routes to a single prefix, distinguished by the site ID alone. Therefore the result of the second selection process is the single best path to the multihomed site.

The PE router that originates this advertisement then becomes the designated VE device for the multihomed customer site. When the designated VE device is determined for both the local and remote customer sites for the VPWS, then a VPWS pseudowire is created between the designated VE devices.

The BGP best path selection process is run only in the core VPN address family. This first selection process does not consider the status vector bit for VPWS (or the down bit for VPLS).

The layer 2 multihoming decision process is run only in the non-core VPWS (or VPLS) layer 2 unicast address families. This second decision process treats prefixes with the same site ID but different RDs as unique prefixes.

When the PE router receives a layer 2 BGP advertisement that has the down bit set, inbound policy sets the local preference attribute to zero. The selection process can then choose an existing route from an alternate PE router, if available.

When a a PE router in a VPWS domain is also a BGP route reflector (RR), the path selection process to determine the VE device for the multihomed site has no effect on the path selection process performed by this PE router for the purpose of reflecting layer 2 routes.

Layer 2 prefixes that have different route distinguishers are considered to have different NLRI for route reflection. This result of the L2VPN multihoming decision process enables the RR to reflect all routes that have different route distinguishers to all other RR clients even though only one of these routes is used to trigger the VPWS pseudowire to the multihomed site.