A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::SixLowPanNetDevice Class Reference

Shim performing 6LoWPAN compression, decompression and fragmentation. More...

#include "sixlowpan-net-device.h"

+ Inheritance diagram for ns3::SixLowPanNetDevice:
+ Collaboration diagram for ns3::SixLowPanNetDevice:

Classes

struct  ContextEntry
 Structure holding the information for a context (used in compression and decompression) More...
 
class  Fragments
 A Set of Fragments. More...
 

Public Types

enum  DropReason {
  DROP_FRAGMENT_TIMEOUT = 1 , DROP_FRAGMENT_BUFFER_FULL , DROP_UNKNOWN_EXTENSION , DROP_DISALLOWED_COMPRESSION ,
  DROP_SATETFUL_DECOMPRESSION_PROBLEM
}
 Enumeration of the dropping reasons in SixLoWPAN. More...
 
typedef void(* DropTracedCallback) (DropReason reason, Ptr< const Packet > packet, Ptr< SixLowPanNetDevice > sixNetDevice, uint32_t ifindex)
 TracedCallback signature for packet drop events.
 
typedef void(* RxTxTracedCallback) (Ptr< const Packet > packet, Ptr< SixLowPanNetDevice > sixNetDevice, uint32_t ifindex)
 TracedCallback signature for packet send/receive events.
 
- Public Types inherited from ns3::NetDevice
typedef void(* LinkChangeTracedCallback) ()
 TracedCallback signature for link changed event.
 
enum  PacketType {
  PACKET_HOST = 1 , NS3_PACKET_HOST = PACKET_HOST , PACKET_BROADCAST , NS3_PACKET_BROADCAST = PACKET_BROADCAST ,
  PACKET_MULTICAST , NS3_PACKET_MULTICAST = PACKET_MULTICAST , PACKET_OTHERHOST , NS3_PACKET_OTHERHOST = PACKET_OTHERHOST
}
 Packet types are used as they are in Linux. More...
 
typedef Callback< bool, Ptr< NetDevice >, Ptr< const Packet >, uint16_t, const Address &, const Address &, PacketTypePromiscReceiveCallback
 
typedef Callback< bool, Ptr< NetDevice >, Ptr< const Packet >, uint16_t, const Address & > ReceiveCallback
 

Public Member Functions

 SixLowPanNetDevice ()
 Constructor for the SixLowPanNetDevice.
 
 SixLowPanNetDevice (const SixLowPanNetDevice &)=delete
 
void AddContext (uint8_t contextId, Ipv6Prefix contextPrefix, bool compressionAllowed, Time validLifetime)
 Add, remove, or update a context used in IPHC stateful compression.
 
void AddLinkChangeCallback (Callback< void > callback) override
 
