diff --git a/run_experiments.sh b/run_experiments.sh deleted file mode 100755 index 9109f34f..00000000 --- a/run_experiments.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/bash - -# Check if arguments are provided -if [ "$#" -ne 10 ]; then - echo "Usage: $0 " - exit 1 -fi - -# Extract arguments -test_name=$1 -bandwidth_bottleneck=$2 -bandwidth_access=$3 -bandwidth_udp_access=$4 -delay_bottleneck=$5 -delay_access=$6 -delay_alternate=$7 -bandwidth_alternate=$8 -policy=$9 -variable=${10} - -edit_cpp_files() { - local filename=$1 - local policy=$2 - - awk -v BB="$bandwidth_bottleneck" -v BA="$bandwidth_access" -v BUA="$bandwidth_udp_access" -v DB="$delay_bottleneck" -v DA="$delay_access" -v DALT="$delay_alternate" -v BALT="$bandwidth_alternate" -v POL="$policy" ' - { - gsub(/std::string bandwidth_bottleneck = ".+";/, "std::string bandwidth_bottleneck = \"" BB "\";"); - gsub(/std::string bandwidth_access = ".+";/, "std::string bandwidth_access = \"" BA "\";"); - gsub(/std::string bandwidth_udp_access = ".+";/, "std::string bandwidth_udp_access = \"" BUA "\";"); - gsub(/std::string delay_bottleneck = ".+";/, "std::string delay_bottleneck = \"" DB "\";"); - gsub(/std::string delay_access = ".+";/, "std::string delay_access = \"" DA "\";"); - gsub(/std::string delay_alternate = ".+";/, "std::string delay_alternate = \"" DALT "\";"); - gsub(/std::string bandwidth_alternate = ".+";/, "std::string bandwidth_alternate = \"" BALT "\";"); - gsub(/CongestionPolicy = BasicCongestionPolicy<[0-9]+>;$/, "CongestionPolicy = BasicCongestionPolicy<" POL ">;"); - print - } - ' "$filename" >"$filename.tmp" && mv "$filename.tmp" "$filename" -} - -# Define function to run Docker command for each file -run_docker_command() { - local filename=$1 - echo "Running script: $filename" - - docker-compose run ns3 $filename -} - -# Define function to copy files to experiments directory -copy_files_to_experiments() { - local test_type=$1 - local variable=$2 - - dest_dir="experiments/$test_name/$variable/$policy/$test_type" - - # Create directory if it doesn't exist - mkdir -p $dest_dir - - cp -r traces/* $dest_dir -} - -# Main script starts here - -# Define test types -test_types=("baseline-no-udp" "baseline-udp" "frr" "frr-no-udp") - -# Loop through each test type -for test_type in "${test_types[@]}"; do - # Loop through each C++ file - for file in combined-$test_type.cc; do - # Edit lines in the C++ file - edit_cpp_files "src/$file" "$policy" - - sleep 1 - - # Run Docker command - run_docker_command $file - - # Copy resulting files to experiments directory - copy_files_to_experiments $test_type "$variable" - done -done - -# Wait for all background processes to finish -wait - -# Write parameters to a markdown file -echo "### Experiment Parameters" >"experiments/$test_name/README.md" -echo "- Bandwidth Bottleneck: $bandwidth_bottleneck" >>"experiments/$test_name/README.md" -echo "- Bandwidth Access: $bandwidth_access" >>"experiments/$test_name/README.md" -echo "- Bandwidth UDP Access: $bandwidth_udp_access" >>"experiments/$test_name/README.md" -echo "- Delay Bottleneck: $delay_bottleneck" >>"experiments/$test_name/README.md" -echo "- Delay Access: $delay_access" >>"experiments/$test_name/README.md" -echo "- Delay Alternate: $delay_alternate" >>"experiments/$test_name/README.md" -echo "- Bandwidth Alternate: $bandwidth_alternate" >>"experiments/$test_name/README.md" -#echo "- Congestion Policy: $policy" >>"experiments/$test_name/README.md" diff --git a/run_ns3.sh b/run_ns3.sh index 89c129e1..27e49ad2 100755 --- a/run_ns3.sh +++ b/run_ns3.sh @@ -44,7 +44,7 @@ done # Bandwidth primary experiments echo "Bandwidth Primary experiments" -bandwidth_vals=("75Kbps" "100Kbps" "125Kbps" "150Kbps" "175Kbps" "200Kbps" "225Kbps" "250Kbps" "275Kbps" "300Kbps") +bandwidth_vals=("200Kbps" "225Kbps" "250Kbps" "275Kbps" "300Kbps" "325Kbps" "350Kbps" "375Kbps" "400Kbps") for bandwidth_val in "${bandwidth_vals[@]}"; do echo "Bandwidth Primary value: $bandwidth_vals" for policy_number in 20 40 60 80 99; do @@ -54,7 +54,7 @@ done # Bandwidth alternate experiments echo "Bandwidth alternate experiments" -bandwidth_vals=("75Kbps" "100Kbps" "125Kbps" "150Kbps" "175Kbps" "200Kbps" "225Kbps" "250Kbps" "275Kbps" "300Kbps") +bandwidth_vals=("200Kbps" "225Kbps" "250Kbps" "275Kbps" "300Kbps" "325Kbps" "350Kbps" "375Kbps" "400Kbps") for bandwidth_val in "${bandwidth_vals[@]}"; do echo "Bandwidth Alternate value: $bandwidth_vals" for policy_number in 20 40 60 80 99; do diff --git a/src/combined-baseline-no-udp.cc b/src/combined-baseline-no-udp.cc index 0d69909a..b11e1a85 100644 --- a/src/combined-baseline-no-udp.cc +++ b/src/combined-baseline-no-udp.cc @@ -26,13 +26,13 @@ uint32_t segmentSize = 1024; uint32_t MTU_bytes = segmentSize + 54; // Topology parameters -std::string bandwidth_bottleneck = "150Kbps"; -std::string bandwidth_access = "600kbps"; +std::string bandwidth_primary = "300Kbps"; +std::string bandwidth_access = "200kbps"; std::string bandwidth_udp_access = "100kbps"; std::string delay_bottleneck = "20ms"; std::string delay_access = "20ms"; -std::string delay_alternate = "100ms"; -std::string bandwidth_alternate = "600kbps"; +std::string delay_alternate = "20ms"; +std::string bandwidth_alternate = "300kbps"; void SetupTCPConfig() { @@ -59,7 +59,7 @@ void SetupTCPConfig() void CalculateExpectedPackets(uint32_t tcp_max_bytes, DataRate udp_data_rate) { - DataRate bandwidth_bottleneck_dr(bandwidth_bottleneck); + DataRate bandwidth_primary_dr(bandwidth_primary); DataRate bandwidth_access_dr(bandwidth_access); Time bottleneck_delay_t(delay_bottleneck); Time access_delay_t(delay_access); @@ -67,14 +67,13 @@ void CalculateExpectedPackets(uint32_t tcp_max_bytes, DataRate udp_data_rate) // Serialization delay ~2ms Time serialization_delay_t( (1024 + 54) / - (std::min(bandwidth_bottleneck_dr, bandwidth_access_dr).GetBitRate())); + (std::min(bandwidth_primary_dr, bandwidth_access_dr).GetBitRate())); - uint32_t max_bottleneck_tcp_bytes = static_cast( - ((std::min(bandwidth_access_dr, bandwidth_bottleneck_dr).GetBitRate() / - 8) * - (((access_delay_t * 2) + bottleneck_delay_t) * 2 + - serialization_delay_t) - .GetSeconds())); + uint32_t max_bottleneck_tcp_bytes = static_cast(( + (std::min(bandwidth_access_dr, bandwidth_primary_dr).GetBitRate() / 8) * + (((access_delay_t * 2) + bottleneck_delay_t) * 2 + + serialization_delay_t) + .GetSeconds())); uint32_t expected_tcp_packets = std::ceil(max_bottleneck_tcp_bytes / (1024 + 54)); @@ -89,8 +88,7 @@ int main(int argc, char* argv[]) int number_of_tcp_senders = 1; std::string dir = ""; CommandLine cmd; - cmd.AddValue("bandwidth_primary", "Bandwidth primary", - bandwidth_bottleneck); + cmd.AddValue("bandwidth_primary", "Bandwidth primary", bandwidth_primary); cmd.AddValue("bandwidth_access", "Bandwidth Access", bandwidth_access); cmd.AddValue("bandwidth_udp_access", "Bandwidth UDP Access", bandwidth_udp_access); @@ -167,7 +165,7 @@ int main(int argc, char* argv[]) // PointToPointFRRHelper p2p_congested_link; PointToPointHelper p2p_congested_link; p2p_congested_link.SetDeviceAttribute("DataRate", - StringValue(bandwidth_bottleneck)); + StringValue(bandwidth_primary)); p2p_congested_link.SetChannelAttribute("Delay", StringValue(delay_bottleneck)); p2p_congested_link.SetQueue("ns3::DropTailQueue"); @@ -232,7 +230,7 @@ int main(int argc, char* argv[]) Ipv4GlobalRoutingHelper::PopulateRoutingTables(); // Receiver address Ipv4Address receiver_addr = interfaces_3_5.GetAddress(1); - std::cout << receiver_addr << std::endl; + // UDP Congestion traffic setup uint16_t udp_port = 50001; OnOffHelper udp_source("ns3::UdpSocketFactory", @@ -246,11 +244,11 @@ int main(int argc, char* argv[]) udp_source.SetAttribute("PacketSize", UintegerValue(1024)); // ApplicationContainer udp_app = udp_source.Install(nodes.Get(0)); - // udp_app.Start(Seconds(0.0)); - // udp_app.Stop(Seconds(5.0)); + // udp_app.Start(Seconds(2.0)); + // udp_app.Stop(Seconds(10.0)); DataRate b_access(bandwidth_access); - DataRate b_bottleneck(bandwidth_bottleneck); + DataRate b_bottleneck(bandwidth_primary); Time d_access(delay_access); Time d_bottleneck(delay_bottleneck); Time d_serialization("1.9ms"); @@ -270,7 +268,7 @@ int main(int argc, char* argv[]) tcp_apps.push_back(tcp_source.Install(tcp_devices.Get(i))); tcp_apps.back().Start(Seconds(0.0)); - tcp_apps.back().Stop(Seconds(5.0)); + tcp_apps.back().Stop(Seconds(10.0)); } // Packet sink setup (Receiver node) @@ -278,19 +276,14 @@ int main(int argc, char* argv[]) InetSocketAddress(Ipv4Address::GetAny(), tcp_port)); ApplicationContainer sink_app = sink.Install(nodes.Get(4)); sink_app.Start(Seconds(0.0)); - sink_app.Stop(Seconds(10.0)); + sink_app.Stop(Seconds(20.0)); PacketSinkHelper udp_sink( "ns3::UdpSocketFactory", InetSocketAddress(Ipv4Address::GetAny(), udp_port)); ApplicationContainer udp_sink_app = udp_sink.Install(nodes.Get(4)); udp_sink_app.Start(Seconds(0.0)); - udp_sink_app.Stop(Seconds(10.0)); - // SimulationQueue::sinkAddress = - // Mac48Address::ConvertFrom(getDevice<1>(devices_3_5)->GetAddress()); - // NOTE: Is TrafficControlHelper needed here? - - // CalculateExpectedPackets(10000, DataRate("1Mbps")); + udp_sink_app.Stop(Seconds(20.0)); p2p_traffic.EnablePcapAll(dir); p2p_congestion.EnablePcapAll(dir); diff --git a/src/combined-baseline-udp.cc b/src/combined-baseline-udp.cc index 74e4c2cf..d85eabf0 100644 --- a/src/combined-baseline-udp.cc +++ b/src/combined-baseline-udp.cc @@ -69,13 +69,13 @@ uint32_t segmentSize = 1024; uint32_t MTU_bytes = segmentSize + 54; // Topology parameters -std::string bandwidth_bottleneck = "150Kbps"; -std::string bandwidth_access = "600kbps"; +std::string bandwidth_primary = "300Kbps"; +std::string bandwidth_access = "200kbps"; std::string bandwidth_udp_access = "100kbps"; std::string delay_bottleneck = "20ms"; std::string delay_access = "20ms"; -std::string delay_alternate = "100ms"; -std::string bandwidth_alternate = "600kbps"; +std::string delay_alternate = "20ms"; +std::string bandwidth_alternate = "300kbps"; void SetupTCPConfig() { @@ -102,7 +102,7 @@ void SetupTCPConfig() void CalculateExpectedPackets(uint32_t tcp_max_bytes, DataRate udp_data_rate) { - DataRate bandwidth_bottleneck_dr(bandwidth_bottleneck); + DataRate bandwidth_primary_dr(bandwidth_primary); DataRate bandwidth_access_dr(bandwidth_access); Time bottleneck_delay_t(delay_bottleneck); Time access_delay_t(delay_access); @@ -110,14 +110,13 @@ void CalculateExpectedPackets(uint32_t tcp_max_bytes, DataRate udp_data_rate) // Serialization delay ~2ms Time serialization_delay_t( (1024 + 54) / - (std::min(bandwidth_bottleneck_dr, bandwidth_access_dr).GetBitRate())); + (std::min(bandwidth_primary_dr, bandwidth_access_dr).GetBitRate())); - uint32_t max_bottleneck_tcp_bytes = static_cast( - ((std::min(bandwidth_access_dr, bandwidth_bottleneck_dr).GetBitRate() / - 8) * - (((access_delay_t * 2) + bottleneck_delay_t) * 2 + - serialization_delay_t) - .GetSeconds())); + uint32_t max_bottleneck_tcp_bytes = static_cast(( + (std::min(bandwidth_access_dr, bandwidth_primary_dr).GetBitRate() / 8) * + (((access_delay_t * 2) + bottleneck_delay_t) * 2 + + serialization_delay_t) + .GetSeconds())); uint32_t expected_tcp_packets = std::ceil(max_bottleneck_tcp_bytes / (1024 + 54)); @@ -132,8 +131,7 @@ int main(int argc, char* argv[]) int number_of_tcp_senders = 1; std::string dir = ""; CommandLine cmd; - cmd.AddValue("bandwidth_primary", "Bandwidth primary", - bandwidth_bottleneck); + cmd.AddValue("bandwidth_primary", "Bandwidth primary", bandwidth_primary); cmd.AddValue("bandwidth_access", "Bandwidth Access", bandwidth_access); cmd.AddValue("bandwidth_udp_access", "Bandwidth UDP Access", bandwidth_udp_access); @@ -211,7 +209,7 @@ int main(int argc, char* argv[]) // PointToPointFRRHelper p2p_congested_link; PointToPointHelper p2p_congested_link; p2p_congested_link.SetDeviceAttribute("DataRate", - StringValue(bandwidth_bottleneck)); + StringValue(bandwidth_primary)); p2p_congested_link.SetChannelAttribute("Delay", StringValue(delay_bottleneck)); // p2p_congested_link.SetQueue(SimulationQueue::getQueueString()); @@ -294,11 +292,11 @@ int main(int argc, char* argv[]) udp_source.SetAttribute("PacketSize", UintegerValue(1024)); ApplicationContainer udp_app = udp_source.Install(nodes.Get(0)); - udp_app.Start(Seconds(0.0)); - udp_app.Stop(Seconds(5.0)); + udp_app.Start(Seconds(2.0)); + udp_app.Stop(Seconds(10.0)); DataRate b_access(bandwidth_access); - DataRate b_bottleneck(bandwidth_bottleneck); + DataRate b_bottleneck(bandwidth_primary); Time d_access(delay_access); Time d_bottleneck(delay_bottleneck); Time d_serialization("1.9ms"); @@ -318,7 +316,7 @@ int main(int argc, char* argv[]) tcp_apps.push_back(tcp_source.Install(tcp_devices.Get(i))); tcp_apps.back().Start(Seconds(0.0)); - tcp_apps.back().Stop(Seconds(5.0)); + tcp_apps.back().Stop(Seconds(10.0)); } // Packet sink setup (Receiver node) @@ -326,39 +324,15 @@ int main(int argc, char* argv[]) InetSocketAddress(Ipv4Address::GetAny(), tcp_port)); ApplicationContainer sink_app = sink.Install(nodes.Get(4)); sink_app.Start(Seconds(0.0)); - sink_app.Stop(Seconds(10.0)); + sink_app.Stop(Seconds(20.0)); PacketSinkHelper udp_sink( "ns3::UdpSocketFactory", InetSocketAddress(Ipv4Address::GetAny(), udp_port)); ApplicationContainer udp_sink_app = udp_sink.Install(nodes.Get(4)); udp_sink_app.Start(Seconds(0.0)); - udp_sink_app.Stop(Seconds(10.0)); - // SimulationQueue::sinkAddress = - // Mac48Address::ConvertFrom(getDevice<1>(devices_3_5)->GetAddress()); - // NOTE: Is TrafficControlHelper needed here? + udp_sink_app.Stop(Seconds(20.0)); - // CalculateExpectedPackets(10000, DataRate("1Mbps")); - - // LFA Alternate Path setup - // Set up an alternate forwarding target, assuming you have an alternate - // path configured - - // TODO: Need some help with setting alternate target - // setAlternateTarget<0>( - // devices_2_3, getDevice<0, ns3::PointToPointNetDevice>(devices_2_4)); - // setAlternateTarget<1>( - // devices_2_3, getDevice<1, ns3::PointToPointNetDevice>(devices_4_3)); - // setAlternateTarget<0>(devices01, getDevice<0>(devices02)); - // setAlternateTarget<0>(devices02, getDevice<0>(devices01)); - - // setAlternateTarget<0>(devices12, getDevice<1>(devices01)); - // setAlternateTarget<1>(devices01, getDevice<0>(devices12)); - - // setAlternateTarget<1>(devices02, getDevice<1>(devices12)); - // setAlternateTarget<1>(devices12, getDevice<1>(devices02)); - - // enableRerouting(getQueue<0>(devices_2_3)); p2p_traffic.EnablePcapAll(dir); p2p_congestion.EnablePcapAll(dir); diff --git a/src/combined-frr-no-udp.cc b/src/combined-frr-no-udp.cc index e898ef73..dc373bd3 100644 --- a/src/combined-frr-no-udp.cc +++ b/src/combined-frr-no-udp.cc @@ -69,13 +69,13 @@ uint32_t segmentSize = 1024; uint32_t MTU_bytes = segmentSize + 54; // Topology parameters -std::string bandwidth_bottleneck = "150Kbps"; -std::string bandwidth_access = "600kbps"; +std::string bandwidth_primary = "300Kbps"; +std::string bandwidth_access = "200kbps"; std::string bandwidth_udp_access = "100kbps"; std::string delay_bottleneck = "20ms"; std::string delay_access = "20ms"; -std::string delay_alternate = "100ms"; -std::string bandwidth_alternate = "600kbps"; +std::string delay_alternate = "20ms"; +std::string bandwidth_alternate = "300kbps"; void SetupTCPConfig() { @@ -102,7 +102,7 @@ void SetupTCPConfig() void CalculateExpectedPackets(uint32_t tcp_max_bytes, DataRate udp_data_rate) { - DataRate bandwidth_bottleneck_dr(bandwidth_bottleneck); + DataRate bandwidth_primary_dr(bandwidth_primary); DataRate bandwidth_access_dr(bandwidth_access); Time bottleneck_delay_t(delay_bottleneck); Time access_delay_t(delay_access); @@ -110,14 +110,13 @@ void CalculateExpectedPackets(uint32_t tcp_max_bytes, DataRate udp_data_rate) // Serialization delay ~2ms Time serialization_delay_t( (1024 + 54) / - (std::min(bandwidth_bottleneck_dr, bandwidth_access_dr).GetBitRate())); + (std::min(bandwidth_primary_dr, bandwidth_access_dr).GetBitRate())); - uint32_t max_bottleneck_tcp_bytes = static_cast( - ((std::min(bandwidth_access_dr, bandwidth_bottleneck_dr).GetBitRate() / - 8) * - (((access_delay_t * 2) + bottleneck_delay_t) * 2 + - serialization_delay_t) - .GetSeconds())); + uint32_t max_bottleneck_tcp_bytes = static_cast(( + (std::min(bandwidth_access_dr, bandwidth_primary_dr).GetBitRate() / 8) * + (((access_delay_t * 2) + bottleneck_delay_t) * 2 + + serialization_delay_t) + .GetSeconds())); uint32_t expected_tcp_packets = std::ceil(max_bottleneck_tcp_bytes / (1024 + 54)); @@ -132,8 +131,7 @@ int main(int argc, char* argv[]) int number_of_tcp_senders = 1; std::string dir = ""; CommandLine cmd; - cmd.AddValue("bandwidth_primary", "Bandwidth primary", - bandwidth_bottleneck); + cmd.AddValue("bandwidth_primary", "Bandwidth primary", bandwidth_primary); cmd.AddValue("bandwidth_access", "Bandwidth Access", bandwidth_access); cmd.AddValue("bandwidth_udp_access", "Bandwidth UDP Access", bandwidth_udp_access); @@ -210,7 +208,7 @@ int main(int argc, char* argv[]) PointToPointFRRHelper p2p_congested_link; // PointToPointHelper p2p_congested_link; p2p_congested_link.SetDeviceAttribute("DataRate", - StringValue(bandwidth_bottleneck)); + StringValue(bandwidth_primary)); p2p_congested_link.SetChannelAttribute("Delay", StringValue(delay_bottleneck)); p2p_congested_link.SetQueue(SimulationQueue::getQueueString()); @@ -295,11 +293,11 @@ int main(int argc, char* argv[]) udp_source.SetAttribute("PacketSize", UintegerValue(1024)); // ApplicationContainer udp_app = udp_source.Install(nodes.Get(0)); - // udp_app.Start(Seconds(0.0)); - // udp_app.Stop(Seconds(5.0)); + // udp_app.Start(Seconds(2.0)); + // udp_app.Stop(Seconds(10.0)); DataRate b_access(bandwidth_access); - DataRate b_bottleneck(bandwidth_bottleneck); + DataRate b_bottleneck(bandwidth_primary); Time d_access(delay_access); Time d_bottleneck(delay_bottleneck); Time d_serialization("1.9ms"); @@ -319,7 +317,7 @@ int main(int argc, char* argv[]) tcp_apps.push_back(tcp_source.Install(tcp_devices.Get(i))); tcp_apps.back().Start(Seconds(0.0)); - tcp_apps.back().Stop(Seconds(5.0)); + tcp_apps.back().Stop(Seconds(10.0)); } // Packet sink setup (Receiver node) @@ -327,13 +325,13 @@ int main(int argc, char* argv[]) InetSocketAddress(Ipv4Address::GetAny(), tcp_port)); ApplicationContainer sink_app = sink.Install(nodes.Get(4)); sink_app.Start(Seconds(0.0)); - sink_app.Stop(Seconds(10.0)); + sink_app.Stop(Seconds(20.0)); PacketSinkHelper udp_sink( "ns3::UdpSocketFactory", InetSocketAddress(Ipv4Address::GetAny(), udp_port)); ApplicationContainer udp_sink_app = udp_sink.Install(nodes.Get(4)); - udp_sink_app.Start(Seconds(0.0)); + udp_sink_app.Start(Seconds(2.0)); udp_sink_app.Stop(Seconds(10.0)); // LFA Alternate Path setup diff --git a/src/combined-frr.cc b/src/combined-frr.cc index 8885b8cb..b438ee44 100644 --- a/src/combined-frr.cc +++ b/src/combined-frr.cc @@ -68,13 +68,13 @@ uint32_t segmentSize = 1024; uint32_t MTU_bytes = segmentSize + 54; // Topology parameters -std::string bandwidth_bottleneck = "600Kbps"; -std::string bandwidth_access = "600kbps"; +std::string bandwidth_primary = "300Kbps"; +std::string bandwidth_access = "200kbps"; std::string bandwidth_udp_access = "100kbps"; std::string delay_bottleneck = "20ms"; std::string delay_access = "20ms"; std::string delay_alternate = "20ms"; -std::string bandwidth_alternate = "600kbps"; +std::string bandwidth_alternate = "300kbps"; void SetupTCPConfig() { @@ -106,8 +106,7 @@ int main(int argc, char* argv[]) int number_of_tcp_senders = 1; std::string dir = ""; CommandLine cmd; - cmd.AddValue("bandwidth_primary", "Bandwidth primary", - bandwidth_bottleneck); + cmd.AddValue("bandwidth_primary", "Bandwidth primary", bandwidth_primary); cmd.AddValue("bandwidth_access", "Bandwidth Access", bandwidth_access); cmd.AddValue("bandwidth_udp_access", "Bandwidth UDP Access", bandwidth_udp_access); @@ -185,7 +184,7 @@ int main(int argc, char* argv[]) PointToPointFRRHelper p2p_congested_link; // PointToPointHelper p2p_congested_link; p2p_congested_link.SetDeviceAttribute("DataRate", - StringValue(bandwidth_bottleneck)); + StringValue(bandwidth_primary)); p2p_congested_link.SetChannelAttribute("Delay", StringValue(delay_bottleneck)); p2p_congested_link.SetQueue(SimulationQueue::getQueueString()); @@ -270,11 +269,11 @@ int main(int argc, char* argv[]) udp_source.SetAttribute("PacketSize", UintegerValue(1024)); ApplicationContainer udp_app = udp_source.Install(nodes.Get(0)); - udp_app.Start(Seconds(0.0)); - udp_app.Stop(Seconds(5.0)); + udp_app.Start(Seconds(2.0)); + udp_app.Stop(Seconds(10.0)); DataRate b_access(bandwidth_access); - DataRate b_bottleneck(bandwidth_bottleneck); + DataRate b_bottleneck(bandwidth_primary); Time d_access(delay_access); Time d_bottleneck(delay_bottleneck); Time d_serialization("1.9ms"); @@ -282,7 +281,6 @@ int main(int argc, char* argv[]) // TCP Setup SetupTCPConfig(); uint16_t tcp_port = 50002; - std::list tcp_apps; for (int i = 0; i < number_of_tcp_senders; i++) { BulkSendHelper tcp_source("ns3::TcpSocketFactory", @@ -294,7 +292,7 @@ int main(int argc, char* argv[]) tcp_apps.push_back(tcp_source.Install(tcp_devices.Get(i))); tcp_apps.back().Start(Seconds(0.0)); - tcp_apps.back().Stop(Seconds(5.0)); + tcp_apps.back().Stop(Seconds(10.0)); } // Packet sink setup (Receiver node) @@ -302,14 +300,14 @@ int main(int argc, char* argv[]) InetSocketAddress(Ipv4Address::GetAny(), tcp_port)); ApplicationContainer sink_app = sink.Install(nodes.Get(4)); sink_app.Start(Seconds(0.0)); - sink_app.Stop(Seconds(10.0)); + sink_app.Stop(Seconds(20.0)); PacketSinkHelper udp_sink( "ns3::UdpSocketFactory", InetSocketAddress(Ipv4Address::GetAny(), udp_port)); ApplicationContainer udp_sink_app = udp_sink.Install(nodes.Get(4)); udp_sink_app.Start(Seconds(0.0)); - udp_sink_app.Stop(Seconds(10.0)); + udp_sink_app.Stop(Seconds(20.0)); // LFA Alternate Path setup // Set up an alternate forwarding target, assuming you have an alternate diff --git a/test_suite.sh b/test_suite.sh deleted file mode 100755 index 18d10db5..00000000 --- a/test_suite.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash - -# Define parameters -bandwidth_bottleneck="150Kbps" -bandwidth_access="600kbps" -bandwidth_udp_access="100kbps" -delay_bottleneck="20ms" -delay_access="20ms" -delay_alternate="20ms" -bandwidth_alternate="600kbps" - -# Define function to run experiments for a given policy number -run_experiment() { - local policy_number=$1 - local test_name=$2 - local test_variable=$3 - - # Run experiments with current policy number - ./run_experiments.sh "$test_name" "$bandwidth_bottleneck" "$bandwidth_access" "$bandwidth_udp_access" "$delay_bottleneck" "$delay_access" "$delay_alternate" "$bandwidth_alternate" "$policy_number" "$test_variable" -} - -# Define initial test number -test_name="delay-primary" - -# Define delay_vals array correctly -delay_vals=("0ms" "40ms" "60ms" "80ms") - -for delay_val in "${delay_vals[@]}"; do - delay_bottleneck=$delay_val - for policy_number in 20 40 60 80 99; do - run_experiment "$policy_number" "$test_name" "$delay_val" - done -done -delay_bottleneck="20ms" - -test_name="bandwidth-alternate" -# Define bandwidth_vals array correctly -bandwidth_vals=("200Kbps" "400Kbps" "600Kbps" "800Kbps" "1000Kbps") - -for bandwidth_val in "${bandwidth_vals[@]}"; do - bandwidth_alternate=$bandwidth_val - for policy_number in 20 40 60 80 99; do - run_experiment "$policy_number" "$test_name" "$bandwidth_val" - done -done -bandwidth_alternate="600kbps" - -test_name="delay-alternate" -# Define delay_vals array correctly -delay_vals=("0ms" "20ms" "40ms" "60ms" "80ms" "100ms") - -for delay_val in "${delay_vals[@]}"; do - delay_alternate=$delay_val - for policy_number in 20 40 60 80 99; do - run_experiment "$policy_number" "$test_name" "$delay_val" - done -done -delay_alternate="20ms"