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
- 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)
- 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
- node: any device that runs a link-layer (layer 2) protocol
- hosts
- routers
- switches
- Wi-Fi access points
- link: a communication channel connecting two adjacent nodes
- a Wi-Fi link between a host and a Wi-Fi access point
- an Ethernet link between an access point and a link-layer switch
- link-layer frame: encapsulates a network-layer packet (e.g., IP datagram) as payload
Travel analogy
| Aspect | Description |
|---|---|
Trip planning |
A travel agent plans a tourist's trip from Princeton (New Jersey) to Lausanne (Switzerland) by booking:
|
Responsibility |
Each transportation company is responsible only for its own segment:
|
Each segment |
|
Key idea |
Although services vary, each segment just moves the passenger from one adjacent stop to the next. |
In this analogy |
|
Services provided by the link layer
Basic service:
- move a network-layer datagram
- between two directly connected (adjacent) nodes
- over a single communication link
Other possible services:
| Service | Description |
|---|---|
Framing |
|
Link access |
|
Reliable delivery |
|
Error detection and correction |
|
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:
- framing
- controlling access to the link
- detecting errors
The link-layer uses both hardware and software:
- most of it runs in hardware on the network adapter
- some parts run as software on the computer's CPU