int64_t AssignStreams (int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model.
 
Address GetAddress () const override
 
Address GetBroadcast () const override
 
Ptr< ChannelGetChannel () const override
 
bool GetContext (uint8_t contextId, Ipv6Prefix &contextPrefix, bool &compressionAllowed, Time &validLifetime)
 Get a context used in IPHC stateful compression.
 
uint32_t GetIfIndex () const override
 
uint16_t GetMtu () const override
 Returns the link-layer MTU for this interface.
 
Address GetMulticast (Ipv4Address multicastGroup) const override
 Make and return a MAC multicast address using the provided multicast group.
 
Address GetMulticast (Ipv6Address addr) const override
 Get the MAC multicast address corresponding to the IPv6 address provided.
 
Ptr< NetDeviceGetNetDevice () const
 Returns a smart pointer to the underlying NetDevice.
 
Ptr< NodeGetNode () const override
 
void InvalidateContext (uint8_t contextId)
 Invalidate a context used in IPHC stateful compression.
 
bool IsBridge () const override
 Return true if the net device is acting as a bridge.
 
bool IsBroadcast () const override
 
bool IsLinkUp () const override
 
bool IsMulticast () const override
 
bool IsPointToPoint () const override
 Return true if the net device is on a point-to-point link.
 
bool NeedsArp () const override
 
SixLowPanNetDeviceoperator= (const SixLowPanNetDevice &)=delete
 
void RemoveContext (uint8_t contextId)
 Remove a context used in IPHC stateful compression.
 
void RenewContext (uint8_t contextId, Time validLifetime)
 Renew a context used in IPHC stateful compression.
 
bool Send (Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber) override
 
bool SendFrom (Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber) override
 
void SetAddress (Address address) override
 Set the address of this interface.
 
void SetIfIndex (const uint32_t index) override
 
bool SetMtu (const uint16_t mtu) override
 
void SetNetDevice (Ptr< NetDevice > device)
 Setup SixLowPan to be a proxy for the specified NetDevice.
 
void SetNode (Ptr< Node > node) override
 
void SetPromiscReceiveCallback (NetDevice::PromiscReceiveCallback cb) override
 
void SetReceiveCallback (NetDevice::ReceiveCallback cb) override
 
bool SupportsSendFrom () const override
 
- Public Member Functions inherited from ns3::NetDevice
 ~NetDevice () override
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const override
 Get the most derived TypeId for this Object.
 
template<typename T >
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::NetDevice
static TypeId GetTypeId ()
 Get the type ID.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Static Public Attributes

static constexpr uint16_t PROT_NUMBER {0xA0ED}
 The protocol number for 6LoWPAN (0xA0ED) - see RFC 7973 .
 

Protected Member Functions

void DoDispose () override
 Destructor implementation.
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

Private Types

typedef std::pair< std::pair< Address, Address >, std::pair< uint16_t, uint16_t > > FragmentKey_t
 Fragment identifier type: src/dst address src/dst port.
 
typedef std::list< std::tuple< Time, FragmentKey_t, uint32_t > > FragmentsTimeoutsList_t
 Container for fragment timeouts.
 
typedef std::list< std::tuple< Time, FragmentKey_t, uint32_t > >::iterator FragmentsTimeoutsListI_t
 Container Iterator for fragment timeouts.
 
typedef std::map< FragmentKey_t, Ptr< Fragments > > MapFragments_t
 Container for fragment key -> fragments.
 
typedef std::map< FragmentKey_t, Ptr< Fragments > >::iterator MapFragmentsI_t
 Container Iterator for fragment key -> fragments.
 

Private Member Functions

bool CanCompressLowPanNhc (uint8_t headerType)
 Checks if the next header can be compressed using NHC.
 
Ipv6Address CleanPrefix (Ipv6Address address, Ipv6Prefix prefix)
 Clean an address from its prefix.
 
uint32_t CompressLowPanHc1 (Ptr< Packet > packet, const Address &src, const Address &dst)
 Compress the headers according to HC1 compression.
 
uint32_t CompressLowPanIphc (Ptr< Packet > packet, const Address &src, const Address &dst)
 Compress the headers according to IPHC compression.
 
uint32_t CompressLowPanNhc (Ptr< Packet > packet, uint8_t headerType, const Address &src, const Address &dst)
 Compress the headers according to NHC compression.
 
uint32_t CompressLowPanUdpNhc (Ptr< Packet > packet, bool omitChecksum)
 Compress the headers according to NHC compression.
 
void DecompressLowPanHc1 (Ptr< Packet > packet, const Address &src, const Address &dst)
 Decompress the headers according to HC1 compression.
 
bool DecompressLowPanIphc (Ptr< Packet > packet, const Address &src, const Address &dst)
 Decompress the headers according to IPHC compression.
 
std::pair< uint8_t, bool > DecompressLowPanNhc (Ptr< Packet > packet, const Address &src, const Address &dst, Ipv6Address srcAddress, Ipv6Address dstAddress)
 Decompress the headers according to NHC compression.
 
void DecompressLowPanUdpNhc (Ptr< Packet > packet, Ipv6Address saddr, Ipv6Address daddr)
 Decompress the headers according to NHC compression.
 
void DoFragmentation (Ptr< Packet > packet, uint32_t origPacketSize, uint32_t origHdrSize, uint32_t extraHdrSize, std::list< Ptr< Packet > > &listFragments)
 Performs a packet fragmentation.
 
bool DoSend (Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber, bool doSendFrom)
 
void DropOldestFragmentSet ()
 Drops the oldest fragment set.
 
bool FindMulticastCompressionContext (Ipv6Address address, uint8_t &contextId)
 Finds if the given multicast address matches a context for compression.
 
bool FindUnicastCompressionContext (Ipv6Address address, uint8_t &contextId)
 Finds if the given unicast address matches a context for compression.
 
Address Get16MacFrom48Mac (Address addr)
 Get a Mac16 from its Mac48 pseudo-MAC.
 
void HandleFragmentsTimeout (FragmentKey_t key, uint32_t iif)
 Process the timeout for packet fragments.
 
void HandleTimeout ()
 Handles a fragmented packet timeout.
 
bool ProcessFragment (Ptr< Packet > &packet, const Address &src, const Address &dst, bool isFirst)
 Process a packet fragment.
 
void ReceiveFromDevice (Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, const Address &source, const Address &destination, PacketType packetType)
 Receives all the packets from a NetDevice for further processing.
 
FragmentsTimeoutsListI_t SetTimeout (FragmentKey_t key, uint32_t iif)
 Set a new timeout "event" for a fragmented packet.
 

Private Attributes

uint8_t m_bc0Serial
 Serial number used in BC0 header.
 
uint32_t m_compressionThreshold
 Minimum L2 payload size.
 
std::map< uint8_t, ContextEntrym_contextTable
 Table of the contexts used in compression/decompression.
 
TracedCallback< DropReason, Ptr< const Packet >, Ptr< SixLowPanNetDevice >, uint32_tm_dropTrace
 Callback to trace drop packets.
 
Time m_fragmentExpirationTimeout
 Time limit for fragment rebuilding.
 
uint16_t m_fragmentReassemblyListSize
 How many packets can be rebuilt at the same time.
 
MapFragments_t m_fragments
 Fragments hold to be rebuilt.
 
uint32_t m_ifIndex
 Interface index.
 
uint16_t m_meshCacheLength
 length of the cache for each source.
 
bool m_meshUnder
 Use a mesh-under routing.
 
uint8_t m_meshUnderHopsLeft
 Start value for mesh-under hops left.
 
Ptr< RandomVariableStreamm_meshUnderJitter
 Random variable for the mesh-under packet retransmission.
 
Ptr< NetDevicem_netDevice
 Smart pointer to the underlying NetDevice.
 
Ptr< Nodem_node
 Smart pointer to the Node.
 
bool m_omitUdpChecksum
 Omit UDP checksum in NC1 encoding.
 
NetDevice::PromiscReceiveCallback m_promiscRxCallback
 The callback used to notify higher layers that a packet has been received in promiscuous mode.
 
Ptr< UniformRandomVariablem_rng
 Rng for the fragments tag.
 
NetDevice::ReceiveCallback m_rxCallback
 The callback used to notify higher layers that a packet has been received.
 
TracedCallback< Ptr< const Packet >, Ptr< SixLowPanNetDevice >, uint32_tm_rxTrace
 Callback to trace RX (reception) packets.
 
std::map< Address, std::list< uint8_t > > m_seenPkts
 Seen packets, memorized by OriginatorAddress, SequenceNumber.
 
EventId m_timeoutEvent
 Event for the next scheduled timeout.
 
FragmentsTimeoutsList_t m_timeoutEventList
 Timeout "events" container.
 
TracedCallback< Ptr< const Packet >, Ptr< SixLowPanNetDevice >, uint32_tm_txTrace
 Callback to trace TX (transmission) packets.
 
bool m_useIphc
 Use IPHC or HC1.
 

Additional Inherited Members

Detailed Description

Shim performing 6LoWPAN compression, decompression and fragmentation.

This class implements the shim between IPv6 and a generic NetDevice, performing packet compression, decompression and fragmentation in a transparent way. To this end, the class pretend to be a normal NetDevice, masquerading some functions of the underlying NetDevice.

Config Paths

ns3::SixLowPanNetDevice is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/DeviceList/[i]/$ns3::SixLowPanNetDevice"

Attributes

  • CompressionThreshold: The minimum MAC layer payload size.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint32_t 0:4294967295
    • Initial value: 0
    • Flags: constructwriteread
    • Support level: SUPPORTED
  • FragmentExpirationTimeout: When this timeout expires, the fragments will be cleared from the buffer.
    • Set with class: ns3::TimeValue
    • Underlying type: Time -9.22337e+18ns:+9.22337e+18ns
    • Initial value: +6e+10ns
    • Flags: constructwriteread
    • Support level: SUPPORTED
  • FragmentReassemblyListSize: The maximum size of the reassembly buffer (in packets). Zero meaning infinite.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint16_t 0:65535
    • Initial value: 0
    • Flags: constructwriteread
    • Support level: SUPPORTED
  • MeshCacheLength: Length of the cache for each source.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint16_t 0:65535
    • Initial value: 10
    • Flags: constructwriteread
    • Support level: SUPPORTED
  • MeshUnderJitter: The jitter in ms a node uses to forward mesh-under packets - used to prevent collisions
  • MeshUnderRadius: Hops Left to use in mesh-under.
    • Set with class: ns3::UintegerValue
    • Underlying type: uint8_t 0:255
    • Initial value: 10
    • Flags: constructwriteread
    • Support level: SUPPORTED
  • OmitUdpChecksum: Omit the UDP checksum in IPHC compression.
    • Set with class: ns3::BooleanValue
    • Underlying type: bool
    • Initial value: true
    • Flags: constructwriteread
    • Support level: SUPPORTED
  • Rfc6282: Use RFC6282 (IPHC) if true, RFC4944 (HC1) otherwise.
    • Set with class: ns3::BooleanValue
    • Underlying type: bool
    • Initial value: true
    • Flags: constructwriteread
    • Support level: SUPPORTED
  • UseMeshUnder: Use a mesh-under routing protocol.
    • Set with class: ns3::BooleanValue
    • Underlying type: bool
    • Initial value: false
    • Flags: constructwriteread
    • Support level: SUPPORTED

TraceSources

Group: SixLowPan

Size of this type is 400 bytes (on a 64-bit architecture).

Definition at line 61 of file sixlowpan-net-device.h.

Member Typedef Documentation

◆ DropTracedCallback

typedef void(* ns3::SixLowPanNetDevice::DropTracedCallback) (DropReason reason, Ptr< const Packet > packet, Ptr< SixLowPanNetDevice > sixNetDevice, uint32_t ifindex)

TracedCallback signature for packet drop events.

Parameters
[in]reasonThe reason for the drop.
[in]packetThe packet.
[in]sixNetDeviceThe SixLowPanNetDevice.
[in]ifindexThe ifindex of the device.
Deprecated
The non-const Ptr<SixLowPanNetDevice> argument is deprecated and will be changed to Ptr<const SixLowPanNetDevice> in a future release.

Definition at line 187 of file sixlowpan-net-device.h.

◆ FragmentKey_t

typedef std::pair<std::pair<Address, Address>, std::pair<uint16_t, uint16_t> > ns3::SixLowPanNetDevice::FragmentKey_t
private

Fragment identifier type: src/dst address src/dst port.

Definition at line 436 of file sixlowpan-net-device.h.

◆ FragmentsTimeoutsList_t

Container for fragment timeouts.

Definition at line 439 of file sixlowpan-net-device.h.

◆ FragmentsTimeoutsListI_t

typedef std::list<std::tuple<Time,FragmentKey_t,uint32_t>>::iterator ns3::SixLowPanNetDevice::FragmentsTimeoutsListI_t
private

Container Iterator for fragment timeouts.

Definition at line 441 of file sixlowpan-net-device.h.

◆ MapFragments_t

Container for fragment key -> fragments.

Definition at line 598 of file sixlowpan-net-device.h.

◆ MapFragmentsI_t

Container Iterator for fragment key -> fragments.

Definition at line 602 of file sixlowpan-net-device.h.

◆ RxTxTracedCallback

typedef void(* ns3::SixLowPanNetDevice::RxTxTracedCallback) (Ptr< const Packet > packet, Ptr< SixLowPanNetDevice > sixNetDevice, uint32_t ifindex)

TracedCallback signature for packet send/receive events.

Parameters
[in]packetThe packet.
[in]sixNetDeviceThe SixLowPanNetDevice.
[in]ifindexThe ifindex of the device.
Deprecated
The non-const Ptr<SixLowPanNetDevice> argument is deprecated and will be changed to Ptr<const SixLowPanNetDevice> in a future release.

Definition at line 171 of file sixlowpan-net-device.h.

Member Enumeration Documentation

◆ DropReason

Enumeration of the dropping reasons in SixLoWPAN.

Enumerator
DROP_FRAGMENT_TIMEOUT 

Fragment timeout exceeded.

DROP_FRAGMENT_BUFFER_FULL 

Fragment buffer size exceeded.

DROP_UNKNOWN_EXTENSION 

Unsupported compression kind.

DROP_DISALLOWED_COMPRESSION 

HC1 while in IPHC mode or vice-versa.

DROP_SATETFUL_DECOMPRESSION_PROBLEM 

Decompression failed due to missing or expired context.

Definition at line 67 of file sixlowpan-net-device.h.

Constructor & Destructor Documentation

◆ SixLowPanNetDevice() [1/2]

ns3::SixLowPanNetDevice::SixLowPanNetDevice ( )

Constructor for the SixLowPanNetDevice.

Definition at line 114 of file sixlowpan-net-device.cc.

References ns3::CreateObject(), m_bc0Serial, m_netDevice, m_rng, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ SixLowPanNetDevice() [2/2]

ns3::SixLowPanNetDevice::SixLowPanNetDevice ( const SixLowPanNetDevice & )
delete

Member Function Documentation

◆ AddContext()

void ns3::SixLowPanNetDevice::AddContext ( uint8_t contextId,
Ipv6Prefix contextPrefix,
bool compressionAllowed,
Time validLifetime )

Add, remove, or update a context used in IPHC stateful compression.

A context with a zero validLifetime will be immediately removed.

Parameters
[in]contextIdcontext id (most be between 0 and 15 included).
[in]contextPrefixcontext prefix to be used in compression/decompression.
[in]compressionAllowedcompression and decompression allowed (true), decompression only (false).
[in]validLifetimevalidity time (relative to the actual time).

Definition at line 2721 of file sixlowpan-net-device.cc.

References ns3::Time::As(), ns3::Ipv6Address::GetOnes(), ns3::Time::IsZero(), m_contextTable, ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_LOGIC, and ns3::Time::S.

+ Here is the call graph for this function:

◆ AddLinkChangeCallback()

void ns3::SixLowPanNetDevice::AddLinkChangeCallback ( Callback< void > callback)
overridevirtual
Parameters
callbackthe callback to invoke

Add a callback invoked whenever the link status changes to UP. This callback is typically used by the IP/ARP layer to flush the ARP cache and by IPv6 stack to flush NDISC cache whenever the link goes up.

Implements ns3::NetDevice.

Definition at line 467 of file sixlowpan-net-device.cc.

References m_netDevice, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

◆ AssignStreams()

int64_t ns3::SixLowPanNetDevice::AssignStreams ( 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.

Parameters
[in]streamFirst stream index to use.
Returns
the number of stream indices assigned by this model.

Definition at line 155 of file sixlowpan-net-device.cc.

References m_meshUnderJitter, m_rng, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().

+ Here is the call graph for this function:

◆ CanCompressLowPanNhc()

bool ns3::SixLowPanNetDevice::CanCompressLowPanNhc ( uint8_t headerType)
private

Checks if the next header can be compressed using NHC.

Parameters
[in]headerTypeThe header kind to be compressed.
Returns
True if the header can be compressed.

Definition at line 1348 of file sixlowpan-net-device.cc.

References ns3::Ipv6Header::IPV6_EXT_FRAGMENTATION, ns3::Ipv6Header::IPV6_EXT_HOP_BY_HOP, ns3::Ipv6Header::IPV6_EXT_MOBILITY, ns3::Ipv6Header::IPV6_EXT_ROUTING, ns3::Ipv6Header::IPV6_IPV6, and ns3::Ipv6Header::IPV6_UDP.

Referenced by CompressLowPanIphc(), and CompressLowPanNhc().

+ Here is the caller graph for this function:

◆ CleanPrefix()

Ipv6Address ns3::SixLowPanNetDevice::CleanPrefix ( Ipv6Address address,
Ipv6Prefix prefix )
private

Clean an address from its prefix.

This function is used to find the relevant bits to be sent in stateful IPHC compression. Only the prefix length is used - the address prefix is assumed to be matching the prefix.

Parameters
addressthe address to be cleaned
prefixthe prefix to remove
Returns
An address with the prefix zeroed.

Definition at line 2904 of file sixlowpan-net-device.cc.

References ns3::Ipv6Address::Deserialize(), and ns3::Ipv6Prefix::GetPrefixLength().

Referenced by CompressLowPanIphc().

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

◆ CompressLowPanHc1()

uint32_t ns3::SixLowPanNetDevice::CompressLowPanHc1 ( Ptr< Packet > packet,
const Address & src,
const Address & dst )
private

Compress the headers according to HC1 compression.

Parameters
[in]packetThe packet to be compressed.
[in]srcThe MAC source address.
[in]dstThe MAC destination address.
Returns
The size of the removed headers.

Definition at line 742 of file sixlowpan-net-device.cc.

References ns3::Ipv6Address::GetBytes(), ns3::Ipv6Header::GetDestination(), ns3::Ipv6Header::GetFlowLabel(), ns3::Ipv6Header::GetHopLimit(), ns3::Ipv6Header::GetNextHeader(), ns3::Ipv6Header::GetSerializedSize(), ns3::SixLowPanHc1::GetSerializedSize(), ns3::Ipv6Header::GetSource(), ns3::Ipv6Header::GetTrafficClass(), ns3::SixLowPanHc1::HC1_PCIC, ns3::SixLowPanHc1::HC1_PCII, ns3::SixLowPanHc1::HC1_PIIC, ns3::SixLowPanHc1::HC1_PIII, ns3::Ipv6Address::IsLinkLocal(), ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(), NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::SixLowPanHc1::SetDstCompression(), ns3::SixLowPanHc1::SetDstInterface(), ns3::SixLowPanHc1::SetDstPrefix(), ns3::SixLowPanHc1::SetFlowLabel(), ns3::SixLowPanHc1::SetHc2HeaderPresent(), ns3::SixLowPanHc1::SetHopLimit(), ns3::SixLowPanHc1::SetNextHeader(), ns3::SixLowPanHc1::SetSrcCompression(), ns3::SixLowPanHc1::SetSrcInterface(), ns3::SixLowPanHc1::SetSrcPrefix(), ns3::SixLowPanHc1::SetTcflCompression(), and ns3::SixLowPanHc1::SetTrafficClass().

Referenced by DoSend().

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

◆ CompressLowPanIphc()

uint32_t ns3::SixLowPanNetDevice::CompressLowPanIphc ( Ptr< Packet > packet,
const Address & src,
const Address & dst )
private

Compress the headers according to IPHC compression.

Parameters
[in]packetThe packet to be compressed.
[in]srcThe MAC source address.
[in]dstThe MAC destination address.
Returns
The size of the removed headers.

Definition at line 967 of file sixlowpan-net-device.cc.

References CanCompressLowPanNhc(), CleanPrefix(), CompressLowPanIphc(), CompressLowPanNhc(), CompressLowPanUdpNhc(), FindMulticastCompressionContext(), FindUnicastCompressionContext(), ns3::Ipv6Address::GetAny(), ns3::Ipv6Address::GetBytes(), ns3::Ipv6Header::GetDestination(), ns3::Ipv6Header::GetFlowLabel(), ns3::Ipv6Header::GetHopLimit(), ns3::SixLowPanIphc::GetM(), ns3::Ipv6Header::GetNextHeader(), ns3::Ipv6Header::GetSerializedSize(), ns3::SixLowPanIphc::GetSerializedSize(), ns3::Ipv6Header::GetSource(), ns3::Ipv6Header::GetTrafficClass(), ns3::SixLowPanIphc::HC_COMPR_0, ns3::SixLowPanIphc::HC_COMPR_16, ns3::SixLowPanIphc::HC_COMPR_64, ns3::SixLowPanIphc::HC_INLINE, ns3::SixLowPanIphc::HLIM_COMPR_1, ns3::SixLowPanIphc::HLIM_COMPR_255, ns3::SixLowPanIphc::HLIM_COMPR_64, ns3::SixLowPanIphc::HLIM_INLINE, ns3::Ipv6Header::IPV6_IPV6, ns3::Ipv6Header::IPV6_UDP, ns3::Ipv6Address::IsLinkLocal(), ns3::Ipv6Address::IsMulticast(), m_contextTable, m_omitUdpChecksum, ns3::Ipv6Address::MakeAutoconfiguredAddress(), ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(), NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Ipv6Address::Serialize(), ns3::SixLowPanIphc::SetCid(), ns3::SixLowPanIphc::SetDac(), ns3::SixLowPanIphc::SetDam(), ns3::SixLowPanIphc::SetDscp(), ns3::SixLowPanIphc::SetDstContextId(), ns3::SixLowPanIphc::SetDstInlinePart(), ns3::SixLowPanIphc::SetEcn(), ns3::SixLowPanIphc::SetFlowLabel(), ns3::SixLowPanIphc::SetHlim(), ns3::SixLowPanIphc::SetHopLimit(), ns3::SixLowPanIphc::SetM(), ns3::SixLowPanIphc::SetNextHeader(), ns3::SixLowPanIphc::SetNh(), ns3::SixLowPanIphc::SetSac(), ns3::SixLowPanIphc::SetSam(), ns3::SixLowPanIphc::SetSrcContextId(), ns3::SixLowPanIphc::SetSrcInlinePart(), ns3::SixLowPanIphc::SetTf(), ns3::SixLowPanIphc::TF_DSCP_ELIDED, ns3::SixLowPanIphc::TF_ELIDED, ns3::SixLowPanIphc::TF_FL_ELIDED, and ns3::SixLowPanIphc::TF_FULL.

Referenced by CompressLowPanIphc(), CompressLowPanNhc(), and DoSend().

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

◆ CompressLowPanNhc()

uint32_t ns3::SixLowPanNetDevice::CompressLowPanNhc ( Ptr< Packet > packet,
uint8_t headerType,
const Address & src,
const Address & dst )
private

Compress the headers according to NHC compression.

Parameters
[in]packetThe packet to be compressed.
[in]headerTypeThe header type.
[in]srcThe MAC source address.
[in]dstThe MAC destination address.
Returns
The size of the removed headers.

Definition at line 1701 of file sixlowpan-net-device.cc.

References ns3::Buffer::AddAtStart(), ns3::Buffer::Begin(), CanCompressLowPanNhc(), CompressLowPanIphc(), CompressLowPanNhc(), CompressLowPanUdpNhc(), ns3::SixLowPanNhcExtension::EID_DESTINATION_OPTIONS_H, ns3::SixLowPanNhcExtension::EID_FRAGMENTATION_H, ns3::SixLowPanNhcExtension::EID_HOPBYHOP_OPTIONS_H, ns3::SixLowPanNhcExtension::EID_ROUTING_H, ns3::Ipv6ExtensionHeader::GetLength(), ns3::Ipv6ExtensionHeader::GetNextHeader(), ns3::Ipv6ExtensionDestinationHeader::GetSerializedSize(), ns3::Ipv6ExtensionFragmentHeader::GetSerializedSize(), ns3::Ipv6ExtensionHopByHopHeader::GetSerializedSize(), ns3::Ipv6ExtensionRoutingHeader::GetSerializedSize(), ns3::SixLowPanNhcExtension::GetSerializedSize(), ns3::Buffer::GetSize(), ns3::Ipv6Header::IPV6_EXT_DESTINATION, ns3::Ipv6Header::IPV6_EXT_FRAGMENTATION, ns3::Ipv6Header::IPV6_EXT_HOP_BY_HOP, ns3::Ipv6Header::IPV6_EXT_MOBILITY, ns3::Ipv6Header::IPV6_EXT_ROUTING, ns3::Ipv6Header::IPV6_IPV6, ns3::Ipv6Header::IPV6_UDP, m_omitUdpChecksum, NS_ABORT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Buffer::PeekData(), ns3::Buffer::RemoveAtStart(), ns3::Ipv6ExtensionDestinationHeader::Serialize(), ns3::Ipv6ExtensionFragmentHeader::Serialize(), ns3::Ipv6ExtensionHopByHopHeader::Serialize(), ns3::Ipv6ExtensionRoutingHeader::Serialize(), ns3::SixLowPanNhcExtension::SetBlob(), ns3::SixLowPanNhcExtension::SetEid(), ns3::SixLowPanNhcExtension::SetNextHeader(), and ns3::SixLowPanNhcExtension::SetNh().

Referenced by CompressLowPanIphc(), and CompressLowPanNhc().

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

◆ CompressLowPanUdpNhc()

uint32_t ns3::SixLowPanNetDevice::CompressLowPanUdpNhc ( Ptr< Packet > packet,
bool omitChecksum )
private

Compress the headers according to NHC compression.

Parameters
[in]packetThe packet to be compressed.
[in]omitChecksumOmit UDP checksum (if true).
Returns
The size of the removed headers.

Definition at line 2187 of file sixlowpan-net-device.cc.

References ns3::UdpHeader::GetChecksum(), ns3::UdpHeader::GetDestinationPort(), ns3::SixLowPanUdpNhcExtension::GetSerializedSize(), ns3::UdpHeader::GetSourcePort(), ns3::UdpHeader::IsChecksumOk(), NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::SixLowPanUdpNhcExtension::PORTS_ALL_SRC_LAST_DST, ns3::SixLowPanUdpNhcExtension::PORTS_INLINE, ns3::SixLowPanUdpNhcExtension::PORTS_LAST_SRC_ALL_DST, ns3::SixLowPanUdpNhcExtension::PORTS_LAST_SRC_LAST_DST, ns3::SixLowPanUdpNhcExtension::SetC(), ns3::SixLowPanUdpNhcExtension::SetChecksum(), ns3::SixLowPanUdpNhcExtension::SetDstPort(), ns3::SixLowPanUdpNhcExtension::SetPorts(), and ns3::SixLowPanUdpNhcExtension::SetSrcPort().

Referenced by CompressLowPanIphc(), and CompressLowPanNhc().

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

◆ DecompressLowPanHc1()

void ns3::SixLowPanNetDevice::DecompressLowPanHc1 ( Ptr< Packet > packet,
const Address & src,
const Address & dst )
private

Decompress the headers according to HC1 compression.

Parameters
[in]packetthe packet to be compressed.
[in]srcthe MAC source address.
[in]dstthe MAC destination address.

Definition at line 850 of file sixlowpan-net-device.cc.

References ns3::SixLowPanHc1::HC1_PCIC, ns3::SixLowPanHc1::HC1_PCII, ns3::SixLowPanHc1::HC1_PIIC, ns3::SixLowPanHc1::HC1_PIII, ns3::Ipv6Address::MakeAutoconfiguredAddress(), ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(), NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, ns3::Ipv6Header::SetDestination(), ns3::Ipv6Header::SetFlowLabel(), ns3::Ipv6Header::SetHopLimit(), ns3::Ipv6Header::SetNextHeader(), ns3::Ipv6Header::SetPayloadLength(), ns3::Ipv6Header::SetSource(), and ns3::Ipv6Header::SetTrafficClass().

Referenced by ProcessFragment(), and ReceiveFromDevice().

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

◆ DecompressLowPanIphc()

bool ns3::SixLowPanNetDevice::DecompressLowPanIphc ( Ptr< Packet > packet,
const Address & src,
const Address & dst )
private

Decompress the headers according to IPHC compression.

Parameters
[in]packetThe packet to be compressed.
[in]srcThe MAC source address.
[in]dstThe MAC destination address.
Returns
true if the packet can not be decompressed due to wrong context information.

Definition at line 1369 of file sixlowpan-net-device.cc.

References DecompressLowPanNhc(), DecompressLowPanUdpNhc(), ns3::Ipv6Address::Deserialize(), ns3::Ipv6Address::GetAny(), ns3::Ipv6Address::GetBytes(), ns3::Ipv6Header::GetDestination(), ns3::SixLowPanDispatch::GetNhcDispatchType(), ns3::Ipv6Header::GetSource(), ns3::SixLowPanIphc::HC_COMPR_0, ns3::SixLowPanIphc::HC_COMPR_16, ns3::SixLowPanIphc::HC_COMPR_64, ns3::SixLowPanIphc::HC_INLINE, ns3::Ipv6Header::IPV6_UDP, ns3::SixLowPanDispatch::LOWPAN_UDPNHC, m_contextTable, ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(), ns3::Simulator::Now(), NS_ABORT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Ipv6Header::SetDestination(), ns3::Ipv6Header::SetFlowLabel(), ns3::Ipv6Header::SetHopLimit(), ns3::Ipv6Header::SetNextHeader(), ns3::Ipv6Header::SetPayloadLength(), ns3::Ipv6Header::SetSource(), ns3::Ipv6Header::SetTrafficClass(), ns3::SixLowPanIphc::TF_DSCP_ELIDED, ns3::SixLowPanIphc::TF_ELIDED, ns3::SixLowPanIphc::TF_FL_ELIDED, and ns3::SixLowPanIphc::TF_FULL.

Referenced by DecompressLowPanNhc(), ProcessFragment(), and ReceiveFromDevice().

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

◆ DecompressLowPanNhc()

std::pair< uint8_t, bool > ns3::SixLowPanNetDevice::DecompressLowPanNhc ( Ptr< Packet > packet,
const Address & src,
const Address & dst,
Ipv6Address srcAddress,
Ipv6Address dstAddress )
private

Decompress the headers according to NHC compression.

Parameters
[in]packetThe packet to be compressed.
[in]srcThe MAC source address.
[in]dstThe MAC destination address.
[in]srcAddressThe IPv6 source address.
[in]dstAddressThe IPv6 destination address.
Returns
A std::pair containing the decompressed header type and a flag - true if the packet can not be decompressed due to wrong context information.

Definition at line 1967 of file sixlowpan-net-device.cc.

References ns3::Buffer::AddAtStart(), ns3::Buffer::Begin(), DecompressLowPanIphc(), DecompressLowPanNhc(), DecompressLowPanUdpNhc(), ns3::Ipv6ExtensionDestinationHeader::Deserialize(), ns3::Ipv6ExtensionFragmentHeader::Deserialize(), ns3::Ipv6ExtensionHopByHopHeader::Deserialize(), ns3::Ipv6ExtensionRoutingHeader::Deserialize(), DROP_SATETFUL_DECOMPRESSION_PROBLEM, ns3::SixLowPanNhcExtension::EID_DESTINATION_OPTIONS_H, ns3::SixLowPanNhcExtension::EID_FRAGMENTATION_H, ns3::SixLowPanNhcExtension::EID_HOPBYHOP_OPTIONS_H, ns3::SixLowPanNhcExtension::EID_IPv6_H, ns3::SixLowPanNhcExtension::EID_MOBILITY_H, ns3::SixLowPanNhcExtension::EID_ROUTING_H, GetIfIndex(), ns3::SixLowPanDispatch::GetNhcDispatchType(), ns3::Ipv6Header::IPV6_EXT_DESTINATION, ns3::Ipv6Header::IPV6_EXT_FRAGMENTATION, ns3::Ipv6Header::IPV6_EXT_HOP_BY_HOP, ns3::Ipv6Header::IPV6_EXT_ROUTING, ns3::Ipv6Header::IPV6_IPV6, ns3::Ipv6Header::IPV6_UDP, ns3::SixLowPanDispatch::LOWPAN_UDPNHC, m_dropTrace, NS_ABORT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Buffer::Iterator::Write().

Referenced by DecompressLowPanIphc(), and DecompressLowPanNhc().

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

◆ DecompressLowPanUdpNhc()

void ns3::SixLowPanNetDevice::DecompressLowPanUdpNhc ( Ptr< Packet > packet,
Ipv6Address saddr,
Ipv6Address daddr )
private

Decompress the headers according to NHC compression.

Parameters
[in]packetThe packet to be compressed.
[in]saddrThe IPv6 source address.
[in]daddrThe IPv6 destination address.

Definition at line 2245 of file sixlowpan-net-device.cc.

References ns3::Node::ChecksumEnabled(), ns3::UdpHeader::EnableChecksums(), ns3::UdpHeader::ForceChecksum(), ns3::UdpHeader::InitializeChecksum(), ns3::UdpHeader::IsChecksumOk(), NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::SixLowPanUdpNhcExtension::PORTS_ALL_SRC_LAST_DST, ns3::SixLowPanUdpNhcExtension::PORTS_INLINE, ns3::SixLowPanUdpNhcExtension::PORTS_LAST_SRC_ALL_DST, ns3::SixLowPanUdpNhcExtension::PORTS_LAST_SRC_LAST_DST, ns3::UdpL4Protocol::PROT_NUMBER, ns3::UdpHeader::SetDestinationPort(), and ns3::UdpHeader::SetSourcePort().

Referenced by DecompressLowPanIphc(), and DecompressLowPanNhc().

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

◆ DoDispose()

void ns3::SixLowPanNetDevice::DoDispose ( )
overrideprotectedvirtual

Destructor implementation.

This method is called by Dispose() or by the Object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overridden version of this method and chain up to their parent's implementation once they are done. i.e, for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose() method.

It is safe to call GetObject() from within this method.

Reimplemented from ns3::Object.

Definition at line 164 of file sixlowpan-net-device.cc.

References ns3::EventId::Cancel(), ns3::Object::DoDispose(), ns3::EventId::IsPending(), m_fragments, m_netDevice, m_node, m_timeoutEvent, m_timeoutEventList, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ DoFragmentation()

void ns3::SixLowPanNetDevice::DoFragmentation ( Ptr< Packet > packet,
uint32_t origPacketSize,
uint32_t origHdrSize,
uint32_t extraHdrSize,
std::list< Ptr< Packet > > & listFragments )
private

Performs a packet fragmentation.

Parameters
[in]packetthe packet to be fragmented (with headers already compressed with 6LoWPAN).
[in]origPacketSizethe size of the IP packet before the 6LoWPAN header compression, including the IP/L4 headers.
[in]origHdrSizethe size of the IP header before the 6LoWPAN header compression.
[in]extraHdrSizethe sum of the sizes of BC0 header and MESH header if mesh routing is used or 0.
[out]listFragmentsA reference to the list of the resulting packets, all with the proper headers in place.

Definition at line 2308 of file sixlowpan-net-device.cc.

References ns3::SixLowPanFrag1::GetSerializedSize(), ns3::SixLowPanFragN::GetSerializedSize(), m_netDevice, m_rng, NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_LOGIC, packetSize, ns3::SixLowPanFragN::SetDatagramOffset(), ns3::SixLowPanFrag1::SetDatagramSize(), ns3::SixLowPanFragN::SetDatagramSize(), ns3::SixLowPanFrag1::SetDatagramTag(), and ns3::SixLowPanFragN::SetDatagramTag().

Referenced by DoSend().

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

◆ DoSend()

bool ns3::SixLowPanNetDevice::DoSend ( Ptr< Packet > packet,
const Address & source,
const Address & dest,
uint16_t protocolNumber,
bool doSendFrom )
private
Parameters
[in]packetPacket sent from above down to Network Device.
[in]sourceSource mac address (only used if doSendFrom is true, i.e., "MAC spoofing").
[in]destMac address of the destination (already resolved).
[in]protocolNumberIdentifies the type of payload contained in this packet. Used to call the right L3Protocol when the packet is received.
[in]doSendFromPerform a SendFrom instead of a Send.

Called from higher layer to send packet into Network Device with the specified source and destination Addresses.

Returns
Whether the Send operation succeeded.

Definition at line 563 of file sixlowpan-net-device.cc.

References CompressLowPanHc1(), CompressLowPanIphc(), DoFragmentation(), Get16MacFrom48Mac(), ns3::Node::GetId(), GetIfIndex(), ns3::SixLowPanBc0::GetSerializedSize(), ns3::SixLowPanMesh::GetSerializedSize(), ns3::Mac48Address::IsMatchingType(), m_bc0Serial, m_compressionThreshold, m_meshUnder, m_meshUnderHopsLeft, m_netDevice, m_node, m_txTrace, m_useIphc, NS_ASSERT_MSG, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, pktSize, PROT_NUMBER, ns3::SixLowPanMesh::SetFinalDst(), ns3::SixLowPanMesh::SetHopsLeft(), ns3::SixLowPanMesh::SetOriginator(), and ns3::SixLowPanBc0::SetSequenceNumber().

Referenced by Send(), and SendFrom().

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

◆ DropOldestFragmentSet()

void ns3::SixLowPanNetDevice::DropOldestFragmentSet ( )
private

Drops the oldest fragment set.

◆ FindMulticastCompressionContext()

bool ns3::SixLowPanNetDevice::FindMulticastCompressionContext ( Ipv6Address address,
uint8_t & contextId )
private

Finds if the given multicast address matches a context for compression.

Parameters
[in]addressthe address to check
[out]contextIdthe context found
Returns
true if a valid context has been found

Definition at line 2860 of file sixlowpan-net-device.cc.

References ns3::SixLowPanNetDevice::ContextEntry::compressionAllowed, ns3::SixLowPanNetDevice::ContextEntry::contextPrefix, ns3::Ipv6Prefix::GetBytes(), ns3::Ipv6Address::GetOnes(), ns3::Ipv6Prefix::GetPrefixLength(), m_contextTable, ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_LOGIC, and ns3::SixLowPanNetDevice::ContextEntry::validLifetime.

Referenced by CompressLowPanIphc().

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

◆ FindUnicastCompressionContext()

bool ns3::SixLowPanNetDevice::FindUnicastCompressionContext ( Ipv6Address address,
uint8_t & contextId )
private

Finds if the given unicast address matches a context for compression.

Parameters
[in]addressthe address to check
[out]contextIdthe context found
Returns
true if a valid context has been found

Definition at line 2834 of file sixlowpan-net-device.cc.

References ns3::SixLowPanNetDevice::ContextEntry::compressionAllowed, ns3::SixLowPanNetDevice::ContextEntry::contextPrefix, ns3::Ipv6Address::GetOnes(), m_contextTable, ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_LOGIC, and ns3::SixLowPanNetDevice::ContextEntry::validLifetime.

Referenced by CompressLowPanIphc().

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

◆ Get16MacFrom48Mac()

Address ns3::SixLowPanNetDevice::Get16MacFrom48Mac ( Address addr)
private

Get a Mac16 from its Mac48 pseudo-MAC.

Parameters
addrthe PseudoMac address
Returns
the Mac16Address

Definition at line 2670 of file sixlowpan-net-device.cc.

References ns3::Mac16Address::CopyFrom(), ns3::Address::CopyTo(), ns3::Mac48Address::IsMatchingType(), and NS_ASSERT_MSG.

Referenced by DoSend(), and ReceiveFromDevice().

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

◆ GetAddress()

Address ns3::SixLowPanNetDevice::GetAddress ( ) const
overridevirtual
Returns
the current Address of this interface.

Implements ns3::NetDevice.

Definition at line 425 of file sixlowpan-net-device.cc.

References m_netDevice, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

◆ GetBroadcast()

Address ns3::SixLowPanNetDevice::GetBroadcast ( ) const
overridevirtual
Returns
the broadcast address supported by this netdevice.

Calling this method is invalid if IsBroadcast returns not true.

Implements ns3::NetDevice.

Definition at line 485 of file sixlowpan-net-device.cc.

References m_netDevice, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

◆ GetChannel()

Ptr< Channel > ns3::SixLowPanNetDevice::GetChannel ( ) const
overridevirtual
Returns
the channel this NetDevice is connected to. The value returned can be zero if the NetDevice is not yet connected to any channel or if the underlying NetDevice has no concept of a channel. i.e., callers must check for zero and be ready to handle it.

Implements ns3::NetDevice.

Definition at line 407 of file sixlowpan-net-device.cc.

References m_netDevice, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

◆ GetContext()

bool ns3::SixLowPanNetDevice::GetContext ( uint8_t contextId,
Ipv6Prefix & contextPrefix,
bool & compressionAllowed,
Time & validLifetime )

Get a context used in IPHC stateful compression.

Parameters
[in]contextIdcontext id (most be between 0 and 15 included).
[out]contextPrefixcontext prefix to be used in compression/decompression.
[out]compressionAllowedcompression and decompression allowed (true), decompression only (false).
[out]validLifetimevalidity time (relative to the actual time).
Returns
false if the context has not been found.

Definition at line 2748 of file sixlowpan-net-device.cc.

References m_contextTable, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

◆ GetIfIndex()

uint32_t ns3::SixLowPanNetDevice::GetIfIndex ( ) const
overridevirtual
Returns
index ifIndex of the device

Implements ns3::NetDevice.

Definition at line 400 of file sixlowpan-net-device.cc.

References m_ifIndex, and NS_LOG_FUNCTION.

Referenced by DecompressLowPanNhc(), DoSend(), ProcessFragment(), and ReceiveFromDevice().

+ Here is the caller graph for this function:

◆ GetMtu()

uint16_t ns3::SixLowPanNetDevice::GetMtu ( ) const
overridevirtual

Returns the link-layer MTU for this interface.

If the link-layer MTU is smaller than IPv6's minimum MTU (RFC 4944 ), 1280 will be returned.

Returns
The link-level MTU in bytes for this interface.

Implements ns3::NetDevice.

Definition at line 443 of file sixlowpan-net-device.cc.

References m_netDevice, and NS_LOG_FUNCTION.

◆ GetMulticast() [1/2]

Address ns3::SixLowPanNetDevice::GetMulticast ( Ipv4Address multicastGroup) const
overridevirtual

Make and return a MAC multicast address using the provided multicast group.

RFC 1112 says that an Ipv4 host group address is mapped to an Ethernet multicast address by placing the low-order 23-bits of the IP address into the low-order 23 bits of the Ethernet multicast address 01-00-5E-00-00-00 (hex). Similar RFCs exist for Ipv6 and Eui64 mappings. This method performs the multicast address creation function appropriate to the underlying MAC address of the device. This MAC address is encapsulated in an abstract Address to avoid dependencies on the exact MAC address format.

In the case of net devices that do not support multicast, clients are expected to test NetDevice::IsMulticast and avoid attempting to map multicast packets. Subclasses of NetDevice that do support multicasting are expected to override this method and provide an implementation appropriate to the particular device.

Parameters
multicastGroupThe IP address for the multicast group destination of the packet.
Returns
The MAC multicast Address used to send packets to the provided multicast group.
Warning
Calling this method is invalid if IsMulticast returns not true.
See also
IsMulticast()

Implements ns3::NetDevice.

Definition at line 503 of file sixlowpan-net-device.cc.

References m_netDevice, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

◆ GetMulticast() [2/2]

Address ns3::SixLowPanNetDevice::GetMulticast ( Ipv6Address addr) const
overridevirtual

Get the MAC multicast address corresponding to the IPv6 address provided.

Parameters
addrIPv6 address
Returns
the MAC multicast address
Warning
Calling this method is invalid if IsMulticast returns not true.

Implements ns3::NetDevice.

Definition at line 512 of file sixlowpan-net-device.cc.

References m_netDevice, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

◆ GetNetDevice()

Ptr< NetDevice > ns3::SixLowPanNetDevice::GetNetDevice ( ) const

Returns a smart pointer to the underlying NetDevice.

Returns
A smart pointer to the underlying NetDevice.

Definition at line 126 of file sixlowpan-net-device.cc.

References m_netDevice, and NS_LOG_FUNCTION.

◆ GetNode()

Ptr< Node > ns3::SixLowPanNetDevice::GetNode ( ) const
overridevirtual
Returns
the node base class which contains this network interface.

When a subclass needs to get access to the underlying node base class to print the nodeid for example, it can invoke this method.

Implements ns3::NetDevice.

Definition at line 698 of file sixlowpan-net-device.cc.

References m_node, and NS_LOG_FUNCTION.

◆ GetTypeId()

◆ HandleFragmentsTimeout()

void ns3::SixLowPanNetDevice::HandleFragmentsTimeout ( FragmentKey_t key,
uint32_t iif )
private

Process the timeout for packet fragments.

Parameters
[in]keyA key representing the packet fragments.
[in]iifInput Interface.

Definition at line 2653 of file sixlowpan-net-device.cc.

References DROP_FRAGMENT_TIMEOUT, m_dropTrace, m_fragments, and NS_LOG_FUNCTION.

Referenced by HandleTimeout().

+ Here is the caller graph for this function:

◆ HandleTimeout()

void ns3::SixLowPanNetDevice::HandleTimeout ( )
private

Handles a fragmented packet timeout.

Definition at line 2700 of file sixlowpan-net-device.cc.

References HandleFragmentsTimeout(), HandleTimeout(), m_timeoutEvent, m_timeoutEventList, ns3::Simulator::Now(), and ns3::Simulator::Schedule().

Referenced by HandleTimeout(), and SetTimeout().

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

◆ InvalidateContext()

void ns3::SixLowPanNetDevice::InvalidateContext ( uint8_t contextId)

Invalidate a context used in IPHC stateful compression.

An invalid context will not be used for compression but it will be used for decompression.

Parameters
[in]contextIdcontext id (most be between 0 and 15 included).

Definition at line 2795 of file sixlowpan-net-device.cc.

References m_contextTable, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

◆ IsBridge()

bool ns3::SixLowPanNetDevice::IsBridge ( ) const
overridevirtual

Return true if the net device is acting as a bridge.

Returns
value of m_isBridge flag

Implements ns3::NetDevice.

Definition at line 530 of file sixlowpan-net-device.cc.

References m_netDevice, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

◆ IsBroadcast()

bool ns3::SixLowPanNetDevice::IsBroadcast ( ) const
overridevirtual
Returns
true if this interface supports a broadcast address, false otherwise.

Implements ns3::NetDevice.

Definition at line 476 of file sixlowpan-net-device.cc.

References m_netDevice, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

◆ IsLinkUp()

bool ns3::SixLowPanNetDevice::IsLinkUp ( ) const
overridevirtual
Returns
true if link is up; false otherwise

Implements ns3::NetDevice.

Definition at line 458 of file sixlowpan-net-device.cc.

References m_netDevice, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

◆ IsMulticast()

bool ns3::SixLowPanNetDevice::IsMulticast ( ) const
overridevirtual
Returns
value of m_isMulticast flag

Implements ns3::NetDevice.

Definition at line 494 of file sixlowpan-net-device.cc.

References m_netDevice, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

◆ IsPointToPoint()

bool ns3::SixLowPanNetDevice::IsPointToPoint ( ) const
overridevirtual

Return true if the net device is on a point-to-point link.

Returns
value of m_isPointToPoint flag

Implements ns3::NetDevice.

Definition at line 521 of file sixlowpan-net-device.cc.

References m_netDevice, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

◆ NeedsArp()

bool ns3::SixLowPanNetDevice::NeedsArp ( ) const
overridevirtual
Returns
true if ARP is needed, false otherwise.

Called by higher-layers to check if this NetDevice requires ARP to be used.

Implements ns3::NetDevice.

Definition at line 712 of file sixlowpan-net-device.cc.

References m_netDevice, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

◆ operator=()

SixLowPanNetDevice & ns3::SixLowPanNetDevice::operator= ( const SixLowPanNetDevice & )
delete

◆ ProcessFragment()

bool ns3::SixLowPanNetDevice::ProcessFragment ( Ptr< Packet > & packet,
const Address & src,
const Address & dst,
bool isFirst )
private

Process a packet fragment.

Parameters
[in]packetThe packet.
[in]srcThe source MAC address.
[in]dstThe destination MAC address.
[in]isFirstTrue if it is the first fragment, false otherwise.
Returns
True is the fragment completed the packet.

Definition at line 2382 of file sixlowpan-net-device.cc.

References ns3::Create(), DecompressLowPanHc1(), DecompressLowPanIphc(), DROP_FRAGMENT_BUFFER_FULL, DROP_SATETFUL_DECOMPRESSION_PROBLEM, ns3::SixLowPanFragN::GetDatagramOffset(), ns3::SixLowPanFrag1::GetDatagramSize(), ns3::SixLowPanFragN::GetDatagramSize(), ns3::SixLowPanFrag1::GetDatagramTag(), ns3::SixLowPanFragN::GetDatagramTag(), ns3::SixLowPanDispatch::GetDispatchType(), GetIfIndex(), ns3::SixLowPanDispatch::LOWPAN_HC1, ns3::SixLowPanDispatch::LOWPAN_IPHC, ns3::SixLowPanDispatch::LOWPAN_IPv6, m_dropTrace, m_fragmentReassemblyListSize, m_fragments, m_timeoutEventList, NS_FATAL_ERROR, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, packetSize, and SetTimeout().

Referenced by ReceiveFromDevice().

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

◆ ReceiveFromDevice()

void ns3::SixLowPanNetDevice::ReceiveFromDevice ( Ptr< NetDevice > device,
Ptr< const Packet > packet,
uint16_t protocol,
const Address & source,
const Address & destination,
PacketType packetType )
private

Receives all the packets from a NetDevice for further processing.

Parameters
[in]deviceThe NetDevice the packet ws received from.
[in]packetThe received packet.
[in]protocolThe protocol (if known).
[in]sourceThe source address.
[in]destinationThe destination address.
[in]packetTypeThe packet kind (e.g., HOST, BROADCAST, etc.).

Definition at line 187 of file sixlowpan-net-device.cc.

References ns3::Mac16Address::ConvertFrom(), DecompressLowPanHc1(), DecompressLowPanIphc(), DROP_DISALLOWED_COMPRESSION, DROP_SATETFUL_DECOMPRESSION_PROBLEM, DROP_UNKNOWN_EXTENSION, Get16MacFrom48Mac(), ns3::SixLowPanDispatch::GetDispatchType(), ns3::SixLowPanMesh::GetFinalDst(), ns3::SixLowPanMesh::GetHopsLeft(), GetIfIndex(), ns3::SixLowPanMesh::GetOriginator(), ns3::SixLowPanBc0::GetSequenceNumber(), ns3::RandomVariableStream::GetValue(), ns3::Mac16Address::IsBroadcast(), ns3::Mac16Address::IsMatchingType(), ns3::Mac48Address::IsMatchingType(), ns3::Mac16Address::IsMulticast(), ns3::Callback< R, UArgs >::IsNull(), ns3::SixLowPanDispatch::LOWPAN_BC0, ns3::SixLowPanDispatch::LOWPAN_FRAG1, ns3::SixLowPanDispatch::LOWPAN_FRAGN, ns3::SixLowPanDispatch::LOWPAN_HC1, ns3::SixLowPanDispatch::LOWPAN_IPHC, ns3::SixLowPanDispatch::LOWPAN_IPv6, ns3::SixLowPanDispatch::LOWPAN_MESH, m_dropTrace, m_meshCacheLength, m_meshUnderJitter, m_netDevice, m_promiscRxCallback, m_rxCallback, m_rxTrace, m_seenPkts, m_useIphc, ns3::MilliSeconds(), NS_ABORT_MSG_IF, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_LOGIC, ProcessFragment(), ns3::Ipv6L3Protocol::PROT_NUMBER, ns3::Simulator::Schedule(), ns3::NetDevice::Send(), and ns3::SixLowPanMesh::SetHopsLeft().

Referenced by SetNetDevice().

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

◆ RemoveContext()

void ns3::SixLowPanNetDevice::RemoveContext ( uint8_t contextId)

Remove a context used in IPHC stateful compression.

Parameters
[in]contextIdcontext id (most be between 0 and 15 included).

Definition at line 2814 of file sixlowpan-net-device.cc.

References m_contextTable, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

◆ RenewContext()

void ns3::SixLowPanNetDevice::RenewContext ( uint8_t contextId,
Time validLifetime )

Renew a context used in IPHC stateful compression.

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

Parameters
[in]contextIdcontext id (most be between 0 and 15 included).
[in]validLifetimevalidity time (relative to the actual time).

Definition at line 2775 of file sixlowpan-net-device.cc.

References ns3::Time::As(), m_contextTable, ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_LOGIC, and ns3::Time::S.

+ Here is the call graph for this function:

◆ Send()

bool ns3::SixLowPanNetDevice::Send ( Ptr< Packet > packet,
const Address & dest,
uint16_t protocolNumber )
overridevirtual
Parameters
packetpacket sent from above down to Network Device
destmac address of the destination (already resolved)
protocolNumberidentifies the type of payload contained in this packet. Used to call the right L3Protocol when the packet is received.

Called from higher layer to send packet into Network Device to the specified destination Address

Returns
whether the Send operation succeeded

Implements ns3::NetDevice.

Definition at line 539 of file sixlowpan-net-device.cc.

References DoSend(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ SendFrom()

bool ns3::SixLowPanNetDevice::SendFrom ( Ptr< Packet > packet,
const Address & source,
const Address & dest,
uint16_t protocolNumber )
overridevirtual
Parameters
packetpacket sent from above down to Network Device
sourcesource mac address (so called "MAC spoofing")
destmac address of the destination (already resolved)
protocolNumberidentifies the type of payload contained in this packet. Used to call the right L3Protocol when the packet is received.

Called from higher layer to send packet into Network Device with the specified source and destination Addresses.

Returns
whether the Send operation succeeded

Implements ns3::NetDevice.

Definition at line 550 of file sixlowpan-net-device.cc.

References DoSend(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ SetAddress()

void ns3::SixLowPanNetDevice::SetAddress ( Address address)
overridevirtual

Set the address of this interface.

Parameters
addressaddress to set

Implements ns3::NetDevice.

Definition at line 416 of file sixlowpan-net-device.cc.

References m_netDevice, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

◆ SetIfIndex()

void ns3::SixLowPanNetDevice::SetIfIndex ( const uint32_t index)
overridevirtual
Parameters
indexifIndex of the device

Implements ns3::NetDevice.

Definition at line 393 of file sixlowpan-net-device.cc.

References m_ifIndex, and NS_LOG_FUNCTION.

◆ SetMtu()

bool ns3::SixLowPanNetDevice::SetMtu ( const uint16_t mtu)
overridevirtual
Parameters
mtuMTU value, in bytes, to set for the device
Returns
whether the MTU value was within legal bounds

Override for default MTU defined on a per-type basis.

Implements ns3::NetDevice.

Definition at line 434 of file sixlowpan-net-device.cc.

References m_netDevice, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

◆ SetNetDevice()

void ns3::SixLowPanNetDevice::SetNetDevice ( Ptr< NetDevice > device)

Setup SixLowPan to be a proxy for the specified NetDevice.

All the packets incoming and outgoing from the NetDevice will be processed by SixLowPanNetDevice.

Parameters
[in]deviceA smart pointer to the NetDevice to be proxied.

Definition at line 133 of file sixlowpan-net-device.cc.

References m_netDevice, m_node, ns3::MakeCallback(), NS_LOG_DEBUG, NS_LOG_FUNCTION, PROT_NUMBER, ReceiveFromDevice(), and ns3::Node::RegisterProtocolHandler().

+ Here is the call graph for this function:

◆ SetNode()

void ns3::SixLowPanNetDevice::SetNode ( Ptr< Node > node)
overridevirtual
Parameters
nodethe node associated to this netdevice.

This method is called from ns3::Node::AddDevice.

Implements ns3::NetDevice.

Definition at line 705 of file sixlowpan-net-device.cc.

References m_node, and NS_LOG_FUNCTION.

◆ SetPromiscReceiveCallback()

void ns3::SixLowPanNetDevice::SetPromiscReceiveCallback ( NetDevice::PromiscReceiveCallback cb)
overridevirtual
Parameters
cbcallback to invoke whenever a packet has been received in promiscuous mode and must be forwarded to the higher layers.

Enables netdevice promiscuous mode and sets the callback that will handle promiscuous mode packets. Note, promiscuous mode packets means all packets, including those packets that can be sensed by the netdevice but which are intended to be received by other hosts.

Implements ns3::NetDevice.

Definition at line 728 of file sixlowpan-net-device.cc.

References m_promiscRxCallback, and NS_LOG_FUNCTION.

◆ SetReceiveCallback()

void ns3::SixLowPanNetDevice::SetReceiveCallback ( NetDevice::ReceiveCallback cb)
overridevirtual
Parameters
cbcallback to invoke whenever a packet has been received and must be forwarded to the higher layers.

Set the callback to be used to notify higher layers when a packet has been received.

Implements ns3::NetDevice.

Definition at line 721 of file sixlowpan-net-device.cc.

References m_rxCallback, and NS_LOG_FUNCTION.

◆ SetTimeout()

SixLowPanNetDevice::FragmentsTimeoutsListI_t ns3::SixLowPanNetDevice::SetTimeout ( FragmentKey_t key,
uint32_t iif )
private

Set a new timeout "event" for a fragmented packet.

Parameters
keythe fragment identification
iifinput interface of the packet
Returns
an iterator to the inserted "event"

Definition at line 2684 of file sixlowpan-net-device.cc.

References HandleTimeout(), m_fragmentExpirationTimeout, m_timeoutEvent, m_timeoutEventList, ns3::Simulator::Now(), and ns3::Simulator::Schedule().

Referenced by ProcessFragment().

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

◆ SupportsSendFrom()

bool ns3::SixLowPanNetDevice::SupportsSendFrom ( ) const
overridevirtual
Returns
true if this interface supports a bridging mode, false otherwise.

Implements ns3::NetDevice.

Definition at line 735 of file sixlowpan-net-device.cc.

References NS_LOG_FUNCTION.

Member Data Documentation

◆ m_bc0Serial

uint8_t ns3::SixLowPanNetDevice::m_bc0Serial
private

Serial number used in BC0 header.

Definition at line 616 of file sixlowpan-net-device.h.

Referenced by SixLowPanNetDevice(), and DoSend().

◆ m_compressionThreshold

uint32_t ns3::SixLowPanNetDevice::m_compressionThreshold
private

Minimum L2 payload size.

Definition at line 630 of file sixlowpan-net-device.h.

Referenced by DoSend(), and GetTypeId().

◆ m_contextTable

std::map<uint8_t, ContextEntry> ns3::SixLowPanNetDevice::m_contextTable
private

◆ m_dropTrace

TracedCallback<DropReason, Ptr<const Packet>, Ptr<SixLowPanNetDevice>, uint32_t> ns3::SixLowPanNetDevice::m_dropTrace
private

Callback to trace drop packets.

Data passed:

  • DropReason
  • Packet dropped (including 6LoWPAN header)
  • Ptr to SixLowPanNetDevice
  • interface index
    Deprecated
    The non-const Ptr<SixLowPanNetDevice> argument is deprecated and will be changed to Ptr<const SixLowPanNetDevice> in a future release.

Definition at line 344 of file sixlowpan-net-device.h.

Referenced by DecompressLowPanNhc(), GetTypeId(), HandleFragmentsTimeout(), ProcessFragment(), and ReceiveFromDevice().

◆ m_fragmentExpirationTimeout

Time ns3::SixLowPanNetDevice::m_fragmentExpirationTimeout
private

Time limit for fragment rebuilding.

Definition at line 605 of file sixlowpan-net-device.h.

Referenced by GetTypeId(), and SetTimeout().

◆ m_fragmentReassemblyListSize

uint16_t ns3::SixLowPanNetDevice::m_fragmentReassemblyListSize
private

How many packets can be rebuilt at the same time.

Some real implementation do limit this. Zero means no limit.

Definition at line 611 of file sixlowpan-net-device.h.

Referenced by GetTypeId(), and ProcessFragment().

◆ m_fragments

◆ m_ifIndex

uint32_t ns3::SixLowPanNetDevice::m_ifIndex
private

Interface index.

Definition at line 626 of file sixlowpan-net-device.h.

Referenced by GetIfIndex(), and SetIfIndex().

◆ m_meshCacheLength

uint16_t ns3::SixLowPanNetDevice::m_meshCacheLength
private

length of the cache for each source.

Definition at line 618 of file sixlowpan-net-device.h.

Referenced by GetTypeId(), and ReceiveFromDevice().

◆ m_meshUnder

bool ns3::SixLowPanNetDevice::m_meshUnder
private

Use a mesh-under routing.

Definition at line 615 of file sixlowpan-net-device.h.

Referenced by DoSend(), and GetTypeId().

◆ m_meshUnderHopsLeft

uint8_t ns3::SixLowPanNetDevice::m_meshUnderHopsLeft
private

Start value for mesh-under hops left.

Definition at line 617 of file sixlowpan-net-device.h.

Referenced by DoSend(), and GetTypeId().

◆ m_meshUnderJitter

Ptr<RandomVariableStream> ns3::SixLowPanNetDevice::m_meshUnderJitter
private

Random variable for the mesh-under packet retransmission.

Definition at line 620 of file sixlowpan-net-device.h.

Referenced by AssignStreams(), GetTypeId(), and ReceiveFromDevice().

◆ m_netDevice

◆ m_node

Ptr<Node> ns3::SixLowPanNetDevice::m_node
private

Smart pointer to the Node.

Definition at line 624 of file sixlowpan-net-device.h.

Referenced by DoDispose(), DoSend(), GetNode(), SetNetDevice(), and SetNode().

◆ m_omitUdpChecksum

bool ns3::SixLowPanNetDevice::m_omitUdpChecksum
private

Omit UDP checksum in NC1 encoding.

Definition at line 628 of file sixlowpan-net-device.h.

Referenced by CompressLowPanIphc(), CompressLowPanNhc(), and GetTypeId().

◆ m_promiscRxCallback

NetDevice::PromiscReceiveCallback ns3::SixLowPanNetDevice::m_promiscRxCallback
private

The callback used to notify higher layers that a packet has been received in promiscuous mode.

Definition at line 301 of file sixlowpan-net-device.h.

Referenced by ReceiveFromDevice(), and SetPromiscReceiveCallback().

◆ m_rng

Ptr<UniformRandomVariable> ns3::SixLowPanNetDevice::m_rng
private

Rng for the fragments tag.

Definition at line 632 of file sixlowpan-net-device.h.

Referenced by SixLowPanNetDevice(), AssignStreams(), and DoFragmentation().

◆ m_rxCallback

NetDevice::ReceiveCallback ns3::SixLowPanNetDevice::m_rxCallback
private

The callback used to notify higher layers that a packet has been received.

Definition at line 295 of file sixlowpan-net-device.h.

Referenced by ReceiveFromDevice(), and SetReceiveCallback().

◆ m_rxTrace

TracedCallback<Ptr<const Packet>, Ptr<SixLowPanNetDevice>, uint32_t> ns3::SixLowPanNetDevice::m_rxTrace
private

Callback to trace RX (reception) packets.

Data passed:

  • Packet received (including 6LoWPAN header)
  • Ptr to SixLowPanNetDevice
  • interface index
    Deprecated
    The non-const Ptr<SixLowPanNetDevice> argument is deprecated and will be changed to Ptr<const SixLowPanNetDevice> in a future release.

Definition at line 329 of file sixlowpan-net-device.h.

Referenced by GetTypeId(), and ReceiveFromDevice().

◆ m_seenPkts

std::map<Address , std::list<uint8_t > > ns3::SixLowPanNetDevice::m_seenPkts
private

Seen packets, memorized by OriginatorAddress, SequenceNumber.

Definition at line 622 of file sixlowpan-net-device.h.

Referenced by ReceiveFromDevice().

◆ m_timeoutEvent

EventId ns3::SixLowPanNetDevice::m_timeoutEvent
private

Event for the next scheduled timeout.

Definition at line 458 of file sixlowpan-net-device.h.

Referenced by DoDispose(), HandleTimeout(), and SetTimeout().

◆ m_timeoutEventList

FragmentsTimeoutsList_t ns3::SixLowPanNetDevice::m_timeoutEventList
private

Timeout "events" container.

Definition at line 456 of file sixlowpan-net-device.h.

Referenced by DoDispose(), HandleTimeout(), ProcessFragment(), and SetTimeout().

◆ m_txTrace

TracedCallback<Ptr<const Packet>, Ptr<SixLowPanNetDevice>, uint32_t> ns3::SixLowPanNetDevice::m_txTrace
private

Callback to trace TX (transmission) packets.

Data passed:

  • Packet received (including 6LoWPAN header)
  • Ptr to SixLowPanNetDevice
  • interface index
    Deprecated
    The non-const Ptr<SixLowPanNetDevice> argument is deprecated and will be changed to Ptr<const SixLowPanNetDevice> in a future release.

Definition at line 315 of file sixlowpan-net-device.h.

Referenced by DoSend(), and GetTypeId().

◆ m_useIphc

bool ns3::SixLowPanNetDevice::m_useIphc
private

Use IPHC or HC1.

Definition at line 613 of file sixlowpan-net-device.h.

Referenced by DoSend(), GetTypeId(), and ReceiveFromDevice().

◆ PROT_NUMBER

uint16_t ns3::SixLowPanNetDevice::PROT_NUMBER {0xA0ED}
staticconstexpr

The protocol number for 6LoWPAN (0xA0ED) - see RFC 7973 .

Definition at line 80 of file sixlowpan-net-device.h.

Referenced by DoSend(), and SetNetDevice().


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