How is it possible to get 2 million websocket connections when you have 65536 available ports?

Each network connection is described by tuple of 4 values:

  • Source Address
  • Source Port
  • Target Address
  • Target Port

So only if these 4 values match, we cannot open new connection. This should make it clear how we can have 2M (or more) simultaneous connections to single service listening on single port.

7 Likes