UDP ASSOCIATE problem

Use this forum to post questions relating to WinGate, feature requests, technical or configuration problems

Moderator: Qbik Staff

UDP ASSOCIATE problem

Postby manishjg » Feb 08 04 2:22 am

Hello Sir,

I have a DNS UDP client which has to connect to a external server such as a.root-servers.net at port 53.
The proxy server used is WinGate and ProxyPlus. I am doing the following steps with both wingate and proxy plus

1. Connect to 1080 on localhost via TCP
2. Check Auth mode
3. Auth if necessary
4. send packet with
+----+-----+-------+------+----------+----------+
|VER | CMD | RSV | ATYP | DST.ADDR | DST.PORT |
+----+-----+-------+------+----------+----------+
| 1 | 1 | X'00' | 1 | Variable | 2 |
+----+-----+-------+------+----------+----------+
DST == localhost , 5000 say
[ A UDP server is started at DST ]

5. Recvd a reply from proxy server with ip and port to sent subsequent packets to via UDP
6. sent a udp packet to given ip and port (obtained in step5) conatining the IP and port of external server
+----+------+------+----------+----------+----------+
|RSV | FRAG | ATYP | DST.ADDR | DST.PORT | DATA |
+----+------+------+----------+----------+----------+
| 2 | 1 | 1 | Variable | 2 | Variable |
+----+------+------+----------+----------+----------+

7. Waiting for reply on my UDP server started in step 4

now with wingate i never get a reply back in step 7 , and in proxyplus i get a reply

this is what the log says
02/07/04 03:27:57 127.0.0.1 sr 0000000035 Debug: UDP Associate: received 37 bytes from 127.0.0.1:3442
02/07/04 03:27:57 127.0.0.1 sr 0000000035 Debug: UDP Associate: received 459 bytes from 198.41.0.4:53
02/07/04 03:27:57 127.0.0.1 sr 0000000035 Error: Caught socket exception in CSOCKSSession::OnRead() Connection Reset by Remote Host - terminating
02/07/04 03:27:57 127.0.0.1 sr 0000000035 Traffic 491 50 27 459 24s

Please let me know what i am doing wrong
manishjg
 
Posts: 7
Joined: Feb 08 04 2:18 am

Re: UDP ASSOCIATE problem

Postby Pascal » Feb 09 04 9:40 am

Are you using NAT ? From the steps you describe, it sounds as if:

1. The UDP response you are expecting is being blocked by the server
2. The waiting TCP connection gets closed by the remote server (Timeout / no response within a given timeframe)

Is it possible to check the remote server's logs ? This might give you a clearer indication as to why it's closing the connection. Secondly, check your firewall logs to see if the response initiated in step 4 is being blocked.
Pascal

Qbik New Zealand
pascalv@qbik.com
http://www.qbik.com
Pascal
Qbik Staff
 
Posts: 2623
Joined: Sep 08 03 8:19 pm
Location: Auckland, New Zealand

Postby adrien » Feb 09 04 10:57 am

Hi

I see you set the frag field in the UDP wrapper. I think from memory fragmented UDP packets are not supported in the WinGate SOCKS5 server, since that requires buffering in the gateway up to an unidentified amount - not one of NEC's best ideas that.

Adrien
adrien
Qbik Staff
 
Posts: 5448
Joined: Sep 03 03 2:54 pm
Location: Auckland

Postby manishjg » Feb 09 04 11:00 pm

adrien wrote:Hi

I see you set the frag field in the UDP wrapper. I think from memory fragmented UDP packets are not supported in the WinGate SOCKS5 server, since that requires buffering in the gateway up to an unidentified amount - not one of NEC's best ideas that.

Adrien



I am setting frag=0.

See the point is my UDP server on localhost never gets the packet (DNS reply) which wingate recvd from a.root-servers.net . The log clearly shows that WinGate recvd my DNS client request and recvd respons from root-servers but then some exception occured , so my UDP server is waiting for response.

And this never happens with proxyplus (another s/w ) , I am using the same code

Could you please read my above post and tell me what worng i am doing
and What is causing Wingate to crash.
manishjg
 
Posts: 7
Joined: Feb 08 04 2:18 am

Re: UDP ASSOCIATE problem

Postby manishjg » Feb 09 04 11:04 pm

Pascal wrote:Are you using NAT ? From the steps you describe, it sounds as if:

1. The UDP response you are expecting is being blocked by the server
2. The waiting TCP connection gets closed by the remote server (Timeout / no response within a given timeframe)

Is it possible to check the remote server's logs ? This might give you a clearer indication as to why it's closing the connection. Secondly, check your firewall logs to see if the response initiated in step 4 is being blocked.


>>1. The UDP response you are expecting is being blocked by the server
in the wingate server log some exception occurs after it recs 459 bytes from a.root-servers.net

