47
1 Kyung Hee University Chapter 8 ARP(Address Resolution Protocol)

Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

1Kyung Hee University

Chapter 8ARP(Address

Resolution Protocol)

Page 2: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

2Kyung Hee University

8.1 Address Mapping

Logical address

The hosts and routers are recognized at the network level by their logical addressLogical address is unique universalIP addresses are logical address in TCP/IP and 32 bits long

Physical address

Local addressShould be unique locally, but not necessarily universallyImplemented in hardwareImprinted on the NIC installed in the host or router

Page 3: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

3Kyung Hee University

Address Mapping

Static mapping

Create a table that associates a logical address with a physical address

This table is stored in each machine on the network

The machine that know the IP address of another machine but not its physical address can look it up in table

When physical addresses are changed, a static mapping table must be updated periodically. This overhead could affect network performance

Page 4: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

4Kyung Hee University

Address Mapping

Dynamic mapping

The machine could know the logical address or physical address of another machine using following protocols ARP (Address Resolution Protocol)

– Mapping a logical address to a physical address RARP (Reverse Address Resolution Protocol)

– Mapping a physical address to a logical addressSince RARP is replaced with another protocol, we discuss only ARP protocol

Page 5: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

5Kyung Hee University

8.2 ARP Protocol

A host or a router has an IP datagram to send to another host or router, it has the logical (IP) address of the receiver

IP datagram must be encapsulated in a frame to be able to pass through the physical network

This means that the sender needs the physical address of the receiver

ARP accepts a logical address from the IP protocol, maps the address to the corresponding physical address and pass it to the data link layer.

Page 6: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

6Kyung Hee University

Position of ARP in TCP/IP Protocol Suite

Page 7: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

7Kyung Hee University

ARP Operation

TCP/IP Protocol Suite

LAN

a. ARP request is multicast

System A System B

b. ARP reply is unicast

LAN

System A System B

Looking for physical address of anode with IP address 141.23.56.23

Request

The node physical addressis A4:6E:F4:59:83:AB

Reply

Page 8: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

8Kyung Hee University

ARP Packet

Page 9: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

9Kyung Hee University

ARP Packet Hardware type : define the type of the network (Ethernet : 1)

Protocol type : define the protocol (IPv4 : 080016)

Hardware length : define the length of the physical address in bytes

Protocol length : define the length of logical address in byte

Operation : define the type of packetARP request (1), ARP reply (2)

Sender hardware address : define the physical address of the sender

Sender protocol address : define the logical address of the sender

Target hardware address : define the physical address of the target

Target protocol address : define the logical address of the target

Page 10: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

10Kyung Hee University

Encapsulation of ARP Packet

Type

Type

Page 11: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

11Kyung Hee University

ARP OperationEncapsulation operation of ARP process

① The sender knows the IP address of target② IP asks ARP to create an ARP request message③ The message is passed to the link layer where it is

encapsulated in an 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 and passes it to ARP⑤ The target machine replies with an ARP reply message that

contains tis physical address⑥ The sender receives the reply message and knows the

physical address of the target machine⑦ The IP datagram, which carries data for the target machine, is

now encapsulated in a frame and is unicast to the destination

Page 12: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

12Kyung Hee University

Four Different Cases

The sender is a host and wants to send a packet to another host on the same network

The sender is a host and wants to send a packet to another host on another network

The sender is a router that has received a datagram designed for a host on another network

The sender is a router that has received a datagram designed for a host in the same network

Page 13: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

13Kyung Hee University

Four Cases Using ARP

Page 14: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

14Kyung Hee University

Example 8.1

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 (which is unknown to the first host). The two hosts are on the same Ethernet network. Show the ARP request and reply packets encapsulated in Ethernet frames.

Solution

Figure 8.6 shows the ARP request and reply packet. Note that the ARP data field in this case is 28 bytes, and that the individual addresses do not fit in the 4-byte boundaries for these addresses. Also note that the IP addresses are shown in hexadecimal.

Page 15: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

15Kyung Hee University

Figure 8.6

Page 16: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

16Kyung Hee University

Proxy ARP

Used to create a subnetting effect

The proxy ARP router repliesto any ARP request receivedfor destinations 141.23.56.21,

141.23.56.22, and 141.23.56.23.

Router or hostProxy ARP

router

141.23.56.21 141.23.56.22 141.23.56.23Added subnetwork

Page 17: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

17Kyung Hee University

