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

Ipv6QueueDiscItem is a subclass of QueueDiscItem which stores IPv6 packets. More...

#include "ipv6-queue-disc-item.h"

+ Inheritance diagram for ns3::Ipv6QueueDiscItem:
+ Collaboration diagram for ns3::Ipv6QueueDiscItem:

Public Member Functions

 Ipv6QueueDiscItem ()=delete
 
 Ipv6QueueDiscItem (const Ipv6QueueDiscItem &)=delete
 
 Ipv6QueueDiscItem (Ptr< Packet > p, const Address &addr, uint16_t protocol, const Ipv6Header &header)
 Create an IPv6 queue disc item containing an IPv6 packet.
 
 ~Ipv6QueueDiscItem () override
 
void AddHeader () override
 Add the header to the packet.
 
const Ipv6HeaderGetHeader () const
 
uint32_t GetSize () const override
 
bool GetUint8Value (Uint8Values field, uint8_t &value) const override
 Retrieve the value of a given field from the packet, if present.
 
uint32_t Hash (uint32_t perturbation) const override
 Computes the hash of the packet's 5-tuple.
 
bool Mark () override
 Marks the packet by setting ECN_CE bits if the packet has ECN_ECT0 or ECN_ECT1 set.
 
Ipv6QueueDiscItemoperator= (const Ipv6QueueDiscItem &)=delete
 
void Print (std::ostream &os) const override
 Print the item contents.
 
- Public Member Functions inherited from ns3::QueueDiscItem
 QueueDiscItem ()=delete
 
 QueueDiscItem (const QueueDiscItem &)=delete
 
 QueueDiscItem (Ptr< Packet > p, const Address &addr, uint16_t protocol)
 Create a queue disc item.
 
 ~QueueDiscItem () override
 
virtual void AddHeader ()=0
 Add the header to the packet.
 
Address GetAddress () const
 Get the MAC address included in this item.
 
uint16_t GetProtocol () const
 Get the L3 protocol included in this item.
 
Time GetTimeStamp () const
 Get the timestamp included in this item.
 
uint8_t GetTxQueueIndex () const
 Get the transmission queue index included in this item.
 
virtual uint32_t Hash (uint32_t perturbation=0) const
 Computes the hash of various fields of the packet header.
 
virtual bool Mark ()=0
 Marks the packet as a substitute for dropping it, such as for Explicit Congestion Notification.
 
QueueDiscItemoperator= (const QueueDiscItem &)=delete
 
void Print (std::ostream &os) const override
 Print the item contents.
 
void SetTimeStamp (Time t)
 Set the timestamp included in this item.
 
void SetTxQueueIndex (uint8_t txq)
 Set the transmission queue index to store in this item.
 
- Public Member Functions inherited from ns3::QueueItem
 QueueItem ()=delete
 
 QueueItem (const QueueItem &)=delete
 
 QueueItem (Ptr< Packet > p)
 Create a queue item containing a packet.
 
virtual ~QueueItem ()
 
Ptr< PacketGetPacket () const
 
virtual uint32_t GetSize () const
 Use this method (instead of GetPacket ()->GetSize ()) to get the packet size.
 
virtual bool GetUint8Value (Uint8Values field, uint8_t &value) const
 Retrieve the value of a given field from the packet, if present.
 
QueueItemoperator= (const QueueItem &)=delete
 
virtual void Print (std::ostream &os) const
 Print the item contents.
 
- Public Member Functions inherited from ns3::SimpleRefCount< QueueItem >
 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.
 

Private Attributes

Ipv6Header m_header
 The IPv6 header.
 
bool m_headerAdded
 True if the header has already been added to the packet.
 

Additional Inherited Members

- Public Types inherited from ns3::QueueItem
typedef void(* TracedCallback) (Ptr< const QueueItem > item)
 TracedCallback signature for Ptr<QueueItem>
 
enum  Uint8Values { IP_DSFIELD }
 1-byte fields of the packet whose value can be retrieved, if present More...
 

Detailed Description

Ipv6QueueDiscItem is a subclass of QueueDiscItem which stores IPv6 packets.

Header and payload are kept separate to allow the queue disc to manipulate the header, which is added to the packet when the packet is dequeued.

Definition at line 37 of file ipv6-queue-disc-item.h.

Constructor & Destructor Documentation

◆ Ipv6QueueDiscItem() [1/3]

ns3::Ipv6QueueDiscItem::Ipv6QueueDiscItem ( Ptr< Packet p,
const Address addr,
uint16_t  protocol,
const Ipv6Header header 
)

Create an IPv6 queue disc item containing an IPv6 packet.

Parameters
pthe packet included in the created item.
addrthe destination MAC address
protocolthe protocol number
headerthe IPv6 header

Definition at line 30 of file ipv6-queue-disc-item.cc.

◆ ~Ipv6QueueDiscItem()

ns3::Ipv6QueueDiscItem::~Ipv6QueueDiscItem ( )
override

Definition at line 40 of file ipv6-queue-disc-item.cc.

References NS_LOG_FUNCTION.

