Project

General

Profile

Actions

Bug #1774

closed

Packet size limit is not exposed or restricted in Face

Added by Junxiao Shi almost 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Base
Target version:
Start date:
07/18/2014
Due date:
% Done:

100%

Estimated time:

Description

Snippet to reproduce:

// g++ packetlength.cpp `pkg-config --libs --cflags libndn-cxx`

#include <ndn-cxx/face.hpp>
#include <ndn-cxx/security/key-chain.hpp>

using namespace ndn;

int
main(int argc, char** argv)
{
  Face face;
  KeyChain keyChain;

  static uint8_t buffer[9000];

  shared_ptr<Data> data = make_shared<Data>("/A");
  data->setContent(buffer, sizeof(buffer));
  keyChain.sign(*data);
  face.put(*data);

  face.processEvents();
}

Actual:

terminate called after throwing an instance of 'ndn::Transport::Error'
  what():  error while receiving data from socket (Connection reset by peer)
Aborted (core dumped)

Expected:

  • A constant equal to NFD's MAX_NDN_PACKET_SIZE is defined as part of ndn-cxx public API
  • An exception is raised in Face::put and Face::expressInterest when packet size exceeds the limit
Actions #1

Updated by Alex Afanasyev over 9 years ago

Regarding exception. I can add the exception in from expressInterest/put, but it will not be exact. When LocalControlHeader is used, only the size of the actual data packet will be checked, while NFD will not process any TLV with size larger than maximum.

I think this part is not correct on NFD part. We should allow Interest/Data packet size of maximum, which implies that we should allow extra bytes for LocalControlHeader information.

Actions #2

Updated by Alex Afanasyev over 9 years ago

  • Status changed from New to Code review
  • Assignee set to Alex Afanasyev
  • % Done changed from 0 to 100
Actions #3

Updated by Alex Afanasyev over 9 years ago

  • Status changed from Code review to Closed
Actions

Also available in: Atom PDF