#include "node.h"
Classes | |
struct | ProtocolHandlerEntry |
Protocol handler entry. More... | |
Public Types | |
typedef Callback< void, Ptr< NetDevice > > | DeviceAdditionListener |
A callback invoked whenever a device is added to a node. More... | |
typedef Callback< void, Ptr< NetDevice >, Ptr< const Packet >, uint16_t, const Address &, const Address &, NetDevice::PacketType > | ProtocolHandler |
A protocol handler. More... | |
Public Member Functions | |
Node () | |
Node (uint32_t systemId) | |
virtual | ~Node () |
uint32_t | AddApplication (Ptr< Application > application) |
Associate an Application to this Node. More... | |
uint32_t | AddDevice (Ptr< NetDevice > device) |
Associate a NetDevice to this node. More... | |
Ptr< Application > | GetApplication (uint32_t index) const |
Retrieve the index-th Application associated to this node. More... | |
Ptr< NetDevice > | GetDevice (uint32_t index) const |
Retrieve the index-th NetDevice associated to this node. More... | |
uint32_t | GetId (void) const |
Time | GetLocalTime (void) const |
In the future, ns3 nodes may have clock that returned a local time different from the virtual time Simulator::Now(). More... | |
uint32_t | GetNApplications (void) const |
uint32_t | GetNDevices (void) const |
uint32_t | GetSystemId (void) const |
void | RegisterDeviceAdditionListener (DeviceAdditionListener listener) |
void | RegisterProtocolHandler (ProtocolHandler handler, uint16_t protocolType, Ptr< NetDevice > device, bool promiscuous=false) |
void | UnregisterDeviceAdditionListener (DeviceAdditionListener listener) |
void | UnregisterProtocolHandler (ProtocolHandler handler) |
Public Member Functions inherited from ns3::Object | |
Object () | |
Constructor. More... | |
virtual | ~Object () |
Destructor. More... | |
void | AggregateObject (Ptr< Object > other) |
Aggregate two Objects together. More... | |
void | Dispose (void) |
Dispose of this Object. More... | |
AggregateIterator | GetAggregateIterator (void) const |
Get an iterator to the Objects aggregated to this one. More... | |
virtual TypeId | GetInstanceTypeId (void) const |
Get the most derived TypeId for this Object. More... | |
template<> | |
Ptr< Object > | GetObject () const |
Specialization of () for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
Get a pointer to the requested aggregated Object by TypeId. More... | |
template<> | |
Ptr< Object > | GetObject (TypeId tid) const |
Specialization of (TypeId tid) for objects of type ns3::Object. More... | |
template<typename T > | |
Ptr< T > | GetObject (void) const |
Get a pointer to the requested aggregated Object. More... | |
void | Initialize (void) |
Invoke DoInitialize on all Objects aggregated to this one. More... | |
bool | IsInitialized (void) const |
Check if the object has been initialized. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= ([[maybe_unused]] const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Public Member Functions inherited from ns3::ObjectBase | |
virtual | ~ObjectBase () |
Virtual destructor. More... | |
void | GetAttribute (std::string name, AttributeValue &value) const |
Get the value of an attribute, raising fatal errors if unsuccessful. More... | |
bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
Get the value of an attribute without raising erros. More... | |
void | SetAttribute (std::string name, const AttributeValue &value) |
Set a single attribute, raising fatal errors if unsuccessful. More... | |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
Set a single attribute without raising errors. More... | |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
Connect a TraceSource to a Callback with a context. More... | |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
Connect a TraceSource to a Callback without a context. More... | |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected with a context. More... | |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Disconnect from a TraceSource a Callback previously connected without a context. More... | |
Static Public Member Functions | |
static bool | ChecksumEnabled (void) |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId (void) |
Register this type. More... | |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Get the type ID. More... | |
Protected Member Functions | |
virtual void | DoDispose (void) |
The dispose method. More... | |
virtual void | DoInitialize (void) |
Initialize() implementation. More... | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
Copy an Object. More... | |
virtual void | NotifyNewAggregate (void) |
Notify all Objects aggregated to this one of a new Object being aggregated. More... | |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
Complete construction of ObjectBase; invoked by derived classes. More... | |
virtual void | NotifyConstructionCompleted (void) |
Notifier called once the ObjectBase is fully constructed. More... | |
Private Types | |
typedef std::vector< DeviceAdditionListener > | DeviceAdditionListenerList |
Typedef for NetDevice addition listeners container. More... | |
typedef std::vector< struct Node::ProtocolHandlerEntry > | ProtocolHandlerList |
Typedef for protocol handlers container. More... | |
Private Member Functions | |
void | Construct (void) |
Finish node's construction by setting the correct node ID. More... | |
bool | NonPromiscReceiveFromDevice (Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, const Address &from) |
Receive a packet from a device in non-promiscuous mode. More... | |
void | NotifyDeviceAdded (Ptr< NetDevice > device) |
Notifies all the DeviceAdditionListener about the new device added. More... | |
bool | PromiscReceiveFromDevice (Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, const Address &from, const Address &to, NetDevice::PacketType packetType) |
Receive a packet from a device in promiscuous mode. More... | |
bool | ReceiveFromDevice (Ptr< NetDevice > device, Ptr< const Packet >, uint16_t protocol, const Address &from, const Address &to, NetDevice::PacketType packetType, bool promisc) |
Receive a packet from a device. More... | |
Private Attributes | |
std::vector< Ptr< Application > > | m_applications |
Applications associated to this node. More... | |
DeviceAdditionListenerList | m_deviceAdditionListeners |
Device addition listeners in the node. More... | |
std::vector< Ptr< NetDevice > > | m_devices |
Devices associated to this node. More... | |
ProtocolHandlerList | m_handlers |
Protocol handlers in the node. More... | |
uint32_t | m_id |
Node id for this node. More... | |
uint32_t | m_sid |
System id for this node. More... | |
Related Functions | |
(Note that these are not member functions.) | |
static GlobalValue | g_checksumEnabled |
More... | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
A network Node.
This class holds together:
Every Node created is added to the NodeList automatically.
ns3::Node is accessible through the following paths with Config::Set and Config::Connect:
No TraceSources are defined for this type.
Size of this type is 136 bytes (on a 64-bit architecture).
typedef Callback<void,Ptr<NetDevice> > ns3::Node::DeviceAdditionListener |
|
private |
typedef Callback<void,Ptr<NetDevice>, Ptr<const Packet>,uint16_t,const Address &, const Address &, NetDevice::PacketType> ns3::Node::ProtocolHandler |
A protocol handler.
device | a pointer to the net device which received the packet |
packet | the packet received |
protocol | the 16 bit protocol number associated with this packet. This protocol number is expected to be the same protocol number given to the Send method by the user on the sender side. |
sender | the address of the sender |
receiver | the address of the receiver; Note: this value is only valid for promiscuous mode protocol handlers. Note: If the L2 protocol does not use L2 addresses, the address reported here is the value of device->GetAddress(). |
packetType | type of packet received (broadcast/multicast/unicast/otherhost); Note: this value is only valid for promiscuous mode protocol handlers. |
|
private |
ns3::Node::Node | ( | ) |
Definition at line 80 of file node.cc.
References Construct(), and NS_LOG_FUNCTION.
ns3::Node::Node | ( | uint32_t | systemId | ) |
systemId | a unique integer used for parallel simulations. |
Definition at line 88 of file node.cc.
References Construct(), and NS_LOG_FUNCTION.
|
virtual |
Definition at line 103 of file node.cc.
References NS_LOG_FUNCTION.
uint32_t ns3::Node::AddApplication | ( | Ptr< Application > | application | ) |
Associate an Application to this Node.
application | Application to associate to this node. |
Definition at line 159 of file node.cc.
References GetId(), ns3::Object::Initialize(), m_applications, NS_LOG_FUNCTION, ns3::Simulator::ScheduleWithContext(), ns3::Seconds(), and ns3::Application::SetNode().
Referenced by ns3::NoBackhaulEpcHelper::NoBackhaulEpcHelper(), ns3::NoBackhaulEpcHelper::AddEnb(), EpcS1uUlTestCase::DoRun(), SpectrumIdealPhyTestCase::DoRun(), Ns3TcpNoDelayTestCase::DoRun(), Ns3TcpSocketTestCaseP2P::DoRun(), Ns3TcpSocketTestCaseCsma::DoRun(), BlockAckAggregationDisabledTest::DoRun(), PreservePacketsInAmpdus::DoRun(), Bug730TestCase::DoRun(), QosFragmentationTestCase::DoRun(), Bug2222TestCase::DoRun(), ns3::UdpServerHelper::Install(), ns3::UdpClientHelper::Install(), ns3::UdpTraceClientHelper::Install(), ns3::Ping6Helper::Install(), ns3::RadvdHelper::Install(), ns3::DhcpHelper::InstallDhcpClientPriv(), ns3::DhcpHelper::InstallDhcpServer(), ns3::QKDAppHelper::InstallKMS(), ns3::QKDAppHelper::InstallPostProcessing(), ns3::BulkSendHelper::InstallPriv(), ns3::OnOffHelper::InstallPriv(), ns3::PacketSinkHelper::InstallPriv(), ns3::ThreeGppHttpClientHelper::InstallPriv(), ns3::ThreeGppHttpServerHelper::InstallPriv(), ns3::UdpEchoServerHelper::InstallPriv(), ns3::UdpEchoClientHelper::InstallPriv(), ns3::V4PingHelper::InstallPriv(), ns3::V4TraceRouteHelper::InstallPriv(), ns3::WaveBsmHelper::InstallPriv(), ns3::QKDAppHelper::InstallQKDApp(), ns3::QKDAppHelper::InstallSDN(), OcbWifiMacTestCase::PostDeviceConfiguration(), Experiment::Run(), and WifiChannelSwitchingTest::SendPacket().
Associate a NetDevice to this node.
device | NetDevice to associate to this node. |
Definition at line 130 of file node.cc.
References GetId(), ns3::Object::Initialize(), m_devices, ns3::MakeCallback(), NonPromiscReceiveFromDevice(), NotifyDeviceAdded(), NS_LOG_FUNCTION, ns3::Simulator::ScheduleWithContext(), ns3::Seconds(), ns3::NetDevice::SetIfIndex(), ns3::NetDevice::SetNode(), and ns3::NetDevice::SetReceiveCallback().
Referenced by ns3::NoBackhaulEpcHelper::NoBackhaulEpcHelper(), Tunnel::Tunnel(), TcpTestCase::AddSimpleNetDevice(), AddSimpleNetDevice(), TcpTestCase::AddSimpleNetDevice6(), BuildSimpleTopology(), ns3::MeshHelper::CreateInterface(), WifiTest::CreateOne(), InterferenceHelperSequenceTest::CreateOne(), ThreeGppHttpObjectTestCase::CreateSimpleInternetNode(), Ipv6L3ProtocolTestCase::DoRun(), UdpClientServerTestCase::DoRun(), UdpTraceClientServerTestCase::DoRun(), IcmpEchoReplyTestCase::DoRun(), IcmpV6EchoReplyTestCase::DoRun(), Ipv4ForwardingTest::DoRun(), Ipv4GlobalRoutingSlash32TestCase::DoRun(), Ipv4HeaderTest::DoRun(), Ipv4PacketInfoTagTest::DoRun(), Ipv4RipTest::DoRun(), Ipv4RipCountToInfinityTest::DoRun(), Ipv4RipSplitHorizonStrategyTest::DoRun(), Ipv4StaticRoutingSlash32TestCase::DoRun(), Ipv4L3ProtocolTestCase::DoRun(), IpAddressHelperTestCasev6::DoRun(), Ipv6FragmentationTest::DoRun(), Ipv6PacketInfoTagTest::DoRun(), Ipv6RipngTest::DoRun(), Ipv6RipngCountToInfinityTest::DoRun(), Ipv6RipngSplitHorizonStrategyTest::DoRun(), LrWpanAckTestCase::DoRun(), LrWpanCcaTestCase::DoRun(), LrWpanCollisionTestCase::DoRun(), LrWpanEdTestCase::DoRun(), LrWpanErrorDistanceTestCase::DoRun(), LrWpanDataIfsTestCase::DoRun(), LrWpanSlottedCsmacaTestCase::DoRun(), PointToPointTest::DoRun(), SixlowpanFragmentationTest::DoRun(), SixlowpanHc1ImplTest::DoRun(), SixlowpanIphcImplTest::DoRun(), DcfImmediateAccessBroadcastTestCase::DoRun(), Bug2831TestCase::DoRun(), SpectrumWifiPhyFilterTest::DoSetup(), TestDlOfdmaPhyTransmission::DoSetup(), TestUlOfdmaPpduUid::DoSetup(), TestUlOfdmaPhyTransmission::DoSetup(), TestPhyPaddingExclusion::DoSetup(), ns3::WaveHelper::Install(), ns3::WifiHelper::Install(), ns3::MeshHelper::Install(), ns3::SixLowPanHelper::Install(), ns3::LrWpanHelper::Install(), ns3::AdhocAlohaNoackIdealPhyHelper::Install(), ns3::SpectrumAnalyzerHelper::Install(), ns3::WaveformGeneratorHelper::Install(), ns3::WimaxHelper::Install(), ns3::TvSpectrumTransmitterHelper::Install(), ns3::PointToPointHelper::Install(), ns3::BridgeHelper::Install(), ns3::TapBridgeHelper::Install(), ns3::UanHelper::Install(), ns3::TvSpectrumTransmitterHelper::InstallAdjacent(), ns3::FdNetDeviceHelper::InstallPriv(), ns3::CsmaHelper::InstallPriv(), ns3::SimpleNetDeviceHelper::InstallPriv(), ns3::LteHelper::InstallSingleEnbDevice(), ns3::LteSimpleHelper::InstallSingleEnbDevice(), ns3::LteHelper::InstallSingleUeDevice(), ns3::LteSimpleHelper::InstallSingleUeDevice(), InterferenceExperiment::Run(), TbfQueueDiscTestCase::RunTbfTest(), ns3::Ipv6L3Protocol::SetupLoopback(), and ns3::Ipv4L3Protocol::SetupLoopback().
|
static |
Definition at line 278 of file node.cc.
References g_checksumEnabled, ns3::BooleanValue::Get(), ns3::GlobalValue::GetValue(), and NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::CsmaNetDevice::AddHeader(), ns3::Ipv4L3Protocol::BuildHeader(), ns3::SixLowPanNetDevice::DecompressLowPanUdpNhc(), ns3::Ipv4L3Protocol::DoFragmentation(), ns3::LrWpanMac::McpsDataRequest(), ns3::LrWpanMac::PdDataIndication(), ns3::Ipv4L3Protocol::Receive(), ns3::CsmaNetDevice::Receive(), ns3::V4Ping::Send(), ns3::V4TraceRoute::Send(), ns3::UdpL4Protocol::Send(), ns3::LrWpanMac::SendAck(), ns3::Icmpv4L4Protocol::SendMessage(), ns3::LrWpanMac::SendOneBeacon(), ns3::TcpL4Protocol::SendPacketV4(), ns3::TcpL4Protocol::SendPacketV6(), ns3::olsr::Bug780Test::SendPing(), and ns3::Ipv4L3Protocol::SendWithHeader().
|
private |
Finish node's construction by setting the correct node ID.
Definition at line 97 of file node.cc.
References ns3::NodeList::Add(), m_id, and NS_LOG_FUNCTION.
Referenced by Node().
|
protectedvirtual |
The dispose method.
Subclasses must override this method and must chain up to it by calling Node::DoDispose at the end of their own DoDispose method.
Reimplemented from ns3::Object.
Definition at line 185 of file node.cc.
References ns3::Object::Dispose(), ns3::Object::DoDispose(), m_applications, m_deviceAdditionListeners, m_devices, m_handlers, and NS_LOG_FUNCTION.
|
protectedvirtual |
Initialize() implementation.
This method is called only once by Initialize(). If the user calls Initialize() multiple times, DoInitialize() is called only the first time.
Subclasses are expected to override this method and chain up to their parent's implementation once they are done. It is safe to call GetObject() and AggregateObject() from within this method.
Reimplemented from ns3::Object.
Definition at line 209 of file node.cc.
References ns3::Object::DoInitialize(), ns3::Object::Initialize(), m_applications, m_devices, and NS_LOG_FUNCTION.
Ptr< Application > ns3::Node::GetApplication | ( | uint32_t | index | ) | const |
Retrieve the index-th Application associated to this node.
index | the index of the requested Application |
Definition at line 170 of file node.cc.
References m_applications, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
Referenced by ns3::NoBackhaulEpcHelper::AddEnb(), ns3::NoBackhaulEpcHelper::AddS1Interface(), ns3::OnOffHelper::AssignStreams(), ns3::WaveBsmHelper::AssignStreams(), EpcS1uDlTestCase::DoRun(), EpcS1uUlTestCase::DoRun(), LteIpv6RoutingTestCase::DoRun(), ns3::V4Ping::GetApplicationId(), ns3::V4TraceRoute::GetApplicationId(), ns3::LteHelper::InstallSingleEnbDevice(), and ns3::V4TraceRouteHelper::PrintTraceRouteAt().
Retrieve the index-th NetDevice associated to this node.
index | the index of the requested NetDevice |
Definition at line 144 of file node.cc.
References m_devices, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
Referenced by ns3::EmuEpcHelper::AddX2Interface(), ns3::NoBackhaulEpcHelper::AddX2Interface(), ns3::NixVectorRouting< T >::BFS(), ns3::Socket::BindToNetDevice(), ns3::NixVectorRouting< T >::BuildIpAddressToNodeMap(), ns3::NixVectorRouting< T >::BuildNixVector(), ns3::AnimationInterface::ConnectLte(), ContextToMac(), ns3::GlobalRouter::DiscoverLSAs(), ns3::PacketSocket::DoBind(), AcousticModemEnergyTestCase::DoRun(), InterferenceHelperSequenceTest::DoRun(), StaWifiMacScanningTestCase::DoRun(), ns3::LteEnbRrcProtocolIdeal::DoSendSystemInformation(), ns3::LteEnbRrcProtocolReal::DoSendSystemInformation(), ns3::UanHelper::EnableAscii(), ns3::AsciiTraceHelperForDevice::EnableAsciiImpl(), ns3::AthstatsHelper::EnableAthstats(), ns3::PcapHelperForDevice::EnablePcap(), ns3::NixVectorRouting< T >::FindNetDeviceForNixIndex(), ns3::NixVectorRouting< T >::FindTotalNeighbors(), ns3::PacketSocket::GetMinMtu(), ns3::dsr::DsrRouting::GetNetDeviceFromContext(), ns3::AnimationInterface::GetNetDeviceFromContext(), ns3::TrafficControlLayer::GetRootQueueDiscOnDeviceByIndex(), ns3::PacketSocket::GetSockName(), ns3::AcousticModemEnergyModel::HandleEnergyDepletion(), ns3::AcousticModemEnergyModel::HandleEnergyRecharged(), ns3::Radvd::HandleRead(), ns3::GlobalRouter::NetDeviceIsBridged(), ns3::NixVectorRouting< T >::NetDeviceIsBridged(), ns3::DhcpServer::NetHandler(), OcbWifiMacTestCase::PostDeviceConfiguration(), PrintGnuplottableEnbListToFile(), PrintGnuplottableUeListToFile(), PrintPosition(), ns3::NixVectorRouting< T >::PrintRoutingPath(), PrintUePosition(), ns3::Rip::Receive(), ns3::RipNg::Receive(), ns3::GrantedTimeWindowMpiInterface::ReceiveMessages(), ns3::NullMessageMpiInterface::ReceiveMessages(), ns3::olsr::RoutingProtocol::RecvOlsr(), Experiment::Run(), ns3::TrafficControlLayer::ScanDevices(), AcousticModemEnergyTestCase::SendOnePacket(), AcousticModemEnergyDepletionTestCase::SendOnePacket(), TcFlowControlTestCase::SendPackets(), UanExperiment::SendSinglePacket(), ns3::PacketSocket::SendTo(), ns3::LteUeRrcProtocolIdeal::SetEnbRrcSapProvider(), ns3::LteUeRrcProtocolReal::SetEnbRrcSapProvider(), ns3::Ipv6L3Protocol::SetupLoopback(), ns3::Ipv4L3Protocol::SetupLoopback(), PowerRateAdaptationTest::TestAparf(), PowerRateAdaptationTest::TestParf(), PowerRateAdaptationTest::TestRrpaa(), ns3::PyViz::TraceNetDevRxCommon(), ns3::PyViz::TraceNetDevTxCommon(), StaWifiMacScanningTestCase::TurnApOff(), StaWifiMacScanningTestCase::TurnBeaconGenerationOn(), and ns3::AnimationInterface::WriteLinkProperties().
uint32_t ns3::Node::GetId | ( | void | ) | const |
This unique id happens to be also the index of the Node into the NodeList.
Definition at line 109 of file node.cc.
References m_id, and NS_LOG_FUNCTION.
Referenced by ns3::Ipv4FlowProbe::Ipv4FlowProbe(), ns3::Ipv6FlowProbe::Ipv6FlowProbe(), ns3::QKDGraph::QKDGraph(), ns3::LteHelper::ActivateDataRadioBearer(), AddApplication(), AddDevice(), ns3::QKDControl::AddLinkRecord(), ns3::TcpSocketBase::AddOptionSack(), ns3::TcpSocketBase::AddOptionSackPermitted(), ns3::TcpSocketBase::AddOptionTimestamp(), ns3::TcpSocketBase::AddOptionWScale(), ns3::QKDGraphManager::AddQKDBuffer(), ns3::GlobalRouter::AnotherRouterOnLink(), ns3::NixVectorRouting< T >::BFS(), ns3::NixVectorRouting< T >::BuildIpAddressToNodeMap(), ns3::GlobalRouter::BuildNetworkLSAs(), ns3::NixVectorRouting< T >::BuildNixVector(), ns3::TcpSocketBase::CalculateWScale(), ns3::AcousticModemEnergyModel::ChangeState(), TestInterBssConstantObssPdAlgo::CheckPhyDropReasons(), ns3::AnimationInterface::ConnectLteEnb(), ns3::AnimationInterface::ConnectLteUe(), ns3::Ipv4GlobalRoutingHelper::Create(), Bug772ChainTest::CreateDevices(), ns3::QKDLinkHelper::CreateQKDLink(), ns3::GlobalRouteManagerImpl::DeleteGlobalRoutes(), ns3::AnimationInterface::DevTxTrace(), ns3::GlobalRouter::DiscoverLSAs(), ns3::LteEnbPhy::DoInitialize(), ns3::LteUePhy::DoInitialize(), ns3::aodv::LoopbackTestCase::DoRun(), IcmpEchoReplyTestCase::DoRun(), IcmpTimeExceedTestCase::DoRun(), IcmpV6EchoReplyTestCase::DoRun(), IcmpV6TimeExceedTestCase::DoRun(), Ipv4FragmentationTest::DoRun(), Ipv6FragmentationTest::DoRun(), SixlowpanFragmentationTest::DoRun(), WifiMsduAggregatorThroughputTest::DoRun(), ns3::SixLowPanNetDevice::DoSend(), ns3::LteEnbRrcProtocolReal::DoSendSystemInformation(), ns3::UanHelper::EnableAscii(), ns3::AsciiTraceHelperForDevice::EnableAsciiImpl(), ns3::CsmaHelper::EnableAsciiInternal(), ns3::FdNetDeviceHelper::EnableAsciiInternal(), ns3::LrWpanHelper::EnableAsciiInternal(), ns3::PointToPointHelper::EnableAsciiInternal(), ns3::YansWavePhyHelper::EnableAsciiInternal(), ns3::WimaxHelper::EnableAsciiInternal(), ns3::WifiPhyHelper::EnableAsciiInternal(), ns3::AsciiTraceHelperForIpv4::EnableAsciiIpv4Impl(), ns3::InternetStackHelper::EnableAsciiIpv4Internal(), ns3::AsciiTraceHelperForIpv6::EnableAsciiIpv6Impl(), ns3::InternetStackHelper::EnableAsciiIpv6Internal(), ns3::AthstatsHelper::EnableAthstats(), ns3::AnimationInterface::EnableIpv4L3ProtocolCounters(), ns3::PcapHelperForDevice::EnablePcap(), ns3::PcapHelperForIpv4::EnablePcapIpv4(), ns3::PcapHelperForIpv6::EnablePcapIpv6(), ns3::AnimationInterface::EnableQueueCounters(), ns3::AnimationInterface::EnableWifiMacCounters(), ns3::AnimationInterface::EnableWifiPhyCounters(), ns3::GlobalRouter::FindDesignatedRouterForLink(), ns3::GlobalRouter::FindInterfaceForDevice(), ns3::ThreeGppChannelModel::GenerateChannelParameters(), ns3::BsmApplication::GenerateWaveTraffic(), ns3::AnimationInterface::GenericWirelessTxTrace(), ns3::QKDControl::GetBufferByDestinationNode(), ns3::ThreeGppChannelModel::GetChannel(), ns3::PcapHelper::GetFilenameFromDevice(), ns3::AsciiTraceHelper::GetFilenameFromDevice(), ns3::PcapHelper::GetFilenameFromInterfacePair(), ns3::AsciiTraceHelper::GetFilenameFromInterfacePair(), ns3::AnimationInterface::GetIpv4Address(), ns3::AnimationInterface::GetIpv4Addresses(), ns3::AnimationInterface::GetIpv4RoutingTable(), ns3::AnimationInterface::GetIpv6Address(), ns3::AnimationInterface::GetIpv6Addresses(), ns3::ThreeGppChannelConditionModel::GetKey(), ns3::ThreeGppPropagationLossModel::GetKey(), ns3::ThreeGppChannelModel::GetNewChannel(), ns3::NixVectorRouting< T >::GetNixVector(), ns3::PyViz::GetPacketDropSamples(), ns3::ThreeGppChannelModel::GetParams(), ns3::AnimationInterface::GetPosition(), ns3::PyViz::GetTransmissionSamples(), ns3::AcousticModemEnergyModel::HandleEnergyDepletion(), ns3::AcousticModemEnergyModel::HandleEnergyRecharged(), ns3::BsmApplication::HandleReceivedBsmPacket(), ns3::ArpCache::HandleWaitReplyTimeout(), ns3::SixLowPanHelper::Install(), ns3::SpectrumAnalyzerHelper::Install(), ns3::BuildingsHelper::Install(), ns3::BridgeHelper::Install(), ns3::TapBridgeHelper::Install(), HwmpProactiveRegressionTest::InstallApplications(), HwmpReactiveRegressionTest::InstallApplications(), HwmpSimplestRegressionTest::InstallApplications(), HwmpDoRfRegressionTest::InstallApplications(), FlameRegressionTest::InstallApplications(), ns3::Ipv6L3Protocol::IpForward(), ns3::Ipv4L3Protocol::IpForward(), ns3::Ipv6L3Protocol::IpMulticastForward(), ns3::Ipv4L3Protocol::IpMulticastForward(), ns3::ArpL3Protocol::Lookup(), ns3::AnimationInterface::LrWpanPhyTxBeginTrace(), ns3::AnimationInterface::MobilityAutoCheck(), ns3::AnimationInterface::MobilityCourseChangeTrace(), ns3::AnimationInterface::OutputCsmaPacket(), ns3::AnimationInterface::OutputWirelessPacketRxInfo(), ns3::AnimationInterface::OutputWirelessPacketTxInfo(), ns3::Ipv4RoutingHelper::PrintArpCache(), ns3::Ipv4RoutingHelper::PrintArpCacheEvery(), ns3::QKDGraph::PrintGraph(), ns3::Ipv6RoutingHelper::PrintNdiscCache(), ns3::Ipv6RoutingHelper::PrintNdiscCacheEvery(), PrintPosition(), PrintReceivedPacket(), PrintReceivedRoutingPacket(), ns3::NixVectorRouting< T >::PrintRoutingPath(), ns3::V4TraceRouteHelper::PrintTraceRouteAt(), ns3::GlobalRouter::ProcessBridgedBroadcastLink(), ns3::QKDGraph::ProcessMCurrent(), ns3::QKDGraph::ProcessMStatusHelpFunction(), ns3::QKDGraph::ProcessMThrStatus(), ns3::TcpSocketBase::ProcessOptionSackPermitted(), ns3::TcpSocketBase::ProcessOptionTimestamp(), ns3::TcpSocketBase::ProcessOptionWScale(), ns3::QKDKeyManagerSystemApplication::ProcessRequest(), ns3::GlobalRouter::ProcessSingleBroadcastLink(), ChannelAccessTestCase::Receive(), ns3::ArpL3Protocol::Receive(), ns3::Ipv4L3Protocol::Receive(), ns3::Ipv6L3Protocol::Receive(), ns3::TapBridge::ReceiveFromBridgedDevice(), ReceiveFromDevice(), ns3::GrantedTimeWindowMpiInterface::ReceiveMessages(), ns3::NullMessageMpiInterface::ReceiveMessages(), ns3::AnimationInterface::RecursiveIpv4RoutePathSearch(), ns3::Ipv4ListRouting::RouteInput(), ns3::olsr::RoutingProtocol::RouteInput(), ns3::Ipv6ListRouting::RouteInput(), ns3::olsr::RoutingProtocol::RouteOutput(), ns3::TrafficControlLayer::ScanDevices(), ns3::V4Ping::Send(), ns3::LoopbackNetDevice::Send(), ns3::YansWifiChannel::Send(), ns3::ArpL3Protocol::SendArpReply(), ns3::ArpL3Protocol::SendArpRequest(), Bug772ChainTest::SendData(), ns3::aodv::LoopbackTestCase::SendData(), UdpSocketImplTest::SendData(), HwmpProactiveRegressionTest::SendData(), HwmpReactiveRegressionTest::SendData(), HwmpSimplestRegressionTest::SendData(), FlameRegressionTest::SendData(), Ipv4ForwardingTest::SendData(), Ipv4GlobalRoutingSlash32TestCase::SendData(), Ipv4RawSocketImplTest::SendData(), Ipv4RipTest::SendData(), Ipv4RipCountToInfinityTest::SendData(), Ipv4StaticRoutingSlash32TestCase::SendData(), Ipv6ForwardingTest::SendData(), Ipv6RawSocketImplTest::SendData(), Ipv6RipngTest::SendData(), Ipv6RipngCountToInfinityTest::SendData(), SixlowpanHc1ImplTest::SendData(), SixlowpanIphcImplTest::SendData(), NixVectorRoutingTest::SendData(), Ipv4RawSocketImplTest::SendData_IpHdr(), Ipv4HeaderTest::SendData_IpHdr_Dscp(), HwmpDoRfRegressionTest::SendDataA(), HwmpDoRfRegressionTest::SendDataB(), HwmpDoRfRegressionTest::SendDataC(), UdpSocketImplTest::SendDataTo(), Udp6SocketImplTest::SendDataTo(), ns3::LoopbackNetDevice::SendFrom(), Experiment::SendMultiDestinations(), Ipv4DeduplicationTest::SendPacket(), ns3::LteTestMac::SendTxOpportunity(), ns3::SubscriberStationNetDevice::SetBasicConnection(), ns3::AnimationInterface::SetConstantPosition(), ns3::QKDPostprocessingApplication::SetDst(), ns3::FdNetDevice::SetNode(), ns3::GlobalRoutingLSA::SetNode(), ns3::SubscriberStationNetDevice::SetPrimaryConnection(), ns3::QKDPostprocessingApplication::SetSrc(), showPosition(), ns3::GlobalRouteManagerImpl::SPFAddASExternal(), ns3::GlobalRouteManagerImpl::SPFIntraAddRouter(), ns3::GlobalRouteManagerImpl::SPFIntraAddStub(), ns3::GlobalRouteManagerImpl::SPFIntraAddTransit(), ns3::LteTestRrc::Start(), ns3::BsmApplication::StartApplication(), ns3::TapBridge::StartTapDevice(), ns3::MultiModelSpectrumChannel::StartTx(), ns3::SingleModelSpectrumChannel::StartTx(), ns3::PyViz::TraceNetDevRxCommon(), ns3::AnimationInterface::TrackIpv4L3ProtocolCounters(), ns3::AnimationInterface::TrackIpv4Route(), ns3::AnimationInterface::TrackQueueCounters(), ns3::AnimationInterface::TrackWifiMacCounters(), ns3::AnimationInterface::TrackWifiPhyCounters(), ns3::AnimationInterface::UpdateLinkDescription(), ns3::AnimationInterface::UpdateNodeColor(), ns3::AnimationInterface::UpdateNodeDescription(), ns3::AnimationInterface::UpdatePosition(), ns3::AnimationInterface::WifiPhyTxBeginTrace(), ns3::AnimationInterface::WriteLinkProperties(), ns3::AnimationInterface::WriteNodeColors(), ns3::AnimationInterface::WriteNodeEnergies(), ns3::AnimationInterface::WriteNodes(), and ns3::AnimationInterface::WriteNodeSizes().
Time ns3::Node::GetLocalTime | ( | void | ) | const |
In the future, ns3 nodes may have clock that returned a local time different from the virtual time Simulator::Now().
This function is currently a placeholder to ease the development of this feature. For now, it is only an alias to Simulator::Now()
Definition at line 116 of file node.cc.
References ns3::Simulator::Now(), and NS_LOG_FUNCTION.
uint32_t ns3::Node::GetNApplications | ( | void | ) | const |
Definition at line 178 of file node.cc.
References m_applications, and NS_LOG_FUNCTION.
Referenced by ns3::NoBackhaulEpcHelper::AddEnb(), ns3::OnOffHelper::AssignStreams(), ns3::WaveBsmHelper::AssignStreams(), ns3::V4Ping::GetApplicationId(), ns3::V4TraceRoute::GetApplicationId(), and ns3::V4TraceRouteHelper::PrintTraceRouteAt().
uint32_t ns3::Node::GetNDevices | ( | void | ) | const |
Definition at line 152 of file node.cc.
References m_devices, and NS_LOG_FUNCTION.
Referenced by ns3::EmuEpcHelper::AddX2Interface(), ns3::NixVectorRouting< T >::BFS(), ns3::Socket::BindToNetDevice(), ns3::NixVectorRouting< T >::BuildIpAddressToNodeMap(), ns3::NixVectorRouting< T >::BuildNixVector(), ns3::AnimationInterface::ConnectLte(), ContextToMac(), ns3::GlobalRouter::DiscoverLSAs(), ns3::LteEnbRrcProtocolIdeal::DoSendSystemInformation(), ns3::LteEnbRrcProtocolReal::DoSendSystemInformation(), ns3::UanHelper::EnableAscii(), ns3::AsciiTraceHelperForDevice::EnableAsciiImpl(), ns3::AthstatsHelper::EnableAthstats(), ns3::PcapHelperForDevice::EnablePcap(), ns3::NixVectorRouting< T >::FindNetDeviceForNixIndex(), ns3::NixVectorRouting< T >::FindTotalNeighbors(), ns3::PacketSocket::GetMinMtu(), ns3::TrafficControlLayer::GetNDevices(), ns3::GlobalRouter::NetDeviceIsBridged(), ns3::NixVectorRouting< T >::NetDeviceIsBridged(), PrintGnuplottableEnbListToFile(), PrintGnuplottableUeListToFile(), PrintUePosition(), ns3::GrantedTimeWindowMpiInterface::ReceiveMessages(), ns3::NullMessageMpiInterface::ReceiveMessages(), ns3::TrafficControlLayer::ScanDevices(), ns3::PacketSocket::SendTo(), ns3::LteUeRrcProtocolIdeal::SetEnbRrcSapProvider(), ns3::LteUeRrcProtocolReal::SetEnbRrcSapProvider(), ns3::Ipv6L3Protocol::SetupLoopback(), ns3::Ipv4L3Protocol::SetupLoopback(), and ns3::AnimationInterface::WriteLinkProperties().
uint32_t ns3::Node::GetSystemId | ( | void | ) | const |
Definition at line 123 of file node.cc.
References m_sid, and NS_LOG_FUNCTION.
Referenced by ns3::DistributedSimulatorImpl::CalculateLookAhead(), ns3::NullMessageSimulatorImpl::CalculateLookAhead(), ns3::GlobalRouteManagerImpl::InitializeRoutes(), ns3::PointToPointHelper::Install(), ns3::GrantedTimeWindowMpiInterface::SendPacket(), ns3::NullMessageMpiInterface::SendPacket(), and ns3::AnimationInterface::WriteNodes().
|
static |
Get the type ID.
Definition at line 52 of file node.cc.
References ns3::TypeId::ATTR_GET, ns3::TypeId::ATTR_SET, m_applications, m_devices, m_id, m_sid, ns3::MakeObjectVectorAccessor(), ns3::MakeUintegerAccessor(), and ns3::TypeId::SetParent().
|
private |
Receive a packet from a device in non-promiscuous mode.
device | the device |
packet | the packet |
protocol | the protocol |
from | the sender |
Definition at line 295 of file node.cc.
References ns3::NetDevice::GetAddress(), NS_LOG_FUNCTION, and ReceiveFromDevice().
Referenced by AddDevice().
Notifies all the DeviceAdditionListener about the new device added.
device | the added device to notify. |
Definition at line 362 of file node.cc.
References m_deviceAdditionListeners, and NS_LOG_FUNCTION.
Referenced by AddDevice().
|
private |
Receive a packet from a device in promiscuous mode.
device | the device |
packet | the packet |
protocol | the protocol |
from | the sender |
to | the destination |
packetType | the packet type |
Definition at line 287 of file node.cc.
References NS_LOG_FUNCTION, and ReceiveFromDevice().
Referenced by RegisterProtocolHandler().
|
private |
Receive a packet from a device.
device | the device |
packet | the packet |
protocol | the protocol |
from | the sender |
to | the destination |
packetType | the packet type |
promisc | true if received in promiscuous mode |
Definition at line 303 of file node.cc.
References ns3::Simulator::GetContext(), GetId(), ns3::NetDevice::GetIfIndex(), ns3::Object::GetInstanceTypeId(), ns3::TypeId::GetName(), ns3::Packet::GetUid(), m_handlers, NS_ASSERT_MSG, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by NonPromiscReceiveFromDevice(), and PromiscReceiveFromDevice().
void ns3::Node::RegisterDeviceAdditionListener | ( | DeviceAdditionListener | listener | ) |
listener | the listener to add |
Add a new listener to the list of listeners for the device-added event. When a new listener is added, it is notified of the existence of all already-added devices to make discovery of devices easier.
Definition at line 335 of file node.cc.
References m_deviceAdditionListeners, m_devices, and NS_LOG_FUNCTION.
void ns3::Node::RegisterProtocolHandler | ( | ProtocolHandler | handler, |
uint16_t | protocolType, | ||
Ptr< NetDevice > | device, | ||
bool | promiscuous = false |
||
) |
handler | the handler to register |
protocolType | the type of protocol this handler is interested in. This protocol type is a so-called EtherType, as registered here: http://standards.ieee.org/regauth/ethertype/eth.txt the value zero is interpreted as matching all protocols. |
device | the device attached to this handler. If the value is zero, the handler is attached to all devices on this node. |
promiscuous | whether to register a promiscuous mode handler |
Definition at line 229 of file node.cc.
References ns3::Node::ProtocolHandlerEntry::device, ns3::Node::ProtocolHandlerEntry::handler, m_devices, m_handlers, ns3::MakeCallback(), NS_LOG_FUNCTION, PromiscReceiveFromDevice(), ns3::Node::ProtocolHandlerEntry::promiscuous, ns3::Node::ProtocolHandlerEntry::protocol, and ns3::NetDevice::SetPromiscReceiveCallback().
Referenced by ns3::BridgeNetDevice::AddBridgePort(), ns3::Ipv4L3Protocol::AddInterface(), ns3::Ipv6L3Protocol::AddInterface(), ns3::MeshPointDevice::AddInterface(), ns3::PacketSocket::DoBind(), ns3::SixLowPanNetDevice::SetNetDevice(), ns3::Ipv6L3Protocol::SetupLoopback(), and ns3::Ipv4L3Protocol::SetupLoopback().
void ns3::Node::UnregisterDeviceAdditionListener | ( | DeviceAdditionListener | listener | ) |
listener | the listener to remove |
Remove an existing listener from the list of listeners for the device-added event.
Definition at line 347 of file node.cc.
References m_deviceAdditionListeners, and NS_LOG_FUNCTION.
void ns3::Node::UnregisterProtocolHandler | ( | ProtocolHandler | handler | ) |
handler | the handler to unregister |
After this call returns, the input handler will never be invoked anymore.
Definition at line 263 of file node.cc.
References m_handlers, and NS_LOG_FUNCTION.
Referenced by ns3::PacketSocket::Close().
|
related |
A global switch to enable all checksums for all protocols.
Definition at line 46 of file node.cc.
Referenced by ChecksumEnabled().
|
private |
Applications associated to this node.
Definition at line 288 of file node.h.
Referenced by AddApplication(), DoDispose(), DoInitialize(), GetApplication(), GetNApplications(), and GetTypeId().
|
private |
Device addition listeners in the node.
Definition at line 290 of file node.h.
Referenced by DoDispose(), NotifyDeviceAdded(), RegisterDeviceAdditionListener(), and UnregisterDeviceAdditionListener().
Devices associated to this node.
Definition at line 287 of file node.h.
Referenced by AddDevice(), DoDispose(), DoInitialize(), GetDevice(), GetNDevices(), GetTypeId(), RegisterDeviceAdditionListener(), and RegisterProtocolHandler().
|
private |
Protocol handlers in the node.
Definition at line 289 of file node.h.
Referenced by DoDispose(), ReceiveFromDevice(), RegisterProtocolHandler(), and UnregisterProtocolHandler().
|
private |
Node id for this node.
Definition at line 285 of file node.h.
Referenced by Construct(), GetId(), and GetTypeId().
|
private |
System id for this node.
Definition at line 286 of file node.h.
Referenced by GetSystemId(), and GetTypeId().