Presentation is loading. Please wait.

Presentation is loading. Please wait.

2: Application Layer1 Chapter 2 outline r 2.1 Principles of app layer protocols r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail r 2.5 DNS r 2.6 Socket.

Similar presentations


Presentation on theme: "2: Application Layer1 Chapter 2 outline r 2.1 Principles of app layer protocols r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail r 2.5 DNS r 2.6 Socket."— Presentation transcript:

1 2: Application Layer1 Chapter 2 outline r 2.1 Principles of app layer protocols r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail r 2.5 DNS r 2.6 Socket programming with TCP r 2.7 Socket programming with UDP r 2.8 Building a Web server r 2.9 Content distribution m Network Web caching m Content distribution networks m P2P file sharing

2 2: Application Layer2 Web caching: broader r Client-side caching m Browser cache (in disks) m Proxies (hosts) r Server-side caching m Buffer (in memory) m Reverse proxies (hosts) r In-network caching m CDN, it is caches to some extent

3 2: Application Layer3 Web caching: client-side proxies r user sets browser: Web accesses via proxy r browser sends all HTTP requests to proxy m object in cache: proxy returns object m else proxy requests object from origin server, then returns object to client Goal: satisfy client request without involving origin servers client Proxy server client HTTP request HTTP response HTTP request HTTP response origin server origin server

4 2: Application Layer4 More about caching proxies r proxy acts as both client and server  proxy can do up-to-date check using If-modified- since HTTP header m Issue: should proxy take risk and deliver cached object without checking? m Heuristics are used. r Typically proxy is installed by ISP (university, company, residential ISP) Why caching proxies? r Reduce response time for client request. r Reduce traffic on an institution’s access link. r Internet dense with caches enables “poor” content providers to effectively deliver content. r Improve quality of service, especially for bandwidth- demanding applications.

5 2: Application Layer5 Caching example (1) Assumptions r average object size = 100,000 bits (many objects) r avg. request rate from institution’s browser to origin serves = 15/sec r delay from institutional router to any origin server and back to router = 1 sec Consequences r utilization on LAN = 15% r utilization on access link = 100% r total delay = Internet delay + access delay + LAN delay = 1 sec + minutes + milliseconds origin servers public Internet institutional network 10 Mbps LAN 1.5 Mbps access link institutional cache

6 2: Application Layer6 Caching example (2) Possible solution r increase bandwidth of access link to, say, 10 Mbps Consequences r utilization on LAN = 15% r utilization on access link = 15% r Total delay = Internet delay + access delay + LAN delay = 1 sec + msecs + msecs r often a costly upgrade origin servers public Internet institutional network 10 Mbps LAN 10 Mbps access link institutional cache

7 2: Application Layer7 Caching example (3) Install cache r suppose hit rate is 40% Consequence r 40% requests will be satisfied almost immediately r 60% requests satisfied by origin server r utilization of access link reduced to 60%, resulting in negligible delays (say 10 msec) r total delay = Internet delay + access delay + LAN delay = 60%*1 sec + 60%*10 msec + milliseconds ~ 0.66 secs origin servers public Internet institutional network 10 Mbps LAN 1.5 Mbps access link institutional cache

8 2: Application Layer8 CDNs: Content distribution networks r The content providers are the CDN customers. m CNN provides service to you; Akamai provides service to CNN. Content replication r CDN company installs hundreds of CDN servers throughout Internet m in lower-tier ISPs, close to users r CDN replicates its customers’ content in CDN servers. When provider updates content, CDN updates servers r CDN servers are caches! origin server in North America CDN distribution node CDN server in S. America CDN server in Europe CDN server in Asia

9 2: Application Layer9 CDN example origin server r www.foo.com r delivers HTML r Replaces: http://www.foo.com/sports/ruth.gif with http://www.cdn.com/www.foo.com/sports/ruth.gif HTTP request for www.foo.com/sports/sports.html DNS query for www.cdn.com HTTP request for www.cdn.com/www.foo.com/sports/ruth.gif 1 2 3 Origin server CDNs authoritative DNS server Nearby CDN server CDN company r cdn.com r delivers gif files r uses its authoritative DNS server to route redirect requests

10 2: Application Layer10 More about CDNs routing requests r CDN creates a “map”, indicating distances from leaf ISPs and CDN nodes r when query arrives at authoritative DNS server: m server determines ISP from which query originates m uses “map” to determine best CDN server not just Web pages r streaming stored audio/video r streaming real-time audio/video m CDN nodes create application-layer overlay network

11 2: Application Layer11 P2P file sharing Example r Alice runs P2P client application on her notebook r Intermittently connects to the Internet; gets new IP address for each connection r Asks for “American life” r Application displays other peers that have copy of “American life”. r Alice chooses one of the peers, Bob. r File is copied from Bob’s PC to Alice’s notebook: HTTP r While Alice downloads, other users uploading from Alice. r Alice’s peer is both a Web client and a transient Web server. All peers are servers = highly scalable!

12 2: Application Layer12 P2P: centralized directory original “Napster” design 1) when peer connects, it informs central server: m IP address m content 2) Alice queries for music 3) Alice requests file from Bob Decentralized file transfer; Centralized content locating centralized directory server peers Alice Bob 1 1 1 1 2 3 Problems r Single point of failure r Performance bottleneck r Copyright infringement

13 2: Application Layer13 P2P: decentralized directory r Each peer is either a group leader or assigned to a group leader. r Group leader tracks the content in all its children. r Peer queries group leader; group leader may query other group leaders. Hierarchical Ordinary peer Group-leader peer Neighboring relationships in overlay network

14 2: Application Layer14 P2P: decentralized directory (more) overlay network r peers are nodes r edges between peers and their group leaders r edges between some pairs of group leaders r virtual neighbors bootstrap node r connecting peer is either assigned to a group leader or designated as a leader advantages of approach r no centralized directory server m location service distributed over peers m more difficult to shut down disadvantages of approach r bootstrap node needed r group leaders can get overloaded

15 2: Application Layer15 P2P: Query flooding r Gnutella r no hierarchy r use bootstrap node to learn about others r join message r Send query to neighbors r Neighbors forward query r If queried peer has object, it sends message back to querying peer join

16 2: Application Layer16 P2P: Query flooding (more) Pros r peers have similar responsibilities: no group leaders r highly decentralized r no peer maintains directory info Cons r excessive query traffic r query radius: may not have content when present r bootstrap node r maintenance of overlay network


Download ppt "2: Application Layer1 Chapter 2 outline r 2.1 Principles of app layer protocols r 2.2 Web and HTTP r 2.3 FTP r 2.4 Electronic Mail r 2.5 DNS r 2.6 Socket."

Similar presentations


Ads by Google