Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[NS3] send a maximum of 1024 bytes per Send
authorLucas Schnorr <Lucas.Schnorr@imag.fr>
Thu, 8 Sep 2011 08:28:33 +0000 (10:28 +0200)
committerLucas Schnorr <Lucas.Schnorr@imag.fr>
Thu, 8 Sep 2011 14:56:11 +0000 (16:56 +0200)
details:
- this is the way to observe the known TCP behavior
where bandwidth is equally shared among the flows

src/surf/ns3/ns3_simulator.cc

index d7b29c1..99e93d1 100644 (file)
@@ -122,7 +122,8 @@ static void send_callback(Ptr<Socket> 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);