Review of Networking Basics

                    Yao Wang
    Polytechnic University, Brooklyn, NY11201
              yao@...
These slides are extracted from the slides
made by authors of the book (J. F. Kurose            Slides based on
and K. Ros...
Overview of Telecommunication
   Networks and Internet
                Based on Chapter I -- Computer
                 Net...
Roadmap
      What is the Internet?
      Network edge
      Network core
      Internet structure and ISPs
      Protocol...
What’s the Internet: “nuts and bolts” view
      millions of connected                            router
                 ...
What’s the Internet: “nuts and bolts” view
   protocols control sending,                        router
                   ...
A closer look at network structure:

      network edge:
      applications and
      hosts
      network core:
       ❍ r...
Network edge: connection-oriented service

  Goal: data transfer                    TCP service [RFC 793]
      between en...
Network edge: connectionless service

  Goal: data transfer                  App’s using TCP:
      between end systems   ...
The Network Core
      mesh of interconnected
      routers
      the fundamental
      question: how is data
      transf...
Network Core: Circuit Switching

  End-end resources
    reserved for “call”
      link bandwidth, switch
      capacity
 ...
Network Core: Circuit Switching
  network resources                   dividing link bandwidth
    (e.g., bandwidth)       ...
Circuit Switching: TDMA and TDMA
                                   Example:
FDMA
                                   4 use...
Network Core: Packet Switching
  each end-end data stream                resource contention:
    divided into packets    ...
Packet Switching: Statistical Multiplexing
              10 Mbs
   A          Ethernet          statistical multiplexing  ...
Packet switching versus circuit switching
  Packet switching allows more users to use network!
      1 Mbit link
      eac...
Packet switching versus circuit switching
  Is packet switching a “slam dunk winner?”

      Great for bursty data
       ...
Packet-switched networks: forwarding
     Goal: move packets through routers from source to
     destination
       ❍   we...
Network Taxonomy
                          Telecommunication
                              networks



            Circuit...
Internet structure: network of networks

   roughly hierarchical
   at center: “tier-1” ISPs (e.g., UUNet, BBN/Genuity,
  ...
Tier-1 ISP: e.g., Sprint
     Sprint US backbone network




From [Kurose/Ross]       Networking Basics   21
Internet structure: network of networks

    “Tier-2” ISPs: smaller (often regional) ISPs
      ❍   Connect to one or more...
Internet structure: network of networks

    “Tier-3” ISPs and local ISPs
      ❍   last hop (“access”) network (closest t...
Internet structure: network of networks

   a packet passes through many networks!


                 local
              ...
Internet protocol stack
      application: supporting network
      applications                                     appli...
Layering: logical communication
Each layer:          application
                     transport
  distributed         netw...
Layering: logical communication
                        data
E.g.: transport        application
                       tra...
Layering: physical communication
                          data
                     application
                     tran...
Protocol layering and data
    Each layer takes data from above
      adds header information to create new data unit
    ...
Application Layer Functions and
   Protocols with focus on Content
   Distribution/Retrieval on the
   Web
               ...
Roadmap
      Principles of app layer protocols
       ❍ Client-server paradigm
       ❍ Transport service requirements of...
Applications and application-layer protocols

 Application: communicating,              application
                      ...
App-layer protocol defines
      Types of messages              Public-domain protocols:
      exchanged, e.g., request   ...
Client-server paradigm
Typical network app has two           application

  pieces: client and server           transport
...
What transport service does an app need?
 Data loss                          Bandwidth
   some apps (e.g., audio) can     ...
Transport service requirements of common apps

          Application     Data loss       Bandwidth            Time Sensiti...
How do loss and delay occur?
packets queue in router buffers
   packet arrival rate to link exceeds output link capacity
 ...
Packet loss
      queue (aka buffer) preceding link in buffer
      has finite capacity
      when packet arrives to full ...
Internet transport protocols services

  TCP service:                            UDP service:
      connection-oriented: s...
Internet apps: application, transport protocols

                            Application               Underlying
        ...
DNS: Domain Name System

  People: many identifiers:            Domain Name System:
       ❍   SSN, name, passport #      ...
DNS name servers
 Why not centralize DNS?        no server has all name-
                                to-IP address map...
DNS: Root name servers
         contacted by local name server that can not resolve name
         root name server:
      ...
Simple DNS example                                   root name server



  host surf.eurecom.fr                           ...
DNS example                                    root name server



   Root name server:                       2           ...
HTTP overview

  HTTP: hypertext
    transfer protocol                                     HT
                            ...
HTTP overview (continued)
  Uses TCP:                              HTTP is “stateless”
      client initiates TCP         ...
HTTP connections
  Nonpersistent HTTP            Persistent HTTP
    At most one object is         Multiple objects can
  ...
HTTP request message

      two types of HTTP messages: request, response
      HTTP request message:
       ❍   ASCII (hu...
HTTP request message: general format




From [Kurose/Ross]   Networking Basics   50
HTTP response message
      status line
       (protocol
     status code               HTTP/1.1 200 OK
    status phrase)...
HTTP response status codes
  In first line in server->client response message.
  A few sample codes:
  200 OK
       ❍   r...
Cookies: keeping “state”
  Many major Web sites              Example:
    use cookies                          ❍   Susan a...
Cookies: keeping “state” (cont.)

                      client                              server
      Cookie file      ...
Cookies (continued)
                                                     aside
  What cookies can bring:            Cookie...
Conditional GET: client-side caching

Goal: don’t send object if     client                        server
client has up-to...
Web caches (proxy server)
  Goal: satisfy client request without involving origin server

     user sets browser: Web     ...
More about Web caching
      Cache acts as both client           Why Web caching?
      and server                        ...
More about Web caching
      Cache acts as both client           Why Web caching?
      and server                        ...
Caching example (1)
                                                                    origin
 Assumptions
              ...
Caching example (2)
                                                                               origin
 Possible soluti...
Caching example (3)
                                                                              origin
  Install cache  ...
Content distribution networks (CDNs)
                                                     origin server
                  ...
CDN example
                                             HTTP request for
                                             www...
More about CDNs
 routing requests                    not just Web pages
   CDN creates a “map”,                streaming s...
What you should know
 Generic networks
 ❍   Two types of services:
      • connection-oriented and connectionless
 ❍   Two...
What you should know
 Application layer functionalities and protocols
 ❍   Client-server model
 ❍   Makes use of underlyin...
Upcoming SlideShare
Loading in …5
×

Microsoft PowerPoint - network_overview

1,037 views
958 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,037
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
33
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Microsoft PowerPoint - network_overview

  1. 1. Review of Networking Basics Yao Wang Polytechnic University, Brooklyn, NY11201 yao@vision.poly.edu
  2. 2. These slides are extracted from the slides made by authors of the book (J. F. Kurose Slides based on and K. Ross), available from the publisher site Computer Networking: for instructors. We would like to thank the A Top Down Approach authors for the excellent book and the slides. Featuring the Internet, 2nd edition. Jim Kurose, Keith Ross Addison-Wesley, July 2002. Chapters 1-2 From [Kurose/Ross] Networking Basics 2
  3. 3. Overview of Telecommunication Networks and Internet Based on Chapter I -- Computer Networks and the Internet From [Kurose/Ross] Networking Basics 3
  4. 4. Roadmap What is the Internet? Network edge Network core Internet structure and ISPs Protocol layers, service models From [Kurose/Ross] Networking Basics 4
  5. 5. What’s the Internet: “nuts and bolts” view millions of connected router workstation computing devices: hosts, end-systems server mobile ❍ PCs workstations, servers local ISP ❍ PDAs phones, toasters running network apps communication links regional ISP ❍ fiber, copper, radio, satellite ❍ transmission rate = bandwidth routers: forward packets company (chunks of data) network From [Kurose/Ross] Networking Basics 5
  6. 6. What’s the Internet: “nuts and bolts” view protocols control sending, router workstation receiving of msgs server ❍ e.g., TCP, IP, HTTP, FTP, PPP mobile Internet: “network of local ISP networks” ❍ loosely hierarchical ❍ public Internet versus regional ISP private intranet Internet standards ❍ RFC: Request for comments ❍ IETF: Internet Engineering Task Force company network From [Kurose/Ross] Networking Basics 6
  7. 7. A closer look at network structure: network edge: applications and hosts network core: ❍ routers ❍ network of networks access networks, physical media: communication links From [Kurose/Ross] Networking Basics 7
  8. 8. Network edge: connection-oriented service Goal: data transfer TCP service [RFC 793] between end systems reliable, in-order byte- handshaking: setup stream data transfer (prepare for) data ❍ loss: acknowledgements transfer ahead of time and retransmissions ❍ Hello, hello back human flow control: protocol ❍ sender won’t overwhelm ❍ set up “state” in two receiver communicating hosts congestion control: TCP - Transmission ❍ senders “slow down sending Control Protocol rate” when network ❍ Internet’s connection- congested oriented service From [Kurose/Ross] Networking Basics 8
  9. 9. Network edge: connectionless service Goal: data transfer App’s using TCP: between end systems HTTP (Web), FTP (file ❍ same as before! transfer), Telnet UDP - User Datagram (remote login), SMTP Protocol [RFC 768]: (email) Internet’s connectionless service App’s using UDP: ❍ unreliable data transfer streaming media, teleconferencing, DNS, ❍ no flow control Internet telephony ❍ no congestion control From [Kurose/Ross] Networking Basics 9
  10. 10. The Network Core mesh of interconnected routers the fundamental question: how is data transferred through net? ❍ circuit switching: dedicated circuit per call: telephone net ❍ packet-switching: data sent thru net in discrete “chunks” From [Kurose/Ross] Networking Basics 10
  11. 11. Network Core: Circuit Switching End-end resources reserved for “call” link bandwidth, switch capacity dedicated resources: no sharing circuit-like (guaranteed) performance call setup required From [Kurose/Ross] Networking Basics 11
  12. 12. Network Core: Circuit Switching network resources dividing link bandwidth (e.g., bandwidth) into “pieces” divided into “pieces” ❍ frequency division pieces allocated to calls ❍ time division resource piece idle if not used by owning call (no sharing) From [Kurose/Ross] Networking Basics 12
  13. 13. Circuit Switching: TDMA and TDMA Example: FDMA 4 users frequency time TDMA frequency time From [Kurose/Ross] Networking Basics 13
  14. 14. Network Core: Packet Switching each end-end data stream resource contention: divided into packets aggregate resource user A, B packets share demand can exceed network resources amount available each packet uses full link congestion: packets bandwidth queue, wait for link use resources used as needed store and forward: packets move one hop at a time Bandwidth division into “pieces” ❍ transmit over link Dedicated allocation ❍ wait turn at next Resource reservation link From [Kurose/Ross] Networking Basics 14
  15. 15. Packet Switching: Statistical Multiplexing 10 Mbs A Ethernet statistical multiplexing C 1.5 Mbs B queue of packets waiting for output link D E Sequence of A & B packets does not have fixed pattern statistical multiplexing. In TDM each host gets same slot in revolving TDM frame. From [Kurose/Ross] Networking Basics 15
  16. 16. Packet switching versus circuit switching Packet switching allows more users to use network! 1 Mbit link each user: ❍ 100 kbps when “active” ❍ active 10% of time N users circuit-switching: 1 Mbps link ❍ 10 users packet switching: ❍ with 35 users, probability > 10 active less than .0004 From [Kurose/Ross] Networking Basics 16
  17. 17. Packet switching versus circuit switching Is packet switching a “slam dunk winner?” Great for bursty data ❍ resource sharing ❍ simpler, no call setup Excessive congestion: packet delay and loss ❍ protocols needed for reliable data transfer, congestion control Q: How to provide circuit-like behavior? ❍ bandwidth guarantees needed for audio/video apps ❍ still an unsolved problem (chapter 6) From [Kurose/Ross] Networking Basics 17
  18. 18. Packet-switched networks: forwarding Goal: move packets through routers from source to destination ❍ we’ll study several path selection (i.e. routing)algorithms (chapter 4) datagram network: ❍ destination address in packet determines next hop ❍ routes may change during session ❍ analogy: driving, asking directions virtual circuit network: ❍ each packet carries tag (virtual circuit ID), tag determines next hop ❍ fixed path determined at call setup time, remains fixed thru call ❍ routers maintain per-call state From [Kurose/Ross] Networking Basics 18
  19. 19. Network Taxonomy Telecommunication networks Circuit-switched Packet-switched networks networks FDM Networks Datagram TDM with VCs Networks • Datagram network is not either connection-oriented Internet or connectionless. • Internet provides both connection-oriented (TCP) and connectionless services (UDP) to apps. From [Kurose/Ross] Networking Basics 19
  20. 20. Internet structure: network of networks roughly hierarchical at center: “tier-1” ISPs (e.g., UUNet, BBN/Genuity, Sprint, AT&T), national/international coverage ❍ treat each other as equals Tier-1 providers also interconnect Tier-1 providers Tier 1 ISP at public network NAP access points interconnect (NAPs) (peer) privately Tier 1 ISP Tier 1 ISP From [Kurose/Ross] Networking Basics 20
  21. 21. Tier-1 ISP: e.g., Sprint Sprint US backbone network From [Kurose/Ross] Networking Basics 21
  22. 22. Internet structure: network of networks “Tier-2” ISPs: smaller (often regional) ISPs ❍ Connect to one or more tier-1 ISPs, possibly other tier-2 ISPs Tier-2 ISPs Tier-2 ISP pays Tier-2 ISP also peer Tier-2 ISP privately with tier-1 ISP for connectivity to Tier 1 ISP each other, rest of Internet NAP interconnect tier-2 ISP is at NAP customer of tier-1 provider Tier 1 ISP Tier 1 ISP Tier-2 ISP Tier-2 ISP Tier-2 ISP From [Kurose/Ross] Networking Basics 22
  23. 23. Internet structure: network of networks “Tier-3” ISPs and local ISPs ❍ last hop (“access”) network (closest to end systems) local ISP Tier 3 local local local ISP ISP ISP ISP Local and tier- Tier-2 ISP Tier-2 ISP 3 ISPs are customers of Tier 1 ISP higher tier NAP ISPs connecting them to rest Tier 1 ISP of Internet Tier 1 ISP Tier-2 ISP local Tier-2 ISP Tier-2 ISP ISP local local local ISP ISP ISP From [Kurose/Ross] Networking Basics 23
  24. 24. Internet structure: network of networks a packet passes through many networks! local ISP Tier 3 local local local ISP ISP ISP ISP Tier-2 ISP Tier-2 ISP Tier 1 ISP NAP Tier 1 ISP Tier 1 ISP Tier-2 ISP local Tier-2 ISP Tier-2 ISP ISP local local local ISP ISP ISP From [Kurose/Ross] Networking Basics 24
  25. 25. Internet protocol stack application: supporting network applications application ❍ FTP, SMTP, STTP transport: host-host data transfer transport ❍ TCP, UDP network: routing of datagrams from network source to destination ❍ IP, routing protocols link link: data transfer between neighboring network elements physical ❍ PPP, Ethernet physical: bits “on the wire” From [Kurose/Ross] Networking Basics 25
  26. 26. Layering: logical communication Each layer: application transport distributed network “entities” link physical implement network layer functions application link at each node transport physical network entities link perform physical application application actions, transport transport exchange network network link link messages with physical physical peers From [Kurose/Ross] Networking Basics 26
  27. 27. Layering: logical communication data E.g.: transport application transport transport take data from app network add addressing, link reliability check physical info to form ack network “datagram” application link send datagram to transport data physical network peer link data wait for peer to physical ack receipt application application transport transport transport analogy: post network network office link link physical physical From [Kurose/Ross] Networking Basics 27
  28. 28. Layering: physical communication data application transport network link physical network application link transport physical network link physical data application application transport transport network network link link physical physical From [Kurose/Ross] Networking Basics 28
  29. 29. Protocol layering and data Each layer takes data from above adds header information to create new data unit passes new data unit to layer below source destination M application application M message Ht M transport transport Ht M segment Hn Ht M network network Hn Ht M datagram Hl Hn Ht M link link Hl Hn Ht M frame physical physical From [Kurose/Ross] Networking Basics 29
  30. 30. Application Layer Functions and Protocols with focus on Content Distribution/Retrieval on the Web Based on Chapter II --- Application Layer From [Kurose/Ross] Networking Basics 30
  31. 31. Roadmap Principles of app layer protocols ❍ Client-server paradigm ❍ Transport service requirements of common app. DNS Web and HTTP Content distribution ❍ Network Web caching ❍ Content distribution networks From [Kurose/Ross] Networking Basics 31
  32. 32. Applications and application-layer protocols Application: communicating, application transport distributed processes network data link ❍ e.g., e-mail, Web, P2P file physical sharing, instant messaging ❍ running in end systems (hosts) ❍ exchange messages to implement application Application-layer protocols ❍ one “piece” of an app application application transport transport ❍ define messages network network data link exchanged by apps and data link physical physical actions taken ❍ use communication services provided by lower layer protocols (TCP, UDP) From [Kurose/Ross] Networking Basics 32
  33. 33. App-layer protocol defines Types of messages Public-domain protocols: exchanged, e.g., request defined in RFCs & response messages allows for Syntax of message types: what fields in interoperability messages & how fields eg, HTTP, SMTP are delineated Proprietary protocols: Semantics of the fields, eg, KaZaA i.e., meaning of information in fields Rules for when and how processes send & respond to messages From [Kurose/Ross] Networking Basics 33
  34. 34. Client-server paradigm Typical network app has two application pieces: client and server transport network data link physical Client: request initiates contact with server (“speaks first”) typically requests service from server, reply Web: client implemented in browser; e-mail: in mail reader application transport Server: network data link physical provides requested service to client e.g., Web server sends requested Web page, mail server delivers e-mail From [Kurose/Ross] Networking Basics 34
  35. 35. What transport service does an app need? Data loss Bandwidth some apps (e.g., audio) can some apps (e.g., tolerate some loss multimedia) require other apps (e.g., file minimum amount of transfer, telnet) require bandwidth to be 100% reliable data “effective” transfer other apps (“elastic Timing apps”) make use of some apps (e.g., whatever bandwidth Internet telephony, they get interactive games) require low delay to be “effective” From [Kurose/Ross] Networking Basics 35
  36. 36. Transport service requirements of common apps Application Data loss Bandwidth Time Sensitive file transfer no loss elastic no e-mail no loss elastic no Web documents no loss elastic no real-time audio/video loss-tolerant audio: 5kbps-1Mbps yes, 100’s msec video:10kbps-5Mbps stored audio/video loss-tolerant same as above yes, few secs interactive games loss-tolerant few kbps up yes, 100’s msec instant messaging no loss elastic yes and no From [Kurose/Ross] Networking Basics 36
  37. 37. How do loss and delay occur? packets queue in router buffers packet arrival rate to link exceeds output link capacity packets queue, wait for turn packet being transmitted (delay) A B packets queueing (delay) free (available) buffers: arriving packets dropped (loss) if no free buffers From [Kurose/Ross] Networking Basics 37
  38. 38. Packet loss queue (aka buffer) preceding link in buffer has finite capacity when packet arrives to full queue, packet is dropped (aka lost) lost packet may be retransmitted by previous node, by source end system, or not retransmitted at all From [Kurose/Ross] Networking Basics 38
  39. 39. Internet transport protocols services TCP service: UDP service: connection-oriented: setup unreliable data transfer required between client and between sending and server processes receiving process reliable transport between does not provide: sending and receiving process connection setup, flow control: sender won’t reliability, flow control, overwhelm receiver congestion control, timing, congestion control: throttle or bandwidth guarantee sender when network overloaded does not providing: timing, Q: why bother? Why is minimum bandwidth there a UDP? guarantees From [Kurose/Ross] Networking Basics 39
  40. 40. Internet apps: application, transport protocols Application Underlying Application layer protocol transport protocol e-mail SMTP [RFC 2821] TCP remote terminal access Telnet [RFC 854] TCP Web HTTP [RFC 2616] TCP file transfer FTP [RFC 959] TCP streaming multimedia proprietary TCP or UDP (e.g. RealNetworks) Internet telephony proprietary (e.g., Dialpad) typically UDP From [Kurose/Ross] Networking Basics 40
  41. 41. DNS: Domain Name System People: many identifiers: Domain Name System: ❍ SSN, name, passport # distributed database Internet hosts, routers: implemented in hierarchy of many name servers ❍ IP address (32 bit) - used for addressing application-layer protocol host, routers, name servers to datagrams communicate to resolve names ❍ “name”, e.g., (address/name translation) gaia.cs.umass.edu - used ❍ note: core Internet by humans function, implemented as Q: map between IP application-layer protocol addresses and name ? ❍ complexity at network’s “edge” From [Kurose/Ross] Networking Basics 41
  42. 42. DNS name servers Why not centralize DNS? no server has all name- to-IP address mappings single point of failure local name servers: traffic volume ❍ each ISP, company has distant centralized local (default) name server database ❍ host DNS query first goes to local name server maintenance authoritative name server: ❍ for a host: stores that doesn’t scale! host’s IP address, name ❍ can perform name/address translation for that host’s name From [Kurose/Ross] Networking Basics 42
  43. 43. DNS: Root name servers contacted by local name server that can not resolve name root name server: ❍ contacts authoritative name server if name mapping not known ❍ gets mapping ❍ returns mapping to local name server a NSI Herndon, VA c PSInet Herndon, VA k RIPE London d U Maryland College Park, MD i NORDUnet Stockholm g DISA Vienna, VA h ARL Aberdeen, MD j NSI (TBD) Herndon, VA m WIDE Tokyo e NASA Mt View, CA f Internet Software C. Palo Alto, CA 13 root name b USC-ISI Marina del Rey, CA servers worldwide l ICANN Marina del Rey, CA From [Kurose/Ross] Networking Basics 43
  44. 44. Simple DNS example root name server host surf.eurecom.fr 2 4 wants IP address of 5 3 gaia.cs.umass.edu 1. contacts its local DNS server, dns.eurecom.fr 2. dns.eurecom.fr contacts local name server authorititive name server dns.eurecom.fr dns.umass.edu root name server, if necessary 1 6 3. root name server contacts authoritative name server, dns.umass.edu, if necessary requesting host gaia.cs.umass.edu surf.eurecom.fr From [Kurose/Ross] Networking Basics 44
  45. 45. DNS example root name server Root name server: 2 6 may not know 7 3 authoritative name server may know intermediate name local name server intermediate name server server: who to dns.eurecom.fr dns.umass.edu contact to find 4 5 1 8 authoritative name server authoritative name server dns.cs.umass.edu requesting host surf.eurecom.fr gaia.cs.umass.edu From [Kurose/Ross] Networking Basics 45
  46. 46. HTTP overview HTTP: hypertext transfer protocol HT TP r equ Web’s application layer PC running HT est TP protocol Explorer res pon se client/server model ❍ client: browser that st q ue requests, receives, Pr e se Server T on “displays” Web objects HT res p running TP Apache Web ❍ server: Web server HT server sends objects in response to requests Mac running HTTP 1.0: RFC 1945 Navigator HTTP 1.1: RFC 2068 From [Kurose/Ross] Networking Basics 46
  47. 47. HTTP overview (continued) Uses TCP: HTTP is “stateless” client initiates TCP server maintains no connection (creates socket) information about to server, port 80 past client requests server accepts TCP connection from client aside Protocols that maintain HTTP messages (application- “state” are complex! layer protocol messages) past history (state) must exchanged between browser be maintained (HTTP client) and Web if server/client crashes, server (HTTP server) their views of “state” may TCP connection closed be inconsistent, must be reconciled From [Kurose/Ross] Networking Basics 47
  48. 48. HTTP connections Nonpersistent HTTP Persistent HTTP At most one object is Multiple objects can sent over a TCP be sent over single connection. TCP connection HTTP/1.0 uses between client and nonpersistent HTTP server. HTTP/1.1 uses persistent connections in default mode From [Kurose/Ross] Networking Basics 48
  49. 49. HTTP request message two types of HTTP messages: request, response HTTP request message: ❍ ASCII (human-readable format) request line (GET, POST, GET /somedir/page.html HTTP/1.1 HEAD commands) Host: www.someschool.edu User-agent: Mozilla/4.0 header Connection: close lines Accept-language:fr Carriage return, (extra carriage return, line feed) line feed indicates end of message From [Kurose/Ross] Networking Basics 49
  50. 50. HTTP request message: general format From [Kurose/Ross] Networking Basics 50
  51. 51. HTTP response message status line (protocol status code HTTP/1.1 200 OK status phrase) Connection close Date: Thu, 06 Aug 1998 12:00:15 GMT Server: Apache/1.3.0 (Unix) header Last-Modified: Mon, 22 Jun 1998 …... lines Content-Length: 6821 Content-Type: text/html data, e.g., data data data data data ... requested HTML file From [Kurose/Ross] Networking Basics 51
  52. 52. HTTP response status codes In first line in server->client response message. A few sample codes: 200 OK ❍ request succeeded, requested object later in this message 301 Moved Permanently ❍ requested object moved, new location specified later in this message (Location:) 400 Bad Request ❍ request message not understood by server 404 Not Found ❍ requested document not found on this server 505 HTTP Version Not Supported From [Kurose/Ross] Networking Basics 52
  53. 53. Cookies: keeping “state” Many major Web sites Example: use cookies ❍ Susan access Internet Four components: always from same PC ❍ She visits a specific e- 1) cookie header line in commerce site for first the HTTP response time message ❍ When initial HTTP 2) cookie header line in requests arrives at site, HTTP request message site creates a unique ID 3) cookie file kept on and creates an entry in user’s host and managed backend database for by user’s browser ID 4) back-end database at Web site From [Kurose/Ross] Networking Basics 53
  54. 54. Cookies: keeping “state” (cont.) client server Cookie file usual http request msg server e n da try i tab n b usual http response + creates ID as ac e ke ebay: 8734 Set-cookie: 1678 1678 for user nd Cookie file usual http request msg amazon: 1678 cookie: 1678 cookie- ss ebay: 8734 specific ac ce usual http response msg action ss one week later: ce ac usual http request msg Cookie file cookie- cookie: 1678 amazon: 1678 spectific ebay: 8734 usual http response msg action From [Kurose/Ross] Networking Basics 54
  55. 55. Cookies (continued) aside What cookies can bring: Cookies and privacy: authorization cookies permit sites to shopping carts learn a lot about you recommendations you may supply name and e-mail to sites user session state (Web e-mail) search engines use redirection & cookies to learn yet more advertising companies obtain info across sites From [Kurose/Ross] Networking Basics 55
  56. 56. Conditional GET: client-side caching Goal: don’t send object if client server client has up-to-date cached HTTP request msg version If-modified-since: object client: specify date of <date> not cached copy in HTTP request modified If-modified-since: HTTP response HTTP/1.0 <date> 304 Not Modified server: response contains no object if cached copy is up- HTTP request msg to-date: If-modified-since: HTTP/1.0 304 Not <date> object Modified modified HTTP response HTTP/1.0 200 OK <data> From [Kurose/Ross] Networking Basics 56
  57. 57. Web caches (proxy server) Goal: satisfy client request without involving origin server user sets browser: Web origin accesses via cache server browser sends all HTTP HT Proxy TP st requests to cache req server reque HT client TP ues TP se ❍ object in cache: cache res t HT espon returns object pon TPr se HT st else cache requests ue req ❍ object from origin TP se p on HT res server, then returns P TT object to client H client origin server From [Kurose/Ross] Networking Basics 57
  58. 58. More about Web caching Cache acts as both client Why Web caching? and server Reduce response time for Cache can do up-to-date client request. check using If-modified- Reduce traffic on an since HTTP header institution’s access link. ❍ Issue: should cache take risk and deliver cached Internet dense with caches object without checking? enables “poor” content ❍ Heuristics are used. providers to effectively deliver content Typically cache is installed by ISP (university, company, residential ISP) From [Kurose/Ross] Networking Basics 58
  59. 59. More about Web caching Cache acts as both client Why Web caching? and server Reduce response time for Cache can do up-to-date client request. check using If-modified- Reduce traffic on an since HTTP header institution’s access link. ❍ Issue: should cache take risk and deliver cached Internet dense with caches object without checking? enables “poor” content ❍ Heuristics are used. providers to effectively deliver content Typically cache is installed by ISP (university, company, residential ISP) From [Kurose/Ross] Networking Basics 59
  60. 60. Caching example (1) origin Assumptions servers average object size = 100,000 bits public Internet avg. request rate from institution’s browser to origin serves = 15/sec delay from institutional router 1.5 Mbps to any origin server and back access link to router = 2 sec institutional Consequences network 10 Mbps LAN utilization on LAN = 15% ❍ Traffic=100K*15 /sec=1.5Mbps utilization on access link = 100% Very long delay (minutes) institutional ❍ total delay = Internet delay + cache access delay + LAN delay = 2 sec + minutes + milliseconds From [Kurose/Ross] Networking Basics 60
  61. 61. Caching example (2) origin Possible solution servers increase bandwidth of access link to, say, 10 Mbps public Internet Consequences utilization on LAN = 15% utilization on access link = 15% 10 Mbps Total delay = Internet delay + access link access delay + LAN delay institutional = 2 sec + msecs + msecs network but a costly upgrade 10 Mbps LAN institutional cache From [Kurose/Ross] Networking Basics 61
  62. 62. Caching example (3) origin Install cache servers suppose hit rate is .4 public Consequence Internet 40% requests will be satisfied almost immediately 60% requests satisfied by 1.5 Mbps origin server access link utilization of access link institutional reduced to 60%, resulting in network 10 Mbps LAN negligible delays (say 10 msec) total delay = Internet delay + access delay + LAN delay = .6*(2 sec + .01 secs + ms) + institutional 0.4*ms) < 1.3 secs cache From [Kurose/Ross] Networking Basics 62
  63. 63. Content distribution networks (CDNs) origin server in North America The content providers are the CDN customers. Content replication CDN company installs CDN distribution node hundreds of CDN servers throughout Internet ❍ in lower-tier ISPs, close to users CDN replicates its customers’ content in CDN servers. When provider updates CDN server CDN server content, CDN updates in S. America CDN server in Asia servers in Europe From [Kurose/Ross] Networking Basics 63
  64. 64. CDN example HTTP request for www.foo.com/sports/sports.html 1 Origin server 2 DNS query for www.cdn.com CDNs authoritative 3 DNS server HTTP request for www.cdn.com/www.foo.com/sports/ruth.gif Nearby CDN server origin server CDN company www.foo.com cdn.com distributes HTML distributes gif files Replaces: uses its authoritative http://www.foo.com/sports.ruth.gif DNS server to route with redirect requests http://www.cdn.com/www.foo.com/sports/ruth.gif From [Kurose/Ross] Networking Basics 64
  65. 65. More about CDNs routing requests not just Web pages CDN creates a “map”, streaming stored indicating distances audio/video from leaf ISPs and CDN nodes streaming real-time when query arrives at audio/video authoritative DNS ❍ CDN nodes create server: application-layer overlay network ❍ server determines ISP from which query originates ❍ uses “map” to determine best CDN server From [Kurose/Ross] Networking Basics 65
  66. 66. What you should know Generic networks ❍ Two types of services: • connection-oriented and connectionless ❍ Two types of switching (routing) • Circuit switching and packet switching (datagram and VC) • Internet uses datagram packet switching Internet structure and protocol layers ❍ Edges (workstations, servers), core (routers), physical links, coordinated by protocols ❍ Protocol layers of the Internet • Application (HTTP, email), transport (TCP,UDP), network (IP), link, physical Networking Basics 66
  67. 67. What you should know Application layer functionalities and protocols ❍ Client-server model ❍ Makes use of underlying transport protocol How does DNS works? (how does your computer find the IP address of a desired destination?) Web applications ❍ Web browser and server in the client-server model ❍ HTTP (uses TCP, stateless, request and response) • Pros and cons of using “cookies” • Why using client-side caching? What are the trade-offs when determining the cache size? ❍ Why using a Proxy server? ❍ Why would a content provider use a CDN? Networking Basics 67

×