Download presentation
Presentation is loading. Please wait.
1
Address Resolution Protocol (ARP)
2
Mapping IP Address to Data-Link Address How does a machine map an IP address to its Data- Link layer (hardware or MAC) address? This is needed by the source host A who needs to send an IP packet to another host B if B is on same IP network as A, address frame to B. Thus, DL-Address of B is needed. if B on a separate network, address frame to a router. Thus, DL-Address of router is needed. ARP is also used by routers (See next slide)
3
Four cases using ARP
4
Address Resolution Some protocol suites adopt one of the following: Keep mapping tables in each machine Hardware (physical) addresses are encoded in the high level addresses Both are ad-hoc, awkward solutions
5
Resolution Through Dynamic Binding Ethernet uses 48-bit physical addresses Addresses assigned by manufacturers Replacing a faulty interface card meant a change to the machine physical address Can’t encode 48-bit long address into a 32-bit long IP address TCP/IP solution: Address Resolution Protocol (ARP)
6
ARP Exploits broadcast capability of Ethernet Allows a host to find the Ethernet address of a target host on the same network, given the target’s IP address Allows machines to be added or removed with no code recompilation Builds and maintains dynamically a table to translate IP addresses into Ethernet physical addresses
7
ARP operation
8
ARP (contd.) Hosts that use ARP maintain a small cache of recently acquired (IP,Hardware) address bindings Cache is updated dynamically Timer for each entry Whenever a new binding is received, update the corresponding table entry and reset the associated timer ARP is a low level protocol that hides the underlying network physical addressing, permitting us to assign IP addresses of our choosing to every machine
9
ARP (contd.) We think of it as part of the physical network and not as part of the internet protocols Functionally ARP is divided in two parts One part that determines physical address of the destination of the outgoing packet One part answers requests from other machines
10
ARP Implementation (contd.) Address resolution of outgoing packet IF dest. IP address is in cache THEN Get corresponding physical address Construct an Ethernet frame Else Broadcast an ARP request Wait for an ARP reply
11
ARP Implementation (contd.) Two types of incoming ARP packets A Request IF this machine is the target of ARP Request THEN Generate ARP Reply and send it to requester ELSE Ignore the request A Reply Determine if we need to create a cache entry or update existing entry Match Reply with initial Request
12
ARP Encapsulation in Ethernet Frame Eth. DA (Ethernet Destination Address) : For ARP Request it is set to FF FF FF FF FF FF
13
ARP Packet Format (contd.) 80162431 Hardware TypeProtocol Type HALENPALEN Operation (1/2: ARP-Req,/Rep, 3/4: RARP-Req/Rep) SENDER HA (Bytes 0-3) SENDER HA (Bytes 4-5) SENDER IP (Bytes 0-1) SENDER IP (Bytes 2-3)TARGET HA (Bytes 0-1) TARGET HA (Bytes 2-5) TARGET IP (Bytes 0-3) (0x0001: Ethernet)(0x0800: IP)
14
ARP Packet Format To allow ARP to be used with a variety of network technologies, header of ARP messages does not have a fixed format First fields in the header specify the length of succeeding fields On Ethernet, 28-octet ARP message format is used
15
A host with IP address 130.23.43.20 and physical address B2:34:55:10:22:10 has a packet to send to another host with IP address 130.23.43.25 and physical address A4:6E:F4:59:83:AB. The two hosts are on the same Ethernet network. Show the ARP request and reply packets encapsulated in Ethernet frames. Solution Figure shows the ARP request and reply packets. Note that the ARP data field in this case is 28 bytes, and that the individual addresses do not fit in the 4-byte boundary. That is why we do not show the regular 4-byte boundaries for these addresses. Example
16
an ARP request and reply
17
Additional Notes about ARP Every host that receives the broadcast ARP request caches the Sender's IP Address/Hardware Address When a station boots it sends a broadcast ARP request with target IP address matching its own This enables other hosts to cache the sender's info. If the station gets a reply, it knows that its IP address is used by some other host and thus we know of duplicate IP addresses
18
Determining an IP Address at Startup Diskless machines use IP addresses to communicate with the file server Also, many diskless machines use TCP/IP FTP protocols to obtain their initial boot image, thus requiring that they obtain and use IP addresses Designers keep both the bootstrap code and initial OS images free from specific IP addresses for portability
19
Determining IP Address at Startup (contd.) How does a diskless machine determine its IP address? When bootstrap code starts execution on a diskless machine, it must use the network to contact a server to obtain the machine’s IP address Usually, a machine’s IP address is kept on disk where OS finds it at startup
20
Reverse Address Resolution Protocol (RARP) RARP is the protocol used to solve the reverse problem solved by ARP Given a physical address, get the corresponding IP address RARP uses the same message format as ARP RARP messages are sent encapsulated in Ethernet frames These days, DHCP (Dynamic Host Configuration Protocol) is a newer protocol that is used as a replacement for RARP. Thus, we can say that DHCP has rendered RARP (but not ARP) obsolete
21
RARP (contd.) DA YX C RARP_RequestRARP_Replies RARP Server
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.