Docsity

ARP and RARP - Mapping IP and MAC Addresses, Study notes of Computer Science

Toggle sidebar
bg1
1
The Address Resolution Protocol
(ARP)
Internet Protocols
CSC / ECE 573
Fall, 2005
N. C. State University
copyright 2005 Douglas S. Reeves 2
Today’s Lecture
I. ARP: Mapping IP (logical) Addresses to Link
Layer (MAC, hardware) Addresses
II. RARP: Mapping Link Layer Addresses to IP
Addresses
ARP
copyright 2005 Douglas S. Reeves 4
The Address Resolution Problem
• Applications specify destinations by IP address (or
DNS name that gets translated into IP address)
• IP packets are sent over links that only recognize
MAC addresses
⇒ How map IP address to Ethernet address?
copyright 2005 Douglas S. Reeves 5
An Analogy
• Phone call to <Employee@Company>
must be translated into <extension #> for
connection
– what’s the best way to do this? what factors should be
considered?
copyright 2005 Douglas S. Reeves 6
What Layer is ARP?
• Does not use IP
Ethernet
Driver
ARP IP RARP
ICMP IGMPTCP UDP
application application application application
… …
pf3
pf4
pf5

Partial preview of the text

Download ARP and RARP - Mapping IP and MAC Addresses and more Study notes Computer Science in PDF only on Docsity!

The Address Resolution Protocol

(ARP)

Internet Protocols CSC / ECE 573 Fall, 2005 N. C. State University copyright 2005 Douglas S. Reeves (^) 2

Today’s Lecture

I. ARP: Mapping IP (logical) Addresses to Link Layer (MAC, hardware) Addresses II. RARP: Mapping Link Layer Addresses to IP Addresses

ARP

copyright 2005 Douglas S. Reeves (^) 4

The Address Resolution Problem

  • Applications specify destinations by IP address (or DNS name that gets translated into IP address)
  • IP packets are sent over links that only recognize MAC addresses ⇒ How map IP address to Ethernet address? copyright 2005 Douglas S. Reeves (^) 5

An Analogy

  • Phone call to must be translated into for connection - what’s the best way to do this? what factors should be considered? copyright 2005 Douglas S. Reeves (^) 6

What Layer is ARP?

  • Does not use IP Ethernet Driver ARP IP RARP ICMP TCP UDP IGMP

application … application^ application … application

copyright 2005 Douglas S. Reeves (^) 7 Solution: Dynamic Binding (RFC 826) Host A wants to send data to Host B with logical address IP B, located on same local area network Host A broadcasts to all hosts on LAN: “What is the hardware address of host with logical address IP B ”? B receives broadcast frame, decapsulates ARP Request Host A sends IP datagram to IP B inside frame with hardware address MAC B Host B recognizes its logical (IP) address, unicasts “My hardware address is MAC B ” to MAC A copyright 2005 Douglas S. Reeves (^) 8 ARP in a Picture copyright 2005 Douglas S. Reeves (^) 9 ARP PDU Format

  • Two message Types (ARP Request and ARP Reply), with same format (28 bytes) Hardware Type (e.g. Ethernet) Protocol Type (e.g. IPv4) Length of Physical (MAC) Address (e.g., Ethernet=6) Length of Logical Address (e.g. IPv4=4) Operation Type (e.g. Request, Reply) Sender Physical Address (MAC) Sender Logical Address (IP) Target Physical Address (MAC) Target Logical Address (IP) copyright 2005 Douglas S. Reeves (^) 10 Details Host A ARP Request SenderMAC = MAC A SenderIP = IP A TargetMAC = ??? TargetIP = IP B SenderMAC = MACB SenderIP = IP B TargetMAC = MAC A TargetIP = IP A Host B ARP Reply
  • Q: Is Target MAC ever useful? Broadcast to everybody on the LAN Unicast just to A copyright 2005 Douglas S. Reeves (^) 11 Possible Outcome?
  • What if two hosts claim same IP address, but reply with different hardware addresses? - could this be legit? copyright 2005 Douglas S. Reeves (^) 12 ARP Cache
  • Wish to avoid sending an ARP Request for every data packet
  • Solution: cache address mapping for reuse
  • A caches the ARP Reply (MACB, IPB) mapping
  • All hosts on LAN cache ARP Request (MACA, IPA) mapping

