question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to "talk" to long sleeping devices behind NAT (patch)

See original GitHub issue

For a NB-IoT devices we’re facing NAT inflicted communications problems: As lwm2m protocol us UDP based and our devices usually sit in mobile operators private networks we can’t always assume working communication path from server to device. To be able to talk to our device we always observer our device on registration and have command queues for every device holding commands to that device to be executed when a periodic “refresh” of the observation is triggered by the device and the NAT channel is granted (usually for just 30 seconds). When the NAT session expires the next UDP packet from the device is with different port and probably different host. With default Network config this breaks the registration matching but luckily this can be overcome with some coapConfig.setString(NetworkConfig.Keys.RESPONSE_MATCHING,"PRINCIPAL"); and timeout tweaking. Yet in the current code the registration identity is immutable and never changes but this does not reflect the reality in our scenario and when the NAT session is recreated you should “talk” to the identity of the coap responce and not to the original registration identity. I’ve managed to device a minimal change to the current code base that allow proper communication in our scenario. The commit that does the trick is here:

https://github.com/sdrsdr/leshan/commit/6d569616e52c9d151eaddef4199fbf8922fa7d23

If there is a interest in this patch I can do a proper PR 😃

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
sbernard31commented, Jun 15, 2020

You could also have a look to this #854 PR I just created.

0reactions
sbernard31commented, Jun 22, 2020

@sdrsdr, if you can maybe you could add Allterco as Leshan adopters ? https://github.com/eclipse/leshan/issues/830

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to access a machine behind a restricted NAT gateway I ...
Anyways, I was wondering if there was a way to get around this using a VPN. I know that a VPN would allow...
Read more >
NAT problem - VuzeWiki
Basically, a Network Address Translation problem is caused by a router not being able to do what it's supposed to; it is not...
Read more >
The NAT and SIP Problem - Here's How to Fix it. - N2Net
NAT and SIP can be an issue for VoIP traffic, but how you can overcome that problem. SIP NAT can be easily understood...
Read more >
Troubleshoot NAT gateways - Amazon Virtual Private Cloud
The following topics help you to troubleshoot common issues that you might encounter when creating or using a NAT gateway. Issues. NAT gateway...
Read more >
pfSense 2.x - How to fix Strict NAT for XBox One
I used a small computer with 4 Ethernet port (network) ports. One port used for WAN (Internet) and one for LAN (my devices)....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found