mirror of
https://gitlab.ibr.cs.tu-bs.de/tschuber/ns-3-leo.git
synced 2025-06-08 18:13:57 +02:00
Add a way to set routing helper
This commit is contained in:
parent
7ba1d66e8c
commit
a55177cd67
3 changed files with 25 additions and 7 deletions
|
@ -25,10 +25,9 @@ LeoHelper::Install (NodeContainer &satellites, NodeContainer &gateways, NodeCont
|
|||
utNet = m_utChannelHelper.Install (satellites, terminals);
|
||||
|
||||
// Install internet stack on nodes
|
||||
InternetStackHelper stack;
|
||||
stack.Install (satellites);
|
||||
stack.Install (gateways);
|
||||
stack.Install (terminals);
|
||||
m_stackHelper.Install (satellites);
|
||||
m_stackHelper.Install (gateways);
|
||||
m_stackHelper.Install (terminals);
|
||||
|
||||
// Make all networks addressable
|
||||
Ipv6AddressHelper address;
|
||||
|
@ -201,4 +200,16 @@ LeoHelper::EnableAsciiInternal (
|
|||
m_utChannelHelper.EnableAsciiInternal (stream, prefix, nd, explicitFilename);
|
||||
}
|
||||
|
||||
void
|
||||
LeoHelper::SetRoutingHelper (const Ipv4RoutingHelper &routing)
|
||||
{
|
||||
m_stackHelper.SetRoutingHelper (routing);
|
||||
}
|
||||
|
||||
void
|
||||
LeoHelper::SetRoutingHelper (const Ipv6RoutingHelper &routing)
|
||||
{
|
||||
m_stackHelper.SetRoutingHelper (routing);
|
||||
}
|
||||
|
||||
} /* namespace ns3 */
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <ns3/net-device-container.h>
|
||||
#include <ns3/node-container.h>
|
||||
#include <ns3/trace-helper.h>
|
||||
#include "ns3/internet-stack-helper.h"
|
||||
|
||||
#include "leo-channel-helper.h"
|
||||
#include "isl-helper.h"
|
||||
|
@ -142,6 +143,11 @@ public:
|
|||
void SetIslChannelAttribute (std::string name, const AttributeValue &value);
|
||||
void SetUtChannelAttribute (std::string name, const AttributeValue &value);
|
||||
void SetGwChannelAttribute (std::string name, const AttributeValue &value);
|
||||
|
||||
void SetInternetStackAttribute (std::string name, const AttributeValue &value);
|
||||
|
||||
void SetRoutingHelper (const Ipv4RoutingHelper &routing);
|
||||
void SetRoutingHelper (const Ipv6RoutingHelper &routing);
|
||||
private:
|
||||
/**
|
||||
* \brief Enable pcap output the indicated net device.
|
||||
|
@ -173,6 +179,7 @@ private:
|
|||
Ptr<NetDevice> nd,
|
||||
bool explicitFilename);
|
||||
|
||||
InternetStackHelper m_stackHelper;
|
||||
IslHelper m_islChannelHelper;
|
||||
LeoChannelHelper m_utChannelHelper;
|
||||
LeoChannelHelper m_gwChannelHelper;
|
||||
|
|
|
@ -6,9 +6,10 @@
|
|||
#include "ns3/applications-module.h"
|
||||
#include "ns3/node-container.h"
|
||||
#include "ns3/core-module.h"
|
||||
#include "ns3/aodv-module.h"
|
||||
#include "ns3/test.h"
|
||||
|
||||
#include "ns3/leo-module.h"
|
||||
#include "ns3/test.h"
|
||||
|
||||
using namespace ns3;
|
||||
|
||||
|
@ -54,6 +55,7 @@ LeoTestCase1::DoRun (void)
|
|||
LeoHelper leo;
|
||||
leo.SetDeviceAttribute ("DataRate", StringValue ("10Mbps"));
|
||||
leo.SetChannelAttribute ("PropagationDelay", StringValue ("ns3::ConstantSpeedPropagationDelayModel"));
|
||||
leo.SetRoutingHelper (AodvHelper ());
|
||||
|
||||
NetDeviceContainer allDevices = leo.Install (satellites, gateways, terminals);
|
||||
|
||||
|
@ -61,8 +63,6 @@ LeoTestCase1::DoRun (void)
|
|||
UdpEchoServerHelper echoServer (9);
|
||||
ApplicationContainer serverApps = echoServer.Install (terminals);
|
||||
|
||||
// TODO routing
|
||||
|
||||
// install a client on each of the terminals
|
||||
ApplicationContainer clientApps;
|
||||
for (uint32_t i = 1; i < terminals.GetN (); i++)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue