190 likes | 347 Vues
This article explores the intricacies of Internet Protocol (IP) addressing and how datagrams are delivered within networks. It explains the concept of addressing an interface rather than a host, and how multiple interfaces can lead to multiple IP addresses. The mechanism of direct and indirect delivery of datagrams is discussed alongside the Address Resolution Protocol (ARP) that maps IP addresses to physical MAC addresses. We also touch on related mechanisms like Proxy ARP, Reverse ARP, and the tools necessary for packet capturing and analysis within the TCP/IP stack.
E N D
IP Addresses • Universal address regardless of layer 2 architecture • Each address is that of an interface, not necessarily a host • A host may have more than one interface and therefore more than one IP address • IP address affects the path selected to deliver data to a host
I1 I3 I4 R A B I2 I5 Path Based on Address Host A sends data to host B at address I4 Host A sends data to host B at address I5
I1 Host I2 I4 Router I3 I5 I7 I8 Bridge
Datagram Delivery • In the Internet Protocol, the basic unit of data is called a datagram • Each datagram is individually addressed • Decide if destination is on a network to which device (host/router) is attached • If on the same network, deliver datagram directly (direct delivery) • If on other than a directly attached network, send datagram to a predefined router for delivery (indirect delivery)
Datagram Delivery • Given a destination IP address, a datagram eventually needs direct delivery • But datagram must be encapsulated into the layer 2 architecture for delivery (frame) • How to find the layer 2 (MAC) address that is associated with the destination IP address? • Could build a table • Could develop a protocol
Ethernet IB IC IA A B C PA PB PC Address Resolution Protocol(ARP) • At higher level protocol we wish to use addresses IA, IB, IC • At final delivery we need to use PA, PB, PC • We must therefore map IXPX
O Ethernet IB IC IA A B C PA PB PC F • Station O needs to send a datagram to address IX • Station O sends a special frame to broadcast address • Frame contains address IX • Station IX is expected to respond with its Physical address • Station O retains this mapping in its memory (cache) • Station O also includes its own IP and Physical addresses in the frame
Address Resolution Protocol • This is sort of a call for ‘Who on this network has addressIX’ • Response from target station contains its Physical address • Actual protocol is defined in RFC 826 • Frame format also defined • This is a general protocol, not unique to IP
11111..111 Source T Type = 0806 ARP Frame CRC
1111….111 Source T Type = 0806 ARP Frame CRC
ARP Frame Hardware type: 1 for Ethernet Protocol type:0800 for Internet Protocol Hardware length:6 for Ethernet Protocol length:4 for IP Operation:1 for ARP Request, 2 for Reply Sender hardware address Sender protocol address Target hardware address:0s on a request Target protocol address
ARP – The Protocol • A broadcast is received • Check the frame type – 0806 = ARP • Check Type and address of sender (Is) Update cache • Check Operation – Is it a Request • Check Target address (It) – Is it me? • Swaps Hardware and Protocol address • Inserts own Hardware address • Set Operation to Reply (2) • Sends response (unicast)
Gratuitous ARP • Station send ARP request for its own IP address • Let other stations know its mapping and any changes in hardware address • Checks to see if any other station has this same IP address
Proxy ARP • Sometimes it is desirable for one device (router) to respond on behalf of other hosts • Often used to respond for devices on the other end of a serial line connected to the router • If a station can respond for another, is this a security concern?
Reverse ARP • Extension of ARP protocol to allow a station to obtain its IP address given its hardware addressed • Originally used with diskless stations • This function has been replaced with more modern protocols • BOOTP • DHCP
Tools - Utilities Packet Capture – Analyzer http://www.ethereal.com Ethereal capture/analyzer Windows version Unix version Ethereal_XTRA on course Web site http://www.netgroup.polito.it/ WinPcap – required for ethereal Analyzer – another capture utility Windump