Sitemap
sunny Gupta

sunny Gupta

Software Engineer , , Writer for Towards Dev

ESSENTIAL Network Protocols

1 . HTTP

HTTP (Hypertext Transfer Protocol) is one of the foundational protocols of the World Wide Web, used for transmitting hypertext documents.

HTTP defines how messages are formatted and transmitted, and how web servers and browsers should respond to various commands.

HTTP request from a client to server is independent; the server does not retain any state information between requests.

Press enter or click to view image in full size

HTTP Methods :

. GET: Requests data from a specified resource.

. POST: Submits data to be processed to a specified resource

. PUT: Updates a current resource with new data.

. DELETE: Deletes a specified resource.

. HEAD: Similar to GET, but it transfers the status line and header section only.

. PATCH: Applies partial modifications to a resource.

2 . HTTPS

HTTPS (Hypertext Transfer Protocol Secure) is an extension of HTTP designed to ensure secure communication over a computer network, primarily the Internet. It does this by using Transport Layer Security (TLS) or its predecessor, Secure Sockets Layer (SSL), to encrypt the data being exchanged between the client and the server.

Key Features of HTTPS :

1 . Encryption:

  • Purpose: Encrypts the data exchanged between the client and server to protect it from eavesdroppers.
  • Benefit: Ensures that even if data is intercepted, it cannot be read without the decryption key.

2 . Data Integrity:

  • Purpose: Ensures that the data sent and received has not been tampered with during transmission.
  • Benefit: Protects against data corruption and malicious alterations.

2 . Authentication:

  • Purpose: Verifies that the website the client is communicating with is actually the intended website.
  • Benefit: Prevents man-in-the-middle attacks by ensuring that the server the client is connecting to is the legitimate one.

3 . FTP :

FTP (File Transfer Protocol) is a standard network protocol used for transferring files between a client and a server on a computer network. It is one of the oldest protocols used on the Internet and allows for the upload, download, and management of files on a remote server.

The client and the server communicate using two types of connections. These are –

  1. Control connection
  2. Data connection

Control Connection

The client and server communicate to send and receive commands through the control connection. FTP uses a control connection to transmit information such as user name, password, remote directory change commands, file retrieval, storage instructions, etc. It is initiated via port 21.

Data Connection

The data connection allows the transfer of file data between the client and server. It is initiated via port 20. FTP works via two different modes. These are:

  1. Active Mode: When a client starts a session through a command channel, the server initiates a data connection and begins exchanging information with the client.
  2. Passive Mode: The server sends the client the necessary information to initiate a data channel through the command channel. To avoid being blocked by firewalls and NAT routers, the client always uses passive mode while making connections.

Types of FTP Protocol

1 . Secure FTP (SFTP) :

SFTP stands for The SSH File Transfer Protocol. SFTP is a layer above SSH that provides all the security and authentication capabilities of SSH. This protocol is rapidly replacing FTP/S and has already overtaken legacy FTP. It provides the full range of features available via these protocols with high reliability and higher levels of security.

Press enter or click to view image in full size

2 . Trivial FTP (TFTP):

TFTP is a simplified version of FTP that uses UDP instead of TCP for data transfer. Not all programs can use TCP because of its complexity and the features they don’t require. Regarding client-server interactions, TFTP’s simple structure and low cost make it suitable. TFTP is limited to File Transfer only and does not permit authentications.

TFTP is mainly used for bootstrapping network devices or transferring small files.

Press enter or click to view image in full size

3 . File Transfer Protocol Secure (FTPS):

File Transfer Protocol Secure (FTPS) is the secured variant of FTP, similar to Hypertext Transfer Protocol Secure. Transport Layer Security (TLS) and secure socket layer (SSL) safeguard these protocols. Using FTPS, companies may establish encrypted connections with their clients, partners, and end-users.

FTPS can encrypt either the control connection only (explicit FTPS) or both the control and data connections (implicit FTPS).

Press enter or click to view image in full size

4 . TCP:

TCP (Transmission Control Protocol) is one of the core protocols of the Internet Protocol Suite, commonly known as TCP/IP. It provides reliable, ordered, and error-checked delivery of data between applications running on hosts communicating via an IP network.

