03_ip

30
CSS432: Basic Internetworking 1 CSS432 Basic Internetworking Textbook Ch 3.2 Instructor: Joe McCarthy (based on Prof. Fukuda’s slides)

Upload: terra212

Post on 16-Dec-2015

219 views

Category:

Documents


0 download

DESCRIPTION

ppt presentaion styles

TRANSCRIPT

  • CSS432: Basic Internetworking*CSS432 Basic InternetworkingTextbook Ch 3.2 Instructor: Joe McCarthy (based on Prof. Fukudas slides)

    CSS432: Basic Internetworking

  • CSS432: Internetworking*You are here

    CSS432: Internetworking

  • CSS432: Basic Internetworking*IP: Internet ProtocolInterconnected Collection of NetworksBridged networks (link layer): homogenousIP networks (network layer): heterogeneousViewed as a single logical networkRouters: nodes interconnecting networksProtocol StackIP on all nodes (both hosts and router)TCP and UDP on top of IP

    Identical frameIdentical frameIdenticaldatagramIdenticaldatagramIdentical packet

    CSS432: Basic Internetworking

  • CSS432: Basic Internetworking*Service ModelGlobal addressingIP address (e.g., 128.95.155.134)Best-effort delivery (unreliable service)Connectionless (datagram-based)Packets may be lost, reordered, duplicated, delayedLowest common denominator: run over anythingSimplifies routing (& routers) IP Packet format:

    Version: IPv4/IPv6HLen: header length in 32-bit wordsMinimum / maximum header length?TOS: type of service (priority queue in routers)Length: packet length in bytesMinimum / maximum packet size?TTL: time to live (# hops); default: 64Protocol: TCP, UDPChecksum (header, 1s complement)SourceAddr: source IP addressDestinationAddr: destination IP addressOptions: optional & variable

    preambledest addrsrc addr0x0800CRCframe typeEx. Ethernethttp://bpastudio.csudh.edu/fac/lpress/471/hout/netech/stackinaction.htm

    CSS432: Basic Internetworking

  • CSS432: Basic Internetworking*Fragmentation & ReassemblyEach network has some MTU (Maximum Transmission Unit)To check each interface of your computer (Linux/Mac OS X):netstat i[/sbin/]ifconfigStrategyFragment / split when necessary (MTU < Datagram size)try to avoid fragmentation at source hostRe-fragmentation is possible Each fragment is a self-contained datagramWhere should reassembly occur?What about lost fragments?

    CSS432: Basic Internetworking

  • CSS432: Basic Internetworking*Fragmentation & ReassemblyEach physical network has its MTU (Maximum Transmission Unit)To check each interface of your computer (Linux/Mac OS X):netstat i[/sbin/]ifconfigStrategyFragment / split when necessary (MTU < Datagram size)try to avoid fragmentation at source hostRe-fragmentation is possible Each fragment is a self-contained datagramReassemble at destinationLost fragment(s) discard packet

    CSS432: Basic Internetworking

  • CSS432: Basic Internetworking*Fragmentation Example MTUs: 802.11: Ethernet: PPP: 532 bytesSend a 1400 byte segment from H5 to H8

    CSS432: Basic Internetworking

  • CSS432: Basic Internetworking*Fragmentation Example Send a 1400 byte segment from H5 to H8MTUs: 802.11: 1500 bytes Ethernet: 1500 bytes PPP: 532 bytes

    CSS432: Basic Internetworking

  • CSS432: Basic Internetworking*Fragmentation Example (a)(b)MTUs: 802.11: 1500 bytes Ethernet: 1500 bytes PPP: 532 bytesSend a 1400 byte segment from H5 to H8376376

    CSS432: Basic Internetworking

  • CSS432: Basic Internetworking*Fragmentation Example (a)(b)MTUs: 802.11: 1500 bytes Ethernet: 1500 bytes PPP: 532 bytesSend a 1400 byte segment from H5 to H8376376

    CSS432: Basic Internetworking

  • CSS432: Basic Internetworking*Global AddressesPropertiesglobally uniquehierarchical: network + host

    Dotted Decimal NotationClass A1.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 B128.0.0.1 191.255.255.254Class C192.0.0.1 223.255.255.254

    CSS432: Basic Internetworking

  • CSS432: Basic Internetworking*Datagram Forwarding AlgorithmIf ( datagrams dest network # == network # of network interface x ) deliver it to the destination host over interface xelseif ( datagrams dest network # == network # of a next hop router y )deliver it to the router yelsedeliver it to its default routerExample

    CSS432: Basic Internetworking

  • CSS432: Basic Internetworking*Static Configuration for Cisco Routershostname 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.2ip route 172.16.4.0 255.255.255.0 172.16.1.2ip route 172.16.5.0 255.255.255.0 172.16.1.2

    CSS432: Basic Internetworking

  • CSS432: Basic Internetworking*Address Translation Map IP addresses into physical addressesdestination hostnext hop routerTechniquesencode physical address in host part of IP addressPha = f( IPa) or IPa =f-1(Pha)Pha: 0010 0001 0100 1001 => IPa: 128.96.33.81ProblemsClass C has only 8 bits to indicate a hostEthernet has 48 bits to present a host addresstable-basedResolution through dynamic bindingAddress Resolution Protocol (ARP)table of IP physical address bindingsbroadcast request if IP address not in tabletarget machine responds with its physical addresstable entries are discarded if not refreshed

    CSS432: Basic Internetworking

  • CSS432: Internetworking*

    CSS432: Internetworking

  • CSS432: Basic Internetworking*ARP Details table entries timeout after 15 minutesUpdate table with source info when you are the target, otherwise no need to add an entryupdate table if already have an entryAXBYResponse (from B): Im IPb and Phb. Youre IPa and Pha Request (from A): Im IPa and Pha. Youre IPb. How about Phb?AXBY

    IPPhIPbPhbIPaPha

    IPPhIPaPhaIPbPhb

    IPPhIPbPhb

    IPPhIPaPhaIPb??

    CSS432: Basic Internetworking

  • CSS432: Basic Internetworking*ARP Packet FormatAn ARP packet is carried in a frame headerHardwareType: type of physical network (e.g., Ethernet)ProtocolType: type of higher layer protocol (e.g., IP)HLen & PLen: length of physical and protocol addressesOperation: request or response Source/Target Physical/Protocol addressespreambledest addrsrc addr0x0806CRCframe typeEx. Ethernet

    CSS432: Basic Internetworking

  • CSS432: Basic Internetworking*RARP: Reverse Address Resolution Protocol Use RARP if a client host is diskless workstationUse the unique MAC addressAsk an RARP server about a client IPWorks in the same LANRetransmit an RARP message after a large delay if it has been lost.Prepare a primary & secondary server.

    AXBYResponse Youre IPa and Pha Request Im Pha. Whats my IPa?AXBYRARP serverRARP server

    IPPhIPaPhaIPbPhb

    IPPhIPaPha

    IPPh??Pha

    IPPhIPaPhaIPbPhb

    CSS432: Basic Internetworking

  • CSS432: Basic Internetworking*DHCP: Dynamic Host Configuration ProtocolIP addresses must be configured for each networkDHCP server:Centralized repository for available IP addressesPre-assigned or drawn from a poolAccessible by sending a DHCPDISCOVER message to an IP broadcast address (255.255.255.255)May receive a DHCPDISCOVER from a Relay agent connected to a different networkClient:Receives a leased IP addressMay renew the lease periodicallyWhen lease expires, IP address can be reassigned (by DHCP server)

    CSS432: Basic Internetworking

  • CSS432: Internetworking*DHCP Client State TransitionINITIALIZEFig. 23.4 on p453 of Internetworking with TCP/IPREQUESTSELECTRENEWREBINDBOUNDHost boots/ DHCPDISCOVER to all serversSelect offer / DHCPREQUEST to a specific serverReceive DHCPOFFERfrom all serversReceive DHCPACK from the current serverLease reaches 50% expiration/ DHCPREQUEST to the current serverDHCPACKDHCPNACKLease reaches 87.5% expiration/ DHCPREQUEST to any serverDHCPACKDHCPNACKOrLease expires

    CSS432: Internetworking

  • CSS432: Internetworking*Two-Step bootstrap ProcedureDiskless WorkstationStep 1A: BOOTP request: BOOT FILE NAME=I want to boot unixStep 1B:BOOTP reply: Server = mercury, BOOT FILE NAME=/local/var/bootfiles/xncd19rStep 2A: TFTP request: request for the imageStep 2B: TFTP reply: image returnedBOOTP serverFile serverOS Image:UnixWindows

    CSS432: Internetworking

  • Internet Control Message ProtocolCSS432: Internetworking*http://www.borella.net/content/MITP432/ICMP/img4.html

    CSS432: Internetworking

  • CSS432: Basic Internetworking*ICMP Message Types

    Type fieldCode fieldICMP Message TypeApplications0 and 8Echo reply/requestping3Destination unreachable5Redirect (change a route)110TTL exceededTrace route, 111Fragment reassemble failed

    CSS432: Basic Internetworking

  • CSS432: Internetworking*http://nmap.org/book/tcpip-ref.htmlICMP Message Header

    CSS432: Internetworking

  • CSS432: Internetworking*Internet Control Message Protocol (ICMP)frame headerdatagram heaaderICMP headerICMP dataSrcR1R2R3RKRERcvError occurredMistakenly routedAn error reporting message (ICMP)ICMP type 0-18Is Src responsible for this ICMP message?IPICMPData Link

    CSS432: Internetworking

  • CSS432: Basic Internetworking*ReviewsIP Internet: Protocol stack, fragmentation/reassembly, IP address, and datagram forwardingAddress translation: ARP, RAPR, and DHCPICMPExercises in Chapter 3Ex. 36 (fragmentation)Ex. 44 (ARP)Ex. 45 (ARP)

    CSS432: Basic Internetworking

  • Ex 36CSS432: Internetworking*36. Suppose a TCP message that contains 1024 bytes of data and 20 bytes of TCP header is passed to IP for delivery across two networks interconnected by a router (i.e., it travels from the source host to a router to the destination host). The first network has an MTU of 1024 bytes; the second has a MTU of 576 bytes. Each networks MTU gives the size of the largest IP datagram that can be carried in a link-layer frame. Give the sizes and offsets of the sequence of fragments delivered to the network layer at the destination host. Assume all IP headers are 20 bytes.

    CSS432: Internetworking

  • Ex 44CSS432: Internetworking*44. Suppose hosts A and B have been assigned the same IP address on the same Ethernet, on which ARP is used. B starts up after A. What will happen to As existing connections? Explain how self-ARP (querying the network on start-up for ones own IP address) might help with this problem.

    CSS432: Internetworking

  • Ex 45CSS432: Internetworking*45. Suppose an IP implementation adheres literally to the following algorithm on receipt of a packet, P, destined for IP address D:if ( Ethernet address for D is in ARP cache ) send Pelse send out an ARP Query for D put P into a queue until the response comes back(a) If the IP layer receives a burst of packets destined for D, how might this algorithm waste resources unnecessarily?(b) Sketch an improved version.(c) Suppose we simply drop P, after sending out a query, when cache lookup fails. How would this behave? (Some early ARP implementations allegedly did this)

    CSS432: Internetworking

  • CSS432: Internetworking*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? Why or why not?Q2. (DHCP)DHCP mandates a minimum address lease of one hour. Can you imagine a situation in which DHCPs minimum lease causes inconvenience? Explain.

    CSS432: Internetworking

    **