classifies IP packets according to Traffic Flow Templates (TFTs) More...
#include "epc-tft-classifier.h"
Public Member Functions | |
EpcTftClassifier () | |
void | Add (Ptr< EpcTft > tft, uint32_t id) |
add a TFT to the Classifier | |
uint32_t | Classify (Ptr< Packet > p, EpcTft::Direction direction, uint16_t protocolNumber) |
classify an IP packet | |
void | Delete (uint32_t id) |
delete an existing TFT from the classifier | |
Public Member Functions inherited from ns3::SimpleRefCount< EpcTftClassifier > | |
SimpleRefCount () | |
Default constructor. | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. | |
void | Ref () const |
Increment the reference count. | |
void | Unref () const |
Decrement the reference count. | |
Protected Attributes | |
std::map< std::tuple< uint32_t, uint32_t, uint8_t, uint16_t >, std::pair< uint32_t, uint32_t > > | m_classifiedIpv4Fragments |
Map with already classified IPv4 Fragments An entry is added when the port info is available, i.e. | |
std::map< uint32_t, Ptr< EpcTft > > | m_tftMap |
TFT map. | |
classifies IP packets according to Traffic Flow Templates (TFTs)
The following actions are performed to use the port info present in the first segment with the next fragments:
When we cannot cache the port info, the TFT of the default bearer is used. This may happen if there is reordering or losses of IP packets.
Definition at line 41 of file epc-tft-classifier.h.
ns3::EpcTftClassifier::EpcTftClassifier | ( | ) |
Definition at line 36 of file epc-tft-classifier.cc.
References NS_LOG_FUNCTION.
add a TFT to the Classifier
tft | the TFT to be added |
id | the ID of the bearer which will be classified by specified TFT classifier |
Definition at line 42 of file epc-tft-classifier.cc.
References m_tftMap, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by ns3::EpcUeNas::DoActivateEpsBearer().
uint32_t ns3::EpcTftClassifier::Classify | ( | Ptr< Packet > | p, |
EpcTft::Direction | direction, | ||
uint16_t | protocolNumber ) |
classify an IP packet
p | the IP packet. The outmost header can only be an IPv4 or an IPv6 header. |
direction | the EPC TFT direction (can be downlink, uplink or bi-directional) |
protocolNumber | the protocol of the packet. Only IPv4 and IPv6 are supported. |
Definition at line 59 of file epc-tft-classifier.cc.
References ns3::EpcTft::DOWNLINK, ns3::Ipv4Address::Get(), ns3::Ipv4Header::GetDestination(), ns3::Ipv6Header::GetDestination(), ns3::TcpHeader::GetDestinationPort(), ns3::UdpHeader::GetDestinationPort(), ns3::Ipv4Header::GetFragmentOffset(), ns3::Ipv4Header::GetIdentification(), ns3::Ipv6Header::GetNextHeader(), ns3::Ipv4Header::GetPayloadSize(), ns3::Ipv4Header::GetProtocol(), ns3::Ipv4Header::GetSource(), ns3::Ipv6Header::GetSource(), ns3::TcpHeader::GetSourcePort(), ns3::UdpHeader::GetSourcePort(), ns3::Ipv4Header::GetTos(), ns3::Ipv6Header::GetTrafficClass(), ns3::Ipv4Header::IsLastFragment(), m_classifiedIpv4Fragments, m_tftMap, NS_ABORT_MSG, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, ns3::Ipv4L3Protocol::PROT_NUMBER, ns3::Ipv6L3Protocol::PROT_NUMBER, ns3::TcpL4Protocol::PROT_NUMBER, ns3::UdpL4Protocol::PROT_NUMBER, and ns3::EpcTft::UPLINK.
Referenced by ns3::EpcUeNas::Send().
void ns3::EpcTftClassifier::Delete | ( | uint32_t | id | ) |
delete an existing TFT from the classifier
id | the identifier of the TFT to be deleted |
Definition at line 52 of file epc-tft-classifier.cc.
References m_tftMap, and NS_LOG_FUNCTION.
Referenced by ns3::EpcUeNas::DoNotifyConnectionReleased().
|
protected |
Map with already classified IPv4 Fragments An entry is added when the port info is available, i.e.
first fragment, UDP/TCP protocols and enough payload data An entry is used if port info is not available, i.e. not first fragment or not enough payload data for TCP/UDP An entry is removed when the last fragment is classified Note: If last fragment is lost, entry is not removed
Definition at line 78 of file epc-tft-classifier.h.
Referenced by Classify().
TFT map.
Definition at line 75 of file epc-tft-classifier.h.
Referenced by Add(), Classify(), and Delete().