Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use default config value for MTU.
authorNavarrop <Pierre.Navarro@imag.fr>
Mon, 12 Sep 2011 12:55:58 +0000 (14:55 +0200)
committerNavarrop <Pierre.Navarro@imag.fr>
Mon, 12 Sep 2011 15:20:57 +0000 (17:20 +0200)
src/surf/ns3/ns3_interface.cc
src/surf/ns3/ns3_simulator.cc

index fce98bc..10d8d6b 100644 (file)
@@ -100,7 +100,7 @@ int ns3_initialize(const char* TcpProtocol){
 //  "ns3::TcpReno"
 //  "ns3::TcpTahoe"
 
 //  "ns3::TcpReno"
 //  "ns3::TcpTahoe"
 
-  Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (1000)); // 1000-byte packet for easier reading
+  Config::SetDefault ("ns3::TcpSocket::SegmentSize", UintegerValue (1024)); // 1024-byte packet for easier reading
   Config::SetDefault ("ns3::TcpSocket::DelAckCount", UintegerValue (1));
 
   if(!strcmp(TcpProtocol,"default")){
   Config::SetDefault ("ns3::TcpSocket::DelAckCount", UintegerValue (1));
 
   if(!strcmp(TcpProtocol,"default")){
index af1359b..07abf0c 100644 (file)
@@ -117,8 +117,7 @@ static void send_callback(Ptr<Socket> localSocket, uint32_t txSpace){
          return;
        }
 
          return;
        }
 
-       uint32_t packetSize = 1024;
-       uint32_t toWrite = min (mysocket->remaining, packetSize);
+       uint32_t toWrite = min (mysocket->remaining, txSpace);
        uint8_t *data = (uint8_t*)malloc(sizeof(uint8_t)*toWrite);
        int amountSent = localSocket->Send (&data[0], toWrite, 0);
        free (data);
        uint8_t *data = (uint8_t*)malloc(sizeof(uint8_t)*toWrite);
        int amountSent = localSocket->Send (&data[0], toWrite, 0);
        free (data);