|
|
| 44 |
#include "ns3/onoff-application.h" |
44 |
#include "ns3/onoff-application.h" |
| 45 |
#include "ns3/packet-sink.h" |
45 |
#include "ns3/packet-sink.h" |
| 46 |
#include "ns3/simulator.h" |
46 |
#include "ns3/simulator.h" |
| 47 |
#include "ns3/ipv4-static-routing-helper.h" |
|
|
| 48 |
#include "ns3/ipv4-list-routing-helper.h" |
| 49 |
#include "ns3/ipv4-nix-vector-helper.h" |
47 |
#include "ns3/ipv4-nix-vector-helper.h" |
| 50 |
|
48 |
|
| 51 |
using namespace ns3; |
49 |
using namespace ns3; |
|
|
| 126 |
TIMER_TYPE t0, t1, t2; |
124 |
TIMER_TYPE t0, t1, t2; |
| 127 |
TIMER_NOW (t0); |
125 |
TIMER_NOW (t0); |
| 128 |
std::cout << " ==== DARPA NMS CAMPUS NETWORK SIMULATION ====" << std::endl; |
126 |
std::cout << " ==== DARPA NMS CAMPUS NETWORK SIMULATION ====" << std::endl; |
| 129 |
LogComponentEnable ("OnOffApplication", LOG_LEVEL_INFO); |
127 |
// LogComponentEnable ("OnOffApplication", LOG_LEVEL_INFO); |
| 130 |
|
128 |
|
| 131 |
int nCN = 2, nLANClients = 42; |
129 |
int nCN = 2, nLANClients = 42; |
| 132 |
bool nix = true; |
130 |
bool nix = true; |
|
|
| 174 |
p2p_100mb1ms.SetChannelAttribute ("Delay", StringValue ("1ms")); |
172 |
p2p_100mb1ms.SetChannelAttribute ("Delay", StringValue ("1ms")); |
| 175 |
|
173 |
|
| 176 |
// Setup NixVector Routing |
174 |
// Setup NixVector Routing |
| 177 |
Ipv4NixVectorHelper nixRouting; |
|
|
| 178 |
Ipv4StaticRoutingHelper staticRouting; |
| 179 |
|
| 180 |
Ipv4ListRoutingHelper list; |
| 181 |
list.Add (staticRouting, 0); |
| 182 |
list.Add (nixRouting, 10); |
| 183 |
|
| 184 |
if (nix) |
175 |
if (nix) |
| 185 |
{ |
176 |
{ |
| 186 |
stack.SetRoutingHelper (list); // has effect on the next Install () |
177 |
Ipv4NixVectorHelper nixRouting; |
|
|
178 |
stack.SetRoutingHelper (nixRouting); // has effect on the next Install () |
| 187 |
} |
179 |
} |
| 188 |
|
180 |
|
| 189 |
// Create Campus Networks |
181 |
// Create Campus Networks |