Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mapping Internet Addresses to Physical Addresses (ARP)

Similar presentations


Presentation on theme: "Mapping Internet Addresses to Physical Addresses (ARP)"— Presentation transcript:

1 Mapping Internet Addresses to Physical Addresses (ARP)
Chapter 5

2 Each host has 32-bit address (IP address)
Internet uses only assigned addresses for packet sending and receiving Two machines can communicate only if they know each other’s physical address How does host (or router) map an IP address to a correct physical address??

3 Address Resolution Problem
Refers to problem of mapping high-level addresses to physical addresses Suppose two machines A and B are connected to the same physical network A B IA IB PA PB What if A only has B’s IP address? How does A map this to B’s physical address?

4 Address mapping must occur at each step along a path as well
In general, two cases: Case 1: Last step in delivering a packet Last computer must map final destination’s internet address to the destination’s physical address Case 2: Any point along the path when sending to intermediate router Sender must map intermediate router’s internet address to a physical address

5 Two basic types of physical addresses:
proNET Small, easily configurable physical addresses Address resolution is easy Ethernet Large, fixed physical addresses Address resolution is hard

6 Direct Mapping Resolution
Consider a proNET token ring Uses small integers for physical addresses Allows user to choose hardware address Make address resolution easy by making part of the IP & physical address the same Assign IP addresses with hostid portion equal to 1, 2, 3, … When installing interface card, select physical address of 1, 2, 3, … IP get physical address 3

7 Mapping is easy Just extract host portion of IP address Conceptually, select a function f that maps IP addresses to physical addresses Resolving IP address IA means computing PA = f (IA ) Want computation as efficient as possible

8 Dynamic Binding Resolution
Consider an Ethernet Each interface has a 48-bit physical address Interface fails, address changes 48-bits can’t be encoded into 32-bit IP addresses Use Address Resolution Protocol (ARP) Host sends packet requesting intended destination to respond with its physical address All receive; destination recognizes its IP address and responds

9

10 Why not just send the packet?
ARP: allows a host to find the physical address of a target on the same physical network given only the target’s IP address Why not just send the packet? The request for address is broadcast Too expensive to broadcast every packet All machines must process the packet

11 ARP Cache Maintain a cache of recently acquired pairs
Keep IP, PhyAddr pairs to reduce comm costs Looks in cache before sending packet If have a binding, use it If not, broadcast an ARP request Since most communications involve multiple packets, even a small cache helps

12 Example Address Binding Table
IP Address Hardware Address 0A:07:4B:12:82:36 0A:9C:28:71:32:8D 0A:11:C3:68:01:99 0A:74:59:32:CC:1F 0A:04:BC:00:03:28 0A:77:81:0E:52:FA Example Address Binding Table

13 Soft state Information becomes stale without warning Example:
Computer A gets binding for computer B B then crashes A does not get notified A continues to send packets to B Ethernet does not have guaranteed delivery! No way of knowing ARP cache is wrong

14 Responsibility for correctness lies with the owner of the information
Use timer to periodically delete old bindings Typical timeout is 20 minutes (since set) Information must be removed Two cases then: 1) If no more packets, nothing happens 2) If have more packets, do another ARP broadcast If destination reachable, will get new binding If not, sender will know

15 Advantage of soft state is autonomy
Computer knows to revalidate bindings independent of other computers Sender does not need communication with anyone to invalidate a binding No reliance on network hardware for reliable transfer Disadvantage is delay Time to detect a crash is potentially as large as the timeout window

16 Refinements to ARP Include own binding when send a request
Queried machine updates its ARP cache All machines can update as well After a crash, send out an ARP request as part of the booting process

17 ARP is only one scheme for mapping
Some network technologies don’t need it Really imposes new address scheme on to of lower-level hardware address mechanism Think of ARP as part of physical network system (vs part of internet protocols)

18 ARP Implementation Divided into two functional parts Mapping
Mapping IP address to physical address Answering requests Mapping If have binding in cache, use it If not, send broadcast May not get reply (lost or machine down) Must store outgoing packets If other programs run, must not generate multiple requests for the same address currently waiting on

19 When ARP reply arrives Update ARP cache Remove packet(s) from queue
May have been packets from other applications Send

20 Answering requests First extract sender’s binding
If cache entry exists, update it Next, process the packet If target of request, then answer If not target, ignore rest of packet

21 ARP Encapsulation ARP messages travel in data portion of a frame
Sender assigns special type value in header

22 ARP Protocol Format ARP packets do not have fixed format header
Length of fields with addresses depend on the type of network Header includes fixed fields near beginning Format is general enough to be used with arbitrary physical addresses and arbitrary protocol addresses

23 Example ARP message format for Ethernet
Hardware Type Protocol Type HLEN PLEN Operation Sender HA (octets 0-3) Sender HA (octets 4-5) Sender IP (octets 0-1) Sender IP (octets 2-3) Target HA (octets 0-1) Target HA (octets 2-5) Target IP (octets 0-3)

24 Automatic Cache Revalidation
Jitter Variance in packet transfer times ARP timer expires; next datagram has extra delay Automatic revalidation Use a second (revalidation) timer for each entry Goes off early; sends ARP request Can still use ARP cache entry If station replies, both timers reset If no reply, act as normal when traditional timer expires

25 Reverse ARP (RARP) Operation field can specify Reverse ARP
Allows system to obtain its IP address at startup Computer can know its hardware address, but perhaps not its IP address (ex.: diskless systems) When booting, system broadcasts a RARP request RARP server has to be configured and listening RARP server sends reply giving requester’s IP address RARP no longer used At one time was essential for computers without stable storage (see DHCP, Chap. 22)

26 Summary IP addresses are independent of physical addresses
To send packets, must do mapping Direct mapping If physical addresses smaller than IP addresses Dynamic mapping ARP performs dynamic address resolution

27 RARP ARP broadcast finds physical addresses
All machines receive ARP broadcast If IP address matches machine’s, answer request Replies directed to one machine only (not broadcast) For efficiency, bindings are cached Cache helps eliminate many broadcast Early revalidation can be used to avoid jitter RARP Could be used to obtain IP address at startup Now obsolete


Download ppt "Mapping Internet Addresses to Physical Addresses (ARP)"

Similar presentations


Ads by Google