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

Introspection did not find any typical Config paths. More...

#include "qkd-packet-filter.h"

+ Inheritance diagram for ns3::PfifoFastQKDPacketFilter:
+ Collaboration diagram for ns3::PfifoFastQKDPacketFilter:

Public Types

enum  QKDTrafficClassMode { PF_MODE_TOS, PF_MODE_DSCP }
 Enumeration of modes of Ipv4 header traffic class semantics. More...
 

Public Member Functions

 PfifoFastQKDPacketFilter ()
 
virtual ~PfifoFastQKDPacketFilter ()
 
uint32_t TosToBand (uint8_t tos) const
 
- Public Member Functions inherited from ns3::QKDPacketFilter
 QKDPacketFilter ()
 
virtual ~QKDPacketFilter ()
 
- Public Member Functions inherited from ns3::PacketFilter
 PacketFilter ()
 
virtual ~PacketFilter ()
 
int32_t Classify (Ptr< QueueDiscItem > item) const
 Classify a packet. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together. More...
 
void Dispose (void)
 Dispose of this Object. More...
 
AggregateIterator GetAggregateIterator (void) const
 Get an iterator to the Objects aggregated to this one. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the most derived TypeId for this Object. More...
 
template<typename T >
Ptr< T > GetObject (void) const
 Get a pointer to the requested aggregated Object. More...
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId. More...
 
void Initialize (void)
 Invoke DoInitialize on all Objects aggregated to this one. More...
 
bool IsInitialized (void) const
 Check if the object has been initialized. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 Get the value of an attribute, raising fatal errors if unsuccessful. More...
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising erros. More...
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful. More...
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors. More...
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context. More...
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context. More...
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context. More...
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context. More...
 

Static Public Member Functions

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

Private Member Functions

virtual int32_t DoClassify (Ptr< QueueDiscItem > item) const
 Classify a packet. More...
 
uint32_t DscpToBand (Ipv4Header::DscpType dscpType) const
 

Private Attributes

QKDTrafficClassMode m_trafficClassMode
 traffic class mode More...
 
const uint32_t prio2band [16] = {1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1}
 

Additional Inherited Members

- Static Public Attributes inherited from ns3::PacketFilter
static const int PF_NO_MATCH = -1
 Standard value used by packet filters to indicate that no match was possible. More...
 
- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object. More...
 
virtual void DoDispose (void)
 Destructor implementation. More...
 
virtual void DoInitialize (void)
 Initialize() implementation. More...
 
virtual void NotifyNewAggregate (void)
 Notify all Objects aggregated to this one of a new Object being aggregated. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes. More...
 
virtual void NotifyConstructionCompleted (void)
 Notifier called once the ObjectBase is fully constructed. More...
 

Detailed Description

Introspection did not find any typical Config paths.

Return the priority corresponding to a given TOS value.


Attributes

  • Mode: Whether to interpret the TOS byte as legacy TOS or DSCP
    • Set with class: ns3::EnumValue
    • Underlying type:
    • Initial value: TOS semantics
    • Flags: construct write read

No TraceSources are defined for this type.
Size of this type is 96 bytes (on a 64-bit architecture).

We use it for sorting of packets in waiting queues based on TOS value

