1 / 63

Connecting The Network Layer to Data Link Layer

Connecting The Network Layer to Data Link Layer. 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:

finleyn
Download Presentation

Connecting The Network Layer to Data Link Layer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Connecting The Network Layer to Data Link Layer

  2. 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: • function:get frame from one interface to another physically-connected interface (same network) • 48 bit MAC address (for most LANs) • burned in NIC ROM, also sometimes software settable 5: DataLink Layer

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

  4. Question: how to determine MAC address of B knowing B’s IP address? ARP: Address Resolution Protocol • Each IP node (host, router) on LAN has ARPtable • 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) 137.196.7.78 1A-2F-BB-76-09-AD 137.196.7.23 137.196.7.14 LAN 71-65-F7-2B-08-53 58-23-D7-FA-20-B0 0C-C4-11-6F-E3-98 137.196.7.88

  5. ARP in the IP Layer The Address Resolution Protocol (ARP) Part of the Internet Protocol (IP) to solve a specific problem Usually considered to be a part of the link layer The physical layer has 6 byte MAC addresses, while the network layer has independent (4 byte) IP addresses

  6. ARP What is the connection between IP and HW (MAC = Ethernet) addresses? There is no a priori connection as they live in different layers But they need some connection otherwise we won't be able to use a physical layer to send IP packets: we won't know where a particular IP packet should physically be sent

  7. ARP Every host on the Internet has (at least) one 32 bit (4 byte) IP address It is unique to that host and so identifies that machine on the Internet

  8. ARP IP addresses are chosen by the local system administrator to suit the local network Ethernet addresses are built into the interface hardware by the manufacturer The two addresses bear absolutely no relationship to one another (as we would expect from the layering principles)‏

  9. ARP Suppose want to send a packet over (say) an Ethernet We only know the destination's IP address To build the Ethernet frame we have to know the Ethernet address that the destination has This is what ARP does: It finds the hardware address corresponding to an IP address

  10. How ARP finds the Targets MAC Address STEP 1: ARP broadcasts an ARP Request packet that contains the target IP address in an Ethernet frame with destination address ff:ff:ff:ff:ff:ff and source (its own) Ethernet address‏ All hosts on the local network read thisbroadcasted frame The target host recognises the request for its IP address

  11. ARP STEP 2: The target sends an ARP Reply packet containing its own Ethernet address It knows the source's Ethernet address as found in the request packet The source gets the reply and reads out the target's Ethernet address It can now use that Ethernet address to send IP packets

  12. WHAT is ARP FRAME? The frame type for ARP is 0806 Hardware type: 1 for an Ethernet address Protocol type: 0800 for an IP address Sizes: sizes in bytes of the address fields, 6 for Ethernet, 4 for IP

  13. ARP OP: 1 for a request, 2 for a reply Address fields: the data In a request the targetMAC address field is not filled in,which is what we are trying to find! In a reply the sender MAC address is the address we seek

  14. ARP The source caches the address so it doesn't need to do an ARP for every IP packet The cache expires after (say) 20 minutes, after which a fresh ARP exchange is needed This is in case the Ethernet-to-IP address relationship changes, e.g., an IP address is reassigned to a new machine

  15. What if the Target is not on the Same LAN? If no machine on the local network has the requested IP address, or that machine is down, no reply will be forthcoming In this case, after a few seconds (and a few repeated ARP requests), an error message is send to the application trying to make the IP connection This might be “no such host” or “host unreachable”

  16. SRC and DST on different Networks: ARP Bridging A clever trick that shows ARP can be used for things other than it was designed to do This trick allows us to extend an Ethernet (or other network) over a physically larger distance than its specifications allow, and to join a wireless network to a wired one so they appear to be a single network

  17. ARP Bridging A bridge is a host with two interfaces, one on each network If host h1 wishes to send to host h2 it must determine its hardware address

  18. ARP Bridging So h1 sends an ARP broadcast for h2 The bridge sees this request and responds on behalf of h2 (a proxy ARP), but it supplies its own hardware address b1

  19. ARP Bridging Now h1 sends data to what it thinks is h2, but is actually the bridge The bridge reads the packet, sees it is destined for h2 (by its IP address) and forwards it to the other network where h2 can read it

  20. ARP Bridging The forwarded frame will be changed to have h2 as destination and b2 as source If h2 replies, it can either use h2 which it got from the original packet or do an ARP request, which the bridge proxies in a symmetrical way

  21. ARP Bridging In either case the packet goes to the bridge, which forwards it to h1, again rewriting the frame addresses appropriately This is all transparent to h1 and h2 who believe they are on the same network

  22. ARP Bridging This is sometimes called transparent bridging If h1 is communicating with both h2 and h3 its cache will show then to have the same hardware address b1: this is not a problem

  23. ARP Bridging ARP bridging is fine for joining a pair of small networks, but less so for larger collections of networks IEEE 802.1d Ethernet Bridging standard addresses this, dealing with the cases of multiple routes between hosts

  24. Remote ARP Bridging Bridging can also connect networks that are widely separated, e.g., by a WAN, again to appear as a single network using remote bridging Compare this with tunnelling

  25. Remote ARP Bridging The endpoints are called half bridges This is similar in principle to local bridging, but now the half bridges must cope with encapsulation over the WAN; differences in speed and packet sizes of the LAN and WAN and so on

  26. Reverse Address Resolution Protocol (RARP) Reverse ARP addresses to opposite problem to ARP: given a hardware address find the IP address Needed by hosts that don't initially know their own IP address, e.g., a diskless computer, a laptop plugging into a network, a refrigerator, etc.

  27. Reverse Address Resolution Protocol (RARP) Very similar to ARP Frame type 8035 Same frame layout Op type 3 for a RARP request, type 4 for a RARP reply RARP is OK for limited purposes, but much better protocols exist to solve the same problem (see DHCP)‏

  28. DHCP a Sublayers Under the Network Layer How does a host get allocated an IP address? allocated manually by an administrator: OK as far as it goes but does not scale to large networks and some networks (e.g., home networks) don't have (competent) administrators Use the Dynamic Host Configuration Protocol

  29. DHCP a Sublayers Under the Network Layer DHCP, and its predecessor BOOTP, exist to allocate IP addresses to hosts We start with BOOTP then describe DHCP which is similar but massively extends BOOTP Both extend RARP

  30. How Does DHCP Work? Dynamic Host Configuration Protocol :DHCP DHCP is designed for the general configuration of a host: address, subnet mask, gateway, name servers, and more Needed usually for hosts with non-permanent connections, e.g., Internet service providers, etc

  31. How Does DHCP Work? DHCP has a pool of available addresses that it can assign to hosts as they need When a host leaves, its address can be reused DHCP gives a lease time on an address If the lease expires the host can renew via DHCP A well-behaved host will signal (via DHCP) when it no longer needs an address

  32. How Does DHCP Work? • DHCP supplies • IP address • Subnet mask • Gateway • name servers • lease times • print servers • Gateway • boot servers • mail servers • host name • web servers

  33. Prechecking of an IP Address Before supplying an address, DHCP should ping the network for that address: this is to check that no host is accidentally using that address already

  34. Prechecking of an IP Address Before supplying an address, DHCP should ping the network for that address: this is to check that no host is accidentally using that address already Inform others:After getting an address, the host can send an ARP reply containing its own address. This gratuitous ARP informs other hosts on the network of the new address association so they can update their ARP caches

  35. How Does DHCP Work? The data is encoded in a DHCP packet as a tag byte to indicate the type of data a length byte the data itself Tag 0 to pad data for alignment Tag 255 to indicate end of data

  36. The Packet Header

  37. DHCP Message Flow

  38. Ethernet Topologies “dominant” wired LAN technology: • cheap $20 for NIC • first widely used LAN technology • simpler, cheaper than token LANs and ATM • kept up with speed race: 10 Mbps – 10 Gbps Metcalfe’s Ethernet sketch 5: DataLink Layer

  39. Star topology • bus topology popular through mid 90s • all nodes in same collision domain (can collide with each other) • today: star topology prevails • active switch in center • each “spoke” runs a (separate) Ethernet protocol (nodes do not collide with each other) switch bus: coaxial cable star 5: DataLink Layer

  40. Ethernet Frame Structure Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame Preamble: • 7 bytes with pattern 10101010 followed by one byte with pattern 10101011 • used to synchronize receiver, sender clock rates 5: DataLink Layer

  41. Ethernet Frame Structure (more) • Addresses: 6 bytes • if adapter receives frame with matching destination address, or with broadcast address (eg ARP packet), it passes data in frame to network layer protocol • otherwise, adapter discards frame • Type: indicates higher layer protocol (mostly IP but others possible, e.g., Novell IPX, AppleTalk) • CRC: checked at receiver, if error is detected, frame is dropped 5: DataLink Layer

  42. Ethernet: Unreliable, connectionless • connectionless: No handshaking between sending and receiving NICs • unreliable: receiving NIC doesn’t send acks or nacks to sending NIC • stream of datagrams passed to network layer can have gaps (missing datagrams) • gaps will be filled if app is using TCP • otherwise, app will see gaps • Ethernet’s MAC protocol: unslotted CSMA/CD 5: DataLink Layer

  43. twisted pair hub Hubs … physical-layer (“dumb”) repeaters: • bits coming in one link go out all other links at same rate • all nodes connected to hub can collide with one another • no frame buffering • no CSMA/CD at hub: host NICs detect collisions 5: DataLink Layer

  44. Switch • link-layer device: smarter than hubs, take active role • store, forward Ethernet frames • examine incoming frame’s MAC address, selectively forward frame to one-or-more outgoing links when frame is to be forwarded on segment, uses CSMA/CD to access segment • transparent • hosts are unaware of presence of switches • plug-and-play, self-learning • switches do not need to be configured 5: DataLink Layer

More Related