Computer Networks Guest Lecture in COS 318 Jennifer Rexford http://www.cs.princeton.edu/~jrex

  • View
    212

  • Download
    0

Embed Size (px)

Transcript

  • Slide 1
  • Computer Networks Guest Lecture in COS 318 Jennifer Rexford http://www.cs.princeton.edu/~jrex
  • Slide 2
  • Goal of the Lecture Brief introduction to data networking Best-effort service and the hourglass model From sending packets to downloading Web pages Internet addressing, routing, and topology Teaser for COS 461, offered next term MW 1:30-2:50pm
  • Slide 3
  • Best-Effort Packet-Delivery Service
  • Slide 4
  • IP Service Model: Best-Effort Packet Delivery Packet switching Send data in packets Header with source & destination address Best-effort delivery Packets may be lost Packets may be corrupted Packets may be delivered out of order source destination IP network
  • Slide 5
  • IP Service Model: Why Packets? Data traffic is bursty Logging in to remote machines Exchanging e-mail messages Dont want to waste reserved bandwidth No traffic exchanged during idle periods Better to allow multiplexing Different transfers share access to same links Packets can be delivered by most anything RFC 2549: IP over Avian Carriers (aka birds) still, packet switching can be inefficient Extra header bits (envelope) for every packet
  • Slide 6
  • IP Service Model: Why Best-Effort? Its easier not to make promises Dont reserve bandwidth and memory Dont do error detection and correction Dont remember from one packet to next Easier to survive failures Transient disruptions are okay during failover but, applications do want efficient, accurate transfer of data in order, in a timely fashion
  • Slide 7
  • IP Service Model: Best-Effort is Enough No error detection or correction Receiver can discard corrupted packets Sender can send the packets again Successive packets may not follow the same path Okay as long as packets reach the destination Packets can be delivered out-of-order Receiver can put packets back in order Packets may be lost or arbitrarily delayed Sender can send the packets again No network congestion control (beyond drop) Sender can slow down in response to loss or delay
  • Slide 8
  • Layering in the IP Protocols: Hourglass Internet Protocol Transmission Control Protocol (TCP) User Datagram Protocol (UDP) Telnet HTTP SONETATM Ethernet RTPDNS FTP
  • Slide 9
  • Transport Protocols: Between End Hosts
  • Slide 10
  • Transmission Control Protocol (TCP) Communication service (socket) Ordered, reliable byte stream Simultaneous transmission in both directions Key mechanisms at end hosts Retransmit lost and corrupted packets Discard duplicate packets and put packets in order Flow control to avoid overloading the receiver buffer Congestion control to adapt sending rate to network load sourcenetworkdestination TCP connection
  • Slide 11
  • Opening and Closing a TCP Connection Three-way handshake to establish connection Host A sends a SYN to the host B Host B returns a SYN and acknowledgement Host A sends an ACK to acknowledge the SYN ACK Four-way handshake to close the connection Finish (FIN) to close and receive remaining bytes, or Reset (RST) to close and not receive remaining bytes SYN SYN ACK ACK Data FIN ACK time A B FIN ACK
  • Slide 12
  • Lost and Corrupted Packets Detecting corrupted and lost packets Error detection via checksum on header and data Sender sends packet, sets timeout, and waits for ACK Receiver sends ACKs for received packets Sender infers loss from timeout or duplicate ACKs Retransmission by sender Sender retransmits lost/corrupted packets Receiver reassembles and reorders packets Receiver discards corrupted and duplicated packets
  • Slide 13
  • TCP Flow and Congestion Control Window-based flow control Sender limits number of outstanding bytes (window size) Receiver window ensures data does not overflow receiver Adapting to network congestion Congestion window tries to avoid overloading the network (increase with successful delivery, decrease with loss) TCP connection starts with small initial congestion window time congestion window slow start congestion avoidance
  • Slide 14
  • User Datagram Protocol (UDP) Some applications do not want or need TCP Avoid overhead of opening/closing a connection Avoid recovery from lost/corrupted packets Avoid sender adaptation to loss/congestion Example applications that use UDP Multimedia streaming applications Domain Name System (DNS) queries/replies Dealing with the growth in UDP traffic Interference with TCP performance Pressure to apply congestion control Future routers may enforce TCP-friendly behavior
  • Slide 15
  • Converting Host Names to Numerical Addresses
  • Slide 16
  • Domain Name System (DNS) Properties of DNS Hierarchical name space divided into zones Translation of names to/from IP addresses Distributed over a collection of DNS servers Client application Extract server name (e.g., from the URL) Invoke system call to trigger DNS resolver code E.g., gethostbyname() on www.cs.princeton.edu Server application Extract client IP address from socket Optionally invoke system call to translate into name E.g., gethostbyaddr() on 12.34.158.5
  • Slide 17
  • Domain Name System comeduorgac uk zw arpa unnamed root bar westeast foomy ac cam usr in- addr 12 34 56 generic domainscountry domains my.east.bar.edu usr.cam.ac.uk 12.34.56.0/24
  • Slide 18
  • DNS Resolver and Local DNS Server Application DNS resolver Local DNS server 1 10 DNS cache DNS query 2 DNS response 9 Root server 3 4 Top-level domain server 5 6 Second-level domain server 7 8 Caching based on a time-to-live (TTL) assigned by the DNS server responsible for the host name to reduce latency in DNS translation.
  • Slide 19
  • Building Applications on Top (e.g., Web)
  • Slide 20
  • Application-Layer Protocols Messages exchanged between applications Syntax and semantics of the messages between hosts Tailored to the specific application (e.g., Web, e-mail) Messages transferred over transport connection (e.g., TCP) Popular application-layer protocols Telnet, FTP, SMTP, NNTP, HTTP, ClientServer GET /index.html HTTP/1.1 HTTP/1.1 200 OK
  • Slide 21
  • Example: Many Steps in Web Download Browser cache DNS resolution TCP open 1 st byte response Last byte response Sources of variability of delay Browser cache hit/miss, need for cache revalidation DNS cache hit/miss, multiple DNS servers, errors Packet loss, round-trip time, server accept queue RTT, busy server, CPU overhead (e.g., CGI script) Response size, receive buffer size, congestion downloading embedded image(s) on the page
  • Slide 22
  • IP Suite: End Hosts vs. Routers HTTP TCP IP Ethernet interface HTTP TCP IP Ethernet interface IP Ethernet interface Ethernet interface SONET interface SONET interface host router HTTP message TCP segment IP packet
  • Slide 23
  • Routers, Addressing, and Forwarding
  • Slide 24
  • What is a Router? A computer with Multiple interfaces Implementing routing protocols Packet forwarding Wide range of variations of routers Small LinkSys device in a home network Linux-based PC running router software Million-dollar high-end routers with large chassis and links Serial line Ethernet Packet-over-SONET
  • Slide 25
  • Fibers Coaxial Cable LinksInterfacesSwitches/routers Ethernet card Wireless card Large router Telephone switch Network Components
  • Slide 26
  • Inside a High-End Router Switching Fabric Processor Line card
  • Slide 27
  • Happy Routers Make Happy Packets Routers forward packets Forward incoming packet to outgoing link Store packets in queues Drop packets when necessary Routers compute paths Routers run routing protocols Routers compute forwarding tables A famous quotation from RFC 791 A name indicates what we seek. An address indicates where it is. A route indicates how we get there. -- Jon Postel
  • Slide 28
  • IP Addressing 32-bit number in dotted-quad notation (12.34.158.5) Divided into network & host portions (left and right) 12.34.158.0/24 is a 24-bit prefix with 2 8 addresses 0000110000100010 1001111000000101 Network (24 bits)Host (8 bits) 12341585
  • Slide 29
  • whois h whois.arin.net 128.112.136.35 OrgName: Princeton University OrgID: PRNU Address: Office of Information Technology Address: 87 Prospect Avenue City: Princeton StateProv: NJ PostalCode: 08544-2007 Country: US NetRange: 128.112.0.0 - 128.112.255.255 CIDR: 128.112.0.0/16 NetName: PRINCETON NetHandle: NET-128-112-0-0-1 Parent: NET-128-0-0-0-0 NetType: Direct Allocation RegDate: 1986-02-24
  • Slide 30
  • Packet Forwarding Forwarding tables in IP routers Maps each IP prefix to next-hop link(s) Destination-based forwarding Packet has a destination address Router identifies longest-matching prefix Cute algorithmic problem: very fast lookups 4.0.0.0/8 4.83.128.0/17 12.0.0.0/8 12.34.158.0/24 126.255.103.0/24 12.34.158.5 destination forwarding table Serial0/0.1 outgoing link
  • Slide 31
  • Internet Topology and Routing
  • Slide 32
  • Autonomous Systems (ASes) 1 2 3 4 5 6 7 Client Web server Path: 6, 5, 4, 3, 2, 1
  • Slide 33
  • Internet Routing Architecture Divided into Autonomous Systems Distinct regions of administrative control Routers/links managed by a single institution Service provider, company, university,

Recommended

View more >