140 likes | 263 Views
CSCE 515 : Computer Network Programming. Chin-Tser Huang huangct@cse.sc.edu University of South Carolina. Need for Address Resolution. Need to map from an IP address to a hardware address Frames exchanged at hardware level must be addressed to correct interface
E N D
CSCE 515:Computer Network Programming Chin-Tser Huang huangct@cse.sc.edu University of South Carolina
Need for Address Resolution • Need to map from an IP address to a hardware address • Frames exchanged at hardware level must be addressed to correct interface • Mapping between IP address and hardware address may change • Need to map from a hardware address to an IP address • For systems without a disk (diskless workstations or X terminals)
ARP and RARP • Provide dynamic mapping between IP address and hardware address 32-bit Internet address ARP RARP 48-bit Ethernet address
ARP Request • For computer i to get hardware address of computer j, i broadcasts a rqst message with IP address of j to the subnetwork rqst(ipa.j) i default router Internet switch r j
ARP Reply • If j sees a rqst message from i with its IP address, j sends a rply message with its IP address and hardware address to i rply(ipa.j,hda.j) i default router Internet switch r j
ARP and RARP Packet Format hard size prot size Ethernet destination addr Ethernet source addr frame type hard type prot type op sender Ethernet addr sender IP addr target Ethernet addr target IP addr 6 6 2 2 2 1 1 2 6 4 6 4 Ethernet header 28-byte ARP request/reply
ARP Cache • Maintain recent mappings from Internet addresses to hardware addresses • Make ARP operations efficient • Timeout is 20 minutes for completed entry and 3 minutes for incomplete entry • Timeout for an entry restarted every time it is referenced
Proxy ARP • A router answers ARP request on one of its networks for a host on another of its networks • Sender of ARP request will regard the router as destination host and send IP datagram to the router • Router acting as proxy agent will forward IP datagram to destination
Proxy ARP Example gemini ARP request for 140.252.1.29 Ethernet subnet 140.252.1 140.252.1.183 ARP reply netb Router configured to act as proxy ARP agent for sun modem SLIP modem 140.252.1.29 slip bsdi sun svr4 SLIP .65 .66 .35 .33 .34 Ethernet subnet 140.252.13
Gratuitous ARP • A host sends an ARP request looking for its own IP address • Usually done at bootstrap time • Two features provided by gratuitous ARP • Let a host determine if another host is already configured with same IP address • Let other hosts update their cache entries
arp Command • Available at /usr/sbin • -a option to display all entries in ARP cache • -n option to print IP addresses instead of host names • -d option to delete an entry from ARP cache (superuser only) • -s option to add a permanent entry to ARP cache (superuser only) • Keyword temp • Keyword pub
Ethereal • A free network protocol analyzer for Unix and Windows • Examine data from a live network or from a capture file on disk • Provide a rich display filter language and the ability to view the reconstructed stream of a TCP session • http://www.ethereal.com
Ethereal at Unix Lab • To sniff packets at Unix lab with Ethereal, use the following four machines at SWGN 1D39 • regulus.cse.sc.edu • pollux.cse.sc.edu • nunki.cse.sc.edu • menkar.cse.sc.edu
Next Class • IP • Read TI Ch. 3 • Homework 1 will be passed out