← Back Published on

Network Ports

What is a port?

A port is also called a logical connection. And it is not a physical connection.

Why do we use it? To exchange information and it specifies what exact service or program will be used. Think of it as an envelope! You have many different types of envelopes to send data to someone or someplace. Do you use a fast small one or a secure heavy slow one? Does the envelope have insurance on it? Or are you just sending it and hoping it gets to the receiver?

This brings us to our next point TCP and UDP!

TCP is transmission control protocol and is connectionful- the packets sent and received are confirmed and are reliable

UDP user datagram protocol is used for a connection-oriented file transfer exchange. And it is connectionless meaning packets are sent and not confirmed or guaranteed for arrival to the host. A lot faster than TCP as well

So… A port will be assigned a primary transfer protocol of UDP or TCP. so for example port 22 secure shell uses TCP or UDP depending on the configurations and needs. And Port 23 telnet uses TCP as it is used for administrative command line interfaces (important info right?) we can't afford those packets of data not getting to the destination!

How many ports are there you might ask? There are between 0 and 65535 ports.

Port numbers are broken down into 3 main categories

  1. Is known as well-known ports or system ports 0-1023
  2. users or registered ports port 1024-49151 are ports that companies and developers use for a specific reason
  3. Lastly is dynamic or private ports. From 49152-65535 these ports any device can use. When your computer is searching the web or is connecting to a service online. These are the ports the computer attaches to your IP address so that when packets come back, it comes back to the correct port.

When we use an IP address, a port number is always attached to it when we are performing a task and sending a packet out.

When we pair an IP and a port together it is could look something like this 43.14.200.10:21 - port 21

Let's look at how this works!

-we want to connect to walmart.com to look for slippers

-we click the link that has slippers on sale!

-your computer reads the information associated with the advertisement and obtains the IP address and Port associated with the Walmart shopping site

-packets are sent to the server associated with the destination

-when we do this, it sends our IP and port assigned in the packet

-in the packet is our information as well as the destination IP and port of the server to buy hose cozy slip slips

-the Walmart server receives the request and your information. and sends it to the port associated with the purchasing of those slippers

-the destination then sends you more information about those slippers back to your assigned IP and to the port, it was sent from

-your computer gets it and sends it up to you, as the user

-and you make your decision to buy some warm cozy feet mittens

below is a good picture I found to explain this again



Depending on the ports associated with the service, depending on what action is performed. let's take a look at a few ” well-known ” ports

Port 20 and port 21. This is FTP - file transfer protocol and is used for sending files with clients and servers    TCP and UDP are used

Port 22. SSH is a secure shell and is a “tunneling” Protocol. This protocol is used for creating secure network connections    TCP and UDP are used

Port 23 Telnet- often used with administrative command line interface to equipment such as routers and switches but it is unencrypted so it is best used on a local area network because the data is in clear text    TCP is used

Port 25. SMTP - simple mail transfer protocol is used for email and uses TCP

Port 53. DNS is a domain name system it creates human-readable domain names. Allowing us to type walamrt.com instead of the Walmarts IP address TCP and UDP are used

Port 67 and 68. DHCP Dynamic host configuration protocol. This provides network addresses to configure TCP and IP addresses. Port 67 is used by the server and port 68 is used by the client UDP is used

Port 80. HTTP - hypertext transfer protocol and it is used to send and receives data from a web server the web traffic then is seen by the user in plain text TCP is used

110 also known as POP3 - post office protocol version 3 is used to receive mail from a remote server to a local email client. Very straightforward TCP is used

111 portmapper is required to run NFS - network file system - both on the client and the server and is responsible for the dynamic binding of remote programs TCP and UDP are used

137 NetBios network basic input and output system - it allows applications on different computers to talk and establish sessions and share resources like files and printers and see each other on the LAN local area network TCP and UDP are used

143 IMAP internet message protocol - a mail protocol used to access emails on a local client's remote web server nonencrypted IMAP port!  Uses TCP and UDP

161 and 162 SNMP simple network administration protocol and is a collection of network management and monitoring protocols. Often we use this with firewalls, routers, switches, servers, etc… 161 is used for SNMP managers to communicate with SNMP agents with UDP

162 is used when agents send unsolicited SNMP traps to the SNMP manager

443 HTTPS hypertext transfer protocol and is a web browsing port. This I sussed for secure data transfer and over 95 percent of the globe uses HTTPS TCP is used


587 SMTP simple mail transfer protocol and is the default mail submission port. Best results for submitting an email to be routed. Also provides TLS encryption and is secure.  UDP is used….. Just kidding, totally TCP

993 IMAPS which is IMAP over SSL. So, IMAP traffic travels over a secure socket to a secure port. This IMAP connection is encrypted and helps with data privacy.  TCP is used

This has been a quick overview of network ports and how they relate to servers and hosts.