< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

Re: [reSIProcate-users] why reTurn example TestClient always fails in Binding Request while TestAsyncClient Ok?


Thank you! I will dynamically add. 



Sent from my Verizon, Samsung Galaxy smartphone


-------- Original message --------
From: Scott Godin <sgodin@xxxxxxxxxxxxxxx>
Date: 4/19/16 1:51 PM (GMT-08:00)
To: Tom Chen <chentom60@xxxxxxxxxxx>
Cc: resiprocate-users@xxxxxxxxxxxxxxx
Subject: Re: [reSIProcate-users] why reTurn example TestClient always fails in Binding Request while TestAsyncClient Ok?

The callers IP and port are part of the SDP negotiation.

Scott

On Tue, Apr 19, 2016 at 3:46 PM, Tom Chen <chentom60@xxxxxxxxxxx> wrote:
If TestAsyncClient and TURN server are used in a SIP VOIP phone application, how can an unknown Remote caller contact it if the caller's ip and port not known in advance? 
 

Sent from my Verizon, Samsung Galaxy smartphone


-------- Original message --------
From: Scott Godin <sgodin@xxxxxxxxxxxxxxx>
Date: 4/19/16 12:09 PM (GMT-08:00)
To: Tom Chen <chentom60@xxxxxxxxxxx>
Subject: Re: [reSIProcate-users] why reTurn example TestClient always fails in Binding Request while TestAsyncClient Ok?

You can only receive packets from an active destination.  Try calling setActiveDestination with the IP and port of the UDP test app first.

Scott

On Tue, Apr 19, 2016 at 2:54 PM, Tom Chen <chentom60@xxxxxxxxxxx> wrote:
Hi Scott, 

Thank you! 

I just see another strange issue:  after the TestAsyncClient successfully allocated a mapped transport address on TURN server, I use another UDP app running on another test peer to send a message to this mapped address. I can see from the shell that the message is successfully received by TURN server and is transferred  to the machine TestAsyncClient is running but message got discarded by TestAsyncClient:
TurnAsyncSocket.cxx:712 handleDataInd: Data received from unknown RemotePeer - discarding 

Any idea why? how to make the remote peer known?

Tom  


Sent from my Verizon, Samsung Galaxy smartphone


-------- Original message --------
From: Scott Godin <sgodin@xxxxxxxxxxxxxxx>
Date: 4/19/16 9:27 AM (GMT-08:00)
To: Tom Chen <chentom60@xxxxxxxxxxx>
Subject: Re: [reSIProcate-users] why reTurn example TestClient always fails in Binding Request while TestAsyncClient Ok?

The synchronous API's block until completion, the asynchronous ones do not block and use callbacks to report success/failure instead.

Scott

On Tue, Apr 19, 2016 at 11:28 AM, Tom Chen <chentom60@xxxxxxxxxxx> wrote:
Scott, 

What's the difference between Synchronous mode and Asynchronous mode that are used in TestClient.cxx and TestAsyncClient.cxx?

Tom



Sent from my Verizon, Samsung Galaxy smartphone


-------- Original message --------
From: Scott Godin <sgodin@xxxxxxxxxxxxxxx>
Date: 4/18/16 11:22 AM (GMT-08:00)
To: Tom Chen <chentom60@xxxxxxxxxxx>
Subject: Re: [reSIProcate-users] why reTurn example TestClient always fails in Binding Request while TestAsyncClient Ok?

...inline...

On Mon, Apr 18, 2016 at 1:28 PM, Tom Chen <chentom60@xxxxxxxxxxx> wrote:
The handle_turn_command () in ns_turn_server.c of github.com/coturn seems to indicate that Binding request is ignored if the server does not support STUN, ie TURN service only.

[Scott]  The same binding request works if it comes from the Async test client, so clearly the server supports STUN Bind  - something must be different.  You may need to step through the server handling of the bind request from both AsyncTestClient and TestClient to see what is different.
 
In reTurn/client/test/TestClient.cxx, in the  main () function , I don't know why it returns immediately if bind request fails, should it continue to try to create allocation ? Or passing binding request test to get reflexive address is a prerequisite before calling createAllocation ()? Sorry, I am very new to STUN, TURN.

[Scott] TestClient is just a test program.  You are free to modify it if you like.  The binding result is not needed in order to do an allocation.

 
Tom

Sent from my Verizon, Samsung Galaxy smartphone


-------- Original message --------
From: Scott Godin <sgodin@xxxxxxxxxxxxxxx>
Date: 4/18/16 10:02 AM (GMT-08:00)
To: Tom Chen <chentom60@xxxxxxxxxxx>
Subject: Re: [reSIProcate-users] why reTurn example TestClient always fails in Binding Request while TestAsyncClient Ok?

The bind isn't necessary - it's only there as a test, but it is supported in the TURN standard, so it shouldn't fail.  

