cn-uofbasel / ccn-lite

CCN-lite, a lightweight implementation of the CCNx protocol and its variations
ISC License
74 stars 63 forks source link

NDN interest life time is wrong #382

Closed MahdiBaghbani closed 3 years ago

MahdiBaghbani commented 3 years ago

Description

I was trying to stream video using ndn format and created the stream packets with ccn-lite-produce and tried to receive them with ccn-lite-fetch but the relay always shows timeout.

Steps to reproduce the issue

  1. choose any video file you like.
  2. use ccn-lite-produce to create packetized NDO for ndn2013 format.
  3. start relay and point content store to the directory containing files produced in last step.
  4. try to receive with ccn-lite-fetch
  5. timeout!

Expected results

no timeout!

Actual results

timeout

[D] 381.5000: ccn_iribu_core_RX ifndx=0, 28 bytes
[D] 381.5000:   face 4, peer=127.0.0.1/43883
[D] 381.5000: ccn_iribu_ndntlv_forwarder (28 bytes left)
[D] 381.5000: ccn_iribu_ndntlv_bytes2pkt len=26
[D] 381.5000:   check interest type
[I] 381.5000:   incoming interest=</ndn/test/movie>ndn2013 nonce=1501772704 from=127.0.0.1/43883
[D] 381.5000:   searching in CS
[D] 381.5000:   created new interest entry 0x55d7f8835458 (prefix=/ndn/test/movie)
[D] 381.5000:   appending interest entry 0x55d7f8835458
[D] 381.5000:   appending a new pendint entry 0x55d7f88354c8 </ndn/test/movie>(0x55d7f8834e78)
[D] 381.5000: ccn_iribu_interest_propagate
[D] 381.7000:  timeout: remove interest 0x0x55d7f8835458 </ndn/test/movie>

Versions

Operating system: Linux, Compiler: GCC 9

MahdiBaghbani commented 3 years ago

So far so good I have tracked down the issue to below lines of code.

Here it seems we define the default timeout to be 10 and as I read your past issues and closed issues I understand that the time is in seconds so it means 10 seconds. https://github.com/cn-uofbasel/ccn-lite/blob/f125b9fb33c39074190f165c237652a669b8485a/src/ccnl-core/include/ccnl-defs.h#L74-L76

then I come to this issue here #210 so it seems that you have seen it before and fixed it, but why the issue still persists?

I explored the changes you made to solve this problem and I think I spotted the problem in this commit: 92e797e32d344a1b9a618353c0b1cb7e21597245

so here you made an exception for NDN because it's lifetime should be in milliseconds rather than seconds and you will divide it by 1000 to be compatible with your actual aging function which is operated in seconds: https://github.com/cn-uofbasel/ccn-lite/blob/f125b9fb33c39074190f165c237652a669b8485a/src/ccnl-core/src/ccnl-pkt-util.c#L231-L234

but you forget something! I was wondering why this works in RIOT and not in my PC, so here it is: https://github.com/cn-uofbasel/ccn-lite/blob/f125b9fb33c39074190f165c237652a669b8485a/src/ccnl-riot/src/ccn-lite-riot.c#L531 https://github.com/cn-uofbasel/ccn-lite/blob/f125b9fb33c39074190f165c237652a669b8485a/src/ccnl-pkt/src/ccnl-pkt-ndntlv.c#L154

it seems while you changed the RIOT NDN specification to milliseconds you forget to do it for the actual NDN data packet structure.