Application Layer Protocols
To truly understand how to make an application layer protocol, it is important to understand existing examples of application layer protocols.
There are lots of different types of existing application layer protocols that are well established. These categories are:
- Management Protocols (BOOTP, DNS, SNMP, NTP)
- Remote Communication Protocols (Telnet, SSH)
- File Transfer Protocols (FTP, TFTP)
- Mail Application Protocols (SMTP, POP3, IMAP4)
- Browser Protocols (HTTP, HTTPS, TLS/SSL)
- Voice over IP (VoIP) Protocols (SIP, RTP)
BootP will automate the IP Address configuration process. Today, this is replaced by Dynamic Host Configuration Protocol (DHCP)
DNS - Domain Name Services
DNS converts domain names to IP addresses. For example, it will convert example.com into 188.8.131.52 so you don't have to remember 184.108.40.206.
NTP - Network Time Protocol
NTP will automatically synchronize clocks over a network.
SNMP(v3) - Simple Network Management Protocol
SNMP(v3) will gather statistics from network devices. Useful for gathering information from network devices like "How many bytes have gone into this network device?". Version 3 is the only encrypted version of this protocol, so it is recommended to use version 3 always.
Remote Communication Protocols
Telnet - Telecommunication Network
Telnet can be used to remote connect to another machine over a network (Like SSH but unencrypted). Since it's unencrypted, it's not recommended that you use this protocol to connect to any machine with private data.
SSH - Secure Shell
SSH can be used to remote into another machine, except unlike Telnet, SSH is of course secure and encrypted (end to end), so you do not need to worry about the security of the connection.
File Transfer Protocols
FTP - File Transfer Protocol
Allows the transfer of files between two machines. This is similar to a remote communication protocol, however it is only used for the transfer of files (technically SSH can also be used to transfer files through the scp command, but FTP was built for file transfer and it's probably better for doing such a thing in most cases). FTP offers a full suite of functionality for transferring and modifying files on a remote machine.
TFTP - Trivial File Transfer Protocol
This is a much simpler way to transfer files. It can only read and write files, so not but better than just using SSH. In fact, unless your use case requires it, you really shouldn't use TFTP ever because it requires no authentication to transfer files if set up on a machine. Anybody can connect and read or write files this way without authentication.
Mail Application Protocols
SMTP - Simple Mail Transfer Protocol
SMTP is often used for sending mail between mail servers. We need another protocol for receiving mail.
POP3 - Post Office Protocol Version 3
POP3 is used to receive mail, and it is designed for intermittent connectivity.
IMAP4 - Internet Message Access Protocol v4
IMAP4 is another mail protocol similar to POP3, however IMAP4 is a lot more functional. It keeps states like Read, Replied, Deleted, etc…
Browser Application Protocols
HTTP - Hypertext Transfer Protocol
HTTP is the most common browser protocols there are, and it's even used in non browser applications.
HTTPS - Hypertext Transfer Protocol Secure
Just HTTP with an extra layer of encryption through TLS/SSL. HTTPS ensure your data does not get intercepted by a man-in-the-middle attack. If someone tries to intercept your data, it would be almost impossible to decrypt.
TLS/SSL - Transport Layer Security and Secure Sockets Layer
TLS is the updated version of SSL. These are encryption layers to encrypt data in a browser.
Voice over IP (VoIP) Protocols
SIP - Session Initiation Protocol
Sets up and tears down media calls.
RTP - Real-Time Transport Protocol
RTP is the main protocol used in VoIP along with SIP. This is the protocol that is used to actually transfer media, like your voice, over the network. SIP is only used to set up the call, make sure it's still running, and tear down the call.