Key Features of HTTPS :

1 . Connection-Oriented:

  • Three-Way Handshake: Establishes a connection between the client and server before data is transmitted.
  • State Management: Maintains state information about the connection, including sequence numbers and acknowledgments.

2 . Reliable Data Transfer:

  • Error Detection and Correction: Uses checksums to detect errors and acknowledgments (ACKs) to confirm successful data receipt.
  • Retransmission: Lost or corrupted packets are retransmitted based on the lack of an acknowledgment.

3 . Flow Control:

  • Window Size: Uses a sliding window mechanism to manage the amount of data that can be sent before requiring an acknowledgment, ensuring that the sender does not overwhelm the receiver.

4 . Congestion Control:

  • Algorithms: Implements algorithms like slow start, congestion avoidance, fast retransmit, and fast recovery to manage network congestion.

4 . IP:

The Internet Protocol (IP) is a core protocol of the Internet Protocol Suite (commonly referred to as TCP/IP). It is responsible for addressing, routing, and delivering packets of data from the source host to the destination host across one or more IP networks.

Key Features of IP :

1 . Packet-Switched Protocol:

  • Datagrams: IP encapsulates data into packets called datagrams, each with a header containing addressing and control information.
  • Independence: Each datagram is treated independently and can take different paths to the destination.

2 .Addressing:

  • IP Addresses: Provides unique numerical labels (IP addresses) for each device on a network.
  • Hierarchical Structure: IP addresses have a hierarchical structure to facilitate routing.

3 .Routing:

  • Route Determination: Uses routing tables and protocols to determine the best path for data to reach its destination.
  • Forwarding: Routers forward packets from one network to another based on the destination IP address.

4. Fragmentation and Reassembly:

  • Fragmentation: If a packet is too large for the next network segment, it is divided into smaller fragments.
  • Reassembly: The destination host reassembles the fragments into the original packet.

5 . SMTP:

SMTP (Simple Mail Transfer Protocol) is a protocol used for sending and receiving email. It is a fundamental protocol for email communication on the Internet, responsible for the transfer of messages between email servers and from clients to servers for outgoing mail.

Press enter or click to view image in full size

SMTP Commands:

  • HELO/EHLO: Identifies the client to the server. EHLO is used for Extended SMTP (ESMTP).
  • MAIL FROM: Specifies the sender’s email address.
  • RCPT TO: Specifies the recipient’s email address.
  • DATA: Indicates that the email content follows. The message body is sent after this command, ending with a single period on a line by itself.
  • QUIT: Terminates the session.

Common Use Cases :

  • Sending Emails: From clients (e.g., Outlook, Gmail) to email servers.
  • Email Relaying: Between email servers to route messages to the recipient’s server.
  • Notification Systems: Automated systems to send alerts and notifications via email.

Key Features of SMTP :

Get sunny Gupta’s stories in your inbox

Join Medium for free to get updates from this writer.

1 .Simple and Text-Based:

  • Commands and Responses: SMTP uses plain text commands and responses, making it straightforward to implement and debug.
  • ASCII Format: Emails are sent in ASCII text format.

2 . Client-Server Model:

  • Client: The email client or sending server that initiates the email transfer.
  • Server: The receiving server that accepts the email for delivery to the recipient’s inbox.

3 . Store and Forward:

  • Intermediary Servers: SMTP servers can relay messages to other servers, ensuring delivery even if the recipient’s server is temporarily unavailable.

4 .Push Protocol:

  • Active Transfer: The sending server pushes the email to the receiving server, rather than the recipient server pulling the email.

5 . SSH (Secure Shell):

SSH (Secure Shell) is a protocol used for securely accessing and managing network devices and servers over an unsecured network. It provides a secure channel over an unsecured network by using encryption for data transmission, ensuring confidentiality and integrity of the data.

Press enter or click to view image in full size

Key Features of SSH :

1 .Secure Authentication:

  • Username and Password: Traditional login method using a username and password.
  • Public Key Authentication: More secure method using cryptographic key pairs (private and public keys).
  • Two-Factor Authentication: Additional security layer using methods like TOTP (Time-based One-Time Password).

