PfifoFastIpv4PacketFilter is the filter to be added to the PfifoFast queue disc to simulate the behavior of the pfifo_fast Linux queue disc. More...
#include "ipv4-packet-filter.h"
Public Types | |
enum | Ipv4TrafficClassMode { PF_MODE_TOS, PF_MODE_DSCP } |
Enumeration of modes of Ipv4 header traffic class semantics. More... | |
Public Member Functions | |
PfifoFastIpv4PacketFilter () | |
virtual | ~PfifoFastIpv4PacketFilter () |
Public Member Functions inherited from ns3::Ipv4PacketFilter | |
Ipv4PacketFilter () | |
virtual | ~Ipv4PacketFilter () |
Public Member Functions inherited from ns3::PacketFilter | |
PacketFilter () | |
virtual | ~PacketFilter () |
int32_t | Classify (Ptr< QueueDiscItem > item) const |
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 |
Implement the GetInstanceTypeId method defined in ObjectBase. 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... | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
SimpleRefCount () | |
Constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment. 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::Ipv4PacketFilter | |
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::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
static void | Cleanup (void) |
Noop. 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 |
uint32_t | DscpToBand (Ipv4Header::DscpType dscpType) const |
uint32_t | TosToBand (uint8_t tos) const |
Private Attributes | |
Ipv4TrafficClassMode | m_trafficClassMode |
traffic class mode More... | |
Additional Inherited Members | |
Static Public Attributes inherited from ns3::PacketFilter | |
static const int | PF_NO_MATCH = -1 |
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... | |
Related Functions inherited from ns3::ObjectBase | |
static TypeId | GetObjectIid (void) |
Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. More... | |
PfifoFastIpv4PacketFilter is the filter to be added to the PfifoFast queue disc to simulate the behavior of the pfifo_fast Linux queue disc.
Introspection did not find any typical Config paths.
Two modes of operation are provided. In PF_MODE_TOS mode, packets are classified based on the TOS byte (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'.
In the eight-bit legacy TOS byte, there were five lower bits for TOS and three upper bits for Precedence. Bit 7 was never used. Bits 6-7 are now repurposed for ECN. The below TOS values correspond to bits 3-7 in the TOS byte (i.e. including MBZ), omitting the precedence bits 0-2.
TOS | Bits | Means | Linux Priority | Band |
---|---|---|---|---|
0x0 | 0 | Normal Service | 0 Best Effort | 1 |
0x2 | 1 | Minimize Monetary Cost | 1 Filler | 2 |
0x4 | 2 | Maximize Reliability | 0 Best Effort | 1 |
0x6 | 3 | mmc+mr | 0 Best Effort | 1 |
0x8 | 4 | Maximize Throughput | 2 Bulk | 2 |
0xa | 5 | mmc+mt | 2 Bulk | 2 |
0xc | 6 | mr+mt | 2 Bulk | 2 |
0xe | 7 | mmc+mr+mt | 2 Bulk | 2 |
0x10 | 8 | Minimize Delay | 6 Interactive | 0 |
0x12 | 9 | mmc+md | 6 Interactive | 0 |
0x14 | 10 | mr+md | 6 Interactive | 0 |
0x16 | 11 | mmc+mr+md | 6 Interactive | 0 |
0x18 | 12 | mt+md | 4 Int. Bulk | 1 |
0x1a | 13 | mmc+mt+md | 4 Int. Bulk | 1 |
0x1c | 14 | mr+mt+md | 4 Int. Bulk | 1 |
0x1e | 15 | mmc+mr+mt+md | 4 Int. Bulk | 1 |
In PF_MODE_TOS, the above values are used to map packets into bands, and IP precedence bits are disregarded.
In PF_MODE_DSCP (the default), the following mappings are used.
For DSCP, the following values are recommended for Linux in a patch to the netdev mailing list from Jesper Dangaard Brouer broue on 15 Sept 2014. CS* values I made up myself. r@re dhat. com
DSCP | Hex | Means | Linux Priority | Band |
---|---|---|---|---|
EF | 0x2E | TC_PRIO_INTERACTIVE_BULK=4 | 4 Int. Bulk | 1 |
AF11 | 0x0A | TC_PRIO_BULK=2 | 2 Bulk | 2 |
AF21 | 0x12 | TC_PRIO_BULK=2 | 2 Bulk | 2 |
AF31 | 0x1A | TC_PRIO_BULK=2 | 2 Bulk | 2 |
AF41 | 0x22 | TC_PRIO_BULK=2 | 2 Bulk | 2 |
AF12 | 0x0C | TC_PRIO_INTERACTIVE=6 | 6 Interactive | 0 |
AF22 | 0x14 | TC_PRIO_INTERACTIVE=6 | 6 Interactive | 0 |
AF32 | 0x1C | TC_PRIO_INTERACTIVE=6 | 6 Interactive | 0 |
AF42 | 0x34 | TC_PRIO_INTERACTIVE=6 | 6 Interactive | 0 |
AF13 | 0x0E | TC_PRIO_INTERACTIVE_BULK=4 | 4 Int. Bulk | 1 |
AF23 | 0x16 | TC_PRIO_INTERACTIVE_BULK=4 | 4 Int. Bulk | 1 |
AF33 | 0x1E | TC_PRIO_INTERACTIVE_BULK=4 | 4 Int. Bulk | 1 |
AF43 | 0x26 | TC_PRIO_INTERACTIVE_BULK=4 | 4 Int. Bulk | 1 |
CS0 | 0x00 | TC_PRIO_BESTEFFORT | 0 Best Effort | 1 |
CS1 | 0x20 | TC_PRIO_FILLER | 1 Filler | 2 |
CS2 | 0x40 | TC_PRIO_BULK | 2 Bulk | 1 |
CS3 | 0x60 | TC_PRIO_INTERACTIVE_BULK | 4 Int. Bulk | 1 |
CS4 | 0x80 | TC_PRIO_INTERACTIVE | 6 Interactive | 0 |
CS5 | 0xA0 | TC_PRIO_INTERACTIVE | 6 Interactive | 0 |
CS6 | 0xC0 | TC_PRIO_INTERACTIVE | 6 Interactive | 0 |
CS7 | 0xE0 | TC_PRIO_CONTROL | 8 Control | 0 |
No TraceSources are defined for this type.
Size of this type is 32 bytes (on a 64-bit architecture).
Definition at line 129 of file ipv4-packet-filter.h.
ns3::PfifoFastIpv4PacketFilter::PfifoFastIpv4PacketFilter | ( | ) |
Definition at line 82 of file ipv4-packet-filter.cc.
References NS_LOG_FUNCTION.
|
virtual |
Definition at line 87 of file ipv4-packet-filter.cc.
References NS_LOG_FUNCTION.
|
privatevirtual |
Implements ns3::Ipv4PacketFilter.
Definition at line 93 of file ipv4-packet-filter.cc.
References DscpToBand(), m_trafficClassMode, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, PF_MODE_TOS, and TosToBand().
|
private |
Definition at line 153 of file ipv4-packet-filter.cc.
References ns3::Ipv4Header::DSCP_AF11, ns3::Ipv4Header::DSCP_AF12, ns3::Ipv4Header::DSCP_AF13, ns3::Ipv4Header::DSCP_AF21, ns3::Ipv4Header::DSCP_AF22, ns3::Ipv4Header::DSCP_AF23, ns3::Ipv4Header::DSCP_AF31, ns3::Ipv4Header::DSCP_AF32, ns3::Ipv4Header::DSCP_AF33, ns3::Ipv4Header::DSCP_AF41, ns3::Ipv4Header::DSCP_AF42, ns3::Ipv4Header::DSCP_AF43, ns3::Ipv4Header::DSCP_CS1, ns3::Ipv4Header::DSCP_CS2, ns3::Ipv4Header::DSCP_CS3, ns3::Ipv4Header::DSCP_CS4, ns3::Ipv4Header::DSCP_CS5, ns3::Ipv4Header::DSCP_CS6, ns3::Ipv4Header::DSCP_CS7, ns3::Ipv4Header::DSCP_EF, ns3::Ipv4Header::DscpDefault, NS_LOG_DEBUG, and NS_LOG_FUNCTION.
Referenced by DoClassify().
|
static |
Get the type ID.
Definition at line 66 of file ipv4-packet-filter.cc.
References m_trafficClassMode, ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), PF_MODE_DSCP, PF_MODE_TOS, and ns3::TypeId::SetParent().
|
private |
Definition at line 118 of file ipv4-packet-filter.cc.
References NS_LOG_ERROR, and NS_LOG_FUNCTION.
Referenced by DoClassify().
|
private |
traffic class mode
Definition at line 154 of file ipv4-packet-filter.h.
Referenced by DoClassify(), and GetTypeId().