72
SMU CSE 4344 More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

Embed Size (px)

DESCRIPTION

More on the link layer Logical Link Control (LLC) Medium Access Control (MAC). link layer functions. services un-ACKed connectionless ACKed connectionless ACKed connection oriented framing encoding error control flow control (vs. congestion control?) MAC. - PowerPoint PPT Presentation

Citation preview

Page 1: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

More on the link layer

Logical Link Control (LLC)

Medium Access Control (MAC)

Page 2: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

link layer functions

• services– un-ACKed connectionless – ACKed connectionless– ACKed connection oriented

• framing• encoding• error control• flow control (vs. congestion control?)• MAC

Page 3: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

point-to-point vs. broadcast media

• point-to-point– PPP for dial-up access– point-to-point link between Ethernet switch and host

• broadcast (shared wire or medium)– traditional Ethernet– 802.11 wireless LAN

Page 4: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

data link protocols (logical)

• unrestricted simplex• simplex stop-and-wait• simplex for noisy channel

– discussion

• sliding window protocols

Page 5: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

sliding window protocols

• piggybacked ACKs– less overhead (bandwidth, interrupts, buffering, ...)– how to deal with timeouts?

• sequence numbers• sending window• receiving window

Page 6: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

1-frame sliding window

Page 7: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

1-bit sliding window

