A port is a communication channel that computers use to send and receive information from other computers. Think of them as doorways - only imagine there are a total 65,536 of these doorways! Each “doorway” will let a computer receiving or sending the data know how to use the file in question.
However, this also leaves 65,536 ways for a hacker or virus to infiltrate a network - so learning the basics of ports is extremely vital.
A Bit of Background Information
Before we jump to the specifics, let’s do a little review. Computers connect to each other based on the TCP/IP model. In short, this is a model that lets computers send and receive data to each other. This model works on the basis that all computers have a unique IP address. These IP addresses act as a location - much like your home address. With an IP address, and the right authority, you can connect to any computer in the world!
But, we just ran into two problems here. First, connecting to any computer in the world can pose as a serious security threat. Second, how do the computers receiving the data know what to do with it? We have solved both of these problems with the invention of the port. The port number that is transmitted with the data tells the receiving computer what kind of data it is - and also how to use it. We can close these ports when they aren’t in use, or even deny all access to them completely. This keeps unwanted traffic out of a network - in particular, Trojans, malware, viruses, hacking attempts, and the like.
Is it really necessary to have 65,536 ports?
Of course! Each port is reserved for a certain task, as assigned by the IANA, or Internet Assigned Numbers Authority. The most common ports are numbered 0 through 1,023. These are commonly referred to as “the well known” ports. One of the most commonly used “well known” port, is port 80 - the HTTP port. This is the port that allows you to access a webpage - so it’s the backbone of the internet! So what on earth do we need the rest of the 64,513 ports for?
Ports numbered from 1,023 to 49,151 are for registered services. Governments, organizations, and institutions such as NASA have registered ports in this spectrum. It’s likely that you won’t be dealing with these too much. The rest of the 16,385 ports are up for grabs by anyone. This can be anything from special access for certain programs, to viruses and backdoors. Generally, it is best to limit port access, which most firewalls do automatically, unless you know what you are doing.
It is important to note that firewalls only use a passive protection. This means that you may receive a Trojan from the internet, or port 80, and install it. Luckily, this Trojan will need to communicate with the attacker to do most forms of attacks - which firewalls can easily see as “bad” traffic, and block it. In this case, a little common sense can go a long way. Generally, it’s best to download items from only trusted websites or trusted individuals.
Don’t feel obligated to seal off every port you have - but do be wary in allowing certain ports to be open. This goes for local traffic too, not just the internet traffic. A computer may be manipulated from other computers on a network, just like traffic from the internet. In this case a firewall will provide protection, if configured correctly. They say that an ounce of prevention is worth a pound of cure - and this obviously holds true when configuring ports for your own network security.