Lec6-Link Layer 链路层和局域网
Goals
- Understand principles behind link layer services:
- error detection, correction
- sharing a broadcast channel: multiple access(多点接入)
- link layer addressing
- local area networks(局域网): Ethernet, WLAN
- 可靠数据传输,流量控制
- instatiation, implementation of various link layer technologies
Review:
Introduction
Link layer: introduction
terminology:
- hosts and routers: nodes
- communication channels that connect adjacent nodes along communication path: links
- wired
- wireless
- LANs
- layer-2 packet: frame, encapsulates datagram
link layer has responsibility of transferring datagram from one node to physically adjacent node over a link
Link layer: context
- datagram transferred by different link protocols over different links:
- e.g., WiFi on first link, Ethernet on next link
- each link protocol provides different services
- e.g., may or may not provide reliable data tranasfer over link
transportation analogy:
- trip from Princeton to Lausanne
- limo: Princeton to JFK
- plane: JFK to Geneva
- train: Geneva to Lausanne
- tourist = datagram
- transport segment = communication link
- transport mode = link-layer protocol
- travel agent = routing algorithm
Link layer: services
- framing, link access:
- encapsulate datagram into frame, adding header, trailer
- channel access if shared medium
- “MAC” addresses in frame headers identify source, destination (different from IP address!)
- reliable delivery between adjacent nodes
- we already know how to do this!
- seldom used on low bit-error links
- wireless link: high error rates
- Q: why both link-level and end-end reliability?
Link layer: services(more)
- flow control:
- pacing between adjacent sending and receiving nodes
- error detection:
- errors caused by single attenuation, noise.
- receiver detects errors, signals retransmission, or drops frame
- error correction:
- receiver identifies and corrects bit error(s) without retransmission
Where is the link layer implemented?
- in each-and-every host
- link layer implemented in network interface card(NIC) or on a chip
- Ethernet, WiFi card or chip —— (CPU)
- implements link, physical layer
- attaches into host’s system buses
- combination of hardware, software, firmwawre
Interfaces communicating
Error Detection, correction
Error detection
EDC: error detection and correction bits (e.g., redundancy)
D: data protected by error checking, may include header fields
数据检查并非百分百可靠
Parity checking
Internet checksum (review)
Cyclic Redundancy Check(CRC)
CRC example
3. 两边同除G得到余数 «R=
Mulitple access protocols
Multiple access links, protocols
A day in the life of a web request
Synthesis: a day in the life of a web request
A day in the life: scenario
A day in the life: connecting to the Internet
A day in the life … ARP(befor DNS, before HTTP)
uisng DNS
TCP connection carrying HTTP
HTTP request/reply