On Tue, 1 Feb 2005 09:47:58 +0100 (MET), Verdi March <cincaipatron@gmx.net> wrote:
Hi,
I've a question on socket programming (I'm a bit rusty on this).
I'm reading an article on NAT, which mentions a case where a client opens two sessions (to two distinct remote end-points), but from the same source ip:port.
How is this possible? I thought every time a client program open a socket to a remote ip:port, the OS will automatically associate the local endpoint with a differrent port number?
Regards, Verdi
I don't know how to do it programatically, but it would not be a violation of tcp/ip. tcp/ip just requires that one of four values be unique: source host, source port dest host, dest port. If any one of those values is unique, then you have a diferent/unique socket. If they are the same, you have a conflict. I believe some of the socket hi-jacking code out there somehow takes advantage of this conflict. Greg -- Greg Freemyer