arp rarp

21
Introduction IP addresses are “virtual”, maintained by SW A frame transmitted across a physical NW must have the HW address (HWA) of the destination SW must translate the protocol address (PRA) of the destination into an equivalent HWA This section describes three general mechanisms that are used to perform address mapping: –1 st relies on a table that contains address translation information –2 nd uses a mathematical function to perform the translation. –3 rd makes two computers exchange messages across a NW

Upload: kamalesh-lunkad

Post on 09-Nov-2014

10 views

Category:

Documents


0 download

DESCRIPTION

ARP RARP

TRANSCRIPT

Page 1: ARP RARP

Introduction

• IP addresses are “virtual”, maintained by SW• A frame transmitted across a physical NW

– must have the HW address (HWA) of the destination

• SW must translate the protocol address (PRA) of the destination into an equivalent HWA

This section • describes three general mechanisms that are used to

perform address mapping:– 1st relies on a table that contains address translation information– 2nd uses a mathematical function to perform the translation.– 3rd makes two computers exchange messages across a NW

Page 2: ARP RARP

Protocol Addresses And Packet Delivery

• SW in each host or router uses the destination PRA to select a next hop for the packet

• PRA cannot be used when transmitting frames across physical NW– the HW does not understand PRA

• A frame must use the HW's frame format– and all addresses in the frame must be a HWA

• PRA of a next hop must be translated to an equivalent HWA before a frame can be sent

Page 3: ARP RARP

Address Resolution (AR)

• Mapping between a PRA and a HWA – called “address resolution” (AR)

• A host/router uses AR when it needs to send a packet to another computer on the same physical NW– AR is local to a NW

• A computer never resolves the address of a computer that attaches to a remote NW.

• Each computer that handles a packet resolves a next-hop address before sending

Page 4: ARP RARP
Page 5: ARP RARP

Address Resolution Techniques

• Different methods needed– To resolve a PRA to an Ethernet address differs from the

method used to resolve a PRA to an ATM address

• AR algorithms can be grouped into three categories:• Table lookup

– Bindings or mappings are stored in a table in memory

• Closed-form computation– HWA can be computed from the protocol address using basic

Boolean and arithmetic operations

• Message exchange– Computers exchange messages across a NW for AR; “request” and “reply” messages

Page 6: ARP RARP

AR With Table Lookup

• Table is an array with a pair of ( P, H ) entries – P PRA– H equivalent HWA

• A separate binding table is used for each NW• Table in next Figure corresponds to a NW with prefix

197.15.3.0 / 24. Each IP address has 197.15.3 prefix– We can save space by omitting the prefix from table entries

• Chief advantage of the table lookup is generality– a table can store the address bindings for an arbitrary set– arbitrary no. of PRAs can map to an arbitrary no. of HWA

Page 7: ARP RARP
Page 8: ARP RARP

AR With Table Lookup (cont)

• Sequential search for a match for a given PRA• For large NWs a sequential search requires excessive

CPU time– For computational efficiency– We can use “hashing” or “direct indexing”

• Administrators may choose non-sequential numbers for PRA to help identify the purpose of a computer, e.g. – hosts with suffixes < 200 , while routers with suffixes > 200– host suffix from an IP address as an index into the array

• To prevent an illegal PRA from causing a subscript error– must check to ensure the suffix is in range

Page 9: ARP RARP
Page 10: ARP RARP

AR With Closed-Form Computation

• Some technologies use configurable addressing– A NW interface can be assigned a specific HWA– values can be chosen to optimize the translation– especially, the host portion of PRA can be chosen to be identical

to the computer's HWA

• HWA can be computed by a Boolean and (&) operation: HWA = PRA & 0xFF

Page 11: ARP RARP

AR With Message Exchange

• A request HWA corresponding to a PRA• Reply carries the corresponding HWA• Where should an AR request be sent?• Most protocols choose one of two possible designs

– A NW may include one or more servers • contact servers in turns

• broadcasts its request to all servers

– Each computer on the NW participates by agreeing to answer resolution requests for its address:

• broadcasts a request on the NW, all machines examine

• If request matches a computer's address, then responds

• Centralization versus distributed mechanism ?

Page 12: ARP RARP

Address Resolution Protocol

• TCP/IP can use any of the three methods depending on the addressing scheme used by HW– Table lookup to resolve PRA across a WAN– Closed-form computation for configurable NWs – Message exchange on LAN with static/dynamic addressing

• TCP/IP has an Address Resolution Protocol (ARP), which defines two message types: – A request for a HWA correspond to an PRA (namely IP address)– A reply returning the HWA

Page 13: ARP RARP

ARP Message Delivery

• An ARP request message should – Be placed in a HW frame and broadcast to all computers

• All receive the request and examines the IP address– The computer mentioned in the request sends a response; – All others discard the request

• The ARP response is not broadcast– Response is sent directly back to the computer that issued the

request

Page 14: ARP RARP
Page 15: ARP RARP

ARP Message Format

• ARP describes the general form for messages, – and specifies how to determine the details for each type of HW

• To increase the generality of ARP– the designers included an address length field for PRA and HWA

• ARP is not restricted to IP addresses or specific HWA– In practice, these generality of ARP is seldom used:– ARP is almost always used to bind a 32-bit IP address (a PRA)

to a 48-bit Ethernet address (a HWA)

Page 16: ARP RARP
Page 17: ARP RARP

Sending An ARP Message

• When sending an ARP, the message travels inside a HW frame

• The ARP message is treated as data being transported – the NW HW does not know about the ARP message format and

does not examine the contents of individual fields

• Placing a message inside a frame for transport is called encapsulation– an ARP message is encapsulated directly in a HW frame

• Figure 19.7 illustrates the concept

Page 18: ARP RARP
Page 19: ARP RARP

Identifying ARP Frames

• How does a host know whether an incoming frame contains an ARP message?– The type field specifies that the frame contains an ARP msg

• Sender must assign the appropriate value to the type field before transmitting the frame

• Receiver examine the type field in each incoming frame

• Figure 19.8 illustrates the concept

Page 20: ARP RARP
Page 21: ARP RARP

Processing An Incoming ARP Message

• Receiver perform two steps when a message arrives – extracts the sender's address binding– checks to see if the sender's address is present in the cache

• ARP contains a further optimization:– after a reply to an ARP request, adds to its cache for later use

• Most computer communication involves two-way traffic – if a message travels from one computer to another, probability is

high that a reply will travel back

• Because memory constraints– only the target of an ARP request perform caching