Skip to content
Home » How Web Works, Internet Protocols

How Web Works, Internet Protocols

If you are an aspiring engineer its important for you to understand the different protocols. Because they form the foundation of how the internet works and how web applications communicate with each other. Understanding web protocols is essential for building robust and reliable web applications.

Here are some reasons why web protocols are important for developers:

  1. Interoperability: Web protocols enable different systems and technologies to communicate with each other. By following a set of standard protocols. Developers can ensure that their applications can interoperate with other web applications and services.
  2. Security: Web protocols such as HTTPS and SSL/TLS provide a secure way to transmit data over the internet. By using these protocols, developers can protect sensitive user data and prevent unauthorized access to their web applications.
  3. Performance: Web protocols such as HTTP/2 and WebSocket allow for faster and more efficient data transmission between web applications. By optimizing their use of web protocols, developers can improve the performance and responsiveness of their web applications.
  4. Compatibility: Web protocols are constantly evolving. And developers need to stay up-to-date with the latest protocols and standards. To ensure that their applications are compatible with modern web technologies and devices.

Web protocols are essential for building robust, secure, and high-performing web applications. That can communicate effectively with other web applications and services. Developers who understand web protocols and their underlying principles are better equipped to build web applications. That meet the needs of their users and can adapt to changing technologies and environments. Its important that you have a basic understanding of the following protocols and tools. That can be used to understand and analyse these protocols.

HTTP

HTTP (Hypertext Transfer Protocol) is an application protocol that is used for transmitting data over the internet. It is the foundation of data communication for the World Wide Web. And governs how web browsers and servers communicate with each other.

HTTP works by defining a set of rules for how data is transmitted between a client (such as a web browser). And a server (such as a web server). When a client requests a resource (such as a web page or an image) from a server. It sends an HTTP request to the server, which then responds with an HTTP response containing the requested resource.

HTTP uses a set of standard methods, or verbs, to define the actions that can be performed on a resource. These methods include GET (to retrieve a resource). POST (to submit data to be processed by a server). PUT (to update an existing resource). And DELETE (to delete a resource).

HTTP also defines a set of status codes that are used to indicate the outcome of a request. Such as 200 OK (for a successful request) or 404 Not Found (for a request that could not be fulfilled).

Over the years, various versions of HTTP have been developed, with HTTP/1.1 being the most widely used version. Until the introduction of HTTP/2. Which improves performance by allowing multiple requests to be sent over a single connection.

DNS

DNS (Domain Name System) is a system that translates human-readable domain names (such as www.example.com). Into IP (Internet Protocol) addresses that are used by computers to identify each other on the internet. It acts as a phone book for the internet. Allowing users to access websites and services using memorable domain names instead of numerical IP addresses.

When a user enters a domain name in their web browser. The browser sends a DNS query to a DNS resolver. Which is typically provided by the user’s Internet Service Provider (ISP) or a public DNS provider such as Google DNS or Cloudflare DNS. The resolver then looks up the IP address associated with the domain name by querying a series of DNS servers. That are authoritative for the domain. Starting with the top-level DNS servers and working its way down to the authoritative DNS server for the specific domain.

Once the IP address has been resolved. The web browser can then establish a connection to the server associated with that IP address. Allowing the user to access the website or service associated with the domain name.

DNS also supports other types of records. Such as MX records for mail servers and TXT records for text-based data. And can be configured to provide additional services such as load balancing and failover.

SMTP

SMTP (Simple Mail Transfer Protocol) is a protocol used for sending email messages over the internet. It is the standard protocol used for email transmission between server. And is also used by email clients to send outgoing mail to a mail server.

SMTP works by defining a set of rules for how email messages are transferred between a client (such as an email application) and a server (such as a mail server). When a client wants to send an email. It establishes a connection with the mail server and sends a series of commands to transfer the message to the server.

SMTP defines a number of commands that can be used to transfer email messages. Including HELO (to identify the client to the server). MAIL FROM (to specify the sender of the message). RCPT TO (to specify the recipient of the message). DATA (to specify the content of the message), and QUIT (to terminate the connection).

SMTP also supports a number of security features, such as encryption and authentication, to protect the transmission of email messages.

SMTP is typically used in combination with other protocols, such as POP (Post Office Protocol) and IMAP (Internet Message Access Protocol), which are used for receiving email messages.

FTP

FTP (File Transfer Protocol) is a protocol used for transferring files over the internet. It is a standard network protocol that allows files to be exchanged between computers on a network, including the internet.

FTP works by defining a set of rules for how files are transferred between a client (such as a computer or a mobile device) and a server (such as a file server or a web server). When a client wants to transfer a file to or from a server, it establishes a connection with the server and sends a series of commands to initiate the transfer.

FTP defines a number of commands that can be used to transfer files, including USER (to specify the username), PASS (to specify the password). PUT (to upload a file to the server), GET (to download a file from the server), and LIST (to list the contents of a directory on the server).

FTP supports a number of security features, such as encryption and authentication, to protect the transmission of files.

FTP has been widely used for many years as a simple way to transfer files between computers, but it has largely been superseded by more secure and efficient file transfer protocols such as SFTP (Secure File Transfer Protocol) and FTPS (FTP over SSL).

Tools to Explore
Telnet

