Port

A port is a point at which a connection is made, and in computing the word covers two quite different things: a physical connector on a device where a cable plugs in, and a logical number inside the network software that tells the operating system which program should receive incoming data. The two share a name because both are doors into a machine, but one is a piece of metal and plastic and the other is a 16-bit integer in a packet header, and confusing them is one of the most common beginner mistakes. A third, unrelated sense, porting software to a new platform, is a verb about adapting code and is not covered here.

A physical port is a socket on a device that accepts a connector, defining the shape, electrical signals and protocol of the connection. Familiar examples are USB-A and USB-C for peripherals and charging, HDMI and DisplayPort for video, RJ45 for Ethernet, the 3.5 millimeter jack for audio and the card slot for storage. Older machines carried the serial port, standardized as RS-232, and the parallel port for printers, both now mostly gone. The terms are used loosely: strictly, the port is the receptacle on the machine and the plug is the part on the cable, and a connector alone does not guarantee what the port can do, since two sockets with the same shape may support different speeds or features. The USB standard has its own entry, as do the peripherals that use these ports, and what matters here is the general rule that shape, signaling and protocol are three separate layers.

A logical or network port is a 16-bit number, from 0 to 65535, used by the transport protocols TCP and UDP to direct data to the right program on a machine. An IP address identifies a host, but a host runs many programs at once, so each TCP segment and UDP datagram carries a source port and a destination port in its header, as defined in RFC 793 for TCP and RFC 768 for UDP. A server program listens on a port, and a client connecting to it picks a temporary source port, so a connection is identified by the combination of both addresses and both ports. The pairing of an address with a port is what programmers call a socket address, and a socket is the operating system object that holds the endpoint. Ports exist at the transport layer, which means protocols such as ICMP, which has no ports, are not addressed this way.

Packet arrives for 192.0.2.10 port 443
the network card delivers it to the operating system's network stack
Operating system looks it up
IP address matches this machine
the address picks the host
Protocol is TCP
the transport header is read
Destination port 443
is any program listening on it?
A web server process owns the socket for port 443
the data is queued for that process, which handles the HTTPS request
If nothing listens or a firewall blocks it
the connection is refused or silently dropped

Port numbers are divided into ranges that the Internet Assigned Numbers Authority (IANA) manages. The well-known ports from 0 to 1023 are assigned to standard services: 80 for HTTP, 443 for HTTPS, 22 for SSH, 25 for SMTP mail delivery, 53 for DNS, and 21 for FTP control. Ports 1024 to 49151 are registered for specific applications, and 49152 to 65535 are the dynamic or ephemeral range from which clients take temporary source ports. Because the numbers are conventions, nothing stops a web server from using port 8080 or a developer from running a test server on 3000, and a URL can name the port explicitly, as in a local development address ending in a colon and a number. A computer therefore exposes many logical doors even though it may have only a few physical ones.

Two misconceptions follow from the shared name. First, opening a port does not mean touching hardware: it is a software state in which a program is listening, and closing it means that program stops or a firewall refuses the traffic. Second, a port is not inherently dangerous; the risk lies in what is listening behind it and whether that software is up to date, which is why security tools scan for open ports to map what a machine exposes. Port forwarding on a home router, which sends traffic arriving on one outside port to a particular machine and port inside the network, is the usual way a game server or camera is made reachable from outside, and it carries the same caution. Docker and cloud platforms use the same idea in port mappings that connect a container's internal port to one on the host.

Read a port as a numbered doorway: on the outside of a device it is a connector that fixes how two machines can be wired together, and on the inside of the network stack it is a 16-bit number that fixes which program receives the data, and keeping those two meanings separate removes most of the confusion around the word.

Take port further

Ask the copilot about this term, or have our engineers assess it against your process.