8.3 ATMARP

When IP packets are moving through an ATM WAN, a mechanism protocol is needed to find (map) the physical address of the exiting-point router in the ATM WAN given the IP address of the router.

Page 18: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

18Kyung Hee University

ATMARP Packet

Page 19: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

19Kyung Hee University

Packet Format Hardware type : define the type of the physical network

Protocol type : define the type of protocol

Sender hardware length : define the length of the sender’s physical address in bytes

Operation : define the type of the packet

Sender protocol length : defines the length of the address in bytes

Target hardware length : define the length of the receiver’s physical address in bytes

Target protocol length : define the length of the address in bytes

Sender hardware address : define the physical address of the sender

Sender protocol address : define the address of the sender

Target hardware address : define the physical address of the receiver

Target protocol address : define the address of the receiver

Page 20: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

20Kyung Hee University

Operation field

Page 21: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

21Kyung Hee University

ATMARP Operation

PVC(Permanent Virtual Circuit) connection

Established between two end points by the network provider

The VPIs and VCIs are define for the permanent connections The values are entered in a table for each switch If the permanent virtual circuit is established, there is no need

for an ATMARP serverThe router must be able to bind a physical address to an IP address

Using inverse request message and inverse reply message

After the exchanging, both routers add a table entry that maps the physical addresses to the PVC

Page 22: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

22Kyung Hee University

Binding with PVC

time time

Two routers connected through PVC

I II IIIATM

Inverse Request1

Inverse Reply2

Page 23: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

23Kyung Hee University

ATMARP Operation

SVC (Switched Virtual Circuit) connection

Each time a router wants to make a connection with another router, a new virtual circuit must be established

But virtual circuit can be created only if the entering-point router knows the physical address of the exiting-point router

To map the IP addresses to physical addresses, each router runs a client ATMARP programs

Page 24: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

24Kyung Hee University

Binding with ATMARP

Entering-pointrouter

Exiting-pointrouter

ATMARPServer

Time Time

I IIIIIATM

Using PVC or SVCconnection

Request1

Reply 2

orNACK

2

Finding physicaladdress

Page 25: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

25Kyung Hee University

The Process of Establishing a virtual connectionConnecting to the Server

Normally, there is a permanent virtual circuit established between each router and the serverIf there is no PVC connection, the server must at least know the physical address of the router

Receiving the physical addressWhen there is a connection between the entering-point router and the server, the router sends an ATMARP request to the serverThe server sends back an ATMARP reply if the physical address can be found or an ATMARP NACK otherwise

Establishing Virtual CircuitEntering-point router can request SVC between itself and the exiting-point router

Page 26: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

26Kyung Hee University

Building the Table

The ATM server build its mapping table

Use of ATMARP and the two inverse messages

When a router is connected to an ATM network for the first time and a permanent virtual connection is established between the router and the server, the server sends an inverse request message to the router

The router sends back an inverse reply message, which includes its IP address and physical address

Using these two address, the server creates an entry in its routing table

Page 27: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

27Kyung Hee University

Building the Table

A newly connectedrouter

Time Time

I II III

ATMARPserverATM

Inverse request1

Inverse reply2

Page 28: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

28Kyung Hee University

Logical IP Subnet (LIS)

Page 29: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

29Kyung Hee University

Logical IP Subnet (LIS)

A large ATM network can be divided into logical subnetwokrs

In previous figure,

Routers B, C, and D belong to one or more logical subnets

Routers F, G, and H belong to another logical sunbets

Routers A and E belong to both logical subnets

To send a packet to a router that belongs to another subnet, the packet must first go to a router that belongs to both subnets

Page 30: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

30Kyung Hee University

8.4 ARP Package

ARP package involves five components

Cache table

Queue

Output module

Input module

Cache-control module

Page 31: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

31Kyung Hee University

ARP Components

Page 32: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

32Kyung Hee University

ARP Package

Cache table

Inefficient to use the ARP protocol for each datagram destined for the same host or router

When a host or router receives the corresponding physical address for an 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 miniute

As space in the cache table is very limited, mappings in the cache are not retained for an unlimited time

Page 33: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

33Kyung Hee University

ARP PackageEntry of cache table

