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. | |
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 | |
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.
UanExperiment::UanExperiment | ( | ) |
Definition at line 95 of file uan-6lowpan-example.cc.
UanExperiment::UanExperiment | ( | ) |
UanExperiment::UanExperiment | ( | ) |
UanExperiment::UanExperiment | ( | ) |
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().
void UanExperiment::Prepare | ( | ) |
Prepare the experiment.
void UanExperiment::Prepare | ( | ) |
Prepare the experiment.
void UanExperiment::Prepare | ( | ) |
Prepare the experiment.
Print the received packet.
socket | The 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().
Print the received packet.
socket | The receiving socket |
Print the received packet.
socket | The receiving socket |
Print the received packet.
socket | The receiving socket |
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().
void UanExperiment::SendPackets | ( | ) |
Send a packet from all the nodes.
void UanExperiment::SendPackets | ( | ) |
Send a packet from all the nodes.
void UanExperiment::SendPackets | ( | ) |
Send a packet from all the nodes.
void UanExperiment::SendSinglePacket | ( | Ptr< Node > | node, |
Ptr< Packet > | pkt, | ||
Ipv4Address | dst ) |
Send a packet from one of the nodes.
node | The sending node |
pkt | The packet |
dst | the destination |
Definition at line 210 of file uan-ipv4-example.cc.
References m_sockets, ns3::Simulator::Now(), and NS_LOG_UNCOND.
void UanExperiment::SendSinglePacket | ( | Ptr< Node > | node, |
Ptr< Packet > | pkt, | ||
Ipv6Address | dst ) |
Send a packet from one of the nodes.
node | The sending node |
pkt | The packet |
dst | the 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().
void UanExperiment::SendSinglePacket | ( | Ptr< Node > | node, |
Ptr< Packet > | pkt, | ||
Ipv6Address | dst ) |
Send a packet from one of the nodes.
node | The sending node |
pkt | The packet |
dst | the destination |
void UanExperiment::SendSinglePacket | ( | Ptr< Node > | node, |
Ptr< Packet > | pkt, | ||
Mac8Address | dst ) |
Send a packet from one of the nodes.
node | The sending node |
pkt | The packet |
dst | the 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().
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().
void UanExperiment::SetupApplications | ( | ) |
Set the UAN nodes communication channels.
void UanExperiment::SetupApplications | ( | ) |
Set the UAN nodes communication channels.
void UanExperiment::SetupApplications | ( | ) |
Set the UAN nodes communication channels.
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().
void UanExperiment::SetupCommunications | ( | ) |
Set the UAN nodes communication channels.
void UanExperiment::SetupCommunications | ( | ) |
Set the UAN nodes communication channels.
void UanExperiment::SetupCommunications | ( | ) |
Set the UAN nodes communication channels.
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().
void UanExperiment::SetupEnergy | ( | ) |
Set the UAN nodes energy.
void UanExperiment::SetupEnergy | ( | ) |
Set the UAN nodes energy.
void UanExperiment::SetupEnergy | ( | ) |
Set the UAN nodes energy.
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().
void UanExperiment::SetupPositions | ( | ) |
Set the UAN nodes position.
void UanExperiment::SetupPositions | ( | ) |
Set the UAN nodes position.
void UanExperiment::SetupPositions | ( | ) |
Set the UAN nodes position.
void UanExperiment::Teardown | ( | ) |
Teardown the experiment.
Definition at line 239 of file uan-6lowpan-example.cc.
References m_sockets.
void UanExperiment::Teardown | ( | ) |
Teardown the experiment.
void UanExperiment::Teardown | ( | ) |
Teardown the experiment.
void UanExperiment::Teardown | ( | ) |
Teardown the experiment.
|
private |
UAN nodes.
Definition at line 91 of file uan-6lowpan-example.cc.
Referenced by Prepare(), SendPackets(), SetupApplications(), SetupCommunications(), SetupEnergy(), and SetupPositions().
send and receive sockets
Definition at line 92 of file uan-6lowpan-example.cc.
Referenced by SendSinglePacket(), SendSinglePacket(), SendSinglePacket(), SetupApplications(), and Teardown().