cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1075
Views
1
Helpful
6
Replies

Port Numbers

Sagar4
Level 1
Level 1

Why does network devices needs port numbers? Is it only for identifying applications or services used during communication? But what about dynamic port numbers assigned to user devices? If those devices have their own unique ip addresses for identification, then why do they need dynamic port numbers?

6 Replies 6

Please more elaborate

I'm asking about the use of dynamic port numbers assigned to client devices during network communication. Why are they used?

ammahend
VIP Alumni
VIP Alumni

Now sure if I understand your question but let me try,  generally speaking IP is device specific while ports are application/protocol specific, from single IP you can access many application. for e.g. if you simply go to your task manager > Resource Monitor > Network > tcp connection or type netstat -a in windows terminal, you will see all application connection with unique IP of your computer to many application with their respective ports, this is for computer to understand what protocol you are using to communicate with an application

ammahend_2-1682622123860.png

ammahend_1-1682622013959.png

not sure if this answers your question but hope this helps.

 

-hope this helps-

I'm asking about use of dynamic/unregistered ports. The snap which you included also shows ports in the range of 60000s. What is the use of that?

katrin1701
Level 1
Level 1

e.g. Your PC x.x.x.x could connect twice to the same server y.y.y.y, for two websites (port 80).

so the three values, would be the same: from x.x.x.x to y.y.y.y:80

The fourth value, your source port, would be a random port for each connection.

from x.x.x.x:65000 to y.y.y.y:80

and x.x.x.x:65001 to y.y.y.y:80

So now the server can tell that apart.

Joseph W. Doherty
Hall of Fame
Hall of Fame

Well, much for the same reason if your address is 123 Main Street, but it's an apartment building, you have apartment numbers. It makes getting mail to an apartment's current resident much simpler.

Ah, but you might say apartment numbers are static and you asked about dynamic.

Firstly, remember, some port number are "static" too, such as port 80 being used for HTTP servers.

But, if you had electrical apartment number displays (though confusing for typical apartment addressing) they could be dynamic too.  For example, as apartment number's first digit is a floor number, and the next digit or two, a particular apartment on the floor, you add and reassign a different last digit every time the apartment's resident changes.  This so, not only does the apartment number indicate a floor and particular apartment, but a specific resident, precluding mail going to the "wrong" resident.

Further (and also generally not done with apartment number, of which I'm aware), perhaps a dynamically assigned (logical) apartment number is assigned to each particular resident, and follows such resident even if they move to a different apartment within same building.  The latter, though, requires the "building" to assign such a number and keep track where that particular resident is.  (The latter, though, is much like was a host does, an UDP or TCP application asks for a dynamic port number, the host provides one, and keeps track of what network app is using it.  It insures it doesn't issue the same number to two currently active network apps, and "recovers", for reuse, port numbers no longer being used.)

Hopefully, the above, analogy, helps explains the usefulness of dynamic port numbers at the same unique host address, because you can easily bump into the issue where more than one network app (or resident) wants to communicate with the same other location address (IP or building address), i.e. port numbers allow easy identification of the unique two way informational exchanges.  (BTW port numbers are also very handy for PAT, where dynamic NAT often will run out of unique IPs.  [I.e. w/o PAT IPv4 would have run out of addresses years and years ago.])