260 likes | 424 Views
TCOM 509 – Internet Protocols (TCP/IP) Lecture 03_a. Instructor: Dr. Li-Chuan Chen Date: 09/15/2003. Based in part upon slides of Prof. J. Kurose (U Mass), Prof. B. Yener (Rensselaer Polytechnic Institute). Outline. Chapter 5 – mapping Internet Addresses to Physical Addresses (ARP)
E N D
TCOM 509 – Internet Protocols (TCP/IP)Lecture 03_a Instructor: Dr. Li-Chuan ChenDate: 09/15/2003 Based in part upon slides of Prof. J. Kurose (U Mass), Prof. B. Yener (Rensselaer Polytechnic Institute)
Outline • Chapter 5 – mapping Internet Addresses to Physical Addresses (ARP) • Chapter 6 • Chapter 7
Address Resolution Problems • Problem: given an IP address, need to find its equivalent physical address • Sender must map the intermediate router’s IP address and destination IP address to their corresponding physical addresses. • Solutions: • Direct Mapping • Table lookup • Dynamic Binding via ARP (Address Resolution Protocol)
Address Resolution Mechanisms • Direct mappingMake the physical addresses equal to the host ID portion. • Mapping is easy. • Only possible if admin has power to choose both IP and physical address or when size of physical address < IP address. • Cannot apply to Ethernet addresses (Ethernet addresses are 48 bits vs. IP addresses which are 32-bits).
Address Resolution Mechanisms • Table LookupSearching or indexing to get MAC addresses • Similar to lookup in /etc/hosts for names • Problem: change Ethernet card => change table IP Address MAC Address 197.15.3.1 0A:4B:00:00:07:08 197.15.3.2 0B:4B:00:00:07:00 197.15.3.3 0A:5B:00:01:01:03
Address Resolution Mechanisms • Dynamic Binding (ARP) • The host broadcasts a request: “What is the MAC address of 216.109.11.67?” • The host whose IP address is 216.109.11.67 replies back: “The MAC address for 216.109.11.67 is 8A-5F-3C-23-45-5616” • Broadcast is expensive. • ARP responses are cached. Issues • Broken hardware: use timer. • Table full: least recently used (LRU) • Each host updates its table when receiving an ARP broadcast.
ARP Message Format 8 16 24 31 0 HW Type Protocol Type • Hardware (HW) Type: 1 for Ethernet • Protocol Type: 080016 = IP address • HW Len and Protocol Len allows arbitrary networks to be used • Operation: 1 = ARP Request, 2 = ARP Response 3 = RARP Request, 4 = RARP Response • ARP messages are sent directly to MAC layer • ARP message is 28 octets long. HW Len Protocol Len Operation Sender HW Address (6 bytes) Sender HWAddress Sender IP Address (4 bytes) Sender IP Address Target HW Address (6 bytes) Target HW Address Target IP Address (4 bytes)
ARP Let Ia = IP address and pa =physical address • To send an internet packet across a physical net, the network software must map Ia to pa and use the pa to transmit the frame. • If Ia < pa, use direct mapping. Else, use ARP to perform dynamic mapping. • Given an IP address, a host uses ARP to find the corresponding hardware address. • To make ARP efficient, all hosts on the network receive the ARP request and update its cache. • The host with the same Ia replies directly to the sender.
Outline • Chapter 4.1 – 4.18 • Chapter 5 • Chapter 6 – Determining An Internet Address At Startup (RARP) • Chapter 7
RARP Problems: Given pa, how do we find Ia ? Solution: Reverse ARP (RARP) • Use the same message format as ARP. • Sender broadcast a RARP request (fills its pa in the target field). • Only RARP server replies. • Typically used in Ethernet LAN. • If only one RARP server available on the network, use larger delay time before retransmit another request. • More RARP servers? • Pros – reliable • Cons – overload the network. (assign primary and secondary server to solve this problem)
RARP • Diskless host needs to find its IP address at startup before it can communicate using TCP/IP. • Give physical address, a host can use RARP to find its IP address from a RARP server on the network.
Outline • Chapter 4.1 – 4.18 • Chapter 5 • Chapter 6 • Chapter 7 – Internet Protocol: Connectionless Datagram Delivery
Application Service Reliable TransportServices Connectionless Packet Delivery Services Internet Services The three conceptual layers of internet services.
0 4 8 16 31 Vers HLen TOS Total Length Identification Flags Fragment Offset Time to live Protocol Header Checksum Source IP Address Destination IP Address IP Options (if any) Padding Data IP Datagram Format
IP Datagram Format • Internet datagram: basic transfer unit • VERS - Version (4 bits): IPv4 • HLEN - Internet header length (4 bits): units of 32-bit words. Min header is 20 bytes or 5 words. • Total Length (16 bits): header + data. Units of bytes. Total must be less than 64 K (216) octets.
IP Header • TOS - Type of service (8 bits) • precedence (3 bits), delay, throughput, and reliability. • Not widely supported.
IP Header • How big can a datagram be? • What happens when a datagram is larger than the frame size of the underlying physical network?
Net 1 MTU = 1500 Net 2 MTU = 620 Net 3 MTU = 1500 R1 R2 A B Maximum Transmission Unit (MTU) • Each subnet has a maximum frame sizeEthernet: 1500 octetsFDDI: 4470 octets per frameToken Ring: 2K to 4K octets • Transmission Unit = IP datagram (data + header) • Each subnet has a maximum IP datagram length (header + payload) = MTU
IP Header Original Datagram IP Hdr 1 Data 1 IP Hdr 2 Data 2 IP Hdr 3 Data 3 Fragmentation • Datagrams larger than MTU are fragmented • Original header is copied to each fragment and then modified (fragment flag, fragment offset, length,...) • Fragments must be a multiple of 8-octets.
Net 1 MTU = 1500 Net 2 MTU = 620 Net 3 MTU = 1500 R1 R2 A B Reassembly • Reassembly only at the final destination • Partial datagrams are discarded after a timeout • Fragments can be further fragmented along the path. Subfragments have a format similar to fragments. • Minimum MTU along a path Path MTU
IP Header • Fragmentation • Identifier (16 bits): used in reassembly to uniquely identify all the pieces of a fragment chain. • Flags (3 bits): more fragments (MF), don’t fragment (DF), and reserved bit. • Fragment offset (13 bits): In units of 8 octets
H3 H1 H2 frag1 frag3 frag2 Net works Min MTU = 620 0 75 150 frag1 frag2 frag3 Fragmentation Example Net 1 MTU = 1500 Net 2 MTU = 620 Net 3 MTU = 1500 R1 R2 A B • Payload size 1400 bytes needs to be transmitted, Packet ID = 2222 • Networks: Ethernet (MTU=1500) and Net2 (MTU=620) • Use smallest MTU size (620) to find payload size for the fragment packet. IP Header = 20 bytes => Payload = MTU – IP Header = 600 bytes • Fragments need to be multiples of 8-bytes. • Nearest multiple to 600 is still 600 bytes • Fragment offset length = 600/8 = 75 • Number of fragments = 1400/600 = 2.33 = 3 • frag1 = 600, frag2 = 600, frag3 = 200, Packet ID = 2222 for all fragments Offset1 = 0, Offset2 = 75, Offset3 = 150MF1 bit = 1, MF2 bit = 1, MF3 bit = 0
IP Header • Time to live (TTL) 8 bits: • Specifies how long the datagram is allowed to live in the network (in seconds). Typically use number of hops visited. • Protocol (8 bits) • Next level protocol to receive the data, e.g., ICMP (1), IGMP (2), TCP (6), UDP (17). • Header checksum (16 bits) • 1’s complement sum of all 16-bit words in the header.
IP Header • Source Address (32 bits): Original source. Does not change along the path • Destination Address (32 bits): Final destination. Does not change along the path. • Options (variable length): security, source route, record route, stream id, timestamp recording • Padding(variable length): Makes header length a multiple of 4 • Payload Data (variable length): Data + header < 65,535 bytes
IP Header Options – for network testing or debugging • Security - for military purpose and is only supported by some products. • Source route – a list of IP address that the datagram must take. • Record route – the nodes in the path must return their IP address. • Stream id - used for voice for reserved resources • Timestamp – the time through the node is returned, so that delays may be measured. If entries in the options must be recorded by nodes, the sender must reserve sufficient space for the option data.
Summary • Internetworking Problem • IP header: supports connectionless delivery, variable length pkts/headers/options, fragmentation/reassembly, • Fragmentation/Reassembly, Path MTU discovery. • ARP, RARP: address mapping • Internet architectural principles