Seems like you will need to debug the server side in order to understand why this is happening.

Scott

On Mon, Apr 18, 2016 at 12:58 PM, Tom Chen <chentom60@xxxxxxxxxxx> wrote:
Scott,

I tried and not working.

For a TURN only server, should the client send Allocate request  (03) rather than Binding request (01)? 

Tom



Sent from my Verizon, Samsung Galaxy smartphone


-------- Original message --------
From: Scott Godin <sgodin@xxxxxxxxxxxxxxx>
Date: 4/18/16 6:40 AM (GMT-08:00)
To: Tom Chen <chentom60@xxxxxxxxxxx>
Subject: Re: [reSIProcate-users] why reTurn example TestClient always fails in Binding Request while TestAsyncClient Ok?

I'm guessing this is related to the servers handling of the Software header and how it is padded.  As a test change the software string on the Sync client to be the same as the Async client:
reTURN Async Client 0.3 - RFC5389/turn-12   

Scott

On Mon, Apr 18, 2016 at 12:02 AM, Tom Chen <chentom60@xxxxxxxxxxx> wrote:

Hello,

 

I have a strange issue when testing reTurn examples. I modified TestClient.cxx and TestAsyncClient.cxx in reTurn/client/test/ to use real test client’s IP addresses (10.113.54.61) instead of 127.0.0.1 and successfully compiled. 

 

A “coturn” TURN server running on 10.113.54.60 is started as following script which skips user authentication.

#turnserver -v -f --min-port=32355 --max-port=65535 --no-auth

 

I run both TestClient and TestAsyncClient on 10.113.54.61 to interact with the TURN server but I got  different results: “TestClient” always receives no response and I can see “STUN method 0x1 ignored” on Turn Server screen while “TestAsyncClient” always got OK response with XOR-Mapped-address. I captured Binding Requests sent by TestClient and TestAsyncClient for comparison but I can not see the difference. Can someone tell me why the Binding request from TestClient got no response from TURN server? attached are the Wireshark traces.

 

1.       Failed Binding request from TestClient.cxx that got “1506: handle_turn_command: STUN method 0x1 ignored” error

# TestClient 10.113.54.60 3478

INFO | 20000621-062858.790 |  | RETURN | 1081483264 | TurnSocket.cxx:970 | Timed out waiting for Stun response!

INFO | 20000621-062858.791 |  | RESIP:TEST | 1081483264 | TestClient.cxx:141 | CLIENT: Error calling bindRequest: rc=asio.misc error, value=8008

 

0000  00 0c 29 34 d0 b4 00 05 a6 0e 04 c3 08 00 45 00   ..)4..........E.

0010  00 5c 00 00 40 00 40 11 b9 36 0a 71 36 3d 0a 71   .\..@.@..6.q6=.q

0020  36 3c 92 06 0d 96 00 48 fd a6 00 01 00 2c 21 12   6<.....H.....,!.

0030  a4 42 d2 9d f7 c0 b1 a6 3e ba 60 1f c8 0a 80 22   .B......>.`...."

0040  00 28 72 65 54 55 52 4e 20 53 79 6e 63 20 43 6c   .(reTURN Sync Cl

0050  69 65 6e 74 20 30 2e 33 20 2d 20 52 46 43 35 33   ient 0.3 - RFC53

60    39 2f 74 75 72 6e 2d 31 32                     89/turn-12

 

2.  Successful Binding request from TestAsyncClient.cxx that got Ok response with XOR-Mapped_address

0000  00 0c 29 34 d0 b4 00 05 a6 0e 04 c3 08 00 45 00   ..)4..........E.

0010  00 60 00 00 40 00 40 11 b9 32 0a 71 36 3d 0a 71   .`..@.@..2.q6=.q

