Layer 2 Tunneling Protocol
In computer networking, Layer 2 Tunneling Protocol is a tunneling protocol used to support virtual private networks or as part of the delivery of services by ISPs. It does not provide any encryption or confidentiality by itself. Rather, it relies on an encryption protocol that it passes within the tunnel to provide privacy.
History
Published in 2000 as proposed standard RFC 2661, L2TP has its origins primarily in two older tunneling protocols for point-to-point communication: Cisco's Layer 2 Forwarding Protocol and Microsoft'sPoint-to-Point Tunneling Protocol. A new version of this protocol, L2TPv3, appeared as proposed standard RFC 3931 in 2005. L2TPv3 provides additional security features, improved encapsulation, and the ability to carry data links other than simply Point-to-Point Protocol over an IP network.
Description
The entire L2TP packet, including payload and L2TP header, is sent within a User Datagram Protocol datagram. A virtue of transmission over UDP is that it avoids the "TCP meltdown problem". It is common to carry PPP sessions within an L2TP tunnel. L2TP does not provide confidentiality or strong authentication by itself. IPsec is often used to secure L2TP packets by providing confidentiality, authentication and integrity. The combination of these two protocols is generally known as L2TP/IPsec.The two endpoints of an L2TP tunnel are called the LAC and the LNS. The LNS waits for new tunnels. Once a tunnel is established, the network traffic between the peers is bidirectional. To be useful for networking, higher-level protocols are then run through the L2TP tunnel. To facilitate this, an L2TP session is established within the tunnel for each higher-level protocol such as PPP. Either the LAC or LNS may initiate sessions. The traffic for each session is isolated by L2TP, so it is possible to set up multiple virtual networks across a single tunnel. MTU should be considered when implementing L2TP.
The packets exchanged within an L2TP tunnel are categorized as either control packets or data packets. L2TP provides reliability features for the control packets, but no reliability for data packets. Reliability, if desired, must be provided by the nested protocols running within each session of the L2TP tunnel.
L2TP allows the creation of a virtual private dialup network to connect a remote client to its corporate network by using a shared infrastructure, which could be the Internet or a service provider's network.
Tunneling models
An L2TP tunnel can extend across an entire PPP session or only across one segment of a two-segment session. This can be represented by four different tunneling models, namely:- voluntary tunnel
- compulsory tunnel — incoming call
- compulsory tunnel — remote dial
- L2TP multihop connection
L2TP packet structure
Field meanings:
; Flags and version: control flags indicating data/control packet and presence of length, sequence, and offset fields.
; Length : Total length of the message in bytes, present only when length flag is set.
; Tunnel ID: Indicates the identifier for the control connection.
; Session ID: Indicates the identifier for a session within a tunnel.
; Ns : sequence number for this data or control message, beginning at zero and incrementing by one for each message sent. Present only when sequence flag set.
; Nr : sequence number for expected message to be received. Nr is set to the Ns of the last in-order message received plus one. In data messages, Nr is reserved and, if present, MUST be ignored upon receipt..
;Offset Size : Specifies where payload data is located past the L2TP header. If the offset field is present, the L2TP header ends after the last byte of the offset padding. This field exists if the offset flag is set.
;Offset Pad : Variable length, as specified by the offset size. Contents of this field are undefined.
;Payload data: Variable length
L2TP packet exchange
At the time of setup of L2TP connection, many control packets are exchanged between server and client to establish tunnel and session for each direction. One peer requests the other peer to assign a specific tunnel and session id through these control packets. Then using this tunnel and session id, data packets are exchanged with the compressed PPP frames as payload.The list of L2TP Control messages exchanged between LAC and LNS, for handshaking before establishing a tunnel and session in voluntary tunneling method are
L2TP/IPsec
Because of the lack of confidentiality inherent in the L2TP protocol, it is often implemented along with IPsec. This is referred to as L2TP/IPsec, and is standardized in IETF RFC 3193. The process of setting up an L2TP/IPsec VPN is as follows:- Negotiation of IPsec security association, typically through Internet key exchange. This is carried out over UDP port 500, and commonly uses either a shared password, public keys, or X.509 certificates on both ends, although other keying methods exist.
- Establishment of Encapsulating Security Payload communication in transport mode. The IP protocol number for ESP is 50. At this point, a secure channel has been established, but no tunneling is taking place.
- Negotiation and establishment of L2TP tunnel between the SA endpoints. The actual negotiation of parameters takes place over the SA's secure channel, within the IPsec encryption. L2TP uses UDP port 1701.
A potential point of confusion in L2TP/IPsec is the use of the terms tunnel and secure channel. The term tunnel-mode refers to a channel which allows untouched packets of one network to be transported over another network. In the case of L2TP/PPP, it allows L2TP/PPP packets to be transported over IP. A secure channel refers to a connection within which the confidentiality of all data is guaranteed. In L2TP/IPsec, first IPsec provides a secure channel, then L2TP provides a tunnel.
Windows implementation
Windows has had native support for L2TP since Windows 2000. Windows Vista added 2 alternative tools, an MMC snap-in called "Windows Firewall with Advanced Security" and the "netsh advfirewall" command-line tool. One limitation with both of the WFwAS and netsh commands is that servers must be specified by IP address. Windows 10 added the "" and "" PowerShell commands. A registry key must be created on the client and server if the server is behind a NAT-T device.L2TP in ISPs' networks
L2TP is often used by ISPs when internet service over for example ADSL or cable is being resold. From the end user, packets travel over a wholesale network service provider's network to a server called a Broadband Remote Access Server, a protocol converter and router combined. On legacy networks the path from end user customer premises' equipment to the BRAS may be over an ATM network.From there on, over an IP network, an L2TP tunnel runs from the BRAS to an LNS which is an edge router at the boundary of the ultimate destination ISP's IP network. See .
Implementations
- Cisco: , also read
- Open source and Linux: , , , , , , , ,
- Microsoft: built-in client included with Windows 2000 and higher; for Windows 98/Windows Me/Windows NT 4.0
- Apple: built-in client included with Mac OS X 10.3 and higher.
-
Internet standards and extensions
- RFC 2341 Cisco Layer Two Forwarding "L2F"
- RFC 2637 Point-to-Point Tunneling Protocol
- RFC 2661 Layer Two Tunneling Protocol "L2TP"
- RFC 2809 Implementation of L2TP Compulsory Tunneling via RADIUS
- RFC 2888 Secure Remote Access with L2TP
- RFC 3070 Layer Two Tunneling Protocol over Frame Relay
- RFC 3145 L2TP Disconnect Cause Information
- RFC 3193 Securing L2TP using IPsec
- RFC 3301 Layer Two Tunneling Protocol : ATM access network
- RFC 3308 Layer Two Tunneling Protocol Differentiated Services
- RFC 3355 Layer Two Tunneling Protocol Over ATM Adaptation Layer 5
- RFC 3371 Layer Two Tunneling Protocol "L2TP" Management Information Base
- RFC 3437 Layer Two Tunneling Protocol Extensions for PPP Link Control Protocol Negotiation
- RFC 3438 Layer Two Tunneling Protocol Internet Assigned Numbers: Internet Assigned Numbers Authority Considerations Update
- RFC 3573 Signaling of Modem-On-Hold status in Layer 2 Tunneling Protocol
- RFC 3817 Layer 2 Tunneling Protocol Active Discovery Relay for PPP over Ethernet
- RFC 3931 Layer Two Tunneling Protocol - Version 3
- RFC 4045 Extensions to Support Efficient Carrying of Multicast Traffic in Layer-2 Tunneling Protocol
- RFC 4951 Fail Over Extensions for Layer 2 Tunneling Protocol "failover"
Other
- -
*
*