PE1 and PE2 devices will form an LDP session (Targeted-LDP session) using Extended Discovery mechanism. The PW label is exchanged over this LDP session using Downstream Unsolicited label distribution method.
 

l2vpn_topology

LDP has been extended to facilitate PseudoWire (PW) setup and maintenance. The Label Mapping message contains the FEC TLV, Label TLV and zero or more optional Interface Parameters.

The FEC TLV is used to indicate the meaning of the label. The FEC TLV is used to identify a particular PW that a particular label is bound to. Each FEC TLV must contain exactly one FEC element.

The Pseudowire ID (PW ID) FEC Element may be used whenever both pseudowire endpoints (PE devices) are configured with the same 32-bit pseudowire identifier.

 
pw_fec_tlv
 

PW ID: Set to 0x80 (128 in decimal)

C: If set to 1, indicates presence of Control Word

PW Type: 15-bit value indicating the type of PW- 0x0004 for Ethernet Tagged mode and 0x0005 for Ethernet Untagged mode.

PW info Length: Length of PW ID field and Interface Parameters Sub-TLV in octets.

Group ID: It identifies a group of Pseudowires.

PW ID: A 32-bit value that together with PW Type identifies the pseudowire. Both these values should match on each endpoints of a pseudowire.

Interface Parameter Sub-TLV: This variable length TLV is used to provide interface-specific parameters like MTU.

Using the PW ID FEC, each endpoint of the pseudowire initiates a unidirectional LSP. Once both endpoints setup their outgoing and incoming LSPs, they are bound together provided their PW ID and PW Type match.

Signalling PW Status:

The status of PW can be signaled by a PE to its peer using

  • Label Withdraw message or
  • PW Status TLV

When the PEs first setup the PW, they attempt to negotiate the usage of PW Status TLV. A PE that supports PW Status TLV includes it in the initial Label Mapping message following the PW FEC TLV and interface parameter sub-TLVs. If the peer PE supports PW Status TLV and if it includes it in its initial Label Mapping message, then this method is followed. OR if the peer PE supports PW Status TLV but does not include it in its Label Mapping message, or does not support it, the PE will revert back to Label Withdraw method.

a) Use of Label Withdraw message:

If the Label Withdraw message is selected, it will result in the Label Mapping message being advertised only if the attachment circuit is active. If the AC goes down, the PE router signals this by sending Label Withdraw message to the remote PE. If the physical interface goes down, the Label Withdraw message includes the Group ID indicating all the ACs attached to this physical interface are down.

b) Signaling using PW Status TLV:

The format of PW Status TLV is-

 
pw_statuus_tlv
 
 

The PW Status TLV is transported to remote PE in LDP Notification message. The Status Code (4-bytes) contains specific status code for PW.

Further reading:

RFC 4447: Pseudowire setup and maintenance using LDP – https://datatracker.ietf.org/doc/html/rfc4447