This action might not be possible to undo. Are you sure you want to continue?
Chapter 6: Application Layer
ECE 610 – Winter 2013
Dr. Mohamed Mahmoud
6.1 Introduction 6.2 Web and HTTP 6.3 FTP 6.4 Electronic Mail 6.5 DNS 6.6 P2P applications
- Application layer: Communicating distributed processes - Running in network hosts in “user space” - Exchange messages to implement applications, e.g., email, file transfer, the Web - Application-layer protocols use communication services provided by lower layer. -Application-layer protocols define: 1- Types of messages exchanged: e.g., request, response 2- Message syntax: what fields in messages & how fields are delineated 3- Message semantics: meaning of information in fields
application transport network data link physical application transport network data link physical
application transport network data link physical
Rules for when and how processes send & respond to messages and actions taken.Peer-to-peer (P2P) 3.Streaming audio/video: media player Application architectures 1.Web: browser . .Client-server 2.E-mail: mail reader .A user agent is an interface between the user and the network application. .Hybrid of client-server and P2P 2-4 6-2 .4.
Always-on host .May have dynamic IP addresses 6-3 . Web server sends requested Web page. mail server client/server delivers e-mail Client: .Client-server architecture Server: .Permanent IP address .Typically requests service from server .Respond to requests from clients by providing requested service.g.. e.Initiates contact with server (“speaks first”) .1.
Arbitrary end systems directly communicate .Highly scalable .Peers request service from other peers.Peers are intermittently connected and change IP addresses peer-peer 2-6 6-4 .2.But difficult to manage .P2P architecture . provide service in return to other peers .
Peers inquiry same central server to locate content .User contacts central server to find IP addresses of buddies 6-5 .3.Peers register content at central server .File search centralized: .Chatting between two users is P2P .User registers its IP address with central server when it comes online .Napster .Instant messaging .File transfer P2P .Hybrid of client-server and P2P .Presence detection/location centralized: .
interactive games) require low delay to be “effective” .. audio) can tolerate some loss Timing .g.Encryption. Other apps (“elastic apps”) make use of whatever throughput they get .Throughput .Some applications (e.Some apps (e. Internet telephony. multimedia) require minimum amount of throughput to be “effective”.g. web transactions) require 100% reliable data transfer .g. file transfer.Some apps (e.Other apps (e.Security ...What transport service does an application need? Reliable data tarnsfer .. data integrity. … 6-6 .g.
Transport service requirements of common apps Application file transfer e-mail Web documents real-time audio/video stored audio/video interactive games financial apps Data loss no loss no loss loss-tolerant loss-tolerant loss-tolerant loss-tolerant no loss Bandwidth elastic elastic elastic audio: 5Kb-1Mb video:10Kb-5Mb same as above few Kbps up elastic Time Sensitive no no no yes. 100’s msec yes. few secs yes. 100’s msec yes and no 6-7 .
Congestion control .Internet transport protocols services TCP service: . throughput guarantee. security .Flow control .Reliable transport between sending and receiving process .Does not provide: timing. timing. congestion control.Unreliable data transfer between sending and receiving processes . security. or connection setup 6-8 . flow control.Connection-oriented: setup required between client and server processes 2-10 UDP service: . minimum throughput guarantee.Does not provide: reliability.
.g.Internet apps: their protocols and transport protocols Application e-mail remote terminal access Web file transfer streaming multimedia remote file server Internet telephony Application layer protocol smtp [RFC 821] telnet [RFC 854] http [RFC 2068] ftp [RFC 959] proprietary (e.g. RealNetworks) NSF proprietary (e. Vocaltec) Underlying transport protocol TCP TCP TCP TCP TCP or UDP TCP or UDP typically UDP 6-9 .
Outline 6.1 Introduction 6.5 DNS 6.3 FTP 6.4 Electronic Mail 6.2 Web and HTTP 6.6 P2P applications .
g.10 . http://ece. 6 . and other information located on a web page at a web server. audio.… . Java applet.uwaterloo. audio file. e..HTTP is used across the World Wide Web for data transfer and is one of the most used application protocols .What is a Web Browser: A software application that enables a user to display and interact with html..Web page consists of base HTML-file which includes several referenced objects .jpg Protocol host name File path on host .Each object is addressable by a URL.ca/~mmabdels/Data/photo. text. images.Object can be JPEG image.
2-14 port 80 6 .Client/server model . receives.HTTP: hypertext transfer protocol . (using HTTP protocol) and “displays” Web objects .Web’s application layer protocol .HTTP uses TCP .Client initiates TCP connection (creates socket) to server.11 PC running Firefox browser server running Apache Web server iphone running Safari browser .Server: Web server sends (using HTTP protocol) objects in response to requests .Client: browser that requests.HTTP overview .
TCP connection closed HTTP connections 1.1 in default mode 6 . Used by HTTP/1.0 2.HTTP messages (application-layer protocol messages) exchanged between browser (HTTP client) and Web server (HTTP server) .Nonpersistent HTTP: At most one object is sent over a TCP connection..12 .Server accepts TCP connection from client .Persistent HTTP: Multiple objects can be sent over single TCP connection between client and server. Used by HTTP/1.
HTTP client initiates TCP connection to HTTP server (process) at www. references to 10 jpeg images) 1b.index (the base file) time 3.someSchool. and sends message into its socket 6 . HTTP server at host www.edu waiting for TCP connection at port 80.index 1a. forms response message containing requested object. notifying client 2.someSchool.Nonpersistent HTTP Suppose user enters URL www. HTTP client sends HTTP request message (containing URL) into TCP connection socket.1. Message indicates that client wants object someDepartment/home. HTTP server receives request message.someSchool.13 . “accepts” connection.edu on port 80 (contains text.edu/someDepartment/home.
Client requests one object on each connection. finds 10 referenced jpeg objects time 4. HTTP server closes TCP connection. .Client creates several TCP connections with the server(s) simultaneously (parallel TCP connections) . Steps 1-5 repeated for each of 10 jpeg objects . 6 .14 .OS must work and allocate host resources for each TCP connection . Parsing html file. displays html.Each TCP connection is terminated when the requested object is retrieved. 6.5. HTTP client receives response message containing html file.
15 . 6 .An example of a nonpersistent connection: The client needs to access a file that contains two links to images..
.One RTT for HTTP request and first few bytes of HTTP response to return .File transmission time initiate TCP connection RTT Request file RTT File received time to transmit file time time Total response time to fetch one object = 2RTT + transmit time 6 .16 .Definition of RTT: time for a small packet to travel from client to server and back.Response time: .Non-Persistent HTTP: Response time .One RTT to initiate TCP connection .
2.17 .An example of a persistent connection: The client needs to access a file that contains two links to images. 6 .Persistent HTTP .
6 .Client sends new request only when previous response has been received .default in HTTP/1. a total of 3 RTTs Fewer RTTs and less slow start.server leaves connection open after sending response .18 .One RTT for each referenced object..As little as one RTT for all the referenced objects.1 .Persistent with pipelining: . .Persistent without pipelining: .Client sends requests for all referenced objects as soon as it receives base HTML.Persistent HTTP . see slide 6-17 2.e. i.Subsequent HTTP messages between same client/server are sent over connection 1.
Request first object 2.Tenth second object First object received Tenth object received time 10 2 1 time to transmit base file time to transmit first object Response Time ≈ 3RTT+ files’ transmit time 6 .Persistent HTTP With Pipeline initiate TCP connection RTT Request base (html) file RTT Base file received 1.Request second object … 10.19 .
20 .HTTP request message Format of the request message 2-23 6 .
5\r\n Accept-Encoding: gzip. HEAD commands) header lines carriage return.html HTTP/1.edu\r\n User-Agent: Firefox/3. POST.cs.1\r\n Host: www-net.Example: request line (GET.10\r\n Accept: text/html.application/xhtml+xml\r\n Accept-Language: en-us.en. line feed at start of line indicates end of header lines carriage return character line-feed character GET /index.21 .q=0.umass.6.utf-8.7\r\n Keep-Alive: 115\r\n Connection: keep-alive\r\n \r\n 6 .q=0.deflate\r\n Accept-Charset: ISO-8859-1.
when user has filled out a form and sending information to the server Example: words in a search engine 6 .Methods HTTP Methods Head Post read information about the web page but not the page itself send information from client to server .22 send a webpage and objects from the server to the client Put .
23 .HTTP Message Headers 6 .
Web page often includes form input .Post method: .somesite.Uses GET method .cgi?firstname=morteza&las tnme=analoui 6 .URL method: .24 .com/cgi.Input is uploaded to server in entity body 2.somesite.bin/form.Uploading form input 1.com/animalsearch?monkeys&banana www.Input is uploaded in URL field of request line: www.
HTTP response message Format of the response message 6 .25 .
26 . requested HTML file 2-29 HTTP/1. 6 .52 (CentOS)\r\n Last-Modified: Tue.. charset=ISO-88591\r\n \r\n data data data data data .g.. max=100\r\n Connection: Keep-Alive\r\n Content-Type: text/html. e..0.1 200 OK\r\n Date: Sun.Example: status line (protocol status code status phrase) header lines data. 30 Oct 2007 17:00:02 GMT\r\n ETag: "17dc6-a5c-bf716880"\r\n Accept-Ranges: bytes\r\n Content-Length: 2652\r\n Keep-Alive: timeout=10. 26 Sep 2010 20:09:20 GMT\r\n Server: Apache/2.
requested object later in this message 301 Moved Permanently requested object moved.HTTP response status codes some sample codes: 200 OK request succeeded. 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 2-30 HTTP Version Not Supported 6 .27 .
28 . . and length of the document.1). 6 . .The response message contains the status line and four lines of header.The example (shown on slide 6-29) retrieves a document. . MIME version. . and the HTTP version (1. .The header lines define the date. .The header has two lines that show that the client can accept images in GIF and JPEG format. server.The request line shows the method (GET). .The body of the document follows the header.The request does not have a body. the URL.Example 1 .We use the GET method to retrieve an image with the path /usr/bin/image1.
29 .32 6 .
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue reading from where you left off, or restart the preview.