Download - 03 Packets

Transcript
  • 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 169.229.62.1 2 169.229.59.225 3 128.32.255.169 4 128.32.0.249 5 128.32.0.66 6 209.247.159.109 7 * 8 64.159.1.46 9 209.247.9.17010 66.185.138.3311 * 12 66.185.136.1713 64.236.16.52Hop 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 12.1.1.1On Windows machineTracertE.g., tracert www.cnn.com or tracert 12.1.1.1

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

  • IP Header Fields: Transport ProtocolProtocol (8 bits)Identifies the higher-level protocolE.g., 6 for the Transmission Control Protocol (TCP)E.g., 17 for the User Datagram Protocol (UDP)Important for demultiplexing at receiving hostIndicates what kind of header to expect nextIP headerIP headerTCP headerUDP headerprotocol=6protocol=17

  • IP Header: Checksum on the HeaderChecksum (16 bits)Sum of all 16-bit words in the IP packet headerIf any bits of the header are corrupted in transit the checksum wont match at receiving hostReceiving host discards corrupted packetsSending host will retransmit the packet, if needed 134+ 212

    = 346 134+ 216

    = 350Mismatch!

  • IP Header: To and From AddressesTwo IP addressesSource IP address (32 bits)Destination IP address (32 bits)Destination addressUnique identifier for the receiving hostAllows each node to make forwarding decisionsSource addressUnique identifier for the sending hostRecipient can decide whether to accept packetEnables recipient to send a reply back to source

  • Source Address: What if Source Lies?Source address should be the sending hostBut, whos checking, anyway?You could send packets with any source you wantWhy would someone want to do this?Launch a denial-of-service attackSend excessive packets to the destination to overload the node, or the links leading to the nodeEvade detection by spoofingBut, the victim could identify you by the source addressSo, you can put someone elses source address in the packetsAlso, an attack against the spoofed hostSpoofed host is wrongly blamedSpoofed host may receive return traffic from the receiver

  • Summary: Packet Switching ReviewEfficient Can send from any input that is readyGeneralMultiple types of applicationsAccommodates bursty trafficAddition of queuesStore and forwardPackets are self contained unitsCan use alternate paths reorderingContention (i.e., no isolation)CongestionDelay

  • Next LectureIP routersPacket forwardingComponents of a routerReading for this weekChapter 3: Sections 3.1 and 3.4Chapter 4: Sections 4.1.1-4.1.4Please subscribe to the course mailing listhttps://lists.cs.princeton.edu/mailman/listinfo/cos461