Skip to content

Commit

Permalink
Merge branch 'main' into tcp-lfa
Browse files Browse the repository at this point in the history
  • Loading branch information
YousefEZ authored Mar 9, 2024
2 parents a6327e6 + 91b3e27 commit 52fe9e5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
7 changes: 4 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/bin/bash
echo "Simulating ns3 on file: $1"

rm -rf traces/
mkdir traces
cp user_src/* scratch/

export NS_LOG=FRRQueue=level_all

./ns3 build
./ns3 run "scratch/$1" > traces/output.log 2>&1

./ns3 build
./ns3 run "scratch/$1" >traces/output.log 2>&1
2 changes: 2 additions & 0 deletions format.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
#!/bin/bash

find . -regex '.*\.\(cpp\|hpp\|cc\|cxx\|h\)' -exec clang-format -style=file -i {} \;
8 changes: 8 additions & 0 deletions src/lfa.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@
#include "ns3/point-to-point-module.h"
#include "ns3/traffic-control-module.h"


#include "../libs/frr_queue.h"
#include "../libs/dummy_congestion_policy.h"
#include "../libs/frr_queue.h"
#include "../libs/lfa_policy.h"
#include "../libs/modulo_congestion_policy.h"


using namespace ns3;

NS_LOG_COMPONENT_DEFINE("CongestionFastReRoute");
Expand Down Expand Up @@ -77,6 +80,7 @@ void InstallBulkSend(Ptr<Node> node, Ipv4Address address, uint16_t port,
// nullptr);
}


int main(int argc, char* argv[])
{
// TCP Recovery Algorithm
Expand Down Expand Up @@ -115,6 +119,7 @@ int main(int argc, char* argv[])
nodes.Create(3);
Names::Add("Node0", nodes.Get(0));


InternetStackHelper stack;
stack.Install(nodes);

Expand Down Expand Up @@ -183,6 +188,7 @@ int main(int argc, char* argv[])
// ApplicationContainer app = onoff.Install(nodes.Get(0));
// app.Start(Seconds(1.0));
// app.Stop(Seconds(10.0));

// Set up an alternate forwarding target, assuming you have an alternate
// path configured

Expand All @@ -195,12 +201,14 @@ int main(int argc, char* argv[])
setAlternateTarget<1>(devices02, getDevice<1>(devices12));
setAlternateTarget<1>(devices12, getDevice<1>(devices02));


p2p.EnablePcapAll("traces/");

/* Install BulkSend application */
InstallBulkSend(nodes.Get(0), interfaces01.GetAddress(1), 5000,
"ns3::TcpSocketFactory", 2, 0, nullptr, 1000, Seconds(0.2));


Simulator::Run();
Simulator::Destroy();

Expand Down
2 changes: 2 additions & 0 deletions src/lfa_random.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "ns3/network-module.h"
#include "ns3/point-to-point-module.h"


#include "../libs/frr_queue.h"
#include "../libs/dummy_congestion_policy.h"
#include "../libs/frr_queue.h"
#include "../libs/lfa_policy.h"
Expand Down

0 comments on commit 52fe9e5

Please sign in to comment.