0020  36 3c a7 9b 0d 96 00 4c b0 28 00 01 00 30 21 12   6<.....L.(...0!.

0030  a4 42 5a 10 34 a1 7b 2a 76 60 c3 f2 14 94 80 22   .BZ.4.{*v`....."

0040  00 2c 72 65 54 55 52 4e 20 41 73 79 6e 63 20 43   .,reTURN Async C

0050  6c 69 65 6e 74 20 30 2e 33 20 2d 20 52 46 43 35   lient 0.3 - RFC5

0060  33 38 39 2f 74 75 72 6e 2d 31 32 20 20 20         389/turn-12  

 

# TestAsyncClient 10.113.54.60 3478 10.113.54.61

INFO | 20000621-053336.180 |  | RESIP:DNS | 1075593216 | DnsUtil.cxx:233 | Local IP address for  is 169.254.6.91

INFO | 20000621-053336.183 |  | RESIP:TEST | 1075593216 | TestAsyncClient.cxx:271 | Using 10.113.54.61 as local IP address.

INFO | 20000621-053336.193 |  | RESIP:TEST | 1075593216 | TestAsyncClient.cxx:95 | MyTurnAsyncSocketHandler::onConnectSuccess: socketDest=6, address=10.113.54.60, port=3478

INFO | 20000621-053336.203 |  | RETURN | 1075593216 | ../StunMessage.cxx:1163 | Ignoring unknown comprehension optional attribute: 32811

INFO | 20000621-053336.203 |  | RETURN | 1075593216 | ../StunMessage.cxx:1163 | Ignoring unknown comprehension optional attribute: 32812

INFO | 20000621-053336.204 |  | RESIP:TEST | 1075593216 | TestAsyncClient.cxx:115 | MyTurnAsyncSocketHandler::onBindingSuccess: socketDest=6, reflexive=[UDP 10.113.54.61:44116], serverTuple=[UDP 10.113.54.60:3478]

INFO | 20000621-053336.208 |  | RESIP:TEST | 1075593216 | TestAsyncClient.cxx:134 | MyTurnAsyncSocketHandler::onAllocationSuccess: socketDest=6, reflexive=[UDP 10.113.54.61:44116], relay=[UDP 10.113.54.60:53166], lifetime=600, bandwidth=0, reservationToken=13219478805274871241

INFO | 20000621-053336.208 |  | RESIP:TEST | 1075593216 | TestAsyncClient.cxx:138 | CLIENT: Sending: This test is for wrapped Turn Data!

INFO | 20000621-053336.210 |  | RESIP:TEST | 1075593216 | TestAsyncClient.cxx:182 | MyTurnAsyncSocketHandler::onChannelBindRequestSent: socketDest=6 channelNumber=31931

INFO | 20000621-053336.210 |  | RESIP:TEST | 1075593216 | TestAsyncClient.cxx:142 | CLIENT: Sending: This test should be in ChannelData message in TCP/TLS but not in UDP - since ChannelBindResponse is not yet received.

INFO | 20000621-053336.211 |  | RESIP:TEST | 1075593216 | TestAsyncClient.cxx:165 | MyTurnAsyncSocketHandler::onSetActiveDestinationSuccess: socketDest=6

INFO | 20000621-053336.213 |  | RESIP:TEST | 1075593216 | TestAsyncClient.cxx:186 | MyTurnAsyncSocketHandler::onChannelBindSuccess: socketDest=6 channelNumber=31931

INFO | 20000621-053336.215 |  | RESIP:TEST | 1090270304 | TestAsyncClient.cxx:69 | PEER: Received data from 10.113.54.60:53166 - [This test is for wrapped Turn Data!]

INFO | 20000621-053336.216 |  | RESIP:TEST | 1090270304 | TestAsyncClient.cxx:69 | PEER: Received data from 10.113.54.60:53166 - [This test should be in ChannelData message in TCP/TLS but not in UDP - since ChannelBindResponse is not yet received.]

INFO | 20000621-053336.217 |  | RESIP:TEST | 1075593216 | TestAsyncClient.cxx:204 | MyTurnAsyncSocketHandler::onReceiveSuccess: socketDest=6, fromAddress=10.113.54.61, fromPort=2000, size=36, data="" test is for wrapped Turn Data!

INFO | 20000621-053336.217 |  | RESIP:TEST | 1075593216 | TestAsyncClient.cxx:204 | MyTurnAsyncSocketHandler::onReceiveSuccess: socketDest=6, fromAddress=10.113.54.61, fromPort=2000, size=118, data="" test should be in ChannelData message in TCP/TLS but not in UDP - since ChannelBindResponse is not yet received.

INFO | 20000621-053336.218 |  | RESIP:TEST | 1075593216 | TestAsyncClient.cxx:213 | CLIENT: Sending: This test is for ChannelData message!

INFO | 20000621-053336.220 |  | RESIP:TEST | 1090270304 | TestAsyncClient.cxx:69 | PEER: Received data from 10.113.54.60:53166 - [This test is for ChannelData message!]

INFO | 20000621-053336.221 |  | RESIP:TEST | 1075593216 | TestAsyncClient.cxx:204 | MyTurnAsyncSocketHandler::onReceiveSuccess: socketDest=6, fromAddress=10.113.54.61, fromPort=2000, size=38, data="" test is for ChannelData message!

INFO | 20000621-053336.224 |  | RESIP:TEST | 1075593216 | TestAsyncClient.cxx:152 | MyTurnAsyncSocketHandler::onRefreshSuccess: socketDest=6, lifetime=0

INFO | 20000621-053336.225 |  | RESIP:TEST | 1075593216 | TestAsyncClient.cxx:235 | MyTurnAsyncSocketHandler::onReceiveFailure: socketDest=4294967295 error=125(Operation aborted.)

. . . . . .


_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxx
List Archive: http://list.resiprocate.org/archive/resiprocate-users/