CNT 4007 - Computer Networks I: Link Layer Lecture (Fall 2024) PDF

Document Details

BeauteousGlockenspiel

Uploaded by BeauteousGlockenspiel

University of Florida

2024

Patrick Traynor

Tags

computer networks link layer networking protocols data communication

Summary

These are lecture notes for a Computer Networks course on the Link Layer, covering topics such as error detection, multiple access protocols, and random access protocols. The lecture is from Fall 2024.

Full Transcript

CNT 4007- Computer Networks I: Link Layer Professor Patrick Traynor Fall 2024 Florida Institute for Cyber...

CNT 4007- Computer Networks I: Link Layer Professor Patrick Traynor Fall 2024 Florida Institute for Cybersecurity (FICS) Research Reminders/Notes We’re getting there folks: Homework 3 will be posted on Thursday. Project 3 will be posted next Tuesday. Midterm grading: Started yesterday, making progress. I will keep you posted. Keep an eye on the calendar. Prompt: Can you please create an image of a sweaty runner on a track who is two thirds of the way to the nish line? Florida Institute for Cybersecurity (FICS) Research 2 fi Link Layer and LANs: Our Goals Understand principles behind link layer services: ▪ Instantiation, implementation of various link layer technologies error detection, correction sharing a broadcast channel: multiple access link layer addressing local area networks: Ethernet, VLANs Datacenter networks Florida Institute for Cybersecurity (FICS) Research 3 Link Layer, LANs: Roadmap ▪ Introduction ▪ error detection, correction ▪ multiple access protocols ▪ LANs addressing, ARP Ethernet switches VLANs ▪ link virtualization: MPLS ▪ a day in the life of a web request ▪ data center networking Florida Institute for Cybersecurity (FICS) Research 4 Link Layer: Introduction Terminology: mobile network ▪ hosts and routers: nodes national or global ISP ▪ communication channels that connect adjacent nodes along communication path: links wired wireless LANs ▪ Layer-2 packet: frame, encapsulates datagram datacenter network link layer has responsibility of transferring datagram from one node enterprise to physically adjacent node over a link network Florida Institute for Cybersecurity (FICS) Research 5 Link Layer: Context ▪ Datagram transferred by Transportation analogy: different link protocols over ▪ trip from Princeton to Lausanne different links: limo: Princeton to JFK e.g., WiFi on first link, Ethernet on plane: JFK to Geneva next link train: Geneva to Lausanne ▪ Each link protocol provides ▪ tourist = datagram different services ▪ transport segment = e.g., may or may not provide communication link reliable data transfer over link ▪ transportation mode = link-layer protocol ▪ travel agent = routing algorithm Florida Institute for Cybersecurity (FICS) Research 6 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 links: high error rates Q: why both link-level and end-end reliability? Florida Institute for Cybersecurity (FICS) Research 7 Link Layer: Services (more) ▪ flow control: … pacing between adjacent sending and receiving nodes … ▪ error detection: errors caused by signal attenuation, noise. receiver detects errors, signals retransmission, or drops frame ▪ error correction: receiver identifies and corrects bit error(s) without retransmission ▪ half-duplex and full-duplex: with half duplex, nodes at both ends of link can transmit, but not at same time Florida Institute for Cybersecurity (FICS) Research 8 Where is the Link Layer implemented? ▪ In each-and-every host ▪ link layer implemented in network interface card (NIC) or on a chip application transport Ethernet, WiFi card or chip network cpu memory link implements link, physical layer host bus (e.g., PCI) ▪ attaches into host’s system buses link physical controller ▪ combination of hardware, physical software, firmware network interface Florida Institute for Cybersecurity (FICS) Research 9 Interfaces Communicating application application transport transport datagram network cpu memory memory CPU network link link linkh datagram controller controller datagram link link physical physical physical physical Sending side: Receiving side: ▪ encapsulates datagram in frame ▪ looks for errors, reliable data ▪ adds error checking bits, reliable data transfer, flow control, etc. transfer, flow control, etc. ▪ extracts datagram, passes to upper layer at receiving side Florida Institute for Cybersecurity (FICS) Research 10 Link Layer, LANs: Roadmap ▪ introduction ▪ error detection, correction ▪ multiple access protocols ▪ LANs addressing, ARP Ethernet switches VLANs ▪ a day in the life of a web request ▪ link virtualization: MPLS ▪ data center networking Florida Institute for Cybersecurity (FICS) Research 11 Error Detection EDC: error detection and correction bits (e.g., redundancy) D: data protected by error checking, may include header fields datagram datagram Error detection not 100% otherwise reliable! all N ▪ protocol may miss bits in D’ OK detected some errors, but rarely d data bits ? error ▪ larger EDC field yields D EDC D’ EDC’ better detection and correction bit-error prone link Florida Institute for Cybersecurity (FICS) Research 12 Why? This is not the rst time that we’ve talked about detecting errors. Why are we doing it again? What’s so special about the link layer that this deserves additional attention? Is there anything to support this extra effort? Florida Institute for Cybersecurity (FICS) Research 13 fi Parity Checking single bit parity: two-dimensional bit parity: ▪ detect single bit errors ▪ detect and correct single bit errors row parity 0111000110101011 1 d1,1... d1,j d1,j+1 d data bits d2,1... d2,j d2,j+1............ parity bit di,1... di,j di,j+1 column parity di+1,1... di+1,j di+1,j+1 Even parity: set parity bit so there is an even number of 1’s no errors: 1 0 1 0 1 1 detected 10101 1 11110 0 and 10110 0 parity error 01110 1 correctable 01110 1 single-bit 10101 0 error: 10101 0 * Check out the online interactive exercises for more parity examples: http://gaia.cs.umass.edu/kurose_ross/interactive/ error Florida Institute for Cybersecurity (FICS) Research 14 Internet Checksum (review) Goal: detect errors (i.e., flipped bits) in transmitted segment Sender: Receiver: ▪ treat contents of UDP ▪ compute checksum of received segment (including UDP header segment fields and IP addresses) as sequence of 16-bit integers ▪ check if computed checksum equals ▪ checksum: addition (one’s checksum field value: complement sum) of segment not equal - error detected content equal - no error detected. But maybe ▪ checksum value put into UDP errors nonetheless? More later …. checksum field Florida Institute for Cybersecurity (FICS) Research 15 Cyclic Redundancy Check (CRC) ▪ More powerful error-detection coding ▪ D: data bits (given, think of these as a binary number) ▪ G: bit pattern (generator), of r+1 bits (given) r CRC bits d data bits D R bit pattern = D *2r XOR R formula for bit pattern Goal: choose r CRC bits, R, such that exactly divisible by G (mod 2) receiver knows G, divides by G. If non-zero remainder: error detected! can detect all burst errors less than r+1 bits widely used in practice (Ethernet, 802.11 WiFi) Florida Institute for Cybersecurity (FICS) Research 16 Cyclic Redundancy Check (CRC): Example G We want: 1 0 1 0 1 1 D.2r XOR R = nG 1 0 0 1 1 0 1 1 1 00 0 0 1 0 0 1 or equivalently: 1 0 1 D.2r = nG XOR R D* 2r 0 0 0 1 0 1 0 or equivalently: 1 0 0 1 if we divide D.2r by G, want 1 1 0 remainder R to satisfy: 0 0 0 D.2r 1 1 0 0 R = remainder [ ] 1 0 0 1 G 1 0 1 0 1 0 0 1 0 1 1 * Check out the online interactive exercises for more examples: http://gaia.cs.umass.edu/kurose_ross/interactive/ R Florida Institute for Cybersecurity (FICS) Research 17 Link Layer, LANs: Roadmap ▪ introduction ▪ error detection, correction ▪ multiple access protocols ▪ LANs addressing, ARP Ethernet switches VLANs ▪ a day in the life of a web request ▪ link virtualization: MPLS ▪ data center networking Florida Institute for Cybersecurity (FICS) Research 18 Multiple Access Links, Protocols Two types of “links”: ▪ Point-to-point point-to-point link between Ethernet switch, host PPP for dial-up access ▪ Broadcast (shared wire or medium) old-fashioned Ethernet upstream HFC in cable-based access network 802.11 wireless LAN, 4G/4G. satellite shared wire (e.g., humans at a cocktail party cabled Ethernet) shared radio: 4G/5G shared radio: WiFi shared radio: satellite (shared air, acoustical) Florida Institute for Cybersecurity (FICS) Research 19 Multiple Access Protocols ▪ Single shared broadcast channel ▪ Two or more simultaneous transmissions by nodes: interference collision if node receives two or more signals at the same time multiple access protocol ▪ distributed algorithm that determines how nodes share channel, i.e., determine when node can transmit ▪ communication about channel sharing must use channel itself! no out-of-band channel for coordination Florida Institute for Cybersecurity (FICS) Research 20 An Ideal Multiple Access Protocol given: multiple access channel (MAC) of rate R bps desiderata: 1. when one node wants to transmit, it can send at rate R. 2. when M nodes want to transmit, each can send at average rate R/M 3. fully decentralized: no special node to coordinate transmissions no synchronization of clocks, slots 4. simple Florida Institute for Cybersecurity (FICS) Research 21 MAC Protocols: Taxonomy Three broad classes: ▪ channel partitioning divide channel into smaller “pieces” (time slots, frequency, code) allocate piece to node for exclusive use ▪ random access channel not divided, allow collisions “recover” from collisions ▪ “taking turns” nodes take turns, but nodes with more to send can take longer turns Florida Institute for Cybersecurity (FICS) Research 22 Channel Partitioning MAC Protocols: TDMA TDMA: time division multiple access ▪ access to channel in “rounds” ▪ each station gets fixed length slot (length = packet transmission time) in each round ▪ unused slots go idle ▪ example: 6-station LAN, 1,3,4 have packets to send, slots 2,5,6 idle 6-slot 6-slot frame frame 1 3 4 1 3 4 Florida Institute for Cybersecurity (FICS) Research 23 Channel Partitioning MAC Protocols: FDMA FDMA: frequency division multiple access ▪ channel spectrum divided into frequency bands ▪ each station assigned fixed frequency band ▪ unused transmission time in frequency bands go idle ▪ example: 6-station LAN, 1,3,4 have packet to send, frequency bands 2,5,6 idle time frequency bands FDM cable Florida Institute for Cybersecurity (FICS) Research 24 Random Access Protocols ▪ When node has packet to send transmit at full channel data 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: ALOHA, slotted ALOHA CSMA, CSMA/CD, CSMA/CA Florida Institute for Cybersecurity (FICS) Research 25 Slotted ALOHA Assumptions: Operation: ▪ all frames same size ▪ when node obtains fresh frame, ▪ time divided into equal size slots transmits in next slot (time to transmit 1 frame) if no collision: node can send ▪ nodes start to transmit only slot new frame in next slot beginning if collision: node retransmits ▪ nodes are synchronized frame in each subsequent slot with probability p until success ▪ if 2 or more nodes transmit in slot, all nodes detect collision randomization – why? Florida Institute for Cybersecurity (FICS) Research 26 Slotted ALOHA node 1 1 1 1 1 node 2 2 2 2 C: collision S: success node 3 3 3 3 E: empty C E C S E C E S S Pros: Cons: ▪ single active node can continuously ▪ collisions, wasting slots transmit at full rate of channel ▪ idle slots ▪ highly decentralized: only slots in ▪ nodes may be able to detect collision in nodes need to be in sync less than time to transmit packet ▪ simple ▪ clock synchronization Florida Institute for Cybersecurity (FICS) Research 27 Slotted ALOHA: Ef ciency Ef ciency: long-run fraction of successful slots(many nodes, all with many frames to send) suppose: N nodes with many frames to send, each transmits in slot with probability p prob that given node has success in a slot = p(1-p)N-1 prob that any node has a success = Np(1-p)N-1 max ef ciency: nd p* that maximizes Np(1-p)N-1 for many nodes, take limit of Np*(1-p*)N-1 as N goes to in nity, gives: max ef ciency = 1/e =.37 at best: channel used for useful transmissions 37% of time! Florida Institute for Cybersecurity (FICS) Research 28 fi fi fi fi fi fi Pure ALOHA ▪ Unslotted Aloha: simpler, no synchronization when frame first arrives: transmit immediately ▪ Collision probability increases with no synchronization: frame sent at t0 collides with other frames sent in [t0-1,t0+1] will overlap will overlap with start of with end of i’s frame i’s frame t0 - 1 t0 t0 + 1 ▪ Pure Aloha efficiency: 18% ! Florida Institute for Cybersecurity (FICS) Research 29 Conclusions This is just the tip of the iceberg - two more lectures worth of Link Layer to come! Nearly there! We’re almost through with October, the end is shockingly close! Make sure you keep up with the reading and participation. Prompt: Please make me an image of the tip of an iceberg. You should be able to also see underwater and see both how large the rest of the iceberg is, and also See you Thursday! that it is surrounded by dangerous creatures Florida Institute for Cybersecurity (FICS) Research 30

Use Quizgecko on...
Browser
Browser