[Nfd-dev] Drop Packets NFD - XBee Face

Oscar Jaime Ciceri Coral oscarcicericoral at gmail.com
Mon May 20 07:11:38 PDT 2019


Dear Junxiao

Thank you very much for your answer.

We identify the problem in the XBee Transport, when is create the block as
below


(NFD xbee-transport.cpp)
std::tie(isOk, element) = Block::*fromBufferXBee*(*payload*, *length*);

(ndn-cxx block.cpp)
std::tuple<bool, Block>
Block::fromBufferXBee(const uint8_t* buffer, size_t offset)
{
      std::cout << "Buffer:             "<<buffer<<"\n";
      std::cout << "Offset:             "<<offset<<"\n";
      const uint8_t* pos = buffer;
      const uint8_t* const end = buffer+offset;
      std::cout << "Pos:             "<<pos<<"\n";
      std::cout << "End              "<<end<<"\n";
      uint32_t type = 0;
      std::cout << "type         "<<type<<"\n";
      bool isOk = tlv::readType(pos, end, type);
      if (!isOk) {
        return std::make_tuple(false, Block());
      }
      std::cout << "type         "<<type<<"\n";
      uint64_t length = 0;
      std::cout << "length         "<<length<<"\n";
      isOk = tlv::readVarNumber(pos, end, length);
      if (!isOk) {
        return std::make_tuple(false, Block());
      }
      std::cout << "length         "<<length<<"\n";
      // pos now points to TLV-VALUE
      if (length > static_cast<uint64_t>(end - pos)) {
        return std::make_tuple(false, Block());
      }
      size_t typeLengthSize = pos - buffer;
      auto b = make_shared<Buffer>(buffer, pos + length);
      std::cout << "Type:               "<<type<<"\n";
      std::cout << "typeLengthSize = pos - buffer :
"<<typeLengthSize<<"\n";

      return std::make_tuple(true, Block(b, type, b->begin(),
b->end(),b->begin() + typeLengthSize, b->end()));
}


The resulting trace is:

Buffer:
100[30]={81[8]=0000000000000001,82[1]=02,83[1]=05,80[12]=6C655F6F726967696E616C5F}
Offset:             82
Pos:
100[30]={81[8]=0000000000000001,82[1]=02,83[1]=05,80[12]=6C655F6F726967696E616C5F}
End
type         0
type         49
length         0
length         48
Type:               49
typeLengthSize = pos - buffer :  2
1558360770.236956 INFO: [nfd.XBeeTransport] Element:
49[48]=305B33305D3D7B38315B385D3D303030303030303030303030303030312C38325B315D3D30322C38335B315D3D30352C

I would like to ask you kindly,
what would be the appropriate values  for the  *payload* and  *length*,
when is called the *fromBufferXBee* function?








El vie., 17 de may. de 2019 a la(s) 11:14, Junxiao Shi (
shijunxiao at email.arizona.edu) escribió:

> Hi Oscar
>
> The TX  fragment the Interest Packets as:
>>
>>
>> 100[30]={81[8]=FFFFFFFFFFFFFFFF,82[1]=00,83[1]=05,80[12]=05310721080A636C69636B69}
>>
>> 100[30]={81[8]=0000000000000000,82[1]=01,83[1]=05,80[12]=646569610813746573746669}
>>
>> 100[30]={81[8]=0000000000000001,82[1]=02,83[1]=05,80[12]=6C655F6F726967696E616C5F}
>>
>> 100[30]={81[8]=0000000000000002,82[1]=03,83[1]=05,80[12]=31090212000A046287BE9A0C}
>> 100[21]={81[8]=0000000000000003,82[1]=04,83[1]=05,80[3]=020FA0}
>>
>
> This is a correctly encoded NDN Interest (packet format v0.2) in five
> NDNLPv2 fragments. I can interpret the L3 packet as:
> 0531 Interest
>   0721 Name
>     080A636C69636B6964656961 GenericNameComponent clickideia
>     08137465737466696C655F6F726967696E616C5F31 GenericNameComponent
> testfime_original_1
>   0902 Selectors
>     1200 MustBeFresh
>   0A046287BE9A Nonce
>   0C020FA0 InterestLifetime 4000ms
>
>
>
>> The RX is Dropping the packets as show below:
>>
>> XBee RX Message:
>> 100[30]={81[8]=FFFFFFFFFFFFFFFF,82[1]=00,83[1]=05,80[12]=05310721080A636C69636B69}
>>
>
> This line is correct.
>
> 1558009398.386278 TRACE: [nfd.XBeeTransport]
>> [id=256,local=xbee://,remote=xbee://[xbee]] Received: 82 bytes
>>
>
> The "82 bytes" is problematic, as we can see there are only 32 bytes in
> the NDNLPv2 frame.
>
>
>> Wire Type = 49
>>
>
> I don't know where does this number come from, but this is likely the
> problem because it also appears in GenericLinkService's error message.
>
>
>> TLV LpPacket = 100
>>
>
> This is the correct type and is what should be passed to the LinkService.
>
> 1558009398.386386 WARNING: [nfd.GenericLinkService]
>> [id=256,local=xbee://,remote=xbee://[xbee]] packet parse error
>> (unrecognized TLV-TYPE 49): DROP
>>
>
> Yours, Junxiao
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/nfd-dev/attachments/20190520/b83f12e3/attachment.html>


More information about the Nfd-dev mailing list