Here is the routing instance of a PE configured for using BGP for autodiscovery and LDP for setting up pseudowires. All PEs in the same VPLS must use the same l2vpn-id and the same vrf-target. If the target already identifies the VPLS, why do we need the l2vpn-id?
LDP FEC 129 (Generalized PWid FEC Element) contains VPLS-ID, a.k.a Attachment Group Identifier (AGI), see https://tools.ietf.org/html/rfc4762#page-8
Therefore, to establish LDP pseudowire mesh after BGP autodiscovery of PEs, a VPLS-ID is required which is encoded in BGP Extended Community "L2VPN identifier", see RFC 6074.
This is insurance, if You will, that LDP pseudowire will be established to the same router that signaled a particular BGP VPLS-ID.
a VPLS-ID is required which is encoded in BGP Extended Community "L2VPN identifier"
My question is that since we already have a vrf-target which identifies the VPLS, why not use that and do away with configuring an l2vpn ID? Thus we'd have the following:
A VPLS-ID is required which is encoded in BGP Extended Community "VRF Target"
I'm wondering about the reason why the design thinks the L2VPN ID is necessary even though we have a vrf target which already identifies the VPLS
It is indeed possible but it breaks more complex VPLS architectures such as VPLS hub-n-spoke which uses different RTs but have to have same VPLS-ID.
Please see RFC 6074 section 22.214.171.124 https://tools.ietf.org/html/rfc6074#section-126.96.36.199
If a particular VPLS is meant to be a single fully connected LAN, all
its VSIs will have the same RT, in which case the RT could be (though
it need not be) an encoding of the VPN-id. A VSI can be placed in
multiple VPLSes by assigning it multiple RTs.
Note that hierarchical VPLS can be set up by assigning multiple RTs
to some of the VSIs; the RT mechanism allows one to have complete
control over the pseudowire overlay that constitutes the VPLS