HTTP Overview - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

HTTP Overview

Description:

identifies the subnet. Local part - sometimes called the hostid (suffix) Subnet Mask delineates netid and hostid used to further divide a network ... – PowerPoint PPT presentation

Number of Views:19
Avg rating:3.0/5.0
Slides: 25
Provided by: bobsw4
Category:
Tags: http | mask | overview | subnet

less

Transcript and Presenter's Notes

Title: HTTP Overview


1
HTTP Overview
  • HTTP - protocol used by servers and clients along
    with others (TCP, IP, URL) to exchange data
  • HTTP - simple request/response "conversation
  • HTTP/1.0 - TCP connection made for each webpage
    item
  • HTTP/1.1 - persistent TCP connections
  • HTTP is Stateless - server doesn't remember
    previous requests
  • Must use cookies or server's API to maintain
    state
  • HTTP uses MIME for data typing and type
    negotiation

2
Multiple HTTP Requests/Responses
  • An HTML document may require many HTTP Requests
    and Responses between client and server
  • Client (browser) creates initial HTTP-Request-PDU
    for an HTML document
  • Server finds document and returns it with
    HTTP-Response-PDU
  • Browser reads HTML document sees ltimg
    srcmy.pnggt and sends HTTP-Request-PDU for
    my.png
  • Server finds my.png, creates HTTP-Response-PDU
    and returns them
  • HTTP/1.0 would require 2 TCP connections.
  • HTTP/1.1 needs only 1 TCP connection.

3
HTTP-Request PDU from Client
  • Using HTTP, clients make requests of servers for
    resources. The HTTP-Request-PDU consists of
  • Client request line request method, URI, HTTP
    protocol versionExample GET /simple.html
    HTTP/1.1
  • Header fields metainformation about the
    requestExample Accept image/gif, image/jpeg,
    /
  • Blank line separates Header fields from Entity
    body
  • Entity body data (e.g., form data) passed to
    server from client if POST method used. GET
    method requests contain no data in Entity body.
    Example nameBobSweeney21

4
Client HTTP Request Methods
  • Request Method - determines what to do with
    request. Examples
  • The GET Method - it retrieves information from
    server, and Entity Body is empty.
  • To pass information to the server it must be
    included in URL (info parameters follow a ?)
  • The POST Method allows server to receive data
    from client, usually HTML form data, in Entity
    body
  • The HEAD Method like GET except server returns
    only header section. Verification.
  • The PUT Method used (along with DELETE method)
    to publish documents to Web server from a client

5
HTTP-Response PDU from Server
  • Using HTTP, servers respond to client requests.
    The HTTP-Response-PDU consists of
  • Server response status lineprotocol version,
    status code, reason phraseExample HTTP/1.1 200
    OK
  • Header fields metainformation about the
    responseExample Server Apache/1.3.29 (Unix)
  • Blank line separates Header fields from Entity
    body
  • Entity body data (e.g., an html document) sent
    to client. ExampleltHTMLgtltTITLEgt
    Welcomelt/TITLEgt...lt/HTMLgt

