Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 2: Packet Switching Reading: Sections 3.1, 3.4 CMSC 23300/33300 Computer Networks ?

Similar presentations


Presentation on theme: "Lecture 2: Packet Switching Reading: Sections 3.1, 3.4 CMSC 23300/33300 Computer Networks ?"— Presentation transcript:

1 Lecture 2: Packet Switching Reading: Sections 3.1, 3.4 CMSC 23300/33300 Computer Networks http://dsl.cs.uchicago.edu/Courses/CMSC33300 ?

2 2 Class Logistics l Slides online at u http://dsl.cs.uchicago.edu/Courses/CMSC33300 l Sign up for the course e-mail list u http://mailman.cs.uchicago.edu/mailman/listinfo/cm sc33300

3 3 Goals of Today’s Lecture l Connectivity u Links and nodes u Circuit switching u Packet switching l IP service model u Best-effort packet delivery u IP as the Internet’s “narrow waist” u Design philosophy of IP l IP packet structure u Fields in the IP header u Traceroute using TTL field u Source-address spoofing

4 4 Simple Network: Nodes and a Link l Node: computer u End host: general-purpose computer, cell phone, PDA u Network node: switch or router l Link: physical medium connecting nodes u Twisted pair: the wire that connects to telephones u Coaxial cable: the wire that connects to TV sets u Optical fiber: high-bandwidth long-distance links u Space: propagation of radio waves, microwaves, … NodeLinkNode

5 5 Fibers Coaxial Cable LinksInterfacesSwitches/routers Ethernet card Wireless card Large router Telephone switch Network Components

6 6 Links: Delay and Bandwidth l Delay u Latency for propagating data along the link u Corresponds to the “length” of the link u Typically measured in seconds l Bandwidth u Amount of data sent (or received) per unit time u Corresponds to the “width” of the link u Typically measured in bits per second bandwidth delay delay x bandwidth

7 7 Connecting More Than Two Hosts l Multi-access link: Ethernet, wireless u Single physical link, shared by multiple nodes u Limitations on distance and number of nodes l Point-to-point links: fiber-optic cable u Only two nodes (separate link per pair of nodes) u Limitations on the number of adapters per node multi-access link point-to-point links

8 8 Beyond Directly-Connected Networks l Switched network u End hosts at the edge u Network nodes that switch traffic u Links between the nodes l Multiplexing u Many end hosts communicate over the network u Traffic shares access to the same links

9 9 Circuit Switching (e.g., Phone Network) l Source establishes connection to destination u Node along the path store connection info u Nodes may reserve resources for the connection l Source sends data over the connection u No destination address, since nodes know path l Source tears down connection when done

10 10 Circuit Switching With Human Operator

11 11 Circuit Switching: Multiplexing a Link l Time-division u Each circuit allocated certain time slots l Frequency-division u Each circuit allocated certain frequencies time frequency time

12 12 Advantages of Circuit Switching l Guaranteed bandwidth u Predictable communication performance u Not “best-effort” delivery with no real guarantees l Simple abstraction u Reliable communication channel between hosts u No worries about lost or out-of-order packets l Simple forwarding u Forwarding based on time slot or frequency u No need to inspect a packet header l Low per-packet overhead u Forwarding based on time slot or frequency u No IP (and TCP/UDP) header on each packet

13 13 Disadvantages of Circuit Switching l Wasted bandwidth u Bursty traffic leads to idle connection during silent period u Unable to achieve gains from statistical multiplexing l Blocked connections u Connection refused when resources are not sufficient u Unable to offer “okay” service to everybody l Connection set-up delay u No communication until the connection is set up u Unable to avoid extra latency for small data transfers l Network state u Network nodes must store per-connection information u Unable to avoid per-connection storage and state

14 14 Packet Switching (e.g., Internet) l Data traffic divided into packets u Each packet contains a header (with address) l Packets travel separately through network u Packet forwarding based on the header u Network nodes may store packets temporarily l Destination reconstructs the message

15 15 Packet Switching: Statistical Multiplexing Packets

16 16 IP Service: Best-Effort Packet Delivery l Packet switching u Divide messages into a sequence of packets u Headers with source and destination address l Best-effort delivery u Packets may be lost u Packets may be corrupted u Packets may be delivered out of order source destination IP network

