@@ -40,7 +40,7 @@ unsigned long start = getTickCount();
4040double global_start_time = 1.0 ;
4141double sink_start_time = global_start_time + 1.0 ;
4242double client_start_time = sink_start_time + 1.0 ;
43- double client_stop_time = client_start_time + 5 ; // sending time
43+ double client_stop_time = client_start_time + 30 ; // sending time
4444double sink_stop_time = client_stop_time + 5 ;
4545double global_stop_time = sink_stop_time + 5 ;
4646
@@ -185,8 +185,8 @@ main(int argc, char* argv[])
185185
186186 int running_number = 0 ;
187187 uint16_t pktSize = 1000 ; // in Bytes. 1458 to prevent fragments, default 512
188- std::string appDataRate[] = {" 1Mbps " , " 3Mbps " }; // Default application data rate
189- std::string ns3_link_rate = " 1000Mbps " ;
188+ std::string appDataRate[] = {" 10Mbps " , " 40Mbps " }; // Default application data rate
189+ std::string ns3_link_rate = " 100Mbps " ;
190190 bool enableTracePcap = true ;
191191
192192 std::string p4JsonPath =
@@ -230,8 +230,8 @@ main(int argc, char* argv[])
230230
231231 // set default network link parameter
232232 P4PointToPointHelper p4p2phelper;
233- p4p2phelper.SetDeviceAttribute (" DataRate" , DataRateValue (DataRate (" 10Mbps " )));
234- p4p2phelper.SetChannelAttribute (" Delay" , TimeValue (MilliSeconds (0.01 )));
233+ p4p2phelper.SetDeviceAttribute (" DataRate" , DataRateValue (DataRate (ns3_link_rate )));
234+ p4p2phelper.SetChannelAttribute (" Delay" , TimeValue (MilliSeconds (1 )));
235235
236236 P4TopologyReader::ConstLinksIterator_t iter;
237237 SwitchNodeC_t switchNodes[switchNum];
@@ -350,6 +350,7 @@ main(int argc, char* argv[])
350350 // p4SwitchHelper.SetDeviceAttribute("ChannelType", UintegerValue(0));
351351 p4SwitchHelper.SetDeviceAttribute (" P4SwitchArch" , UintegerValue (0 ));
352352 p4SwitchHelper.SetDeviceAttribute (" ChannelType" , UintegerValue (1 ));
353+ p4SwitchHelper.SetDeviceAttribute (" SwitchRate" , UintegerValue (10000 ));
353354
354355 for (unsigned int i = 0 ; i < switchNum; i++)
355356 {
@@ -410,18 +411,12 @@ main(int argc, char* argv[])
410411 onOff1.SetAttribute (" DataRate" , StringValue (appDataRate[0 ]));
411412 onOff1.SetAttribute (" OnTime" , StringValue (" ns3::ConstantRandomVariable[Constant=1]" ));
412413 onOff1.SetAttribute (" OffTime" , StringValue (" ns3::ConstantRandomVariable[Constant=0]" ));
413- onOff1.SetAttribute (" MaxBytes" , UintegerValue (5000 ));
414+ // onOff1.SetAttribute("MaxBytes", UintegerValue(5000));
414415
415416 ApplicationContainer app1 = onOff1.Install (terminals.Get (clientI));
416417 app1.Start (Seconds (client_start_time));
417418 app1.Stop (Seconds (client_stop_time));
418419
419- // === Setup Tracing ===
420- Ptr<OnOffApplication> ptr_app1 =
421- DynamicCast<OnOffApplication>(terminals.Get (clientI)->GetApplication (0 ));
422- ptr_app1->TraceConnectWithoutContext (" Tx" , MakeCallback (&TxCallback));
423- sinkApp1.Get (0 )->TraceConnectWithoutContext (" Rx" , MakeCallback (&RxCallback));
424-
425420 // Normal Stream == Second == send link h0 -----> h1
426421 servPort = 1301 ; // change the application port
427422
@@ -441,18 +436,12 @@ main(int argc, char* argv[])
441436 onOff2.SetAttribute (" DataRate" , StringValue (appDataRate[1 ]));
442437 onOff2.SetAttribute (" OnTime" , StringValue (" ns3::ConstantRandomVariable[Constant=1]" ));
443438 onOff2.SetAttribute (" OffTime" , StringValue (" ns3::ConstantRandomVariable[Constant=0]" ));
444- onOff2.SetAttribute (" MaxBytes" , UintegerValue (10000 ));
439+ // onOff2.SetAttribute("MaxBytes", UintegerValue(10000));
445440
446441 ApplicationContainer app2 = onOff2.Install (terminals.Get (clientI));
447442 app2.Start (Seconds (client_start_time));
448443 app2.Stop (Seconds (client_stop_time));
449444
450- // === Setup Tracing ===
451- Ptr<OnOffApplication> ptr_app2 =
452- DynamicCast<OnOffApplication>(terminals.Get (clientI)->GetApplication (1 ));
453- ptr_app2->TraceConnectWithoutContext (" Tx" , MakeCallback (&TxCallback_2));
454- sinkApp2.Get (0 )->TraceConnectWithoutContext (" Rx" , MakeCallback (&RxCallback_2));
455-
456445 // Enable pcap tracing
457446 p4p2phelper.EnablePcapAll (" p4-basic-tunnel" );
458447
0 commit comments