Telnet is a network protocol used to provide a bidirectional interactive communication session between a client and a server over a computer network. It is often used to remotely log in to a server or other network device, such as a router or switch, and allows users to access the command-line interface of the remote device as if they were physically present at the device.

Telnet works by establishing a connection between a client and a server over a network, typically using the Transmission Control Protocol (TCP) as the transport protocol. Once the connection is established, the client and server can exchange data in both directions, with the user typing commands and receiving responses from the remote device.

Conclusion

Telnet is a simple protocol and has been widely used for many years, but it has several security vulnerabilities. For example, it transmits all data, including login credentials and other sensitive information, in plain text, making it vulnerable to interception by malicious actors. As a result, Telnet has largely been superseded by more secure protocols, such as SSH (Secure Shell), which encrypts all data transmitted over the network.

To use the Telnet command, you will need to have a command prompt or terminal window open on your computer. The exact steps for accessing the command prompt or terminal window will depend on your operating system.

Once you have the command prompt or terminal window open, you can use the following syntax to use the Telnet command:

telnet [host] [port]

Where:

  • [host] is the hostname or IP address of the server you want to connect to.
  • [port] is the port number of the service you want to connect to on the server.

For example, to connect to a Telnet server running on a machine with IP address 192.168.1.100 on port 23 (the default Telnet port), you would enter the following command:

telnet 192.168.1.100 23

Once you have established a connection, you will see a prompt indicating that you are connected to the remote host. You can then enter commands or interact with the remote device as if you were physically present at the device. To exit the Telnet session, you can enter the quit or exit command at the prompt.

Note that Telnet is an insecure protocol and should not be used to transmit sensitive information, such as login credentials or personal data. If you need to establish a secure connection to a remote host, you should use a protocol such as SSH instead.

NetCat


Netcat (short for “networking utility”) is a versatile command-line tool used for networking purposes. It is also known as the Swiss Army Knife of networking tools due to its ability to perform a wide range of network-related tasks. Netcat can act as a client or a server, and it can work with both TCP and UDP protocols.

Some common uses of Netcat include:

  • Port scanning: Netcat can be used to scan a network for open ports and identify which services are running on those ports.
  • File transfer: Netcat can be used to transfer files between computers over a network.
  • Chatting: Netcat can be used to create a chat session between two computers.
  • Banner grabbing: Netcat can be used to grab banner information from a network service running on a specific port.
  • Remote shell access: Netcat can be used to establish a remote shell session with a computer over a network.

Netcat is a powerful tool, but it should be used with caution as it can also be used for malicious purposes. As such, it is important to ensure that you have the necessary permissions to use Netcat and that you are using it ethically and responsibly.

Wireshark

Wireshark is a free and open-source packet analyzer that allows you to capture, analyze, and troubleshoot network traffic. Here are the general steps to use Wireshark:

  1. Download and install Wireshark: You can download Wireshark from the official website and install it on your computer.
  2. Start a capture: Launch Wireshark and select the network interface you want to capture from. Click the “Start” button to start capturing packets.
  3. Analyze the captured packets: Once Wireshark is capturing packets, you can view the captured packets in real-time or save them for later analysis. You can filter the packets by protocol, source or destination IP address, or other criteria.
  4. Interpret the results: You can use the various statistics and graphs provided by Wireshark to interpret the captured packets and identify any network issues. You can also export the captured data to other file formats for further analysis.

Some common use cases for Wireshark include:

  • Network troubleshooting: Wireshark can help you identify issues such as slow network performance, packet loss, and network congestion.
  • Security analysis: Wireshark can be used to identify suspicious network activity and potential security breaches, such as unauthorized access attempts or data exfiltration.
  • Protocol analysis: Wireshark can be used to analyze network protocols and identify any protocol-related issues or errors.

It is important to note that Wireshark captures all network traffic, including sensitive data such as passwords and other confidential information. As such, it should only be used on networks that you have permission to monitor and analyze, and you should take appropriate measures to secure any captured data.

NSLOOKUP

NSLOOKUP is a command-line tool that is used to query Domain Name System (DNS) servers to obtain domain name or IP address mapping information. Here are the general steps to use the nslookup tool:

  1. Open a command prompt: To use NSLOOKUP, you will need to open a command prompt or terminal window on your computer.
  2. Launch NSLOOKUP: Once you have the command prompt open, type nslookup followed by the domain name or IP address you want to query. For example, to look up the IP address for the domain “example.com”, you would type nslookup example.com and press enter.
  3. View the results: NSLOOKUP will display the IP address of the domain you queried, as well as the name and IP address of the DNS server that provided the information.
  4. Query a specific DNS server: By default, NSLOOKUP queries the DNS server configured on your computer. If you want to query a specific DNS server, you can use the following syntax: nslookup [domain] [server]. For example, to query the domain “example.com” using the DNS server at IP address 8.8.8.8, you would type nslookup example.com 8.8.8.8.
  5. Other options: NSLOOKUP also provides various other options for querying DNS servers, such as specifying the type of DNS record to look up (e.g. A, MX, or NS records) and setting various timeout and debugging options.

NSLOOKUP is a powerful tool for troubleshooting DNS-related issues and for obtaining information about DNS servers and domain names. However, it should be used with caution and only on networks that you have permission to access

Exercise

  • explore telnet command
  • connect to an http server to get a response
  • make use of CURL command to fire a request to an existing webserver to get the response