What Is a Network Port
A port is a numbered channel on a computer that lets it run many network services at once and keep their traffic separate — if the IP address from the IP-address topic is like a building's street address, the port number is like the specific apartment or office inside it that a message is meant for. The need arises because a single device, with just one IP address, usually does many networked things at the same time: it might be serving web pages, handling email, and running other services all at once. The IP address gets a packet to the right machine, but the machine then needs to know which of its running programs the packet is for — and that is exactly what the port number provides. Every network connection is therefore identified by the combination of an IP address and a port, so traffic for the web service and traffic for email arrive at the same machine but are routed to different programs because they carry different port numbers. Many ports have well-known, standard numbers tied to the protocols from the protocol topic, which is how your software knows where to send things by default: web traffic over HTTP uses port 80, secure web traffic over HTTPS uses port 443, and email relay over SMTP uses port 25. This is why, when the server topic showed running local sites on ports like 8081 and 8083, each site could run on the same machine simultaneously without clashing — they simply listened on different port numbers. A program that offers a service "listens" on a particular port, waiting for connections to arrive there, while a program making a request connects to the service's port on the other machine. Ports also connect directly to the firewall and staying-safe-online topics, because controlling network security is largely about controlling ports: a firewall's rules are often expressed in terms of which ports may be reached, so closing an unused port removes a possible way in, and leaving unnecessary services listening on open ports is a classic security risk. The simple takeaway is that a port is a numbered doorway for network traffic on a single machine: the IP address identifies the computer and the port identifies which service on it, well-known port numbers let standard protocols find each other automatically, running many services at once just means using different ports, and managing which ports are open is a core part of keeping a machine secure.