The port is a 16-bit number. It is occasionally seen on Web addresses:
http://www.someplace.com:80/
where 80 is the default for the HTTP server. Nowadays the port
number is seldom included in the URL since the default is almost
always used.
Various applications using particular protocols use standard
port values as shown in tthe above diagram. Unix machines reserve
ports 1-1023 for standard services. Windows machines do not restrict
the use of these ports but to make your Java programs portable,
it is wise to use port values above 1023.
One type of firewall assigns port numbers to the machines behind
its shield. Incoming packets all go to the same IP address but
with different port numbers according to the machine they are
destined for. This both reduces the exposure and accessibility
to the machines and reduces the need for universally unique IP
numbers. Behind the firewall, the local addresses can be the same
as in other LANs since the LANs are isolated from each other.
This is one of the reasons that four bytes remain sufficient
for the internet despite the explosion in the number of devices
with IP addresses. (Nevertheless, a sixteen byte version of IP
addressing called IPv6 will gradually take over.)