1 / 27

Chapter 8

Chapter 8. ARP and RARP. About ARP and RARP Logical address The hosts and routers are recognized at the network level by there logical address . A logical address is an internetwork address and unique universally. It is usually implemented in software.

maxine
Download Presentation

Chapter 8

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 8 ARP and RARP

  2. About ARP and RARP Logical address The hosts and routers are recognized at the network level by there logical address. A logical address is an internetwork address and unique universally. It is usually implemented in software. The logical address in the TCP/IP protocol suit are called IP address.(32 bit) Physical address At the physical level, the hosts and routers are recognized by there Physical address. The Physical address is a local address and unique locally. It is usually implemented in hardware.(48 bits MAC address) Static mapping It means creating a table that associates a logical address with a physical address. Dynamic mapping Each time a machine knows one of the two address(logical or physical), it can use a protocol to find the other one.(ARP:Address resolution protocol/RARP:Reverse ARP)

  3. Figure 8-1 ARP and RARP

  4. 8.1 ARP Anytime a host, or a router, needs to find physical address of another host or router on its network, it sends an ARP query packet. The packet includes the physical and IP address of the sender and the IP address of receiver. The query is broadcast over the network.  Only the intended recipient recognizes its IP address and sends back an ARP response packet.(recipient’s IP and physical address) The packet is unicast directly to the inquirer using the physical address received in the query packet. ARP & RARP

  5. Figure 8-2 ARP operation

  6. Packet Format HTYPE(Hardware type): The type of the network on which ARP is running. (16-bit) (Ex) Ethernet is given the type 1 PTYPE(Protocol type): Protocol (16-bit field). (Ex) IPv4 protocol is 080016. HLEN(Hardware length): The length of the physical address in bytes (8-bit field) (Ex) Ethernet the value is six PLEN(Protocol length): The length of the logical address in bytes (8-bit field) (Ex) IPv4 protocol the value is four. OPER(Operation): The type of the packet. (16-bit) Two packet types are defined: ARP request(1), ARP reply(2). SHA (Sender hardware address): The physical address of the sender. (variable-length field) (Ex) Ethernet the value six ARP & RARP

  7. Packet Format… SPA(Sender protocol address): The logical address of the sender. (variable-length field) (Ex) For the IP protocol, this field is four bytes long. THA(Target hardware address): The physical address of the sender. (variable-length field) (Ex) Ethernet this field is sixbytes long. For an ARP request message, this field is all 0,s TPA(Target protocol address): The logical address of the target. (variable-length field) (Ex) For the IP protocol, this field is four bytes long. ARP & RARP

  8. Figure 8-3 ARP Packet

  9. Packet Format… • Encapsulation: • An ARP packet is encapsulated directly in to a data link frame. Figure 8-4 Encapsulation of ARP packet. The type field indicates that the data carried by the frame is an ARP packet

  10. Operation Step Involved IP asks ARP to create a request ARP message, filling in the sender physical address, the sender IP address, and the target IP address.(The target physical address field is filled with 0’s) The message is passed to the data link layer where it is encapsulated in a frame using the physical address of the sender as the source address and the physical broadcast address as the destination address. Every host or router receives the frame. The target machine replies with an ARP message that contains its physical address. The message is unicast. The sender receives the reply message. It knows the physical address of the target machine. The IP datagram, which carries data for the target machine, is now encapsulated in aframe and is unicast to the destination. ARP & RARP

  11. Operation.. Four Different Cases The sender is a host and wants to send a packet to another host on the same network. The logical address that must be mapped to a physical address is the destination IP address in the datagram header. The sender is a host and wants to send a packet to another host on another network  The host looks at its routing table and finds the IP address of the next hop(router) for this destination. If it does not have a routing table, it looks for the IP address of the default router. The IP address of the router becomes the logical address that must be mapped to a physical address. The sender is a router that has received a datagram destined for a host another network.  It checks its routing table and finds the IP address of the next router. The sender is a router that has received a datagram destined for a host in the same network. The destination IP address of the datagram becomes the logical address that must be mapped to a physicall address. ARP & RARP

  12. Figure 8-5, Part I Four cases using ARP

  13. Figure 8-5, Part II Four cases using ARP

  14. Proxy ARP A proxy ARP is an ARP that acts on be half of a set of host. Whenever the the router running a proxy ARP receives an ARP request looking for the IP address of one of these hosts, the 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. ARP & RARP

  15. Figure 8-6 Proxy ARP

  16. 8.2 ARP DESIGN ARP package involves five component: A cache table A queues An output module An input module A cache-control module Cache Table When a host or router receives the corresponding physical address for IP datagram, the address can be saved in the cache table. This address can be used for the datagram destined for the same receiver within the next few minutes. ARP & RARP

  17. Figure 8-7 ARP components

  18. 8.2 ARP DESIGN.. Cache Table.. The cache table is implemented as an array of entries, In our design, each entry contains the following fields: State: This column shows the state of the entry. It can have one of three values: FREE: The time-to-live for this entry has expired. The space can be used for a new entry. PENDING: A request for this entry has been sent, but the reply has not yet been received. RESOLVED: The entry is complete. The entry now has the physical address of the destination. The packets waiting to be sent this destination can use information in this entry. Hardware type: This field is the same as corresponding field in the ARP packet. Protocol type: This field is the same as corresponding field in the ARP packet. Hardware length: This field is the same as corresponding field in the ARP packet. Protocol length: This field is the same as corresponding field in the ARP packet. ARP & RARP

  19. 8.2 ARP DESIGN… Cache Table.. Interface number: A router (or multihomed host) can be connected to different networks, each with a different interface number. Each networks can have different hardware and protocol types. Queue number: ARP uses different queues to enqueue the packets waiting for address resolution. Packets for the same destination are usually enqueued in the same queue. The queue number refers to the queue whose packets are waiting for this entry to be resolved. Attempts: This column shows how many times an ARP requesu is sent out for this entry. Time-out: This column shows the lifetime of an entry in seconds. Hardware address: This column shows the destination hardware address. It remains empty until resolved by an ARP reply. Protocol address: This column shows the destination IP address. ARP & RARP

  20. 8.2 ARP DESIGN… Queues The ARP package maintains a set of queues, one for each destination, to hold the IP packets while ARP tries to resolve the hardware address. The output module sends unresolved packets into the corresponding queue. The input module removes a packet from a queue and sends it, with the resolved physical address, to the data link layer for transmission. ARP & RARP

  21. 8.2 ARP DESIGN… 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 th 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. ARP & RARP

  22. 8.2 ARP DESIGN… Input Module Sleep until an ARP packet(request or reply) arrives. Check the cache table to find an entry corresponding to this ARP packet. If (found) If (the state is PENDING) Update the entry. While the queue is not empty. Dequeue one packet. Send the packet and the hardware address to data link. If (the state is RESOLVED) Update the entyry. If (not found) Create an entry. Add the entry to the table. If (the packet is a request) Send an ARP reply Return. ARP & RARP

  23. 8.2 ARP DESIGN… 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 maxium) 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. ARP & RARP

  24. 8.3 RARP The RARP is designed to resolve the address mapping problem in which a machine knows its physical address but does not know its logical address. To create an IP datagram, a host or a router needs to know its own IP address or address. The IP address of a machine is usually read from its configuration file stored on a disk file. However, a diskless machine is usually booted from ROM, which has minimum booting information. The machine can get its physical address (by reading its NIC, for example), which is unique locally. It can then use the physical address to get the logical address using the RARP protocol. A ARP request is created and broadcast on the local network. Another machine on the local network that knows all the IP address will respond with RARP reply. ARP & RARP

  25. Figure 8-8 RARP operation The RARP request packets are broadcast; the RARP reply packets are unicast

  26. Figure 8-9 RARP packet : the same as the ARP

  27. Figure 8-10 Encapsulation of RARP packet The RARP packet is encapsulated directly in to a data link frame. Note that the type field shows that the data carried by the frame is a RARP packet.

More Related