Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 2, slide: 1 ECE/CS 372 – introduction to computer networks Lecture 5 Announcements: r Lab1 is due today r Lab2 is posted and is due next Tuesday.

Similar presentations


Presentation on theme: "Chapter 2, slide: 1 ECE/CS 372 – introduction to computer networks Lecture 5 Announcements: r Lab1 is due today r Lab2 is posted and is due next Tuesday."— Presentation transcript:

1 Chapter 2, slide: 1 ECE/CS 372 – introduction to computer networks Lecture 5 Announcements: r Lab1 is due today r Lab2 is posted and is due next Tuesday Acknowledgement: slides drawn heavily from Kurose & Ross

2 Chapter 2, slide: 2 Chapter 1: recap By now, you should know: r the Internet and its components r circuit-switching networks vs. packet-switching networks r different network access technologies r the three Tiers 1, 2, and 3 r layered architecture of networks r types of delays and throughput analysis

3 Chapter 2, slide: 3 Chapter 2: Application Layer Our goals: r aspects of network application protocols  transport-layer service models  client-server paradigm  peer-to-peer paradigm r learn about protocols by examining popular application-level protocol: HTTP

4 Chapter 2, slide: 4 Some network apps r e-mail r web r instant messaging r remote login r P2P file sharing r multi-user network games r streaming stored video clips r voice over IP r real-time video conferencing r grid computing

5 Chapter 2, slide: 5 Creating a network app write programs that  run on (different) end systems  communicate over network  e.g., web server software communicates with browser software little software written for devices in network core  network core devices do not run user applications

6 Chapter 2, slide: 6 Chapter 2: Application layer r Principles of network applications  app architectures  app requirements r Web and HTTP r P2P file sharing

7 Chapter 2, slide: 7 Application architectures There are 3 types of architectures: r Client-server r Peer-to-peer (P2P) r Hybrid of client-server and P2P

8 Chapter 2, slide: 8 Client-server architecture server:  always-on  fixed/known IP address  serves many clients at same time clients:  communicate with server only  may be intermittently connected  may have dynamic IP addresses  do not communicate directly with each other E.g., of client-server archit.:  Google, Amazon, MySpace, YouTube,

9 Chapter 2, slide: 9 Pure P2P architecture r no always-on server r arbitrary end systems directly communicate r peers are intermittently connected and change IP addresses r example: BitTorrent Pros and cons: r scalable and distributive r difficult to manage r not secure peer-peer

10 Chapter 2, slide: 10 Hybrid of client-server and P2P Skype  voice-over-IP P2P application  centralized server: finding address of remote party  client-client connection: direct (not through server) Instant messaging  chatting between two users is P2P  centralized service: client presence location user registers its IP address with central server when it comes online user contacts central server to find IP addresses of buddies

11 Chapter 2, slide: 11 Processes communicating Process: is program running within a host. r processes in same host communicate using inter-process communication (managed by OS). r processes in different hosts communicate by exchanging messages Client process: process that initiates communication Server process: process that waits to be contacted r Note: applications with P2P architectures have client processes & server processes

12 Chapter 2, slide: 12 Sockets r process sends/receives messages to/from its socket r socket analogous to door  sending process shoves message out door  sending process relies on transport infrastructure on other side of door which brings message to socket at receiving process controlled by OS process TCP with buffers, variables socket host or server process TCP with buffers, variables socket host or server Internet controlled by app developer r App Program Interface (API): (1) choice of transport protocol; (2) ability to fix a few parameters

13 Chapter 2, slide: 13 Addressing processes r to receive messages, process must have identifier r host device has unique 32-bit IP address r Q: does IP address of host on which process runs suffice to identify the process? r identifier consists of:  IP address (host)  port numbers (process) r Example port numbers:  HTTP server: 80  Mail server: 25 r to send HTTP message to gaia.cs.umass.edu web server:  IP address: 128.119.245.12  Port number: 80 r more shortly… r A: No, many processes can be running on same host

14 Chapter 2, slide: 14 App-layer protocol defines r Types of messages exchanged,  e.g., request, response r Message syntax:  what fields in messages & how fields are delineated r Message semantics  meaning of information in fields r Rules for when and how processes send & respond to messages Public-domain protocols: r defined in RFCs r allows for interoperability r e.g., HTTP, SMTP Proprietary protocols: r e.g., Skype Question: why do we need an “App-layer protocol” ?

