760 likes | 1.11k Views
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.
E N D
More on the link layerLogical 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
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
data link protocols (logical) unrestricted simplex simplex stop-and-wait simplex for noisy channel discussion sliding window protocols
sliding window protocols piggybacked ACKs less overhead (bandwidth, interrupts, buffering, ...) how to deal with timeouts? sequence numbers sending window receiving window
1-bit sliding window (seq#, ACK#, pkt#); ACK#: last OK frame
pipelining idea do not block transmitter during the roundtrip time increase the window size what happens with errors go back n selective repeat
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
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
sliding window schemes “go back n” “go back n” (frames received out of sequence discarded) “selective repeat” (frames received out of sequence buffered) (after error, receiver may NAK frame 2 to short-circuit sender timeout) (a
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
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
(review this in detail)protocol specification by FSM state diagram; key to state ovals: (SRC), S in {0,1}, R in {0,1}, C in {0,1,A,-} transition chart (from Tanenbaum text)
(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”
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
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
“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 tokenpassed from one node to next sequentially • token message • concerns: • token overhead • latency • single point of failure (token)
token rings (a) transmit token after frame is sent (b) transmit token while frame is being stripped
ring topology self-healing ring (SHR)
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
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”)
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
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
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
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
pure vs. slotted ALOHA Throughput versus offered traffic for ALOHA systems. max throughput: ALOHA 1/(2e) ~ 18%; slotted ALOHA 1/e ~ 37%
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
persistent and non-persistent CSMA non-persistent CSMA: very good throughput under high load 0.01-persistent CSMA: best throughput tolerance for delay can enhance throughput in chaotic environments
collision-free protocols basic bit-map protocol - contention slots are constant overhead - overhead means less as frames get large
collision-free protocols binary countdown protocol (log2n bits); dash indicates silence. addresses: (AND of addresses)
limited-contention protocols Acquisition probability for a symmetric contention channel. throughput of contention protocols under high load ~ 1/e - motivation for hybrid deterministic/probabilistic protocols - idea: allow contention at low load, use taking-turns at high load
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(log2(n)) time
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
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
“original flavor” 10 Mbps Ethernet common kinds of Ethernet cabling only twisted pair and fiber are still being deployed (except in specialized environments)
10 Mbps (“plain”) Ethernet PHY (a) and (b) (10base5, 10base2) seldom deployed (c) 10baseT hub is a collision domain
10 Mbps Ethernet PHY topologies - broadcast medium - same logical topologies - no loops (rings) allowed • no path has > 4 repeaters - network diameter <= 2500 m
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
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) contention period: series of slot-length collisions/jamming frames half-duplex: cannot receive while listening for own transmission collision • sense; if idle, send; if collision, abort, random delay
performance of Ethernet efficiency of 10 Mbps Ethernet, 512-bit slot times
switched Ethernet vs. hub half-duplex “collision domain” full-duplex point-to-point links
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
gigabit Ethernet cabling 100 m and 25 m copper segments used, e.g., in data center or POP of ISP
Ethernet MAC sublayer framing (a) DIX (Digital, Intel, Xerox) (b) IEEE 802.3 preamble: for receiver clock sync dest addr: 0* unicast, 1* multicast, all 1s broadcast type: network protocol to call at dest, OR length: # data bytes (“type” embedded in data) pad: frame length(without preamble) >= 64 bytes = 512 bits
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)
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 - Ethernet MAC sends best effort datagrams - LLC supports flow-control & error-control PHY PHY
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)