A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
UanExperiment Class Reference

This example shows the usage of UDP over 6LoWPAN to transfer data. More...

+ Collaboration diagram for UanExperiment:

Public Member Functions

 UanExperiment ()
 
 UanExperiment ()
 
 UanExperiment ()
 
 UanExperiment ()
 
void Prepare ()
 Prepare the experiment.
 
void Prepare ()
 Prepare the experiment.
 
void Prepare ()
 Prepare the experiment.
 
void Prepare ()
 Prepare the experiment.
 
void PrintReceivedPacket (Ptr< Socket > socket)
 Print the received packet.
 
void PrintReceivedPacket (Ptr< Socket > socket)
 Print the received packet.
 
void PrintReceivedPacket (Ptr< Socket > socket)
 Print the received packet.
 
void PrintReceivedPacket (Ptr< Socket > socket)
 Print the received packet.
 
void SendPackets ()
 Send a packet from all the nodes.
 
void SendPackets ()
 Send a packet from all the nodes.
 
void SendPackets ()
 Send a packet from all the nodes.
 
void SendPackets ()
 Send a packet from all the nodes.
 
void SendSinglePacket (Ptr< Node > node, Ptr< Packet > pkt, Ipv4Address dst)
 Send a packet from one of the nodes.
 
void SendSinglePacket (Ptr< Node > node, Ptr< Packet > pkt, Ipv6Address dst)
 Send a packet from one of the nodes.
 
void SendSinglePacket (Ptr< Node > node, Ptr< Packet > pkt, Ipv6Address dst)
 Send a packet from one of the nodes.
 
void SendSinglePacket (Ptr< Node > node, Ptr< Packet > pkt, Mac8Address dst)
 Send a packet from one of the nodes.
 
void SetupApplications ()
 Set the UAN nodes communication channels.
 
void SetupApplications ()
 Set the UAN nodes communication channels.
 
void SetupApplications ()
 Set the UAN nodes communication channels.
 
void SetupApplications ()
 Set the UAN nodes communication channels.
 
void SetupCommunications ()
 Set the UAN nodes communication channels.
 
void SetupCommunications ()
 Set the UAN nodes communication channels.
 
void SetupCommunications ()
 Set the UAN nodes communication channels.
 
void SetupCommunications ()
 Set the UAN nodes communication channels.
 
void SetupEnergy ()
 Set the UAN nodes energy.
 
void SetupEnergy ()
 Set the UAN nodes energy.
 
void SetupEnergy ()
 Set the UAN nodes energy.
 
void SetupEnergy ()
 Set the UAN nodes energy.
 
void SetupPositions ()
 Set the UAN nodes position.
 
void SetupPositions ()
 Set the UAN nodes position.
 
void SetupPositions ()
 Set the UAN nodes position.
 
void SetupPositions ()
 Set the UAN nodes position.
 
void Teardown ()
 Teardown the experiment.
 
void Teardown ()
 Teardown the experiment.
 
void Teardown ()
 Teardown the experiment.
 
void Teardown ()
 Teardown the experiment.
 

Private Attributes

NodeContainer m_nodes
 UAN nodes.
 
std::map< Ptr< Node >, Ptr< Socket > > m_sockets
 send and receive sockets
 

Detailed Description

This example shows the usage of UDP over 6LoWPAN to transfer data.

This example shows the usage of raw packets transfer data.

This example shows the usage of UDP over IPv6 to transfer data.

This example shows the usage of UDP over IPv4 to transfer data.

Two nodes are sending their remaining energy percentage (1 byte) to a gateway node, that prints the received data. The transmissions are scheduled at random times to avoid collisions

Definition at line 36 of file uan-6lowpan-example.cc.

Constructor & Destructor Documentation

◆ UanExperiment() [1/4]

UanExperiment::UanExperiment ( )

Definition at line 95 of file uan-6lowpan-example.cc.

◆ UanExperiment() [2/4]

UanExperiment::UanExperiment ( )

◆ UanExperiment() [3/4]

UanExperiment::UanExperiment ( )

◆ UanExperiment() [4/4]

UanExperiment::UanExperiment ( )

Member Function Documentation

◆ Prepare() [1/4]

void UanExperiment::Prepare ( )

Prepare the experiment.

Definition at line 228 of file uan-6lowpan-example.cc.

