Bug #2317
closedNDNLP totalLength exceeds MTU causing IP fragmentation
100%
Description
I have a Data object of 1MB. I want to fragment the Data into multiple segments of 9000bytes and send them over a tunnel. At the sending side, I slice the Data into multiple fragments in daemon/face/datagram-face.hpp
static const size_t MTU = 9000;
unique_ptrndnlp::Slicer m_slicer;
m_slicer.reset(new ndnlp::Slicer(MTU));
ndnlp::PacketArray pa = m_slicer->slice(payload);
for (const auto& packet : *pa) {
m_socket->async_send(boost::asio::buffer(packet.wire(), packet.size()),
bind(&DatagramFace::handleSend, this, _1, _2, packet));
I expect the slicer to take the payload and create fragments of 9000bytes, including all the headers. Instead, it takes MTU sized payloads and appends the link layer header on it. This makes the fragment larger than 9000 bytes and causes IP fragmentation. In daemon/face/ndnlp-slicer.cpp function Slicer_encodeFragment, I added
NFD_LOG_WARN("***total fragment size " << totalLength);
Output: ***total fragment size 9024