-3

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);
        try
        {
            udpClient.Send(sendBytes, sendBytes.Length);
        }
        catch (Exception e)
        {
            Console.WriteLine(e.ToString());
        }
    }

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: 
183eef87a307001cbffbffdb08004500004ea95d000080110000c0a80006c0a800f2bf69bf6a003a829458475053312c2d3132322e3537383634302c34372e3236343536302c38372e393933362c382e323135322c36382e35333538

>ûÿÛEN©]À¨À¨ò¿i¿j:XGPS1,-122.578640,47.264560,87.9936,8.2152,68.5358
From Xplane: 
183eef87a307001cbffbffdb080045000050a94d000080110000c0a80006c0a800f2bf69bf6a003c829658475053312c2d3132322e3330323539322c34372e3436303236382c3133362e363139332c3236382e353936362c302e30373137

>ûÿÛEP©MÀ¨À¨ò¿i¿j<XGPS1,-122.302592,47.460268,136.6193,268.5966,0.0717

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.