copyright 2005 Douglas S. Reeves (^) 19 Questions about Spoofing

  • What are the possible results?
  • Won’t B notice that C is claiming its IP address?
  • What can B do about it?
  • Will C know if B asserts its own mapping for B.B.B.B to other hosts? - what should C do? - who “wins”?
  • Ways to prevent spoofing? copyright 2005 Douglas S. Reeves (^) 20 Proxy Arp
  • Example: bridging two Ethernets at the IP layer Router R Ethernet Switch E Host A Host B Host C Ethernet Switch E2 Host Y Host Z IP: R.R.R.R HW: rr:rr:rr:rr:rr:rr IP: S.S.S.S HW: ss:ss:ss:ss:ss:ss
  • Can we make A, B, C, Y, and Z think they are all on the same Ethernet segment? copyright 2005 Douglas S. Reeves (^) 21 Proxy Arp (cont’d)
  • Solution
  • R intercepts ARP Requests from Y for B’s hardware address, and replies with its own hardware address (ss:ss:ss:ss:ss:ss)
  • Y will sends data for B.B.B.B to R
  • R substitutes rr:rr:rr:rr:rr:rr for Source Hardware Address in link layer frame, forwards to B
  • Sometimes it’s good to lie  RARP (REVERSE ARP) copyright 2005 Douglas S. Reeves (^) 23 RARP (RFC 903)
  • One or more RARP servers store IP addresses for hosts on their network
  • A client host can request its IP address from the server(s), using its own hardware address
  • RARP Request is broadcast on the LAN
  • RARP uses the same message format as ARP, except for the Operation Field copyright 2005 Douglas S. Reeves (^) 24 Example
  • Host A RARP Request SenderMAC = MAC A SenderIP = ??? TargetMAC = MAC A TargetIP = ??? SenderMAC = MACS SenderIP = IP S TargetMAC = MAC A TargetIP = IP A  RARP Server S RARP Reply
  • Q: Is Target MAC ever useful? Broadcast Unicast

copyright 2005 Douglas S. Reeves (^) 25 Some Questions

  • Client repeats the RARP Request if no RARP Reply is received - how many times? - how much delay (time-out) between retransmissions?
  • What if multiple Replies?
    • could this be legit? copyright 2005 Douglas S. Reeves (^) 26 RARP Servers
  • Primary ARP server
  • provides mapping for many hosts
  • Sends RARP Reply directly to the client
  • Secondary ARP server(s)
  • does not respond to first RARP Request from the client
  • responds to second RARP Request received within a short time
  • each server randomly delays the Reply to avoid collisions with other servers
  • If we use RARP servers, why don’t we use ARP servers? copyright 2005 Douglas S. Reeves (^) 27 More Questions for RARP
  1. Who data fills the server with mappings?
  2. What if you want mapping to be only temporary?
  3. How handle changes in mapping?
  4. What if you want to request more than just IP address, e.g.,…
    1. DNS server
    2. Routing information
    3. Time of day
    4. …? copyright 2005 Douglas S. Reeves (^) 28 Summary
  5. ARP maps IP (logical) addresses to MAC (hardware) addresses, so IP datagrams can be delivered over arbitrary link layers
  6. ARP caches reduce the frequency of ARP Requests
  7. ARP spoofing is a substantial security problem
  8. RARP maps MAC (hardware) addresses to IP addresses
  • much more widely used: BOOTP / DHCP copyright 2005 Douglas S. Reeves (^) 29 Next Lecture
  • Classful IPv4 Addresses and Datagram Forwarding