A Closer Look at HTTP, TCP, IP, and PPP.ppt

上传人:赵齐羽 文档编号:373137 上传时间:2018-10-05 格式:PPT 页数:78 大小:292KB
下载 相关 举报
A Closer Look at HTTP, TCP, IP, and PPP.ppt_第1页
第1页 / 共78页
A Closer Look at HTTP, TCP, IP, and PPP.ppt_第2页
第2页 / 共78页
A Closer Look at HTTP, TCP, IP, and PPP.ppt_第3页
第3页 / 共78页
A Closer Look at HTTP, TCP, IP, and PPP.ppt_第4页
第4页 / 共78页
A Closer Look at HTTP, TCP, IP, and PPP.ppt_第5页
第5页 / 共78页
亲,该文档总共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

25、ed in your response letter TCP segments too can both send new information and acknowledge a segment received. Example: SYN, ACK at start of connection If response will take time, however, send a pure ACK message,29,TCP Connections: Recap,For Page Downloads 3 TCP segments to open the connection 4 TCP

26、 segments per file downloaded More if file downloaded is long, because may take multiple segments to download 4 TCP segments to close the connection A very chatty protocol,30,TCP: Error Handling,TCP is reliable-it does error correction ACKs acknowledge each correctly-received TCP segment If a TCP se

27、gment is not acknowledged, the other side retransmits it after awhile TCP is reliable-it Places TCP Segments in Order IP does not guarantee that packets will arrive in order TCP can place TCP segments in order based on their sequence numbers,31,TCP: Error Handling,TCP Reliability in Perspective Prov

28、ides clean application data to application program If data link layer frame or IP packet is lost at lower layers, receiving transport process will not acknowledge a segment The sending transport process will resend automatically So TCP protects against errors at lower layers as well as transport lay

29、er errors,32,User Datagram Protocol (UDP),UDP User Datagram Protocol Alternative to TCP at the transport layer Lightweight No connections (connectionless) No error correction (unreliable) Reduces work source and destination host must do,33,User Datagram Protocol (UDP),UDP Good for voice, for which t

30、he delay of error correction would be unacceptable Good for applications for which the cost of an occasional message is small compared to the cost of connection-oriented service,34,IP: Connectionless Service,The Internet Protocol (IP) Internet layer protocol Governs transmission between router and h

31、ost Governs transmission between pairs of routers Gives end-to-end route across many routers,User PC,Webserver,Router,Router,35,IP: Connectionless Service,The Internet Protocol (IP) IP messages are called IP packets IP is unreliable and connectionless Low overhead Let TCP correct any errors!,Interne

32、t Process,Internet Process,IP Packet,36,TCP/IP Partnership,TCP checks for errors only once, at the destination host By not checking for errors at each router along the route, IP greatly reduces overall processing work Reduces router costs,Transport,Transport,Internet,Internet,Internet,Check Only Onc

33、e,Host,Router,Host,37,Connectionless IP,IP is unreliable (does not catch errors) But this is not bad First, errors are corrected-at the next-higher layer (transport) if TCP is used Second, avoiding error correction at each hop between routers lowers router costs Far less expensive to correct errors

34、on one destination host than on many routers along the way,38,IP Addresses and Router Forwarding,Routers use the destination IP address of an incoming packet in the router forwarding decision, that is, to decide what output port to use to send the packet back out to the destination host or to anothe

35、r router (B, C or D?),B?,D?,C?,Router A,B,C,D,Packet,39,Router Delivery,If Destination Host is On the Source Hosts Subnet, Source Host Delivers the Packet Directly No router is involved Called local delivery to destination host,Subnet,Subnet,Source Host,Destination Host,Local Delivery,40,Router Deli

36、very,If Destination Host is NOT On the Source Hosts Subnet, Source Host Sends the Packet to a Router for Delivery Delivery to next-hop router,Subnet,Subnet,Delivery to Next-Hop Router,41,Router Delivery,If Destination Host is On One of the Routers Subnets, the Router Sends the Packet to the Destinat

