Chap1 - HUFS
Download
Report
Transcript Chap1 - HUFS
TCP/IP Illustrated Vol 1
ARP & RARP
2005. 3. 16(화)
이병희
[email protected]
Introduction
When an Ethernet frame is sent from one host on the
LAN to another
The device driver never looks at the destination address in
the IP datagram
Address resolution need to map IP address to MAC address
ARP (Address Resolution Protocol) provides a mapping
between the two different forms of address
32-bit Internet address
ARP
RARP
42-bit Ethernet address
Example ARP with FTP
%ftp Hostname
Hostname
DNS Cache
FTP
resolver
establish connection
with IP address
IP address
TCP
send IP datagram
to IP address
IP
ARP Cache
ARP
Ethernet Driver
Ethernet Driver
Ethernet Driver
ARP Request (Ethernet broadcast)
ARP
ARP Reply
ARP
IP
TCP
ARP Packet Format
Ethernet
Dest addr
Ethernet
Src addr
frame
type
6
6
2
ARP Packet
Ethernet header
28 byte ARP request/reply
hard
type
prot
type
hard
size
prot
size
op
sender
Ethernet addr
sender
IP addr
target
Ethernet addr
target
IP addr
2
2
1
1
2
6
4
6
4
• frame type is 0x806 for an ARP request or an ARP reply
• op field – 1 : ARP request
2 : ARP reply
3 : RARP request
4 : RARP reply
ARP Request and Reply
bsdi % telnet svr4 discard
bsdi % tcpdump –e
Trying 140.252.13.34…
1 0.0
Connected to svr4.
0:0:c0:6f:2d:40 ff:ff:ff:ff:ff:ff arp 60:
arp who-has svr4 tell bsdi
Escape character is ‘^]’.
2 0.002174 (0.0022) 0:0:c0:c2:9b:26 0:0:c0:6f:2d:40 arp 60:
arp reply svr4 is-at 0:0:c0:c2:9b:26
^]
3 0.002831 (0.007)
telnet> quit
Connection closed
0:0:c0:6f:2d:40 0:0:c0:c2:9b:26 ip 60:
bsdi.1030 > svr4.discard: s 596459521:596459521 (0)
win 4096 <mss 1024> [tos 0x10]
4 0.007834 (0.0050) 0:0:c0:c2:9b:26 0:0:c0:6f:2d:40 ip 60:
svr4.discard > bsdi.1030: s 3562228255 : 3562228225 (0)
ack 596459522 win 4096 <mss 1024>
5 0.009615 (0.0018) 0:0:c0:6f:2d:40 0:0:c0:c2:9b:26 ip 60:
bsdi.1030 > svr4.discard: . ack 1 win 4096 [tos 0x10]
Proxy ARP
Router answer ARP request on one of its
network for a host on another of its network
gemini % arp –a
netb (140.252.1.183) at 0:80:ad:3:6a:80
sun (140.252.1.29) at 0:80:ad:3:6a:80
gemini
ARP request for 140.252.1.29
Ethernet,subnet 140.252.1
140.252.1.183
ARP reply
netb
Act as proxy ARP agent
modem
SLIP
(dialup)
modem
140.252.1.29
slip
SLIP
.65
.66
bsdi
.35
sun
.33
svr4
.34
Ethernet 140.252.13
Gratuitous ARP
When a host looking for its own IP address
It is usually done when the interface is configured at
bootstrap time
0.0
0:0:c0:6f:2d:40 ff:ff:ff:ff:ff:ff: arp 60:
arp who-has 140.252.12.35 tell 140.252.13.35
If another host is already configured with the
same IP address
Not expecting a reply to ARP request
If a reply is received, the error message is logged on
the console
RARP
Principle of RARP
Get IP address in diskless system by using
RARP request and reply
RARP Packet Format
Almost identical to an ARP packet
Frame type field : 0x8035
Op type : “3” for request and “4” for reply
sun
bsdi
host
host
RARP Server
host
RARP request (Ethernet Broadcast)
RARP reply
RARP Examples
RARP Request and Reply
Bsdi % tcpdump –e
1
0.0
8:0:20:3:f6:42 ff:ff:ff:ff:ff:ff arp 60:
rarp who-is 8:0:20:3:f6:42 tell 8:0:20:3:f6:42
2
0.13 (0.13)
0:0:c0:6f:2d:40 8:0:20:3:f6:42 rarp 42:
rarp reply 8:0:20:3:f6:42 at sun
3
0.14 (0.01)
8:0:20:3:f6:42 0:0:c0:6f:2d:40 ip 65:
sun.26999 > bsdi.tftp: 23 RRQ “8CFC0D21.SUN4C”
If there is no RARP server on the network, the
request retransmitted with different timeout
interval