Ephemeral Ports: Why That Web Connection Uses Port 52744
A firewall log can show an ordinary web connection using port 52744. That high number may be the temporary port your own computer chose, rather than a new service the website started running.
An ephemeral port is a port number assigned temporarily for network communication, often automatically by the operating system.
A port number helps software sort network traffic; it isn't a physical socket for a cable. A firewall filters network traffic according to rules, and its log records details of the traffic it observes.
What Do Port Numbers Actually Do?
“Temporary” doesn't mean one page or a few seconds
An application can ask the operating system to choose an available local port instead of naming one itself. That assignment gives the communication a local number other devices can send replies to.
The port can remain in use while the application keeps the communication going.
A browser, for example, doesn't necessarily close its connection when a page finishes loading. The HTTP/2 standard, which defines a widely used version of web communication, allows multiple exchanges over one persistent connection.
So the number of browser tabs isn't a reliable count of how many temporary ports you're using.
TCP, the Transmission Control Protocol, delivers data in order and handles retransmission when portions go missing.
Closing a TCP connection doesn't always make its details immediately reusable. The system can retain a record in TIME_WAIT, a state that helps keep delayed traffic from an old connection from being mistaken for a new one.
Which numbers can the system choose?
The Internet Assigned Numbers Authority, or IANA, sets aside 49152–65535 as the Dynamic and/or Private port range. These numbers aren't assigned by IANA to individual services.
An operating system's actual automatic-assignment range can differ.
The Linux kernel documentation, for example, specifies a default local range of 32768–60999. Administrators can change that range and reserve numbers that automatic selection should avoid.
That's why an ephemeral port can fall outside IANA's Dynamic and/or Private range without indicating a fault. Check the system's configuration before treating one published range as a universal rule.
- Give every phone, laptop and TV a steadier connection with Wi-Fi 6.
- Stop the buffering at busy hours, with room for many devices at once.
- Replace an aging router and get stronger coverage across more of your home.
Read both ends of the conversation
Return to port 52744. Suppose your browser uses it to connect to a website's TCP port 443, the registered port for HTTPS, the encrypted form of web communication.
In the outgoing traffic, 52744 is the source port and 443 is the destination port. In the replies, those roles reverse: the website sends from 443 to your computer's 52744.
The traffic also carries IP addresses, the network addresses used to reach the two ends. TCP identifies a connection using both addresses and both port numbers, so a port number alone isn't a complete connection identifier.
An ephemeral assignment doesn't mean the computer has opened a general-purpose service for anyone to use. Whether unrelated incoming traffic is accepted depends on the software and filtering rules involved.
When investigating a surprising number, check which program used it, where the traffic was going and which direction the log describes. The high number may be normal; the surrounding activity is what needs explaining.
Source Ports: The Number Changes Roles When the Reply Returns

Sockets: How a Program Gets a Way to Communicate

Network Ports: How Numbers Sort Traffic Between Programs

QUOTE:
"Amateurs hack systems, professionals hack people."