References ns3::NodeContainer::Create(), m_nodes, SendPackets(), SetupApplications(), SetupCommunications(), SetupEnergy(), and SetupPositions().

+ Here is the call graph for this function:

◆ Prepare() [2/4]

void UanExperiment::Prepare ( )

Prepare the experiment.

◆ Prepare() [3/4]

void UanExperiment::Prepare ( )

Prepare the experiment.

◆ Prepare() [4/4]

void UanExperiment::Prepare ( )

Prepare the experiment.

◆ PrintReceivedPacket() [1/4]

void UanExperiment::PrintReceivedPacket ( Ptr< Socket > socket)

Print the received packet.

Parameters
socketThe receiving socket

Definition at line 157 of file uan-6lowpan-example.cc.

References ns3::Inet6SocketAddress::ConvertFrom(), ns3::Inet6SocketAddress::IsMatchingType(), ns3::Simulator::Now(), and NS_LOG_UNCOND.

Referenced by SetupApplications().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PrintReceivedPacket() [2/4]

void UanExperiment::PrintReceivedPacket ( Ptr< Socket > socket)

Print the received packet.

Parameters
socketThe receiving socket

◆ PrintReceivedPacket() [3/4]

void UanExperiment::PrintReceivedPacket ( Ptr< Socket > socket)

Print the received packet.

Parameters
socketThe receiving socket

◆ PrintReceivedPacket() [4/4]

void UanExperiment::PrintReceivedPacket ( Ptr< Socket > socket)

Print the received packet.

Parameters
socketThe receiving socket

◆ SendPackets() [1/4]

void UanExperiment::SendPackets ( )

Send a packet from all the nodes.

Definition at line 196 of file uan-6lowpan-example.cc.

References ns3::NodeContainer::Begin(), ns3::Create(), ns3::CreateObject(), ns3::NodeContainer::End(), ns3::Ipv6InterfaceAddress::GetAddress(), ns3::Ipv6L3Protocol::GetAddress(), ns3::Hours(), m_nodes, ns3::Simulator::Schedule(), ns3::Seconds(), SendPackets(), and SendSinglePacket().

Referenced by Prepare(), and SendPackets().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendPackets() [2/4]

void UanExperiment::SendPackets ( )

Send a packet from all the nodes.

◆ SendPackets() [3/4]

void UanExperiment::SendPackets ( )

Send a packet from all the nodes.

◆ SendPackets() [4/4]

void UanExperiment::SendPackets ( )

Send a packet from all the nodes.

◆ SendSinglePacket() [1/4]

void UanExperiment::SendSinglePacket ( Ptr< Node > node,
Ptr< Packet > pkt,
Ipv4Address dst )

Send a packet from one of the nodes.

Parameters
nodeThe sending node
pktThe packet
dstthe destination

Definition at line 210 of file uan-ipv4-example.cc.

References m_sockets, ns3::Simulator::Now(), and NS_LOG_UNCOND.

+ Here is the call graph for this function:

◆ SendSinglePacket() [2/4]

void UanExperiment::SendSinglePacket ( Ptr< Node > node,
Ptr< Packet > pkt,
Ipv6Address dst )

Send a packet from one of the nodes.

Parameters
nodeThe sending node
pktThe packet
dstthe destination

Definition at line 219 of file uan-6lowpan-example.cc.

References ns3::Ipv6Address::ConvertFrom(), m_sockets, ns3::Simulator::Now(), and NS_LOG_UNCOND.

Referenced by SendPackets().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendSinglePacket() [3/4]

void UanExperiment::SendSinglePacket ( Ptr< Node > node,
Ptr< Packet > pkt,
Ipv6Address dst )

Send a packet from one of the nodes.

Parameters
nodeThe sending node
pktThe packet
dstthe destination

◆ SendSinglePacket() [4/4]

void UanExperiment::SendSinglePacket ( Ptr< Node > node,
Ptr< Packet > pkt,
Mac8Address dst )

Send a packet from one of the nodes.

Parameters
nodeThe sending node
pktThe packet
dstthe destination

Definition at line 199 of file uan-raw-example.cc.

References m_sockets, ns3::Simulator::Now(), NS_LOG_UNCOND, ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), and ns3::PacketSocketAddress::SetSingleDevice().

+ Here is the call graph for this function:

◆ SetupApplications() [1/4]

void UanExperiment::SetupApplications ( )

