160 likes | 174 Views
Explore cyclic redundancy check (CRC) for error detection and correction in data link layer protocols. Learn how to choose generators and perform CRC calculations. Follow examples and applications in ATM and HDLC systems.
E N D
CS 5565Network Architecture and Protocols Godmar Back Lecture 39
Announcements • Project 2B due Wed Apr 26 & May 3 • Read posts in forum • Reading Assignment Chapter 5 CS 5565 Spring 2006
Data Link Layer Error Detection & Correction
Checksumming: 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) CS 5565 Spring 2006
CRC Example Want: D.2rXOR R = nG equivalently: D.2r = nG XOR R equivalently: if we divide D.2r by G, want remainder R D.2r G R = remainder[ ] CS 5565 Spring 2006
CRC (cont’d) • Formulation often as polynomials over algebraic field {0, 1}, e.g. • G = x3 + 1 • D = x5 + x3 + x2 + x • CRC-32 IEEE polynomial • x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1 • detects all burst errors up to 32bits • detects all burst errors of odd length CS 5565 Spring 2006
Ideal Multiple Access Protocol 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 CS 5565 Spring 2006
MAC Protocols: a taxonomy MAC – Media Access Control 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 CS 5565 Spring 2006
MAC Addresses and ARP • 32-bit IP address: • network-layer address • used to get datagram to destination IP subnet • MAC (or LAN or physical or Ethernet) address: • used to get datagram from one interface to another physically-connected interface (same network) • 48 bit MAC address (for most LANs) burned in the adapter ROM • MAC address allocation administered by IEEE • manufacturer buys portion of MAC address space (to assure uniqueness) CS 5565 Spring 2006
1A-2F-BB-76-09-AD LAN (wired or wireless) 71-65-F7-2B-08-53 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 LAN Addresses and ARP Each adapter on LAN has unique LAN address Broadcast address = FF-FF-FF-FF-FF-FF = adapter CS 5565 Spring 2006
237.196.7.78 1A-2F-BB-76-09-AD 237.196.7.23 237.196.7.14 LAN 71-65-F7-2B-08-53 58-23-D7-FA-20-B0 Question: how to determine MAC address of B knowing B’s IP address? 0C-C4-11-6F-E3-98 237.196.7.88 ARP: Address Resolution Protocol • Each IP node (Host, Router) on LAN has ARP table • ARP Table: IP/MAC address mappings for some LAN nodes < IP address; MAC address; TTL> • TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min) CS 5565 Spring 2006
A wants to send datagram to B, and B’s MAC address not in A’s ARP table. A broadcasts ARP query packet, containing B's IP address Dest MAC address = FF-FF-FF-FF-FF-FF all machines on LAN receive ARP query B receives ARP packet, replies to A with its (B's) MAC address frame sent to A’s MAC address (unicast) A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state: information that times out (goes away) unless refreshed ARP is “plug-and-play”: nodes create their ARP tables without intervention from net administrator ARP Protocol CS 5565 Spring 2006
Routing to another LAN Send datagram from A to B via R A R B • Two ARP tables in router R, one for each IP network (LAN) • Q. How would you implement ARP at end hosts? • Q. What about security? CS 5565 Spring 2006
Proxy ARP Default Gateway 237.196.7.78 237.196.7.23 • 237.196.7.23 uses 237.196.7/24 • 237.196.7.14 answers ARP requests for 237.196.7.78 • See arp(8), “arp –s … pub” • Forwards IP datagrams along 237.196.7.77 • 237.196.7.78 uses 237.196.7.77 as default gateway 237.196.7.14 LAN 237.196.7.77 Point-To-Point Link, e.g. dialup with subnet 237.196.7.76/30 Upstream Internet 58-23-D7-FA-20-B0 237.196.7.88 CS 5565 Spring 2006
DHCP • Dynamic Host Configuration Protocol • Precursors: RARP – Reverse ARP, bootp • Uses MAC-level broadcast • DHCP Discovery (“what DHCP servers are out there and who can give me an IP address?”) • DHCP Offer (“you may use this address”) • May be more than one • DHCP Request (“I’d like to use this address”) • DHCP Ack (“please do”) • DHCP relay agents for larger networks. CS 5565 Spring 2006