Dear networkseclearners, welcome to this new tutorial on the Computer Networks Ports and Protocols. In today’s tutorial, I would like to present you an interesting topic which is Computers Networks Ports and Protocols. If you have never heard about any of these words, don’t worry, I will explain them in the first section of this tutorial. 😉 Ports and Protocols are essential elements for networks to operate properly and make communication possible. In a nutshell, Ports can be seen like doors that give access to some applications used in network communications. Protocols can be seen like languages or set of rules that network devices shall follow to enable the communications over networks. As you can see, these 2 concepts might seem intimidating at first glance, but they are very easy to understand. If you wanna learn more and become a pundit on networks ports and protocols, I strongly recommend you to read the whole article. It gonna be a very interesting one. 😉
And I even forgot to mention one important reason to read this article. Indeed, if you are aiming at taking the CompTIA network+ certification exam, this tutorial will be a big help because it covers domain 1. Networking concepts and objective 1.4 explain common networking ports, protocols, services and traffic.
Well, enough time ! 😂 Let’s get started by deep diving into ports and protocols. 😉
1. Ports and Protocols In Computer Networks
As promised in the introduction, I am going to use simple and easy to understand terms to explain you these two concepts namely computer ports and protocols. Let’s start with the ports.
1.1 Ports
Ports are a vital part of how communication happens in computer networks. To understand the concept better, let’s use a simple analogy. Imagine a university dormitory, a large building with many rooms each occupied by a student. Every room has a unique number.
Now, let’s think of the building as a computer and each room as an application running on that computer. If a parent wants to call their child (student), they don’t just contact the dorm’s main reception. Instead, they dial a specific extension number that connects them directly to the right room.
In this analogy, let’s break down the following :
- The dormitory (building) can be seen a computer
- The rooms can be seen as applications or services available on a computer
- The room numbers can be seen as ports
- The phone system can be seen as the computer network that delivers data and enables connections
Just like the phone system needs the correct room number to connect the call, a computer uses port numbers to direct incoming data to the right application. Without ports, the computer wouldn’t know which software should handle the data it receives. I hope you know understand the ports concept very well with this simple analogy. If it is not the case and if you have a doubt, drop a comment or contact me directly with your questions and I will very glad to help you.😊 Now, as you master the ports concept, let’s discuss a little bit more the protocols concept before deep diving into the details. Stay focused ! 💪
1.2 Protocols
Well, you have probably seen a website address like this : https://networkseclearning.com
At least, this website is probably your favorite one! 😊
But have you ever wondered what “https” means? Well, this is exactly one example of protocol. In Computer networks, protocols are basically a set of rules or standards that computers follow when they communicate with each other. You can think of them as languages that computers use to understand each other. Without common protocols, devices would not be able to exchange data properly. I think protocols concept is easier to understand than ports. I hope you understood it. If not, don’t worry and stay focused. We gonna get into the details in the upcoming sections. 💪
2. Ports fundamentals
Now, since you are familiar with ports and protocols, let’s deep dive into the fundamentals of ports. In fact, Ports are numbered from 0 to 65,535 and are categorized in 3 groups which are :
- Well-known ports group : numbered from 0 to1,023 such as FTP(20,21), SMTP(25), HTTP(80 ) and HTTPS(443)
- Registered ports : numbered from 1,024 to 49,151
- Ephemeral Ports : numbered from 49,152 to 65,535, temporary, short-lived ports for dynamic use.
Both Well-known and Registered Ports are registered with IANA ( Internet Assigned Numbers Authority) for specific applications or services whereas Ephemeral Ports don’t require any registration and anyone can use them.
3. Most Common Protocols and Ports in Computer Networks
Let’s take some time here to talk in details the most common protocols and ports in computer networks . Let’s start with the main protocols used in computer networks.
3.1 Transmission Control Protocol (TCP)
Let’s start with one of the most common and most important computer protocols which is the Transmission Control Protocol or just TCP for short. This TCP protocol works behind the scenes every time you browse a website, stream a video or send an email. Indeed, TCP lives at the transport layer of the OSI model and plays a big role in making sure data travels safely from one device to another. But wait what does OSI model mean? I am sure that if you have never come accross this word, you probably asked yourself what it is. Don’t worry, I am planning on writing an article on the OSI model for March 2025. So, don’t forget to subscribe to the newsletter to get notified as soon as the article on OSI model is released.😉 Well, in a nutshell, OSI stands for Open Systems Interconnection and is a standardized model of communication between all computers. This OSI standardizes how computer systems communicate and this is very important since computer systems are made by many manufacturers.
Let’s come back to our intial topic which is TCP. 😉 I am sure, you wanna get to know more details about TCP and wonder what it exactly does. Indeed, you can think of TCP as a well organized postal worker in the sense that it takes your big package of data, breaks it into smaller chunks (called packets) sends them across the network and then carefully reassembles everything at the destination. In addition to this incredible job of formatting data for the transmission and at reception, TCP also makes sure no packet (chunk of data) gets lost, scrambled or duplicated along the way. As you have already probably guessed it, both computers at transmission and reception shall know TCP language or have it implemented in order to use it to exchange data. 😉 Now, let’s talk about one amazing feature of TCP called the three way handshake.
3.1.1 The Three Way Handshake
As as I said previously, this a fascinating feature of TCP as this can be found also in humans interractions. As a matter of fact, most of the time, before humans start talking, they greet each other first somehow be it via phone or face to face. Most of the time when humans meet, they greet each other by shaking hands before starting any interraction. TCP also similarly requires this greeting between computers before they can start exchanging data or “talk”. Isn’t it fascinating? 😊 This TCP greeting is done through a process called the three-way handshake which consists in the following steps :
- The sender device greets the receiver device with a SYN (synchronize) message (see it as “hello”)
- The receiver device answers with a SYN-ACK (synchronize-acknowledge) (see it as “I have received your “hello”).
- The sender replies with an ACK (acknowledge). (see this as “OK, let’s start talking).
Once this friendly handshake is done, both sides can start exchanging data safely and reliably. Isn’t it wonderful? This is exactly what a protocol does : it defines rules sets and language network devices use to be able to communicate and understand each other. 😉
Don’t think that this is only what TCP has to offer. As said above TCP also makes sure no data packet got lost, scrumbled during the transfer from the sender to the receiver. It does thanks to another interesting feature which is error handling and flow control.
3.1.2 Errors handling and Flow Control
Now, what if some packets get lost or damaged on the way during a communication? Have you ever imagined that things can go wrong during a communication between computers? No worries while using TCP because it will avoid such communication issues. Indeed, TCP uses sequence numbers and acknowledgments to detect problems and if anything is missing, it simply resends it. TCP also keeps things flowing smoothly. It uses a method called windowing to control how much data is sent at once. This way, the receiving device is not overwhelmed and the network stays stable and efficient. In simple terms, TCP helps keep the digital communication between computers from being total chaos. It ensures your messages and downloads arrive in one piece and in the right order. TCP is awesome for communication where data or packets lost is not acceptable. For communication scenarios where data lost is acceptable, another protocol which is more simple and faster called UDP is used.
3.2 User Datagram Protocol (UDP)
UDP stands for User Datagram Protocol and is another key player in the transport layer of the OSI model. Unlike TCP which prioritizes reliability, UDP is all about speed and simplicity. UDP is used or chosen over TCP when we need to get data across quickly and can afford packets lost or to skip confirmations (like waiting for an acknowledgment).
Unlike TCP, UDP doesn’t bother with handshakes or connection setups. Basically with UDP, there is no greeting before starting the data exchange because It simply sends datagrams or small packets of data from one device to another without checking whether they arrive or in what order. Due to this feature, UDP is commonly called a connectionless protocol. I am sure you are doubtful about the reliability of UDP and are probably wondering if it is safe to use UDP for data transmission. Well, this UDP “fire-and-forget” style might sound risky but it is perfect for situations where speed matters more than perfect accuracy like streaming video, online gaming or making a VoIP (Voice over IP) call. I have mentioned datagrams and this corresponds to the chunks of data in UDP. In TCP, we called them “packets”. Do you remember? 😉
UDP datagrams are efficient and come with :
- Source and destination port numbers
- A length field (to indicate the size of the packet)
- A checksum (basic error detection)
Compared to TCP heavier packet structure whose header is 20-60 bytes, UDP datagrams headers are smaller and simpler, just 8 bytes which make them quick to process and light on resources. In addition to the headers simplicity, UDP doesn’t keep track of what it sent or whether it was received and therefore there is no tracking and no retransmission if something goes missing. That’s what makes it so fast.
And just like TCP, UDP uses ports to identify different services on the same device. So even though it is more relaxed, it is still organized.
3.3 Internet Control Message Protocol (ICMP)
ICMP might not be as famous as TCP or UDP but it part of the Internet Protocol Suite and operates at the network layer of the OSI model. Unlike TCP and UDP, ICMP is not used to send data between devices and its job is more about diagnostics and communication health checks.
Indeed, Instead of transferring files or messages, ICMP is used to send control and error messages. For example, it can let you know if a host is unreachable, if a router’s buffer is full or if a packet’s time-to-live (TTL) has expired. It’s like the messenger that tells you why something did not go as planned on the network.
One of the most well-known uses of ICMP is the ping command. When you ping a device, you are sending ICMP echo request messages to see if the host responds. If it replies with an echo reply, you know the device is reachable. Ping also gives you round-trip time info which helps measure how long it takes for a packet to go there and back which is handy for checking latency.
ICMP messages are pretty lightweight. Each message has a small header with three key parts:
- Type : tells you what kind of ICMP message it is
- Code : gives more details about the type
- Checksum : helps detect errors in the message itself
Unfortunately, ICMP has been used in some well-known cyberattacks. Here are a couple of examples :
- ICMP flood attack : This overwhelms a system with echo requests (pings) and can lead to a Denial of Service (DoS). In bigger attacks, it’s part of a Distributed DoS (DDoS) campaign.
- Ping of Death : This attack used oversized ping packets to crash vulnerable systems although most modern systems are now protected against this.
Because of these risks, many network admins block ICMP traffic at the firewall level. While that boosts security, it also makes network troubleshooting harder since tools like ping and traceroute will not work properly.
3.4 Web Ports and Protocols
When you browse the web, your computer is not just randomly shouting into the void, it is rather using specific ports and protocols to talk to web servers. the two ports that rule the Web are indeed 80 and 443.
3.4.1 Port 80
Port 80 is used by HTTP which stands for HyperText Transfer Protocol. This is the original method for delivering web pages from servers to your browser. It works at the application layer of the OSI model and forms the backbone of early web communication. Again, don’t worry, the next article on OSI model is coming out soon. 🙏
When you type in a URL that starts with http://
, your browser connects through port 80 by default. HTTP requests content and delivers it back to you in plain text meaning that no encryption is involved. This makes it fast but not secure. Anyone snooping on the network could potentially see what you are browsing or even tamper with it. That’s a more secure version of HTTP came out.
3.4.2 Port 443 For The Secure Web (HTTPS)
Port 443 is used by HTTPS, the secure version of HTTP. That little “S” stands for Secure and it means all communication between your browser and the website is encrypted using SSL or TLS. HTTPS keeps your data safe from prying eyes and tampering which is critical when you are logging into accounts, entering credit card numbers or doing online banking. These days, most websites automatically redirect you from port 80 to port 443 to keep your browsing secure.
3.5 Emails and Protocols
When you hit “send” on an email, a lot of things happen in the background. Behind the scenes, a lot of protocols and specific ports are working together to make sure your message reaches the right inbox securely and efficiently. So, let’s review the most used email protocols and ports.😊
3.5.1 SMTP
SMTP stands for Simple Mail Transfer Protocol and is the standard protocol used to send emails from one server to another. Think of it as the mail man of the internet.😉 Port 25 is the traditional SMTP port but beware, it sends data in plain text, which is not secure. SMTP only sends emails but it doesn’t handle receiving them.
To make things more secure, there is SMTPS (SMTP Secure) which is not a new protocol but rather a way of securing SMTP using encryption (SSL or TLS). Ports 465 and 587 are commonly used for secure email sending.
3.5.2 POP3
POP3 or Post Office Protocol version 3 is one of the original ways to get emails from a remote server to your local device and uses port 110 (insecure). It is designed to download and delete messages from the server. There is also POP3S, the secure version of POP3 which encrypts the connection using SSL/TLS. POP3S and runs over port 995 making email retrieval much more secure.
3.5.3 IMAP
IMAP stands for Internet Message Access Protocol and is what most people use today for managing email across devices. IMAP works over port 143 (insecure on its own) and unlike POP3, IMAP lets you access and manage your emails directly on the server. This means your messages stay in sync across your phone, laptop and tablet.
IMAPS, the secure version of IMAP runs over port 993 and uses encryption to protect your data during transmission.
3.6 File trasnsfert protocols and ports
When you need to move files between systems over a network, several different protocols can handle the job each with its own strengths, weaknesses and use cases. Let’s start with the first one.💪
3.6.1 FTP
FTP stands for File Transfer Protocol and is one of the oldest file transfer protocols out there. It uses two ports:
- Port 21 for sending control commands
- Port 20 for the actual data transfer
It’s simple and widely supported but there is a catch and it sends everything in plain text which means it’s not enough secure.
3.6.2 SFTP
SFTP stands for Secure File Transfer Protocol and is the secure and more modern version of FTP. It actually runs over SSH and uses port 22. Everything is encrypted so that your data stay protected during the transfer. If security matters, SFTP is the way to go.
3.6.3 TFTP
TFTP and Trivial File Transfer Protocol for short is like FTP minimalist cousin. It uses in fact port 69 and skips over features like authentication or directory browsing. Since it is so basic, it is mostly used for sending simple files in trusted environments definitely not ideal for sensitive data.
3.6.4 SMB
SMB or Server Message Block for short is mainly used for sharing files, printers and other resources between computers on the same local network especially in Windows environments. It runs on port 445. On Linux, a version called Samba allows SMB-style sharing too. SMB is not meant for sending files over the internet but more suited for a LAN.
As you can see all the file transfer protocols serve different use cases. Here is a short recap :
- Use FTP (ports 20 and 21) for basic, no-frills transfers.
- Use SFTP (port 22) if you want secure file sharing.
- Use TFTP (port 69) for quick, simple transfers in low-risk environments.
- Use SMB (port 445) for sharing files between systems inside local networks, especially on Windows.
3.7 Remote Access Ports and Protocols
Remote access protocols allow you control systems and networks remotely which is super helpful in today connected world. Basically, you can troubleshoot from New York a network device located in London. Wonderful, right?🤔 This magic happens thanks to the following protocols.
3.7.1 SSH
SSH or Secure SHell is the go-to protocol for secure remote access. It runs on port 22 and provides a protected channel for managing systems over an unsecured network. Everything is encrypted and authentication is solid which is why network admins use it all the time to control servers or web applications.
3.7.2 Telnet
Telnet or Teletype Network is one of the earliest remote login tools. It uses port 23 and allows you to access another computer on the same network. The downside? It sends everything in plain text which makes it vulnerable to snooping. For this reason, Telnet has mostly been replaced by SSH for security.
3.7.3 RDP
RDP stands for Remote Desktop Protocol and is a Microsoft protocol that lets you access a Windows system with a full graphical interface. It runs on port 3389 and supports features like encryption, smart card logins and ways to optimize bandwidth. It is especially useful when you need to work with the actual desktop of a remote Windows machine.
3.8 Network Service Ports and Protocols
Network services are essential for devices to communicate, identify each other and exchange key system information across a network. These services rely on specific ports and protocols to function smoothly.
3.8.1 DNS
DNS or Domain Name System for short helps translate easy-to-remember website names (like google.com) into IP addresses that computers can use. It typically uses port 53 over UDP for basic queries and responses. For larger data transfers, it can also use TCP.
3.8.2 DHCP
DHCP or Dynamic Host Configuration Protocol automatically assigns IP addresses and network settings to devices when they join a network. It listens for requests on port 67 (UDP) and responds back to the client on port 68 (UDP). This makes getting connected quick and hands-free.
3.8.3 SQL Services
These are the protocols used by databases to handle requests and manage data.
- Microsoft SQL Server uses port 1433.
- MySQL typically uses port 3306.
3.8.4 SNMP
SNMP for Simple Network Management Protocol is used to gather data from and manage network devices like switches, routers and servers. It uses port 161 (UDP) for regular polling and port 162 (UDP) for alerts or trap messages. It is key for monitoring and maintaining network health.
3.8.5 Syslog
Syslog or System Logging is a standard way for devices to send event logs to a central server. It helps track what is happening across your network. The Syslog server receives these logs on port 514. It usually uses UDP but can switch to TCP when more reliable delivery is needed.
These services and their ports play a critical role in keeping networks efficient, organized and secure.
CONCLUSION
In this tutorial, we explored the fundamental concepts of ports and protocols in computer networks which are essential building blocks that enable smooth and secure communication between devices. We learned how ports act like numbered doors that direct data to the correct application while protocols serve as the rules or languages that ensure devices understand each other during communication.
We also reviewed common ports and the protocols associated with web services, file transfers, emails, remote access and network services, along with their typical use cases and security implications. If you are preparing for the CompTIA Network+ exam or if you are simply aiming to strengthen your networking knowledge, I think that understanding these ports and protocols concepts is crucial and of a very big importance. I hope you enjoyed this journey and learnt all the way. 😊
If you now master all these concepts or have become knowledgeable, I am very happy.😊 If not and if you have some doubts about anything, don’t hesitate share your questions or thoughts in the comment section. 🙏
As always, keep on exploring, stay curious and don’t forget that knowing your ports and protocols gives you a strong foundation for mastering network operations and security.
If you found this tutorial helpful, please, feel free to leave a comment or share it with friends or colleagues who might benefit from it. Your feedback and support help the networkseclearning community grow!🙏