This function is implemented after the Linux rt_tos2priority function. The usage of the TOS byte has been originally defined by RFC 1349 (http://www.ietf.org/rfc/rfc1349.txt):

          0     1     2     3     4     5     6     7
      +-----+-----+-----+-----+-----+-----+-----+-----+
      |   PRECEDENCE    |          TOS          | MBZ |
      +-----+-----+-----+-----+-----+-----+-----+-----+

where MBZ stands for 'must be zero'.

The Linux rt_tos2priority function ignores the precedence bits and maps each of the 16 values coded in bits 3-6 as follows:

Bits 3-6 Means Linux Priority
0 Normal Service Best Effort (0)
1 Minimize Monetary Cost Best Effort (0)
2 Maximize Reliability Best Effort (0)
3 mmc+mr Best Effort (0)
4 Maximize Throughput Bulk (2)
5 mmc+mt Bulk (2)
6 mr+mt Bulk (2)
7 mmc+mr+mt Bulk (2)
8 Minimize Delay Interactive (6)
9 mmc+md Interactive (6)
10 mr+md Interactive (6)
11 mmc+mr+md Interactive (6)
12 mt+md Int. Bulk (4)
13 mmc+mt+md Int. Bulk (4)
14 mr+mt+md Int. Bulk (4)
15 mmc+mr+mt+md Int. Bulk (4)

RFC 2474 (http://www.ietf.org/rfc/rfc2474.txt) redefines the TOS byte:

          0     1     2     3     4     5     6     7
      +-----+-----+-----+-----+-----+-----+-----+-----+
      |              DSCP                 |     CU    |
      +-----+-----+-----+-----+-----+-----+-----+-----+

where DSCP is the Differentiated Services Code Point and CU stands for 'currently unused' (actually, RFC 3168 proposes to use these two bits for ECN purposes). The table above allows to determine how the Linux rt_tos2priority function maps each DSCP value to a priority value. Such a mapping is shown below.

DSCP Hex TOS (binary) bits 3-6 Linux Priority
EF 0x2E 101110xx 12-13 Int. Bulk (4)
AF11 0x0A 001010xx 4-5 Bulk (2)
AF21 0x12 010010xx 4-5 Bulk (2)
AF31 0x1A 011010xx 4-5 Bulk (2)
AF41 0x22 100010xx 4-5 Bulk (2)
AF12 0x0C 001100xx 8-9 Interactive (6)
AF22 0x14 010100xx 8-9 Interactive (6)
AF32 0x1C 011100xx 8-9 Interactive (6)
AF42 0x24 100100xx 8-9 Interactive (6)
AF13 0x0E 001110xx 12-13 Int. Bulk (4)
AF23 0x16 010110xx 12-13 Int. Bulk (4)
AF33 0x1E 011110xx 12-13 Int. Bulk (4)
AF43 0x26 100110xx 12-13 Int. Bulk (4)
CS0 0x00 000000xx 0-1 Best Effort (0)
CS1 0x08 001000xx 0-1 Best Effort (0)
CS2 0x10 010000xx 0-1 Best Effort (0)
CS3 0x18 011000xx 0-1 Best Effort (0)
CS4 0x20 100000xx 0-1 Best Effort (0)
CS5 0x28 101000xx 0-1 Best Effort (0)
CS6 0x30 110000xx 0-1 Best Effort (0)
CS7 0x38 111000xx 0-1 Best Effort (0)
Parameters
ipTosthe TOS value (in the range 0..255)
Returns
The priority value corresponding to the given TOS value

Definition at line 136 of file qkd-packet-filter.h.

Member Enumeration Documentation

Enumeration of modes of Ipv4 header traffic class semantics.

Enumerator
PF_MODE_TOS 

use legacy TOS semantics to interpret TOS byte

PF_MODE_DSCP 

use DSCP semantics to interpret TOS byte

Definition at line 150 of file qkd-packet-filter.h.

Constructor & Destructor Documentation

ns3::PfifoFastQKDPacketFilter::PfifoFastQKDPacketFilter ( )

Definition at line 83 of file qkd-packet-filter.cc.

References NS_LOG_FUNCTION.

ns3::PfifoFastQKDPacketFilter::~PfifoFastQKDPacketFilter ( )
virtual

Definition at line 88 of file qkd-packet-filter.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

int32_t ns3::PfifoFastQKDPacketFilter::DoClassify ( Ptr< QueueDiscItem item) const
privatevirtual

Classify a packet.

Parameters
itemthe packet to classify.
Returns
-1 if the item does not match the filter conditions, or the configured return value otherwise.

Implements ns3::QKDPacketFilter.

Definition at line 94 of file qkd-packet-filter.cc.

References ns3::SocketIpTosTag::GetTos(), NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Packet::PeekPacketTag().

+ Here is the call graph for this function:

TypeId ns3::PfifoFastQKDPacketFilter::GetTypeId ( void  )
static

Get the type ID.

Returns
the object TypeId

Definition at line 67 of file qkd-packet-filter.cc.

References m_trafficClassMode, ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

uint32_t ns3::PfifoFastQKDPacketFilter::TosToBand ( uint8_t  tos) const

Definition at line 132 of file qkd-packet-filter.cc.

References NS_LOG_DEBUG, and NS_LOG_FUNCTION.

Member Data Documentation

QKDTrafficClassMode ns3::PfifoFastQKDPacketFilter::m_trafficClassMode
private

traffic class mode

Definition at line 165 of file qkd-packet-filter.h.

Referenced by GetTypeId().

const uint32_t ns3::PfifoFastQKDPacketFilter::prio2band[16] = {1, 2, 2, 2, 1, 2, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1}
private

Definition at line 160 of file qkd-packet-filter.h.


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