2 Computer Networking A Top Down Approach Featuring

  • Slides: 46
Download presentation

课程基本信息 2、教材选用 • Computer Networking: A Top Down Approach Featuring the Internet,4 rd edition

课程基本信息 2、教材选用 • Computer Networking: A Top Down Approach Featuring the Internet,4 rd edition – Jim Kurose, Keith Ross – Addison-Wesley. • 计算机网络—自顶向下方法与Internet特色 – (第 4版 影印版)高等教育出版社 #1 #2 #3 #4 #5 Computer Networks and the Internet Application Layer Transport Layer Network Layer and Routing Link Layer and Local Area Networks Computer Networking

人人教学网站 v 课程主站 § X-pec § 霸气爷们波 § 春田花花幼儿园 § 七星阁 § 相聚岛 §

人人教学网站 v 课程主站 § X-pec § 霸气爷们波 § 春田花花幼儿园 § 七星阁 § 相聚岛 § 真我风采 § 火力全开 § 愤怒的小强 § 梦之翼 § 非常 6+1 Computer Networking http: //zhan. renren. com/dawnet http: //zhan. renren. com/xpectteam http: //zhan. renren. com/820930374 http: //zhan. renren. com/cthhyey http: //zhan. renren. com/qxging http: //zhan. renren. com/darlingnet http: //zhan. renren. com/junzicreat http: //zhan. renren. com/dqhkzc http: //zhan. renren. com/fennudexiaoniao http: //zhan. renren. com/mengzhiyinet http: //zhan. renren. com/xhwnet

单元说课 第二章 第 2&3次课 HTTP协议 Computer Networking

单元说课 第二章 第 2&3次课 HTTP协议 Computer Networking

1. 课程导入 Computer Networking

1. 课程导入 Computer Networking

2. 基本概念 Computer Networking

2. 基本概念 Computer Networking

Some jargon v Web page consists of objects § Object can be HTML file,

Some jargon v Web page consists of objects § Object can be HTML file, JPEG image, Java applet, audio file, … v Web page consists of base HTML-file which includes several referenced objects v Each object is addressable by a URL v Example URL(Uniform Resource Locator): Http: //www. nbu. edu. cn/images/run 1. gif Protocol host name 2: Application Layer path name 19

HTTP overview HTTP: hypertext transfer protocol v Web’s application layer protocol v client/server model

HTTP overview HTTP: hypertext transfer protocol v Web’s application layer protocol v client/server model § client: • browser that requests, • receives, • “displays” Web objects HT TP PC running Explorer HT TP § server: est res pon se est u q e • Web server sends objects • in response to requests v HTTP 1. 0: RFC 1945 v HTTP 1. 1: RFC 2068 req u HT r TP es r P T HT se n po Server running Apache Web server Mac running Navigator 2: Application Layer 20

HTTP overview (continued) Uses TCP: v client initiates TCP connection (creates socket, >1024, dynamic)

HTTP overview (continued) Uses TCP: v client initiates TCP connection (creates socket, >1024, dynamic) to server(fixed, port 80) v server accepts TCP connection from client v HTTP messages (application-layer protocol messages) exchanged between browser (HTTP client) and Web server (HTTP server), again, …. v TCP connection closed 2: Application Layer 21

HTTP request message v two types of HTTP messages: request, response v HTTP request

HTTP request message v two types of HTTP messages: request, response v HTTP request message: § ASCII (human-readable format) request line (GET, POST, HEAD commands) GET /index. html HTTP/1. 1 Host: www. nbu. edu. cn User-agent: Mozilla/4. 0 header lines Connection: close Accept-language: cn Carriage return, line feed indicates end of message (extra carriage return, line feed) 2: Application Layer 22

Method types HTTP/1. 0 v GET v POST v HEAD § asks server to

Method types HTTP/1. 0 v GET v POST v HEAD § asks server to leave requested object out of response HTTP/1. 1 v GET, POST, HEAD v PUT § uploads file in entity body to path specified in URL field v DELETE § deletes file specified in the URL field 2: Application Layer 23

HTTP response message status line (protocol status code status phrase) header lines data, e.

HTTP response message status line (protocol status code status phrase) header lines data, e. g. , Requested HTML file HTTP/1. 1 200 OK Connection close Date: Thu, 06 Aug 2004 12: 00: 15 GMT Server: Apache/1. 3. 0 (Unix) Last-Modified: Mon, 22 Jun 2004 …. . . Content-Length: 6821 Content-Type: text/html DEMO data data. . . 2: Application Layer 24

HTTP response status codes In first line in server->client response message. A few sample

HTTP response status codes In first line in server->client response message. A few sample codes: 200 OK § request succeeded, requested object later in this message 301 Moved Permanently § requested object moved, 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 HTTP Version Not Supported 2: Application Layer 25

3. 理论实验融合探究教学 Computer Networking

3. 理论实验融合探究教学 Computer Networking

探究任务与问题 2: Application Layer 28

探究任务与问题 2: Application Layer 28

DIY!now 2. 2 得到较长的HTTP文档 v 通过浏览器访问一个较长的网页 v 分析多个数据包传输的过程 v 观察“Continuation or non-HTTP traffic DATA”或“TCP

DIY!now 2. 2 得到较长的HTTP文档 v 通过浏览器访问一个较长的网页 v 分析多个数据包传输的过程 v 观察“Continuation or non-HTTP traffic DATA”或“TCP Segment of a Reassembled PDU ” 2: Application Layer 29

