Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the maximum port range 65535 in the TCP/IP Suite?

My doubt is that - a port is just logical, so why such restriction ? Why can't I have a port of 9924593 or something like that ?

like image 389
Tilak Maddy Avatar asked Apr 22 '16 14:04

Tilak Maddy


People also ask

What is port 65535 used for?

Dynamic ports—Ports in the range 49152 to 65535 are not assigned, controlled, or registered. They are used for temporary or private ports. They are also known as private or non-reserved ports. Clients should choose ephemeral port numbers from this range, but many systems do not.

Why are there 65k ports?

The port identifiers are unsigned 16-bit integers, meaning that the largest number you can put in there is 216-1 = 65535.

Can you have more than 65535 ports?

The maximum value is 65535. The TCP/IP network port number for IPv4 is an unsigned 16-bit integer, which can be no more than 65535.

Why are there only 65536 ports?

65,536 is a very common number in computing, because it's 2 to the power of 16 (2^16). 2^8 is 256, and 65,536 is the square of 256. In other words, a 16 bit binary number can represent 65,536 different integers. So that's probably where your 65,535 range comes from.


1 Answers

Look at the packet format for the TCP segment. The port identifiers are unsigned 16-bit integers, meaning that the largest number you can put in there is 216-1 = 65535.

like image 125
Polynomial Avatar answered Nov 15 '22 23:11

Polynomial