OpenDV icon indicating copy to clipboard operation
OpenDV copied to clipboard

G2 Udp hole punching / NAT Traversal

Open F4FXL opened this issue 5 years ago • 4 comments

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

F4FXL avatar Nov 01 '18 14:11 F4FXL

Port forwarding is the approach most commonly used.

On Thu, Nov 1, 2018, 07:30 Geoffrey Merck <[email protected] 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:

  • https://github.com/dl5di/OpenDV/pull/164.patch
  • https://github.com/dl5di/OpenDV/pull/164.diff

— 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 .

johnhays avatar Nov 01 '18 15:11 johnhays

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

F4FXL avatar Nov 01 '18 17:11 F4FXL

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 [email protected] 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

johnhays avatar Nov 01 '18 17:11 johnhays

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.

F4FXL avatar Nov 01 '18 17:11 F4FXL