◆ Ipv6QueueDiscItem() [2/3]

ns3::Ipv6QueueDiscItem::Ipv6QueueDiscItem ( )
delete

◆ Ipv6QueueDiscItem() [3/3]

ns3::Ipv6QueueDiscItem::Ipv6QueueDiscItem ( const Ipv6QueueDiscItem )
delete

Member Function Documentation

◆ AddHeader()

void ns3::Ipv6QueueDiscItem::AddHeader ( )
overridevirtual

Add the header to the packet.

Implements ns3::QueueDiscItem.

Definition at line 66 of file ipv6-queue-disc-item.cc.

References ns3::QueueItem::GetPacket(), m_header, m_headerAdded, NS_ASSERT, NS_ASSERT_MSG, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetHeader()

const Ipv6Header & ns3::Ipv6QueueDiscItem::GetHeader ( ) const
Returns
the header stored in this item..

Definition at line 60 of file ipv6-queue-disc-item.cc.

References m_header.

◆ GetSize()

uint32_t ns3::Ipv6QueueDiscItem::GetSize ( ) const
overridevirtual
Returns
the correct packet size (header plus payload).

Reimplemented from ns3::QueueItem.

Definition at line 46 of file ipv6-queue-disc-item.cc.

References ns3::QueueItem::GetPacket(), ns3::Ipv6Header::GetSerializedSize(), m_header, m_headerAdded, NS_ASSERT, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetUint8Value()

bool ns3::Ipv6QueueDiscItem::GetUint8Value ( QueueItem::Uint8Values  field,
uint8_t &  value 
) const
overridevirtual

Retrieve the value of a given field from the packet, if present.

Parameters
fieldthe field whose value has to be retrieved
valuethe output parameter to store the retrieved value
Returns
true if the requested field is present in the packet, false otherwise.

Reimplemented from ns3::QueueItem.

Definition at line 103 of file ipv6-queue-disc-item.cc.

References ns3::Ipv6Header::GetTrafficClass(), ns3::QueueItem::IP_DSFIELD, and m_header.

+ Here is the call graph for this function:

◆ Hash()

uint32_t ns3::Ipv6QueueDiscItem::Hash ( uint32_t  perturbation) const
overridevirtual

Computes the hash of the packet's 5-tuple.

Computes the hash of the source and destination IP addresses, protocol number and, if the transport protocol is either UDP or TCP, the source and destination port

Parameters
perturbationhash perturbation value
Returns
the hash of the packet's 5-tuple

Reimplemented from ns3::QueueDiscItem.

Definition at line 119 of file ipv6-queue-disc-item.cc.

References ns3::Ipv6Header::GetDestination(), ns3::TcpHeader::GetDestinationPort(), ns3::UdpHeader::GetDestinationPort(), ns3::Ipv6Header::GetNextHeader(), ns3::QueueItem::GetPacket(), ns3::Ipv6Header::GetSource(), ns3::TcpHeader::GetSourcePort(), ns3::UdpHeader::GetSourcePort(), ns3::Hash32(), m_header, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_WARN, ns3::Packet::PeekHeader(), and ns3::Ipv6Address::Serialize().

Referenced by operator=().

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

◆ Mark()

bool ns3::Ipv6QueueDiscItem::Mark ( )
overridevirtual

Marks the packet by setting ECN_CE bits if the packet has ECN_ECT0 or ECN_ECT1 set.

If ECN_CE is already set, returns true.

Returns
true if the method results in a marked packet, false otherwise

Implements ns3::QueueDiscItem.

Definition at line 91 of file ipv6-queue-disc-item.cc.

References ns3::Ipv6Header::ECN_CE, ns3::Ipv6Header::ECN_NotECT, ns3::Ipv6Header::GetEcn(), m_header, m_headerAdded, NS_LOG_FUNCTION, and ns3::Ipv6Header::SetEcn().

+ Here is the call graph for this function:

◆ operator=()

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

References Hash().

+ Here is the call graph for this function:

◆ Print()

void ns3::Ipv6QueueDiscItem::Print ( std::ostream &  os) const
overridevirtual

Print the item contents.

Parameters
osoutput stream in which the data should be printed.

Reimplemented from ns3::QueueItem.

Definition at line 78 of file ipv6-queue-disc-item.cc.

References ns3::QueueDiscItem::GetAddress(), ns3::QueueItem::GetPacket(), ns3::QueueDiscItem::GetProtocol(), ns3::QueueDiscItem::GetTxQueueIndex(), m_header, and m_headerAdded.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_header

Ipv6Header ns3::Ipv6QueueDiscItem::m_header
private

The IPv6 header.

Definition at line 109 of file ipv6-queue-disc-item.h.

Referenced by AddHeader(), GetHeader(), GetSize(), GetUint8Value(), Hash(), Mark(), and Print().

◆ m_headerAdded

bool ns3::Ipv6QueueDiscItem::m_headerAdded
private

True if the header has already been added to the packet.

Definition at line 110 of file ipv6-queue-disc-item.h.

Referenced by AddHeader(), GetSize(), Mark(), and Print().


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