Reputation:
I understand that there is a limit of ports available (2^16) but I don't understand how an operating system is managing the ports. Is there like a microcontroller inside that is multiplexing all the opened ports? How is a port actually making a connection with the operating system? Is a port connecting to a specific process in the OS? I know that my questions are vague and ițm very sorry about that. Maybe ișm thinking the wrong way.
Upvotes: 4
Views: 791
Reputation: 3988
Port is an application(or process) specific construct representing an endpoint on a host. A remote party can identify an application(or process) on the host with the unique port it is bound to.
Unix like operating systems provide bind(2)
system call to bind your process to a specific port so that the operating system can forward all the messages destined to a port to the right process.
Port is represented by a 16-bit number ranging from 1 to 65535. However, the port numbers below 1024 are reserved for core network services.
Upvotes: 3
Reputation: 310884
A port is just a number in the operating system, or more accurately in the TCP/IP protocol stack. It isn't a piece of physical hardware. No microcontroller, no magic. Just software.
Upvotes: 3