DIY!now 2. 3 基本的HTTP post/Response v 访问mail. nbu. edu. cn v 用任意用户名登录 v 对捕获到的post和response进行分析

DIY!now 2. 3 基本的HTTP post/Response v 访问mail. nbu. edu. cn v 用任意用户名登录 v 对捕获到的post和response进行分析 v 研究chunked编码和set-cookie的作用 2: Application Layer 30

Persistent HTTP(难点) Nonpersistent HTTP issues: v requires 2 RTTs per object v OS overhead

Persistent HTTP(难点) Nonpersistent HTTP issues: v requires 2 RTTs per object v OS overhead for each TCP connection v browsers often open parallel TCP connections to fetch referenced objects v Default in HTTP/1. 0 Persistent HTTP v server leaves connection open after sending response v subsequent HTTP messages between same client/server sent over open connection Persistent without pipelining: v client issues new request only when previous response has been received v one RTT for each referenced object Persistent with pipelining: v default in HTTP/1. 1 v client sends requests as soon as it encounters a referenced object v as little as one RTT for all the referenced objects 2: Application Layer 34

Nonpersistent HTTP Suppose user enters URL www. nbu. edu. cn (contains 5 text files,

Nonpersistent HTTP Suppose user enters URL www. nbu. edu. cn (contains 5 text files, 1 css file, 31 gif images) 1 a. HTTP client initiates TCP connection to HTTP server (process) at www. nbu. edu. cn on port 80 2. HTTP client sends HTTP request message (containing URL) into TCP connection socket. Message indicates that client wants object index. html time 1 b. HTTP server at host www. nbu. edu. cn waiting for TCP connection at port 80. “accepts” connection, then notifying client 3. HTTP server receives request message, forms response message containing requested object, and sends message into its 2: Application Layer socket 35

Nonpersistent HTTP (cont. ) 4. HTTP server closes TCP connection. 5. HTTP client receives

Nonpersistent HTTP (cont. ) 4. HTTP server closes TCP connection. 5. HTTP client receives response message containing html file, displays html. Parsing html file, finds 31 referenced jpeg objects and other files time 6. Steps 1 -5 repeated for each of 31 jpeg objects and other files 2: Application Layer 36

Non. Persistent HTTP Nonpersistent HTTP issues: v requires 2 RTTs per object v OS

Non. Persistent HTTP Nonpersistent HTTP issues: v requires 2 RTTs per object v OS must work and allocate host resources for each TCP connection v but browsers often open parallel TCP connections to fetch referenced objects Total (index. html+36 files) = 2 RTT*37 + transmit time >74 RTT RTT Index. html RTT 1 RTT 2 3. . . 35 RTT 36 time 2: Application Layer time 37

Persistent HTTP v server leaves connection open after sending response v subsequent HTTP messages

Persistent HTTP v server leaves connection open after sending response v subsequent HTTP messages between same client/server are sent over connection RTT RTT 2: Application Layer Index. html 1 38

Persistent HTTP RTT Persistent without pipelining: v client issues new request only when previous

Persistent HTTP RTT Persistent without pipelining: v client issues new request only when previous response has been received v one RTT for each referenced object Total (index. html+36 files) = 2 RTT+RTT*36 + transmit time >38 RTT Index. html 1 RTT 2 RTT 3. . . 35 36 RTT 2: Application Layer time 39

Persistent HTTP Persistent with pipelining: v default in HTTP/1. 1 v client sends requests

Persistent HTTP Persistent with pipelining: v default in HTTP/1. 1 v client sends requests as soon as it encounters a referenced object v as little as one RTT for all the referenced objects RTT Index. html RTT 1 RTT 2 3 4. . . 35 36 Total (index. html+36 files)= 2 RTT+2 RTT + transmit time>4 RTT 2: Application Layer 40

No. Persistent with pipelining: RTT Index. html RTT 1 2 3. . . 35

No. Persistent with pipelining: RTT Index. html RTT 1 2 3. . . 35 36 RTT Total (index. html+36 files)= 2 RTT+2 RTT + transmit time>4 RTT 2: Application Layer 41

Persistent with pipelining, Issume MAX conection=8 RTT Index. html RTT 1 RTT 2 RTT

Persistent with pipelining, Issume MAX conection=8 RTT Index. html RTT 1 RTT 2 RTT 10 RTT 18 RTT 26 RTT 34 3 4. . . 8 9 11 12. . . 16 17 19 20. . . 24 25 27 28. . . 32 33 35 36 Total (index. html+36 files)= 2 RTT+RTT*6 + transmit time>8 RTT 2: Application Layer 42

No. Persistent with pipelining, Issume MAX conection=8 RTT Index. html RTT 1 2 3.

No. Persistent with pipelining, Issume MAX conection=8 RTT Index. html RTT 1 2 3. . . 7 8 9 10 11. . . 15 16 17 18 19. . . 23 24 25 26 27. . . 31 32 33 34 35 RTT RTT 36 Total (index. html+36 files)= 2 RTT+2 RTT*5 + transmit time>12 RTT 2: Application Layer 43

4. 单元小结与分析 Computer Networking

4. 单元小结与分析 Computer Networking

We are all the wonderful part of course. 宁波大学信息科学与 程学院 2012

We are all the wonderful part of course. 宁波大学信息科学与 程学院 2012