Set the UAN nodes communication channels.

Definition at line 177 of file uan-6lowpan-example.cc.

References ns3::NodeContainer::Begin(), ns3::Socket::CreateSocket(), ns3::NodeContainer::End(), ns3::Ipv6Address::GetAny(), ns3::TypeId::LookupByName(), m_nodes, m_sockets, ns3::MakeCallback(), and PrintReceivedPacket().

Referenced by Prepare().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetupApplications() [2/4]

void UanExperiment::SetupApplications ( )

Set the UAN nodes communication channels.

◆ SetupApplications() [3/4]

void UanExperiment::SetupApplications ( )

Set the UAN nodes communication channels.

◆ SetupApplications() [4/4]

void UanExperiment::SetupApplications ( )

Set the UAN nodes communication channels.

◆ SetupCommunications() [1/4]

void UanExperiment::SetupCommunications ( )

Set the UAN nodes communication channels.

Definition at line 119 of file uan-6lowpan-example.cc.

References ns3::energy::EnergySourceContainer::Add(), ns3::Ipv6AddressHelper::Assign(), ns3::NodeContainer::Begin(), ns3::CreateObject(), ns3::NodeContainer::End(), ns3::energy::EnergySourceContainer::Get(), ns3::Object::GetObject(), ns3::DeviceEnergyModelHelper::Install(), ns3::InternetStackHelper::Install(), ns3::SixLowPanHelper::Install(), ns3::UanHelper::Install(), m_nodes, ns3::Seconds(), and ns3::Ipv6AddressHelper::SetBase().

Referenced by Prepare().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetupCommunications() [2/4]

void UanExperiment::SetupCommunications ( )

Set the UAN nodes communication channels.

◆ SetupCommunications() [3/4]

void UanExperiment::SetupCommunications ( )

Set the UAN nodes communication channels.

◆ SetupCommunications() [4/4]

void UanExperiment::SetupCommunications ( )

Set the UAN nodes communication channels.

◆ SetupEnergy() [1/4]

void UanExperiment::SetupEnergy ( )

Set the UAN nodes energy.

Definition at line 111 of file uan-6lowpan-example.cc.

References ns3::EnergySourceHelper::Install(), m_nodes, and ns3::BasicEnergySourceHelper::Set().

Referenced by Prepare().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetupEnergy() [2/4]

void UanExperiment::SetupEnergy ( )

Set the UAN nodes energy.

◆ SetupEnergy() [3/4]

void UanExperiment::SetupEnergy ( )

Set the UAN nodes energy.

◆ SetupEnergy() [4/4]

void UanExperiment::SetupEnergy ( )

Set the UAN nodes energy.

◆ SetupPositions() [1/4]

void UanExperiment::SetupPositions ( )

Set the UAN nodes position.

Definition at line 100 of file uan-6lowpan-example.cc.

References ns3::NodeContainer::Get(), ns3::Object::GetObject(), ns3::MobilityHelper::Install(), m_nodes, and ns3::MobilityHelper::SetMobilityModel().

Referenced by Prepare().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetupPositions() [2/4]

void UanExperiment::SetupPositions ( )

Set the UAN nodes position.

◆ SetupPositions() [3/4]

void UanExperiment::SetupPositions ( )

Set the UAN nodes position.

◆ SetupPositions() [4/4]

void UanExperiment::SetupPositions ( )

Set the UAN nodes position.

◆ Teardown() [1/4]

void UanExperiment::Teardown ( )

Teardown the experiment.

Definition at line 239 of file uan-6lowpan-example.cc.

References m_sockets.

◆ Teardown() [2/4]

void UanExperiment::Teardown ( )

Teardown the experiment.

◆ Teardown() [3/4]

void UanExperiment::Teardown ( )

Teardown the experiment.

◆ Teardown() [4/4]

void UanExperiment::Teardown ( )

Teardown the experiment.

Member Data Documentation

◆ m_nodes

NodeContainer UanExperiment::m_nodes
private

◆ m_sockets

std::map< Ptr< Node >, Ptr< Socket > > UanExperiment::m_sockets
private

send and receive sockets

Definition at line 92 of file uan-6lowpan-example.cc.

Referenced by SendSinglePacket(), SendSinglePacket(), SendSinglePacket(), SetupApplications(), and Teardown().


The documentation for this class was generated from the following files: