Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Let us know your feedback about the Global Illumination changes in the 2023.2 beta.
    Dismiss Notice
  3. Dismiss Notice

Resolved TURN server usages issue

Discussion in 'Unity Render Streaming' started by sunxia, May 25, 2023.

  1. sunxia

    sunxia

    Joined:
    Apr 10, 2019
    Posts:
    7
    Hello all, I tried to deploy my app with TURN server, following the official instruction:

    The streaming process goes well with TCP, but failed with UDP. I noticed the official instruction is using TCP explicitly. I wonder if there is a reason for this, or do you have any experience with udp relay?

    (BTW this is not a issue of Unity Render Streaming. It should be the problem of coturn usages.)

    Thanks in advance!

    ---
    Full info of my usages of coturn:
    ---

    My config file of turnserver:

    Code (CSharp):
    1.  
    2. external-ip=my.public.ip.address
    3. channel-lifetime=7200
    4. lt-cred-mech
    5.  
    6. user=MyUserNamer:MyPassWord
    7.  
    8. log-file=/var/tmp/turn.log
    9.  
    10. listening-port=8007
    11.  
    12. realm=www.mycompany.com
    13.  
    The listening port 8007 is opened for both TCP and UDP. It can be verified via commands below:

    Code (CSharp):
    1.  
    2. # verify TCP connectivity
    3. $ telnet my.public.ip.address 8007
    4.  
    5. # verify UDP connectivity
    6. $ nc -vuz my.public.ip.address 8007
    7. $ Connection to my.public.ip.address 8007 port [udp/*] succeeded!
    8.  
    When I tried to test relay with https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/, TCP succedded while UDP failed.

    The URL I used for TCP is turn:my.public.ip.address:8007?transport=tcp, while the ones used for UDP is turn:my.public.ip.address:8007?transport=udp or turn:my.public.ip.address:8007

    I got response for both URLs of UDP:

    Code (CSharp):
    1.  
    2. The server stun:103.177.28.44:8007 returned an error with code=701:
    3. STUN server address is incompatible.
    4.  
     
    Last edited: May 25, 2023
  2. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    762
    I think the issue is about firewall rules settings. What cloud platform are you using?
     
  3. sunxia

    sunxia

    Joined:
    Apr 10, 2019
    Posts:
    7
    Thank you kazuki, I am using the private server of my company, my server admin use telnet and nc to verify TCP/UDP connectivity so it seems fine.
    Code (JavaScript):
    1.  
    2. # verify TCP connectivity
    3. $ telnet my.public.ip.address 8007
    4. # verify UDP connectivity
    5. $ nc -vuz my.public.ip.address 8007
    6. $ Connection to my.public.ip.address 8007 port [udp/*] succeeded!
    I guess we might miss some networks so the nc test succeeded but udp relay failed.
    Do you have any common suggenstions for network settings of AWS, AZure or any other? So that I could sync that with our admin.
     
  4. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    762
    Sorry but we have only experience of settings on GCP. It is difficult to advice for the private server in your environment.
     
  5. sunxia

    sunxia

    Joined:
    Apr 10, 2019
    Posts:
    7
    Thank you~ we will study further
     
  6. kazuki_unity729

    kazuki_unity729

    Unity Technologies

    Joined:
    Aug 2, 2018
    Posts:
    762