Introduction to the link layer

The link layer moves a network-layer datagram between adjacent nodes (hosts, switches, routers, or Wi-Fi access points).

Types of network links

  1. point-to-point links:
    • connect one sender to one receiver over a dedicated link
    • examples:
      • two routers connected by a long-distance link
      • a computer connected to an Ethernet switch
    • common protocols:
      • HDLC (High-Level Data Link Control)
      • PPP (point-to-point protocol)
  2. broadcast links:
    • shared by multiple senders and receivers
    • examples:
      • wireless LANs
      • satellite networks
      • hybrid fiber-coaxial (HFC) networks
    • common protocols:
      • Cable Internet: DOCSIS over hybrid fiber-coaxial (HFC) networks
      • Wi-Fi

Terminology

Travel analogy

Aspect Description

Trip planning

A travel agent plans a tourist's trip from Princeton (New Jersey) to Lausanne (Switzerland) by booking:

  1. a limousine from Princeton to JFK Airport
  2. a flight from JFK Airport to Geneva Airport
  3. a train from Geneva Airport to Lausanne

Responsibility

Each transportation company is responsible only for its own segment:

  • Limousine company: Princeton → JFK Airport
  • Airline: JFK Airport → Geneva Airport
  • Swiss rail service: Geneva Airport → Lausanne

Each segment

  • connects two adjacent locations
  • is managed by a different transportation company
  • uses a different mode of transportation (limousine, plane, or train)

Key idea

Although services vary, each segment just moves the passenger from one adjacent stop to the next.

In this analogy

  • the tourist is a datagram
  • each transportation segment is a link
  • the transportation mode is a link-layer (layer 2) protocol
  • the travel agent is a network-layer (layer 3) routing protocol

Services provided by the link layer

Basic service:

Other possible services:

Service Description

Framing

  • encapsulate each network-layer datagram within a link-layer frame before transmission over the link
  • the frame format depends on the link-layer protocol

Link access

  • controls how devices share and use the communication link
  • e.g., Medium Access Control (MAC) protocol

Reliable delivery

  • ensures a datagram reaches the next node without errors
  • uses acknowledgments (ACKs) and retransmissions if needed:
    • mainly useful on unreliable links, such as wireless networks
    • often omitted on reliable wired links (fiber, coaxial cable, twisted-pair copper)

Error detection and correction

  • detects or corrects bit errors during transmission introduced by signal attenuation or electromagnetic noise
  • many link-layer protocols detect bit errors so corrupted frames are not forwarded
  • some protocols can also correct certain errors

Where is the link layer implemented?

The link layer is mostly implemented in a chip called a network adapter also called a network interface controller (NIC).

This chip handles tasks like:

The link-layer uses both hardware and software:

Previous ICMP All ⏎ Next Error-detection and error-correction techniques

A Kemar Joint