ARP Relates to Lab 2 This module is about the address resolution protocol 2 Overview 3 IP and LAN addresses The Internet is based on 32bit IP addresses Applications only deal with IP addresses ID: 631618
Download Presentation The PPT/PDF document "1 Address Resolution Protocol" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
1
Address Resolution Protocol
(ARP)
Relates to Lab 2.
This module is about the address resolution protocol.Slide2
2
OverviewSlide3
3
IP and LAN addresses
The Internet is based on 32bit IP addresses Applications only deal with IP addressesBut all Internet devices connect to a physical link via hardware - Network
Interface Card (NIC
),
that has an address.
Data link protocols (Ethernet, Frame Relay) have different addressesSlide4
Nature of MAC addressesHardare address allocation administered by IEEEManufacturer buys portion of hardware address space (to assure uniqueness)Analogy of Internet Addresses:Hardware address: like Social Security NumberIP address: like postal address Hardware: flat address ➜ portable assigned once, un-chageable, goes with you, move from one physical location to another it doesn’t changeIP: hierarchical address -> not portable address assigned based on physical location, i.e., IP subnet to which device is attached, changes when you move from one network to another
4Slide5
IP and MAC Addresses
5
adapter
1A-2F-BB-76-09-AD
58-23-D7-FA-20-B0
0C-C4-11-6F-E3-98
LAN
137.196.7.23
137.196.7.78
137.196.7.14
137.196.7.88
71-65-F7-2B-08-53
IP addresses are “
generally
” known
–
i.e., application can find it in DNS database.
How do we find a device’s
hardware
address?
Use a ”
dynamic binding
” procedure - an
address resolution process
that finds hardware address for an IP address.Slide6
Address Resolution Protocol - ARPStandard for dynamic address resolution in the InternetThe ARP protocol performs the translation between 32 bit IP addresses and link layer addresses to reach the physical location of a device on the same “single segment” network (i.e., all devices that have same IP network prefix)Physical address burned in NIC ROM, sometimes software settable or firmware.Example of an address on an Ethernet link (48bits): 1A-2F-BB-76-09-ADhexadecimal (base 16) notation (each “number”
represents 4 bits)Isolates hardware address at low level
Allows application programs to use IP addresses
6Slide7
ARP DescriptionAllows device A to find device B’s hardware addressTechnique: broadcast query and obtain unicast responseQuery: sent as a “hardware” broadcast (link layer broadcast)limited broadcast: ARP only used to map addresses within a single physical/segment network, never across multiple (IP) networksQuery contains A’s hardware address and B’s IP addressResponse: sent as a unicast to A’s hardware addresscontains B’s hardware address
7Slide8
ARP OperationA wants to send datagram to BA starts with B’s IP addressA knows B is on the local network (resolved by A using network prefix)A broadcasts ARP query packet, containing B's IP address dest address in Ethernet frame = FF-FF-FF-FF-FF-FFsource address in Ethernet frame = A’s hardware addressall nodes on data link/single segment network, receive ARP query Query (ARP packet) contains A’s hardware address and B’s IP addressB receives A’s ARP query packet, recognizes its IP address, replies to A with its (B's) hardware addressframe sent to A’s hardware address (unicast) containing B’s hardware address
8Slide9
9
ARP Packet Format
18Slide10
ARP Packet FormatGeneral: can be used withArbitrary hardware address (not just Ethernet)Arbitrary protocol address (not just IP)Variable length address fields (depends on type of datalink protocol)
10Slide11
11
Address Translation with ARP
ARP Request: Argon broadcasts an ARP request to all stations on the network: “What is the hardware address of 128.143.137.1?”
128.143.137.1?Slide12
12
Address Translation with ARP
ARP Reply: Router 137 responds with an ARP Reply which contains the hardware address
128.143.137.1?Slide13
13
Example
ARP Request from Argon: Source hardware address: 00:a0:24:71:e4:44Source protocol address: 128.143.137.144
Target hardware address: 00:00:00:00:00:00
Target protocol address: 128.143.137.1
ARP Reply from Router137:
Source hardware address: 00:e0:f9:23:a8:20 Source protocol address: 128.143.137.1 Target hardware address: 00:a0:24:71:e4:44Target protocol address: 128.143.137.144Slide14
Retention of BindingsSending an ARP request/reply for each IP datagram (to same IP address) is inefficient. Solution -> maintain a table of bindingsdevices maintain a cache of currently used IP addresses and their corresponding hardware addresses. A device caches IP-to-hardware address pairs in a table until information becomes old (times out) Soft state: information times out (goes away) unless refreshed (i.e., everytime an IP address is looked up in the table)The entries expire after X minutes. Initially X=20, but because of mobility, it is now very short, sometimes just 30secs.EffectUse ARP one time, place results in table, then quick lookup many times (every packet sent to that same IP address)
14Slide15
Note on BindingsIf A ARPs B, B keeps A’s informationB will probably send a packet to A soonIf A ARPs B, A keeps B’s informationA will probably send more packets to BOther machines do not keep A’s information (even though they all see the broadcast with A’s information)Avoids clogging ARP caches needlessly
15Slide16
16
ARP Cache (table)
Contents of the ARP Cache:(128.143.71.37) at 00:10:4B:C5:D1:15 [ether] on eth0
(128.143.71.36) at 00:B0:D0:E1:17:D5 [ether] on eth0
(128.143.71.35) at 00:B0:D0:DE:70:E6 [ether] on eth0
(128.143.136.90) at 00:05:3C:06:27:35 [ether] on eth1
(128.143.71.34) at 00:B0:D0:E1:17:DB [ether] on eth0
(128.143.71.33) at 00:B0:D0:E1:17:DF [ether] on eth0ARP is “plug-and-play”:nodes create their ARP tables
without intervention from net administratorSlide17
17
Things to know about ARP
What happens if an ARP Request is made for a non-existing host? Several ARP requests are made with increasing time intervals between requests. Eventually, ARP gives up.
What if a host sends an ARP request for its own IP address? Know as gratuitous ARP
No response hopefully
This is useful for detecting if an IP address has already been assigned (via DHCP).Slide18
18
ARP in our Example
Argon realizes that it needs to use router to reach Neon as the two hosts are on different IP networks. Argon sends an ARP Request to the router for
MAC address
of NIC corresponding to
IP address
of router on the
common network.Router sends ARP Response to host Argon with MAC address corresponding to the IP address of its NIC on that connected
network
.
Router IP Address
Router MAC address
128.143.137.1?
128.143.137.1 is
128.143.137.0/24
128.143.71.21/24
128.143.137.144/24
128.143.137.1/24Slide19
Proxy ArpAllow devices on two different IP subnetworks to share a single IP network prefixSource believes destination is on same IP networkSetup router to respond to ARP broadcast requests for destinations on different connected subnet router masquerades as destination for ARP request sent by source on a subnetthe two devices are unaware that they are on different subnets, subnet mask indicates that they have the same network prefix.Masquerades: router responds to broadcast ARP Request from source host that arrives on one of its connected networks for a destination host that is on one of its other connected networks.
19Slide20
20
Proxy ARP Operation in Our Example with Argon having /16 as its network prefix
Router responds to broadcast ARP Request from host Argon that arrives on
one
of its connected
networks
for
host Neon that is on one of its other connected networks. Host Argon believes Neon is on the same IP network because of its ”prefix” /16.
Argon sees it is on IP network
128.143.0.0
. When applying prefix /16 to Neon’s IP address 128.143.71.21 -->
128.143.0.0
, which is the same as its own. so it sends a broadcast ARP request for Neon.Router responds with its MAC address and then transfers the datagram to the next segment.
Neon
IP Address
Router MAC address
128.143.71.21/24
128.143.137.0/24
128.143.137.1/24Slide21
ARP Cache in two ExamplesNon Proxy ARP:A’s ARP cache(128.143.137.1) at 00:e0:f9:23:a8:20 [ether] on eth0Proxy ARP:A’s ARP cache(128.143.71.21) at 00:e0:f9:23:a8:20 [ether] on eth0
21Slide22
ARP TransportARP message travels in data portion of data link layer frameWe say ARP message is encapsulatedData area padded with zeroes if ARP message is shorter than minimum data link layer frameFor Ethernet: frame type field 0x0806 used for ARP
22