Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🤡 experimenting multiple flows #33

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions run_ns3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ echo "Delay Primary experiments"
delay_vals=("0ms" "10ms" "20ms" "30ms" "40ms" "60ms" "80ms" "100ms")
for delay_val in "${delay_vals[@]}"; do
# echo "Delay Primary value: $delay_val"
for policy_number in 20 40 60 80 99; do
run_experiment "delay_primary" "$delay_val" "$policy_number" &
for policy_number in 20 40 60 80; do
false && run_experiment "delay_primary" "$delay_val" "$policy_number" &
done
done

Expand All @@ -50,19 +50,19 @@ echo "Delay Alternate experiments"
delay_vals=("0ms" "10ms" "20ms" "30ms" "40ms" "60ms" "80ms" "100ms")
for delay_val in "${delay_vals[@]}"; do
# echo "Delay Alternate value: $delay_val"
for policy_number in 20 40 60 80 99; do
run_experiment "delay_alternate" "$delay_val" "$policy_number" &
for policy_number in 20 40 60 80; do
false && run_experiment "delay_alternate" "$delay_val" "$policy_number" &
done
done

wait

# Bandwidth primary experiments
echo "Bandwidth Primary experiments"
bandwidth_vals=("200Kbps" "225Kbps" "250Kbps" "275Kbps" "300Kbps" "325Kbps" "350Kbps" "375Kbps" "400Kbps")
bandwidth_vals=("1.5Mbps" "1.6Mbps" "1.7Mbps" "1.8Mbps" "1.9Mbps" "2.0Mbps" "2.1Mbps" "2.2Mbps" "2.3Mbps" "2.4Mbps" "2.5Mbps")
for bandwidth_val in "${bandwidth_vals[@]}"; do
# echo "Bandwidth Primary value: $bandwidth_vals"
for policy_number in 20 40 60 80 99; do
for policy_number in 20 40 60 80; do
run_experiment "bandwidth_primary" "$bandwidth_val" "$policy_number" &
done
done
Expand All @@ -74,8 +74,8 @@ echo "Bandwidth alternate experiments"
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
run_experiment "bandwidth_alternate" "$bandwidth_val" "$policy_number" &
for policy_number in 20 40 60 80; do
false && run_experiment "bandwidth_alternate" "$bandwidth_val" "$policy_number" &
done
done

Expand Down
24 changes: 17 additions & 7 deletions src/combined-baseline-udp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ uint32_t MTU_bytes = segmentSize + 54;

// Topology parameters
std::string bandwidth_primary = "2Mbps";
std::string bandwidth_access = "1Mbps";
std::string bandwidth_access = "1.5Mbps";
std::string bandwidth_udp_access = "1.5Mbps";

std::string delay_bottleneck = "20ms";
Expand Down Expand Up @@ -207,7 +207,17 @@ int main(int argc, char* argv[])
p2p_traffic.SetChannelAttribute("Delay", StringValue(delay_access));
// Set the custom queue for the device
p2p_traffic.SetQueue("ns3::DropTailQueue<Packet>");
// Install devices and channels between nodes
// Install devices and channels

ns3::DataRate rate(bandwidth_access);
ns3::DataRate splitRate(rate.GetBitRate() / number_of_tcp_senders);

PointToPointHelper p2p_traffic_generator;
p2p_traffic_generator.SetDeviceAttribute("DataRate", StringValue(std::to_string(splitRate.GetBitRate()) + "bps"));
p2p_traffic_generator.SetChannelAttribute("Delay", StringValue(delay_access));
// Set the custom queue for the device
p2p_traffic_generator.SetQueue("ns3::DropTailQueue<Packet>");


// PointToPointFRRHelper<FRRPolicy> p2p_congested_link;
PointToPointHelper p2p_congested_link;
Expand All @@ -233,7 +243,7 @@ int main(int argc, char* argv[])

for (int i = 0; i < number_of_tcp_senders; i++) {
tcp_senders.push_back(
p2p_traffic.Install(tcp_devices.Get(i), nodes.Get(1)));
p2p_traffic_generator.Install(tcp_devices.Get(i), nodes.Get(1)));
}

NetDeviceContainer devices_2_3 =
Expand Down Expand Up @@ -313,30 +323,30 @@ int main(int argc, char* argv[])
BulkSendHelper tcp_source("ns3::TcpSocketFactory",
InetSocketAddress(receiver_addr, tcp_port));
tcp_source.SetAttribute("MaxBytes",
UintegerValue(100000)); // 0 for unlimited data
UintegerValue(1000000)); // 0 for unlimited data
tcp_source.SetAttribute("SendSize",
UintegerValue(1024)); // Packet size in bytes

