Link layer: introduction
terminology:
- nodes: hosts and routers
- links: communication channels that connect adjacent nodes along a communication path
* wired links
* wireless links
* LANs
- frame: a layer-2 packet that encapsulates a datagram
data-link layer has responsibility of transferring a datagram from one node to another phy-layer-adjacent node over a link
Link layer: context
transportation analogy:
- trip from Lancaster to Lausanne
* Lancaster to MCR: taxi
* MCR to Geneva: plane
* Geneva to Lausanne: train
- datagram = tourist
- communication link = transport segment
- link-layer protocol = transportation mode
- routing algorithm = travel agent
Link layer sub-layers
logical link control (LLC) sublayer
Link layer sub-layers
medium access control (MAC) sublayer
Where is the link layer implemented?
Two main types of “links”
MAC protocols for broadcast media
Taxonomy: we’ll look at two main classes:
Channel partitioning MAC protocols: TDMA
TDMA: time division multiple access
§ access to channel is structured in “rounds” of time
§ each node, or “station”, gets a fixed length slot in each round (slot length = frame transmission time)
§ example: 6-station LAN, 1,3,4 have frames to send, slots 2,5,6 idle
Channel partitioning MAC protocols: FDMA
FDMA: frequency division multiple access
- channel spectrum is divided into frequency bands
- each station is assigned a fixed frequency band
- example: 6-station LAN, 1,3,4 have packet to send, frequency bands 2,5,6 idle
Random-access protocols
CSMA (carrier sense multiple access)
CSMA: listen before transmit:
if channel sensed idle: transmit entire frame
if channel sensed busy: defer transmission
human analogy: don’t interrupt others when
they’re talking!
CSMA collisions
§ collisions can still occur: propagation delay means two nodes may not hear each other’s
transmissions
§ collision: entire frame transmission time wasted
CSMA/CD (collision detection)
CSMA/CD: carrier sensing, deferral as in CSMA
* collisions detected within short time
* colliding transmissions are aborted, thereby reducing channel wastage
CSMA/CD (collision detection)
Ethernet
the “dominant” wired LAN technology:
- single chip, multiple speeds (e.g., Broadcom BCM5761)
- first widely used LAN technology
- simple, cheap
- has managed to keep up with speed race: 10 Mbps – 10 Gbps
Ethernet CSMA/CD algorithm
Ethernet: physical topology
Ethernet frame structure
sending NIC encapsulates an IP datagram in an Ethernet frame
preamble: 8 byte pattern used to synchronize receiver, sender clock rates
- other fields…
Ethernet frame structure (more)
Ethernet: connectionless, unreliable
MAC addresses in LANs
ARP: address resolution protocol
Question: how to determine an interface’s MAC address, knowing its IP address?
ARP table: each IP node (host, router) on LAN has a table
* IP/MAC address mappings for local LAN
nodes:
< IP address; MAC address; TTL>
* TTL (Time To Live): time after which address
mapping will be forgotten (typically 20
min)
ARP protocol: same LAN
Addressing: routing to another LAN
walkthrough: send datagram from A to B via R