Why o Why is is there 65,535 ports ? Why not 65,536 or 65,534 ? Does anyone know ?
Printable View
Why o Why is is there 65,535 ports ? Why not 65,536 or 65,534 ? Does anyone know ?
Thanks Alot Dude !
I believe its because the TCP packet header only allows for a 16-bit port numer (source and destination) so 0-65535 is the number range you get.
-Maestr0
You're on the right track Maestr0. It's a 32 bit addressing scheme though, and it uses 32 bit header information (TCP packet header uses a 32-bit port number), not 16bit.
65535 just happens to be the highest positive number that can be obtained using 32 bits.
That's also why the portons of an IP and subnet mask are called octets. (8bits per octet x 4 octets = 32bit Address)
This limitation is addressed in IPv6.....If they ever finalize it! :p
The 32-bit adress is related to the IP portion of the protocol(s) and does not contain any information about ports. The TCP portion of the packet contains two 16-bit fields in the header, one for the source port and one for the destination port.
-Maestr0
To me it's kind of like 255. You can't have an IP passed that...or Subnet mask. There are actually only 254 useable though, because 255 is 11111111 in binary, and is not useable, and 0 is of course the other value, and is also not useable....Ok, I know what I'm talking about here but I just crawled out of bed and I'm still waking up, anyone want to clarify this better untill I'm awake?
Ahhhh hang on thar a moment..
if you check your binary.. 65535 is the highest value that can be obtained from 16bits..Quote:
65535 just happens to be the highest positive number that can be obtained using 32 bits.
If my history comes correctly the 64k ports comes from the 8bit cpu days where the original systems could only address 65535bytes.. the cpu would work addresses in 16 bit values..
the X25 protocol was 8bit based and was used with early TCP work..
maestr0 has it:
CheersQuote:
The 32-bit adress is related to the IP portion of the protocol(s) and does not contain any information about ports. The TCP portion of the packet contains two 16-bit fields in the header, one for the source port and one for the destination port.
I just brushed over my TCP/IP and you are correct, Maestr0...the TCP portion of the packet does contain 16-bit, not 32bit headers. Also, I did the binary and Und3ertak3r is correct also.
I guess I was thinking IPv4 is 32-bit and not thinking about the fact that it still uses the original 16-bit addressing scheme.
does the port begin with 0000 ????
No .... port 1 i think , best if one of the mods or senior members comfirm tho :) Thanks