Networking Jargons
HTTP (Hyper Text Transfer Protocol)
HTTP is a protocol for fetching resources such as HTML documents. It is the foundation of any data exchange on the Web and it is a client-server protocol, which means requests are initiated by the recipient, usually the Web browser. A complete document is typically constructed from resources such as text content, layout instructions, images, videos, scripts, and more.
Clients and servers communicate by exchanging individual messages. The messages sent by the client are called requests and the messages sent by the server as an answer are called responses.
Protocol: It is a system of rules that define how data is exchanged within or between computers. Communications between devices require that the devices agree on the format of the data that is being exchanged. The set of rules that defines a format is called a protocol.
Hyper Text: Hypertext is the foundation for web pages, where links (commonly referred to as hyperlinks) connect different pages or resources.
Why Use HTTP?
HTTP is a protocol that enables communication between browsers and servers, helping developers track data, build secure connections (e.g., via cookies), and access human-readable website names through DNS. It also allows developers to inspect and debug web pages using tools like the network tab and view page source.
DNS
DNS (Domain Name System) is a hierarchical and decentralized naming system for Internet connected resources. DNS maintains a list of domain names along with the resources, such as IP addresses, that are associated with them.
The most prominent function of DNS is the translation of human-friendly domain names to a numeric IP address, this process of mapping a domain name to the appropriate IP address is known as a DNS lookup.
Stateless Protocol
HTTP is called as a stateless protocol because each request is executed independently, without any knowledge of the requests that were executed before it, which means once the transaction ends the connection between the browser and the server is also lost.
A stateless protocol is like ordering food at a fast-food restaurant where the server forgets you after each order. For example, if you order a burger and then later come back to order fries, the cashier treats it as a completely new order and doesn’t remember that you previously ordered a burger.
Session: It is the total time used for an activity. The user session starts when he logs-in to a particular network application and ends when the user logs out from the application or shutdowns the system.
Cookie: The cookies help the websites to keep track of the user's browsing history or cart information when they visit their sites. It store vales in key-value pair.
HTTP Headers
HTTP headers let the client and the server pass additional information with a message in a request or response. Headers can be grouped according to their contexts:
Request headers: Contain more information about the resource to be fetched, or about the client requesting the resource.
Response headers: Hold additional information about the response, like its location or about the server providing it.
Request and Response Model
Type of Request:
GET: The GET method requests a representation of the specified resource. Requests using
GET
should only retrieve data and should not contain a request content.POST: The POST method submits an entity to the specified resource, often causing a change in state or side effects on the server.
DELETE: The DELETE method deletes the specified resource.
PUT: The PUT method replaces all current representations of the target resource with the request content.
Response codes:
Responses are grouped in five classes:
Informational responses (
100
–199
):These responses indicate that the request has been received and that the server is continuing to process it. These codes are typically used for providing interim responses.
100 Continue: The server acknowledges that the client can continue with the request.
101 Switching Protocols: The server is switching to a different protocol as requested by the client.
Successful responses (
200
–299
):These indicate that the request was successfully received, understood, and processed by the server. These are the most common responses for successful HTTP requests.
200 OK: The request was successful, and the server has returned the requested data.
201 Created: The request was successful, and a new resource was created as a result (e.g., when creating a new user).
204 No Content: The request was successful, but there’s no content to return (e.g., after deleting a resource).
Redirection messages (
300
–399
):These codes indicate that further action is needed to fulfill the request, usually involving the user being redirected to another URL.
301 Moved Permanently: The resource has been permanently moved to a new URL. The client should use the new URL in future requests.
302 Found: The resource is temporarily located at a different URL.
304 Not Modified: The resource has not been modified since the last request, so the client can use the cached version.
Client error responses (
400
–499
):These codes indicate that the request was invalid or cannot be processed due to an error in the request from the client (e.g., malformed syntax or missing authentication).
400 Bad Request: The server cannot understand the request due to invalid syntax.
401 Unauthorized: The client must authenticate to access the requested resource.
404 Not Found: The requested resource could not be found on the server.
Server error responses (
500
–599
):These codes indicate that the server encountered an error while processing a valid request. These are errors on the server-side.
500 Internal Server Error: The server encountered an unexpected condition that prevented it from fulfilling the request.
502 Bad Gateway: The server received an invalid response from an upstream server while trying to fulfill the request.
503 Service Unavailable: The server is temporarily unable to handle the request (e.g., due to overload or maintenance).
HTTP/2
HTTP/2 is a major revision of the HTTP network protocol.
The primary goals for HTTP/2 are to reduce latency and head-of-line blocking by enabling full request and response multiplexing, minimize protocol overhead via efficient compression of HTTP header fields, and support for request prioritization.
TCP (Transmission Control Protocol)
TCP (Transmission Control Protocol) is an important network protocol that lets two hosts connect and exchange data streams. TCP guarantees the delivery of data and packets in the same order as they were sent. TCP's role is to ensure the packets are reliably delivered, and error-free.
IP (Internet Protocol)
A network-layer protocol responsible for addressing and routing data packets between devices across networks.
FTP (File Transfer Protocol)
FTP or File Transfer Protocol is said to be one of the earliest and also the most common forms of transferring files on the internet. Located in the application layer of the OSI model, FTP is a basic system that helps in transferring files between a client and a server.
URL (Uniform Resource Locator)
A URL (Uniform Resource Locator) is the address of a unique resource on the internet. It is one of the key mechanisms used by browsers to retrieve published resources, such as HTML pages, CSS documents, images, and so on.