Hello, everyone. In this article, I will introduce the knowledge about PWE3.
Definition
PWE3 is a Layer 2 VPN protocols which provides tunnels on the packet switched network (IP/MPLS) to emulate some services, such as FP, ATM, Ethernet, and TDM SONET/SDH. This protocol connects traditional networks to packet switched network, implementing resource sharing and network expansion. As an extension of the Martini protocol, this protocol extends new signaling (optimizes signaling overheads) and specifies the multi-hop negotiation mode, making the networking mode of the protocol more flexible.
Architecture
![]()
1. Attachment Circuit, AC: a connection link or a virtual link between a CE and a PE. Generally, all user packets on the AC, including Layer 2 and Layer 3 protocol packets, are forwarded to the peer site without being changed.
2. Pseudo wire (PW): Simply speaking, a virtual connection is a VC plus a tunnel. The tunnel may be an LSP, an L2TPV3, or a TE. A virtual connection is directional. In PWE3, the VC information is transmitted through the signaling (LDP or RSVP). The VC information and tunnel management form a PW. For the PWE3 system, a PW is like a direct channel between the local AC and the peer AC to transparently transmit Layer 2 user data.
3. Forwarders: After a PE receives data frames from an AC, the forwarder selects a PW for forwarding the data frames. The forwarder is actually the PWE3 forwarding table.
4. Tunnels: carry PWs. One tunnel can carry multiple PWs. Generally, an MPLS tunnel is used. A tunnel is a direct channel between a local PE and a peer PE to transparently transmit data between the PEs.
5. Encapsulation: Packets transmitted on a PW are encapsulated in the standard PW encapsulation format and technology. The PWE3 packets on a PW can be encapsulated in multiple modes, which are defined in draft-ietf-pwe3-iana-allocation-x.
6. PW signaling: The PW signaling protocol is the basis of PWE3 implementation and is used to create and maintain PWs. Currently, the PW signaling protocols include LDP and RSVP.
7. Service quality: The priority information in the Layer 2 packet header is mapped to the QoS priority for transmission on the public network for forwarding. Generally, the application needs to support MPLS QoS.
Packet forwarding process
![]()
1. Establish an LSP, a remote LDP session, and a PW between PE1 and PE2 using MPLS and LDP.
2. CE1 sends a Layer 2 packet to CE3 through the AC. The packet reaches PE1.
3. After receiving the packet, PE1 selects a PW to forward the packet based on the AC interface that receives the packet. Then, the PE generates two MPLS labels (The inner private network label is used to identify the PW, and the outer public network label is used to traverse the tunnel to PE2) based on the forwarding entries of the corresponding PW. MPLS packets are generated.
4. When the MPLS packet reaches the penultimate P node through the public network tunnel, if PHP is configured, the P node pops out the outer label of the packet. After the packet reaches PE2, the P node pops out the private network label and restores the original Layer 2 packet.
5. The forwarder of PE2 selects an AC of Layer 2 packet to forward the Layer 2 packet to CE2.
Creating, Maintaining, and Deleting a Dynamic PW
Single-hop
There is only one segment of PW between the PEs at both ends of the PW, and label switching at the PW label layer is not required.
![]()
![]()
1. PE1 sends a Request message and a Mapping message to PE2, the Request packet is used to request PE2 to allocate a sending VC label (also used as a receiving VC label of PE2) in the VC connection from PE1 to PE2 for PE1, and the Mapping packet is used to allocate a sending VC label (also used as a receiving VC label of PE1) in the VC connection from PE2 to PE1 for PE2.
2. After PE2 receives the Label Mapping message from PE1, PE2 checks whether the same VC is configured locally. If the locally configured PW parameters, such as the VC ID, VC type, MTU, and control word, are consistent, PE2 obtains the VC label carried in the Label Mapping message, set the status of the VC from PE2 to PE1 to Up. At the same time, receiving a Request message from PE1 will trigger PE2 to send a Mapping message to PE1, and assign PE1 the VC label in the VC connection from PE1 to PE2.
3. After receiving the Mapping message from PE2, PE1 checks the local PW configuration. If the PW configurations are consistent, PE1 sets the status of the VC from PE1 to PE2 to Up. A bidirectional VC is established on the dynamic PW between PE1 and PE2.
4. After the PW is set up, PE1 and PE2 notify each other of their status through Notification packets.
![]()
Withdraw: carries the VC labels and status of the two VCs on the PW to be torn down, and instructs the peer end to withdraw the corresponding VC labels.
Release: As a response message to the Withdraw message, it is used to notify the end sending the Withdraw message to revoke the corresponding VC label.
When the AC interface or tunnel of the PW is down, the Martini protocol sends the withdraw packet to disconnect the PW. In this way, when the AC interface or tunnel is up, a new round of negotiation is required to set up the connection. The PWE3 protocol sends notification packets to the peer end to notify the peer end that data forwarding is not allowed. The PW connection is disconnected. When the AC and tunnel are up, the notification packets are sent to notify the peer end that data forwarding is allowed.
In PWE3, PEs at both ends tear down a PW only when the PW configuration is deleted or the signaling protocol is interrupted (for example, the public network or the PW tunnel is Down).
Multi-hop
Indicates the multi-PW. In the case of multi-hop forwarding, the switching PE (SPE) needs to perform label translation for the PW label layer.
![]()
In most cases, a single hop can meet the requirements. However, a single hop cannot meet the requirements in the following situations:
1. The two PEs are not in the same AS, and no signaling connection or tunnel can be set up between the two PEs.
2. The two PEs run different signaling protocols. For example, one PE runs LDP and the other PE runs RSVP.
3. If an access device can run MPLS but cannot establish a large number of LDP sessions, you can configure the user facing provider devices (UFPEs) as U-PEs and configure the high-performance S-PEs as the switching nodes of LDP sessions, which are similar to signaling reflectors.
![]()
Compared with the single-hop mode, the multi-hop mode requires an additional SPE between two PEs. The multi-hop connection is not directly established between PE1 and PE2, but is connected through the SPE. PE1 and PE2 are connected to the SPE, and the SPE connects the two PW segments. During the signaling negotiation for the connection establishment, the SPE forwards the parameters carried in the mapping packet sent from PE1 to the SPE to the PE. Similarly, the SPE sends the parameters of PE2 to the SPE through the mapping packet and then the SPE forwards the parameters to PE1. After the parameters at both ends are negotiated, the PW becomes Up. The release, withdraw, and notification messages are delivered hop-by-hop, just like the mapping messages, and they have reached the purpose of stopping forwarding (notification) or tearing down connections (withdraw, release). There is no limit to the number of SPEs, which can be arbitrarily many.
That is my understanding of PWE3.


