Layer 2 Tunneling Protocol

Short description: Computer networking protocol

In computer networking, Layer 2 Tunneling Protocol (L2TP) is a tunneling protocol used to support virtual private networks (VPNs) or as part of the delivery of services by ISPs. It uses encryption ('hiding') only for its own control messages (using an optional pre-shared secret), and does not provide any encryption or confidentiality of content by itself. Rather, it provides a tunnel for Layer 2 (which may be encrypted), and the tunnel itself may be passed over a Layer 3 encryption protocol such as IPsec.[1]

Internet protocol suite

Application layer

* BGP
* DHCP
* DNS
* FTP
* HTTP
* HTTPS
* IMAP
* LDAP
* MGCP
* MQTT
* NNTP
* NTP
* POP
* ONC/RPC
* RTP
* RTSP
* RIP
* SIP
* SMTP
* SNMP
* SSH
* Telnet
* TLS/SSL
* XMPP
* more...

Transport layer

* TCP
* UDP
* DCCP
* SCTP
* RSVP
* QUIC
* more...

Internet layer

* IP
* IPv4
* IPv6
* ICMP
* ICMPv6
* ECN
* IGMP
* IPsec
* more...

Link layer

* ARP
* NDP
* OSPF
* Tunnels
* L2TP
* PPP
* MAC
* Ethernet
* Wi-Fi
* DSL
* ISDN
* FDDI

* more...

* v
* t
* e

## Contents

* 1 History
* 2 Description
* 3 Tunneling models
* 4 L2TP packet structure
* 5 L2TP packet exchange
* 6 L2TP/IPsec
* 7 Windows implementation
* 8 L2TP in ISPs' networks
* 9 RFC references
* 10 See also
* 11 References
* 12 External links
* 12.1 Implementations
* 12.2 Other

## History

Published in August 1999 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 (L2F) and Microsoft's[2] Point-to-Point Tunneling Protocol (PPTP). 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 (PPP) over an IP network (for example: Frame Relay, Ethernet, ATM, etc.).

## Description

PPP is a widely-deployed protocol for establishing a data link layer connection over an unreliable, point-to-point data link. L2TP provides a mechanism to multiplex and tunnel these PPP connections over a packet transport such as IP, ATM or Frame Relay for handling by a central Network access server elsewhere. In the case of dial-up internet connections this would allow customers of an ISP to call a local number instead of making a potentially-costly long-distance call.[1]

In VPN usage the PPP and L2TP endpoints are not separated, with L2TP used as a mechanism to encapsulate a single PPP session over an IP network. The entire L2TP packet, including payload and L2TP header, is sent within a User Datagram Protocol (UDP) datagram. A virtue of transmission over UDP (rather than TCP) is that it avoids the TCP meltdown problem.[3][4] Since 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 (discussed below).

