[OT] Handling multiple UDP clients through NAT

Bryan Sant bryan.sant at gmail.com
Wed Feb 7 11:19:54 MST 2007


On 2/6/07, plug.org at 2nerds.com <plug.org at 2nerds.com> wrote:
> On Tue, 6 Feb 2007, Bryan Sant wrote:
> > You can't.  You can only handle 2^16 - n TCP connections at the same
> > time.
>
> Where does this limitation come from?  One might be tempted to relate the
> maximum number of TCP connections to the 16-bit size of a TCP port number,
> but that doesn't work because TCP connections are typically identified by
> a four-tuple which includes the source and destination IP addresses as
> well as the source and destination port numbers.  In theory, a TCP stack
> with only a single bound IP address can maintain ~64K independent
> connections to _every_ peer even when using only a single local port, so
> I'm guessing the 2^16 - n number must be coming from some other
> implementation-dependent limitation.  Or am I just up in the night? :-)

You can only handle 64K connections per NATed client.  There is a max
limit controlled by your TCP/IP stack, but that can be tweaked in
/proc/sys/net.

-Bryan



More information about the PLUG mailing list