Beruflich Dokumente
Kultur Dokumente
Outline
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
6-1
4- Rules for when and how processes send & respond to messages and actions taken. - A user agent is an interface between the user and the network application. - Web: browser - E-mail: mail reader - Streaming audio/video: media player
Application architectures
1- Client-server 2- Peer-to-peer (P2P) 3- Hybrid of client-server and P2P
2-4
6-2
1- Client-server architecture
Server: - Always-on host - Permanent IP address - Respond to requests from clients by providing requested service, e.g., Web server sends requested Web page, mail server client/server delivers e-mail Client: - Initiates contact with server (speaks first) - Typically requests service from server - May have dynamic IP addresses
6-3
2- P2P architecture
- Arbitrary end systems directly communicate - Peers request service from other peers, provide service in return to other peers - Highly scalable - But difficult to manage - Peers are intermittently connected and change IP addresses
peer-peer
2-6 6-4
Application file transfer e-mail Web documents real-time audio/video stored audio/video interactive games financial apps
Bandwidth elastic elastic elastic audio: 5Kb-1Mb video:10Kb-5Mb same as above few Kbps up elastic
Time Sensitive no no no yes, 100s msec yes, few secs yes, 100s msec yes and no
6-7
UDP service: - Unreliable data transfer between sending and receiving processes - Does not provide: reliability, flow control, congestion control, timing, throughput guarantee, security, or connection setup
6-8
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.g., Vocaltec)
Underlying transport protocol TCP TCP TCP TCP TCP or UDP TCP or UDP typically UDP
6-9
Outline
6.1 Introduction 6.2 Web and HTTP 6.3 FTP 6.4 Electronic Mail 6.5 DNS 6.6 P2P applications
- Web page consists of base HTML-file which includes several referenced objects - Object can be JPEG image, Java applet, audio file, - Each object is addressable by a URL, e.g.,
http://ece.uwaterloo.ca/~mmabdels/Data/photo.jpg
Protocol host name File path on host
- 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, text, images, audio, and other information located on a web page at a web server.
6 - 10
HTTP overview
- HTTP: hypertext transfer protocol - Webs application layer protocol - Client/server model - Client: browser that requests, receives, (using HTTP protocol) and displays Web objects - Server: Web server sends (using HTTP protocol) objects in response to requests - HTTP uses TCP - Client initiates TCP connection (creates socket) to server, 2-14 port 80 6 - 11
PC running Firefox browser
- Server accepts TCP connection from client - HTTP messages (application-layer protocol messages) exchanged between browser (HTTP client) and Web server (HTTP server) - TCP connection closed
HTTP connections
1- Nonpersistent HTTP: At most one object is sent over a TCP connection. Used by HTTP/1.0 2- Persistent HTTP: Multiple objects can be sent over single TCP connection between client and server. Used by HTTP/1.1 in default mode
6 - 12
1- 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 (contains text, references to 10 jpeg images)
6 - 13
5. HTTP client receives response message containing html file, displays html. Parsing html file, finds 10 referenced jpeg objects
time
6 - 14
- An example of a nonpersistent connection: The client needs to access a file that contains two links to images. 6 - 15
time
time
2- Persistent HTTP
- An example of a persistent connection: The client needs to access a file that contains two links to images. 6 - 17
Persistent HTTP - server leaves connection open after sending response - Subsequent HTTP messages between same client/server are sent over connection 1- Persistent without pipelining: - Client sends new request only when previous response has been received - One RTT for each referenced object, see slide 6-17 2- Persistent with pipelining: - default in HTTP/1.1 - Client sends requests for all referenced objects as soon as it receives base HTML. - As little as one RTT for all the referenced objects, i.e., a total of 3 RTTs Fewer RTTs and less slow start.
6 - 18
initiate TCP connection RTT Request base (html) file RTT Base file received 1- Request first object 2- Request second object 10- Tenth second object First object received Tenth object received time
10 2 1
2-23
6 - 20
Example:
request line (GET, POST, HEAD commands) header lines carriage return, line feed at start of line indicates end of header lines
GET /index.html HTTP/1.1\r\n Host: www-net.cs.umass.edu\r\n User-Agent: Firefox/3.6.10\r\n Accept: text/html,application/xhtml+xml\r\n Accept-Language: en-us,en;q=0.5\r\n Accept-Encoding: gzip,deflate\r\n Accept-Charset: ISO-8859-1,utf-8;q=0.7\r\n Keep-Alive: 115\r\n Connection: keep-alive\r\n \r\n
6 - 21
Methods
HTTP Methods
Head Post
read information about the web page but not the page itself send information from client to server - when user has filled out a form and sending information to the server Example: words in a search engine 6 - 22 send a webpage and objects from the server to the client
Put
6 - 23
6 - 24
6 - 25
Example:
status line (protocol status code status phrase)
header lines
HTTP/1.1 200 OK\r\n Date: Sun, 26 Sep 2010 20:09:20 GMT\r\n Server: Apache/2.0.52 (CentOS)\r\n Last-Modified: Tue, 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, max=100\r\n Connection: Keep-Alive\r\n Content-Type: text/html; charset=ISO-88591\r\n \r\n data data data data data ...
6 - 26
Example 1 - The example (shown on slide 6-29) retrieves a document. - We use the GET method to retrieve an image with the path /usr/bin/image1. - The request line shows the method (GET), the URL, and the HTTP version (1.1). - The header has two lines that show that the client can accept images in GIF and JPEG format. - The request does not have a body. - The response message contains the status line and four lines of header. - The header lines define the date, server, MIME version, and length of the document. - The body of the document follows the header.
6 - 28
32
6 - 29