[Date Prev] [Date Index] [Date Next] [Thread Prev] [Thread Index] [Thread Next]
Bill Sommerfeld sommerfeld@sun.com
Mon, 22 Oct 2007 20:22:33 -0700 (PDT)
On Mon, 2007-10-22 at 15:00 -0700, Harris, David (IT Solutions US) wrote: > Each one of those > connections is using a port# on the conservere end too. For > example: > > delos: {1} netstat -an | grep 7001 > tcp 0 0 172.17.2.254.59046 172.17.2.14.7001 ESTABLISHED > tcp 0 0 172.17.2.254.59081 172.17.2.11.7001 ESTABLISHED > tcp 0 0 172.17.2.254.59106 172.17.2.13.7001 ESTABLISHED > tcp 0 0 172.17.2.254.59195 172.17.2.12.7001 ESTABLISHED > tcp 0 0 172.17.2.254.50994 172.17.2.3.7001 ESTABLISHED > tcp 0 0 172.17.2.254.51007 172.17.2.2.7001 ESTABLISHED > tcp 0 0 172.17.2.254.51021 172.17.2.1.7001 ESTABLISHED There's no actual requirement in the TCP protocol that the local port be unique for an outgoing connection; it's the 4-tuple (local address, local port, remote address, remote port) which uniquely identifies the connection. The system I'm most familiar with -- Solaris -- was fixed about two years ago to do controlled reuse of local ports to permit more connections than the available anonymous port range permits. The easiest way to demonstrate this feature is to artificially constrain the available anonymous port space: # ndd -set /dev/tcp tcp_smallest_anon_port 32768 # ndd -set /dev/tcp tcp_largest_anon_port 32770 and then make a few outgoing connections to web servers: % netstat -n -finet | grep 10.8.57 | grep 80 129.148.174.66.32768 10.8.57.1.80 32811 0 502094 0 ESTABLISHED 129.148.174.66.32768 10.8.57.2.80 32811 0 502094 0 ESTABLISHED 129.148.174.66.32768 10.8.57.3.80 49232 0 501008 0 ESTABLISHED The default 2^15 anonymous ports available can make many more than 2^15 outgoing connections. (this was bug 4461538; the fix is in the current development builds aka sunos 5.11 or solaris "nevada"). - Bill