On Wednesday 02 February 2005 01:30, Verdi March wrote:
Now that you mention UDP, the article is on NAT and P2P applications and discusses techniques to go through NAT using UDP. Perhaps the sender can open a UDP port and send to different dst_ip:dst_port from the same UDP src_port? UDP is a datagram protocol. It does not matter because their is no connection between the sender and receiver. The sender sends the message. Once it leaves the buffer, the sender does not care. The receiver knows who sent the message. It's like sending a snail mail, except that if it is not delivered, it is simply trashed.
What about TCP session? The article does not mention that it is with TCP, but it implies that the scenario (same src_ip:src_port for 2 sessions to 2 different remote IP) it can be done too with TCP. As I mentioned, with TCP, there is a server who listens on a specific port/IP. The client issues a connect. When the server accepts the connection, a new port is established. The client, only sends on the known port, but it is waiting on a port assigned by the OS.
Here is the sequence: Server Client Client2 on same host. Listen on port 23 Connect on port 23 (wait on port 7899). Connect on port 23 (wait on port 7900). Accept assigned to port 8543) Connect returns 0 (success) At this point, the Server is receiving on port 8543 and sending on port 7899. The client is sending on port 8543 and receiving on port 7899. Accept assigned to port 8544) Connect returns 0 (success) At this point, the Server is receiving on port 8544 and sending on port 7900. The client is sending on port 8544 and receiving on port 7900. On the server side, when the server issues accept(2) there is a unique port for both the client and server. Let's say the client computer is an SMP and the connects are issued at the exact same time. The OS will still assign unique port numbers on the client side. -------- Multicast is a bit more complex, but does fit the above model. -- Jerry Feldman <gaf@blu.org> Boston Linux and Unix user group http://www.blu.org PGP key id:C5061EA9 PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9