Download presentation
Presentation is loading. Please wait.
Published byVirgil Knight Modified over 8 years ago
1
CPSC 441: Link Layer1 Link Layer Addressing Slides originally from Carey Williamson Notes derived from “ Computer Networking: A Top Down Approach”, by Jim Kurose and Keith Ross, Addison-Wesley. Slides are adapted from the book’s companion Web site, with changes by Anirban Mahanti and Carey Williamson.
2
CPSC 441: Link Layer2 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 “link” data-link layer (DLL) has responsibility of transferring datagram from one node to adjacent node over a link
3
CPSC 441: Link Layer3 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 wireless on last link r Each DLL protocol provides different services m e.g., may or may not provide reliable data transfer over link
4
CPSC 441: Link Layer4 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! 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?
5
CPSC 441: Link Layer5 Link Layer Services (more) r Flow Control: m regulate transmissions between sender and receiver 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
6
CPSC 441: Link Layer6 Adaptors Communicating r link layer implemented in “adaptor” (aka NIC) m Ethernet card, PCMCI card, 802.11 card r sending side: m encapsulates datagram in a 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 rcving node r adapter is semi- autonomous r link & physical layers sending node frame rcving node datagram frame adapter link layer protocol
7
CPSC 441: Link Layer7 MAC Addresses (1/3) r 32-bit IP address: m network-layer address m used to get datagram to destination IP subnet r MAC address (e.g., Ethernet LAN): m used to get datagram from one interface to another physically-connected interface (on the same network) m 48-bit MAC address (for most LANs) burned in the adapter ROM (globally unique)
8
CPSC 441: Link Layer8 MAC Addresses(2/3) 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)
9
CPSC 441: Link Layer9 LAN Address (3/3) r MAC address allocation administered by IEEE r manufacturer buys portion of MAC address space r MAC flat address provides portability m can move LAN card from one LAN to another m different than with IP addresses!
10
CPSC 441: Link Layer10 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 237.196.7.23 237.196.7.78 237.196.7.14 237.196.7.88
11
CPSC 441: Link Layer11 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) r ARP is a “soft state” protocol: information that times out unless refreshed r ARP is “plug-and-play”: m nodes create their ARP tables without intervention from net administrator
12
CPSC 441: Link Layer12 Routing to another LAN send datagram from A to B via R assume A know’s B IP address r Two ARP tables in router R, one for each IP network (LAN) r In routing table at source Host, find router 111.111.111.110 r In ARP table at source, find MAC address E6-E9-00-17-BB-4B, etc A R B
13
CPSC 441: Link Layer13 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 adapter sends frame r R’s adapter 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 A R B
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.