2 .Data Encryption:

  • Symmetric Encryption: Encrypts the session using a symmetric encryption algorithm (e.g., AES, Blowfish).
  • Asymmetric Encryption: Uses key pairs for secure key exchange and session establishment.

3 .Integrity Protection:

  • Message Authentication Codes (MACs): Ensures data integrity by verifying that the data has not been altered during transmission.

4. Port Forwarding:

  • Local Port Forwarding: Redirects network traffic from a local port to a remote server through the SSH connection.
  • Remote Port Forwarding: Redirects traffic from a remote port to a local server.
  • Dynamic Port Forwarding: Uses a single SSH connection to handle multiple ports, acting as a SOCKS proxy.

5 .Secure File Transfer:

  • SCP (Secure Copy Protocol): Transfers files securely between local and remote hosts.
  • SFTP (SSH File Transfer Protocol): Provides secure file transfer and file system access.

6. Tunneling:

  • Encrypted Tunnels: Creates encrypted tunnels for other network services (e.g., HTTP, VNC).

6. IMAP (Internet Message Access Protocol):

IMAP (Internet Message Access Protocol) is a standard email protocol that enables users to access and manage their email on a remote mail server. It allows for the retrieval of messages and the management of mailboxes, enabling users to organize, read, and delete emails from various devices.

IMAP (Internet Message Access Protocol) is a standard email protocol that enables users to access and manage their email on a remote mail server. It allows for the retrieval of messages and the management of mailboxes, enabling users to organize, read, and delete emails from various devices.

Press enter or click to view image in full size
🧠

Key Features of IMAP :

1 . Remote Mail Storage:

  • Server-Side Management: Emails remain on the mail server, allowing access from multiple devices.
  • Synchronization: Changes made on one device (such as reading, deleting, or organizing emails) are synchronized across all devices.

2 .Mailbox Management:

  • Folders and Labels: Users can create and manage folders or labels to organize emails.
  • Search and Filter: Provides capabilities to search and filter emails on the server.

3. Partial Retrieval:

  • Headers Only: Users can choose to download only the headers of emails to save bandwidth.
  • Selective Download: Allows downloading of specific parts of an email (e.g., attachments or body) as needed.

4 . Status Flags:

  • Read/Unread Status: Marks emails as read or unread.
  • Flagged: Users can flag important messages for follow-up.
  • Deleted: Marks messages for deletion, which can be later expunged.

5. Concurrent Access:

  • Multiple Sessions: Supports multiple simultaneous connections, allowing multiple devices to access the mailbox at the same time.

IMAP Commands

  • LOGIN: Authenticates the user with the server.
  • SELECT: Selects a mailbox to access.
  • FETCH: Retrieves messages or parts of messages.
  • SEARCH: Searches for messages matching specific criteria.
  • STORE: Updates message attributes (e.g., marking as read).
  • COPY: Copies messages to another mailbox.
  • EXPUNGE: Permanently removes messages marked for deletion.
  • LOGOUT: Ends the session with the server.

6. User Datagram Protocol (UDP):

UDP (User Datagram Protocol) is a connectionless transport protocol in the Internet Protocol Suite. It operates at the transport layer and provides a way to send datagrams (packets of data) across networks without establishing a connection. UDP is known for its simplicity and efficiency but does not guarantee delivery or reliability of data transmission.

Press enter or click to view image in full size

Key Features of UDP :

1 . Connectionless:

  • No Handshake: UDP does not establish a connection before sending data.
  • Stateless: Each datagram is handled independently, without maintaining state information.

2 . Minimal Overhead:

  • Header Size: UDP headers are small (8 bytes), consisting of source port, destination port, length, and checksum fields.
  • Less Processing: Minimal processing overhead compared to connection-oriented protocols like TCP.

3 .Unreliable Delivery:

  • No Acknowledgment: UDP does not guarantee delivery or provide acknowledgment of packet receipt.
  • No Retransmission: If a packet is lost or arrives out of order, UDP does not attempt to recover or retransmit it.

4. Fast Transmission:

  • Low Latency: Suitable for applications where speed and efficiency are prioritized over reliability.
  • Streaming: Used in real-time applications like video streaming and online gaming, where occasional packet loss is acceptable.

Software Engineer , , Writer for Towards Dev