13 Linklayerintro
13 Linklayerintro
Goals:
r understand principles
Overview:
r error detection, correction r multiple access protocols and r link layer addressing, ARP
m m m m m
m m
sharing a broadcast channel: multiple access link layer addressing error detection, correction
LANs
r specific link layer technologies: Ethernet hubs, bridges, switches IEEE 802.11 LANs PPP ATM
r instantiation and
5: DataLink Layer
5 a-1
5: DataLink Layer
5 a-2
Link Layer
r r
Multiple access requires addressing Both require rules for sharing the links
M Ht M Hn Ht M Hl Hn Ht M
r
data link protocol phys. link adapter card
5: DataLink Layer 5 a-3
Examples:
m m
Hl Hn Ht M frame
Point-to-point (single wire, e.g. PPP, SLIP) Broadcast (shared wire or medium; e.g, Ethernet or wireless) m Switched (e.g., switched Ethernet, ATM etc)
5: DataLink Layer
5 a-4
Communication Technologies
Data Model?
Packet Mode bursty discrete transmissions r Circuit Mode continuous traffic
r
Wired LANs, Wireless LANs (RF or light), Cellular Telephones, Satellites, Packet Radio, Wired Telephone, Voice
5: DataLink Layer
5 a-5
5: DataLink Layer
5 a-6
Multiple Access
Multiple Access - fundamental to communication r Two or more communicators use a shared medium to share information r Multiple Access Protocol - Rule for sharing medium to facilitate communication?
r
m
5: DataLink Layer
5 a-7
i.e., determine when station can transmit r Note: communication about channel sharing must use channel itself! (or be agreed upon ahead of time) r what to look for in multiple access protocols: synchronous or asynchronous m information needed about other stations
m
divide channel into smaller pieces (time slots, frequency) allocate piece to node for exclusive use
r Random Access
m m
r unused slots go idle r example: 6-station LAN, 1,3,4 have pkt, slots 2,5,6
frequency bands
idle
time
TDMA vs FDMA
r In TDMA, each station gets the whole channel spectrum
r all users share same frequency, but each user has own
satellite,etc)
r decoding: inner-product of encoded signal and chipping r allows multiple users to coexist and transmit
sequence
determines what portions of the channel spectrum they use and for how long to avoid collision with others when and in what way!
m
r All require lots of coordination about who speaks What if didnt want to coordinate things so tightly?
next slot
by any of N nodes S = Prob (only one transmits) = N p (1-p)(N-1) = 1/e = .37 as N -> infty Success (S), Collision (C), Empty (E) slots
5: DataLink Layer 5 a-17
= 1/(2e) = .18
Slotted Aloha
0.2 0.1
Pure Aloha
0.5
G = offered load = Np
1.0
1.5
CSMA collisions
collisions can occur:
propagation delay means two nodes may not year hear each others transmission
Persistent CSMA: retry immediately with probability p when channel becomes idle (may cause instability) m Non-persistent CSMA: retry after random interval
m
collision:
note:
collisions detected within short time colliding transmissions aborted, reducing channel wastage persistent or non-persistent retransmission
r collision detection: m easy in wired LANs: measure signal strengths, compare transmitted, received signals m difficult in wireless LANs: receiver shut off while transmitting r human analogy: if start talking at same time some one
Token passing:
r control token passed from
inefficient at low load: delay in channel access, 1/N bandwidth allocated even if only 1 active node!
r Request to Send, r concerns: m polling overhead m latency m single point of failure (master)
r token message r concerns: m token overhead m latency m single point of failure (token)
Random access MAC protocols m efficient at low load: single node can fully utilize channel m high load: collision overhead Polling style protocols (taking turns) look for best of both worlds!
5: DataLink Layer 5 a-25
Reservation-based protocols
Distributed Polling:
r time divided into slots
m
reservation slot time equal to channel end-end propagation delay m station with message to send posts reservation m reservation seen by all stations r after reservation slots, message transmissions ordered by known priority
Random access
ALOHA, S -ALOHA, CSMA, CSMA/CD carrier sensing: easy in some technologies (wire), hard in others (wireless) CSMA/CD used in Ethernet polling from a central cite, token passing
Polling Style
Error Detection
EDC= Error Detection and Correction bits (redundancy) D = Data protected by error checking, may include header fields Error detection not 100% reliable! protocol may miss some errors, but rarely larger EDC field yields better detection and correction
Smart Redundancy
In general, more bits of redundancy the stronger the error detection/correction abilities but smart redundancy r What if transmitted another copy of the same thing?
r
m
contents
Receiver: r compute checksum of received segment r check if computed checksum equals checksum field value
Example: Parity
Single Bit vs Two Dimensional Two Dimensional Bit Parity : Detect and correct single bit errors Bit Parity: Example of using Want even number of 1s in each dimension redundant bits intelligently for increased error detection/correction capability!
Tailored to type and frequency of errors expected in the specific technology being used
Some error m Some error
m
technologies (like fiber) have very low rates technologies (like wireless) have high rates
How to we tailor the number of bits to use and *how* we use them to get the desired effect??
5: DataLink Layer 5 a-33
Beyond parity?
How can we generalize this example of single vs double bit parity? r Is there a theory of using redundant bits efficiently based on the types of errors we expect to find? r Cyclic Redundancy Checks (CRC) views both the data and the redundant bits as binary polynomials and ensures that they satisfy a certain mathematical relationship
r
5: DataLink Layer 5 a-35
r goal: choose r CRC bits, R, such that m <D, R> = D* 2r XOR R (shift D over place R in the end) m <D,R> exactly divisible by G (modulo 2) m receiver knows G, divides <D,R> by G. If non -zero remainder: error detected! m can detect all burst errors less than r+1 bits r widely used in practice (ATM, HDCL)
CRC Example
Want: D.2r XOR R = nG equivalently: if we divide D.2r by G, want reminder R
CRC-12: X^12+X^11+X^3+X^2+X+1
transmission streams and both result in 16 bit FCS. Considered to give adequate protection for most applications.
m m
R = remainder[
D.2r ] G
5: DataLink Layer 5 a-37
the local network standards committee (IEEE802) and in some DOD applications.
m
5 a-38