p2p_traffic.EnablePcap(dir, tcp_devices.Get(i)->GetId(), 1);

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));
tcp_apps.back().Stop(Seconds(60.0));
}

// Packet sink setup (Receiver node)
PacketSinkHelper sink("ns3::TcpSocketFactory",
InetSocketAddress(Ipv4Address::GetAny(), tcp_port));
ApplicationContainer sink_app = sink.Install(nodes.Get(4));
sink_app.Start(Seconds(0.0));
sink_app.Stop(Seconds(20.0));
sink_app.Stop(Seconds(60.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(20.0));
udp_sink_app.Stop(Seconds(60.0));

// p2p_traffic.EnablePcapAll(dir);
// p2p_congestion.EnablePcapAll(dir);
Expand Down
31 changes: 23 additions & 8 deletions src/combined-frr.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include <iostream>
#include <string>


#include "ns3/core-module.h"
#include "ns3/network-module.h"
Expand Down Expand Up @@ -70,7 +72,7 @@ uint32_t MTU_bytes = segmentSize + 54;
// Topology parameters

std::string bandwidth_primary = "2Mbps";
std::string bandwidth_access = "1Mbps";
std::string bandwidth_access = "1.5Mbps";
std::string bandwidth_udp_access = "1.5Mbps";

std::string delay_bottleneck = "20ms";
Expand Down Expand Up @@ -181,7 +183,20 @@ int main(int argc, char* argv[])
p2p_traffic.SetChannelAttribute("Delay", StringValue(delay_access));
// Set the custom queue for the device
p2p_traffic.SetQueue("ns3::DropTailQueue<Packet>");
// Install devices and channels between nodes
// Install devices and channels between nodes


ns3::DataRate rate(bandwidth_access);
ns3::DataRate splitRate(rate.GetBitRate() / number_of_tcp_senders);

std::cout << "rate is: " << splitRate.GetBitRate() << std::endl;

PointToPointHelper p2p_traffic_generator;
p2p_traffic_generator.SetDeviceAttribute("DataRate", StringValue(std::to_string(splitRate.GetBitRate()) + "bps"));
p2p_traffic_generator.SetChannelAttribute("Delay", StringValue(delay_access));
// Set the custom queue for the device
p2p_traffic_generator.SetQueue("ns3::DropTailQueue<Packet>");


PointToPointFRRHelper<FRRPolicy> p2p_congested_link;
// PointToPointHelper p2p_congested_link;
Expand All @@ -193,7 +208,7 @@ int main(int argc, char* argv[])
// p2p_congested_link.SetQueue("ns3::DropTailQueue<Packet>");

Config::SetDefault("ns3::DropTailQueue<Packet>::MaxSize",
StringValue("10p"));
StringValue("1000p"));
Config::SetDefault(SimulationQueue::getQueueString() + "::MaxSize",
StringValue("10p"));

Expand All @@ -207,7 +222,7 @@ int main(int argc, char* argv[])

for (int i = 0; i < number_of_tcp_senders; i++) {
tcp_senders.push_back(
p2p_traffic.Install(tcp_devices.Get(i), nodes.Get(1)));
p2p_traffic_generator.Install(tcp_devices.Get(i), nodes.Get(1)));
}

NetDeviceContainer devices_2_3 =
Expand Down Expand Up @@ -288,30 +303,30 @@ int main(int argc, char* argv[])
BulkSendHelper tcp_source("ns3::TcpSocketFactory",
InetSocketAddress(receiver_addr, tcp_port));
tcp_source.SetAttribute("MaxBytes",
UintegerValue(100000)); // 0 for unlimited data
UintegerValue(1000000)); // 0 for unlimited data
tcp_source.SetAttribute("SendSize",
UintegerValue(1024)); // Packet size in bytes

p2p_traffic.EnablePcap(dir, tcp_devices.Get(i)->GetId(), 1);

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));
tcp_apps.back().Stop(Seconds(60.0));
}

// Packet sink setup (Receiver node)
PacketSinkHelper sink("ns3::TcpSocketFactory",
InetSocketAddress(Ipv4Address::GetAny(), tcp_port));
ApplicationContainer sink_app = sink.Install(nodes.Get(4));
sink_app.Start(Seconds(0.0));
sink_app.Stop(Seconds(20.0));
sink_app.Stop(Seconds(60.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(20.0));
udp_sink_app.Stop(Seconds(60.0));

// LFA Alternate Path setup
// Set up an alternate forwarding target, assuming you have an alternate
Expand Down
Loading