Chapter 2:Application layer r 2.1 Principles of r 2.6 P2P file sharing network applications r 2.7 Socket programming app architectures with TCP app requirements r 2.8 Socket programming r 2.2 Web and HTTP with UDP r 2.4 Electronic Mail r 2.9 Building a Web ÷SMTP,POP3,IMAP server r 2.5 DNS 2:Application Layer 21
2: Application Layer 21 Chapter 2: Application layer r 2.1 Principles of network applications v app architectures v app requirements r 2.2 Web and HTTP r 2.4 Electronic Mail v SMTP, POP3, IMAP r 2.5 DNS r 2.6 P2P file sharing r 2.7 Socket programming with TCP r 2.8 Socket programming with UDP r 2.9 Building a Web server
Web and HTTP First some jargon 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 ob.ject is addressable by a URL r Example URL: www.someschool.edu/someDept/pic.gif host name path name 2:Application Layer 22
2: Application Layer 22 Web and HTTP First some jargon 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: www.someschool.edu/someDept/pic.gif host name path name
HTTP overview HTTP:hypertext transfer protocol r Web's application layer HTTP request protocol PC running HTTP response Explorer r client/server model *client:browser that requests,receives, HTTP request Server "displays"Web objects running *server:Web server HTTP response Apache Web server sends objects in response to requests Mac running r HTTP 1.0:RFC 1945 Navigator r HTTP 1.1:RFC 2068 2:Application Layer 23
2: Application Layer 23 HTTP overview HTTP: hypertext transfer protocol r Web’s application layer protocol r client/server model v client: browser that requests, receives, “displays” Web objects v 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 request HTTP response HTTP response
HTTP overview (continued) Uses TCP: HTTP is "stateless" r client initiates TCP server maintains no connection (creates socket) information about to server,port 80 past client requests r server accepts TCP connection from client aside Protocols that maintain r HTTP messages (application- "state"are complex! layer protocol messages) r past history (state)must exchanged between browser be maintained (HTTP client)and Web server (HTTP server) r if server/client crashes, their views of "state"may r TCP connection closed be inconsistent,must be reconciled 2:Application Layer 24
2: Application Layer 24 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 (applicationlayer protocol 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
HTTP connections Nonpersistent HTTP Persistent HTTP r At most one object is r Multiple objects can sent over a TCP be sent over single connection. TCP connection r HTTP/1.0 uses between client and nonpersistent HTTP server. r HTTP/1.1 uses persistent connections in default mode 2:Application Layer 25
2: Application Layer 25 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