HTTP and HTTPS Protocols
HTTP is an application layer protocol used to access and transfer data over the world wide web. It’s a client-server protocol that runs on top of the TCP/IP family of protocols and uses the request/response model. It uses port number 80. In HTTP, the client sends a request message to the server; HTTP establishes a TCP connection between the client and the server, HTTP delivers a request to the server, which collects the data that was requested, and after the server sends data to the client, the connection is terminated.
HTTPS is a secure extension of HTTP that provides security to the data sent over the world wide web. This protocol allows transferring data in an encrypted form, which is important, for instance, when users transmit sensitive data such as login credentials. To encrypt communications, HTTPS uses an encryption protocol called Transport Layer Security (TLS), formerly known as Secure Sockets Layer (SSL). HTTPS uses port number 443 for data communication.
TCP Model
A practical network model developed by the Department of Defense in the 1960s to support communication between different network devices on the internet. The TCP model is subdivided into five layers, each containing specific protocols:
-
Application Layer — the uppermost layer, combining the OSI model’s session, presentation, and application layers. Users interact with the application and network resources through this layer. Uses protocols like HTTP, DNS, SMTP, FTP, and TELNET.
-
Transport Layer — in charge of flow control (controlling the rate at which data is transferred), end-to-end connectivity, and error-free data transmission. Uses TCP and UDP.
-
Network Layer — adds IP/logical addresses to the data segments to form IP packets and finds the best possible path for data delivery. Uses IP, ARP, and ICMP.
-
Data Link Layer — divided into two layers: MAC (Media Access Control) and LLC (Logical Link Control). The MAC layer encapsulates IP packets from the network layer into frames; the LLC deals with flow control and error control.
-
Physical Layer — translates bits into signals for transmission on a medium. This is the layer where real communication takes place.
What Happens When You Enter “google.com”
-
Your browser looks up its cache to see if that website was visited before and the IP address is known.
-
If it can’t find the IP address for the requested URL, it asks your operating system to locate the website. Your OS checks the host file for the address of the specified URL. If the URL isn’t found there, the OS makes a DNS request to find the IP address of the web page.
-
The first step is to ask the resolver (or ISP) to look up its cache to see if it knows the IP address. If the resolver doesn’t know, it asks the root server to ask the
.COMTLD (Top Level Domain) server — if your URL ends in.net, then the TLD server will be.NET, and so on. The TLD server again checks its cache to see if the requested IP address is there. -
If not, it will have at least one of the authoritative name servers associated with that URL, and after going to the name server, it returns the IP address associated with your URL. All of this is done in a matter of milliseconds. Once the OS has the IP address, it hands it to the browser, which then makes a GET request to that IP address — the browser makes the request to the OS, which packs the request in the TCP traffic protocol and sends it to the IP address.
-
On its way, it’s checked by both the OS’ and the server’s firewall to make sure there are no security violations. Upon receiving the request, the server sends a response with the IP address of the chosen server along with the SSL certificate to initiate a secure session (HTTPS).
-
Finally, the chosen server sends the HTML, CSS, and JavaScript files back to the OS, which in turn gives them to the browser to interpret. And then you get your website.