03 Packets

Click here to load reader

  • date post

  • Category


  • view

  • download


Embed Size (px)



Transcript of 03 Packets

  • IP Packet SwitchingCOS 461: Computer NetworksSpring 2006 (MW 1:30-2:50 in Friend 004)

    Jennifer RexfordTeaching Assistant: Ioannis Avramopoulos http://www.cs.princeton.edu/courses/archive/spring07/cos461/

  • Goals of Todays LectureConnectivityLinks and nodesCircuit switchingPacket switchingIP service modelBest-effort packet deliveryIP as the Internets narrow waistDesign philosophy of IPIP packet structureFields in the IP headerTraceroute using TTL fieldSource-address spoofing

  • Simple Network: Nodes and a LinkNode: computerEnd host: general-purpose computer, cell phone, PDANetwork node: switch or routerLink: physical medium connecting nodesTwisted pair: the wire that connects to telephonesCoaxial cable: the wire that connects to TV setsOptical fiber: high-bandwidth long-distance linksSpace: propagation of radio waves, microwaves, NodeLinkNode

  • Network ComponentsFibersCoaxial CableLinksInterfacesSwitches/routersEthernet cardWireless cardLarge routerTelephoneswitch

  • Links: Delay and BandwidthDelayLatency for propagating data along the linkCorresponds to the length of the linkTypically measured in secondsBandwidthAmount of data sent (or received) per unit timeCorresponds to the width of the linkTypically measured in bits per secondbandwidthdelaydelay x bandwidth

  • Connecting More Than Two HostsMulti-access link: Ethernet, wireless Single physical link, shared by multiple nodesLimitations on distance and number of nodesPoint-to-point links: fiber-optic cableOnly two nodes (separate link per pair of nodes)Limitations on the number of adapters per node

    multi-access linkpoint-to-point links

  • Beyond Directly-Connected Networks

    Switched networkEnd hosts at the edgeNetwork nodes that switch trafficLinks between the nodesMultiplexingMany end hosts communicate over the networkTraffic shares access to the same links

  • Circuit Switching (e.g., Phone Network)Source establishes connection to destinationNode along the path store connection infoNodes may reserve resources for the connectionSource sends data over the connectionNo destination address, since nodes know pathSource tears down connection when done

  • Circuit Switching With Human Operator

  • Circuit Switching: Multiplexing a LinkTime-divisionEach circuit allocated certain time slotsFrequency-divisionEach circuit allocated certain frequenciestimefrequencytime

  • Advantages of Circuit SwitchingGuaranteed bandwidth Predictable communication performanceNot best-effort delivery with no real guaranteesSimple abstractionReliable communication channel between hostsNo worries about lost or out-of-order packetsSimple forwarding Forwarding based on time slot or frequencyNo need to inspect a packet headerLow per-packet overheadForwarding based on time slot or frequencyNo IP (and TCP/UDP) header on each packet

  • Disadvantages of Circuit SwitchingWasted bandwidthBursty traffic leads to idle connection during silent periodUnable to achieve gains from statistical multiplexingBlocked connectionsConnection refused when resources are not sufficientUnable to offer okay service to everybodyConnection set-up delay No communication until the connection is set upUnable to avoid extra latency for small data transfersNetwork stateNetwork nodes must store per-connection informationUnable to avoid per-connection storage and state

  • Packet Switching (e.g., Internet)Data traffic divided into packetsEach packet contains a header (with address)Packets travel separately through networkPacket forwarding based on the headerNetwork nodes may store packets temporarilyDestination reconstructs the message

  • Packet Switching: Statistical MultiplexingPackets

  • IP Service: Best-Effort Packet DeliveryPacket switchingDivide messages into a sequence of packetsHeaders with source and destination addressBest-effort deliveryPackets may be lostPackets may be corruptedPackets may be delivered out of ordersourcedestinationIP network

  • IP Service Model: Why Packets?Data traffic is burstyLogging in to remote machinesExchanging e-mail messagesDont want to waste bandwidthNo traffic exchanged during idle periodsBetter to allow multiplexingDifferent transfers share access to same linksPackets can be delivered by most anythingRFC 1149: IP Datagrams over Avian Carriers (aka birds) still, packet switching can be inefficientExtra header bits on every packet

  • IP Service Model: Why Best-Effort?IP means never having to say youre sorryDont need to reserve bandwidth and memoryDont need to do error detection & correctionDont need to remember from one packet to nextEasier to survive failuresTransient disruptions are okay during failover

    but, applications do want efficient, accurate transfer of data in order, in a timely fashion

  • IP Service: Best-Effort is EnoughNo error detection or correctionHigher-level protocol can provide error checkingSuccessive packets may not follow the same pathNot a problem as long as packets reach the destinationPackets can be delivered out-of-orderReceiver can put packets back in order (if necessary)Packets may be lost or arbitrarily delayedSender can send the packets again (if desired)No network congestion control (beyond drop)Sender can slow down in response to loss or delay

  • Layering in the IP ProtocolsInternet ProtocolTransmission ControlProtocol (TCP)User Datagram Protocol (UDP)TelnetHTTPSONETATMEthernetRTPDNSFTP

  • History: Why IP Packets?IP proposed in the early 1970sDefense Advanced Research Project Agency (DARPA)Goal: connect existing networksTo develop an effective technique for multiplexed utilization of existing interconnected networksE.g., connect packet radio networks to the ARPAnetMotivating applications Remote login to server machinesInherently bursty traffic with long silent periodsPrior ARPAnet experience with packet switchingPrevious DARPA projectDemonstrated store-and-forward packet switching

  • Other Main Driving Goals (In Order)Communication should continue despite failuresSurvive equipment failure or physical attackTraffic between two hosts continue on another pathSupport multiple types of communication servicesDiffering requirements for speed, latency, & reliabilityBidirectional reliable delivery vs. message serviceAccommodate a variety of networksBoth military and commercial facilitiesMinimize assumptions about the underlying network

  • Other Driving Goals, Somewhat MetPermit distributed management of resourcesNodes managed by different institutions though this is still rather challengingCost-effectivenessStatistical multiplexing through packet switching though packet headers and retransmissions wastefulEase of attaching new hostsStandard implementations of end-host protocols though still need a fair amount of end-host softwareAccountability for use of resourcesMonitoring functions in the nodes though this is still fairly limited and immature

  • IP Packet Structure4-bitVersion4-bitHeaderLength8-bitType of Service(TOS)16-bit Total Length (Bytes)16-bit Identification3-bitFlags13-bit Fragment Offset8-bit Time to Live (TTL)8-bit Protocol16-bit Header Checksum32-bit Source IP Address32-bit Destination IP AddressOptions (if any)Payload

  • IP Header: Version, Length, ToSVersion number (4 bits)Indicates the version of the IP protocolNecessary to know what other fields to expectTypically 4 (for IPv4), and sometimes 6 (for IPv6)Header length (4 bits)Number of 32-bit words in the headerTypically 5 (for a 20-byte IPv4 header)Can be more when IP options are usedType-of-Service (8 bits)Allow packets to be treated differently based on needsE.g., low delay for audio, high bandwidth for bulk transfer

  • IP Header: Length, Fragments, TTLTotal length (16 bits)Number of bytes in the packetMaximum size is 63,535 bytes (216 -1) though underlying links may impose harder limitsFragmentation information (32 bits)Packet identifier, flags, and fragment offsetSupports dividing a large IP packet into fragments in case a link cannot handle a large IP packetTime-To-Live (8 bits)Used to identify packets stuck in forwarding loops and eventually discard them from the network

  • IP Header: More on Time-to-Live (TTL)Potential robustness problemForwarding loops can cause packets to cycle foreverConfusing if the packet arrives much later

    Time-to-live field in packet headerTTL field decremented by each router on the pathPacket is discarded when TTL field reaches 0and time exceeded message is sent to the source

  • IP Header: Use of TTL in Traceroute Time-To-Live field in IP packet headerSource sends a packet with a TTL of nEach router along the path decrements the TTLTTL exceeded sent when TTL reaches 0Traceroute tool exploits this TTL behaviorsourcedestinationSend packets with TTL=1, 2, and record source of time exceeded message

  • Example Traceroute: Berkeley to CNN 1 2 3 4 5 6 7 * 8 9 * 12 number, IP address, DNS nameinr-daedalus-0.CS.Berkeley.EDUsoda-cr-1-1-soda-br-6-2 vlan242.inr-202-doecev.Berkeley.EDUgigE6-0-0.inr-666-doecev.Berkeley.EDUqsv-juniper--ucb-gw.calren2.netPOS1-0.hsipaccess1.SanJose1.Level3.net??pos8-0.hsa2.Atlanta2.Level3.netpop2-atm-P0-2.atdn.net?pop1-atl-P4-0.atdn.netwww4.cnn.com

  • Try Running Traceroute YourselfOn UNIX machineTracerouteE.g., traceroute www.cnn.com or traceroute Windows machineTracertE.g., tracert www.cnn.com or tracert

    Common uses of tracerouteDiscover the topology of the InternetDebug performance and reachability problems

  • IP Header Fields: Transport ProtocolProtocol (8 bi