ArticleslgStudy

computer science

Layer 2 Tunneling Protocol

Layer 2 Tunneling Protocol is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Layer 2 Tunneling Protocol rather than just read about it. In short: 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.

Layer 2 Tunneling Protocol — main illustration
Layer 2 Tunneling Protocol — illustration

Key takeaways

  • Layer 2 Tunneling Protocol belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Layer 2 Tunneling Protocol to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Layer 2 Tunneling Protocol from memory before moving on to harder problems.

Reference excerpt

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.

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 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. 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. 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) 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 An L2TP packet consists of :

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

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:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Layer 2 Tunneling Protocol

Start with the simplest possible case. Write down what Layer 2 Tunneling Protocol claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Layer 2 Tunneling Protocol before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Layer 2 Tunneling Protocol ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Layer 2 Tunneling Protocol

In research
Layer 2 Tunneling Protocol appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Layer 2 Tunneling Protocol in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Layer 2 Tunneling Protocol is common in secondary-school and first-year university syllabi. It links to neighbouring topics Internet Standards, Internet protocols, Tunneling protocols, so understanding it makes those chapters shorter.
In everyday life
Look for Layer 2 Tunneling Protocol outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Layer 2 Tunneling Protocol in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Layer 2 Tunneling Protocol means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Layer 2 Tunneling Protocol out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Layer 2 Tunneling Protocol in simple terms?

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 provi…

Why does Layer 2 Tunneling Protocol matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Layer 2 Tunneling Protocol?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Layer 2 Tunneling Protocol.

Tags

  • Internet Standards
  • Internet protocols
  • Tunneling protocols
  • Virtual private networks

Keep exploring