Skip to content

Commit

Permalink
Merge pull request #30 from YousefEZ/randomexperiments
Browse files Browse the repository at this point in the history
🎲 Some Experimentation
  • Loading branch information
YousefEZ authored Apr 12, 2024
2 parents 84d9162 + 8a48395 commit 32bdc36
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 23 deletions.
9 changes: 5 additions & 4 deletions run_ns3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ 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" &
false && run_experiment "delay_primary" "$delay_val" "$policy_number" &
done
done

Expand All @@ -51,15 +51,16 @@ 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" &
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=("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
Expand All @@ -75,7 +76,7 @@ bandwidth_vals=("200Kbps" "225Kbps" "250Kbps" "275Kbps" "300Kbps" "325Kbps" "350
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" &
false && run_experiment "bandwidth_alternate" "$bandwidth_val" "$policy_number" &
done
done

Expand Down
14 changes: 8 additions & 6 deletions src/combined-baseline-no-udp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ uint32_t seed = 1;
uint32_t segmentSize = 1024;
uint32_t MTU_bytes = segmentSize + 54;

std::string bandwidth_udp_access = "1Mbps";


// Topology parameters
std::string bandwidth_primary = "300Kbps";
std::string bandwidth_access = "200kbps";
std::string bandwidth_udp_access = "100kbps";
std::string bandwidth_primary = "2Mbps";
std::string bandwidth_access = "2.5Mbps";
std::string delay_bottleneck = "20ms";
std::string delay_access = "20ms";
std::string delay_alternate = "20ms";
std::string bandwidth_alternate = "300kbps";
std::string bandwidth_alternate = "1Mbps";

void SetupTCPConfig()
{
Expand Down Expand Up @@ -262,15 +264,15 @@ 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(20.0));
}

// Packet sink setup (Receiver node)
Expand Down
8 changes: 5 additions & 3 deletions src/combined-baseline-udp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,16 @@ uint32_t segmentSize = 1024;
uint32_t MTU_bytes = segmentSize + 54;

// Topology parameters

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

std::string delay_bottleneck = "20ms";
std::string delay_access = "20ms";
std::string delay_alternate = "20ms";


std::string bandwidth_alternate = "2Mbps";


Expand Down Expand Up @@ -313,15 +315,15 @@ 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(500000)); // 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(20.0));
}

// Packet sink setup (Receiver node)
Expand Down
19 changes: 12 additions & 7 deletions src/combined-frr-no-udp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,19 @@ void setAlternateTarget(const NetDeviceContainer& devices,
uint32_t segmentSize = 1024;
uint32_t MTU_bytes = segmentSize + 54;


std::string bandwidth_udp_access = "1Mbps";


// Topology parameters
std::string bandwidth_primary = "300Kbps";
std::string bandwidth_access = "200kbps";
std::string bandwidth_udp_access = "100kbps";
std::string bandwidth_primary = "2Mbps";
std::string bandwidth_access = "2.5Mbps";
std::string delay_bottleneck = "20ms";
std::string delay_access = "20ms";
std::string delay_alternate = "20ms";
std::string bandwidth_alternate = "300kbps";

std::string bandwidth_alternate = "1Mbps";


void SetupTCPConfig()
{
Expand Down Expand Up @@ -311,15 +316,15 @@ 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(20.0));
}

// Packet sink setup (Receiver node)
Expand All @@ -334,7 +339,7 @@ int main(int argc, char* argv[])
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));
udp_sink_app.Stop(Seconds(20.0));

// LFA Alternate Path setup
// Set up an alternate forwarding target, assuming you have an alternate
Expand Down
9 changes: 6 additions & 3 deletions src/combined-frr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,16 @@ uint32_t MTU_bytes = segmentSize + 54;

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


std::string delay_bottleneck = "20ms";
std::string delay_access = "20ms";
std::string delay_alternate = "20ms";

std::string bandwidth_alternate = "2Mbps";


void SetupTCPConfig()
{
// TCP recovery algorithm
Expand Down Expand Up @@ -288,15 +291,15 @@ 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(500000)); // 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(20.0));
}

// Packet sink setup (Receiver node)
Expand Down

0 comments on commit 32bdc36

Please sign in to comment.