(seq#, ACK#, pkt#); ACK#: last OK frame

Page 8: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

pipelining

• idea– do not block transmitter during the roundtrip time– increase the window size

• what happens with errors– go back n– selective repeat

Page 9: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

go back n

• if error– receiver discards subsequent frames– no ACKs for the discarded frames– receiver window size = 1– transmitter times-out, resends unACKed frames– inefficient if the error rate is high

Page 10: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

selective repeat

• if error– receiver still stores the subsequent good frames– transmitter retransmits the bad frame– receiver window size > 1– efficient at higher error rate– trade-off between bandwidth and buffer space

Page 11: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

sliding window schemes

“go back n”

(a

(a) “go back n” (frames received out of sequence discarded)(b) “selective repeat” (frames received out of sequence buffered) (after error, receiver may NAK frame 2 to short-circuit sender timeout)

Page 12: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

3-bit sequence numbers

Page 13: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

line utilization

• b = channel capacity in bits per second

• f = frame size in bits

• R = round-trip propagation time

• frame transmission time = (f / b) seconds

• line utilization = f / (f + bR)

• if f < bR, then efficiency < 1/2

Page 14: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

window size

• sender needs n buffers for window size n• go back n

– sender needs enough buffers for• timeout• RTT of frame + NACK

• selective repeat– window size = floor((maxseq+1)/2)– why?

• optimal window size, sequence#s

Page 15: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

(review this in detail)protocol specification by FSM

(a) state diagram; key to state ovals: (SRC), S in {0,1}, R in {0,1}, C in {0,1,A,-}(b) transition chart

(from Tanenbaum text)

Page 16: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

(review this in detail)Petri net for simplex “wait for ACK”

• [Tanenbaum 4/e, 233]• places, tokens, transitions, input/output arcs• tokens not conserved• no composite states:

sender, receiver, channel separated• transitions may be viewed as a “grammar”

Page 17: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

multiple access protocols

• single shared broadcast channel

– multiple nodes can speak at once

– collisions lead to garbled data

• multiple access protocol (medium access control)

– distributed algorithm for sharing the channel

– algorithm determines which node can transmit

Page 18: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

types of MAC

• static bandwidth allocation: channel partitioning– TDM– FDM– CDMA (see handout)– problems?

• deterministic sharing– token-passing– polling– reservations, scheduling

• contention– random access: allow collisions, and then recover– ALOHA, CSMA, more

Page 19: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

“taking turns” MAC protocols

polling

•master node “invites” slave nodes to transmit in turn

•concerns:– polling overhead – latency– single point of failure

(master)

token passing

• control token passed from one node to next sequentially

• token message

• concerns:– token overhead – latency– single point of failure (token)

Page 20: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

token rings

• (a) transmit token after frame is sent• (b) transmit token while frame is being stripped

Page 21: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

ring topology

• self-healing ring (SHR)

Page 22: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

random access protocols

• when node has packet to send– transmit at full channel data rate– no a priori coordination among nodes

• >= 2 nodes transmit concurrently “collision”➜

• random access MAC protocol specification– collision detection– collision recovery

• examples – ALOHA, slotted ALOHA– CSMA, CSMA/CD, CSMA/CA

Page 23: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

key ideas of random access

• station model– n independent stations (nodes, terminals)

• single channel– all transmission/reception on shared channel– nodes have equivalent ability– node priority may vary dynamically

• time– continuous– slotted (discrete, timed intervals, “master clock”)

Page 24: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

key ideas of random access

• carrier sense (or not)– listen before speaking, and don’t interrupt– check if someone else is already sending data ...– … wait till the other node is done

• collision detection (or not) – if someone else starts talking at the same time, stop– if the data on the wire is garbled ...– ... another node is transmitting, too, so stop

• randomness– don’t start talking again right away– wait for a random time before trying again

Page 25: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

pure ALOHA

in pure ALOHA, frames are transmitted at completely arbitrary times

temporal collisions destroy colliding frames

send when data arrives; if collision, random delay, resend

Page 26: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

ALOHA

Vulnerable period for the shaded frame.

shaded frame vulnerability period modeled as two frame times

intuition: collisions of partially-overlapping frames

slotted ALOHA: during contention, frames collide in some single slot/frame time

Page 27: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

slotted ALOHA

assumptions

•all frames same size

• time divided into equal slots (time to transmit a frame)

•nodes start to transmit frames only at start of slots

•nodes are synchronized

• if two or more nodes transmit, all nodes detect collision

operation

•when node obtains fresh frame, transmits in next slot

•no collision: node can send new frame in next slot

•collision: node retransmits frame in each subsequent slot with probability p until success

Page 28: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

pure vs. slotted ALOHA

Throughput versus offered traffic for ALOHA systems.

max throughput: ALOHA 1/(2e) ~ 18%; slotted ALOHA 1/e ~ 37%

Page 29: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

CSMA: carrier sensing multiple access• 1-persistent CSMA:

– if idle, send; ... ; if collision, random delay, sense ...– propagation delay → collision– “two nodes waiting for idle” → collision– idea behind Ethernet LAN protocol

• non-persistent CSMA: – if idle, send; else, random delay

• p-persistent CSMA (slotted time): – if idle, send with probability p; if collision, random

delay– slotted transmission discipline

Page 30: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

persistent and non-persistent CSMA

non-persistent CSMA: very good throughput under high load0.01-persistent CSMA: best throughput

tolerance for delay can enhance throughput in chaotic environments

Page 31: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

collision-free protocols

basic bit-map protocol

- contention slots are constant overhead- overhead means less as frames get large

Page 32: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

collision-free protocols

binary countdown protocol (log2n bits); dash indicates silence.

(AND of addresses)

addresses:

Page 33: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

limited-contention protocols

Acquisition probability for a symmetric contention channel.

- motivation for hybrid deterministic/probabilistic protocols- idea: allow contention at low load, use taking-turns at high load

~ 1/e

throughput of contention protocols under high load

Page 34: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

adaptive tree walk protocol

tree for eight stations: depth first search, LR

nodes

- at idle, each station ready to send data signals 1 or not, according to a clever plan- example: only station H ready to send: slot1 = 1 (candidate sender is under 1), s2 = 0 (not under 2), s3 = 0 (not under 6), s4 = 0 (not G), s5 = 1 (H).- for binary tree, sender is chosen in O(log

2(n)) time

Page 35: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

WDM access protocol (one example out of 100s)

Wavelength division multiple access.

- fixed data output & control input- tunable data input & control output- on control channel: control slots; on data channel, status slot- classes of traffic: CBR, VBR, datagram

Page 36: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

IEEE 802.3: Ethernet

• [Metcalfe, Boggs, 1976]: first LAN, “the Ethernet”• TCP/IP/Ethernet: a connectionless stack• simple to use, reliable, cheap, scalable• LAN collision domains (broadcast) (bus, hub) • store-and-forward switches, point-to-point links• 10 Mbps, 100 Mbps, gigabit, 10 gigabit• becoming very rare for network paths not to

traverse any Ethernet links

Page 37: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

“original flavor” 10 Mbps Ethernet

common kinds of Ethernet cabling

only twisted pair and fiber are still being deployed(except in specialized environments)

Page 38: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

10 Mbps (“plain”) Ethernet PHY

(a) and (b) (10base5, 10base2) seldom deployed(c) 10baseT hub is a collision domain

Page 39: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

10 Mbps Ethernet PHY topologies

- broadcast medium- same logical topologies- no loops (rings) allowed

-no path has > 4 repeaters

- network diameter <= 2500 m

Page 40: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

intermission

Page 41: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

Ethernet MAC sublayer protocol

- no two nodes are farther apart than A and B- τ is the diameter of the network, the one-way propagation time between the farthest nodes

Page 42: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

Ethernet: CSMA/CD (Collision Detection)

contention slot time = 2τ = max(signal round-trip time)(10 Mbps Ethernet slot = 51.2 microsec = 512 100-nanosec-wide bits)

sense; if idle, send; if collision, abort, random delay

contention period: series of slot-length collisions/jamming frameshalf-duplex: cannot receive while listening for own transmission collision

Page 43: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

performance of Ethernet

efficiency of 10 Mbps Ethernet, 512-bit slot times

Page 44: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

switched Ethernet vs. hub

half-duplex

full-duplex point-to-point links

“collision domain”

Page 45: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

100 Mbps (“fast”) Ethernet cabling

T4: 4 each, “cat 3” unshielded twisted pairs, 3 pairs simplex forward, 1 pair simplex reverse (dynamic) ternary encoding (trits, not bits)TX: 2 each cat 5 unshielded twisted pairs (opposing simplex)FX: 2 multimode fiber (opposing simplex), point-to-point links only

Page 46: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

gigabit Ethernet cabling

100 m and 25 m copper segments used, e.g., in data center or POP of ISP

Page 47: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

Ethernet MAC sublayer framing

(a) DIX (Digital, Intel, Xerox)(b) IEEE 802.3

preamble: for receiver clock syncdest addr: 0* unicast, 1* multicast, all 1s broadcast

type: network protocol to call at dest, ORlength: # data bytes (“type” embedded in data)

pad: frame length (without preamble) >= 64 bytes = 512 bits

Page 48: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

Why MAC is a sublayer

• Ethernet (one of the MAC protocols) interfaces directly to network layer (IP)

• the Ethernet MAC offers best-effort, no-guarantee, datagram service

• this is great for TCP/IP, nothing else is needed

• but, other network layer protocols expect link layer error control and flow control services

• IEEE 802.2 (LLC) supports these services, built on various MAC sublayers (e.g., Ethernet)

Page 49: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

IEEE 802.2: logical link control

(a) network layer sees the same LLC, regardless of type of MAC

(b) LLC encapsulates network layer packet,

MAC encapsulates LLC frame before passing to PHY

PHY

- Ethernet MAC sends best effort datagrams

- LLC supports flow-control & error-control

PHY

Page 50: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

wireless LANs

• IEEE 802.11 (“WiFi”)• Distributed Coordination Function (DCF )

– CSMA-CA

• Point Control Function (PCF) – centrally controlled by basestation (access point)

• short-range RF (rooms, battlefields) • ad hoc and basestation flavors• many PHY layer options

– 802.11, 802.11a, 802.11b, 802.11g, 802.11n (pre-std)

Page 51: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

The 802.11 Protocol Stack

1997 1999 2001

1-2 Mbps 11 Mbps 54 Mbps54 Mbps

Page 52: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

CSMA fails off the wire

C wants to send to B

channel sounds clear to C

C cannot hear A

the “hidden station problem”

C wants to send to D

channel sounds busy to C

D cannot hear B

the “exposed station problem”

(not “unhidden station problem”)

why CSMA falls short in packet radio networks and mobile ad hoc networks

Page 53: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

wireless LAN protocols (CSMA-CA)

MACA(W), multiple access collision avoidance:

A sends RTS to B, B sends CTS to A

all potential “interrupters” hear B's CTS, wait for frame

(“W”ireless: sense first, ACK every frame, sophisticated backoff)

Page 54: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

802.11 MAC sublayer protocol

The use of virtual channel sensing using CSMA/CA.

- C hears A’s RTS … D hears B’s CTS (NAV: transmitter quiet time)

- notice how politely C and D each set aside time for A and B

Page 55: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

802.11 MAC sublayer protocol

A fragment burst.

- A sends a burst to B … C and D wait for it

- after each data or control frame, a system of delay intervals …

Page 56: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

802.11 delay timing

• how can PCF and DCF protocols coexist?

• end of frame or ACK starts series of timers

• {Short, PCF, DCF, Expanded} InterFrame Spacing

• Short for burst fragment, receiver ACK, or CTS

• PCF for central control (beacons, polling)

• DCF for contention (RTS)

• Extended for bad frame reporting (NAK)

Page 57: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

802.11 MAC sublayer protocol

Interframe spacing in 802.11.

FRAME

dead ACK

CTS

fragment

central ctl RTS NAKACK

the starting guns go off at different times for different frame types

PCF and DCF coexist in a single collision domain:

Page 58: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

RF signaling

• RF signal strength at node's own antenna• 2-antenna implementation?• shared channel• RF signal strength from distant antennae• how to detect?

– interference– fading– multipath

Page 59: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

IEEE 802.11• access point infrastructure largely 802.11

– 100 Million 802.11 chipsets per annum (out of date statistic)– strong application development efforts

• IEEE 802.11 spec: CSMA-CA– RTS/CTS channel reservation, ACK

• explicit ACK– CSMA sender will not hear interference, fading, multipath

• contention: short RTS frames, collisions waste less• if sender’s CTS times out, it knows the RTS failed

– random backoff (countdown proceeds while channel is idle)

Page 60: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

802.11 distribution services

• association (connect to access point cell)

– beacons in the “jungle”; “there can only be one”

– next, DHCP discovery

• disassociation

• reassociation (cell-to-cell handover)

• distribution (how to route frames)

• integration (802.11 external network format)

Page 61: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

802.11 intracell services

• authentication (challenge frame, key, encryption)

– if invoked, a pre-condition for association

• deauthentication

• privacy (data encryption)

• data delivery (best effort)

Page 62: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

802.11 data frame

- type: data, ctl, mgt; subtype: RTS, CTS, probe (scanning for new AP)

- to DS/from DS: activation of address 3, 4 for “distribution system” APs

- MF: “more frags”; retry; more (frames)

- duration, sequence

Page 63: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

broadband wireless comparison ...• 802.11 (WiFi)

– mobile Ethernet LAN– centralized infrastructure (APs and cell architecture)– or, distributed architecture

• ad hoc• mobile ad hoc (MANET)

– best effort delivery– short range, half-duplex– power concerns– limited budget (commodotized)

Page 64: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

... broadband wireless comparison

• 802.16 (WiMax)

– wireless “local loop” for buildings

– metro area coverage, full duplex

– many users aggregated per endpoint

– connection oriented

– FEC (Hamming codes), security

– base station control (centralized control)

– fixed, directional antennas

Page 65: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

802.16 Protocol Stack

modulation schemes vary with range to end-points

(what is wrong with this picture?)

Page 66: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

The 802.16 Physical Layer

The 802.16 transmission environment.

Page 67: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

The 802.16 Physical Layer

- shown: TDD (time division duplexing) PHY frames- not shown: FDD (frequency division duplexing)- millimeter RF waves are not omnidirectional

Page 68: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

The 802.16 Frame Structure

(a) A generic frame. (b) A bandwidth request frame.

Page 69: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

802.16 MAC sublayer protocolservice classes

• constant bit rate service (regular slots)

• real-time variable bit rate service (regular polling)

• non-real-time variable bit rate service (frequent polling)

• best effort service (contend for request slots)

• aggregator switch at subscriber building may negotiate with base station for all users, and arbitrate received bandwidth between users

Page 70: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

personal area networks (PANs)

• Bluetooth (Ericsson, IBM, Intel, Nokia, Toshiba)

• “cable replacement”

• specifies complete networking stack

• TDM; 10 m; 2.4 Ghz FHSS; 79 1-MHz channels

• IEEE 802.15– only PHY & LL

• interferes with 802.11 (2.4 GHz)

• master/slave “piconets”

• slaves can bridge piconets to form “scatternets”

Page 71: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

remarks

• networks run on various link layer technologies– point-to-point links vs. shared media– wide varieties within each class

• link layer performs key services– encoding, framing, and error detection– optionally error correction and flow control

• shared media introduce interesting challenges– decentralized control over resource sharing– partitioned channel, taking turns, and random access– Ethernet as a wildly popular example

• next: switches and bridges

Page 72: More on the link layer Logical Link Control (LLC) Medium Access Control (MAC)

SMU CSE 4344

summary/glossary