17 17 IP Service Model: Why Packets? l Data traffic is bursty u Logging in to remote machines u Exchanging e-mail messages l Don’t want to waste reserved bandwidth u No traffic exchanged during idle periods l Better to allow multiplexing u Different transfers share access to same links l Packets can be delivered by most anything u RFC 2549: IP over Avian Carriers (aka birds) l … still, packet switching can be inefficient u Extra header bits on every packet

18 18 IP Service Model: Why Best-Effort? l IP means never having to say you’re sorry… u Don’t need to reserve bandwidth and memory u Don’t need to do error detection & correction u Don’t need to remember from one packet to next l Easier to survive failures u Transient disruptions are okay during failover l … but, applications do want efficient, accurate transfer of data in order, in a timely fashion

19 19 IP Service: Best-Effort is Enough l No error detection or correction u Higher-level protocol can provide error checking l Successive packets may not follow the same path u Not a problem as long as packets reach the destination l Packets can be delivered out-of-order u Receiver can put packets back in order (if necessary) l Packets may be lost or arbitrarily delayed u Sender can send the packets again (if desired) l No network congestion control (beyond “drop”) u Sender can slow down in response to loss or delay

20 20 Layering in the IP Protocols Internet Protocol User Datagram Protocol (UDP) Telnet HTTP SONETATM Ethernet RTPDNS FTP Transmission Control Protocol (TCP)

21 21 History: Why IP Packets? l IP proposed in the early 1970s u Defense Advanced Research Project Agency (DARPA) l Goal: connect existing networks u To develop an effective technique for multiplexed utilization of existing interconnected networks u E.g., connect packet radio networks to the ARPAnet l Motivating applications u Remote login to server machines u Inherently bursty traffic with long silent periods l Prior ARPAnet experience with packet switching u Previous DARPA project u Demonstrated store-and-forward packet switching

22 22 Other Main Driving Goals (In Order) l Communication should continue despite failures u Survive equipment failure or physical attack u Traffic between two hosts continue on another path l Support multiple types of communication services u Differing requirements for speed, latency, & reliability u Bidirectional reliable delivery vs. message service l Accommodate a variety of networks u Both military and commercial facilities u Minimize assumptions about the underlying network

23 23 Other Driving Goals, Somewhat Met l Permit distributed management of resources u Nodes managed by different institutions u … though this is still rather challenging l Cost-effectiveness u Statistical multiplexing through packet switching u … though packet headers and retransmissions wasteful l Ease of attaching new hosts u Standard implementations of end-host protocols u … though still need a fair amount of end-host software l Accountability for use of resources u Monitoring functions in the nodes u … though this is still fairly limited and immature

24 24 IP Packet Structure 4-bit Version 4-bit Header Length 8-bit Type of Service (TOS) 16-bit Total Length (Bytes) 16-bit Identification 3-bit Flags 13-bit Fragment Offset 8-bit Time to Live (TTL) 8-bit Protocol 16-bit Header Checksum 32-bit Source IP Address 32-bit Destination IP Address Options (if any) Payload

25 25 IP Packet Header Fields l Version number (4 bits) u Indicates the version of the IP protocol u Necessary to know what other fields to expect u Typically “4” (for IPv4), and sometimes “6” (for IPv6) l Header length (4 bits) u Number of 32-bit words in the header u Typically “5” (for a 20-byte IPv4 header) u Can be more when “IP options” are used l Type-of-Service (8 bits) u Allow packets to be treated differently based on needs u E.g., low delay for audio, high bandwidth for bulk transfer

26 26 IP Packet Header Fields (Continued) l Total length (16 bits) u Number of bytes in the packet u Maximum size is 63,535 bytes (2 16 -1) u … though underlying links may impose harder limits l Fragmentation information (32 bits) u Packet identifier, flags, and fragment offset u Supports dividing a large IP packet into fragments u … in case a link cannot handle a large IP packet l Time-To-Live (8 bits) u Used to identify packets stuck in forwarding loops u … and eventually discard them from the network

