Docsity

HTTP and Web Server - Local Area Network - Lecture Slides, Slides of Network security

Partial preview of the text

Download HTTP and Web Server - Local Area Network - Lecture Slides and more Slides Network security in PDF only on Docsity!

HTTP and Web Server

16-

HTTP

  • HTTP is the protocol used by Web applications to exchange information.
  • HTTP is a simple stateless request-response protocol.
  • HTTP uses TCP.
  • Do not be confused with HTML, which is a mark up language for describing a web page’s format.

16- 2

Uniform Resource Locator (URL)

  • It is a pointer to an object or

a service on the Internet.

  • It has five components:
    • Protocol or applications
    • Hostname
    • TCP/IP port
    • Path name
    • File name

16- 4

URL Protocols

16- 5

Why Using Persistent?

  • If we use nonpersistent connections
    • Parallel open
      • “The easiest way to kill the Internet.” said by a famous network researcher, V.B.
      • Before, we have shown that the packet drop rate in the bottleneck router will grow as the number of competing TCP connections grow.
    • Serial open
      • Better for congestion control but suffer longer download delay.
      • Why, each object needs to open a new TCP connection, which needs to take 1.5 RTT to finish its 3-way handshaking. When the requested object returns, it is already 2 RTT later. 16- 7Docsity.com

Persistent Connections

  • If we use persistent connections:
    • The Internet congestion is better controlled.
    • The download delay is reduced from 2*RTT to only 1 RTT.
      • No need to go through the 3-way handshaking.
      • Only the request/response delay.
  • To further reduce download time, a pipelining technique can be used (the default mode). - Requests can be sent before the response of the previous request returns. - All objects can be requested and returned in one RTT. (if they are small.)
  • The server will close the connection after a certain period of idle time. (^) 16- 8

HTTP Response Message

Used for cache control

16- 10

Methods (Requests)

  • GET
    • Retrieve whatever information identified by the URL.
  • HEAD
    • Identical to GET but does not return the entity body
  • POST
    • Transfer some information to the server. The function performed depends on the requested URL.
  • PUT
    • Overwrite a file
  • DELETE
    • Delete a file
  • OPTION
    • Ask a server to return its feature and capability
  • TRACE
    • Each back service for debugging purposes (^) 16- 11

Stateless Causes Problems

  • HTTP is a stateless protocol, which makes it robust in presence of crashes.
  • However, in some applications, the web server may want to keep states for a client. - Example 1: Only allow an already authenticated user to access some web pages. - Example 2: Implement shopping carts, which can accumulate (remember) the goods that a user has ordered. - Example 3: Personalized commercial product advertisements (know your preferences, know you personal home page, etc…)
  • Authenticate header and cookies are two solutions. 16- 13Docsity.com

Authentication

  • The client first sends an ordinary request to the server.
  • The server then responds with empty body with “401 Authorization Required” status code. - WWW-Authenticate: header is included which specifies how to do the authentication
  • The client resends the request which this time includes an “Authorization” header. - This header typically will include the username and password information.
  • After obtaining the first object, the client continues to send the cached username and password in subsequent requests. 16- 14

Cookies Applications

  • If the server requires authentication but does not want to hassle a user with a password prompt every time.
  • If a server wants to remember a user’s preference so it can provide targeted advertisement.
  • If the server wants to implement a shopping cart or log in a user to his home page automatically when the user contacts the web site such as Yahoo.
  • Problem: Cookies poses problems for nomadic users who access the same site from different machines.
  • Problems: There are also many privacy issues. 16- 16

Cache Control Mechanism

  • To reduce network bandwidth usage and download delay, cache is often used.
  • Cache can be employed either at the client, server, or proxy side. - Client side: very good for “back” button - Server side: multiple cache servers sitting in front of the server to do load balancing - Proxy side: multiple clients share the cache in the proxy server
  • A proxy server acts as both a client and a server.
    • It receives Web requests from clients.
    • If its cache has the requested objects, these objects are returned to the clients.
    • Otherwise, it makes requests to the origin server to download the requested objects into its cache, and then returns the objects to the clients. 16- 17Docsity.com

Conditional GET

  • To save network bandwidth, we do not want

a client to retrieve an object again if it is

still the same as what is cached on the client.

  • By using the Last-Modified and If-

modified-since headers, the GET method

becomes the conditional GET.

  • The client will retrieve the object only if it

has been modified since the last download.

16- 19

Conditional GET Example

16- 20