Readd option for setting ttlthresh

This commit is contained in:
Tim Schubert 2020-08-31 22:49:44 +02:00
parent 443a563edd
commit 52530f5d04
2 changed files with 14 additions and 4 deletions

View file

@ -36,6 +36,7 @@ int main (int argc, char *argv[])
double duration = 100; double duration = 100;
bool islEnabled = true; bool islEnabled = true;
bool pcap = false; bool pcap = false;
uint64_t ttlThresh = 0;
std::string routingProto = "aodv"; std::string routingProto = "aodv";
cmd.AddValue("orbitFile", "CSV file with orbit parameters", orbitFile); cmd.AddValue("orbitFile", "CSV file with orbit parameters", orbitFile);
@ -50,6 +51,7 @@ int main (int argc, char *argv[])
cmd.AddValue("islEnabled", "Enable inter-satellite links", islEnabled); cmd.AddValue("islEnabled", "Enable inter-satellite links", islEnabled);
cmd.AddValue("latGws", "Latitudal rows of gateways", latGws); cmd.AddValue("latGws", "Latitudal rows of gateways", latGws);
cmd.AddValue("lonGws", "Longitudinal rows of gateways", lonGws); cmd.AddValue("lonGws", "Longitudinal rows of gateways", lonGws);
cmd.AddValue("ttlThresh", "TTL threshold", ttlThresh);
cmd.AddValue("destOnly", "ns3::aodv::RoutingProtocol::DestinationOnly"); cmd.AddValue("destOnly", "ns3::aodv::RoutingProtocol::DestinationOnly");
cmd.AddValue("routeTimeout", "ns3::aodv::RoutingProtocol::ActiveRouteTimeout"); cmd.AddValue("routeTimeout", "ns3::aodv::RoutingProtocol::ActiveRouteTimeout");
cmd.AddValue("pcap", "Enable packet capture", pcap); cmd.AddValue("pcap", "Enable packet capture", pcap);
@ -98,8 +100,11 @@ int main (int argc, char *argv[])
AodvHelper aodv; AodvHelper aodv;
aodv.Set ("EnableHello", BooleanValue (false)); aodv.Set ("EnableHello", BooleanValue (false));
//aodv.Set ("HelloInterval", TimeValue (Seconds (10))); //aodv.Set ("HelloInterval", TimeValue (Seconds (10)));
//aodv.Set ("TtlThreshold", UintegerValue (16)); if (ttlThresh != 0)
//aodv.Set ("NetDiameter", UintegerValue (32)); {
aodv.Set ("TtlThreshold", UintegerValue (ttlThresh));
aodv.Set ("NetDiameter", UintegerValue (2*ttlThresh));
}
stack.SetRoutingHelper (aodv); stack.SetRoutingHelper (aodv);
} }

View file

@ -86,6 +86,7 @@ int main (int argc, char *argv[])
bool traceDrops = false; bool traceDrops = false;
bool traceTxRx = false; bool traceTxRx = false;
bool traceFwd = false; bool traceFwd = false;
uint64_t ttlThresh = 0;
std::string routingProto = "aodv"; std::string routingProto = "aodv";
cmd.AddValue("orbitFile", "CSV file with orbit parameters", orbitFile); cmd.AddValue("orbitFile", "CSV file with orbit parameters", orbitFile);
cmd.AddValue("traceFile", "CSV file to store mobility trace in", traceFile); cmd.AddValue("traceFile", "CSV file to store mobility trace in", traceFile);
@ -103,6 +104,7 @@ int main (int argc, char *argv[])
cmd.AddValue("traceFwd", "Enable tracing of IP layer forwarding", traceFwd); cmd.AddValue("traceFwd", "Enable tracing of IP layer forwarding", traceFwd);
cmd.AddValue("latGws", "Latitudal rows of gateways", latGws); cmd.AddValue("latGws", "Latitudal rows of gateways", latGws);
cmd.AddValue("lonGws", "Longitudinal rows of gateways", lonGws); cmd.AddValue("lonGws", "Longitudinal rows of gateways", lonGws);
cmd.AddValue("ttlThresh", "TTL threshold", ttlThresh);
cmd.AddValue("destOnly", "ns3::aodv::RoutingProtocol::DestinationOnly"); cmd.AddValue("destOnly", "ns3::aodv::RoutingProtocol::DestinationOnly");
cmd.AddValue("routeTimeout", "ns3::aodv::RoutingProtocol::ActiveRouteTimeout"); cmd.AddValue("routeTimeout", "ns3::aodv::RoutingProtocol::ActiveRouteTimeout");
cmd.Parse (argc, argv); cmd.Parse (argc, argv);
@ -150,8 +152,11 @@ int main (int argc, char *argv[])
AodvHelper aodv; AodvHelper aodv;
aodv.Set ("EnableHello", BooleanValue (false)); aodv.Set ("EnableHello", BooleanValue (false));
//aodv.Set ("HelloInterval", TimeValue (Seconds (10))); //aodv.Set ("HelloInterval", TimeValue (Seconds (10)));
//aodv.Set ("TtlThreshold", UintegerValue (16)); if (ttlThresh != 0)
//aodv.Set ("NetDiameter", UintegerValue (32)); {
aodv.Set ("TtlThreshold", UintegerValue (ttlThresh));
aodv.Set ("NetDiameter", UintegerValue (2*ttlThresh));
}
stack.SetRoutingHelper (aodv); stack.SetRoutingHelper (aodv);
} }