From: Martin Quinson Date: Fri, 13 Jul 2018 07:40:46 +0000 (+0200) Subject: ns3: manually packetize the data to send X-Git-Tag: v3_21~471^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/331665bd7365d35d9cb6eeb8e85e6536c4a001a0?hp=fa5d711a39f9c9a5cf179ee5ac8cd8aa220fb2d0 ns3: manually packetize the data to send --- diff --git a/src/surf/ns3/ns3_simulator.cpp b/src/surf/ns3/ns3_simulator.cpp index 825e555f2f..64230a0038 100644 --- a/src/surf/ns3/ns3_simulator.cpp +++ b/src/surf/ns3/ns3_simulator.cpp @@ -57,7 +57,8 @@ static void send_cb(ns3::Ptr sock, uint32_t txSpace) /* While not all is buffered and there remain space in the buffers */ while (flow->bufferedBytes_ < flow->totalBytes_ && sock->GetTxAvailable() > 0) { - uint32_t toWrite = std::min({flow->remaining_, sock->GetTxAvailable()}); + // Send at most 1040 bytes (data size in a TCP packet), as NS3 seems to not split correctly by itself + uint32_t toWrite = std::min({flow->remaining_, sock->GetTxAvailable(), std::uint32_t(1040)}); if (toWrite == 0) { // buffer full XBT_DEBUG("%f: buffer full on flow %p (still %u to go)", ns3::Simulator::Now().GetSeconds(), flow, flow->remaining_);