A Port Number basically identifies how to access an application. If we have two web servers out on the internet:
- Google Web Server - This will have an IP Address e.g. 10.150.1.1/32. There will be a port number associated to access it, e.g. 80.
- Amazon Web Server - This will have an IP Address e.g. 172.150.1.1/32. There will be a port number associated to access it, e.g. 80.
In order to access the Google Web Server we have to have the below:
- Source IP - This will be the IP on our NIC card of our machine. This will be defined either via DHCP or statically assigned.
- Destination IP - We know the destination IP of the Google's Web Server is 10.150.1.1/32.
- Destination Port Number - We know the destination port of the Google's Web Server is 80.
- Source Port Number - This is a randomly assigned Ephemeral port assigned to the end user device. This can be in the range fromΒ 49152β65535 on most modern systems.
For example, if our source IP is 10.10.10.1/24 going to 10.150.1.1/32 on port 80. Our source port may well be 49152.
Every connection flow will have its own unique ephemeral source port. This means in order to access the Amazon Web Server we have the below:
- Source IP - This will be the IP on our NIC card of our machine. 10.10.10.1/24
- Destination IP - We know the destination IP of the Amazon Web Server is 172.150.1.1/32
- Destination Port Number - We know the destination port of the Amazon Web Server is 80.
- Source Port Number - This is a randomly assigned Ephemeral port assigned to the end user device. This can be in the range from 49153β65535.
It cannot use the same SOURCE port number it uses to initiate the connection/flow to Google's Web Server. It has to use a number in the range from 49153β65535 since 49152 is used by an existing flow.
These are two separate connection flows.
Comments