From 556f6694d39fd587fafc7a113ef979d0331c3a39 Mon Sep 17 00:00:00 2001 From: charliebarber Date: Sat, 6 Apr 2024 16:44:49 +0100 Subject: [PATCH 1/9] Initial parameters changes and starting UDP after 2 seconds --- run_experiments.sh | 95 --------------------------------- run_ns3.sh | 4 +- src/combined-baseline-no-udp.cc | 40 +++++++------- src/combined-baseline-udp.cc | 40 +++++++------- src/combined-frr-no-udp.cc | 40 +++++++------- src/combined-frr.cc | 23 ++++---- test_suite.sh | 58 -------------------- 7 files changed, 70 insertions(+), 230 deletions(-) delete mode 100755 run_experiments.sh delete mode 100755 test_suite.sh 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 67d23ca9..c8dca717 100755 --- a/run_ns3.sh +++ b/run_ns3.sh @@ -40,7 +40,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 @@ -50,7 +50,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 1ca4b3f6..d3a9d28d 100644 --- a/src/combined-baseline-no-udp.cc +++ b/src/combined-baseline-no-udp.cc @@ -67,13 +67,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() { @@ -100,7 +100,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); @@ -108,14 +108,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)); @@ -129,8 +128,7 @@ int main(int argc, char* argv[]) int cong_threshold = 0; 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); @@ -198,7 +196,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()); @@ -273,11 +271,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"); @@ -293,21 +291,21 @@ int main(int argc, char* argv[]) UintegerValue(1024)); // Packet size in bytes ApplicationContainer tcp_app = tcp_source.Install(nodes.Get(1)); tcp_app.Start(Seconds(0.0)); - tcp_app.Stop(Seconds(5.0)); + tcp_app.Stop(Seconds(10.0)); // Packet sink setup (Receiver node) PacketSinkHelper sink("ns3::TcpSocketFactory", InetSocketAddress(Ipv4Address::GetAny(), tcp_port)); ApplicationContainer sink_app = sink.Install(nodes.Get(5)); 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(5)); 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/src/combined-baseline-udp.cc b/src/combined-baseline-udp.cc index 1d9ee631..e317763d 100644 --- a/src/combined-baseline-udp.cc +++ b/src/combined-baseline-udp.cc @@ -66,13 +66,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() { @@ -99,7 +99,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); @@ -107,14 +107,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)); @@ -128,8 +127,7 @@ int main(int argc, char* argv[]) int cong_threshold = 0; 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); @@ -197,7 +195,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()); @@ -272,11 +270,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"); @@ -292,21 +290,21 @@ int main(int argc, char* argv[]) UintegerValue(1024)); // Packet size in bytes ApplicationContainer tcp_app = tcp_source.Install(nodes.Get(1)); tcp_app.Start(Seconds(0.0)); - tcp_app.Stop(Seconds(5.0)); + tcp_app.Stop(Seconds(10.0)); // Packet sink setup (Receiver node) PacketSinkHelper sink("ns3::TcpSocketFactory", InetSocketAddress(Ipv4Address::GetAny(), tcp_port)); ApplicationContainer sink_app = sink.Install(nodes.Get(5)); 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(5)); udp_sink_app.Start(Seconds(0.0)); - udp_sink_app.Stop(Seconds(10.0)); + udp_sink_app.Stop(Seconds(20.0)); // SimulationQueue::sinkAddress = // Mac48Address::ConvertFrom(getDevice<1>(devices_3_5)->GetAddress()); // NOTE: Is TrafficControlHelper needed here? diff --git a/src/combined-frr-no-udp.cc b/src/combined-frr-no-udp.cc index 173d2e44..fae797ab 100644 --- a/src/combined-frr-no-udp.cc +++ b/src/combined-frr-no-udp.cc @@ -66,13 +66,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() { @@ -99,7 +99,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); @@ -107,14 +107,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)); @@ -128,8 +127,7 @@ int main(int argc, char* argv[]) int cong_threshold = 0; 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); @@ -197,7 +195,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()); @@ -272,11 +270,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"); @@ -292,20 +290,20 @@ int main(int argc, char* argv[]) UintegerValue(1024)); // Packet size in bytes ApplicationContainer tcp_app = tcp_source.Install(nodes.Get(1)); tcp_app.Start(Seconds(0.0)); - tcp_app.Stop(Seconds(5.0)); + tcp_app.Stop(Seconds(10.0)); // Packet sink setup (Receiver node) PacketSinkHelper sink("ns3::TcpSocketFactory", InetSocketAddress(Ipv4Address::GetAny(), tcp_port)); ApplicationContainer sink_app = sink.Install(nodes.Get(5)); 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(5)); - 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 74009ba4..3b4306ea 100644 --- a/src/combined-frr.cc +++ b/src/combined-frr.cc @@ -66,13 +66,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() { @@ -103,8 +103,7 @@ int main(int argc, char* argv[]) int cong_threshold = 0; 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); @@ -172,7 +171,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()); @@ -247,11 +246,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"); @@ -267,21 +266,21 @@ int main(int argc, char* argv[]) UintegerValue(1024)); // Packet size in bytes ApplicationContainer tcp_app = tcp_source.Install(nodes.Get(1)); tcp_app.Start(Seconds(0.0)); - tcp_app.Stop(Seconds(5.0)); + tcp_app.Stop(Seconds(10.0)); // Packet sink setup (Receiver node) PacketSinkHelper sink("ns3::TcpSocketFactory", InetSocketAddress(Ipv4Address::GetAny(), tcp_port)); ApplicationContainer sink_app = sink.Install(nodes.Get(5)); 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(5)); 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" From 397ef37278bd3906b0a5fd1a10c8a1205f9e073c Mon Sep 17 00:00:00 2001 From: YousefEZ <45167695+YousefEZ@users.noreply.github.com> Date: Sat, 6 Apr 2024 17:43:17 +0300 Subject: [PATCH 2/9] :sparkles: added tcp sender (flows) as argument to cmd --- src/combined-frr-no-udp.cc | 60 +++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/src/combined-frr-no-udp.cc b/src/combined-frr-no-udp.cc index fae797ab..08525e2d 100644 --- a/src/combined-frr-no-udp.cc +++ b/src/combined-frr-no-udp.cc @@ -125,6 +125,7 @@ void CalculateExpectedPackets(uint32_t tcp_max_bytes, DataRate udp_data_rate) int main(int argc, char* argv[]) { int cong_threshold = 0; + int number_of_tcp_senders = 1; std::string dir = ""; CommandLine cmd; cmd.AddValue("bandwidth_primary", "Bandwidth primary", bandwidth_primary); @@ -136,6 +137,7 @@ int main(int argc, char* argv[]) cmd.AddValue("delay_alternate", "Delay Alternate", delay_alternate); cmd.AddValue("bandwidth_alternate", "Bandwidth Alternate", bandwidth_alternate); + cmd.AddValue("tcp_senders", "Number of TCP Senders", number_of_tcp_senders); cmd.AddValue("policy_threshold", "Congestion policy threshold", cong_threshold); cmd.AddValue("dir", "Traces directory", dir); @@ -173,13 +175,16 @@ int main(int argc, char* argv[]) // Topology setup NS_LOG_INFO("Creating Topology"); NodeContainer nodes; - nodes.Create(6); + nodes.Create(5 + number_of_tcp_senders); Names::Add("CongestionSender", nodes.Get(0)); - Names::Add("TrafficSender", nodes.Get(1)); - Names::Add("Router01", nodes.Get(2)); - Names::Add("Router02", nodes.Get(3)); - Names::Add("Router03", nodes.Get(4)); - Names::Add("Receiver", nodes.Get(5)); + for (int i = 0; i < number_of_tcp_senders; i++) + Names::Add("TrafficSender" + std::to_string(i), nodes.Get(1 + i)); + + int offset = number_of_tcp_senders; + Names::Add("Router01", nodes.Get(offset + 1)); + Names::Add("Router02", nodes.Get(offset + 2)); + Names::Add("Router03", nodes.Get(offset + 3)); + Names::Add("Receiver", nodes.Get(offset + 4)); InternetStackHelper stack; stack.Install(nodes); @@ -212,16 +217,21 @@ int main(int argc, char* argv[]) p2p_alternate.SetChannelAttribute("Delay", StringValue(delay_alternate)); p2p_alternate.SetQueue("ns3::DropTailQueue"); - NetDeviceContainer devices_1_2 = - p2p_traffic.Install(nodes.Get(1), nodes.Get(2)); - NetDeviceContainer devices_2_3 = - p2p_congested_link.Install(nodes.Get(2), nodes.Get(3)); + std::list tcp_senders; + + for (int i = 0; i < number_of_tcp_senders; i++) { + tcp_senders.push_back( + p2p_traffic.Install(nodes.Get(1 + i), nodes.Get(offset + 1))); + } + + NetDeviceContainer devices_2_3 = p2p_congested_link.Install( + nodes.Get(offset + 1), nodes.Get(offset + 2)); NetDeviceContainer devices_2_4 = - p2p_alternate.Install(nodes.Get(2), nodes.Get(4)); + p2p_alternate.Install(nodes.Get(offest + 1), nodes.Get(offset + 3)); NetDeviceContainer devices_4_3 = - p2p_alternate.Install(nodes.Get(4), nodes.Get(3)); + p2p_alternate.Install(nodes.Get(offset + 3), nodes.Get(offset + 2)); NetDeviceContainer devices_3_5 = - p2p_traffic.Install(nodes.Get(3), nodes.Get(5)); + p2p_traffic.Install(nodes.Get(offset + 2), nodes.Get(offset + 4)); // Configure PointToPoint link for congestion link PointToPointHelper p2p_congestion; @@ -238,20 +248,25 @@ int main(int argc, char* argv[]) Ipv4AddressHelper address; address.SetBase("10.1.1.0", "255.255.255.0"); Ipv4InterfaceContainer interfaces_0_2 = address.Assign(devices_0_2); - Ipv4InterfaceContainer interfaces_1_2 = address.Assign(devices_1_2); address.NewNetwork(); - address.SetBase("10.1.2.0", "255.255.255.0"); + + for (int i = 0; i < number_of_tcp_senders; i++) { + address.Assign(tcp_senders[i]); + address.NewNetwork(); + } + Ipv4InterfaceContainer interfaces_2_3 = address.Assign(devices_2_3); address.NewNetwork(); - address.SetBase("10.1.3.0", "255.255.255.0"); + Ipv4InterfaceContainer interfaces_2_4 = address.Assign(devices_2_4); address.NewNetwork(); - address.SetBase("10.1.4.0", "255.255.255.0"); + Ipv4InterfaceContainer interfaces_4_3 = address.Assign(devices_4_3); address.NewNetwork(); - address.SetBase("10.1.5.0", "255.255.255.0"); + Ipv4InterfaceContainer interfaces_3_5 = address.Assign(devices_3_5); address.NewNetwork(); + Ipv4GlobalRoutingHelper::PopulateRoutingTables(); // Receiver address @@ -288,9 +303,12 @@ int main(int argc, char* argv[]) UintegerValue(100000)); // 0 for unlimited data tcp_source.SetAttribute("SendSize", UintegerValue(1024)); // Packet size in bytes - ApplicationContainer tcp_app = tcp_source.Install(nodes.Get(1)); - tcp_app.Start(Seconds(0.0)); - tcp_app.Stop(Seconds(10.0)); + + for (int i = 0; i < number_of_tcp_senders; i++) { + ApplicationContainer tcp_app = tcp_source.Install(nodes.Get(1 + i)); + tcp_app.Start(Seconds(0.0)); + tcp_app.Stop(Seconds(10.0)); + } // Packet sink setup (Receiver node) PacketSinkHelper sink("ns3::TcpSocketFactory", From 616728f9ec85f86950643a103766c85f6b549356 Mon Sep 17 00:00:00 2001 From: YousefEZ <45167695+YousefEZ@users.noreply.github.com> Date: Sat, 6 Apr 2024 17:54:44 +0300 Subject: [PATCH 3/9] :bug: fix issues --- src/combined-frr-no-udp.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/combined-frr-no-udp.cc b/src/combined-frr-no-udp.cc index 08525e2d..b12ddfdf 100644 --- a/src/combined-frr-no-udp.cc +++ b/src/combined-frr-no-udp.cc @@ -227,7 +227,7 @@ int main(int argc, char* argv[]) NetDeviceContainer devices_2_3 = p2p_congested_link.Install( nodes.Get(offset + 1), nodes.Get(offset + 2)); NetDeviceContainer devices_2_4 = - p2p_alternate.Install(nodes.Get(offest + 1), nodes.Get(offset + 3)); + p2p_alternate.Install(nodes.Get(offset + 1), nodes.Get(offset + 3)); NetDeviceContainer devices_4_3 = p2p_alternate.Install(nodes.Get(offset + 3), nodes.Get(offset + 2)); NetDeviceContainer devices_3_5 = @@ -250,9 +250,9 @@ int main(int argc, char* argv[]) Ipv4InterfaceContainer interfaces_0_2 = address.Assign(devices_0_2); address.NewNetwork(); - for (int i = 0; i < number_of_tcp_senders; i++) { - address.Assign(tcp_senders[i]); - address.NewNetwork(); + for (auto& tcp_sender : tcp_senders) { + address.Assign(tcp_sender); + address.NewNetwork(); } Ipv4InterfaceContainer interfaces_2_3 = address.Assign(devices_2_3); From abb8cc28c74558c3833b5aadfb7d78b84345ecb8 Mon Sep 17 00:00:00 2001 From: YousefEZ <45167695+YousefEZ@users.noreply.github.com> Date: Sat, 6 Apr 2024 20:11:08 +0300 Subject: [PATCH 4/9] :sparkles: working implementation --- src/combined-frr-no-udp.cc | 61 ++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/src/combined-frr-no-udp.cc b/src/combined-frr-no-udp.cc index b12ddfdf..2bfb9e16 100644 --- a/src/combined-frr-no-udp.cc +++ b/src/combined-frr-no-udp.cc @@ -175,19 +175,21 @@ int main(int argc, char* argv[]) // Topology setup NS_LOG_INFO("Creating Topology"); NodeContainer nodes; - nodes.Create(5 + number_of_tcp_senders); + NodeContainer tcp_devices; + nodes.Create(5); + tcp_devices.Create(number_of_tcp_senders); Names::Add("CongestionSender", nodes.Get(0)); for (int i = 0; i < number_of_tcp_senders; i++) - Names::Add("TrafficSender" + std::to_string(i), nodes.Get(1 + i)); + Names::Add("TrafficSender" + std::to_string(i), tcp_devices.Get(i)); - int offset = number_of_tcp_senders; - Names::Add("Router01", nodes.Get(offset + 1)); - Names::Add("Router02", nodes.Get(offset + 2)); - Names::Add("Router03", nodes.Get(offset + 3)); - Names::Add("Receiver", nodes.Get(offset + 4)); + Names::Add("Router01", nodes.Get(1)); + Names::Add("Router02", nodes.Get(2)); + Names::Add("Router03", nodes.Get(3)); + Names::Add("Receiver", nodes.Get(4)); InternetStackHelper stack; stack.Install(nodes); + stack.Install(tcp_devices); // Configure PointToPoint link for normal traffic PointToPointHelper p2p_traffic; @@ -221,17 +223,17 @@ int main(int argc, char* argv[]) for (int i = 0; i < number_of_tcp_senders; i++) { tcp_senders.push_back( - p2p_traffic.Install(nodes.Get(1 + i), nodes.Get(offset + 1))); + p2p_traffic.Install(tcp_devices.Get(i), nodes.Get(1))); } - NetDeviceContainer devices_2_3 = p2p_congested_link.Install( - nodes.Get(offset + 1), nodes.Get(offset + 2)); + NetDeviceContainer devices_2_3 = + p2p_congested_link.Install(nodes.Get(1), nodes.Get(2)); NetDeviceContainer devices_2_4 = - p2p_alternate.Install(nodes.Get(offset + 1), nodes.Get(offset + 3)); + p2p_alternate.Install(nodes.Get(1), nodes.Get(3)); NetDeviceContainer devices_4_3 = - p2p_alternate.Install(nodes.Get(offset + 3), nodes.Get(offset + 2)); + p2p_alternate.Install(nodes.Get(3), nodes.Get(2)); NetDeviceContainer devices_3_5 = - p2p_traffic.Install(nodes.Get(offset + 2), nodes.Get(offset + 4)); + p2p_traffic.Install(nodes.Get(2), nodes.Get(4)); // Configure PointToPoint link for congestion link PointToPointHelper p2p_congestion; @@ -242,7 +244,7 @@ int main(int argc, char* argv[]) p2p_congestion.SetQueue("ns3::DropTailQueue"); // Install devices and channels between nodes NetDeviceContainer devices_0_2 = - p2p_congestion.Install(nodes.Get(0), nodes.Get(2)); + p2p_congestion.Install(nodes.Get(0), nodes.Get(1)); // Assign IP addresses to subnets Ipv4AddressHelper address; @@ -251,8 +253,8 @@ int main(int argc, char* argv[]) address.NewNetwork(); for (auto& tcp_sender : tcp_senders) { - address.Assign(tcp_sender); - address.NewNetwork(); + address.Assign(tcp_sender); + address.NewNetwork(); } Ipv4InterfaceContainer interfaces_2_3 = address.Assign(devices_2_3); @@ -297,31 +299,44 @@ int main(int argc, char* argv[]) // TCP Setup SetupTCPConfig(); uint16_t tcp_port = 50002; - BulkSendHelper tcp_source("ns3::TcpSocketFactory", - InetSocketAddress(receiver_addr, tcp_port)); - tcp_source.SetAttribute("MaxBytes", - UintegerValue(100000)); // 0 for unlimited data - tcp_source.SetAttribute("SendSize", - UintegerValue(1024)); // Packet size in bytes + std::list tcp_apps; for (int i = 0; i < number_of_tcp_senders; i++) { +<<<<<<< HEAD ApplicationContainer tcp_app = tcp_source.Install(nodes.Get(1 + i)); tcp_app.Start(Seconds(0.0)); tcp_app.Stop(Seconds(10.0)); +======= + BulkSendHelper tcp_source("ns3::TcpSocketFactory", + InetSocketAddress(receiver_addr, tcp_port)); + tcp_source.SetAttribute("MaxBytes", + UintegerValue(100000)); // 0 for unlimited data + tcp_source.SetAttribute("SendSize", + UintegerValue(1024)); // Packet size in bytes + + 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)); +>>>>>>> 142da06 (:sparkles: working implementation) } // Packet sink setup (Receiver node) PacketSinkHelper sink("ns3::TcpSocketFactory", InetSocketAddress(Ipv4Address::GetAny(), tcp_port)); - ApplicationContainer sink_app = sink.Install(nodes.Get(5)); + ApplicationContainer sink_app = sink.Install(nodes.Get(4)); sink_app.Start(Seconds(0.0)); sink_app.Stop(Seconds(20.0)); PacketSinkHelper udp_sink( "ns3::UdpSocketFactory", InetSocketAddress(Ipv4Address::GetAny(), udp_port)); +<<<<<<< HEAD ApplicationContainer udp_sink_app = udp_sink.Install(nodes.Get(5)); udp_sink_app.Start(Seconds(2.0)); +======= + ApplicationContainer udp_sink_app = udp_sink.Install(nodes.Get(4)); + udp_sink_app.Start(Seconds(0.0)); +>>>>>>> 142da06 (:sparkles: working implementation) udp_sink_app.Stop(Seconds(10.0)); // LFA Alternate Path setup From 53fc7fa0a6e4f9c80e5d6c807084b1e802b22f26 Mon Sep 17 00:00:00 2001 From: YousefEZ <45167695+YousefEZ@users.noreply.github.com> Date: Sat, 6 Apr 2024 23:41:44 +0300 Subject: [PATCH 5/9] :sparkles: implemented tcp split --- src/combined-baseline-no-udp.cc | 138 ++++++++++++-------------------- src/combined-baseline-udp.cc | 79 +++++++++++------- src/combined-frr-no-udp.cc | 15 +--- src/combined-frr.cc | 81 ++++++++++++------- 4 files changed, 152 insertions(+), 161 deletions(-) diff --git a/src/combined-baseline-no-udp.cc b/src/combined-baseline-no-udp.cc index d3a9d28d..01174e8e 100644 --- a/src/combined-baseline-no-udp.cc +++ b/src/combined-baseline-no-udp.cc @@ -18,50 +18,6 @@ using namespace ns3; -using CongestionPolicy = BasicCongestionPolicy; - -// using CongestionPolicy = RandomCongestionPolicy<100>; -using FRRPolicy = LFAPolicy; - -using SimulationQueue = FRRQueue; -using FRRNetDevice = PointToPointFRRNetDevice; -using FRRChannel = PointToPointFRRChannel; - -void toggleCongestion(Ptr queue) -{ - ; - // queue->m_congestionPolicy.turnOff(); -} - -// void enableRerouting(Ptr queue) -// { -// // queue->m_congestionPolicy.enable(); -// } - -NS_OBJECT_ENSURE_REGISTERED(SimulationQueue); -NS_OBJECT_ENSURE_REGISTERED(FRRChannel); -NS_OBJECT_ENSURE_REGISTERED(FRRNetDevice); - -template -Ptr getDevice(const NetDeviceContainer& devices) -{ - return devices.Get(INDEX)->GetObject(); -} - -template -Ptr getQueue(const NetDeviceContainer& devices) -{ - return DynamicCast( - getDevice(devices)->GetQueue()); -} - -template -void setAlternateTarget(const NetDeviceContainer& devices, - Ptr target) -{ - getDevice(devices)->addAlternateTarget(target); -} - // TCP parameters uint32_t segmentSize = 1024; uint32_t MTU_bytes = segmentSize + 54; @@ -126,6 +82,7 @@ void CalculateExpectedPackets(uint32_t tcp_max_bytes, DataRate udp_data_rate) int main(int argc, char* argv[]) { int cong_threshold = 0; + int number_of_tcp_senders = 1; std::string dir = ""; CommandLine cmd; cmd.AddValue("bandwidth_primary", "Bandwidth primary", bandwidth_primary); @@ -139,6 +96,7 @@ int main(int argc, char* argv[]) bandwidth_alternate); cmd.AddValue("policy_threshold", "Congestion policy threshold", cong_threshold); + cmd.AddValue("tcp_senders", "Number of TCP Senders", number_of_tcp_senders); cmd.AddValue("dir", "Traces directory", dir); cmd.Parse(argc, argv); @@ -174,16 +132,21 @@ int main(int argc, char* argv[]) // Topology setup NS_LOG_INFO("Creating Topology"); NodeContainer nodes; - nodes.Create(6); + NodeContainer tcp_devices; + nodes.Create(5); + tcp_devices.Create(number_of_tcp_senders); Names::Add("CongestionSender", nodes.Get(0)); - Names::Add("TrafficSender", nodes.Get(1)); - Names::Add("Router01", nodes.Get(2)); - Names::Add("Router02", nodes.Get(3)); - Names::Add("Router03", nodes.Get(4)); - Names::Add("Receiver", nodes.Get(5)); + for (int i = 0; i < number_of_tcp_senders; i++) + Names::Add("TrafficSender" + std::to_string(i), tcp_devices.Get(i)); + + Names::Add("Router01", nodes.Get(1)); + Names::Add("Router02", nodes.Get(2)); + Names::Add("Router03", nodes.Get(3)); + Names::Add("Receiver", nodes.Get(4)); InternetStackHelper stack; stack.Install(nodes); + stack.Install(tcp_devices); // Configure PointToPoint link for normal traffic PointToPointHelper p2p_traffic; @@ -199,13 +162,10 @@ int main(int argc, char* argv[]) StringValue(bandwidth_primary)); p2p_congested_link.SetChannelAttribute("Delay", StringValue(delay_bottleneck)); - // p2p_congested_link.SetQueue(SimulationQueue::getQueueString()); p2p_congested_link.SetQueue("ns3::DropTailQueue"); Config::SetDefault("ns3::DropTailQueue::MaxSize", StringValue("10p")); - Config::SetDefault(SimulationQueue::getQueueString() + "::MaxSize", - StringValue("10p")); PointToPointHelper p2p_alternate; p2p_alternate.SetDeviceAttribute("DataRate", @@ -213,16 +173,21 @@ int main(int argc, char* argv[]) p2p_alternate.SetChannelAttribute("Delay", StringValue(delay_alternate)); p2p_alternate.SetQueue("ns3::DropTailQueue"); - NetDeviceContainer devices_1_2 = - p2p_traffic.Install(nodes.Get(1), nodes.Get(2)); + std::list tcp_senders; + + for (int i = 0; i < number_of_tcp_senders; i++) { + tcp_senders.push_back( + p2p_traffic.Install(tcp_devices.Get(i), nodes.Get(1))); + } + NetDeviceContainer devices_2_3 = - p2p_congested_link.Install(nodes.Get(2), nodes.Get(3)); + p2p_congested_link.Install(nodes.Get(1), nodes.Get(2)); NetDeviceContainer devices_2_4 = - p2p_alternate.Install(nodes.Get(2), nodes.Get(4)); + p2p_alternate.Install(nodes.Get(1), nodes.Get(3)); NetDeviceContainer devices_4_3 = - p2p_alternate.Install(nodes.Get(4), nodes.Get(3)); + p2p_alternate.Install(nodes.Get(3), nodes.Get(2)); NetDeviceContainer devices_3_5 = - p2p_traffic.Install(nodes.Get(3), nodes.Get(5)); + p2p_traffic.Install(nodes.Get(2), nodes.Get(4)); // Configure PointToPoint link for congestion link PointToPointHelper p2p_congestion; @@ -233,31 +198,33 @@ int main(int argc, char* argv[]) p2p_congestion.SetQueue("ns3::DropTailQueue"); // Install devices and channels between nodes NetDeviceContainer devices_0_2 = - p2p_congestion.Install(nodes.Get(0), nodes.Get(2)); + p2p_congestion.Install(nodes.Get(0), nodes.Get(1)); // Assign IP addresses to subnets Ipv4AddressHelper address; address.SetBase("10.1.1.0", "255.255.255.0"); Ipv4InterfaceContainer interfaces_0_2 = address.Assign(devices_0_2); - Ipv4InterfaceContainer interfaces_1_2 = address.Assign(devices_1_2); address.NewNetwork(); - address.SetBase("10.1.2.0", "255.255.255.0"); + + for (auto& tcp_sender : tcp_senders) { + address.Assign(tcp_sender); + address.NewNetwork(); + } + Ipv4InterfaceContainer interfaces_2_3 = address.Assign(devices_2_3); address.NewNetwork(); - address.SetBase("10.1.3.0", "255.255.255.0"); + Ipv4InterfaceContainer interfaces_2_4 = address.Assign(devices_2_4); address.NewNetwork(); - address.SetBase("10.1.4.0", "255.255.255.0"); + Ipv4InterfaceContainer interfaces_4_3 = address.Assign(devices_4_3); address.NewNetwork(); - address.SetBase("10.1.5.0", "255.255.255.0"); + Ipv4InterfaceContainer interfaces_3_5 = address.Assign(devices_3_5); - address.NewNetwork(); - 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", @@ -283,39 +250,34 @@ int main(int argc, char* argv[]) // TCP Setup SetupTCPConfig(); uint16_t tcp_port = 50002; - BulkSendHelper tcp_source("ns3::TcpSocketFactory", - InetSocketAddress(receiver_addr, tcp_port)); - tcp_source.SetAttribute("MaxBytes", - UintegerValue(100000)); // 0 for unlimited data - tcp_source.SetAttribute("SendSize", - UintegerValue(1024)); // Packet size in bytes - ApplicationContainer tcp_app = tcp_source.Install(nodes.Get(1)); - tcp_app.Start(Seconds(0.0)); - tcp_app.Stop(Seconds(10.0)); + std::list tcp_apps; + for (int i = 0; i < number_of_tcp_senders; i++) { + BulkSendHelper tcp_source("ns3::TcpSocketFactory", + InetSocketAddress(receiver_addr, tcp_port)); + tcp_source.SetAttribute("MaxBytes", + UintegerValue(100000)); // 0 for unlimited data + tcp_source.SetAttribute("SendSize", + UintegerValue(1024)); // Packet size in bytes + + tcp_apps.push_back(tcp_source.Install(tcp_devices.Get(i))); + tcp_apps.back().Start(Seconds(0.0)); + tcp_apps.back().Stop(Seconds(10.0)); + } // Packet sink setup (Receiver node) PacketSinkHelper sink("ns3::TcpSocketFactory", InetSocketAddress(Ipv4Address::GetAny(), tcp_port)); - ApplicationContainer sink_app = sink.Install(nodes.Get(5)); + ApplicationContainer sink_app = sink.Install(nodes.Get(4)); sink_app.Start(Seconds(0.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(5)); + ApplicationContainer udp_sink_app = udp_sink.Install(nodes.Get(4)); udp_sink_app.Start(Seconds(0.0)); udp_sink_app.Stop(Seconds(20.0)); - // LFA Alternate Path setup - // Set up an alternate forwarding target, assuming you have an alternate - // path configured - // 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)); - p2p_traffic.EnablePcapAll(dir); p2p_congestion.EnablePcapAll(dir); diff --git a/src/combined-baseline-udp.cc b/src/combined-baseline-udp.cc index e317763d..305da253 100644 --- a/src/combined-baseline-udp.cc +++ b/src/combined-baseline-udp.cc @@ -125,6 +125,7 @@ void CalculateExpectedPackets(uint32_t tcp_max_bytes, DataRate udp_data_rate) int main(int argc, char* argv[]) { int cong_threshold = 0; + int number_of_tcp_senders = 1; std::string dir = ""; CommandLine cmd; cmd.AddValue("bandwidth_primary", "Bandwidth primary", bandwidth_primary); @@ -138,6 +139,7 @@ int main(int argc, char* argv[]) bandwidth_alternate); cmd.AddValue("policy_threshold", "Congestion policy threshold", cong_threshold); + cmd.AddValue("tcp_senders", "Number of TCP Senders", number_of_tcp_senders); cmd.AddValue("dir", "Traces directory", dir); cmd.Parse(argc, argv); @@ -173,16 +175,21 @@ int main(int argc, char* argv[]) // Topology setup NS_LOG_INFO("Creating Topology"); NodeContainer nodes; - nodes.Create(6); + NodeContainer tcp_devices; + nodes.Create(5); + tcp_devices.Create(number_of_tcp_senders); Names::Add("CongestionSender", nodes.Get(0)); - Names::Add("TrafficSender", nodes.Get(1)); - Names::Add("Router01", nodes.Get(2)); - Names::Add("Router02", nodes.Get(3)); - Names::Add("Router03", nodes.Get(4)); - Names::Add("Receiver", nodes.Get(5)); + for (int i = 0; i < number_of_tcp_senders; i++) + Names::Add("TrafficSender" + std::to_string(i), tcp_devices.Get(i)); + + Names::Add("Router01", nodes.Get(1)); + Names::Add("Router02", nodes.Get(2)); + Names::Add("Router03", nodes.Get(3)); + Names::Add("Receiver", nodes.Get(4)); InternetStackHelper stack; stack.Install(nodes); + stack.Install(tcp_devices); // Configure PointToPoint link for normal traffic PointToPointHelper p2p_traffic; @@ -212,16 +219,21 @@ int main(int argc, char* argv[]) p2p_alternate.SetChannelAttribute("Delay", StringValue(delay_alternate)); p2p_alternate.SetQueue("ns3::DropTailQueue"); - NetDeviceContainer devices_1_2 = - p2p_traffic.Install(nodes.Get(1), nodes.Get(2)); + std::list tcp_senders; + + for (int i = 0; i < number_of_tcp_senders; i++) { + tcp_senders.push_back( + p2p_traffic.Install(tcp_devices.Get(i), nodes.Get(1))); + } + NetDeviceContainer devices_2_3 = - p2p_congested_link.Install(nodes.Get(2), nodes.Get(3)); + p2p_congested_link.Install(nodes.Get(1), nodes.Get(2)); NetDeviceContainer devices_2_4 = - p2p_alternate.Install(nodes.Get(2), nodes.Get(4)); + p2p_alternate.Install(nodes.Get(1), nodes.Get(3)); NetDeviceContainer devices_4_3 = - p2p_alternate.Install(nodes.Get(4), nodes.Get(3)); + p2p_alternate.Install(nodes.Get(3), nodes.Get(2)); NetDeviceContainer devices_3_5 = - p2p_traffic.Install(nodes.Get(3), nodes.Get(5)); + p2p_traffic.Install(nodes.Get(2), nodes.Get(4)); // Configure PointToPoint link for congestion link PointToPointHelper p2p_congestion; @@ -232,27 +244,30 @@ int main(int argc, char* argv[]) p2p_congestion.SetQueue("ns3::DropTailQueue"); // Install devices and channels between nodes NetDeviceContainer devices_0_2 = - p2p_congestion.Install(nodes.Get(0), nodes.Get(2)); + p2p_congestion.Install(nodes.Get(0), nodes.Get(1)); // Assign IP addresses to subnets Ipv4AddressHelper address; address.SetBase("10.1.1.0", "255.255.255.0"); Ipv4InterfaceContainer interfaces_0_2 = address.Assign(devices_0_2); - Ipv4InterfaceContainer interfaces_1_2 = address.Assign(devices_1_2); address.NewNetwork(); - address.SetBase("10.1.2.0", "255.255.255.0"); + + for (auto& tcp_sender : tcp_senders) { + address.Assign(tcp_sender); + address.NewNetwork(); + } + Ipv4InterfaceContainer interfaces_2_3 = address.Assign(devices_2_3); address.NewNetwork(); - address.SetBase("10.1.3.0", "255.255.255.0"); + Ipv4InterfaceContainer interfaces_2_4 = address.Assign(devices_2_4); address.NewNetwork(); - address.SetBase("10.1.4.0", "255.255.255.0"); + Ipv4InterfaceContainer interfaces_4_3 = address.Assign(devices_4_3); address.NewNetwork(); - address.SetBase("10.1.5.0", "255.255.255.0"); + Ipv4InterfaceContainer interfaces_3_5 = address.Assign(devices_3_5); address.NewNetwork(); - Ipv4GlobalRoutingHelper::PopulateRoutingTables(); // Receiver address Ipv4Address receiver_addr = interfaces_3_5.GetAddress(1); @@ -282,27 +297,31 @@ int main(int argc, char* argv[]) // TCP Setup SetupTCPConfig(); uint16_t tcp_port = 50002; - BulkSendHelper tcp_source("ns3::TcpSocketFactory", - InetSocketAddress(receiver_addr, tcp_port)); - tcp_source.SetAttribute("MaxBytes", - UintegerValue(100000)); // 0 for unlimited data - tcp_source.SetAttribute("SendSize", - UintegerValue(1024)); // Packet size in bytes - ApplicationContainer tcp_app = tcp_source.Install(nodes.Get(1)); - tcp_app.Start(Seconds(0.0)); - tcp_app.Stop(Seconds(10.0)); + std::list tcp_apps; + for (int i = 0; i < number_of_tcp_senders; i++) { + BulkSendHelper tcp_source("ns3::TcpSocketFactory", + InetSocketAddress(receiver_addr, tcp_port)); + tcp_source.SetAttribute("MaxBytes", + UintegerValue(100000)); // 0 for unlimited data + tcp_source.SetAttribute("SendSize", + UintegerValue(1024)); // Packet size in bytes + + tcp_apps.push_back(tcp_source.Install(tcp_devices.Get(i))); + tcp_apps.back().Start(Seconds(0.0)); + tcp_apps.back().Stop(Seconds(10.0)); + } // Packet sink setup (Receiver node) PacketSinkHelper sink("ns3::TcpSocketFactory", InetSocketAddress(Ipv4Address::GetAny(), tcp_port)); - ApplicationContainer sink_app = sink.Install(nodes.Get(5)); + ApplicationContainer sink_app = sink.Install(nodes.Get(4)); sink_app.Start(Seconds(0.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(5)); + ApplicationContainer udp_sink_app = udp_sink.Install(nodes.Get(4)); udp_sink_app.Start(Seconds(0.0)); udp_sink_app.Stop(Seconds(20.0)); // SimulationQueue::sinkAddress = diff --git a/src/combined-frr-no-udp.cc b/src/combined-frr-no-udp.cc index 2bfb9e16..f05fb51a 100644 --- a/src/combined-frr-no-udp.cc +++ b/src/combined-frr-no-udp.cc @@ -302,11 +302,6 @@ int main(int argc, char* argv[]) std::list tcp_apps; for (int i = 0; i < number_of_tcp_senders; i++) { -<<<<<<< HEAD - ApplicationContainer tcp_app = tcp_source.Install(nodes.Get(1 + i)); - tcp_app.Start(Seconds(0.0)); - tcp_app.Stop(Seconds(10.0)); -======= BulkSendHelper tcp_source("ns3::TcpSocketFactory", InetSocketAddress(receiver_addr, tcp_port)); tcp_source.SetAttribute("MaxBytes", @@ -316,8 +311,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)); ->>>>>>> 142da06 (:sparkles: working implementation) + tcp_apps.back().Stop(Seconds(10.0)); } // Packet sink setup (Receiver node) @@ -330,13 +324,8 @@ int main(int argc, char* argv[]) PacketSinkHelper udp_sink( "ns3::UdpSocketFactory", InetSocketAddress(Ipv4Address::GetAny(), udp_port)); -<<<<<<< HEAD - ApplicationContainer udp_sink_app = udp_sink.Install(nodes.Get(5)); - udp_sink_app.Start(Seconds(2.0)); -======= ApplicationContainer udp_sink_app = udp_sink.Install(nodes.Get(4)); - udp_sink_app.Start(Seconds(0.0)); ->>>>>>> 142da06 (:sparkles: working implementation) + 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 3b4306ea..ae5cdc03 100644 --- a/src/combined-frr.cc +++ b/src/combined-frr.cc @@ -101,6 +101,7 @@ void SetupTCPConfig() int main(int argc, char* argv[]) { int cong_threshold = 0; + int number_of_tcp_senders = 1; std::string dir = ""; CommandLine cmd; cmd.AddValue("bandwidth_primary", "Bandwidth primary", bandwidth_primary); @@ -112,6 +113,7 @@ int main(int argc, char* argv[]) cmd.AddValue("delay_alternate", "Delay Alternate", delay_alternate); cmd.AddValue("bandwidth_alternate", "Bandwidth Alternate", bandwidth_alternate); + cmd.AddValue("tcp_senders", "Number of TCP Senders", number_of_tcp_senders); cmd.AddValue("policy_threshold", "Congestion policy threshold", cong_threshold); cmd.AddValue("dir", "Traces directory", dir); @@ -146,19 +148,24 @@ int main(int argc, char* argv[]) * | | * 5+----------+ */ - // Topology setup + // Topology Setup NS_LOG_INFO("Creating Topology"); NodeContainer nodes; - nodes.Create(6); + NodeContainer tcp_devices; + nodes.Create(5); + tcp_devices.Create(number_of_tcp_senders); Names::Add("CongestionSender", nodes.Get(0)); - Names::Add("TrafficSender", nodes.Get(1)); - Names::Add("Router01", nodes.Get(2)); - Names::Add("Router02", nodes.Get(3)); - Names::Add("Router03", nodes.Get(4)); - Names::Add("Receiver", nodes.Get(5)); + for (int i = 0; i < number_of_tcp_senders; i++) + Names::Add("TrafficSender" + std::to_string(i), tcp_devices.Get(i)); + + Names::Add("Router01", nodes.Get(1)); + Names::Add("Router02", nodes.Get(2)); + Names::Add("Router03", nodes.Get(3)); + Names::Add("Receiver", nodes.Get(4)); InternetStackHelper stack; stack.Install(nodes); + stack.Install(tcp_devices); // Configure PointToPoint link for normal traffic PointToPointHelper p2p_traffic; @@ -188,16 +195,21 @@ int main(int argc, char* argv[]) p2p_alternate.SetChannelAttribute("Delay", StringValue(delay_alternate)); p2p_alternate.SetQueue("ns3::DropTailQueue"); - NetDeviceContainer devices_1_2 = - p2p_traffic.Install(nodes.Get(1), nodes.Get(2)); + std::list tcp_senders; + + for (int i = 0; i < number_of_tcp_senders; i++) { + tcp_senders.push_back( + p2p_traffic.Install(tcp_devices.Get(i), nodes.Get(1))); + } + NetDeviceContainer devices_2_3 = - p2p_congested_link.Install(nodes.Get(2), nodes.Get(3)); + p2p_congested_link.Install(nodes.Get(1), nodes.Get(2)); NetDeviceContainer devices_2_4 = - p2p_alternate.Install(nodes.Get(2), nodes.Get(4)); + p2p_alternate.Install(nodes.Get(1), nodes.Get(3)); NetDeviceContainer devices_4_3 = - p2p_alternate.Install(nodes.Get(4), nodes.Get(3)); + p2p_alternate.Install(nodes.Get(3), nodes.Get(2)); NetDeviceContainer devices_3_5 = - p2p_traffic.Install(nodes.Get(3), nodes.Get(5)); + p2p_traffic.Install(nodes.Get(2), nodes.Get(4)); // Configure PointToPoint link for congestion link PointToPointHelper p2p_congestion; @@ -208,26 +220,31 @@ int main(int argc, char* argv[]) p2p_congestion.SetQueue("ns3::DropTailQueue"); // Install devices and channels between nodes NetDeviceContainer devices_0_2 = - p2p_congestion.Install(nodes.Get(0), nodes.Get(2)); + p2p_congestion.Install(nodes.Get(0), nodes.Get(1)); // Assign IP addresses to subnets Ipv4AddressHelper address; address.SetBase("10.1.1.0", "255.255.255.0"); Ipv4InterfaceContainer interfaces_0_2 = address.Assign(devices_0_2); - Ipv4InterfaceContainer interfaces_1_2 = address.Assign(devices_1_2); address.NewNetwork(); - address.SetBase("10.1.2.0", "255.255.255.0"); + + for (auto& tcp_sender : tcp_senders) { + address.Assign(tcp_sender); + address.NewNetwork(); + } + Ipv4InterfaceContainer interfaces_2_3 = address.Assign(devices_2_3); address.NewNetwork(); - address.SetBase("10.1.3.0", "255.255.255.0"); + Ipv4InterfaceContainer interfaces_2_4 = address.Assign(devices_2_4); address.NewNetwork(); - address.SetBase("10.1.4.0", "255.255.255.0"); + Ipv4InterfaceContainer interfaces_4_3 = address.Assign(devices_4_3); address.NewNetwork(); - address.SetBase("10.1.5.0", "255.255.255.0"); + Ipv4InterfaceContainer interfaces_3_5 = address.Assign(devices_3_5); address.NewNetwork(); + Ipv4GlobalRoutingHelper::PopulateRoutingTables(); // Receiver address @@ -258,27 +275,31 @@ int main(int argc, char* argv[]) // TCP Setup SetupTCPConfig(); uint16_t tcp_port = 50002; - BulkSendHelper tcp_source("ns3::TcpSocketFactory", - InetSocketAddress(receiver_addr, tcp_port)); - tcp_source.SetAttribute("MaxBytes", - UintegerValue(100000)); // 0 for unlimited data - tcp_source.SetAttribute("SendSize", - UintegerValue(1024)); // Packet size in bytes - ApplicationContainer tcp_app = tcp_source.Install(nodes.Get(1)); - tcp_app.Start(Seconds(0.0)); - tcp_app.Stop(Seconds(10.0)); + std::list tcp_apps; + for (int i = 0; i < number_of_tcp_senders; i++) { + BulkSendHelper tcp_source("ns3::TcpSocketFactory", + InetSocketAddress(receiver_addr, tcp_port)); + tcp_source.SetAttribute("MaxBytes", + UintegerValue(100000)); // 0 for unlimited data + tcp_source.SetAttribute("SendSize", + UintegerValue(1024)); // Packet size in bytes + + tcp_apps.push_back(tcp_source.Install(tcp_devices.Get(i))); + tcp_apps.back().Start(Seconds(0.0)); + tcp_apps.back().Stop(Seconds(10.0)); + } // Packet sink setup (Receiver node) PacketSinkHelper sink("ns3::TcpSocketFactory", InetSocketAddress(Ipv4Address::GetAny(), tcp_port)); - ApplicationContainer sink_app = sink.Install(nodes.Get(5)); + ApplicationContainer sink_app = sink.Install(nodes.Get(4)); sink_app.Start(Seconds(0.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(5)); + ApplicationContainer udp_sink_app = udp_sink.Install(nodes.Get(4)); udp_sink_app.Start(Seconds(0.0)); udp_sink_app.Stop(Seconds(20.0)); From bbb1a8dac967de93bd722dd00fe0d2c549b575cc Mon Sep 17 00:00:00 2001 From: YousefEZ <45167695+YousefEZ@users.noreply.github.com> Date: Sat, 6 Apr 2024 23:42:03 +0300 Subject: [PATCH 6/9] :sparkles: updated the bash script --- run_ns3.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/run_ns3.sh b/run_ns3.sh index c8dca717..6415594e 100755 --- a/run_ns3.sh +++ b/run_ns3.sh @@ -12,10 +12,10 @@ run_experiment() { mkdir -p "$dir/baseline-udp/" mkdir -p "$dir/baseline-no-udp/" - NS_LOG="" ./ns3 run "scratch/combined-frr.cc --$test_variable=$test_value --policy_threshold=$policy_threshold --dir=$dir/frr/" - NS_LOG="" ./ns3 run "scratch/combined-frr-no-udp.cc --$test_variable=$test_value --policy_threshold=$policy_threshold --dir=$dir/frr-no-udp/" - NS_LOG="" ./ns3 run "scratch/combined-baseline-udp.cc --$test_variable=$test_value --policy_threshold=$policy_threshold --dir=$dir/baseline-udp/" - NS_LOG="" ./ns3 run "scratch/combined-baseline-no-udp.cc --$test_variable=$test_value --policy_threshold=$policy_threshold --dir=$dir/baseline-no-udp/" + NS_LOG="" ./ns3 run "scratch/combined-frr.cc --$test_variable=$test_value --tcp_senders=1 --policy_threshold=$policy_threshold --dir=$dir/frr/" + NS_LOG="" ./ns3 run "scratch/combined-frr-no-udp.cc --$test_variable=$test_value --tcp_senders=1 --policy_threshold=$policy_threshold --dir=$dir/frr-no-udp/" + NS_LOG="" ./ns3 run "scratch/combined-baseline-udp.cc --$test_variable=$test_value --tcp_senders=1 --policy_threshold=$policy_threshold --dir=$dir/baseline-udp/" + NS_LOG="" ./ns3 run "scratch/combined-baseline-no-udp.cc --$test_variable=$test_value --tcp_senders=1 --policy_threshold=$policy_threshold --dir=$dir/baseline-no-udp/" } # Delay primary experiments From a824f83860760a2db48283fbfeb0d39b4087393f Mon Sep 17 00:00:00 2001 From: YousefEZ <45167695+YousefEZ@users.noreply.github.com> Date: Sat, 6 Apr 2024 23:49:05 +0300 Subject: [PATCH 7/9] :bug: fix ipv4 populating issue --- src/combined-baseline-no-udp.cc | 2 +- src/combined-baseline-udp.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/combined-baseline-no-udp.cc b/src/combined-baseline-no-udp.cc index 01174e8e..80c07dab 100644 --- a/src/combined-baseline-no-udp.cc +++ b/src/combined-baseline-no-udp.cc @@ -221,7 +221,7 @@ int main(int argc, char* argv[]) address.NewNetwork(); Ipv4InterfaceContainer interfaces_3_5 = address.Assign(devices_3_5); - + Ipv4GlobalRoutingHelper::PopulateRoutingTables(); // Receiver address Ipv4Address receiver_addr = interfaces_3_5.GetAddress(1); std::cout << receiver_addr << std::endl; diff --git a/src/combined-baseline-udp.cc b/src/combined-baseline-udp.cc index 305da253..b52d6712 100644 --- a/src/combined-baseline-udp.cc +++ b/src/combined-baseline-udp.cc @@ -271,7 +271,7 @@ int main(int argc, char* argv[]) // Receiver address Ipv4Address receiver_addr = interfaces_3_5.GetAddress(1); - + Ipv4GlobalRoutingHelper::PopulateRoutingTables(); // UDP Congestion traffic setup uint16_t udp_port = 50001; OnOffHelper udp_source("ns3::UdpSocketFactory", From cae8828dd9542cf6c4f3defb2fc5ce729f9c6826 Mon Sep 17 00:00:00 2001 From: charliebarber Date: Sat, 6 Apr 2024 22:20:36 +0100 Subject: [PATCH 8/9] Merged multiple flow setup into the new parameters --- src/combined-baseline-no-udp.cc | 1 - src/combined-baseline-udp.cc | 24 ------------------------ src/combined-frr-no-udp.cc | 1 + 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/src/combined-baseline-no-udp.cc b/src/combined-baseline-no-udp.cc index 80c07dab..71df186f 100644 --- a/src/combined-baseline-no-udp.cc +++ b/src/combined-baseline-no-udp.cc @@ -224,7 +224,6 @@ 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", diff --git a/src/combined-baseline-udp.cc b/src/combined-baseline-udp.cc index b52d6712..758a915a 100644 --- a/src/combined-baseline-udp.cc +++ b/src/combined-baseline-udp.cc @@ -324,31 +324,7 @@ int main(int argc, char* argv[]) ApplicationContainer udp_sink_app = udp_sink.Install(nodes.Get(4)); udp_sink_app.Start(Seconds(0.0)); udp_sink_app.Stop(Seconds(20.0)); - // SimulationQueue::sinkAddress = - // Mac48Address::ConvertFrom(getDevice<1>(devices_3_5)->GetAddress()); - // NOTE: Is TrafficControlHelper needed here? - // 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 f05fb51a..470c5184 100644 --- a/src/combined-frr-no-udp.cc +++ b/src/combined-frr-no-udp.cc @@ -324,6 +324,7 @@ int main(int argc, char* argv[]) 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(2.0)); udp_sink_app.Stop(Seconds(10.0)); From 24895e01c744d2d9936083893b0af6d287ddae84 Mon Sep 17 00:00:00 2001 From: charliebarber Date: Sat, 6 Apr 2024 23:07:48 +0100 Subject: [PATCH 9/9] Fixed failing format --- src/combined-baseline-no-udp.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/combined-baseline-no-udp.cc b/src/combined-baseline-no-udp.cc index 6c189c81..25b6c32c 100644 --- a/src/combined-baseline-no-udp.cc +++ b/src/combined-baseline-no-udp.cc @@ -279,7 +279,6 @@ int main(int argc, char* argv[]) udp_sink_app.Start(Seconds(0.0)); udp_sink_app.Stop(Seconds(20.0)); - p2p_traffic.EnablePcapAll(dir); p2p_congestion.EnablePcapAll(dir);