A Closer Look at HTTP, TCP, IP, and PPP.ppt
《A Closer Look at HTTP, TCP, IP, and PPP.ppt》由会员分享,可在线阅读,更多相关《A Closer Look at HTTP, TCP, IP, and PPP.ppt(78页珍藏版)》请在麦多课文档分享上搜索。
1、A Closer Look at HTTP, TCP, IP, and PPP,Chapter 3Copyright 2001 Prentice Hall Revision 2: July 2001,2,A Closer Look at,HTTP at the Application Layer TCP (and UDP) at the Transport Layer IP at the Internet Layer PPP at the Data Link Layer,3,HTTP: A Closer Look,World Wide Web Standards HTML (HyperText
2、 Markup Language) governs the structure of the HTML webpage HTTP (HyperText Transfer Protocol) governs the format and timing of requests and responses between the browser and the webserver application program,Browser,Webserver Program,HTML,HTTP,4,HTTP: A Closer Look,Sample HTTP Request Line All text
3、, often only a single line Keywordabsolute pathHTTP/ version Keyword (Method) is GET for Retrievals GET must be capitalized Absolute path is URL without http:/hostname,GET /report1/home.htm HTTP/1.1,Absolute Path,5,HTTP: A Closer Look,Sample HTTP Request Header Although the book only discusses the r
4、equest-line, if only the absolute path is give, the request line is supposed to be followed by a header line naming the host. So if the host is puka.hawaii.edu, the request-line and header would be (where CRLF is carriage return followed by line feed):,GET /report1/home.htm HTTP/1.1CRLF Host:puka.ha
5、waii.edu,New,6,HTTP: A Closer Look,Sample HTTP Response Message Header is multiple lines of text Each ends with CRLF,HTTP/1.1 200 OKCRLF Date: Tuesday, 20-JAN-1999 18:32:15 GMTCRLF Server: name of server softwareCRLF MIME-version: 1.0CRLF Content-type: text/plainCRLF CRLF File to be downloaded.,7,HT
6、TP: A Closer Look,Sample HTTP Response Message 200 is a code for a successful retrieval, followed by the humanly readable code, OK Other codes indicate errors, such as 404,HTTP/1.1 200 OKCRLF Date: Tuesday, 20-JAN-1999 18:32:15 GMTCRLF Server: name of server softwareCRLF MIME-version: 1.0CRLF Conten
7、t-type: text/plainCRLF CRLF File to be downloaded.,8,HTTP: A Closer Look,Sample HTTP Response Message MIME-version and Content-type tell the type of file being retrieved For HTML document, text/plain,HTTP/1.1 200 OKCRLF Date: Tuesday, 20-JAN-1999 18:32:15 GMTCRLF Server: name of server softwareCRLF
8、MIME-version: 1.0CRLF Content-type: text/plainCRLF CRLF File to be downloaded.,9,HTTP: A Closer Look,HTML Pages Contain Text To be displayed HTML Pages Contain Tags Some tags say “place a graphic here”, “place a JAVA applet in a box here”, etc. For instance, the tag says “Get file big.jpg and place
9、it here in the HTML document” Graphics, Java programs, etc. are separate files,10,HTTP: A Closer Look,Downloading a “page” may require several downloads One for the HTML document One each for the other files it calls for Each needs a separate request/response cycle,HTML,Big. jpg,App. java,Webserver,
10、User PC,File Downloads,2,3,1,11,HTTP: A Closer Look,How Many HTTP request-response cycles will be needed to download the three files? 3 HTTP request-response cycles,HTML,Big. jpg,App. java,Webserver,User PC,HTTP Request-Response Cycle 1,2,3,12,HTTP: A Closer Look,HTTP is Unreliable No error detectio
11、n and correction for errors As we will see later, TCP at the transport layer is reliable, offering error detection and correction TCP gives HTTP clean data, so there is no need for HTTP to do error checking,13,HTTP: A Closer Look,HTTP is Connectionless HTTP is connectionless. Just send requests, get
12、 responses. No connection between messages Like sending a letter, fax, or e-mail,Browser,Webserver Application,HTTP Request,14,TCP: A Closer Look,Browser does not send HTTP Requests directly to the webserver application The application layer programs are not physically connected Browser sends HTTP R
13、equest to the user PCs transport layer process for delivery,Browser,Transport Process,HTTP Request,15,TCP: A Closer Look,Transport layer process stores the HTTP Request Temporarily Does NOT merely add a TCP header and then pass the TCP segment down to the Internet layer process as noted in Chapter 2
14、,Browser,Transport Process,Transport Process,Request,16,TCP: A Closer Look,User PC transport process opens a connection to the webserver transport layer process This connection can be used to send several TCP segments to handle a several HTTP request-response cycles,Browser,Transport Process,Transpo
15、rt Process,17,TCP: A Closer Look,TCP has a Flags Field Six one-bit flags,Source Port # (16),Destination Port # (16),Sequence Number (32 bits),Acknowledgement Number (32 bits),Hdr Len (4),Flags (6),Window Size (16),Options (if any),PAD,Bit 0,Bit 31,Reserved (6),TCP Checksum (16),Urgent Pointer (16),T
16、CP Segment,Data Field,18,TCP/IP: A Closer Look,Three Flags are Widely Used SYN bit set to 1 in a TCP segment to request a connection ACK bit set to 1 in a segment to acknowledge a received TCP segment FIN bit set to 1 in a segment to inform of a connection closure,Hdr Len (4),Flags (6),Window Size (
17、16),Reserved (6),19,TCP: A Closer Look,Opening a connection takes 3 Segments First TCP segment has SYN flag set. Requests connection to webserver transport process (connection-oriented service) Like a telephone call,User PC Transport Process,Webserver Transport Process,SYN,20,TCP: A Closer Look,Open
18、ing a connection takes 3 Segments Second TCP segment asks to open a connection and also acknowledges the first SYN message (ACK flag set too),User PC Transport Process,Webserver Transport Process,SYN,SYN, ACK,21,TCP: A Closer Look,Opening a connection takes 3 Segments Third TCP segment acknowledges
19、the second All segments are acknowledged except for pure ACKs like the third segment,User PC Transport Process,Webserver Transport Process,SYN,SYN, ACK,ACK,22,TCP: A Closer Look,Next, user PC sends the HTTP Request Sends HTTP Request in data field of a TCP segment Will receive an ACK TCP segment to
20、acknowledge receipt,User PC Transport Process,Webserver Transport Process,TCP segment containing HTTP Request,ACK,23,Delivering the HTTP Response,Transport layer process on the webserver receives the TCP segment delivering the HTTP Request The transport process on the webserver passes the HTTP Reque
21、st in the TCP segment data field to the webserver application program,Webserver Application,Transport Process,HTTP Request,24,Delivering the HTTP Response,Webserver application creates the HTTP Response message Webserver application passes the HTTP Response message to the webserver transport layer p
22、rocess for delivery to the user PC transport layer process,Webserver Application,Transport Process,HTTP Response,25,Delivering the HTTP Response,Webserver Transport Process Delivers the Response User PC transport process sends an acknowledgement,User PC Transport Process,Webserver Transport Process,
23、TCP segment containing HTTP Response,ACK,26,TCP: A Closer Look,Multiple HTTP Request-Response Cycles can be Handled with a Single TCP Connection in HTTP/1.1 and later versions Request message must have following line: Connection: Keep-Alive,New,27,TCP: A Closer Look,Closing the Connection takes 4 TC
24、P Segments You dont simply hang up in a phone call! Initiated by the browser when it downloads the last file,User PC Transport Process,Webserver Transport Process,FIN,FIN,ACK,ACK,28,TCP: A Closer Look,Refinement If your respond quickly to a letter, often include acknowledgement of letter your receiv
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
2000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- ACLOSERLOOKATHTTP TCP IP ANDPPPPPT