>>2. The waiting TCP connection gets closed by the remote server
I didnt get u
The remote server is UDP connection , DNS lookup on a.root-servers.net
manishjg
 
Posts: 7
Joined: Feb 08 04 2:18 am

Postby adrien » Feb 09 04 11:25 pm

Hi

Which exception occurs - does it give a sockets error number? Like 10035 or something like that?

Adrien
adrien
Qbik Staff
 
Posts: 5448
Joined: Sep 03 03 2:54 pm
Location: Auckland

Postby manishjg » Feb 10 04 2:01 am

adrien wrote:Hi

Which exception occurs - does it give a sockets error number? Like 10035 or something like that?

Adrien



his is what the log says
02/07/04 03:27:57 127.0.0.1 sr 0000000035 Debug: UDP Associate: received 37 bytes from 127.0.0.1:3442
02/07/04 03:27:57 127.0.0.1 sr 0000000035 Debug: UDP Associate: received 459 bytes from 198.41.0.4:53
02/07/04 03:27:57 127.0.0.1 sr 0000000035 Error: Caught socket exception in CSOCKSSession::OnRead() Connection Reset by Remote Host - terminating
02/07/04 03:27:57 127.0.0.1 sr 0000000035 Traffic 491 50 27 459 24s
manishjg
 
Posts: 7
Joined: Feb 08 04 2:18 am

Postby manishjg » Feb 11 04 1:29 am

I am now posting the code of the problem.[vc6 workspace]

http:\\manishjaggi.tripod.com\sample_udp.zip

In the problem I am trying to get a response from DNS server a.root-servers.net . The main file contains the #define macros as LOCAL_IP , REMOTE_HOST , PROXY_SERVER
you can set the values based on yr network ip's.

SOCKS5 auth is not supported , to make the code simple.
The code is working fine with proxyplus proxy server.
But is not working with Wingate.

PLease have a look at the code and let me know , what the stupid thing i ma doing :)

Manish
http://manishjaggi.tripod.com\sample_udp.zip
manishjg
 
Posts: 7
Joined: Feb 08 04 2:18 am

Postby adrien » Feb 11 04 9:44 am

Hi

You should start your local UDP socket before you send the UDP associate request and send the DNS request, otherwise if the response comes back before your local socket has started, you will get an ICMP error back (ICMP DEST_UNREACHABLE which means no socket on that port) which will show up as a "connection reset" message like you are seeing.

Try that and see if it helps.

Adrien
adrien
Qbik Staff
 
Posts: 5448
Joined: Sep 03 03 2:54 pm
Location: Auckland

Postby adrien » Feb 11 04 12:33 pm

Hi

We are working on this - for some reason we shut off the control connection after receiving the UDP associate command.

Adrien
adrien
Qbik Staff
 
Posts: 5448
Joined: Sep 03 03 2:54 pm
Location: Auckland

Postby manishjg » Feb 12 04 11:33 pm

adrien wrote:Hi

You should start your local UDP socket before you send the UDP associate request and send the DNS request, otherwise if the response comes back before your local socket has started, you will get an ICMP error back (ICMP DEST_UNREACHABLE which means no socket on that port) which will show up as a "connection reset" message like you are seeing.

Try that and see if it helps.

Adrien


I have tried that too , before establishing the TCP connection I start the UDP server. Still no packet is coming when doing rcvfrom .

Please help me ,
The code is at manishjaggi.tripod.com/sample_udp.zip

can we chat if ok


Manish
manishjg
 
Posts: 7
Joined: Feb 08 04 2:18 am

Postby Pascal » Feb 13 04 8:29 am

Two problems. One, there is a bug in WinGate. This will be resolved in 5.2.3 (We've already fixed and tested it) I'm not sure of the release date, basically as soon as possible. I've made a few mods to the app to make it a bit more transparent, so I'll send that source to you. Watch the forums for updates on the release date of 5.2.3
Pascal

Qbik New Zealand
pascalv@qbik.com
http://www.qbik.com
Pascal
Qbik Staff
 
Posts: 2623
Joined: Sep 08 03 8:19 pm
Location: Auckland, New Zealand

Postby manishjg » Feb 14 04 12:06 am

Please help me find if there is anything wrong i am doing as per RFC 1928 .

This would be really helpful , as i dont think that there is some bug in Wingate that does not allow UDP associate to work properly,

Many users of wingate must have used this feature .

So please if you have time go thru my code and let me know where i am wrong


manishjaggi.tripod.com/sample_udp.zip

Thanks in advance
manishjg
 
Posts: 7
Joined: Feb 08 04 2:18 am


Return to WinGate

Who is online

Users browsing this forum: No registered users and 8 guests

cron