cetic / 6lbr

A deployment-ready 6LoWPAN Border Router solution based on Contiki
github.com/cetic/6lbr/wiki
Other
337 stars 194 forks source link

Too few fragment buffers in sicslowpan.c #322

Closed michelesponchiado closed 7 years ago

michelesponchiado commented 7 years ago

1st edit: missing words Hi, I am pretty convinced that in sicslowpan.c the number of fragment buffers defined by #define SICSLOWPAN_FRAGMENT_BUFFERS 12 is too low. I used the nc6 utility to test the transfer of large (>1024) packets over the 6lowPAN network, and it was not working. After some digging, I found in the sicslowpan.c log this entry: PRINTF("*** Failed to store fragment - packet reassembly will fail tag:%d l\n", frag_info[i].tag); so the store_fragment routine was failing and this was almost certainly because the number of buffers was too low. In the log I saw that the fragment storage operation was called 13 times before the end of the packet was reached, so a limit of 12 buffers seems too low. I changed the define to: #define SICSLOWPAN_FRAGMENT_BUFFERS 16 and this way the error in the fragment store disappears and I can send/receive large packets. There are some other malfunctioning in the stack that I am checking (after some large packets are sent the TCP/IP communication hangs), but this change in the number of buffers definitely seems to give an improvement.

laurentderu commented 7 years ago

12 buffers should be enough to reassemble a standard 1280 bytes IPv6 packet, however it's not enough for two packets at the same time (as allowed by the number of reassembly contexts)

I increased the default value on Native platform to 256 buffers and 16 contexts