Here’s a quick refresher on what ports are because that needs to be crystal clear in order for you to understand multiplexing and demultiplexing.
Sockets, which are gateways to applications, are identified by a combination of an IP address and a 16-bit port number. That means
port numbers exist. However, they start from port
0
0
so they exist in the range of
0
−
65535
0−65535
.
Sockets have associated port numbers!
Sockets have associated port numbers!
Out of these, the port numbers
0
−
1023
0−1023
are well-known and are reserved for certain standard protocols. Port
80
80
, for instance, is reserved for HTTP whereas port
22
22
is reserved for SSH.
Refer to page 16 of RFC 1700 for more details regarding what port number is assigned to what protocol