Introducing L2TPv3L2TPv3 is the IETF standard's track successor to UTI for Layer 2 Tunneling. To overcome some of the limitations that UTI possessed, L2TPv3 built upon UTI's encapsulation format and coupled it with an optional signaling mechanism that heavily borrowed from L2TPv2's control plane to provide pseudowire connectivity (L2TPv2 is described in RFC 2661, "Layer 2 Tunneling Protocol 'L2TP'").Figure 10-3 shows the L2TPv3 connectivity model. L2TPv3's control messages are sent inband using the same packet core path as the data traffic. Each pseudowire is maintained through separate L2TPv3 data sessions similar to UTI tunnels: one for the Frame Relay PVC between R3 and R4, and a separate session for connectivity between LAN 1 and LAN 2. Figure 10-3. L2TPv3 Connectivity Model[View full size image] ![]() L2TPv3 Data EncapsulationAs mentioned in Chapter 2, "Pseudowire Emulation Framework and Standards," the IETF Pseudowire Emulation Edge to Edge (PWE3) group laid some of the framework and specified requirements for a pseudowire emulation protocol. One of the architecture aspects explored in the PWE3 architecture draft was the Pseudowire Protocol Layering Model. To understand L2TPv3's frame encapsulation, this section describes each of the encapsulation components of L2TPv3 and, where applicable, relates it to the Pseudowire Emulation Protocol Layer subset shown in Figure 10-4.
Packet-Switched Network LayerUnlike Any Transport over MPLS (AToM), which uses an outer MPLS label-to-label switch traffic to the far-end PE, L2TPv3 expects an IP-based packet core (IPv4 or IPv6). The L2TPv3 draft specifies two alternative delivery header encapsulations, illustrated in Figure 10-5:Plain IPIP/UDP Figure 10-5. L2TPv3 Packet-Switched Network LayerChapter 13, "Advanced L2TPv3 Case Studies."L2TPv3 with an IPv4/UDP encapsulation uses a standard 20-byte IPv4 header without options and contains an IP protocol value of 17 to signify a UDP payload. The IP header is then Chapter 2.Compared to IPv4 encapsulation, one of the advantages of using IPv4/UDP encapsulation is that it is friendlier to applications such as Network Address Translation (NAT). Furthermore, IPv4 encapsulation provides only a header checksum, whereas UDP also offers a checksum that verifies payload integrity. This could be an issue especially when you are dealing with and confirming the reliability of L2TPv3 control messages, which are covered in the section "L2TPv3 Control Connection," later in this chapter.NoteThe Cisco implementation of L2TPv3 only supports IPv4 header encapsulation for the L2TPv3 Delivery Header. As such, the remainder of this chapter focuses on the IPv4 L2TPv3 implementation. Demultiplexing SublayerThe L2TPv3 Demultiplexing Sublayer field allows the IPv4 tunnel (an IPv4 source and destination pair) to carry and demultiplex multiple pseudowires. This field is the equivalent of the Demultiplexing Sublayer described in Chapter 2. L2TPv3 supports demultiplexing through a combination of a Session Identifier and Cookie values shown in Figure 10-6. Figure 10-6. L2TPv3 Demultiplexer Field![]() Encapsulation SublayerL2TPv3 uses an optional field, referred to as an Layer 2-Specific Sublayer, to convey information that is not carried in the Layer 2 Payload but that is required for the tunnel de-encapsulating endpoint to properly reconstruct the Layer 2 Payload and send the frame to the CE device. This field is the equivalent of the optional Encapsulation Sublayer that is defined in the Pseudowire Emulation Protocol Layers.The L2TPv3 base draft specifies a default Layer 2-Specific Sublayer illustrated in Figure 10-7 that you use if it meets the Layer 2 Payload requirements. Otherwise, you can define alternate Layer 2-Specific Sublayers and use them as negotiated through an Layer 2-Specific Sublayer Type AVP control message. A Data Sequencing AVP is signaled during session negotiation to determine whether sequencing is required or what type of traffic needs to be sequenced. Figure 10-7. L2TPv3 Default Layer 2-Specific Sublayer![]() The Cisco sequencing implementation only drops out-of-order frames and does not attempt to reorder out-of-sequence packets. You should understand the implications of this behavior prior to enabling sequencing relative to the Layer 2 protocol. L2TPv3 Control ConnectionL2TPv3 supports an optional control connection mechanism, which handles peer capability negotiation and detection in addition to pseudowire creation, maintenance, and teardown. This section explores L2TPv3's control connection by examining how control messages are encapsulated and what the different negotiation phases are for control channel initialization and session negotiation.Unlike AToM, which uses link Layer Distribution Protocol (LDP) for LSP tunneling (PSN tunnel signaling) and directed LDP for virtual circuit (VC) label distribution (pseudowire/PE maintenance), L2TPv3 utilizes a single reliable, inband control plane for both purposes. This control plane setup phase begins with an L2TP Control Connection (sometimes referred to in L2TP terminology as the L2TP tunnel) establishment phase for advertising and negotiating capabilities between peers. After the L2TP Control Connection is established, individual pseudowire sessions (referred to in L2TP terminology as L2TP sessions) are set up in the Session Negotiation phase as needed based on the attachment circuit state.NoteThere are three variations on the control plane implementation of L2TPv3. L2TPv3 in its simplest mode of operation, known as Manual Mode, obviates the need for a control plane protocol and simply requires predefined session IDs and cookies. The second variation, called Manual Mode with Keepalive, negotiates the Control Connection phase but not the Session Negotiation phase. This offers a simple dead-peer detection mechanism that is similar to what is available in UTI with keepalives. Dynamic Mode negotiates both the Control Connection phase as well as the Session Negotiation phase for each pseudowire session.As mentioned earlier in the section "Introducing L2TPv3," L2TPv3 essentially borrowed from L2TPv2's control channel signaling and expanded upon it by defining additional AVPs. These AVPs are used as an extensible mechanism to identify message types within the control channel. In addition to identifying the nature of the PW session or control channel, the control messages can indicate or define the operational state of the attachment circuits. The next sections describe control message encapsulation and control channel signaling in more detail. Control Message EncapsulationBecause the L2TPv3 control channel is sent inband with L2TPv3 data packets, it is necessary to have some method of differentiating control channel messages from data packets. To understand how this is accomplished, you must examine the control message formatting. Figure 10-6 and 10-7 examined the encapsulation for L2TPv3 data messages only. The formatting of L2TPv3 control messages over IP differs slightly, as shown in Figure 10-8. Figure 10-8. L2TPv3 Control Channel Encapsulation over IP![]() Following the control message header are one or more AVPs. Each AVP follows a consistent format that contains the following fields:M When the Mandatory bit (M-bit) is set, it indicates that the associated Control Connection or PW Session must be shut down if the recipient does not recognize this AVP. If a Control Connection occurs, a Stop Control Connection (STOPCCN) message is sent. If a PW Session occurs, a Call Disconnect Notification (CDN) message is sent.H The Hidden bit (H-bit) indicates to the recipient whether the AVP content is passed in clear text or obfuscated in some manner to hide sensitive information. For this AVP encryption to occur, a shared secret must be defined on both endpoints, Control Message Authentication must be enabled, and a Random Vector AVP must be sent.AVP Length The AVP Length field indicates the length of the entire AVP, as highlighted in Figure 10-8.Vendor ID The Vendor ID is a 2-byte field that follows Internet Assigned Numbers Authority (IANA) assigned values that are defined in RFC 1700 in the "SMI Network Management Private Enterprise Codes" section. This allows vendors to define private Attribute Types. A Vendor ID field of 0 represents that this Attribute Type is an Internet Engineering Task Force (IETF) adopted attribute value that is defined in the L2TPv3 base draft.Attribute Type The Attribute Type contains a 2-byte field representing the Attribute Message. You must interpret this field's value relative to the Vendor ID field.Attribute Value The Attribute Value contains the actual content of the defined Vendor ID Attribute Type. The length of this field is the Attribute Length minus 6 bytes for Attribute Header fields. L2TPv3 Control Channel SignalingControl channel signaling operates in two phases: control connection establishment followed by session establishment (optional).Figure 10-9 builds upon the network layout in Figure 10-3 and shows the control connection establishment that is required to build the control channel between the two L2TPv3 endpoints, R1 and R2, and subsequent control channel messages. Figure 10-9. L2TPv3 Control Connection PhaseChapter 6, "Understanding Any Transport over MPLS." Table 6-1 illustrates the associated values that are also used for the L2TPv3 Pseudowire Capabilities List AVP.The peer PE router responds with a Start-Control-Connection-Reply (SCCRP) advertising its own capability set. The SCCRP message is sent in response to an accepted SCCRQ message and indicates that the Control Connection establishment can continue. A similar set of AVPs to those sent in SCCRQ are sent in the SCCRP message. One mandatory AVP is Assigned Control Connection ID, which identifies the Control Connection ID value that the peer PE router has selected.Finally, the Start-Control-Connection-Connected (SCCCN) is sent in reply to the SCCRP. The SCCCN message acknowledges that the SCCRP was accepted and that the Control Connection establishment phase is complete.Chapter 11.NoteWhen nonce is used in relation to cryptography, it refers to a random value generated for onetime use to protect against replay attacks.The result of this hash is passed via a Message Digest AVP, which contains the digest type specifying the hashing mechanism and a Message Digest field, containing the resultant hash output.Upon receipt of the Message Digest AVP, the PE router must perform the same hashing mechanism and compare the locally computed value to the Message Digest field value it obtains from the remote PE. If the locally computed value does not match, the PE router must discard the entire control message. Prior to utilizing or reacting to any of the information from the control messages, the PE router must validate the Message Digest AVP.To perform peer authentication, you must configure the shared secret between the PE routers. However, if a shared secret is undefined, you can still perform control message integrity checking by using the hash against an empty shared secret.This Control Message Authentication scheme for L2TPv3 is similar to the mechanism you use for Tunnel Authentication, which is defined in L2TPv2. However, the primary difference is that unlike L2TPv2, you perform the hashing mechanism against the entire control message. This provides the added benefit of providing a checksum-like functionality for control messages in the case of L2TPv3 over IP, where the IP Checksum is only computed for the IP header.The second phase of control connection signaling is an optional Session establishment phase, which dynamically establishes pseudowire sessions. The Session establishment phase can involve incoming call requests (that is, receiving a call) and outgoing call requests (that is, asking to place an outbound call). The Cisco implementation supports only incoming call messages for pseudowire session establishment. Figure 10-10 illustrates the various messages that are used in session negotiation, maintenance, and teardown. Similar to the Control Connection establishment phase, the Session negotiation establishment uses a three-way handshake mechanism. Figure 10-10. L2TPv3 Session Negotiation[View full size image] ![]() |