Presentation is loading. Please wait.

Presentation is loading. Please wait.

5: DataLink Layer5-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction m.

Similar presentations


Presentation on theme: "5: DataLink Layer5-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction m."— Presentation transcript:

1 5: DataLink Layer5-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction m sharing a broadcast channel: multiple access m link layer addressing m reliable data transfer, flow control: done! r instantiation and implementation of various link layer technologies

2 5: DataLink Layer5-2 Link Layer r 5.1 Introduction and services r 5.2 Error detection and correction r 5.3Multiple access protocols r 5.4 Link-layer Addressing r 5.5 Ethernet r 5.6 Link-layer switches r 5.7 PPP r 5.8 Link virtualization: ATM, MPLS

3 5: DataLink Layer5-3 Link Layer: Introduction Some terminology: r hosts and routers are nodes r communication channels that connect adjacent nodes along communication path are links m wired links m wireless links m LANs r 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

4 5: DataLink Layer5-4 Link layer: context r datagram transferred by different link protocols over different links: m e.g., Ethernet on first link, frame relay on intermediate links, 802.11 on last link r each link protocol provides different services m e.g., may or may not provide rdt over link transportation analogy r trip from Princeton to Lausanne m limo: Princeton to JFK m plane: JFK to Geneva m train: Geneva to Lausanne r tourist = datagram r transport segment = communication link r transportation mode = link layer protocol r travel agent = routing algorithm

5 5: DataLink Layer5-5 Link Layer Services r framing, link access: m encapsulate datagram into frame, adding header, trailer m channel access if shared medium m “MAC” addresses used in frame headers to identify source, dest different from IP address! r reliable delivery between adjacent nodes m we learned how to do this already (chapter 3)! m seldom used on low bit-error link (fiber, some twisted pair) m wireless links: high error rates Q: why both link-level and end-end reliability?

6 5: DataLink Layer5-6 Link Layer Services (more) r flow control: m pacing between adjacent sending and receiving nodes r error detection: m errors caused by signal attenuation, noise. m receiver detects presence of errors: signals sender for retransmission or drops frame r error correction: m receiver identifies and corrects bit error(s) without resorting to retransmission r half-duplex and full-duplex m with half duplex, nodes at both ends of link can transmit, but not at same time

7 5: DataLink Layer5-7 Where is the link layer implemented? r in each and every host r link layer implemented in “adaptor” (aka network interface card NIC) m Ethernet card, PCMCI card, 802.11 card m implements link, physical layer r attaches into host’s system buses r combination of hardware, software, firmware controller physical transmission cpu memory host bus (e.g., PCI) network adapter card host schematic application transport network link physical

8 5: DataLink Layer5-8 Adaptors Communicating r sending side: m encapsulates datagram in frame m adds error checking bits, rdt, flow control, etc. r receiving side m looks for errors, rdt, flow control, etc m extracts datagram, passes to upper layer at receiving side controller sending host receiving host datagram frame

9 5: DataLink Layer5-9 Multiple Access Links and Protocols Two types of “links”: r point-to-point m PPP for dial-up access m point-to-point link between Ethernet switch and host r broadcast (shared wire or medium) m old-fashioned Ethernet m upstream HFC m 802.11 wireless LAN shared wire (e.g., cabled Ethernet) shared RF (e.g., 802.11 WiFi) shared RF (satellite) humans at a cocktail party (shared air, acoustical)

10 5: DataLink Layer5-10 Multiple Access protocols r single shared broadcast channel r two or more simultaneous transmissions by nodes: interference m collision if node receives two or more signals at the same time multiple access protocol r distributed algorithm that determines how nodes share channel, i.e., determine when node can transmit r communication about channel sharing must use channel itself! m no out-of-band channel for coordination

11 5: DataLink Layer5-11 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: m no special node to coordinate transmissions m no synchronization of clocks, slots 4. simple

12 5: DataLink Layer5-12 Link Layer r 5.1 Introduction and services r 5.2 Error detection and correction r 5.3Multiple access protocols r 5.4 Link-Layer Addressing r 5.5 Ethernet r 5.6 Link-layer switches r 5.7 PPP r 5.8 Link Virtualization: ATM, MPLS

13 5: DataLink Layer5-13 MAC Addresses and ARP r 32-bit IP address: m network-layer address m used to get datagram to destination IP subnet r MAC (or LAN or physical or Ethernet) address: m function: get frame from one interface to another physically-connected interface (same network) m 48 bit MAC address (for most LANs) burned in NIC ROM, also sometimes software settable

14 5: DataLink Layer5-14 LAN Addresses and ARP Each adapter on LAN has unique LAN address Broadcast address = FF-FF-FF-FF-FF-FF = adapter 1A-2F-BB-76-09-AD 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 71-65-F7-2B-08-53 LAN (wired or wireless)

15 5: DataLink Layer5-15 LAN Address (more) r MAC address allocation administered by IEEE r manufacturer buys portion of MAC address space (to assure uniqueness) r analogy: (a) MAC address: like Social Security Number (b) IP address: like postal address  MAC flat address ➜ portability m can move LAN card from one LAN to another r IP hierarchical address NOT portable m address depends on IP subnet to which node is attached

16 5: DataLink Layer5-16 ARP: Address Resolution Protocol r Each IP node (host, router) on LAN has ARP table r ARP table: IP/MAC address mappings for some LAN nodes m TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min) Question: how to determine MAC address of B knowing B’s IP address? 1A-2F-BB-76-09-AD 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 71-65-F7-2B-08-53 LAN 137.196.7.23 137.196.7.78 137.196.7.14 137.196.7.88

17 5: DataLink Layer5-17 ARP protocol: Same LAN (network) r A wants to send datagram to B, and B’s MAC address not in A’s ARP table. r A broadcasts ARP query packet, containing B's IP address m dest MAC address = FF- FF-FF-FF-FF-FF m all machines on LAN receive ARP query r B receives ARP packet, replies to A with its (B's) MAC address m frame sent to A’s MAC address (unicast) r A caches (saves) IP-to- MAC address pair in its ARP table until information becomes old (times out) m soft state: information that times out (goes away) unless refreshed r ARP is “plug-and-play”: m nodes create their ARP tables without intervention from net administrator

18 5: DataLink Layer5-18 Addressing: routing to another LAN R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 A 74-29-9C-E8-FF-55 222.222.222.221 88-B2-2F-54-1A-0F B 222.222.222.222 49-BD-D2-C7-56-2A walkthrough: send datagram from A to B via R assume A knows B’s IP address r two ARP tables in router R, one for each IP network (LAN)

19 5: DataLink Layer5-19 r A creates IP datagram with source A, destination B r A uses ARP to get R’s MAC address for 111.111.111.110 r A creates link-layer frame with R's MAC address as dest, frame contains A-to-B IP datagram r A’s NIC sends frame r R’s NIC receives frame r R removes IP datagram from Ethernet frame, sees its destined to B r R uses ARP to get B’s MAC address r R creates frame containing A-to-B IP datagram sends to B R 1A-23-F9-CD-06-9B 222.222.222.220 111.111.111.110 E6-E9-00-17-BB-4B CC-49-DE-D0-AB-7D 111.111.111.112 111.111.111.111 A 74-29-9C-E8-FF-55 222.222.222.221 88-B2-2F-54-1A-0F B 222.222.222.222 49-BD-D2-C7-56-2A This is a really important example – make sure you understand!


Download ppt "5: DataLink Layer5-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction m."

Similar presentations


Ads by Google