# UDP MTU and the WebRTC TURN protocol

**URL:** <https://community.fly.io/t/udp-mtu-and-the-webrtc-turn-protocol/3742>\
**Category:** General\
**Created:** [January 21, 2022, 9:10pm UTC](https://community.fly.io/t/udp-mtu-and-the-webrtc-turn-protocol/3742 "2022-01-21T21:10:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Campbell](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Matt\_Campbell](https://community.fly.io/u/Matt_Campbell)\
**Post date:** [January 21, 2022, 9:10pm UTC](https://community.fly.io/t/udp-mtu-and-the-webrtc-turn-protocol/3742/1 "2022-01-21T21:10:34Z")

</div>

I read about how UDP-based services on [fly.io](http://fly.io) have a somewhat reduced MTU. Does anyone know if this will be a problem for the TURN protocol that WebRTC uses to work around restrictive NAT/firewall setups?

---

<div class="post-metadata">

**Author:** ![kurt](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/kurt/32/43757_2.png) [@kurt](https://community.fly.io/u/kurt)\
**Post date:** [January 22, 2022, 3:28am UTC](https://community.fly.io/t/udp-mtu-and-the-webrtc-turn-protocol/3742/2 "2022-01-22T03:28:40Z")

</div>

I think it’ll be fine! The bigger issue with TURN is pinning traffic to the right VM. You pretty much have to run single VM applications to use TURN effectively on Fly right now.

---

<div class="post-metadata">

**Author:** ![Matt\_Campbell](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Matt\_Campbell](https://community.fly.io/u/Matt_Campbell)\
**Post date:** [January 24, 2022, 11:34pm UTC](https://community.fly.io/t/udp-mtu-and-the-webrtc-turn-protocol/3742/3 "2022-01-24T23:34:10Z")

</div>

So then, to use TURN effectively on Fly, I’ll need to create a separate  
app (with its own hostname) for each region, and use some other means to  
route the client to the correct one, right?

One other question: Can I specify a range of public port numbers for the  
service? It looks like coturn expects to have a range of port numbers  
that it uses for the actual relaying.

If anyone can share a working configuration for running coturn on  
[fly.io](http://fly.io), I would appreciate it.

---

<div class="post-metadata">

**Author:** ![thomas](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/thomas/32/40188_2.png) [@thomas](https://community.fly.io/u/thomas)\
**Post date:** [January 25, 2022, 2:38am UTC](https://community.fly.io/t/udp-mtu-and-the-webrtc-turn-protocol/3742/4 "2022-01-25T02:38:48Z")

</div>

For what it’s worth, for UDP ports, you’re fine with ranges — declare _any_ UDP port in your fly.toml, and you’ll get all UDP inbound traffic. UDP routing doesn’t discriminate on ports (remember, though, that you need to listen on the nonstandard `fly-global-services` address to see them).