6
HTTP-Response Status codes examples
  • The Server response status line contains a status
    code and a reason phrase. Here are some common
    ones
  • 1XX Informational request received and is being
    processed
  • 100 Continue
  • 2XX Success client request successful
  • 200 OK (most common)
  • 204 No Content (Entity body is empty)
  • 3XX Redirection
  • 301 Moved Permanently (URL no longer valid,
    server returns new URL
  • 302 Found (Moved Temporarily) (resource is in
    new location)
  • 304 Not Modified (if GET If-Modified-Since
    request)

7
HTTP-Response Status codes
  • 4XX Client Errors
  • 400 Bad Request (server doesnt understand
    request)
  • 401 Unauthorized (information is restricted
    retry with proper authentication)
  • 403 Forbidden (client requested data it didnt
    have permission to access)
  • 404 Not Found (resource not on server, URL does
    not exist or URL spelling error)
  • 5XX Server Errors
  • 500 Internal Service Error (unexpected problem
    on server)

8
HTTP Headers
  • HTTP Headers - metainformation about an HTTP
    request or responseClient Request Headernames
    (explanation)
  • Accept (MIME types browser prepared to accept,
    /)
  • Cookie (returns cookie information to server)
  • User-Agent (kind of browser making request)
  • If-Modified-Since (used for conditional GET
    request)
  • Server Response Headernames
  • Server (type of server providing the response)
  • Set-Cookie (sends cookie information to
    browser)
  • Content-Length (bytes of data to be sent to
    client)
  • Last-Modified (date/time most recently changed)
  • Content-Type (MIME data type being returned to
    client)
  • Content-Encoding (how browser is to decode
    document)

9
Internet Protocol Suite
  • Requests for Comments (RFCs) define standards for
    TCP, IP, and other Internet Protocol Suite
    protocols
  • TCP is RFC793
  • IP is RFC791

10
TCP-PDU
  • Transmission Control Protocol - Protocol Data
    Unit (TCP-PDU) functions include
  • connection management e.g., 3 way handshake
  • stream data transfer TCP groups bytes from
    application layer into segments and passes to IP
    for delivery
  • reliable end-to-end packet delivery TCP
    sequences bytes with a forwarding acknowledgement
    number indicating next byte expected.
    Unacknowledged bytes are resent
  • flow control TCP indicates the highest sequence
    number it can receive without overflowing its
    buffers
  • full-duplex TCP can send and receive at the
    same time
  • TCP-PDU header consists of a group of fields
    (strings of bits), each field has a specific
    purpose - see Appendix E in text, page 558

11
Connect-oriented v. Connectionless
  • TCP is connection-oriented - requires a channel
    to be established before any messages transmitted
  • UDP (User Datagram Protocol) is connectionless
    protocol, messages can be sent without
    establishing a connection
  • UDP performs similar function to TCP at Transport
    layer but is faster but less reliable than TCP
  • UDP used for broadcasts
  • see Appendix E in text, page 558

12
TCP Three-Way Handshake
  • TCP - reliable protocol but also uses many PDUs
    because of positive acknowledgement
  • simple HTTP-Request generates 11 TCP-PDUs
  • TCP establishes connection between Host A Host
    B
  • A sends a request to open a connection to B (SYN
    flag field),
  • B returns an acknowledgement (ACK SYN SYN) to A
  • A acknowledges the acknowledgement back to B (ACK
    SYN) and a (virtual) connection is established.
  • Three-Way Handshake
  • Sequence numbers are synchronized during
    handshake (assure communications between A and B
    are assembled in the proper order, and no missing
    packets exist)
  • A similar conversation occurs when closing TCP
    connections involving exchange of FIN and ACK

13
TCP-PDU header fields
  • Window Size - used for flow control
  • sets the number of bytes (windows size) ok to
    transmit beyond last acknowledgement
  • Sequence - identifies each TCP-PDU
  • Acknowledgement - specifies the TCP-PDU being
    acknowledged
  • if ACK not received, TCP-PDU is resent
  • Port - number to identify which application the
    incoming communication stream must be delivered

14
Ports
  • Used by TCP and UDP to communicate with
    Application layer programs
  • Certain port numbers have been established for
    certain applications by IANA
  • Well Known Port numbers between 0 and 1,023
    need super user authority to use reserved for
    certain applications
  • Registered Ports between 1,024 and 49,151can
    be used by applications or programs executed by
    users
  • Dynamic/Private Ports between 49152 and 65,535
    for dynamically assigned use by applications

15
Network Layer
  • Several key protocols handle logical addressing
    at this layer including
  • Internet Protocol (IP) - provides a
    connectionless delivery service
  • Address Resolution Protocol (ARP) resolves IP
    (logical) address to MAC (physical) address.
  • A host needing MAC address sends broadcast to all
    hosts on subnet and only host with that MAC
    responds a globally unique 6 byte address
    assigned to network interface card (NIC) by
    manufacturer and stored in PROM

16
Internet Protocol (IP) Functions
  • Routing provides connetionless, best-effort
    delivery of packets through an internetwork (a
    collection of networks, e.g., the Internet)
  • Fragmentation dividing packets into fragments
    and reassembling them to support data links in an
    internetwork with different MTU (maximum
    transmission unit) sizes.
  • Addressing provides unique number to identify
    each node on each subnet

17
IP-PDU header fields
  • see Appendix E in text, page 557
  • version field - current version is IPv4 (no
    versions 1-3)
  • next version is IPv6
  • total length - maximum bytes is 65,535 (216) but
    most are lt1500 bytes
  • time to live - number of seconds packet can exist
  • Each router reduces number by one, at 0 packet is
    discarded
  • protocol transport layer protocol at
    destination where data portion of packet is
    passed (TCP or UDP)
  • checksum - checks errors in IP header only, not
    reliable
  • packets with bad headers are discarded

18
IP-PDU header fields
  • source and destination IP address fields
  • see IP Addresses slide for more information
  • identification, flags, and fragment offset if an
    IP Packet will not fit in a single Data Link
    layer frame, it must be fragmented for
    transmission
  • Ethernet/PPP frames hold a maximum of 1500 bytes
    however many WAN links use 576 byte frames

19
IP Addresses
  • IPv4 uses 32 bits in address fields (source and
    destination)
  • these numbers are organized into classes (see
    next slide)
  • most owners of IP classes use only a fraction of
    their addresses
  • dotted decimal notation - consist of four octets
    of numbers between 0 and 255
  • octet each group of 8 bits, 28 256
  • octets are separated by dots

20
Network Classes (the Network Part) Reference
only, not on exam
Note look for first zero in binary address to
determine class
21
IP Address Components
  • IP address has 2 parts network part and local
    part
  • Network part - sometimes called the netid
    (prefix)
  • identifies the subnet
  • Local part - sometimes called the hostid (suffix)
  • Subnet Mask delineates netid and hostid used
    to further divide a network into subnets
    Example 255.255.255.0
  • On TCP/IP networks, subnets are defined as all
    devices whose IP addresses have the same netid

22
Special IP Addresses
  • 127.xxx.xxx.xxx
  • Local loopback address. The value of the last 3
    bytes are ignored. The datagram with this IP
    address is never transmitted over the network.
  • xxx.255.255.255 or xxx.xxx.255.255 or
    xxx.xxx.xxx.255
  • Directed broadcast address. The datagram with
    this IP address is received by all the hosts in
    the specified network. The x represents the
    network ID (netid) bits.

23
IPv6 - IP Version 6
  • In 1994, the IETF defined Ipv6 as next IP
    protocol in response to IPv4 Problems
  • Address Demand and Depletion
  • IPv6 uses 128 bit address fields, 2128 is about
    1040 (each square meter of the earths surface to
    have 1024 addresses)
  • IPv4 uses 32 bit address fields, 232 is about
    4.1 billion
  • Packet flow - primarily for streaming, IPv6 adds
  • Flow Label field added to control the routing of
    special packets
  • Priority field used to identify high priority
    services (e.g., email - low, telnet - high)
  • Security - IPv4 contains no security fields, IPv6
    adds
  • Security field - provides for packet encryption
    using DES
  • Authentication field - provides for packet
    authentication

24
IPv6 Compatibility with IPv4
  • To solve the problem of how to use both address
    methods at the same time IPv6 puts an IPv4
    address into the IPv6 structure.
  • A special address format called an IPv4 mapped
    address has 80 zero bits, followed by 16 one bits
    followed by an IPv4 address. An IPv6 router will
    know that the address is an IPv4 address and
    route it according to the IPv4 rules.
  • Tunneling - If an IPv6 address encounters an IPv4
    router then the address space of the IPv4 router
    is insufficient to move the address and data.
  • The IPv6 packet is fragmented into several IPv4
    packets and routed through the IPv4 system.
  • At some point a router that is capable of both
    methods will reassemble the IPv4 tunneled packets
    back into an IPv6 packet and it is on its way.
Write a Comment
User Comments (0)
About PowerShow.com