A Discrete-Event Network Simulator
API
ns3::SixLowPanHelper Class Reference

Setup a sixlowpan stack to be used as a shim between IPv6 and a generic NetDevice. More...

#include "sixlowpan-helper.h"

+ Collaboration diagram for ns3::SixLowPanHelper:

Public Member Functions

 SixLowPanHelper ()
 
void AddContext (NetDeviceContainer c, uint8_t contextId, Ipv6Prefix context, Time validity)
 Adds a compression Context to a set of NetDevices. More...
 
int64_t AssignStreams (NetDeviceContainer c, int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model. More...
 
NetDeviceContainer Install (NetDeviceContainer c)
 Install the SixLoWPAN stack on top of an existing NetDevice. More...
 
void InvalidateContext (NetDeviceContainer c, uint8_t contextId)
 Invalidates a compression Context in a set of NetDevices. More...
 
void RemoveContext (NetDeviceContainer c, uint8_t contextId)
 Remove a compression Context in a set of NetDevices. More...
 
void RenewContext (NetDeviceContainer c, uint8_t contextId, Time validity)
 Renew a compression Context in a set of NetDevices. More...
 
void SetDeviceAttribute (std::string n1, const AttributeValue &v1)
 Set an attribute on each ns3::SixlowpanNetDevice created by SixlowpanHelper::Install. More...
 

Private Attributes

ObjectFactory m_deviceFactory
 Object factory. More...
 

Detailed Description

Setup a sixlowpan stack to be used as a shim between IPv6 and a generic NetDevice.

Definition at line 40 of file sixlowpan-helper.h.

Constructor & Destructor Documentation

◆ SixLowPanHelper()

ns3::SixLowPanHelper::SixLowPanHelper ( )

Definition at line 35 of file sixlowpan-helper.cc.

References m_deviceFactory, NS_LOG_FUNCTION, and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

Member Function Documentation

◆ AddContext()

void ns3::SixLowPanHelper::AddContext ( NetDeviceContainer  c,
uint8_t  contextId,
Ipv6Prefix  context,
Time  validity 
)

Adds a compression Context to a set of NetDevices.

This function installs one Compression Context on a set of NetDevices. The context is used only in IPHC compression and decompression.

Parameters
[in]cThe NetDevice container.
[in]contextIdThe context id (must be less than 16).
[in]contextThe context prefix.
[in]validitythe context validity time (relative to the actual time).

Definition at line 72 of file sixlowpan-helper.cc.

References ns3::NetDeviceContainer::Get(), ns3::NetDeviceContainer::GetN(), and NS_LOG_FUNCTION.

Referenced by SixlowpanIphcStatefulImplTest::DoRun().

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

◆ AssignStreams()

int64_t ns3::SixLowPanHelper::AssignStreams ( NetDeviceContainer  c,
int64_t  stream 
)

Assign a fixed random variable stream number to the random variables used by this model.

Return the number of streams (possibly zero) that have been assigned. The Install() method should have previously been called by the user.

Parameters
[in]cNetDeviceContainer of the set of net devices for which the SixLowPanNetDevice should be modified to use a fixed stream.
[in]streamFirst stream index to use.
Returns
The number of stream indices assigned by this helper.

Definition at line 139 of file sixlowpan-helper.cc.

References ns3::NetDeviceContainer::Begin(), and ns3::NetDeviceContainer::End().

+ Here is the call graph for this function:

◆ Install()

NetDeviceContainer ns3::SixLowPanHelper::Install ( NetDeviceContainer  c)

Install the SixLoWPAN stack on top of an existing NetDevice.

This function requires a set of properly configured NetDevices passed in as the parameter "c". The new NetDevices will have to be used instead of the original ones. In this way these SixLoWPAN devices will behave as shims between the NetDevices passed in and IPv6.

Note that only IPv6 (and related protocols, such as ICMPv6) can be transmitted over a 6LoWPAN interface. Any other protocol (e.g., IPv4) will be discarded by 6LoWPAN.

Other protocols (e.g., IPv4) could be used on the original NetDevices with some limitations. See the manual for a complete discussion.

Note
IPv6 stack must be installed after SixLoWPAN, using the SixLoWPAN NetDevices. See the example in the examples directory.
Parameters
[in]cThe NetDevice container.
Returns
A container with the newly created SixLowPanNetDevices.

Definition at line 49 of file sixlowpan-helper.cc.

References ns3::NetDeviceContainer::Add(), ns3::Node::AddDevice(), ns3::ObjectFactory::Create(), ns3::NetDeviceContainer::Get(), ns3::Node::GetId(), ns3::NetDeviceContainer::GetN(), m_deviceFactory, NS_ASSERT_MSG, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by SixlowpanIphcStatefulImplTest::DoRun(), and UanExperiment::SetupCommunications().

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

◆ InvalidateContext()

void ns3::SixLowPanHelper::InvalidateContext ( NetDeviceContainer  c,
uint8_t  contextId 
)

Invalidates a compression Context in a set of NetDevices.

An invalid context is used only in IPHC decompression and not in IPHC compression.

This is necessary to avoid that a context reaching its validity lifetime can not be used for decompression whie packets are traveling the network.

Parameters
[in]cThe NetDevice container.
[in]contextIdThe context id (must be less than 16).

Definition at line 107 of file sixlowpan-helper.cc.

References ns3::NetDeviceContainer::Get(), ns3::NetDeviceContainer::GetN(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ RemoveContext()

void ns3::SixLowPanHelper::RemoveContext ( NetDeviceContainer  c,
uint8_t  contextId 
)

Remove a compression Context in a set of NetDevices.

The context is removed immediately from the contexts in the devices.

Parameters
[in]cThe NetDevice container.
[in]contextIdThe context id (must be less than 16).

Definition at line 123 of file sixlowpan-helper.cc.

References ns3::NetDeviceContainer::Get(), ns3::NetDeviceContainer::GetN(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ RenewContext()

void ns3::SixLowPanHelper::RenewContext ( NetDeviceContainer  c,
uint8_t  contextId,
Time  validity 
)

Renew a compression Context in a set of NetDevices.

The context will have its lifetime extended and its validity for compression re-enabled.

Parameters
[in]cThe NetDevice container.
[in]contextIdThe context id (must be less than 16).
[in]validitythe context validity time (relative to the actual time).

Definition at line 91 of file sixlowpan-helper.cc.

References ns3::NetDeviceContainer::Get(), ns3::NetDeviceContainer::GetN(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ SetDeviceAttribute()

void ns3::SixLowPanHelper::SetDeviceAttribute ( std::string  n1,
const AttributeValue v1 
)

Set an attribute on each ns3::SixlowpanNetDevice created by SixlowpanHelper::Install.

Parameters
n1[in] The name of the attribute to set.
v1[in] The value of the attribute to set.

Definition at line 42 of file sixlowpan-helper.cc.

References m_deviceFactory, NS_LOG_FUNCTION, and ns3::ObjectFactory::Set().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_deviceFactory

ObjectFactory ns3::SixLowPanHelper::m_deviceFactory
private

Object factory.

Definition at line 145 of file sixlowpan-helper.h.

Referenced by SixLowPanHelper(), Install(), and SetDeviceAttribute().


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