I am working on a project where i am attempting to spoof a gps command from X-Plane 11 to allow a flight simulator that i am working on to communicate with an electroic flight bag app (Oz Runways)

The X-Plane software outputs a GPS stream that is sent to the app, which the app then interprets. it is sent via UDP as an ascii Stream.

When the stream is sent, it shows the gps position of the plane in Xplane on a moving mapp in the App, on an Ipad.

An Example Stream: "XGPS1,-122.578640,47.264560,87.9936,8.2152,68.5358"

At this stage i have tried taking the exact udp message (from Xplane, intercepted by Wireshark) and sending it from another program called Packet Sender. Sending the stream does not work, but sending the entire packet (which seems wrong) seems to give me the desired result. The Entire Packet: ">ûÿÛEN©]À¨À¨ò¿i¿j:XGPS1,-122.578640,47.264560,87.9936,8.2152,68.5358"

This makes the entire packet of this UDP message: ">ûÿÛEe® À¨À¨ò¿i¿jQ«>ûÿÛEP{ÍÀ¨À¨ò¿i¿j<XGPS1,-122.307752,47.463464,124.7732,180.0498,0.0000"

it seems like it doubles up on the leading data, like ip and port adresses etc.

So while this seems to work, when using my piece of software, which will change the numbers to send through the correct position and speed, but right now is just a simple c# udp sender it refuses to work.

    void openUDP()
        udpClient = new UdpClient(49001);
        udpClient.Connect(IPAddress.Parse(textBoxip.Text), int.Parse(textBoxport.Text));

    void DoUDPThings()
        Byte[] sendBytes = Encoding.UTF8.GetBytes(textBoxmsg.Text);
            udpClient.Send(sendBytes, sendBytes.Length);
        catch (Exception e)

This is the code for my Sender, in order to mimic the Xplane software as much as possible i have set it to use the exact output port, and the text boxes in my win form feed in the message, ip address, and remote port number.

The actual question i suppose i am asking here, is why would copying the start of packet data work in Packet sender in the first place, and not in my c# program?

Below are two packets from wireshark one of which is from Xplane, the other is from my piece of software.

My software: 

From Xplane: 


I understand that this is a very specific issue, but i simply do not understand why the same stream works from one piece of software and not another.

New contributor
Nat Leach is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • 1
    I wonder if networkengineering.stackexchange.com can help. Regardless, this does not belong on this site. – Theraot Nov 18 at 6:20
  • What you are saying is, this duplicate header works, but the "normal" header doesn't work?? – kutschkem Nov 18 at 14:17
  • @Theraot No it can't, that site is for setting up professional networks. Networks themselves, not clients or servers. – user253751 Nov 18 at 19:17
  • The hex codes do not look like an IP header. Are you sure they aren't just part of the packet? – user253751 Nov 18 at 19:17
  • And have you considered that converting your data to UTF-8 and back corrupts all the non-ASCII bytes? – user253751 Nov 18 at 19:17

Your Answer

Nat Leach is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.