NordicSemiconductor / NAT-TestFirmware

Used to test NAT timeouts, sends messages to NAT-TestServer
Other
0 stars 0 forks source link

Implement exponential backoff for interval and binary search to determine timeout #6

Closed coderbyheart closed 4 years ago

coderbyheart commented 4 years ago

Currently we use x = x * x/4 to calculate the timeout, but this will not be very performant with high intervals (can go into days).

Therfore switch to exponential intervals and use binary search to determine actual timeout.

https://docs.google.com/spreadsheets/d/1FDNBKepE8lNcUtF9cTy1peltDfOoZmz_VFBXb2WoS4w/edit?usp=sharing

boundlesscalm commented 4 years ago

bfa8a4b

coderbyheart commented 4 years ago

First UDP interval is now 100, please set back to 1.


TCP client started
Setting up LTE connection
[00:00:00.202,636] <dbg> lte_lc.w_lte_lc_connect: Network mode: AT%XSYSTEMMODE=1,0,0,0
[00:00:01.663,299] <dbg> lte_lc.parse_nw_reg_status: Network registration status: 2
[2020-04-27 16:32:30] [00:00:05.091,430] <dbg> lte_lc.parse_nw_reg_status: Network registration status: 5
[2020-04-27 16:32:30] LTE connected
[2020-04-27 16:32:30] [00:00:05.103,515] <dbg> lte_lc.parse_nw_reg_status: Network registration status: 5
[2020-04-27 16:32:31] Connected to server with protocol UDP
[2020-04-27 16:32:31] Packet sent: {
[2020-04-27 16:32:31]   "ip":   ["10.160.42.38"],
[2020-04-27 16:32:31]   "op":   "24201",
[2020-04-27 16:32:31]   "cell_id":      16956164,
[2020-04-27 16:32:31]   "ue_mode":      2,
[2020-04-27 16:32:31]   "iccid":        "8931089318104284409",
[2020-04-27 16:32:31]   "interval":     100
[2020-04-27 16:32:31] }
[2020-04-27 16:32:31] Waiting for response...
[2020-04-27 16:32:36] Waiting - %f seconds
coderbyheart commented 4 years ago

Backoff does not work at all:

SPM: prepare to jump to Non-Secure image.
*** Booting Zephyr OS build v2.1.99-ncs1-1145-g13dc96f83bab  ***
TCP client started
Setting up LTE connection
[00:00:00.202,636] <dbg> lte_lc.w_lte_lc_connect: Network mode: AT%XSYSTEMMODE=1,0,0,0
[00:00:01.663,299] <dbg> lte_lc.parse_nw_reg_status: Network registration status: 2
[2020-04-27 16:32:30] [00:00:05.091,430] <dbg> lte_lc.parse_nw_reg_status: Network registration status: 5
[2020-04-27 16:32:30] LTE connected
[2020-04-27 16:32:30] [00:00:05.103,515] <dbg> lte_lc.parse_nw_reg_status: Network registration status: 5
[2020-04-27 16:32:31] Connected to server with protocol UDP
[2020-04-27 16:32:31] Packet sent: {
[2020-04-27 16:32:31]   "ip":   ["10.160.42.38"],
[2020-04-27 16:32:31]   "op":   "24201",
[2020-04-27 16:32:31]   "cell_id":      16956164,
[2020-04-27 16:32:31]   "ue_mode":      2,
[2020-04-27 16:32:31]   "iccid":        "8931089318104284409",
[2020-04-27 16:32:31]   "interval":     100
[2020-04-27 16:32:31] }
[2020-04-27 16:32:31] Waiting for response...
[2020-04-27 16:32:36] Waiting - %f seconds
[2020-04-27 16:32:41] Waiting - %f seconds
[2020-04-27 16:32:46] Waiting - %f seconds
[2020-04-27 16:32:51] Waiting - %f seconds
[2020-04-27 16:32:56] Waiting - %f seconds
[2020-04-27 16:33:01] Waiting - %f seconds
[2020-04-27 16:33:06] Waiting - %f seconds
[2020-04-27 16:33:11] Waiting - %f seconds
[2020-04-27 16:33:16] Waiting - %f seconds
[2020-04-27 16:33:21] Waiting - %f seconds
[2020-04-27 16:33:26] Waiting - %f seconds
[2020-04-27 16:33:31] Waiting - %f seconds
[2020-04-27 16:33:36] Waiting - %f seconds
[2020-04-27 16:33:41] Waiting - %f seconds
[2020-04-27 16:33:46] Waiting - %f seconds
[2020-04-27 16:33:51] Waiting - %f seconds
[2020-04-27 16:33:56] Waiting - %f seconds
[2020-04-27 16:34:01] Waiting - %f seconds
[2020-04-27 16:34:06] Waiting - %f seconds
[2020-04-27 16:34:11] No response from server
[2020-04-27 16:34:11] Finished checking for protocol UDP
[2020-04-27 16:34:11] [00:01:46.402,709] <dbg> lte_lc.parse_nw_reg_status: Network registration status: 5
[2020-04-27 16:34:13] Connected to server with protocol TCP
[2020-04-27 16:34:13] Packet sent: {
[2020-04-27 16:34:13]   "ip":   ["10.160.42.38"],
[2020-04-27 16:34:13]   "op":   "24201",
[2020-04-27 16:34:13]   "cell_id":      16956164,
[2020-04-27 16:34:13]   "ue_mode":      2,
[2020-04-27 16:34:13]   "iccid":        "8931089318104284409",
[2020-04-27 16:34:13]   "interval":     306
[2020-04-27 16:34:13] }
[2020-04-27 16:34:13] Waiting for response...
[2020-04-27 16:34:18] Waiting - %f seconds
[2020-04-27 16:34:23] Waiting - %f seconds
boundlesscalm commented 4 years ago

Is this compiled from the repo or using the merged.hex I uploaded. Either way. Somehow you got a really early test version I ran that didn't work and neither had the binary search. I made sure I ran the code yesterday and then upload the it and the hex...

Let me know if it works now.

boundlesscalm commented 4 years ago

Was caused by wrong hex being uploaded. Funtional now