MDSLab / s4t-lightning-rod

Implementation of the Lightning-rod, the Stack4Things node-side probe (this version works with the standalone version of IoTronic)
http://stack4things.unime.it/
Apache License 2.0
3 stars 8 forks source link

tcpkill purpose #24

Closed KostyaEsmukov closed 8 years ago

KostyaEsmukov commented 8 years ago

Hello,

Please explain the purpose of tcpkill in WAMP connection recovery part. Are you sure that it is required? Because in case of broken network link it will be closed anyway. Heartbeats+timeout approach is much more robust than tcpkill one. I'm almost sure that it can be safely pulled out. Please let me know what do you think of this.

https://github.com/MDSLab/s4t-lightning-rod/blob/00e3e5b9356156f2fa86b3e4443047aa730ceb1f/lightning-rod.js#L230-L313

npeditto commented 8 years ago

Hi Kostya,

this part of recovery process is required to trigger the connection lost event with WIFI connection. We noticed this strange behaviour ONLY in the boards connected in WIFI and that have an Internet connection provided via ADSL/Fiber. In particular (without tcpkill tool) the WAMP socket channel keeps "ALIVE" and only after 10 minutes (more or less) WAMP notices that the connection is compromised. So we need tcpkill tool to directly cut off the socket...in this way WAMP correctly/instantly triggers the connection lost through heartbeat+timeout mechanisms.

Of course if you have other suggestions let us know!

Nicola.

KostyaEsmukov commented 8 years ago

Hi Nicola,

Thank you for your response. I guess I have an idea how to gracefully handle such situations. Please let me know whether you are able to reproduce such setup in order to test my idea in real conditions. Thank you.

Kostya.

gmerlino commented 8 years ago

Let me clarify that unfortunately this is not so easy to reproduce, as it is obviously dependent on (broken) NAT implementations on the side of CPEs (Customer Premises Equiment) such as routers our DSL/Fiber providers rent us as residential customers. The only way to know for sure how reproducible it is (on your side) is by trying it out on any router you have and see if it behaves correctly or not.