15 Chapter 2, slide: 15 What transport service does an app need? Data loss/reliability r some apps (e.g., audio) can tolerate some loss r other apps (e.g., file transfer, telnet) require 100% reliable data transfer Timing r some apps (e.g., Internet telephony, interactive games) require low delay to be “effective” Bandwidth r some apps (e.g., multimedia) require minimum amount of bandwidth to be “effective” r other apps (“elastic apps”) make use of whatever bandwidth they get Security r what about it !!!

16 Chapter 2, slide: 16 Transport service requirements of common apps Application file transfer e-mail Web documents real-time audio/video stored audio/video interactive games instant messaging Data loss no loss loss-tolerant no loss Bandwidth elastic audio: 5kbps-1Mbps video:10kbps-5Mbps same as above few kbps up elastic Time Sensitive no yes, 100’s msec yes, few secs yes, 100’s msec yes and no

17 Chapter 2, slide: 17 What services do Internet transport protocols provide? TCP service: r connection-oriented: setup required between client and server processes r reliable transport between sending and receiving process r flow control: sender won’t overwhelm receiver r congestion control: throttle sender when network overloaded r does not provide: timing, minimum bandwidth guarantees UDP service: r unreliable data transfer between sending and receiving process r does not provide: connection setup, reliability, flow control, congestion control, timing, or bandwidth guarantee Q: why bother? Why is there a UDP?

18 Chapter 2, slide: 18 Internet apps: application, transport protocols Application e-mail remote terminal access Web file transfer streaming multimedia Internet telephony Application layer protocol SMTP [RFC 2821] Telnet [RFC 854] HTTP [RFC 2616] FTP [RFC 959] proprietary (e.g. RealNetworks) proprietary (e.g., Vonage, Skype) Underlying transport protocol TCP TCP or UDP typically UDP

19 Chapter 2, slide: 19 Chapter 2: Application layer r Principles of network applications  app architectures  app requirements r Web and HTTP r P2P file sharing

20 Chapter 2, slide: 20 Web and HTTP First some terminologies: r Web page consists of objects r Object can be HTML file, JPEG image, Java applet, audio file,… r Web page consists of base HTML-file which includes several referenced objects r Each object is addressable by a URL r Example URL (Uniform Resource Locator): www.someschool.edu/someDept/pic.gif host name path name

21 Chapter 2, slide: 21 HTTP overview: app architecture HTTP: hypertext transfer protocol r Web’s appl-layer protocol r client/server model  client: browser that requests, receives, “displays” Web objects  server: Web server sends objects in response to requests r HTTP 1.0: RFC 1945 r HTTP 1.1: RFC 2068 PC running Explorer Server running Apache Web server Mac running Navigator HTTP request HTTP response

22 Chapter 2, slide: 22 HTTP overview (continued) Uses TCP: r client initiates TCP connection (creates socket) to server, port 80 r server accepts TCP connection from client r HTTP messages exchanged between browser (HTTP client) and Web server (HTTP server) r TCP connection closed HTTP is “stateless” r server maintains no information about past client requests Protocols that maintain “state” are complex! r past history (state) must be maintained r if server/client crashes, their views of “state” may be inconsistent, must be reconciled aside

23 Chapter 2, slide: 23 HTTP connections Nonpersistent HTTP r At most one object is sent over a TCP connection. r HTTP/1.0 uses nonpersistent HTTP Persistent HTTP r Multiple objects can be sent over single TCP connection between client and server. r HTTP/1.1 uses persistent connections in default mode

24 Chapter 2, slide: 24 Nonpersistent HTTP Suppose user enters URL www.someSchool.edu/someDepartment/home.index 1a. HTTP client initiates TCP connection to HTTP server (process) at www.someSchool.edu on port 80 2. HTTP client sends HTTP request message (containing URL) into TCP connection socket. Message indicates that client wants object someDepartment/home.index 1b. HTTP server at host www.someSchool.edu waiting for TCP connection at port 80. “accepts” connection, notifying client 3. HTTP server receives request message, forms response message containing requested object, and sends message into its socket time (contains text, references to 10 jpeg images)

