* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Chapter 5
Survey
Document related concepts
Transcript
Mapping IP Addresses to Hardware Addresses Chapter 5 Introduction • Two machines on a physical network can communicate only if they know each other’s hardware address • Network connections are given IP addresses • How does a host or a router map an IP address to a hardware address so that a packet can be sent across a network? Address Resolution • Generally, machine A (or a user on machine A) knows the IP address of machine, but not the hardware address • The hardware addresses must be found for: – the destination machine – any intermediate routers along the path • Mapping high-level (IP) addresses to hardware addresses is called address resolution Address Resolution • How can address resolution be done? – – – – keep lookup tables in each machine encode hardware addresses in high-level addresses direct mapping dynamic binding Direct Mapping • Recall proNet which had an interface board with 8 switches that could be set to values (addresses) from 0 to 255 – 0 was not used – 255 was for broadcasting • Network administrators could assign their own hardware addresses and have them correspond to the last decimal digit in the IP address – 129.7.61.15 corresponds to the machine with hardware address of 15 Direct Mapping • Choosing a numbering scheme means selecting a function f that maps IP addresses to hardware addresses • On connection-oriented networks such as ATM, one or more computers (servers) store pairs of addresses as a table in memory for quick searching • Software can use a hashing function to search the table Dynamic Binding • TCP/IP’s approach is to use the Address Resolution Protocol (ARP) – When A wants to communicate with B in the same network, A broadcasts a packet that asks the host with IP address IB to respond with its hardware address PB – All hosts , including B hear the request, but only B replies with its hardware address – When A receives the reply, it plugs the hardware address in and sends the packet to B • Why not just broadcast the message? ARP Cache • Recently acquired IP to hardware address bindings are stored in a cache on each computer. Why? • Thus, when two computers on a network communicate: – ARP request – ARP reply – repeated transfer of packets • The term soft state describes the situation in which information becomes incorrect, or not helpful – information is deleted after a time ARP Cache • Advantages – ? • Disadvantages – Delay of knowing that a machine is not responding ARP Refinements • If A requests a hardware address for B, B will likely need a hardware address for A – Have A send its hardware address to B – Put A’s information in the cache as well • All computers on the network can update their caches when they see the mappings on the line • A newly added computer can do an ARP broadcast when it boots, to notify others ARP Implementation • Two functions – Mapping an IP @ to a hardware @ – Answering requests from other machines • Steps: – Upon reception of request, check cache – If in cache, place data in a frame and send the frame – If not in cache, broadcast ARP request, wait for reply ARP Implementation Problems • The target machine could be down, or too busy to respond. What happens? • A binding has been made for a machine, but then it goes down. This is why cache is short-lived. • Delays • See bottom of p. 83: “the ARP software removes packets from the queue, places each packet in a frame, and …” ARP Encapsulation • When ARP messages are sent from one machine to another, they are sent in frames • What are frames? See Figure 2.7-Frame type 0806 ARP message frame header frame data area ARP Protocol Format • See ARP message format in Figure 5.3 • This shows the 28-octet format used on Ethernet hardware (48 bits) when resolving IP addresses (32 bits) – – – – Hardware type: 1 for Ethernet Protocol type: 080016 for IP addresses ... Sender Hardware Address (6 octets), IP (4 octets) Target Hardware Address (6 octets), IP (4 octets) • The length of fields depends on the hardware and protocol address lengths Summary • IP addresses are assigned independent of hardware addresses • To send a packet, a computer must know the other’s hardware address • ARP broadcasts a message asking for the computer with a given IP address to respond with its hardware address For Next Time • Read Chapter 6