A Discrete-Event Network Simulator
API
sixlowpan-net-device.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013 Universita' di Firenze, Italy
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
19  * Michele Muccio <michelemuccio@virgilio.it>
20  */
21 
22 #ifndef SIXLOWPAN_NET_DEVICE_H
23 #define SIXLOWPAN_NET_DEVICE_H
24 
25 #include <stdint.h>
26 #include <string>
27 #include <map>
28 #include <tuple>
29 #include "ns3/traced-callback.h"
30 #include "ns3/nstime.h"
31 #include "ns3/net-device.h"
32 #include "ns3/random-variable-stream.h"
33 #include "ns3/simulator.h"
34 
35 namespace ns3 {
36 
37 class Node;
38 class UniformRandomVariable;
39 class EventId;
40 
66 {
67 public:
72  {
78  };
79 
84  static TypeId GetTypeId (void);
85 
90 
91  // inherited from NetDevice base class
92  virtual void SetIfIndex (const uint32_t index);
93  virtual uint32_t GetIfIndex (void) const;
94  virtual Ptr<Channel> GetChannel (void) const;
95  virtual void SetAddress (Address address);
96  virtual Address GetAddress (void) const;
97  virtual bool SetMtu (const uint16_t mtu);
98 
106  virtual uint16_t GetMtu (void) const;
107  virtual bool IsLinkUp (void) const;
108  virtual void AddLinkChangeCallback (Callback<void> callback);
109  virtual bool IsBroadcast (void) const;
110  virtual Address GetBroadcast (void) const;
111  virtual bool IsMulticast (void) const;
112  virtual Address GetMulticast (Ipv4Address multicastGroup) const;
113  virtual bool IsPointToPoint (void) const;
114  virtual bool IsBridge (void) const;
115  virtual bool Send (Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber);
116  virtual bool SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber);
117  virtual Ptr<Node> GetNode (void) const;
118  virtual void SetNode (Ptr<Node> node);
119  virtual bool NeedsArp (void) const;
122  virtual bool SupportsSendFrom () const;
123  virtual Address GetMulticast (Ipv6Address addr) const;
124 
130  Ptr<NetDevice> GetNetDevice () const;
131 
139  void SetNetDevice (Ptr<NetDevice> device);
140 
149  int64_t AssignStreams (int64_t stream);
150 
161  typedef void (* RxTxTracedCallback)(Ptr<const Packet> packet,
162  Ptr<SixLowPanNetDevice> sixNetDevice,
163  uint32_t ifindex);
164 
176  typedef void (* DropTracedCallback)(DropReason reason,
177  Ptr<const Packet> packet,
178  Ptr<SixLowPanNetDevice> sixNetDevice,
179  uint32_t ifindex);
180 
192  void AddContext (uint8_t contextId, Ipv6Prefix contextPrefix, bool compressionAllowed, Time validLifetime);
193 
205  bool GetContext (uint8_t contextId, Ipv6Prefix& contextPrefix, bool& compressionAllowed, Time& validLifetime);
206 
215  void RenewContext (uint8_t contextId, Time validLifetime);
216 
224  void InvalidateContext (uint8_t contextId);
225 
231  void RemoveContext (uint8_t contextId);
232 
233 protected:
234  virtual void DoDispose (void);
235 
236 private:
259  void ReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet> packet, uint16_t protocol,
260  Address const &source, Address const &destination, PacketType packetType);
261 
262 
277  bool DoSend (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber, bool doSendFrom);
278 
283 
288 
301 
314 
328 
336  uint32_t CompressLowPanHc1 (Ptr<Packet> packet, Address const &src, Address const &dst);
337 
344  void DecompressLowPanHc1 (Ptr<Packet> packet, Address const &src, Address const &dst);
345 
353  uint32_t CompressLowPanIphc (Ptr<Packet> packet, Address const &src, Address const &dst);
354 
360  bool CanCompressLowPanNhc (uint8_t headerType);
361 
369  bool DecompressLowPanIphc (Ptr<Packet> packet, Address const &src, Address const &dst);
370 
379  uint32_t CompressLowPanNhc (Ptr<Packet> packet, uint8_t headerType, Address const &src, Address const &dst);
380 
390  std::pair<uint8_t, bool> DecompressLowPanNhc (Ptr<Packet> packet, Address const &src, Address const &dst, Ipv6Address srcAddress, Ipv6Address dstAddress);
391 
398  uint32_t CompressLowPanUdpNhc (Ptr<Packet> packet, bool omitChecksum);
399 
406  void DecompressLowPanUdpNhc (Ptr<Packet> packet, Ipv6Address saddr, Ipv6Address daddr);
407 
411  typedef std::pair< std::pair<Address, Address>, std::pair<uint16_t, uint16_t> > FragmentKey_t;
412 
414  typedef std::list< std::tuple <Time, FragmentKey_t, uint32_t > > FragmentsTimeoutsList_t;
416  typedef std::list< std::tuple <Time, FragmentKey_t, uint32_t > >::iterator FragmentsTimeoutsListI_t;
417 
425 
429  void HandleTimeout (void);
430 
432 
434 
438  class Fragments : public SimpleRefCount<Fragments>
439  {
440 public:
444  Fragments ();
445 
449  ~Fragments ();
450 
456  void AddFragment (Ptr<Packet> fragment, uint16_t fragmentOffset);
457 
463  void AddFirstFragment (Ptr<Packet> fragment);
464 
469  bool IsEntire () const;
470 
475  Ptr<Packet> GetPacket () const;
476 
481  void SetPacketSize (uint32_t packetSize);
482 
487  std::list< Ptr<Packet> > GetFraments () const;
488 
494 
500 
501 private:
505  uint32_t m_packetSize;
506 
510  std::list<std::pair<Ptr<Packet>, uint16_t> > m_fragments;
511 
516 
521  };
522 
531  void DoFragmentation (Ptr<Packet> packet, uint32_t origPacketSize, uint32_t origHdrSize, uint32_t extraHdrSize,
532  std::list<Ptr<Packet> >& listFragments);
533 
542  bool ProcessFragment (Ptr<Packet>& packet, Address const &src, Address const &dst, bool isFirst);
543 
549  void HandleFragmentsTimeout (FragmentKey_t key, uint32_t iif);
550 
555 
562 
566  typedef std::map< FragmentKey_t, Ptr<Fragments> > MapFragments_t;
570  typedef std::map< FragmentKey_t, Ptr<Fragments> >::iterator MapFragmentsI_t;
571 
574 
580 
581  bool m_useIphc;
582 
583  bool m_meshUnder;
584  uint8_t m_bc0Serial;
586  uint16_t m_meshCacheLength;
588  std::map <Address /* OriginatorAdddress */, std::list <uint8_t /* SequenceNumber */> > m_seenPkts;
589 
592  uint32_t m_ifIndex;
593 
599 
600  uint16_t m_etherType;
602 
604 
606 
611  {
615  };
616 
617  std::map<uint8_t, ContextEntry> m_contextTable;
618 
626  bool FindUnicastCompressionContext (Ipv6Address address, uint8_t& contextId);
627 
635  bool FindMulticastCompressionContext (Ipv6Address address, uint8_t& contextId);
636 
648 };
649 
650 } // namespace ns3
651 
652 #endif /* SIXLOWPAN_NET_DEVICE_H */
ns3::TypeId
a unique identifier for an interface.
Definition: type-id.h:59
ns3::SixLowPanNetDevice::Fragments::m_timeoutIter
FragmentsTimeoutsListI_t m_timeoutIter
Timeout iterator to "event" handler.
Definition: sixlowpan-net-device.h:520
ns3::SixLowPanNetDevice::DROP_UNKNOWN_EXTENSION
@ DROP_UNKNOWN_EXTENSION
Unsupported compression kind.
Definition: sixlowpan-net-device.h:75
ns3::SixLowPanNetDevice::Fragments::GetTimeoutIter
FragmentsTimeoutsListI_t GetTimeoutIter()
Get the Timeout iterator.
Definition: sixlowpan-net-device.cc:2591
ns3::SixLowPanNetDevice::m_txTrace
TracedCallback< Ptr< const Packet >, Ptr< SixLowPanNetDevice >, uint32_t > m_txTrace
Callback to trace TX (transmission) packets.
Definition: sixlowpan-net-device.h:300
ns3::SixLowPanNetDevice::InvalidateContext
void InvalidateContext(uint8_t contextId)
Invalidate a context used in IPHC stateful compression.
Definition: sixlowpan-net-device.cc:2729
ns3::SixLowPanNetDevice::m_node
Ptr< Node > m_node
Smart pointer to the Node.
Definition: sixlowpan-net-device.h:590
ns3::EventId
An identifier for simulation events.
Definition: event-id.h:54
ns3::SixLowPanNetDevice::GetMtu
virtual uint16_t GetMtu(void) const
Returns the link-layer MTU for this interface.
Definition: sixlowpan-net-device.cc:428
ns3::Callback< void >
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::SixLowPanNetDevice::m_timeoutEventList
FragmentsTimeoutsList_t m_timeoutEventList
Timeout "events" container.
Definition: sixlowpan-net-device.h:431
ns3::SixLowPanNetDevice::IsPointToPoint
virtual bool IsPointToPoint(void) const
Return true if the net device is on a point-to-point link.
Definition: sixlowpan-net-device.cc:498
ns3::SixLowPanNetDevice::SetAddress
virtual void SetAddress(Address address)
Set the address of this interface.
Definition: sixlowpan-net-device.cc:404
ns3::SixLowPanNetDevice::m_fragmentReassemblyListSize
uint16_t m_fragmentReassemblyListSize
How many packets can be rebuilt at the same time.
Definition: sixlowpan-net-device.h:579
ns3::SixLowPanNetDevice::SetTimeout
FragmentsTimeoutsListI_t SetTimeout(FragmentKey_t key, uint32_t iif)
Set a new timeout "event" for a fragmented packet.
Definition: sixlowpan-net-device.cc:2626
ns3::SixLowPanNetDevice::AssignStreams
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition: sixlowpan-net-device.cc:161
ns3::SixLowPanNetDevice::m_meshUnder
bool m_meshUnder
Use a mesh-under routing.
Definition: sixlowpan-net-device.h:583
ns3::SixLowPanNetDevice::Fragments::AddFirstFragment
void AddFirstFragment(Ptr< Packet > fragment)
Add the first packet fragment.
Definition: sixlowpan-net-device.cc:2497
ns3::SixLowPanNetDevice::CleanPrefix
Ipv6Address CleanPrefix(Ipv6Address address, Ipv6Prefix prefix)
Clean an address from its prefix.
Definition: sixlowpan-net-device.cc:2837
ns3::SixLowPanNetDevice::AddContext
void AddContext(uint8_t contextId, Ipv6Prefix contextPrefix, bool compressionAllowed, Time validLifetime)
Add, remove, or update a context used in IPHC stateful compression.
Definition: sixlowpan-net-device.cc:2661
ns3::SixLowPanNetDevice::MapFragmentsI_t
std::map< FragmentKey_t, Ptr< Fragments > >::iterator MapFragmentsI_t
Container Iterator for fragment key -> fragments.
Definition: sixlowpan-net-device.h:570
ns3::SixLowPanNetDevice::ContextEntry::compressionAllowed
bool compressionAllowed
compression and decompression allowed (true), decompression only (false)
Definition: sixlowpan-net-device.h:613
ns3::SimpleRefCount
A template-based reference counting class.
Definition: simple-ref-count.h:74
ns3::SixLowPanNetDevice::ProcessFragment
bool ProcessFragment(Ptr< Packet > &packet, Address const &src, Address const &dst, bool isFirst)
Process a packet fragment.
Definition: sixlowpan-net-device.cc:2330
ns3::Ipv4Address
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
ns3::Ipv6Address
Describes an IPv6 address.
Definition: ipv6-address.h:50
ns3::SixLowPanNetDevice::Fragments::~Fragments
~Fragments()
Destructor.
Definition: sixlowpan-net-device.cc:2466
ns3::SixLowPanNetDevice::Fragments::m_packetSize
uint32_t m_packetSize
The size of the reconstructed packet (bytes).
Definition: sixlowpan-net-device.h:505
ns3::SixLowPanNetDevice::IsMulticast
virtual bool IsMulticast(void) const
Definition: sixlowpan-net-device.cc:474
ns3::SixLowPanNetDevice::m_meshUnderJitter
Ptr< RandomVariableStream > m_meshUnderJitter
Random variable for the mesh-under packet retransmission.
Definition: sixlowpan-net-device.h:587
ns3::SixLowPanNetDevice::SetIfIndex
virtual void SetIfIndex(const uint32_t index)
Definition: sixlowpan-net-device.cc:384
ns3::SixLowPanNetDevice::GetMulticast
virtual Address GetMulticast(Ipv4Address multicastGroup) const
Make and return a MAC multicast address using the provided multicast group.
Definition: sixlowpan-net-device.cc:482
ns3::SixLowPanNetDevice::GetAddress
virtual Address GetAddress(void) const
Definition: sixlowpan-net-device.cc:412
ns3::SixLowPanNetDevice::DROP_DISALLOWED_COMPRESSION
@ DROP_DISALLOWED_COMPRESSION
HC1 while in IPHC mode or viceversa.
Definition: sixlowpan-net-device.h:76
ns3::SixLowPanNetDevice::m_fragments
MapFragments_t m_fragments
Fragments hold to be rebuilt.
Definition: sixlowpan-net-device.h:572
ns3::SixLowPanNetDevice::m_seenPkts
std::map< Address, std::list< uint8_t > > m_seenPkts
Seen packets, memorized by OriginatorAdddress, SequenceNumber.
Definition: sixlowpan-net-device.h:588
ns3::SixLowPanNetDevice::FragmentsTimeoutsList_t
std::list< std::tuple< Time, FragmentKey_t, uint32_t > > FragmentsTimeoutsList_t
Container for fragment timeouts.
Definition: sixlowpan-net-device.h:414
ns3::SixLowPanNetDevice::m_useIphc
bool m_useIphc
Use IPHC or HC1.
Definition: sixlowpan-net-device.h:581
ns3::SixLowPanNetDevice::Fragments::IsEntire
bool IsEntire() const
If all fragments have been added.
Definition: sixlowpan-net-device.cc:2504
ns3::SixLowPanNetDevice::CanCompressLowPanNhc
bool CanCompressLowPanNhc(uint8_t headerType)
Checks if the next header can be compressed using NHC.
Definition: sixlowpan-net-device.cc:1310
ns3::SixLowPanNetDevice::DecompressLowPanIphc
bool DecompressLowPanIphc(Ptr< Packet > packet, Address const &src, Address const &dst)
Decompress the headers according to IPHC compression.
Definition: sixlowpan-net-device.cc:1331
ns3::SixLowPanNetDevice::IsLinkUp
virtual bool IsLinkUp(void) const
Definition: sixlowpan-net-device.cc:442
ns3::SixLowPanNetDevice::IsBridge
virtual bool IsBridge(void) const
Return true if the net device is acting as a bridge.
Definition: sixlowpan-net-device.cc:506
ns3::SixLowPanNetDevice::m_ifIndex
uint32_t m_ifIndex
Interface index.
Definition: sixlowpan-net-device.h:592
ns3::SixLowPanNetDevice::Fragments::SetTimeoutIter
void SetTimeoutIter(FragmentsTimeoutsListI_t iter)
Set the Timeout iterator.
Definition: sixlowpan-net-device.cc:2584
ns3::SixLowPanNetDevice::RenewContext
void RenewContext(uint8_t contextId, Time validLifetime)
Renew a context used in IPHC stateful compression.
Definition: sixlowpan-net-device.cc:2708
ns3::SixLowPanNetDevice::m_forceEtherType
bool m_forceEtherType
Force the EtherType number.
Definition: sixlowpan-net-device.h:598
ns3::SixLowPanNetDevice::Fragments::SetPacketSize
void SetPacketSize(uint32_t packetSize)
Set the packet-to-be-defragmented size.
Definition: sixlowpan-net-device.cc:2566
ns3::Ptr< Channel >
ns3::SixLowPanNetDevice::DoSend
bool DoSend(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber, bool doSendFrom)
Definition: sixlowpan-net-device.cc:538
ns3::SixLowPanNetDevice::IsBroadcast
virtual bool IsBroadcast(void) const
Definition: sixlowpan-net-device.cc:458
ns3::SixLowPanNetDevice::FindMulticastCompressionContext
bool FindMulticastCompressionContext(Ipv6Address address, uint8_t &contextId)
Finds if the given multicast address matches a context for compression.
Definition: sixlowpan-net-device.cc:2792
ns3::SixLowPanNetDevice::DecompressLowPanUdpNhc
void DecompressLowPanUdpNhc(Ptr< Packet > packet, Ipv6Address saddr, Ipv6Address daddr)
Decompress the headers according to NHC compression.
Definition: sixlowpan-net-device.cc:2185
ns3::SixLowPanNetDevice::SixLowPanNetDevice
SixLowPanNetDevice()
Constructor for the SixLowPanNetDevice.
Definition: sixlowpan-net-device.cc:127
ns3::SixLowPanNetDevice::DoFragmentation
void DoFragmentation(Ptr< Packet > packet, uint32_t origPacketSize, uint32_t origHdrSize, uint32_t extraHdrSize, std::list< Ptr< Packet > > &listFragments)
Performs a packet fragmentation.
Definition: sixlowpan-net-device.cc:2254
ns3::SixLowPanNetDevice::m_bc0Serial
uint8_t m_bc0Serial
Serial number used in BC0 header.
Definition: sixlowpan-net-device.h:584
ns3::SixLowPanNetDevice::SetPromiscReceiveCallback
virtual void SetPromiscReceiveCallback(NetDevice::PromiscReceiveCallback cb)
Definition: sixlowpan-net-device.cc:702
ns3::SixLowPanNetDevice::Fragments::m_firstFragment
Ptr< Packet > m_firstFragment
The very first fragment.
Definition: sixlowpan-net-device.h:515
ns3::SixLowPanNetDevice::SetReceiveCallback
virtual void SetReceiveCallback(NetDevice::ReceiveCallback cb)
Definition: sixlowpan-net-device.cc:696
ns3::Address
a polymophic address class
Definition: address.h:91
ns3::SixLowPanNetDevice::m_meshCacheLength
uint16_t m_meshCacheLength
length of the cache for each source.
Definition: sixlowpan-net-device.h:586
ns3::SixLowPanNetDevice
Shim performing 6LoWPAN compression, decompression and fragmentation.
Definition: sixlowpan-net-device.h:66
ns3::SixLowPanNetDevice::CompressLowPanNhc
uint32_t CompressLowPanNhc(Ptr< Packet > packet, uint8_t headerType, Address const &src, Address const &dst)
Compress the headers according to NHC compression.
Definition: sixlowpan-net-device.cc:1654
ns3::SixLowPanNetDevice::GetNode
virtual Ptr< Node > GetNode(void) const
Definition: sixlowpan-net-device.cc:676
ns3::SixLowPanNetDevice::Send
virtual bool Send(Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber)
Definition: sixlowpan-net-device.cc:514
ns3::SixLowPanNetDevice::DROP_FRAGMENT_TIMEOUT
@ DROP_FRAGMENT_TIMEOUT
Fragment timeout exceeded.
Definition: sixlowpan-net-device.h:73
ns3::SixLowPanNetDevice::CompressLowPanIphc
uint32_t CompressLowPanIphc(Ptr< Packet > packet, Address const &src, Address const &dst)
Compress the headers according to IPHC compression.
Definition: sixlowpan-net-device.cc:940
ns3::SixLowPanNetDevice::operator=
SixLowPanNetDevice & operator=(SixLowPanNetDevice const &)
Copy constructor.
ns3::SixLowPanNetDevice::m_rxCallback
NetDevice::ReceiveCallback m_rxCallback
The callback used to notify higher layers that a packet has been received.
Definition: sixlowpan-net-device.h:282
ns3::SixLowPanNetDevice::Fragments::GetPacket
Ptr< Packet > GetPacket() const
Get the entire packet.
Definition: sixlowpan-net-device.cc:2536
ns3::SixLowPanNetDevice::GetTypeId
static TypeId GetTypeId(void)
Get the type ID.
Definition: sixlowpan-net-device.cc:49
first.address
address
Definition: first.py:44
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::SixLowPanNetDevice::m_dropTrace
TracedCallback< DropReason, Ptr< const Packet >, Ptr< SixLowPanNetDevice >, uint32_t > m_dropTrace
Callback to trace drop packets.
Definition: sixlowpan-net-device.h:327
ns3::SixLowPanNetDevice::SupportsSendFrom
virtual bool SupportsSendFrom() const
Definition: sixlowpan-net-device.cc:708
ns3::SixLowPanNetDevice::GetBroadcast
virtual Address GetBroadcast(void) const
Definition: sixlowpan-net-device.cc:466
ns3::SixLowPanNetDevice::GetContext
bool GetContext(uint8_t contextId, Ipv6Prefix &contextPrefix, bool &compressionAllowed, Time &validLifetime)
Get a context used in IPHC stateful compression.
Definition: sixlowpan-net-device.cc:2685
list
#define list
Definition: openflow-interface.h:47
ns3::SixLowPanNetDevice::DoDispose
virtual void DoDispose(void)
Destructor implementation.
Definition: sixlowpan-net-device.cc:169
ns3::SixLowPanNetDevice::Fragments::GetFraments
std::list< Ptr< Packet > > GetFraments() const
Get a list of the current stored fragments.
Definition: sixlowpan-net-device.cc:2572
ns3::SixLowPanNetDevice::RxTxTracedCallback
void(* RxTxTracedCallback)(Ptr< const Packet > packet, Ptr< SixLowPanNetDevice > sixNetDevice, uint32_t ifindex)
TracedCallback signature for packet send/receive events.
Definition: sixlowpan-net-device.h:161
ns3::SixLowPanNetDevice::Fragments::m_fragments
std::list< std::pair< Ptr< Packet >, uint16_t > > m_fragments
The current fragments.
Definition: sixlowpan-net-device.h:510
ns3::SixLowPanNetDevice::Fragments::Fragments
Fragments()
Constructor.
Definition: sixlowpan-net-device.cc:2460
ns3::SixLowPanNetDevice::DropOldestFragmentSet
void DropOldestFragmentSet()
Drops the oldest fragment set.
ns3::SixLowPanNetDevice::m_promiscRxCallback
NetDevice::PromiscReceiveCallback m_promiscRxCallback
The callback used to notify higher layers that a packet has been received in promiscuous mode.
Definition: sixlowpan-net-device.h:287
ns3::SixLowPanNetDevice::CompressLowPanUdpNhc
uint32_t CompressLowPanUdpNhc(Ptr< Packet > packet, bool omitChecksum)
Compress the headers according to NHC compression.
Definition: sixlowpan-net-device.cc:2130
ns3::SixLowPanNetDevice::ContextEntry
Structure holding the informations for a context (used in compression and decompression)
Definition: sixlowpan-net-device.h:611
ns3::SixLowPanNetDevice::m_etherType
uint16_t m_etherType
EtherType number (used only if m_forceEtherType is true).
Definition: sixlowpan-net-device.h:600
ns3::SixLowPanNetDevice::m_compressionThreshold
uint32_t m_compressionThreshold
Minimum L2 payload size.
Definition: sixlowpan-net-device.h:603
ns3::SixLowPanNetDevice::HandleTimeout
void HandleTimeout(void)
Handles a fragmented packet timeout.
Definition: sixlowpan-net-device.cc:2639
ns3::SixLowPanNetDevice::DecompressLowPanHc1
void DecompressLowPanHc1(Ptr< Packet > packet, Address const &src, Address const &dst)
Decompress the headers according to HC1 compression.
Definition: sixlowpan-net-device.cc:823
ns3::SixLowPanNetDevice::Fragments::AddFragment
void AddFragment(Ptr< Packet > fragment, uint16_t fragmentOffset)
Add a fragment to the pool.
Definition: sixlowpan-net-device.cc:2471
ns3::SixLowPanNetDevice::NeedsArp
virtual bool NeedsArp(void) const
Definition: sixlowpan-net-device.cc:688
packetSize
static const uint32_t packetSize
Definition: wifi-power-adaptation-distance.cc:113
ns3::SixLowPanNetDevice::FragmentsTimeoutsListI_t
std::list< std::tuple< Time, FragmentKey_t, uint32_t > >::iterator FragmentsTimeoutsListI_t
Container Iterator for fragment timeouts.
Definition: sixlowpan-net-device.h:416
ns3::SixLowPanNetDevice::m_rxTrace
TracedCallback< Ptr< const Packet >, Ptr< SixLowPanNetDevice >, uint32_t > m_rxTrace
Callback to trace RX (reception) packets.
Definition: sixlowpan-net-device.h:313
ns3::SixLowPanNetDevice::HandleFragmentsTimeout
void HandleFragmentsTimeout(FragmentKey_t key, uint32_t iif)
Process the timeout for packet fragments.
Definition: sixlowpan-net-device.cc:2596
ns3::SixLowPanNetDevice::DROP_FRAGMENT_BUFFER_FULL
@ DROP_FRAGMENT_BUFFER_FULL
Fragment buffer size exceeded.
Definition: sixlowpan-net-device.h:74
ns3::SixLowPanNetDevice::FragmentKey_t
std::pair< std::pair< Address, Address >, std::pair< uint16_t, uint16_t > > FragmentKey_t
Fragment identifier type: src/dst address src/dst port.
Definition: sixlowpan-net-device.h:411
ns3::SixLowPanNetDevice::AddLinkChangeCallback
virtual void AddLinkChangeCallback(Callback< void > callback)
Definition: sixlowpan-net-device.cc:450
ns3::SixLowPanNetDevice::m_rng
Ptr< UniformRandomVariable > m_rng
Rng for the fragments tag.
Definition: sixlowpan-net-device.h:605
ns3::SixLowPanNetDevice::m_netDevice
Ptr< NetDevice > m_netDevice
Smart pointer to the underlying NetDevice.
Definition: sixlowpan-net-device.h:591
ns3::SixLowPanNetDevice::CompressLowPanHc1
uint32_t CompressLowPanHc1(Ptr< Packet > packet, Address const &src, Address const &dst)
Compress the headers according to HC1 compression.
Definition: sixlowpan-net-device.cc:715
ns3::SixLowPanNetDevice::MapFragments_t
std::map< FragmentKey_t, Ptr< Fragments > > MapFragments_t
Container for fragment key -> fragments.
Definition: sixlowpan-net-device.h:566
ns3::SixLowPanNetDevice::Get16MacFrom48Mac
Address Get16MacFrom48Mac(Address addr)
Get a Mac16 from its Mac48 pseudo-MAC.
Definition: sixlowpan-net-device.cc:2613
ns3::SixLowPanNetDevice::ContextEntry::validLifetime
Time validLifetime
validity period
Definition: sixlowpan-net-device.h:614
ns3::SixLowPanNetDevice::m_timeoutEvent
EventId m_timeoutEvent
Event for the next scheduled timeout.
Definition: sixlowpan-net-device.h:433
ns3::NetDevice::PacketType
PacketType
Packet types are used as they are in Linux.
Definition: net-device.h:297
ns3::SixLowPanNetDevice::FindUnicastCompressionContext
bool FindUnicastCompressionContext(Ipv6Address address, uint8_t &contextId)
Finds if the given unicast address matches a context for compression.
Definition: sixlowpan-net-device.cc:2768
ns3::TracedCallback
Forward calls to a chain of Callback.
Definition: traced-callback.h:53
ns3::SixLowPanNetDevice::GetChannel
virtual Ptr< Channel > GetChannel(void) const
Definition: sixlowpan-net-device.cc:396
ns3::SixLowPanNetDevice::DropReason
DropReason
Enumeration of the dropping reasons in SixLoWPAN.
Definition: sixlowpan-net-device.h:72
ns3::SixLowPanNetDevice::m_meshUnderHopsLeft
uint8_t m_meshUnderHopsLeft
Start value for mesh-under hops left.
Definition: sixlowpan-net-device.h:585
ns3::SixLowPanNetDevice::ReceiveFromDevice
void ReceiveFromDevice(Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, Address const &source, Address const &destination, PacketType packetType)
Receives all the packets from a NetDevice for further processing.
Definition: sixlowpan-net-device.cc:191
ns3::SixLowPanNetDevice::m_fragmentExpirationTimeout
Time m_fragmentExpirationTimeout
Time limit for fragment rebuilding.
Definition: sixlowpan-net-device.h:573
ns3::SixLowPanNetDevice::m_contextTable
std::map< uint8_t, ContextEntry > m_contextTable
Table of the contexts used in compression/decompression.
Definition: sixlowpan-net-device.h:617
ns3::SixLowPanNetDevice::GetNetDevice
Ptr< NetDevice > GetNetDevice() const
Returns a smart pointer to the underlying NetDevice.
Definition: sixlowpan-net-device.cc:138
ns3::SixLowPanNetDevice::ContextEntry::contextPrefix
Ipv6Prefix contextPrefix
context prefix to be used in compression/decompression
Definition: sixlowpan-net-device.h:612
ns3::SixLowPanNetDevice::SetMtu
virtual bool SetMtu(const uint16_t mtu)
Definition: sixlowpan-net-device.cc:420
ns3::Ipv6Prefix
Describes an IPv6 prefix.
Definition: ipv6-address.h:456
ns3::SixLowPanNetDevice::GetIfIndex
virtual uint32_t GetIfIndex(void) const
Definition: sixlowpan-net-device.cc:390
ns3::SixLowPanNetDevice::RemoveContext
void RemoveContext(uint8_t contextId)
Remove a context used in IPHC stateful compression.
Definition: sixlowpan-net-device.cc:2748
ns3::SixLowPanNetDevice::SetNetDevice
void SetNetDevice(Ptr< NetDevice > device)
Setup SixLowPan to be a proxy for the specified NetDevice.
Definition: sixlowpan-net-device.cc:144
ns3::SixLowPanNetDevice::SendFrom
virtual bool SendFrom(Ptr< Packet > packet, const Address &source, const Address &dest, uint16_t protocolNumber)
Definition: sixlowpan-net-device.cc:526
ns3::SixLowPanNetDevice::DROP_SATETFUL_DECOMPRESSION_PROBLEM
@ DROP_SATETFUL_DECOMPRESSION_PROBLEM
Decompression failed due to missing or expired context.
Definition: sixlowpan-net-device.h:77
ns3::SixLowPanNetDevice::SixLowPanNetDevice
SixLowPanNetDevice(SixLowPanNetDevice const &)
Copy constructor.
ns3::NetDevice
Network layer to device interface.
Definition: net-device.h:96
ns3::SixLowPanNetDevice::DecompressLowPanNhc
std::pair< uint8_t, bool > DecompressLowPanNhc(Ptr< Packet > packet, Address const &src, Address const &dst, Ipv6Address srcAddress, Ipv6Address dstAddress)
Decompress the headers according to NHC compression.
Definition: sixlowpan-net-device.cc:1913
ns3::SixLowPanNetDevice::Fragments
A Set of Fragments.
Definition: sixlowpan-net-device.h:439
ns3::SixLowPanNetDevice::SetNode
virtual void SetNode(Ptr< Node > node)
Definition: sixlowpan-net-device.cc:682
ns3::SixLowPanNetDevice::m_omitUdpChecksum
bool m_omitUdpChecksum
Omit UDP checksum in NC1 encoding.
Definition: sixlowpan-net-device.h:601
ns3::SixLowPanNetDevice::DropTracedCallback
void(* DropTracedCallback)(DropReason reason, Ptr< const Packet > packet, Ptr< SixLowPanNetDevice > sixNetDevice, uint32_t ifindex)
TracedCallback signature fo packet drop events.
Definition: sixlowpan-net-device.h:176