25 Chapter 2, slide: 25 Nonpersistent HTTP (cont.) 5. HTTP client receives response message containing html file, displays html. Parsing html file, finds 10 referenced jpeg objects 6. Steps 1-5 repeated for each of 10 jpeg objects 4. HTTP server closes TCP connection. time

26 Chapter 2, slide: 26 Non-Persistent HTTP: Response time Definition of RTT (round trip time): time to send a small packet to travel from client to server and back. Response time: r one RTT to initiate TCP connection r one RTT for HTTP request and first few bytes of HTTP response to return r file transmission time = 2RTT + transmit time time to transmit file initiate TCP connection RTT request file RTT file received time

27 Chapter 2, slide: 27 Non-Persistent HTTP: issues time to transmit file initiate TCP connection RTT request file RTT file received time Nonpersistent HTTP: r Name some issues?? r requires 2 RTTs per object r E.g., a 10-object page needs ~ 20 RTTs r Open/close TCP connection for each object => OS overhead r Any ideas for improvement?

28 Chapter 2, slide: 28 Persistent HTTP r server leaves connection open after sending response r subsequent HTTP messages between same client/server sent over open connection r reduces response time Persistent without pipelining: r client issues new request only when previous response has been received r one RTT for each referenced object Persistent with pipelining: r default in HTTP/1.1 r client sends requests as soon as it encounters a referenced object r as little as one RTT for all the referenced objects

29 Chapter 2, slide: 29 time to transmit file initiate TCP connection RTT request file RTT file received time r A HTTP request consists of:  1 basic html object  2 referenced JPEG objects  Each object is of size = 10 6 bits r RTT = 1 second r Transmission rate = 1Mbps r Consider transmission delay of objects only r Question: how long it takes to receive the entire page: a) Non-persistent connection b) Persistent without pipelining c) Persistent with pipelining Web and HTTP: Review Question

30 Chapter 2, slide: 30 time to transmit file initiate TCP connection RTT request file RTT file received time r A HTTP request consists of:  1 basic html object  2 referenced JPEG objects  Each object is of size = 10 6 bits r RTT = 1 second r Transmission rate = 1Mbps r Consider transmission delay of objects only r Answer: (transmit time = 1 sec) a) 3+3+3=9 sec ( initiate + request + transmit) for each of all 3 b) 1+2+2+2=7 sec initiate + (request + transmit) for each of all 3 c) 1+2+3=6 sec initiate + (request + transmit for basic) + (one request for 2 + two transmits, one for each of the 2 objects) Web and HTTP: Review Question

31 Chapter 2, slide: 31 ECE/CS 372 – introduction to computer networks Lecture 6 Announcements: r Lab2 is due next Tuesday Acknowledgement: slides drawn heavily from Kurose & Ross

32 Chapter 2, slide: 32 Web caches (or proxy server) r If page is needed, browser requests it from the Web cache r Q: what if object not in cache?? cache requests object from origin server, then returns object to client Goal: satisfy client request without involving origin server client Proxy server client HTTP request HTTP response HTTP request origin server origin server HTTP response

33 Chapter 2, slide: 33 More about Web caching r cache acts as both client and server r typically cache is installed by ISP (university, company, residential ISP) Why Web caching? r reduce response time for client request r reduce traffic on an institution’s access link.

34 Chapter 2, slide: 34 Caching example Assumptions r avg. object size = 0.1x10 6 bits r avg. request rate from institution to origin servers = 10/sec r Internet delay = 2 sec Consequences r utilization on LAN = 10% (LAN: local area network) r utilization on access link = 100% r total delay = Internet delay + access delay + LAN delay = 2 sec + sec + milliseconds unacceptable delay! origin servers public Internet institutional network 10 Mbps LAN 1 Mbps access link institutional cache

35 Chapter 2, slide: 35 Caching example (cont) possible solution r increase bandwidth of access link to, say, 10 Mbps consequence r utilization on LAN = 10% r utilization on access link = 10% r Total delay = Internet delay + access delay + LAN delay = 2 sec + msecs + msecs r often a costly upgrade r total delay still dominated by Internet delay origin servers public Internet institutional network 10 Mbps LAN 10 Mbps access link institutional cache