27 27 IP Packet Header Fields (Continued) l Protocol (8 bits) u Identifies the higher-level protocol l E.g., “6” for the Transmission Control Protocol (TCP) l E.g., “17” for the User Datagram Protocol (UDP) u Important for demultiplexing at receiving host l Indicates what kind of header to expect next IP header TCP headerUDP header protocol=6protocol=17

28 28 IP Packet Header Fields (Continued) l Checksum (16 bits) u Sum of all 16-bit words in the IP packet header u If any bits of the header are corrupted in transit u … the checksum won’t match at receiving host u Receiving host discards corrupted packets l Sending host will retransmit the packet, if needed 134 + 212 = 346 134 + 216 = 350 Mismatch!

29 29 IP Packet Header (Continued) l Two IP addresses u Source IP address (32 bits) u Destination IP address (32 bits) l Destination address u Unique identifier for the receiving host u Allows each node to make forwarding decisions l Source address u Unique identifier for the sending host u Recipient can decide whether to accept packet u Enables recipient to send a reply back to source

30 30 What if the Source Lies? l Source address should be the sending host u But, who’s checking, anyway? u You could send packets with any source you want l Why would someone want to do this? u Launch a denial-of-service attack l Send excessive packets to the destination l … to overload the node, or the links leading to the node u Evade detection by “spoofing” l But, the victim could identify you by the source address l So, you can put someone else’s source address in the packets u Also, an attack against the spoofed host l Spoofed host is wrongly blamed l Spoofed host may receive return traffic from the receiver

31 31 Error Reporting l Examples of errors a router may see u Router doesn’t know where to forward a packet u Packet’s time-to-live field expires l Router doesn’t really need to respond u Best effort means never having to say you’re sorry u So, IP could conceivably just silently drop packets l But, silent failures are really hard to diagnose u IP includes basic feedback about network problems u Internet Control Message Protocol (ICMP)

32 32 Internet Control Message Protocol l ICMP runs on top of IP u In parallel to TCP and UDP u Though still viewed as an integral part of IP l Diagnostics u Triggered when an IP packet encounters a problem l E.g., time exceeded or destination unreachable u ICMP packet sent back to the source IP address l Includes the error information (e.g., type and code) l … and an excerpt of the original data packet for identification u Source host receives the ICMP packet l Inspects the excerpt of the packet (e.g., protocol and ports) l … to identify which socket should receive the error

33 33 Example: Time Exceeded hostDNS... host DNS... router host 1.2.3.7 8.9.10.11 5.6.7.156 l Host sends an IP packet u Each router decrements the time-to-live field l If time-to-live field reaches 0 u Router generates an ICMP message u Sends a “time exceeded” message back to the source Time exceeded

34 34 Traceroute: Exploiting “Time Exceeded” l Time-To-Live field in IP packet header u Source sends a packet with a TTL of n u Each router along the path decrements the TTL u “TTL exceeded” sent when TTL reaches 0 l Traceroute tool exploits this TTL behavior source destination TTL=1 Time exceeded TTL=2 Send packets with TTL=1, 2, … and record source of “time exceeded” message

35 35 Ping: Echo and Reply l ICMP includes a simple “echo” function u Sending node sends an ICMP “echo” message u Receiving node sends an ICMP “echo reply” l Ping tool u Tests the connectivity with a remote host u … by sending regularly spaced echo commands u … and measuring the delay until receiving the reply l Pinging a host u “ping www.cs.uchicago.edu” or “ping 12.157.34.212” u Used to test if a machine is reachable and alive u (However, some nodes have ICMP disabled…  )

36 36 Summary: Packet Switching Review (Sections 3.1, 3.4, Peterson/Davie) l Efficient u Can send from any input that is ready l General u Multiple types of applications l Accommodates bursty traffic u Addition of queues l Store and forward u Packets are self contained units u Can use alternate paths – reordering l Contention (i.e., no isolation) u Congestion u Delay

37 37 Next Lecture l IP routers u Packet forwarding u Components of a router l Read Sections 4.1.1-4.1.4 of Chapter 4


Download ppt "Lecture 2: Packet Switching Reading: Sections 3.1, 3.4 CMSC 23300/33300 Computer Networks ?"

Similar presentations


Ads by Google