After much back and forth, it appears that most people *also* have no idea how TCP ports are actually implemented at the lowest levels.https://twitter.com/EmilyGorcenski/status/1026939399395831810 …
-
-
What is unclear, I guess?
-
I mean so it’s just a region in the packet header holding a value then, right?
-
Basically yes. It's a number in the header. The kernel on the connect() end writes it into each packet, and the kernel on the listen() end reads it to figure out which socket / program gets it.
-
So I could just read the spec, but I’m guessing it’s implemented as a fixed width value with a known offset in the packet, and not like, a value that is like, modulating some other data or something.
-
Like, say there were only 16 ports, I could imagine the port number being implemented like a rotation mod 17 or something like that. Not dissimilar to how QAM works for example
-
Exactly. Here's a TCP layout. UDP is generally similar but without the flow control part.pic.twitter.com/ApemPvTtmX
-
So there are 65,536 TCP ports on each IP address?
-
0 is reserved, I believe, so 65535.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.