HTTP Transaction

Host: Computers connected to a network are often called ‘hosts’, regardless if they’re hosting a service or not.

  • A single host can have many services running.
  • Client and server can be on the same computer/host (e.g. when you’re building a small application). However, most often, they are on different hosts.

Server: a computer or computer program that manages access to a centralized resource or service in a network.  The server can refer to the host computer itself or the service running on the host computer.  Servers are often classified by the services they provide (e.g. web server).

  • Servers provide services to many clients.
  • Servers communicate with other servers to handle aspects of those client requests they don’t provide.  This is referred to as inter-server or server-to-server communication.
  • A server has one IP address and multiple ports.

Client: can refer to a software or a device that accesses a service made available by a server.  If the server is on another host, the client accesses it via a network.

HTTP transaction:  When a client or browser makes a single request for HTTP content, the followings happen:

  1. DNS Lookup: Client sends DNS query to local ISP DNS server and DNS sever responds with the IP address for the requested website (eg. google.com).
  2. Client establishes TCP connection with google.com’s IP address.
  3. Client sends HTTP request to google’s web server.
    • HTTP requests are made via REST methods: GET, POST, PUT, DELETE, OPTIONS, HEAD.
  4. Server processes the request, finds the resource, and sends the response to client.
  5. Client formats the response and displays it on the browser.
  6. Client closes or reuses the connection for further request.

HTTP Header:  contains additional info about the client browser, the requested page, and the server, etc.

HTTP Body: contains either the resource sent (in a POST request) or the resource fetched (in a POST response).

Screen Shot 2018-01-01 at 9.52.41 PM.png
Example of an HTTP Request
Screen Shot 2018-01-01 at 9.55.57 PM.png
Example of an HTTP Response

 

Routing: parses the url received by a server to identify and trigger target behavior requested by user via that url.

Screen Shot 2018-01-01 at 9.36.40 PM

Workers: background jobs that run behind the scenes.

  • daemon: OS processes that handle background jobs.  They’re basically servers for OS requests.
  • Cron: a daemon that schedules OS jobs or workers.

 

Advertisements
HTTP Transaction

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s