IP Datagram Routing and ProcessingIP Datagram Routing and Processing
• IP Datagram Format• IP Datagram Forwarding and Routing Table • IP Features• Address Resolution Techniques - Table Lookup - Close-form computation - Dynamic Message Exchange• ARP - Address Resolution Protocol • ARP Message Format• Internet History and Standard Administration
• IP Datagram Format• IP Datagram Forwarding and Routing Table • IP Features• Address Resolution Techniques - Table Lookup - Close-form computation - Dynamic Message Exchange• ARP - Address Resolution Protocol • ARP Message Format• Internet History and Standard Administration
Lecture 9
Host, Hop, Router and RoutingHost, Hop, Router and RoutingLecture 9
Lecture 9
Problems in IP Datagram TransferProblems in IP Datagram Transfer
Problems in IP datagram transfer: - What is IP datagram header format? - How to forward IP datagram from one router to another? - How to transfer IP datagram across physical network? - How to process large IP datagram to adapt physical network? - How to find and report errors in IP datagram transfer?
network network network network
router router routerSource hostSender
Destinationhost
Receiver
IP datagram: - Packet used in Internet protocol (IP) - Generated by source, forwarded by routers and received by destination - Created, processed and understood by software
IP D IP D IP D IP D IP D
IP HeaderSource/Dest. Addresses, etc.
IP Data Payload
IP Datagram: 64KByets in maximum
IP DatagramIP DatagramLecture 9
IP Datagram
IP Datagram FormatIP Datagram Format
VERS: 0100 (IPv4), Service Type: priority, reliability,… Total Length: < 216 (with header)H.LEN: header length in 4-bytes, the minimum = 20 bytes when H.LEN=5IDENT, FLAGS, FRAGMENT OFFSET - used with fragmentation Time To Live (TTL): 1~255 integer, number of routers a datagram can passType: upper layer protocol: TCP=6, UDP=17, ICMP=1, IGMP=2, IPv6=41
Lecture 9
Header Data Payload
20 ~ 60 Bytes
Maximum 64K Bytes
1st 32bits/ 4bytes
2nd 32bits/ 4bytes
3rd 32bits/ 4bytes
4th 32bits/ 4bytes
5th 32bits/ 4bytes
6th 32bits/ 4bytes
Lecture 9
IP Datagram Routing Table ConceptIP Datagram Routing Table Concept
Routing Tables for Routers 1-5
Lecture 9
IP Datagram Forwarding and Routing TableIP Datagram Forwarding and Routing Table
IP Datagram Forwarding: - Performed by routers - Similar to WAN forwarding using switching
- Table-driven - Entry specifies next hop - Unlike WAN forwarding - Uses IP addresses - Next-hop is a router or destination - Use default route to keep a routing table small
Lecture 9
IP Datagram Forwarding and Routing TableIP Datagram Forwarding and Routing Table
Process of IP Datagram Forwarding: - Receive a datagram - Extract destination address field, D - Calculate network ID from D using mask M: D & M - Look up ID in routing table - Find next-hop address, N - Send the datagram to NDefault route entry may exist !!Utilities: ipconfig, route, netstat Please try them!!
An Animation of forwarding an IP datagram
Lecture 9
IP FeaturesIP Features
IP is connectionless - Datagram contains identity of destination - Each datagram sent/handled independently
Routers can change at any time
IP allows datagrams to be - Delayed - Lost - Duplicated - Delivered out-of-orderCalled best effort delivery
Motivation: accommodate all possible networks
Sender Receiver
D5D4D3D2D1 D5D5D2D3D1
Internet
Lecture 9
Resolving AddressesResolving Addresses
- IP datagram is sent, forwarded or delivered using IP address across physical network- Physical network does not understand protocol IP address- Consequence: translation from IP address to network hardware/MAC address - to transfer a packet across a physical network - such translation is needed for each physical network e.g., from A to F: 1) A finds R1 addr., 2) R1 finds R2 addr., 3) R2 finds F addr.
- Address Resolution (AR) - Given a network N and IP address IPAddr of computer on N - Find the hardware address HAddr /MAC corresponding to the IPAddr
150.100.12.1150.100.12.5
200.100.16.8
200.100.16.1
R1 Hardware Addr? R2 Hardware Addr?
F Hardware Addr?
Lecture 9
Address Resolution TechniquesAddress Resolution Techniques
- Association between a protocol address and a hardware address is called binding
- Three techniques: Table lookup - Bindings stored in memory with protocol address as key - Data link layer looks up protocol address to find hardware address
Closed-form computation - Protocol address based on hardware address - Data link layer derives hardware address from protocol address Dynamic message exchange - Network messages used for "just-in-time" resolution - Data link layer sends message requesting hardware address - Destination responds with its hardware address
Lecture 9
Table Lookup ResolutionTable Lookup Resolution
- Use a simple list containing IP address and hardware address for each host on net - Search on IP address and extract corresponding hardware address
- Note that all IP addresses have same prefix (netID); can save space by dropping prefix and use suffix (hostID) only.
Lecture 9
Closed-form Computation Closed-form Computation
- If hardware technology uses small, configurable hardware address, network administrator can choose hardware address based on IP address
- Example - hardware uses one octet address that can be configured - Simply choose hardware address to be hostid
- Now, any host can determine hardware address as: hardware_address = ip_address & 0xff
- IPv4 cannot use this approach!
- IPv6 adopts this approach.
Lecture 9
Dynamic Resolution and Comparison Dynamic Resolution and Comparison
- Use ‘network ‘ to resolve IP addresses - Message exchange with other computer(s) returns hardware address to source - Two designs: - Centralized or Server-based - computer sends message to a server to resolve address easier to manage, used on non-broadcast media (e.g., ATM) - Distributed - all computers participate; destination provides hardware address to host requires no dedicated computers, no administration
T: Table Lookup, C: Close-form Computation, D: Dynamic Message Exchange
IP DRC VideoIP DRC Video
Lecture 9
ARP - Address Resolution Protocol ARP - Address Resolution Protocol - Address Resolution Protocol (ARP) - part of IP protocol suite - Two-part protocol - Request from source asking for hardware address - Reply from destination providing hardware address
Step 1:- Make a request ARP message- Broadcast requested IP add.
Step 2:Compare the IP with own
Step 3:- Make a reply ARP message- Y replies its hardware add.
IP add
HW add
ARPARP
Lecture 9
ARP Message FlowARP Message Flow
Source
Destination
IP_Add, Hard_Addr
IP_Add, Hard_Addr
IP Address request messageType=806
Hardware Address reply Type=806
- 48bits (6 bytes) unique address- Broadcast address: all 1s address- Type=800IPv4 D, 806ARP Msg
Ethernet Frame
Type=800
Lecture 9
ARP Example for EthernetARP Example for Ethernet
- ARP request message dropped into hardware frame and broadcast, for Ethernet --------------------------------------------------------------------------------------- | BC-Addr (all 1) | Sender.HAddr |806| Request ARP Message (IPAddr) | ---------------------------------------------------------------------------------------- Uses separate protocol type in hardware frame (Ethernet = 806) - Sender inserts IP address IPAddr into message and broadcast - Every other computer examines the request - Computer with requested IP address responds - Puts hardware address in response - Unicasts to sender, for Ethernet ---------------------------------------------------------------------------------- | Sender.HAddr | Dest.HAddr | 806 | Reply ARP Message (HAddr) | ---------------------------------------------------------------------------------- - Original requester can then extract hardware address & send IP packet to destination -------------------------------------------------------------------------- | Dest.HAddr | Sender.HAddr | 800 | IP Datagram (Packet) | --------------------------------------------------------------------------- Frame type 800 Frame payload is an IP datagram
Lecture 9
ARP Message FormatARP Message Format
- HARDWARE ADDRESS TYPE = 1 for Ethernet - PROTOCOL ADDRESS TYPE = 0x0800 for IP - HARDWARE ADDRESS LENGTH = 6 for Ethernet - PROTOCOL ADDRESS LENGTH = 4 for IPv4 - OPERATION = 1 for request, 2 for response - Contains both target and sender mappings from IP address to hardware address - Request sets hardware address of target to 0 - Target can extract hardware address of sender (saving an ARP request) - Target exchanges sender/target in response
Lecture 9
Sending, Caching and Processing ARP Message Sending, Caching and Processing ARP Message
- Sender constructs ARP message - ARP message carried as data in hardware frame - encapsulation
Using ARP for each IP packet adds two packets of overhead for each IP packet - Computer caches ARP responses in local ARP cache/table - Flushes cache at system startup; and Entries discarded periodically - Cache searched prior to sending ARP request
- Receiver extracts sender's hardware address and updates local ARP table - Receiver checks operation - request or response - Response: - Adds sender's address to local cache - Sends pending IP packet(s) - Request: - If receiver is target, forms response - Unicasts to sender - Adds sender's address to local cache - Note: - Target likely to respond "soon" - Computers have finite storage for ARP cache - Only target adds sender to cache; others only update if target already in cache- arp utility
ARP in Wikipediahttp://en.wikipedia.org/wiki/Address_Resolution_Protocol
How ARP Works - AnimationHow ARP Works - Animation
Lecture 9
Internet HistoryInternet History- Internet concept (originally called ‘catenet’ developed in conjunction with TCP/IP) - (1967) Initially funded through ARPA - Advanced Research Project Agecy in the Department of Defense (DoD) - (1969) Four-node ARPANET established - Univ. of California at Los Angeles (UCLA) - Univ. of California at Santa Barbara (UCSB) - Stanford Research Institute (SRI) - Univ. of Utah - Network Control Protocol - NCP- (1973) Cerf and Kaha proposed NCP, TCP/IP suite development begins - (1977) An internet tested using TCP/IP (ARPANET, packet radio and packet satellite) - (1978) UNIX distributed to academic/research sites - (1981) CSNET established, sponsored by National Science Foundation (NSF) without relation with DARPA - Most CS departments in US universities connected to CSNET by the middle of 1980s - (1983) TCP/IP becomes the official protocol of ARPANET for nonmilitary users - (1983) MILNET was born - (1986) NSFNET established - using T1 - replaced ARPANET in 1990 - went back to a research network in 1995- (1991) ANSNET by IBM, Merit and MCI - Since then rapid progress, wide spread in the world- Current Internet protocol is IPv4, next generation is IPv6 or another (?)
More about Internet history at http://en.wikipedia.org/wiki/Internet
Leonard Kleinrock Vinton Cerf Robert Kahn
Lecture 9
Internet Standard AdministrationInternet Standard Administration
- ISOC (Internet Society): nonprofit organization formed in 1992 to provided support for the Internet standard process - IAB (Internet Architecture Board): technical advisor and the external liaison, 13 voting members
- IRTF (Internet Research Task Force): long-term research, divided by many research groups (RG)
- IETF (Internet Engineering Task Force): forum of working groups for various areas in Internet 1. Applications Area 2. General Area 3. Internet Area 4. Operations and Management Area 5. Routing Area 6. User Services Area 7. Transport Area 8. Security Area
- RFC Editor and IANA (Internet Assigned Numbers Authority): manage and publish RFC (Request for Comment) and IP addresses
IETF Wikipediahttp://en.wikipedia.org/wiki/Internet_Engineering_Task_Force
IETF websitehttp://www.ietf.org/
Exercise 9 Page 1Exercise 9 Page 1
1. Give the main features of IP (Internet Protocol).
2. An IP datagram has arrived with the following information in the header (in hexadecimal): 45 00 00 54 00 03 00 00 20 06 00 00 7C 4E 03 02 B4 0E 0F 02 a. Are there any options? b. What is the size of the data? c. How many more routers can the packet travel to? d. What is the identification number of the packet? e. What is the type of upper layer protocol?
3. Suppose the network of an organization is shown in the following figure. Give a routing table of router R1.
Note: There are five problems in this exercise written in two pages!
150.100.14.0/24150.100.12.0/26
150.100.15.32/27
150.100.13.128/25
R1 R4
R2
R3H1
OutsideInternet
150.100.12.1
150.100.12.5
150.100.14.2
150.100.13.129
150.100.14.3
150.100.14.4
150.100.15.33
150.100.14.1
150.100.0.1
Exercise 9 Page 2Exercise 9 Page 2
4. How many responses does a computer expect to receive when it broadcasts an ARP request? Why? How does a computer (attached an Ethernet) know whether an arriving frame contains an IP datagram or an ARP message?
5. Order the following ARP events correctly. a. Host in procession of IP address sends computer physical address b. Transmission of data to correct host c. IP address is broadcast d. IP address and computer address stored in cache memory