Application layer protocols define the rules and data formats used for communication between software applications over a network. These protocols ensure that information can be correctly formatted, sent, received, and understood by both the sender and receiver in a computer network.
File Transfer Protocol (FTP)
Purpose
FTP (File Transfer Protocol) is a standard network protocol used for transferring files from one host to another over a TCP/IP-based network such as the Internet. It enables users to upload, download, and manage files on a remote server, providing a reliable way to share large files between computers.
Port numbers
Port 21 is used to establish the control connection between the FTP client and server. It is used for sending commands and receiving responses.
Port 20 is used for data transfer in active mode, where the server initiates the data connection to the client.
How FTP works
The client opens a control connection to the server on port 21.
The user is prompted to log in using a username and password.
After authentication, commands like LIST, RETR, and STOR are sent to manage files and directories.
A separate data connection is opened (on port 20 or a dynamic port) for transferring files.
FTP client-server interaction
Practice Questions
FAQ
Active and passive FTP determine how the data connection is established between the client and server. In active FTP, after the client connects to the server’s command port (port 21), the server initiates the data connection back to the client from port 20 to a client-specified port. This setup can be problematic with modern firewalls or NAT (Network Address Translation) because it requires the client to accept incoming connections, which many security systems block by default. In passive FTP, the client initiates both the command and data connections. After the initial connection to port 21, the server provides a random port for data transfer, and the client initiates a connection to that port. Passive mode is more firewall-friendly because all connections are outbound from the client. Due to these differences, passive FTP is preferred in most modern networks, especially where clients are behind firewalls or routers that block incoming traffic for security reasons.
IMAP (Internet Message Access Protocol) and POP3 are both used to retrieve emails from a server, but they differ significantly in how they manage messages. POP3 downloads emails to the client’s device and usually deletes them from the server, which is efficient for single-device access and offline use. However, it lacks synchronisation between devices, so if an email is read or deleted on one device, those changes won’t reflect elsewhere. IMAP, on the other hand, keeps emails on the server and allows multiple clients to view and manage the same mailbox. Actions like reading, deleting, or moving emails are synchronised across all devices. IMAP is ideal in today's environment where users access their email on multiple platforms (e.g. phone, laptop, webmail). It also supports folder management and flags. Although not covered directly under the POP3 focus of the main topic, IMAP is an essential comparison for understanding how modern email clients operate across devices in contrast to POP3’s older, more limited model.
Web servers redirect HTTP to HTTPS to ensure secure communication by forcing encryption through TLS. When a user types a web address or clicks on an unsecured link, their browser may send an HTTP request by default. Modern web servers are often configured to automatically detect this and respond with a 301 or 302 HTTP status code to redirect the browser to the secure HTTPS version of the site. This is done through server-side rules, such as .htaccess configurations in Apache or server blocks in Nginx. The redirection ensures that login forms, payment information, and other sensitive data are encrypted in transit, preventing interception by attackers. Additionally, using HTTPS improves trust with users and can enhance SEO rankings. This technical redirection is critical because it not only improves security but also ensures compliance with modern browser standards that may block or warn users about unsecured HTTP content, even for static pages.
Email clients either request manual input from the user or use auto-discovery mechanisms to configure account settings. When using auto-discovery, the client queries predefined DNS records or uses standard domain naming conventions (e.g. imap.domain.com, smtp.domain.com) to determine available services and supported ports. Many providers implement the Autodiscover (for Exchange) or AutoConfig (for IMAP/POP3) protocols, which allow the client to fetch the server settings (ports, encryption type, protocol) by contacting a well-known service endpoint. Clients can then automatically select the correct ports—110 or 995 for POP3, 143 or 993 for IMAP, 25/465/587 for SMTP—and apply the right encryption settings, such as STARTTLS or SSL/TLS. If automatic discovery fails or is unsupported, users must manually input the server addresses, ports, and authentication methods. This flexibility is important for both casual users and IT administrators, allowing compatibility with a wide range of email hosting environments and ensuring that emails are transmitted securely and reliably.
When a browser encounters an expired, invalid, or untrusted HTTPS certificate, it immediately blocks access and displays a security warning to the user. This certificate is essential for verifying the website’s identity and establishing an encrypted connection using TLS. The browser checks the certificate’s validity period, the issuing certificate authority (CA), and whether it has been revoked or altered. If any of these checks fail, the connection is considered insecure. Browsers like Chrome or Firefox show a warning such as “Your connection is not private” and often prevent users from proceeding unless they bypass the warning manually (which is discouraged). Technically, the TLS handshake fails because the browser cannot trust the identity of the server. Expired certificates may indicate poor server maintenance, while mismatched domain names can suggest phishing attempts. For websites handling personal or financial data, failing these checks not only causes users to leave but may also result in the site being flagged as unsafe by search engines or browser vendors.
