> From: Iljitsch van Beijnum <iljitsch(_at_)muada(_dot_)com>
>> you can only have 65536 connections to a single service on a given
> Demultiplexing should happen on source and destination IP addresses and
> source and destination port numbers. ... that allows for a 65536
> sessions towards each possible IP address connected to the network.
It depends on what protocol you are talking about.
For TCP, this is true: incoming packet demux is based on foreign address/port
as well as local port, so each local port could have (as you point out) up to
65K connections to any other IP address.
However, for UDP this is not the case; the base UDP protocol has no concept of
"connection", and demultiplexing is *supposed* to be done only on local port.
(Which is why TFTP has that funny little hop-step with port numbers when a
TFTP transfer starts.) So for UDP, each local port could only have one
"connection" at a time (and that's to the entire Internet, not per-host) -
unless, of course, the higher-level protocol running on top of UDP does some
sort of demultiplexing (which might use foreign host/port, of course).
However, not all implementations correctly implement this: for instance, I'm
rather embarassed to admit that when I recently looked at a TCP/IP I wrote
some years back, I discovered that the UDP layer used the exact same
demultiplexing code as TCP! Ooops...
Ietf mailing list