1 / 46

CSS432 Basic Internetworking Textbook Ch3.2

CSS432 Basic Internetworking Textbook Ch3.2. Prof. Athirai Irissappane http://courses.washington.edu/css432/athirai/ athirai@uw.edu. You are here. Internetworking. What is IP IP stands for Internet Protocol Key tool used today to build scalable, heterogeneous internetworks

jamessims
Download Presentation

CSS432 Basic Internetworking Textbook Ch3.2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSS432 Basic InternetworkingTextbook Ch3.2 Prof. Athirai Irissappane http://courses.washington.edu/css432/athirai/ athirai@uw.edu CSS432: Basic Internetworking

  2. Youarehere CSS432: Internetworking

  3. Internetworking • What is IP • IP stands for Internet Protocol • Key tool used today to build scalable, heterogeneous internetworks • It runs on all the nodes in a collection of networks and defines the infrastructure that allows these nodes and networks to function as a single logical internetwork

  4. Network 1 (Ethernet) H7 R3 H8 H1 H8 H2 H1 H3 TCP TCP Network 4 R1 R2 R3 (point-to-point) Network 2 (Ethernet) R1 IP IP IP IP IP R2 FDDI PPP ETH ETH ETH FDDI PPP ETH H4 Network 3 (FDDI) H5 H6 IP Internet • Interconnected Collection of Networks • Viewed as a simple logical network • Routers: nodes interconnecting networks • Protocol Stack • IP on all nodes (both hosts and router) • TCP and UDP on top of IP Identical packet Identical datagram Identical datagram Identical frame Identical frame CSS432: Basic Internetworking

  5. IP Service Model • Packet Delivery Model • Connectionless model for data delivery • Best-effort delivery (unreliable service) • packets are lost • packets are delivered out of order • duplicate copies of a packet are delivered • packets can be delayed for a long time • Global Addressing Scheme • Provides a way to identify all hosts in the network

  6. Packet Format • Version (4): currently 4 • Hlen (4): number of 32-bit words in header, length of header • TOS (8): type of service (not widely used) • Length (16): number of bytes in this datagram (header + data) • Ident (16): used by fragmentation • Flags/Offset (16): used by fragmentation • TTL (8): number of hops this datagram has traveled • Protocol (8): demux key (TCP=6, UDP=17) • Checksum (16): of the header only • DestAddr & SrcAddr (32 bits)(4 bytes)

  7. 0 4 8 16 19 31 TOS Length V ersion HLen Ident Flags Offset TTL Protocol Checksum SourceAddr DestinationAddr Pad Options (variable) (variable) Data Service Model • Sent from IP to lower layers • Lower layers attach their own headers • IP packet (32 bit/4 byte boundary) (Each row/word 32 bit, i.e., 0-31) • Header length mostly 5 rows= 5 * 4byte = 20 bytes; (options are not set most time) • Max size of IP datagram packet = 2^16 = 65535 • Length is 16 bit field frame type Ex. Ethernet preamble dest addr src addr 0x0800 CRC CSS432: Basic Internetworking

  8. IP Fragmentation and Reassembly • Each network has some MTU (Maximum Transmission Unit) • Largest IP datagram it can carry in its frame • Max size of payload of the network • Ethernet (1500 bytes), FDDI (4500 bytes), • IP datagram < MTU of link layer • IP header + IP data < MTU of link layer • Strategy • Fragmentation occurs in a router when it receives a datagram that it wants to forward over a network which has (MTU < datagram) • Reassembly is done at the receiving host • All fragments carry same identifier in the Ident field (determined by sender) • Fragments are self-contained datagrams • IP does not recover from missing fragments

  9. IP Fragmentation and Reassembly - E.g., Transmit 1400 bytes IP datagrams traversing the sequence of physical networks Ethernet MTU (1500), PPP MTU in this case 532 bytes 376

  10. IP Fragmentation and Reassembly Header fields used in IP fragmentation. (a) Unfragmented packet; (b) fragmented packets. Seq number of 8-byte chunks

  11. IP Fragmentation and Reassembly • every fragment except the last must contain a multiple of 8 bytes of data • Transmit x bytes of data, if x is > MTU 1400 > 532 • If 20 bytes of IP header • 1st fragment • Data size1 = Min (multiple of 8 closest to MTU-20, x) 512 = Min(512,1400) • Offset1 = 0 • Ident =x (identifier for chunks of the same packet) • M Flag = 1 (more fragments follow) • 2nd fragment • Data size2 = Min (multiple of 8 closest to MTU-20, x-data size1) 512 = Min(512,1400 - 512) • Offset2 = data size1 / 8 64 = 512/8 • Ident =x (identifier for chunks of the same packet) • M Flag = 1 (more fragments follow) • 3rd fragment • Data size3 = Min (multiple of 8 closest to MTU-20, x-data size1-data size2) 376 = Min(512,1400 – 512 - 512) • Offset2 = (data size1 + data size 2) / 8 128 = (512+512)/8 • Ident =x (identifier for chunks of the same packet) • M Flag =0 (more fragments follow)

  12. Fragmentation and Reassembly • Each network has some MTU (maximum transmission unit) • To check each interface of your computer: • netstat –i • ifconfig • Strategy • fragment when necessary (MTU < Datagram) • try to avoid fragmentation at source host • re-fragmentation is possible • fragments are self-contained datagrams • delay reassembly until destination host • do not recover from lost fragments CSS432: Basic Internetworking

  13. 7 24 A: 0 Network Host 14 16 B: 1 0 Network Host 21 8 C: 1 1 0 Network Host Global Addresses • IP address • globally unique, 32 bits, 4 bytes long • hierarchical: network part + host part • 4 Billion IP address, half are A type, ¼ is B type, and 1/8 is C type

  14. 7 24 A: 0 Network Host 14 16 B: 1 0 Network Host 21 8 C: 1 1 0 Network Host Global Addresses • IP address • Class • Identified using first few bits as shown in fig • Class A (previously reserved for small number of WAN) • 7 bits for network, 24 bits for host • 2^7 – 2 different networks (1st bit is 0, 127… is reserved for loopback IP address) • Each network 2^24 -2 hosts (all zeros in host bits represent network ID, all 1s broadcast Id) (2^24 – 2 = 16,777,214) • Class B (previously reserved for medium sized campus networks) • 14 bits for network, 16 bits for host • 2^14 networks • Each network 2^16 -2 hosts (65536-2 = 65534) • Class C (previously reserved for large number of LANs) • 21 bits for network, 8 bits for host (2^8 -2) = (256-2=254) • But convention not followed anymore – Classless addresses are used now

  15. 7 24 A: 0 Network Host 14 16 B: 1 0 Network Host 21 8 C: 1 1 0 Network Host Global Addresses • Dot Notation • Class A • 1.0.0.1 – 126.255.255.254 • (0.0.0.0 – 0.255.255.255, 1.0.0.0, 126.255.255.255, and 127.0.0.0 – 127.255.255.255 reserved) • Class B • 128.0.0.1 – 191.255.255.254 • Class C • 192.0.0.1 – 223.255.255.254 CSS432: Basic Internetworking

  16. IP Datagram Forwarding • How routers forward IP datagrams in internetwork • every datagram contains destination's address • if directly connected to destination network, i.e., in the same network, then forward to host using its own interface • Check if the network portion of destination address is the same as the network portion of the sender’s address • if not directly connected to destination network, then forward to some router • Every node will have a choice of several routers (they can maintain a forwarding table) • Choose the best one/reasonable one capable of delivering datagram atleast close to the destination • Default router can also be used for a particular router • forwarding table of router maps network number into next hop, i.e., what is the next hop for a particular destination • If network number not present in forwarding table then use default router • Routers can have multiple interfaces (hosts mostly have 1 interface) • Include entry for networks directly connected to the interfaces

  17. IP Datagram Forwarding R1 R2 R3 • Example H8 Network 1 H1 Network 2 i/f 0 R3 i/f 1 i/f 1 R1 Network 4 i/f 0 i/f 0 R2 i/f 1 Network 3

  18. IP Datagram Forwarding • Algorithm if (NetworkNum of destination = NetworkNum of one of my interfaces) then deliver packet to destination over that interface else if (NetworkNum of destination is in my forwarding table) then deliver packet to NextHop router else deliver packet to default router For a host with only one interface and only a default router in its forwarding table, this simplifies to if (NetworkNum of destination = my NetworkNum)then deliver packet to destination directly else deliver packet to default router

  19. 172.16.5.0/24 172.16.3.0/24 Eth2: 172.16.5.1 Eth1: 172.16.3.1 Router 2 Eth0: 172.16.3.2 Router 3 Eth0: 172.16.1.2 Eth1: 172.16.4.1 172.16.2.0/24 172.16.4.0/24 Eth1: 172.16.2.1 Router 1 Eht0: 172.16.1.1 172.16.1.0/24 Static Configuration for Cisco Routers hostname router1 ! interface ethernet 0 ip address 172.16.1.1 255.255.255.0 ! interface ethernet 1 ip address 172.16.2.1 255.255.255.0 ! ip route 172.16.3.0 255.255.255.0 172.16.1.2 ip route 172.16.4.0 255.255.255.0 172.16.1.2 ip route 172.16.5.0 255.255.255.0 172.16.1.2 CSS432: Basic Internetworking

  20. hostname router1 ! interface ethernet 0 ip address 172.16.1.1 255.255.255.0 // set ip address of Ethernet 0 with subnet mask ! interface ethernet 1 ip address 172.16.2.1 255.255.255.0 // set ip address of Ethernet 1 with subnet mask ! ip route 172.16.3.0 255.255.255.0 172.16.1.2 // for destination network ip 172.16.3.0 with subnet mask set the next hop ip route 172.16.4.0 255.255.255.0 172.16.1.2 ip route 172.16.5.0 255.255.255.0 172.16.1.2 CSS432: Basic Internetworking

  21. Address Translation Protocol (ARP) • When host find that network portion of address matches with the destination, it can send packets though its own interface • Needs to know the physical address of the destination host/ next hop router • Send them through Ethernet/wifi (direct connection) • Map IP addresses into physical addresses • Physical address destination host • Physical address of next hop router • Techniques • encode physical address in host part of IP address • Maintain table-based

  22. Address Translation • Map IP addresses into physical addresses • destination host • next hop router • Techniques • encode physical address in host part of IP address • Pha = f( IPa) or IPa =f-1(Pha) • Pha: 0010 0001 0100 1001 => 128.96.33.81 • 0010 0001 = 33 • 0100 1001 =81 • Class B address: 16 bits for host part • Problems • Class C has only 8 bits to indicate a host • Ethernet has 48 bits to present a host address CSS432: Basic Internetworking

  23. Address Translation Protocol (ARP) • ARP (Address Resolution Protocol) • Resolution through dynamic binding • table of IP address to physical address bindings at each host • broadcast request if IP address not in table • target machine responds with its physical address • table entries are discarded (after particular time) • Physical address address can change because of a broken NIC • Dynamic Ip addressing • Table entries are refreshed when updated, i.e., their expiry time is extended

  24. ARP Details Reuqest I’m IPa and Pha. You’re IPb. How about Ph? • table entries timeout in about 15 minutes • Update table with source when you are the target, otherwise no need to add an entry • update table if already have an entry • A broadcasts ARP request about IP address of B • The request contains IP address and Mac address of A • B receives the request makes an entry for A in its ARP table and sends back its physical address • Refreshes entry for A if already present • Other nodes may/may not include an entry for A in their table A X B Y Response I’m IPb and Phb. You’re IPa and Pha A X B Y CSS432: Basic Internetworking

  25. 0 8 16 31 Hardware type = 1 ProtocolT ype = 0x0800 HLen = 48 PLen = 32 Operation SourceHardwareAddr (bytes 0 – 3) SourceHardwareAddr (bytes 4 – 5) SourceProtocolAddr (bytes 0 – 1) SourceProtocolAddr (bytes 2 – 3) T argetHardwareAddr (bytes 0 – 1) T argetHardwareAddr (bytes 2 – 5) T argetProtocolAddr (bytes 0 – 3) ARP Packet Format • An ARP packet is carried in a frame header • HardwareType: type of physical network (e.g., Ethernet) • ProtocolType: type of higher layer protocol (e.g., IP) requesting this • HLEN & PLEN: length of physical and protocol addresses • Operation: request or response • Source/Target-Physical/Protocol addresses frame type Ex. Ethernet preamble dest addr src addr 0x0806 CRC CSS432: Basic Internetworking

  26. RARP: Reverse Address Resolution Protocol • ARP assumes each host know their IP & MAC • Clients like diskless workstation do not know IP address • IP address necessary for communication at IP layer • RARP Servers maintain mappings from MAC to IP • Broadcast RARP request • Works in the same LAN • Retransmit an RARP message after a large delay if it has been lost. • Prepare a primary and secondary server. Request I’m Pha. What’s my IPa? A X B Y RARP server Response You’re IPa and Pha A X B Y RARP server CSS432: Basic Internetworking

  27. RARP Disadvantage • Using a computer’s MAC address which does not allow mobile computers to move to another network • Operating at data-link level which requires direct access to the network hardware • Not working beyond routers, because routers are IP-based but RAPS are not IP. • RARP request include only MAC address so cannot be deliver to server not in the same network CSS432: Basic Internetworking

  28. Host Configurations • Notes • Ethernet addresses are configured into network by manufacturer and they are unique • IP addresses must be unique on a given internetwork but also must reflect the structure of the internetwork • Most host Operating Systems provide a way to manually configure the IP information for the host • Drawbacks of manual configuration • A lot of work to configure all the hosts in a large network • Configuration process is error-prune • Automated Configuration Process is required

  29. Dynamic Host Configuration Protocol (DHCP) • DHCP server is responsible for providing configuration information to hosts • There is at least one DHCP server for an administrative domain • Admin can assign IP-MAC mapping and store it in DCHP • When host boot or join network they can contact DCHP server for IP • Still lot of work for admin

  30. Dynamic Host Configuration Protocol (DHCP) • DHCP server maintains a pool of available addresses • Admin assigns range of IP address to the DCHP server • DCHP assigns IP address to host on demand • IP address cannot be changed frequently • Host crash, system failure • Unused IP address must be returned back • Lease IP address for certain period, renew it

  31. Where to find DHCP server? • 1 DHCP server per network hard to maintain • 1 Relay agent per network • Relays incoming query message to DCHP server • Newly booted or attached host sends DHCPDISCOVER message, to a special IP address 255.255.255.255, which is the broadcast address • DHCP relay agent unicasts the message to DHCP server and waits for the response • Relay agent sends back the information to client • UDP protocol for message transfer

  32. OP Htype HLEN HOPS Xid Frame addr datagram UDP header BOOTP/DHCP Secs Flags Client IP addr Your IP addr Server IP addr Router IP aaddr Client Hardware addr Server host name Boot file name Options DHCP • DHCP server: • Works as a centralized repository for IPs • Pools available IP addresses • Hands out one to a client on demand • Accessible by sending a DHCPDISCOVER message to an IP broadcast address • Receives a DHCPDISCOVER from a Relay agent connected to a different network • Advantages: • Works at a user level • Automatic IP configuration • Save IP addresses • Works across networks. • Frame Format • Your IP  IP address filled by DCHP, Client Hardware address filled by client • Options: filled with default router information for the client CSS432: Basic Internetworking

  33. DHCP Client State Transition INITIALIZE Host boots / DHCPDISCOVER to all servers SELECT DHCPNACK DHCPNACK Or Lease expires Receive DHCPOFFER from all servers Lease reaches 87.5% expiration – T2 / DHCPREQUEST to any server REBIND RENEW Select offer / DHCPREQUEST to a specific server DHCPACK REQUEST DHCPACK Lease reaches 50% expiration – T1 / DHCPREQUEST to the current server Receive DHCPACK from the current server BOUND Fig. 23.4 on p453 of Internetworking with TCP/IP CSS432: Basic Internetworking

  34. DHCP Client State Transition Diaram • INITIALIZE – Process of acquiring lease. Client Sends DHCPDISCOVER: The client creates a DHCPDISCOVER message and broadcasts it to try to find a DHCP server. • SELECT - The client is waiting to receive DHCPOFFER messages from one or more DHCP servers • REQUEST - The client is waiting to hear back from the server to which it sent its request. client receives a DHCPACK message from its chosen server which contains IP address, checks it is not already used. Sets lease timers T1, T2

  35. DHCP Client State Transition Diagram • BIND - Client has a valid lease and is in its normal operating state. • Renewal Timer (T1) Expires: The client transitions to the RENEW state. • Client Terminates Lease, Sends DHCPRELEASE, returns to the INITIALIZE state. • RENEW trying to renew its lease. It regularly sends DHCPREQUEST messages with the server that gave it its current lease specified, and waits for a reply. • Client Receives DHCPACK: The client receives a DHCPACK reply to its DHCPREQUEST. Its lease is renewed, it restarts the T1 and T2 timers, and returns to the BOUND state. • Client Receives DHCPNAK: The server has refused to renew the client's lease. The client goes to the INIT state to get a new lease • Rebinding Timer (T2) Expires: While attempting to renew its lease, the T2 timer expires, indicating that the renewal period has ended. The client transitions to the REBIND state

  36. REBIND: client has failed to renew its lease seeks a lease extension with any server that can hear it. It periodically sends DHCPREQUEST messages with no server specified until it gets a reply or the lease ends. • Client Receives DHCPACK: Some server on the network has renewed the client's lease.  • Client Receives DHCPNAK: A server on the network is specifically telling the client it needs to restart the leasing process. – INIT state • Lease Expires: The client receives no reply prior to the expiration of the lease. It goes back to the INITIALIZE state.

  37. Internet Control Message Protocol (ICMP) • Defines a collection of error messages that are sent back to the source host whenever a router or host is unable to process an IP datagram successfully • Destination host unreachable due to link /node failure • Reassembly process failed • TTL had reached 0 (so datagrams don't cycle forever) • IP header checksum failed • ICMP-Redirect Message • From router to a source host if it finds that there exists a better route for the packet sent to the current router from the source • With a better route information • PING and TRACEROUTE use ICMP • PING uses ICMP echo messages to determine if a node is reachable and alive

  38. Internet Control Message Protocol http://www.borella.net/content/MITP432/ICMP/img4.html CSS432: Internetworking

  39. Internet Control Message Protocol (ICMP) An error reporting message (ICMP) Error occurred Src R1 R2 R3 RK Rcv Is Src responsible for this ICMP message? RE Mistakenly routed ICMP type 0-18 ICMP ICMP header ICMP data IP datagram heaader Data Link frame header CSS432: Internetworking

  40. ICMP Message Header http://nmap.org/book/tcpip-ref.html CSS432: Internetworking

  41. ICMP Message Types CSS432: Basic Internetworking

  42. Ping • Uses Echo Request Reply: checking if they are capable of sending datagrams to each other • Device A begins the test process by sending an ICMPv4 Echo message to B. Device B, when it receives the Echo, responds back to Device A with an Echo Reply message.  CSS432: Basic Internetworking

  43. Reviews • IP Internet: Protocol stack, fragmentation/reassembly, IP address, and datagram forwarding • Address translation: ARP, RAPR, and DHCP • ICMP • Exercises in Chapter 3 • Ex. 36 (fragmentation) • Ex. 44 (ARP) • Ex. 45 (ARP) CSS432: Basic Internetworking

  44. More Exercises (not from Our Textbook) • Q1. (DHCP) • Consider a host that has a disk and uses DHCP to obtain an IP address. If the host stores its address on disk along with the data the lease expires, and then reboots within the lease period, can it use the same address Assume that the client’s boot/reboot always starts from “INITIALIZE”? Why or why not? • Q2. (DHCP) • DHCP mandates a minimum address lease of one hour. Can you imagine a situation in which DHCP’s minimum lease causes inconvenience? Explain. CSS432: Basic Internetworking

  45. Supplementary slides CSS432: Basic Internetworking

  46. Two-Step bootstrap Procedure BOOTP server Step 1A: BOOTP request: BOOT FILE NAME=I want to boot “unix” Diskless Workstation Step 1B: BOOTP reply: Server = mercury, BOOT FILE NAME=“/local/var/bootfiles/xncd19r” Step 2A: TFTP request: request for the image File server Step 2B: TFTP reply: image returned OS Image: Unix Windows CSS432: Basic Internetworking

More Related