Download presentation
Presentation is loading. Please wait.
Published byBeatrix Watts Modified over 9 years ago
1
A Closer Look at HTTP, TCP, IP, and PPP Chapter 3 Copyright 2001 Prentice Hall Revision 2: July 2001
2
2 HTTP: A Closer Look n World Wide Web Standards –HTML (HyperText 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
3
3 HTTP: A Closer Look n Sample HTTP Request Line –All text, often only a single line GET /report1/home.htm HTTP/1.1[CRLF] Host:puka.hawaii.edu n Sample HTTP Response Message HTTP/1.1 200 OK[CRLF] Date: Tuesday, 20-JAN-1999 18:32:15 GMT[CRLF] Server: name of server software[CRLF] MIME-version: 1.0[CRLF] Content-type: text/plain[CRLF] [CRLF] File to be downloaded.
4
4 HTTP: A Closer Look n 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 OK[CRLF] Date: Tuesday, 20-JAN-1999 18:32:15 GMT[CRLF] Server: name of server software[CRLF] MIME-version: 1.0[CRLF] Content-type: text/plain[CRLF] [CRLF] File to be downloaded.
5
5 HTTP: A Closer Look n Downloading a “page” may require several downloads –HTML document:text & tags of other files needed –Graphics files specified in tag –Each needs a separate request/response cycle HTML Big. jpg App. java Webserver User PC File Downloads 2 3 1
6
6 HTTP: A Closer Look n HTTP is Unreliable –No error detection and correction for errors –TCP gives HTTP clean data, so there is no need for HTTP to do error checking n HTTP is Connectionless –Send requests without first connecting to destination –Datagram service
7
7 TCP: A Closer Look n Browser does not send HTTP Requests directly to the webserver application –The application layer programs are not physically connected –Browser sends HTTP Request to the user PC’s transport layer process for delivery Browser Transport Process HTTP Request
8
8 TCP: A Closer Look n TCP is connection oriented –Expensive –Once connection open, TCP messages (segments) sent back & forth between computers.
9
9 TCP: A Closer Look n 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 0Bit 31 Reserved (6) TCP Checksum (16)Urgent Pointer (16) TCP Segment Data Field
10
10 TCP/IP: A Closer Look n 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 (16)Reserved (6)
11
11 TCP: A Closer Look n Opening / Request / Response Cycle –Opening a connection takes 3 Segments First TCP segment has SYN flag set. Second TCP segment asks to open a connection and acknowledges first SYN message Third TCP segment acknowledges the second –User PC sends the HTTP Request HTTP Request in data field of a TCP segment User PC Transport Process Webserver Transport Process SYN SYN, ACK ACK TCP segment with HTTP Request ACK
12
12 Delivering the HTTP Response n Transport layer process on the webserver receives the TCP segment –passes the HTTP Request field to the webserver application program n Webserver application creates the HTTP Response message –Webserver application passes the HTTP Response message to the webserver transport layer process for delivery to the user PC transport layer process Webserver Application Transport Process HTTP Request HTTP Response
13
13 TCP: A Closer Look n Closing the Connection takes 4 TCP Segments –Initiated by the browser when it downloads the last file User PC Transport Process Webserver Transport Process FIN ACK
14
14 TCP: Error Handling n TCP is reliable— –Error correction Acknowledge correctly-received TCP segments –Provides clean application data to application program If data link layer frame or IP packet is lost receiving transport process will not acknowledge –If TCP segment not acknowledged other side retransmits –TCP is reliable Places TCP Segments in Order based on sequence numbers IP does not guarantee packets arrive order
15
15 User Datagram Protocol (UDP) n UDP (User Datagram Protocol) –Alternative to TCP at the transport layer –For applications tolerable to data loss or not tolerable to delay Connectionless No error correction (unreliable) Reduces work source and destination host must do –No acknowledgements
16
16 IP: Connectionless Service/Unreliable n Internet Protocol (IP) –Governs transmission between router and host –Governs transmission between pairs of routers –Gives end-to-end route across many routers –IP messages are called IP packets / datagrams Not guaranteed to arrive in sequence User PC WebserverRouter IP
17
17 TCP/IP Partnership n TCP checks for errors only once, at the destination host n By not checking for errors at each router along the route, IP greatly reduces overall processing work Transport Internet Check Only Once Host Router Host
18
18 IP Addresses and Router Forwarding n Routers use the destination IP address of an incoming packet in the router forwarding decision –Decide output port for sending packet out Destination Host On Source Host’s Subnet Destination Host NOT On Source’s Subnet Destination Host On Router’s Subnet Router forward to Other Router Border Router: connect network with Internet B? D? C? B C D Router A Packet Subnet
19
19 IP Hierarchical Addressing n IP Address (32 bits long ) –Hierarchical Addressing –Header stores source & destination –Part of IP address Network part –Identifies host’s network on the Internet Subnet part –Identifies host’s subnet on that network Host part –Identifies host within subnet
20
20 IP Addresses n Network Part Numbers –Assigned by IP Address Registrar: University of Hawaii, this is 128.171 –All IP Addresses in that organization’s network begin with that Network Part –Network parts can be 8 to 24 bits long Network Part IP Address 128.171
21
21 IP Addresses n Network Part is Followed by a Subnet Part –Identifies the subnet within the network –Organization Assigns Subnet Parts to suborganizations UH gave the College of Business Administration the subnet part 17 Suborganization assigns remaining bits to particular host on that subnet –College of Business Administration assigned host part 13 to host name voyager.cba.hawaii.edu Network PartSubnet Part IP Address (32 bits total) Host Part 128.1711713
22
22 IP Addresses n Three rules of assigning part values –No part of host IP address can be all ones Broadcast address: to all hosts on subnet –No part of host IP address can be all zeros For unknown address –No host can have the IP address 127.0.0.0 Loopback testing
23
23 Masks n Problem: Router does not know that the first 16 bits of the IP address are the network part of the address n Solution: A second 32-bit number (mask) paired with the IP address
24
24 Masks n Two Types: Network Masks and Subnet Masks –Network Mask Designates organization network on the Internet. –Subnet Mask Designates specific subnet on the network. –IP Address will be paired with one or the other, but not both simultaneously
25
25 Masks n Masks Begin with 1s, End with 0s (111…00) –Prefix Notation with IP Address-Mask Pairs 128.171.17.13/16 –Prefix represents number of initial 1s (16) –Remaining bits = 0s n Network masks: Network Part =1s Subnet and Host Parts = 0s n For subnet masks, Network and Subnet Parts = 1s; Host part = 0s
26
26 Router Forwarding Tables n Used for Router forwarding decisions –Lists various combinations of IP addresses, mask prefixes, next hop router & metrics and interface for sending message out. –Each row is a router forwarding rule for matching packets
27
27 Router Forwarding Tables n Router Compares Destination IP Address to Each Row in Router Forwarding Table –If matches, adds to list of possible rules to use –There usually are multiple matches Indicate alternative routes n Mask Column –Indicates length of match to partial IP address
28
28 Router Forwarding Tables n Matching IP Addresses –Local Delivery or Next-hop routing –Designates router interface (port) used for delivery Each interface connects to a different subnet –Simple Match –Longest Match selection –Metric-Based Selection Cost Reliability Different routers use different metrics –Default Routing
29
29 Dynamic Routing Protocols n How Do Routers Get Information for their Router Forwarding Tables? –Exchange information about routes & metrics –Dynamic routing protocols: standards governing exchanges 0.0.0.0 used as placeholder not IP address Router Forwarding Table Information
30
30 IP Version 6 n Current Version of IP is IP Version 4 –In use since 1981 –32-bit IP address fields are too small n Next Version will be IP Version 6 –Will have 128-bit IP address fields –Advanced features of security, priority levels, etc.
31
31 Closer look at Data Link Layer n Point-to-Point Protocol –Manage flow of messages (frames) thru subnet –Popular protocol for dial-in connections –Between data link layer processes on user PC and first router; not user PC and destination host DLL Process User PC DLL Process First Router PPP
32
32 Closer look at Data Link Layer n Negotiation Phase –Before exchanging data frames both sides: Negotiate conditions of PPP operation –Also negotiate how specific protocols will be handled Not limited to IP DLL Process User PC DLL Process First Router PPP
33
33 Closer look at Data Link Layer n Data Frames –Header –Information field (IP packet or other information) –Trailer with Frame Check Sequence field Error detection but not correction If an error is found, PPP frame is discarded TrailerInformation FieldHeader IP Packet
34
34 Closer look at Data Link Layer n Flag Fields (1 Octet Each) –Always contain: 01111110 –Designates start of frame and end of frame n Address and Control Fields (1 Octet Each) –Left over from earlier protocol (HDLC) –Address value: 11111111 –Control value 00000011 FlagAddrCtrlProtInfoCRCFlag
35
35 Closer look at Data Link Layer n Protocol Field (2 Octets) –Identifies the contents of the information field –Values for IP, IPX, other internet layer protocols in the information field –Values for supervisory messages to be carried in the information field for supervisory frames FlagAddrCtrlProtInfoCRCFlag
36
36 Closer look at Data Link Layer n Cyclical Redundancy Check (2 Octets) –Error-checking information in data link frame –Receiver discards such frames; error detection but not reliability (no error correction) FlagAddrCtrlProtInfoCRCFlag
37
37 Physical Layer Process n Physical layer process does not create a protocol data unit –Sends one bit at a time over the data link connecting the sending computer to the next computer –It is the data link layer process that organizes these bits into frames over the data link Physical Layer Process 10110
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.