01-23-04 10:36 PM
Hi folks ...
I have an application that needs to:
- receive UDP pkts on a specific port
- those UDP pkts must be coming from a specific server/port
(the port may be taken)
To test this app, I did the following:
- connected (via ssh) to the server; this set up a connection
like this:
1.1.1.1:1665 <--> 2.2.2.2:22
- started a server on 1.1.1.1:2000 to listen for
pkts from 2.2.2.2:22 (Note that the port 22 is deliberate,
I wanted to check if it would work this way.)
- started a client on 2.2.2.2 that sent pkts to the server
on 1.1.1.1:2000; the pkts were to be marked as coming from
port 22. But this failed - bind() gives "Permission Denied" -
I am guessing because my TCP ssh connection has already
taken that port.
My questions:
- If a port is bind()-ed over TCP, then will future UDP socket
bind() requests fail? If yes, then how does sshd work - i.e.
many clients can connect to port 22, don't all those outgoing
packets have port 22 as the source port?
- Is there another way to send out UDP datagrams to a given
IP:port such that the datagrams can "originate" from a port
that may already be taken up by another TCP or UDP server?
TIA,
John
[ Post a follow-up to this message ]
|