http requests — a few steps involved.

First off, this post is more of a personal note than attempt to explain to anyone or an attempt to capture every detail.It was triggered by a monitoring script failing and passing from different systems.
If you would get accurate information, go here
and here. Or just google anatomy of a http request.

these are the steps:
1.Namespace lookup to the DNS Server (a,request to DNS Server for the hostname’s ip address;b,DNS Server replies with ip address)

2.Establish a tcp connection with the server at that ip address
a,Client sends a SYN packet*
b,Server sends back a SYN-ACK packet
c,Client sends a ACK packet, establishing TCP connection

3.Send the HTTP request to the server

4.Wait for the server’s response

5.Web server processes the request, finds the resource, and sends the response to the Client. Client receives the first byte of the first packet from the web server, which contains the HTTP Response headers and content.

6.Load: Client loads the content of the response.

a,Web server sends second TCP segment with the PSH** flag set.
b,Client sends ACK. (Client sends ACK every two segments it receives. from the host)
c,Web server sends third TCP segment with HTTP_Continue.
d,Close: Client sends a a FIN packet to close the TCP connection.

7.Load the server’s response
a,parse the css,html and js
b,Create the DOM object
c,Render the page, load the js
d,execute the js, modify the DOM and CSS layouts if required.

*– Well i looked up here
and it means a specific formatted set of bytes.I’ll leave the wikipedia page to explain exact format.

** –it is a specific bit on the data being sent by the server, and is supposed to be interpreted as asking to push the buffered data.

Actually a standard tcp packet is 3 byte packet.Some bits are reserved for flags like that PSH message.

Leave a Reply

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

You are commenting using your 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

This site uses Akismet to reduce spam. Learn how your comment data is processed.