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... | |
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.
UanExperiment::UanExperiment | ( | ) |
Definition at line 107 of file uan-6lowpan-example.cc.
UanExperiment::UanExperiment | ( | ) |
UanExperiment::UanExperiment | ( | ) |
UanExperiment::UanExperiment | ( | ) |
void UanExperiment::Prepare | ( | ) |
Prepare the experiment.
void UanExperiment::Prepare | ( | ) |
Prepare the experiment.
void UanExperiment::Prepare | ( | ) |
Prepare the experiment.
Definition at line 233 of file uan-6lowpan-example.cc.
void UanExperiment::Prepare | ( | ) |
Prepare the experiment.
Print the received packet.
socket | The receiving socket |
Print the received packet.
socket | The receiving socket |
Print the received packet.
socket | The receiving socket |
Print the received packet.
socket | The receiving socket |
Definition at line 167 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().
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::SendPackets | ( | ) |
Send a packet from all the nodes.
Definition at line 204 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::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, | ||
Ipv4Address | dst | ||
) |
Send a packet from one of the nodes.
node | The sending node |
pkt | The packet |
dst | the destination |
Definition at line 217 of file uan-ipv4-example.cc.
References ns3::Simulator::Now(), and NS_LOG_UNCOND.
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 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().
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 225 of file uan-6lowpan-example.cc.
References ns3::Ipv6Address::ConvertFrom(), ns3::Simulator::Now(), and NS_LOG_UNCOND.
Referenced by SendPackets().
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::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::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.
Definition at line 131 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::DeviceEnergyModelHelper::Install(), ns3::InternetStackHelper::Install(), ns3::Seconds(), and ns3::Ipv6AddressHelper::SetBase().
void UanExperiment::SetupCommunications | ( | ) |
Set the UAN nodes communication channels.
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::SetupEnergy | ( | ) |
Set the UAN nodes energy.
Definition at line 123 of file uan-6lowpan-example.cc.
References ns3::EnergySourceHelper::Install(), and ns3::BasicEnergySourceHelper::Set().
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::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().
void UanExperiment::Teardown | ( | ) |
Teardown the experiment.
void UanExperiment::Teardown | ( | ) |
Teardown the experiment.
void UanExperiment::Teardown | ( | ) |
Teardown the experiment.
Definition at line 244 of file uan-6lowpan-example.cc.
void UanExperiment::Teardown | ( | ) |
Teardown the experiment.
|
private |
UAN nodes.
Definition at line 102 of file uan-6lowpan-example.cc.
send and receive sockets
Definition at line 103 of file uan-6lowpan-example.cc.