I have a simple UDP server running in Node.js on Fly.io, bound to the special address fly-global-services and port 53.
It look likes that packets are being dropped just because they have some specific bytes in them. From my tests, if the third byte of the buffer is less than 8, then the packet will be dropped.
Node.js server code:
const server = require('dgram').createSocket('udp4');
server.on("message", console.log);
server.bind(53, "fly-global-services");
This is the client Node.js code:
const server = require('dgram').createSocket('udp4');
server.connect(53, <flyio-app-address>, () => {
const buffer = Buffer.alloc(3);
buffer.writeUInt8(0, 0);
buffer.writeUInt8(0, 1);
buffer.writeUInt8(7, 2); // <-- packet dropped because of this byte
server.send(buffer);
});
Our UDP forwarding path is completely oblivious to the contents of packets, so it’s hard to imagine what we could be doing to cause this… but here you are with a minimized test case. We’ll dig in. Thank you!
@Emmanuel_Di_Iorio Lemme ask you this: I have a UDP echo service running on crimson.sockpuppet.prg on 5000/udp; any UDP packet you send to that host/port should just bounce back at you.
Would it be easy for you to try to send a packet there and see if you get a response?
I’m not a node person, but if you can give me the bash steps it’d take to get your code running locally, I can test myself too.
Later update
Turned out all I needed to do was type node. Here’s what I see:
So, I changed the server binding port to 5000 and app region from cdg/fra → ams (only ams, without backup regions) and still didn’t worked, and discovered that actually the same packet (regardless of the content) sometimes is getting delivered and sometimes not. Maybe there is a firewall (on my side or other sides) or maybe some Node.js weirdness, since your server is actually 100% reliable.
I will make more tests in the next days. For now, you can consider the ticket closed tho.
Really appreciate the time for the analysis @thomas
If you can’t figure out what’s going on here, please do keep making noise. A couple people are doing somewhat intense DNS stuff on Fly.io, so I have some reason to believe this stuff is working, but you might be spotting some corner case we need to know about.