dl5di / OpenDV

Open Digital Voice software for Amateur Radio based on Jonathan Naylor's (G4KLX) "ircDDBGateway" and "PCRepeaterController" for D-Star
GNU General Public License v2.0
106 stars 63 forks source link

G2 Udp hole punching / NAT Traversal #164

Open F4FXL opened 5 years ago

F4FXL commented 5 years ago

Hi,

This adds a simple UDP Hole punching/NAT Traversal mechanism to enable G2 (Call Sign Routing) for gateways running with non public IP, typically mobile networks.

I have recently read about UDP hole punching / NAT Traversal which is used in kademlia protocol. I decided to go for it and to see if it is possible to implement it to allow G2 to traverse NAT routers.

This turned out to be quite easy yet it has one limitation. There can only be one gateway behind the NAT router.

This works by sending a dummy 1 byte UDP packet on the G2 port every time a gateway is seen on the ircddb network. In case both gateway want to talk together the hole is already punched for DV data to flow through, if gateways don't NAT router will kill the UDP session after TTL is expired.

73 Geoffrey F4FXL - KC3FRA

johnhays commented 5 years ago

Port forwarding is the approach most commonly used.

On Thu, Nov 1, 2018, 07:30 Geoffrey Merck <notifications@github.com wrote:

Hi,

This adds a simple UDP Hole punching/NAT Traversal mechanism to enable G2 (Call Sign Routing) for gateways running with non public IP, typically mobile networks.

I have recently read about UDP hole punching / NAT Traversal which is used in kademlia protocol. I decided to go for it and to see if it is possible to implement it to allow G2 to traverse NAT routers.

This turned out to be quite easy yet it has one limitation. There can only be one gateway behind the NAT router.

This works by sending a dummy 1 byte UDP packet on the G2 port every time a gateway is seen on the ircddb network. In case both gateway want to talk together the hole is already punched for DV data to flow through, if gateways don't NAT router will kill the UDP session after TTL is expired.

73 Geoffrey F4FXL - KC3FRA

You can view, comment on, or merge this pull request online at:

https://github.com/dl5di/OpenDV/pull/164 Commit Summary

  • First G2 UDP Hole Punching test
  • Removed unnecessary loop, using G2_DV_PORT constant

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dl5di/OpenDV/pull/164, or mute the thread https://github.com/notifications/unsubscribe-auth/AGP0enB3vSpLnmA4bzwaE6RZqB1Vxsrgks5uqwVwgaJpZM4YGdrR .

F4FXL commented 5 years ago

Sure, but not always feasible if you are on a mobile network which is actually a big NAT where you cannot forward anything

johnhays commented 5 years ago

Yes, that is true. However, there is another option. See https://groups.io/g/net-44-vpn/wiki/home (It solves a whole bunch of NAT issues for Amateur Radio based projects).

On Thu, Nov 1, 2018 at 10:23 AM Geoffrey Merck notifications@github.com wrote:

Sure, but not always feasible if you are on a mobile network which is actually a big NAT where you cannot forward anything

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dl5di/OpenDV/pull/164#issuecomment-435113609, or mute the thread https://github.com/notifications/unsubscribe-auth/AGP0eqto9-m0i9vqSL3pfX-Sde7htwjYks5uqy3_gaJpZM4YGdrR .

--


John D. Hays Edmonds, WA K7VE

http://k7ve.org/blog http://twitter.com/#!/john_hays

F4FXL commented 5 years ago

This saves the hassle of setting up a VPN and all related stuff. Lots of people do not use VPN on their hotspot and are talking BS about dstar which is decaying. One has to admit the ccs server based stuff based call sign routing is not convenient to use nor smart as it requires to re issue the connection and use a stupid I'd instead of callsign. This provides a turnkey solution right into ircddbgateway and allows even hotspots to talk to each other with no server in between except the ircddb network.