Androidgrl's Blog About 3D Printing & Tech, by Jamie Kawahara

There and Back Again: An HTTPS Request’s Tale, part 3

In the previous post we learned about HTTPS and how the browser and server establish an encrypted way to communicate through the SSL Handshake. Now the browser is ready to actually make a connection to the server! The way that the browser and server establish a connection is called the “TCP three-way handshake”.

TCP stands for Transmission Control Protocol and is a standard that defines how to establish and maintain a network conversation. The handshake consists of three steps:

  1. The browser sends an Initial Sequence Number (ISN) to the server. The ISN is a randomly generated number, let’s say for our example it’s 2000.

  2. The server receives the ISN, and replies to the browser with it’s own ISN, let’s say it’s 5000. The server also acknowledges that it received the browser’s ISN by adding 1 to it (2000 + 1) and sending that number (2001) back as an acknowledgement number.

  3. The browser receives the server’s ISN (5000), and acknowledges that it received it by adding 1 to it and sending it back an acknowledgement number of 5001.

Now that the handshake as been made, a connection is open and the browser and server can start sending data using the agreed upon sequence and acknowledgement numbers. For a more detailed description of this process see TCP Three Way Handshake.

Now that the browser and server have a connection, the browser can actually make a request to the server for the website’s content. This brings us to the final part of our journey- the HTTP request/response!