From: Lucas Schnorr Date: Thu, 8 Sep 2011 08:28:33 +0000 (+0200) Subject: [NS3] send a maximum of 1024 bytes per Send X-Git-Tag: v3_6_2~113 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/90c7ba381698bf25fc1d118549b2b08875e7e47a [NS3] send a maximum of 1024 bytes per Send details: - this is the way to observe the known TCP behavior where bandwidth is equally shared among the flows --- diff --git a/src/surf/ns3/ns3_simulator.cc b/src/surf/ns3/ns3_simulator.cc index d7b29c1cc4..99e93d15a7 100644 --- a/src/surf/ns3/ns3_simulator.cc +++ b/src/surf/ns3/ns3_simulator.cc @@ -122,7 +122,8 @@ static void send_callback(Ptr localSocket, uint32_t txSpace){ return; } - uint32_t toWrite = min (mysocket->remaining, txSpace); + uint32_t packetSize = 1024; + uint32_t toWrite = min (mysocket->remaining, packetSize); uint8_t *data = (uint8_t*)malloc(sizeof(uint8_t)*toWrite); int amountSent = localSocket->Send (&data[0], toWrite, 0); free (data);