Jigsaw-Code / outline-go-tun2socks

Apache License 2.0
227 stars 94 forks source link

Set Intra UDP NAT timeout to 5 minutes #73

Closed ignoramous closed 3 years ago

ignoramous commented 3 years ago

A significant amount of UDP connections on Android are DNS requests. An hour long timeout for them isn't really helpful especially considering DNS TTLs themselves are considerably shorter. Besides, RFC 4787 recommends at least a timeout of 5mins, which is still high for DNS, but may work nicely for other UDP connections, at least according to the RFC.

72

google-cla[bot] commented 3 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

ignoramous commented 3 years ago

@googlebot I signed it!

ignoramous commented 3 years ago

cc: @bemasc

(this was an attempt to add a reviewer... didn't work).

bemasc commented 3 years ago

You're right; we were applying the TCP timeout to UDP. Note that DNS is generally not affected: the DNS handler closes the mapping as soon as the response is relayed.