A Discrete-Event Network Simulator
API
Public Member Functions | Private Attributes | List of all members
UanExperiment Class Reference

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

Public Member Functions

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

Private Attributes

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

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 47 of file uan-6lowpan-example.cc.

Constructor & Destructor Documentation

◆ UanExperiment() [1/4]

UanExperiment::UanExperiment ( )

Definition at line 107 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.

◆ Prepare() [2/4]

void UanExperiment::Prepare ( )

Prepare the experiment.

◆ Prepare() [3/4]

void UanExperiment::Prepare ( )

Prepare the experiment.

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

◆ 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

◆ 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)

◆ SendPackets() [1/4]

void UanExperiment::SendPackets ( )

Send a packet from all the nodes.

◆ 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 ( )

◆ SendSinglePacket() [1/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() [2/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 217 of file uan-ipv4-example.cc.

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

◆ SendSinglePacket() [3/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 209 of file uan-raw-example.cc.

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

◆ SendSinglePacket() [4/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 225 of file uan-6lowpan-example.cc.

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

Referenced by SendPackets().

◆ SetupApplications() [1/4]

void UanExperiment::SetupApplications ( )

Set the UAN nodes communication channels.

◆ 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.

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

References ns3::Socket::CreateSocket(), ns3::Ipv6Address::GetAny(), ns3::TypeId::LookupByName(), ns3::MakeCallback(), and PrintReceivedPacket().

◆ SetupCommunications() [1/4]

void UanExperiment::SetupCommunications ( )

Set the UAN nodes communication channels.

◆ SetupCommunications() [2/4]

void UanExperiment::SetupCommunications ( )

Set the UAN nodes communication channels.

◆ SetupCommunications() [3/4]

void UanExperiment::SetupCommunications ( )

◆ SetupCommunications() [4/4]

void UanExperiment::SetupCommunications ( )

Set the UAN nodes communication channels.

◆ SetupEnergy() [1/4]

void UanExperiment::SetupEnergy ( )

Set the UAN nodes energy.

◆ 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.

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

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

◆ SetupPositions() [1/4]

void UanExperiment::SetupPositions ( )

Set the UAN nodes position.

◆ 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.

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

References ns3::MobilityHelper::Install(), ns3::MobilityHelper::SetMobilityModel(), and SetPosition().

◆ Teardown() [1/4]

void UanExperiment::Teardown ( )

Teardown the experiment.

◆ Teardown() [2/4]

void UanExperiment::Teardown ( )

Teardown the experiment.

◆ Teardown() [3/4]

void UanExperiment::Teardown ( )

Teardown the experiment.

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

◆ Teardown() [4/4]

void UanExperiment::Teardown ( )

Teardown the experiment.

Member Data Documentation

◆ m_nodes

NodeContainer UanExperiment::m_nodes
private

UAN nodes.

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

◆ m_sockets

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

send and receive sockets

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


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