State : state of entry, FREE, PENDING, RESOLVEDHardware type : same as the field in ARP packetHardware length : same as the field in ARP packetProtocol length : same as the field in ARP packetInterface number : a router can be connected to different networks, each with a different interface numberQueue number : ARP uses numbered queue to enqueue the packets waiting for address resolutionAttempts :number of times an ARP request is sent out for this entryTime-out : the lifetime of an entry in secondsHardware address : destination hardware addressProtocol address : the destination IP address

Page 34: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

34Kyung Hee University

ARP Package – Five Components

Output module

Page 35: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

35Kyung Hee University

ARP Package – Five Components

Input module

Page 36: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

36Kyung Hee University

ARP Package – Five Components

Cache control module

Page 37: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

37Kyung Hee University

ARP Package – Five Components

Cache control module

Page 38: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

38Kyung Hee University

Original Cache Table Used for Example

Page 39: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

39Kyung Hee University

Example 8.2

The ARP output module receives an IP datagram (from the IP layer) with the destination address 114.5.7.89. It checks the cache table and finds that an entry exists for this destination with the RESOLVED state (R in the table). It extracts the hardware address, which is 457342ACAE32, and sends the packet and the address to the data link layer for transmission. The cache table remains the same.

Page 40: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

40Kyung Hee University

Example 8.3

Twenty seconds later, the ARP output module receives an IP datagram (from the IP layer) with the destination address 116.1.7.22. It checks the cache table and does not find this destination in the table. The module adds an entry to the table with the state PENDING and the Attempt value 1. It creates a new queue for this destination and enqueues the packets. It then sends an ARP request to the data link layer for this destination. The new cache table is shown in Table 8.6

Page 41: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

41Kyung Hee University

Table 8.6 Updated Cache Table for Example 8.3

Page 42: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

42Kyung Hee University

Example 8.4

Fifteen seconds later, the ARP input module receives an ARP packet with target protocol (IP) address 188.11.8.71. The module checks the table and finds this address. It changes the state of the entry to RESOLVED and sets the time-out value to 900. The module then adds the target hardware address (E34573242ACA) to the entry. Now it accesses queue 18 and sends all the packets in this queue, one by one, to the data link layer. The new cache table is shown in Table 8.7

Page 43: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

43Kyung Hee University

Updated Cache Table for Example 8.4

Page 44: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

44Kyung Hee University

Example 8.5

Twenty-five seconds later, the cache-control module updates every entry. The time-out values for the first three resolved entries are decremented by 60. The time-out value for the lastresolved entry is decremented by 25. The state of the next-to-the last entry is changed to FREE because the time-out is zero. For each of the there pending entries, the value of the attempts field is incremented by one. After incrementing, the attempts value for one entry (the one with IP address 201.11.56.7) is more than maximum; the state is changed to FREE, the queue is deleted, and an ICMP message is sent to the original destination.

Page 45: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

45Kyung Hee University

Table 8.8 Updated Cache Table for Example 8.5

Page 46: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

46Kyung Hee University

8.7 SummaryDelivery of a packet to a host or router requires two levels of

address: logical and physical. A logical address identifies a host or router at the network level. TCP/IP calls this logical address an IP address. A physical address identifies a host or router at the physical level

Mapping of a logical address to a physical address can be static or dynamic. Static mapping involves a list of logical and physical address; maintenance of the list requires high overhead

The address resolution protocol (ARP) is a dynamic mapping method that finds a physical address given a logical address. An ARP request is broadcast to all devices on the network. An ARP reply is unicast to the host requesting the mapping

Page 47: Chapter 8 ARP(Address Resolution Protocol)networking.khu.ac.kr/.../Chapter8.pdf · 2015-06-12 · 5 Kyung Hee University 8.2 ARP Protocol A host or a router has an IP datagram to

47Kyung Hee University

8.7 Summary In proxy ARP, a router represents a set of hosts. When an ARP request seeks

the physical address of any host in this set, the router sends its own physical address. This creates a subnetting effect.

ATMARP is a protocol used on ATM networks that binds a physical address to an IP address. The ATMARP server’s mapping table is built through the use of the inverse request and the inverse reply messages. An ATM network can be divided into logical subnetworks to facilitate ATMARP and other protocol operations.

The ARP software package consists of five components: a cache table, queue, an output module, an input module, and a cache-control module. The cache table has an array of entries used and updated by ARP messages. A queue contains packets going to the same destination. The output module takes a packet from the IP layer and sends it either to the data link later or to a queue. The input module uses an ARP packet to update the cache table. The input module can also send an ARP reply. The cache-control module maintains the cache table by updating entry fields.