Session 5: Data Link Control
Total Page:16
File Type:pdf, Size:1020Kb
Data Communications & Networks Session 4 – Main Theme Data Link Control Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences Adapted from course textbook resources Computer Networking: A Top-Down Approach, 6/E Copyright 1996-2013 J.F. Kurose and K.W. Ross, All Rights Reserved 1 Agenda 1 Session Overview 2 Data Link Control 3 Summary and Conclusion 2 What is the class about? .Course description and syllabus: »http://www.nyu.edu/classes/jcf/csci-ga.2262-001/ »http://cs.nyu.edu/courses/Fall13/CSCI-GA.2262- 001/index.html .Textbooks: » Computer Networking: A Top-Down Approach (6th Edition) James F. Kurose, Keith W. Ross Addison Wesley ISBN-10: 0132856204, ISBN-13: 978-0132856201, 6th Edition (02/24/12) 3 Course Overview . Computer Networks and the Internet . Application Layer . Fundamental Data Structures: queues, ring buffers, finite state machines . Data Encoding and Transmission . Local Area Networks and Data Link Control . Wireless Communications . Packet Switching . OSI and Internet Protocol Architecture . Congestion Control and Flow Control Methods . Internet Protocols (IP, ARP, UDP, TCP) . Network (packet) Routing Algorithms (OSPF, Distance Vector) . IP Multicast . Sockets 4 Course Approach . Introduction to Basic Networking Concepts (Network Stack) . Origins of Naming, Addressing, and Routing (TCP, IP, DNS) . Physical Communication Layer . MAC Layer (Ethernet, Bridging) . Routing Protocols (Link State, Distance Vector) . Internet Routing (BGP, OSPF, Programmable Routers) . TCP Basics (Reliable/Unreliable) . Congestion Control . QoS, Fair Queuing, and Queuing Theory . Network Services – Multicast and Unicast . Extensions to Internet Architecture (NATs, IPv6, Proxies) . Network Hardware and Software (How to Build Networks, Routers) . Overlay Networks and Services (How to Implement Network Services) . Network Firewalls, Network Security, and Enterprise Networks 5 Data Link Control Session in Brief . Principles Behind Data Link Layer Services: . Error Detection and Correction . Sharing a Broadcast Channel Multiple Access . Link-Layer Addressing . Reliable Data Transfer and Flow Control . Instantiation and implementation of various link layer technologies: . Ethernet . Link-layer switches . PPP . Link virtualization: MPLS . A day in the life of a web request 6 Icons / Metaphors Information Common Realization Knowledge/Competency Pattern Governance Alignment Solution Approach 77 Agenda 1 Session Overview 2 Data Link Control 3 Summary and Conclusion 8 Data Link Control - Roadmap 2 Data Link Control Introduction and Services Error Detection and Correction Multiple Access Protocols Link Layer Addressing Ethernet Additional Topics 9 Link Layer: Introduction Some terminology: . hosts and routers are nodes . communication channels that connect adjacent nodes along communication path are links » wired links » wireless links » LANs . layer-2 packet is a frame, encapsulates datagram data-link layer has responsibility of transferring datagram from one node to adjacent node over a link 10 Link layer: context . datagram transferred by transportation analogy different link protocols . trip from Princeton to Lausanne over different links: » limo: Princeton to JFK » plane: JFK to Geneva » e.g., Ethernet on first link, frame relay on intermediate » train: Geneva to Lausanne links, 802.11 on last link . tourist = datagram . each link protocol . transport segment = provides different services communication link » e.g., may or may not provide . transportation mode = link rdt over link layer protocol . travel agent = routing algorithm 11 Link Layer Services (1/2) Framing, link access Encapsulate datagram into frame, adding header, trailer Channel access if shared medium “MAC” addresses used in frame headers to identify source, dest Different from IP address! Reliable delivery between adjacent nodes We briefly discussed how to do this already! Seldom used on low bit error link (fiber, some twisted pair) Wireless links: high error rates Q: why both link-level and end-end reliability? 12 Link Layer Services (2/2) Flow Control Pacing between adjacent sending and receiving nodes Error Detection Errors caused by signal attenuation, noise. Receiver detects presence of errors Signals sender for retransmission or drops frame Error Correction Receiver identifies and corrects bit error(s) without resorting to retransmission Half-duplex and full-duplex With half duplex, nodes at both ends of link can transmit, but not at same time 13 Where is the link layer implemented? . in each and every host host schematic . link layer implemented in application “adaptor” (aka network transport network cpu memory interface card NIC) link » Ethernet card, PCMCI card, host 802.11 card bus controller (e.g., PCI) » implements link, physical link physical layer physical transmission . attaches into host’s system buses network adapter card . combination of hardware, software, firmware 14 Adaptors Communicating datagram datagram controller controller sending host receiving host datagram frame . sending side: . receiving side » encapsulates datagram in » looks for errors, rdt, flow frame control, etc » adds error checking bits, » extracts datagram, passes rdt, flow control, etc. to upper layer at receiving side 15 Encoding Information Frames Typical Fields in a Frame Start Destination Source Frame Frame Data Check Address Address Control Delimiter sum 16 DLL Operation Sender Receiver NL correct and ordered Retransmit CRC ACK if DLL if timeout Frame correct ACK PL CRC 17 Data Link Control - Roadmap 2 Data Link Control Introduction and Services Error Detection and Correction Multiple Access Protocols Link Layer Addressing Ethernet Additional Topics 18 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 otherwise 19 Error Detection Additional bits added by transmitter for error detection code Parity Value of parity bit is such that character has even (even parity) or odd (odd parity) number of ones Even number of bit errors goes undetected Checksum can be a simple XOR operation of bits to be checked DL protocols use more sophisticated methods, like Cyclic Redundancy Check (CRC) 20 Parity Checking Single Bit Parity: Two Dimensional Bit Parity: Detect single bit errors Detect and correct single bit errors 0 0 21 Internet Checksum Goal: detect “errors” (e.g., flipped bits) in transmitted segment (note: used at transport layer only) Sender: Receiver: Treat segment contents as Compute checksum of sequence of 16-bit integers received segment Checksum: addition (1’s Check if computed complement sum) of checksum equals segment contents checksum field value: Sender puts checksum value NO - error detected into UDP checksum field YES - no error detected. But maybe errors nonetheless? More later …. 22 Checksuming: Cyclic Redundancy Check View data bits, D, as a binary number Choose r+1 bit pattern (generator), G Goal: choose r CRC bits, R, such that <D,R> exactly divisible by G (modulo 2) Receiver knows G, divides <D,R> by G. If non-zero remainder: error detected! Can detect all burst errors less than r+1 bits Widely used in practice (ATM, HDLC) 23 CRC Example Want r D.2 XOR R = nG Equivalently r D.2 = nG XOR R Equivalently: if we divide D.2r by G, want remainder R D.2r R = remainder[ ] G 24 Example of G(x) Polynomials CRC-12 12 11 3 2 X + X + X + X + X + 1 CRC-16 16 15 2 X + X + X + 1 CRC-CCITT 16 15 5 X + X + X + 1 CRC-32 32 26 23 22 16 12 11 10 X + X + X + X + X + X + X + X + X8 + X7 + X5 + X4 + X2 + X + 1 CRC’s Are Implemented in Shift registers 25 Data Link Control - Roadmap 2 Data Link Control Introduction and Services Error Detection and Correction Multiple Access Protocols Link Layer Addressing Ethernet Additional Topics 26 Multiple Access Links and Protocols (1/2) Two types of “links” Point-to-point PPP for dial-up access Point-to-point link between Ethernet switch and host Broadcast (shared wire or medium) Old-fashioned Ethernet Upstream HFC 802.11 wireless LAN 27 Multiple Access Protocols (2/2) 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! 28 Ideal Multiple Access Protocols Broadcast channel of rate R bps 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 29 MAC Protocols: A 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 30 Channel Partitioning MAC Protocols: TDMA TDMA: time division multiple access Access to channel in "rounds“ Each station gets fixed length slot (length = pkt trans time) in each round Unused slots go idle Example: 6-station LAN, 1,3,4 have pkt, slots