1 / 33

Chapter 7 ARP and RARP

Chapter 7 ARP and RARP. Prof. Choong Seon HONG. Introduction. The logical addresses in TCP/IP protocol suite are IP addresses Physical address is usually implemented in hardware

nashr
Télécharger la présentation

Chapter 7 ARP and RARP

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. Chapter 7ARP and RARP Prof. Choong Seon HONG

  2. Introduction • The logical addresses in TCP/IP protocol suite are IP addresses • Physical address is usually implemented in hardware • Ex) 48-bit MAC addresses in Ethernet and Token ring protocols, which are imprinted on the NIC installed in the host or router

  3. Introduction (cont’d) • Mapping a logical address to its corresponding physical address • Static mapping • means creating a table that associates a logical address with a physical address • need to update periodically • Dynamic mapping • each time a machine knows one of the two addresses (logical or physical), it can use a protocol to find the other one • ARP (address resolution protocol), RARP (reverse address resolution protocol)

  4. ARP and RARP • ARP (address resolution protocol) • RARP (reverse address resolution protocol)

  5. Position of ARP and RARP in TCP/IP Protocol Suite

  6. ARP Operation

  7. ARP Operation (cont’d) • An ARP request isbroadcast; an ARP reply is unicast

  8. The Format of ARP packet

  9. The Format of ARP packet (cont’d) • HTYPE(hardware type) : defining the type of the network (16 bits) • ex) Ethernet : type 1 • PTYPE(protocol type :16 bits) • the value of this field for the IPv4 protocol : 080016 • HLEN (Hardware length : 8 bits) • defining the length of the physical address in bytes • for Ethernet, the value is six

  10. The Format of ARP packet (cont’d) • PLEN (protocol length : 8bits) • defining the length of the logical address in bytes • ex) for the IPv4, the value is 4 • OPER (operation : 16 bits) • defining the type of the packet • ARP request : 1, ARP reply : 0 • SHA (sender hardware address) • variable length field defining the physical address of the sender

  11. The Format of ARP packet (cont’d) • SPA (sender protocol address) • variable-length field defining the logical address of the sender • for the IP protocol, the field is 4 • THA (target hardware address) • variable-length field defining the physical address of the target • TPA (target protocol address) • variable-length field defining the logical address of the target

  12. Encapsulation of ARP Packet • encapsulated directly into a data link frame • ARP packet encapsulated in an Ethernet frame

  13. Four Cases using ARP Case 2. A host wants to send a packet to another host on another network. It must first be delivered to the default router.

  14. Four Cases using ARP (cont’d)

  15. Example 1 • A host with IP address 130.23.43.20 and physical address 0xB23455102210 has a packet to send to another host with IP address 130.23.43.25 and physical address 0xA46EF45983AB. The two hosts are on the same Ethernet network. Show the ARP request and reply packets encapsulated in Ethernet frames

  16. Example 1 (cont’d) • Request

  17. Example 1 (cont’d) • Reply

  18. Proxy ARP • ARP that acts on behalf of a set of hosts • Whenever the router running a proxy ARP receives an ARP request looking for the IP address of one of these hosts, router sends an ARP reply announcing its own hardware (physical) address • Later, when the router receives the actual IP packet, it will send the packet to the appropriate host or router

  19. 7.2 ARP Package

  20. ARP Design (cont’d) • Cache table • When a host or router receives the corresponding physical address for an IP datagram, the address can be saved in the cache table. • This address can be used for the datagrams destined for the same receiver within the next few minutes • Queues • holding the IP address while ARP tries to resolve the hardware address

  21. ARP Design (cont’d) • Output Module • waiting for an IP packet from the IP software • checking the cache table to find an entry corresponding to the destination IP address of this packet

  22. ARP Design (cont’d) Output module • Sleep until an IP packet is received from IP software • Check the cache table to find an entry corresponding to this IP packet • If (found) • If (the state is RESOLVED) • Extract the value of the hardware address from the entry • Send the packet and the hardware address to data link layer • Return • If (the state is PENDING) • Enqueue the packet to the corresponding queue • Return • If (not found) • Create a queue • Enqueue the packet • Create a cache entry with state set to PENDING and ATTEMPTS set to 1 • Send an ARP request • Return

  23. ARP Design (cont’d) • Input Module • waiting until an ARP packet (request or reply) arrives • checking the cache table to find an entry corresponding to this ARP packet

  24. ARP Design (cont’d) Input Module • Sleep until an ARP packet (request or reply) arrives • Check the cache to find an entry corresponding to the this ARP packet • If (found) • If (the state is PENDING) • Update the entry ( to RESOLVED) • While the queue is not empty • Dequeue one packet • Send the packet and the hardware address to date link • If (the state is RESOLVED) // hardware address could have been changed • Update the entry • If (not found) • Create an entry • Add the entry to the table • If (the packet is a request) • Send an ARP reply • Return

  25. ARP Design (cont’d) • Cache-control module • responsible for maintaining the cache table • periodically (for example, every five seconds) checking the cache table, entry by entry

  26. ARP Design (cont’d) Cache-control module • Sleep until the periodic timer matures. • For every entry in the cache table • If (the state is Free) • Continue. • If (the state is PENDING) • Increment the value of attempts by 1. • If(attempts greater than maximum) • Change the state to FREE • Destroy the corresponding queue. • If(not) • Send an ARP request. • Continue. • If (the state is RESOLVED) • Decrement the value of time-out by the value of elapsed time. • If(time-out less than or equal to zero) • Change the state to FREE. • Destroy the corresponding queue • Return.

  27. Examples of ARP The beginning cache table Example 2 1) ARP output module receives an IP datagram (from IP layer) with the destination address 114.5.7.89. 2) Check the Cache table 3) Extract hardware address, which is 457342ACAE32 and sends packet and the address to the data link layer for transmission

  28. Examples of ARP Example3 1)Twenty seconds later, the ARP out module receives an IP datagram with destination address with 116.1.7.22 and creates a new queue 2) Send an ARP request to the data link layer

  29. Examples of ARP Example 4 • Fifteen seconds layer, ARP input module receives an ARP packet with target protocol (IP) address 188.11.8.71. • Change the state to RESOLVED, and time-out value to 900 and add the target hardware address • Access queue 18 and send all the packets in this queue to the data link layer

  30. 7.3 RARP • To create an IP datagram, a host or a router needs to know its own IP address or addresses • The IP address of a machine is usually read from its configuration file stored on a disk file • A diskless machine is usually booted from ROM, which has minimum booting information • It cannot include the IP address because the IP addresses on a network are assigned by the administrator. • The machine can get its physical address by reading its NIC.

  31. RARP (cont’d)

  32. RARP (cont’d) • Packet Format

  33. RARP (cont’d) • Encapsulation of RARP packet

More Related