37、ion Host for Delivery Local delivery to destination host,Subnet,Subnet,Local Delivery,42,Router Delivery,If Destination Host is NOT On One of the Routers Subnets, the Router Sends the Packet to a Next-Hop Router for Delivery May have to choose among several possible next-hop routers for delivery,Sub

38、net,Subnet,Delivery to Next-Hop Router,43,Router Delivery,Border Routers Connect Networks, Not Subnets Select between next-hop router on own network or on another network,Own Network,Other Network,44,IP Addresses and Router Forwarding,Routers look at destination IP address of packet to make decision

39、s What do I do with this packet, based upon its IP destination address,B?,D?,C?,Router A,B,C,D,Packet,45,IP Addresses,Many Addressing Systems Use Hierarchical Addressing Postal delivery: city, street address Post office looks at city first If not P.O.s city, put in bag for other city If in P.O.s cit

40、y, put in bag for sorting by street address Hierarchical addressing greatly speeds sorting at each post office Imagine if we needed a sorting bin for each address in the country!,City 1,City 2,City 3,Letter,46,IP Hierarchical Addressing,IP Address has Three Parts Network part Identifies hosts networ

41、k on the Internet Subnet part Most networks consist of smaller subnets Identifies hosts subnet on that network Host part Identifies a particular host Total equals 32 bits (the whole IP address),47,IP Hierarchical Addressing,Using Address Parts Router has one forwarding rule for all packets to a part

42、icular network or to a particular subnets Does not need a forwarding rule for each host Many fewer rules to look through when making router forwarding decisions Vastly reduces the work that routers have to do Internet core routers still have 100,000 to 200,000 rules,New,48,IP Addresses,Network Part

43、Numbers For the University of Hawaii, this is 128.171 All IP Addresses in that organizations network begin with that Network Part Network parts can be 8 to 24 bits long,Network Part,IP Address,128.171,49,Assigning Network Parts,Organization applies to an Internet IP address registrar Registrar gives

44、 organization a network part Organization assigns the remaining bits to its hosts internally Only large organizations and ISPs get network parts,Registrar,Firm,128.171,128.171.17.13,128.171.123.130,50,IP Addresses,Network Part is Followed by a Subnet Part Identifies the subnet within the network Rem

45、aining bits are the Host Part, designating a particular host on that subnet,Network Part,Subnet Part,IP Address (32 bits total),Host Part,51,Assigning Subnet Parts,Organization Assigns Subnet Parts Assigns subnet parts to suborganizations Suborganization assigns host bits to hosts,Registrar,Firm,128

46、.171,128.171.17.13,128.171.17.13,Suborganization,Host,52,Assigning Parts,Example University of Hawaii has network part 128.171 UH gave the College of Business Administration the subnet part 17 College of Business Administration gave the host part 13 to a computer it later gave the host name voyager.

47、cba.hawaii.edu So the computers IP address became 128.171.17.13.,53,Importance of Part Sizes,Determine Number of Possible Networks, Subnets, or Hosts If There are N Bits in the Part, there can be 2N possible Networks, Subnets, or Hosts Actually, 2N-2 All zeros cannot be used for a part All ones cann

48、ot be used for a part Example: if part has 8 bits, 28-2 possibilities (254),54,Masks,Problem: Just looking at an IP address does not tell you what bits belong to each part Solution: Create a second 32-bit number, a mask, to tell the size of The network part for border router decisions The network pl

49、us subnet parts for internal router decisions,55,Masks,Two Types: Network Masks and Subnet Masks Network Mask Tells the Length of the Network Part. To get packet closer to network. Subnet Mask Tells the length of the Network Plus Subnet Parts (not just subnet part). To get packet closer to subnet in own network IP Address will be paired with one or the other, but not both simultaneously The correct pairing happens automatically,56,Masks,

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 教学课件 > 大学教育

copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1