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, 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 | 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... | |
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 45 of file uan-6lowpan-example.cc.
UanExperiment::UanExperiment | ( | ) |
Definition at line 104 of file uan-6lowpan-example.cc.
UanExperiment::UanExperiment | ( | ) |
UanExperiment::UanExperiment | ( | ) |
UanExperiment::UanExperiment | ( | ) |
void UanExperiment::Prepare | ( | ) |
Prepare the experiment.
Definition at line 237 of file uan-6lowpan-example.cc.
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 166 of file uan-6lowpan-example.cc.
References ns3::Inet6SocketAddress::ConvertFrom(), ns3::Packet::CopyData(), ns3::Socket::GetRxAvailable(), ns3::Inet6SocketAddress::IsMatchingType(), ns3::Simulator::Now(), NS_LOG_UNCOND, and ns3::Socket::RecvFrom().
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 205 of file uan-6lowpan-example.cc.
References ns3::Ipv6InterfaceAddress::GetAddress(), ns3::Ipv6L3Protocol::GetAddress(), ns3::UniformRandomVariable::GetValue(), ns3::Hours(), ns3::Simulator::Schedule(), ns3::Seconds(), and SendSinglePacket().
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 219 of file uan-ipv4-example.cc.
References 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 228 of file uan-6lowpan-example.cc.
References ns3::Ipv6Address::ConvertFrom(), 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 208 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().
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().
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 128 of file uan-6lowpan-example.cc.
References ns3::EnergySourceContainer::Add(), ns3::Ipv6AddressHelper::Assign(), ns3::EnergySourceContainer::Begin(), ns3::Ipv6InterfaceContainer::Begin(), third::channel, ns3::EnergySourceContainer::Get(), ns3::Object::GetObject(), ns3::SixLowPanHelper::Install(), ns3::UanHelper::Install(), ns3::DeviceEnergyModelHelper::Install(), ns3::InternetStackHelper::Install(), ns3::Seconds(), and ns3::Ipv6AddressHelper::SetBase().
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 120 of file uan-6lowpan-example.cc.
References ns3::EnergySourceHelper::Install(), and ns3::BasicEnergySourceHelper::Set().
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 109 of file uan-6lowpan-example.cc.
References ns3::Object::GetObject(), ns3::MobilityHelper::Install(), and ns3::MobilityHelper::SetMobilityModel().
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 248 of file uan-6lowpan-example.cc.
void UanExperiment::Teardown | ( | ) |
Teardown the experiment.
void UanExperiment::Teardown | ( | ) |
Teardown the experiment.
void UanExperiment::Teardown | ( | ) |
Teardown the experiment.
|
private |
UAN nodes.
Definition at line 100 of file uan-6lowpan-example.cc.
send and receive sockets
Definition at line 101 of file uan-6lowpan-example.cc.