36 Chapter 2, slide: 36 Caching example (cont) 2 nd possible sol: web cache r suppose hit rate is 0.4 (typically, between 0.3 & 0.7) consequence r 40% requests will be satisfied almost immediately and 60% requests satisfied by origin server r utilization of access link reduced by 40%, giving an access delay in the order of milliseconds; say 10 millisec origin servers public Internet institutional network 10 Mbps LAN 1 Mbps access link institutional cache r Total delay = 0.4x(0.1) (LAN) + 0.6x(0.1+0.1+2) (LAN + access + Internet) = (about) 1.3 second r total avg delay reduced by about 40%

37 Chapter 2, slide: 37 Web cache (cont) Advantages are obvious: r Reduce response time r Reduce internet traffic Any problems with caches?? r Local cache copies of web pages may not be up-to-date?? r What do we do then? Solution r Upon receiving a web request, a cache must consult origin server to check whether the requested page is up-to- date r Conditional GET method  What: Sent by cache to origin server: check page status  When: For each new request: client checks with cache

38 Chapter 2, slide: 38 Conditional GET r Goal: don’t send object if cache has up-to-date version r How: cache specifies date of cached copy in HTTP request If-modified-since: r Server: response contains no object if cached copy is up-to- date: HTTP/1.0 304 Not Modified cache server HTTP request msg If-modified- since: HTTP response HTTP/1.0 304 Not Modified object not modified HTTP request msg If-modified- since: HTTP response HTTP/1.0 200 OK object modified

39 Chapter 2, slide: 39 Chapter 2: Application layer r Principles of network applications  app architectures  app requirements r Web and HTTP r P2P file sharing

40 Chapter 2, slide: 40 File sharing approaches There are 2 approaches r Centralized: Client-server architecture r Distributed: P2P architecture (e.g., BitTorrent) obtain list of peers trading chunks peer server peers Alice Bob

41 Chapter 2, slide: 41 File sharing: P2P vs. client-server architectures Robustness to failure Scalability Security Performance Client-Server Single point of failure Not scalable More secure Bottleneck P2P Fault-tolerant Scalable Less secure Better

42 Chapter 2, slide: 42 Comparing Client-Server, P2P architectures Question : What is the file distribution time: from one server to N hosts? usus u2u2 d1d1 d2d2 u1u1 uNuN dNdN Server Network (with abundant bandwidth) File, size F u s : server upload bandwidth u i : client/peer i upload bandwidth d i : client/peer i download bandwidth

43 Chapter 2, slide: 43 Client-server: file distribution time usus u2u2 d1d1 d2d2 u1u1 uNuN dNdN Server Network (with abundant bandwidth) F r server sequentially sends N copies:  NF/u s time r client i takes F/d i time to download = d cs > max { NF/u s, F/min(d i ) } i Time to distribute F to N clients using client/server approach increases linearly in N (for large N)

44 Chapter 2, slide: 44 Client-server: file distribution time d cs = max { NF/u s, F/min(d i ) } i  We now show that the distribution time is actually equal to max{NF/u s, F/min(d i ) } r See board notes

45 uNuN r NF bits must be downloaded - NF bits must be uploaded - Fastest possible upload rate (assuming all nodes sending file chunks to same peer) is: u s +  u i Chapter 2, slide: 45 P2P: file distribution time usus u2u2 d1d1 d2d2 u1u1 dNdN Server Network (with abundant bandwidth) F r server must send one copy: F/u s time r client i takes F/d i time to download i=1,N d P2P > max { F/u s, F/min(d i ), NF/(u s +  u i) } i=1,N

46 Chapter 2, slide: 46 Comparing Client-server, P2P architectures

47 Chapter 2, slide: 47 Chapter 2: Summary r application architectures  client-server, P2P r application service requirements:  reliability, bandwidth, delay r Web and HTTP  Non-Persistent, persistent, web cache r Distribution time  Client-server, P2P We covered general concepts, like:


Download ppt "Chapter 2, slide: 1 ECE/CS 372 – introduction to computer networks Lecture 5 Announcements: r Lab1 is due today r Lab2 is posted and is due next Tuesday."

Similar presentations


Ads by Google