The L2TP Protocol is used for integrating multi-protocol dial-up services into existing Internet Service Providers Point of Presence. PPP defines an encapsulation mechanism for transporting multiprotocol packets across layer 2 (L2) point-to-point links. Typically, a user obtains a L2 connection to a Network Access Server (NAS) using one of a number of techniques (e.g., dialup POTS, ISDN,ADSL, etc.) and then runs PPP over that connection. In such a configuration, the L2 termination point and PPP session endpoint reside on the same physical device (i.e., the NAS).
L2TP extends the PPP model by allowing the L2 and PPP endpoints to reside on different devices interconnected by a packet-switched network. With L2TP, a user has an L2 connection to an access concentrator (e.g., modem bank, ADSL DSLAM, etc.), and the concentrator then tunnels individual PPP frames to the NAS. This allows the actual processing of PPP packets to be divorced from the termination of the L2 circuit.
One obvious benefit of such a separation is that instead of requiring the L2 connection terminate at the NAS, the connection may terminate at a (local) circuit concentrator, which then extends the logical PPP session over a shared infrastructure such as frame relay circuit or the Internet. From the user"s perspective, there is no functional difference between having the L2 circuit terminate in a NAS directly or using L2TP.
This protocol may also be used to solve the "multilink hunt-group splitting" problem. Multilink PPP, often used to aggregate ISDN B channels, requires that all channels composing a multilink bundle be grouped at a single Network Access Server (NAS). Because L2TP makes a PPP session appear at a location other than the physical point at which the session was physically received, it can be used to make all channels appear at a single NAS, allowing for a multilink operation even when the physical calls are spread across distinct physical NASs.
L2TP utilizes two types of messages, control messages and data messages. Control messages are used in the establishment, maintenance and clearing of tunnels and calls. Data messages are used to encapsulate PPP frames being carried over the tunnel. Control messages utilize a reliable Control Channel within L2TP to guarantee delivery (see section 5.1 for details). Data messages are not retransmitted when packet loss occurs.
Protocol Structure
L2TP Common header:
| 12 bits | 16 bits | 32 bits | |||||||||||
| T | L | X | X | S | X | O | P | X | X | X | X | VER | Length |
| Tunnel ID | Session ID | ||||||||||||
| Ns (opt) | Nr (opt) | ||||||||||||
| Offset size (opt) | Offset pad (opt) | ||||||||||||
- T - The T bit indicates the type of message. It is set to 0 for data messages and 1 for control messages.
- L - When set, this indicates that the Length field is present, indicating the total length of the received packet. Must be set for control messages.
- X - The X bits are reserved for future extensions. All reserved bits are set to 0 on outgoing messages and are ignored on incoming messages.
- S - If the S bit is set, both the Nr and Ns fields are present. S must be set for control messages.
- O - When set, this field indicates that the Offset Size field is present in payload messages. This bit is set to 0 for control messages.
- P - If the Priority (P) bit is 1, this data message receives preferential treatment in its local queuing and transmission.
- Ver - The value of the ver bit is always 002. This indicates a version 1 L2TP message.
- Length - Overall length of the message, including header, message type AVP, plus any additional AVP"s associated with a given control message type.
- Tunnel ID - Identifies the tunnel to which a control message applies. If an Assigned Tunnel ID has not yet been received from the peer, Tunnel ID must be set to 0. Once an Assigned Tunnel ID is received, all further packets must be sent with Tunnel ID set to the indicated value.
- Call ID - Identifies the user session within a tunnel to which a control message applies. If a control message does not apply to a single user session within the tunnel (for instance, a Stop-Control-Connection-Notification message), Call ID must be set to 0.
- Nr - The sequence number expected in the next control message to be receivec.
- Ns - The sequence number for this data or control message.
- Offset size & pad - This field specifies the number of bytes past the L2TP header at which the payload data is expected to start. Actual data within the offset padding is undefined. If the offset field is present, the L2TP header ends after the last octet of the offset padding.
Related protocols: PPP, PPTP, L2F, ATM, Frame Relay, UDP
Sponsor Source: L2TP is defined by IETF (http://www.ietf.org) in RFC 2661
Reference: http://www.javvin.com/protocol/rfc2661.pdf: Layer Two Tunneling Protocol "L2TP