The two endpoints of an L2TP tunnel are called the L2TP access concentrator (LAC) and the L2TP network server (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. The protocol is able to carry session metadata ("attribute-value pairs") such as calling and called phone number, whether the session is analog or digital, among others.

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 (VPDN)[5] 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[6]

## L2TP packet structure

An L2TP packet consists of :

Bits 0–15  | Bits 16–31

|

Flags and Version Info  | Length (opt)
Tunnel ID  | Session ID
Ns (opt)  | Nr (opt)
Offset Size (opt)  | Offset Pad (opt)......
Payload data

Field meanings:

Flags and version
control flags indicating data/control packet and presence of length, sequence, and offset fields.
Length (optional)
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 (optional)
sequence number for this data or control message, beginning at zero and incrementing by one (modulo 216) for each message sent. Present only when sequence flag set.
Nr (optional)
sequence number for expected message to be received. Nr is set to the Ns of the last in-order message received plus one (modulo 216). In data messages, Nr is reserved and, if present (as indicated by the S bit), MUST be ignored upon receipt..
Offset Size (optional)
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 (optional)
Variable length, as specified by the offset size. Contents of this field are undefined.
Payload data
Variable length (Max payload size = Max size of UDP packet − size of L2TP header)

## 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

Image:L2TP packet exchange.svg

## L2TP/IPsec

Because of the lack of confidentiality inherent in the L2TP, 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:

1. Negotiation of IPsec security association (SA), typically through Internet key exchange (IKE). This is carried out over UDP port 500, and commonly uses either a shared password (so-called "pre-shared keys"), public keys, or X.509 certificates on both ends, although other keying methods exist.
2. Establishment of Encapsulating Security Payload (ESP) communication in transport mode. The IP protocol number for ESP is 50 (compare TCP's 6 and UDP's 17). At this point, a secure channel has been established, but no tunneling is taking place.
3. 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.

When the process is complete, L2TP packets between the endpoints are encapsulated by IPsec. Since the L2TP packet itself is wrapped and hidden within the IPsec packet, the original source and destination IP address is encrypted within the packet. Also, it is not necessary to open UDP port 1701 on firewalls between the endpoints, since the inner packets are not acted upon until after IPsec data has been decrypted and stripped, which only takes place at the endpoints.

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. IPsec also specifies a tunnel protocol: this is not used when a L2TP tunnel is used.

## Windows implementation

Windows has had native support (configurable in control panel) for L2TP since Windows 2000. Windows Vista added 2 alternative tools, an MMC snap-in called "Windows Firewall with Advanced Security" (WFwAS) 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 "Add-VpnConnection" and "Set-VpnConnectionIPsecConfiguration" PowerShell commands. A registry key must be created on the client and server if the server is behind a NAT-T device. [1]

## 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 (BRAS), 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 (acting as LAC) to an LNS which is an edge router at the boundary of the ultimate destination ISP's IP network.[lower-alpha 1]

## RFC references

* RFC 2341 Cisco Layer Two Forwarding (Protocol) "L2F" (a predecessor to L2TP)
* RFC 2637 Point-to-Point Tunneling Protocol (PPTP)
* 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 (L2TP) over Frame Relay
* RFC 3145 L2TP Disconnect Cause Information
* RFC 3193 Securing L2TP using IPsec
* RFC 3301 Layer Two Tunneling Protocol (L2TP): ATM access network
* RFC 3308 Layer Two Tunneling Protocol (L2TP) Differentiated Services
* RFC 3355 Layer Two Tunneling Protocol (L2TP) Over ATM Adaptation Layer 5 (AAL5)
* 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 (L2TP) Internet Assigned Numbers: Internet Assigned Numbers Authority (IANA) Considerations Update
* RFC 3573 Signaling of Modem-On-Hold status in Layer 2 Tunneling Protocol (L2TP)
* RFC 3817 Layer 2 Tunneling Protocol (L2TP) Active Discovery Relay for PPP over Ethernet (PPPoE)
* RFC 3931 Layer Two Tunneling Protocol - Version 3 (L2TPv3)
* RFC 4045 Extensions to Support Efficient Carrying of Multicast Traffic in Layer-2 Tunneling Protocol (L2TP)
* RFC 4951 Fail Over Extensions for Layer 2 Tunneling Protocol (L2TP) "failover"

## See also

* IPsec
* Layer 2 Forwarding Protocol
* Point-to-Point Tunneling Protocol
* Point-to-Point Protocol
* Virtual Extensible LAN

## References

1. ↑ See example of reseller ISPs using L2TP.

1. ↑ 1.0 1.1 IETF (1999), RFC 2661, Layer Two Tunneling Protocol "L2TP"
2. ↑ "Point-to-Point Tunneling Protocol (PPTP)". TheNetworkEncyclopedia.com. 2013. http://www.thenetworkencyclopedia.com/entry/point-to-point-tunnelling-protocol-pptp/. "Point-to-Point Tunneling Protocol (PPTP) [:] A data-link layer protocol for wide area networks (WANs) based on the Point-to-Point Protocol (PPP) and developed by Microsoft that enables network traffic to be encapsulated and routed over an unsecured public network such as the Internet."
3. ↑ Titz, Olaf (2001-04-23). "Why TCP Over TCP Is A Bad Idea". http://sites.inka.de/bigred/devel/tcp-tcp.html.
4. ↑ Honda, Osamu; Ohsaki, Hiroyuki; Imase, Makoto; Ishizuka, Mika; Murayama, Junichi (October 2005). "Understanding TCP over TCP: effects of TCP tunneling on end-to-end throughput and latency". in Atiquzzaman, Mohammed; Balandin, Sergey I. 6011. doi:10.1117/12.630496. Bibcode: 2005SPIE.6011..138H.
5. ↑ "Cisco Support: Understanding VPDN – Updated Jan 29, 2008". http://www.cisco.com/en/US/tech/tk801/tk703/technologies_tech_note09186a0080094586.shtml.
6. ↑ IBM Knowledge Center: L2TP multi-hop connection

## External links

### Implementations

* Cisco: Cisco L2TP documentation, also read Technology brief from Cisco
* Open source and Linux: xl2tpd , Linux RP-L2TP, OpenL2TP, l2tpns, l2tpd (inactive), Linux L2TP/IPsec server , FreeBSD multi-link PPP daemon, OpenBSD npppd(8), ACCEL-PPP - PPTP/L2TP/PPPoE server for Linux
* Microsoft: built-in client included with Windows 2000 and higher; Microsoft L2TP/IPsec VPN Client for Windows 98/Windows Me/Windows NT 4.0
* Apple: built-in client included with Mac OS X 10.3 and higher.
* VPDN on Cisco.com

### Other

* IANA assigned numbers for L2TP
* L2TP Extensions Working Group (l2tpext) \- (where future standardization work is being coordinated)
* Using Linux as an L2TP/IPsec VPN client
* L2TP/IPSec with OpenBSD and npppd
* Comparison of L2TP, PPTP and OpenVPN

* v
* t
* e

Virtual private networking

Communications protocol|

* SSTP
* IPsec
* L2TP
* L2TPv3
* PPTP
* Split tunneling
* SSL/TLS
* (Opportunistic: tcpcrypt)

Free software|

* Cloudvpn
* FreeLAN
* FreeS/WAN
* Libreswan
* n2n
* OpenConnect
* OpenIKED
* Openswan
* OpenVPN
* Social VPN
* SoftEther VPN
* strongSwan
* tcpcrypt
* tinc
* VTun
* WireGuard
* Shadowsocks

Vendor-driven protocols|

* Layer 2 Forwarding Protocol
* DirectAccess

Proprietary software|

* Avast SecureLine VPN
* Check Point VPN-1
* Cisco Systems VPN Client
* LogMeIn Hamachi
* Microsoft Forefront Unified Access Gateway
* Hola
* Tunnelbear
* NordVPN
* SaferVPN
* ExpressVPN
* ProtonVPN
* PureVPN
* VPN.ht
* Private Internet Access

Risk vectors|

* Content-control software
* Deep content inspection
* Deep packet inspection
* IP address blocking
* Network enumeration
* Stateful firewall
* TCP reset attack
* VPN blocking

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Layer 2 Tunneling Protocol. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Layer_2_Tunneling_Protocol&oldid=4569149"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template