USE YSFLIGHT with the UDP protocol

YSFlight addon development, questions, tutorials, & more!
Post Reply
User avatar
vincent
Contributor
Contributor
Posts: 202
Joined: Wed Feb 02, 2011 7:31 pm
Favorite Aircraft: virtual ones
Location: Toulouse, France
Has thanked: 1 time
Been thanked: 25 times
Contact:

USE YSFLIGHT with the UDP protocol

Post by vincent » Wed Jul 27, 2011 6:50 am

What is the UDP protocol?
The User Datagram Protocol (UDP) is one of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet.
UDP uses a simple transmission model without implicit hand-shaking dialogues for guaranteeing reliability, ordering, or data integrity. Thus, UDP provides an unreliable service and datagrams may arrive out of order, appear duplicated, or go missing without notice. UDP assumes that error checking and correction is either not necessary or performed in the application, avoiding the overhead of such processing at the network interface level. Time-sensitive applications often use UDP because dropping packets is preferable to waiting for delayed packets, which may not be an option in a real-time system. If error correction facilities are needed at the network interface level, an application may use the Transmission Control Protocol (TCP) or Stream Control Transmission Protocol (SCTP) which are designed for this purpose.
source: Wikipedia

How to tunnel TCP connections to UDP and vice-versa?
Let's say you have a server set on theserver.com:7915 and we have said the users they can use the port 7916 to connect trough UDP.

So, the server must listen on port 7916 and tunnel the information to 7915, and the client must listen on port 7915 and tunnel on port 7916.

There are several ways to do it:

- UNIX users

-> with socat:
---> for the server:
socat udp4-listen:7916 tcp4:127.0.0.1:7915

---> for the client:
socat tcp4-listen:7915 udp4:theserver.com:7916

-> With netcat:
---> for the server:
mkfifo /tmp/fifo # we need to create a fifo to have two-way communication between the two channels
sudo nc -l -p -u 7916 < /tmp/fifo | nc 127.0.0.1 7915 > /tmp/fifo

---> for the client:
mkfifo /tmp/fifo
sudo nc -l -p 7915 < /tmp/fifo | nc -u theserver.com 7916 > /tmp/fifo


- Windows users
-> with Netcat (not tested)
--> for the server:
netcat -L 127.0.0.1:7915 -p -u 7916 -vvv

--> for the client:
netcat -L -u theserver.com:7915 -p 7916 -vvv

Else, you can find others programs with a Google search...

User avatar
Eric
Senior Veteran
Senior Veteran
Posts: 1535
Joined: Thu Feb 10, 2011 5:30 am
Favorite Aircraft: Super Hornet
Location: Chicago, Illinois
Has thanked: 59 times
Been thanked: 164 times
Contact:

Re: USE YSFLIGHT with the UDP protocol

Post by Eric » Wed Jul 27, 2011 6:51 am

I make this website.

User avatar
Danny
Contributor
Contributor
Posts: 474
Joined: Thu Feb 10, 2011 10:33 pm
Favorite Aircraft: F-86 Sabre
Location: UK
Has thanked: 89 times
Been thanked: 71 times

Re: USE YSFLIGHT with the UDP protocol

Post by Danny » Tue Jun 18, 2013 4:11 pm

Bump!

Has anyone tried this with any success? I think it could potentially solve the age-old distance lag problem.

User avatar
Martin-Dutchie
Contributor
Contributor
Posts: 482
Joined: Sun Feb 06, 2011 5:13 pm
Favorite Aircraft: F-20A Tigershark
Location: Somewhere between the dykes
Has thanked: 55 times
Been thanked: 38 times

Re: USE YSFLIGHT with the UDP protocol

Post by Martin-Dutchie » Fri Jul 12, 2013 10:56 am

TheJuli and I tried setting this up, ending in a failure sadly. YS was bypassing the port detour for some reason...

User avatar
Eric
Senior Veteran
Senior Veteran
Posts: 1535
Joined: Thu Feb 10, 2011 5:30 am
Favorite Aircraft: Super Hornet
Location: Chicago, Illinois
Has thanked: 59 times
Been thanked: 164 times
Contact:

Re: USE YSFLIGHT with the UDP protocol

Post by Eric » Sat Jul 13, 2013 8:54 pm

I'll be testing this on my server. I have a feeling it won't do much though...
I make this website.

User avatar
Flake
Core Staff
Core Staff
Posts: 4354
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 836 times
Been thanked: 1238 times
Contact:

Re: USE YSFLIGHT with the UDP protocol

Post by Flake » Sun Jul 14, 2013 5:16 am

I think the effort of converting/calculating TCP to UDP and back again negates the benefit.

It's a shame YSF doesn't use UDP instead of TCP natively. If soji wished it to happen, I'd gladly help him.
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!

User avatar
Scarecrow
Senior Veteran
Senior Veteran
Posts: 1264
Joined: Thu Feb 03, 2011 3:08 am
Favorite Aircraft: T-50B
Location: IND
OS: Windows
Has thanked: 61 times
Been thanked: 287 times

Re: USE YSFLIGHT with the UDP protocol

Post by Scarecrow » Mon Jun 02, 2014 8:14 pm

As an update, Flake worked a couple of nights ago regarding this and trying to get rid of the distance lag issue. However, after a testing by the Blue Dolphins Jet Team, we were unable to find any increase in the distance lag problem that we face in YS.

However, it was a very good attempt and I applaud his efforts.

"si hoc legere scis nimium eruditionis habes"

Image

Post Reply

Who is online

Users browsing this forum: Google Adsense [Bot] and 3 guests