The Data Link Layer Flashcards
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
- datagrams are transferred by different link protocols over different links:
- e.g., Ethernet on first link, frame relay on
intermediate links, 802.11 on last link
- e.g., Ethernet on first link, frame relay on
- each link protocol may provide quite different
services- e.g., may or may not provide reliability
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
- abstraction of passing a datagram over a link
- “higher” level mechanisms like flow control, reliability
Link layer sub-layers
medium access control (MAC) sublayer
- interfaces directly with the hardware
- e.g. mediates access to a physical broadcast medium
- MAC addresses are used in frame headers to identify source, destination
Where is the link layer implemented?
- in each and every node!
- in an “adaptor” (aka network interface card NIC) or on a chip
- Ethernet card, 802.11 card; Ethernet chipset
- implements link, physical layer
- attaches into host’s system bus
- combination of hardware, software, firmware
Two main types of “links”
- point-to-point
- PPP for dial-up access
- point-to-point link between Ethernet switch, host
- frame relay
- broadcast (shared wire or medium)
- old-fashioned Ethernet
- 802.11 wireless LAN
- this is our focus…
MAC protocols for broadcast media
Taxonomy: we’ll look at two main classes:
- channel partitioning
- divide channel into smaller “pieces” (time slots, frequency bands)
- allocate a piece to a broadcast link’s channel for exclusive use by a node
- random access
- channel not divided, allow collisions
- … and then “recover” from collisions
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
- when a node has a frame to send
- transmit at full channel rate R
- no a priori coordination among nodes
- two or more transmitting nodes ➜ “collision”,
- random access MAC protocol specifies:
- how to detect collisions
- how to recover from collisions (e.g., via delayed retransmissions)
- examples of random access MAC protocols:
- CSMA/CD
- but also ALOHA, CSMA, CSMA/CA, …
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
- plus, frame is not delivered – will need to
be re-sent by higher-level protocol if reliability is needed
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
- collision detection:
- easy in wired LANs: compare transmitted, received signals
- difficult in wireless LANs: received signal strength is overwhelmed by local transmission strength
- human analogy: the polite conversationalist
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