Flent is a network benchmarking tool. More...
#include "flent-application.h"
Classes | |
| struct | Output |
| Flent output document, in JSON format. More... | |
Public Member Functions | |
| FlentApplication () | |
| ~FlentApplication () override | |
| Public Member Functions inherited from ns3::Application | |
| Application () | |
| ~Application () override | |
| virtual int64_t | AssignStreams (int64_t stream) |
| Assign a fixed random variable stream number to the random variables used by this Application object. | |
| Ptr< Node > | GetNode () const |
| void | SetNode (Ptr< Node > node) |
| void | SetStartTime (Time start) |
| Specify application start time. | |
| void | SetStopTime (Time stop) |
| Specify application stop time. | |
| Public Member Functions inherited from ns3::Object | |
| Object () | |
| Caller graph was not generated because of its size. | |
| ~Object () override | |
| Destructor. | |
| void | AggregateObject (Ptr< Object > other) |
| Aggregate two Objects together. | |
| void | Dispose () |
| Dispose of this Object. | |
| AggregateIterator | GetAggregateIterator () const |
| Get an iterator to the Objects aggregated to this one. | |
| TypeId | GetInstanceTypeId () const final |
| Get the most derived TypeId for this Object. | |
| template<> | |
| Ptr< Object > | GetObject () const |
| Specialization of () for objects of type ns3::Object. | |
| template<typename T> | |
| Ptr< T > | GetObject () const |
| Get a pointer to the requested aggregated Object. | |
| template<> | |
| Ptr< Object > | GetObject (TypeId tid) const |
| Specialization of (TypeId tid) for objects of type ns3::Object. | |
| template<typename T> | |
| Ptr< T > | GetObject (TypeId tid) const |
| Get a pointer to the requested aggregated Object by TypeId. | |
| void | Initialize () |
| Invoke DoInitialize on all Objects aggregated to this one. | |
| bool | IsInitialized () const |
| Check if the object has been initialized. | |
| void | UnidirectionalAggregateObject (Ptr< Object > other) |
| Aggregate an Object to another Object. | |
| Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
| SimpleRefCount () | |
| Default 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. | |
| Public Member Functions inherited from ns3::ObjectBase | |
| virtual | ~ObjectBase () |
| Virtual destructor. | |
| void | GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const |
| Get the value of an attribute, raising fatal errors if unsuccessful. | |
| bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
| Get the value of an attribute without raising errors. | |
| void | SetAttribute (std::string name, const AttributeValue &value) |
| Set a single attribute, raising fatal errors if unsuccessful. | |
| bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
| Set a single attribute without raising errors. | |
| bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
| Connect a TraceSource to a Callback with a context. | |
| bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
| Connect a TraceSource to a Callback without a context. | |
| bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
| Disconnect from a TraceSource a Callback previously connected with a context. | |
| bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
| Disconnect from a TraceSource a Callback previously connected without a context. | |
Static Public Member Functions | |
| static TypeId | GetTypeId () |
| Get the type ID. | |
| Static Public Member Functions inherited from ns3::Application | |
| static TypeId | GetTypeId () |
| Get the type ID. | |
| Static Public Member Functions inherited from ns3::Object | |
| static TypeId | GetTypeId () |
| Register this type. | |
| Static Public Member Functions inherited from ns3::ObjectBase | |
| static TypeId | GetTypeId () |
| Get the type ID. | |
Protected Member Functions | |
| void | DoDispose () override |
| void | DoInitialize () override |
| In this method, the following tasks are performed: 1) set the host node, which is derived from the host address. | |
| Protected Member Functions inherited from ns3::Object | |
| Object (const Object &o) | |
| Copy an Object. | |
| virtual void | NotifyNewAggregate () |
| Notify all Objects aggregated to this one of a new Object being aggregated. | |
| Protected Member Functions inherited from ns3::ObjectBase | |
| void | ConstructSelf (const AttributeConstructionList &attributes) |
| Complete construction of ObjectBase; invoked by derived classes. | |
| virtual void | NotifyConstructionCompleted () |
| Notifier called once the ObjectBase is fully constructed. | |
Private Member Functions | |
| void | AddMetadata () |
| Add Flent metadata to the output document. | |
| void | FillXValues () |
| Fill x_values parameter in Flent file. | |
| Ptr< Node > | GetHostNode (Ipv4Address hostAddress) const |
| Iterates through the node list and finds the node pointer for the given hostAddress. | |
| std::string | GetUtcFormatTime () const |
| Calculate the Time in UTC time format from the number of seconds. | |
| void | GoodputSamplingDownload (std::string name, int i) |
| Goodput calculation for the i-th flow based on the bytes received. | |
| void | GoodputSamplingUpload (std::string name, int i) |
| Goodput calculation for the i-th flow based on the bytes sent. | |
| void | ProcessRawValues () |
| Process raw values and add the processed result in the Flent file. | |
| void | StartApplication () override |
| Application specific startup code. | |
| void | StopApplication () override |
| Application specific shutdown code. | |
| void | TraceReceivedPacket (std::size_t idx, Ptr< const Packet > packet, const Address &address) |
| sink for packet received. | |
| void | TraceReceivedPing (uint16_t seq, Time rtt) |
| Ping RTT Trace function. | |
| void | TraceReceivedUdpPing (std::size_t idx, Ptr< const Packet > packet, const Address &address, const Address &localAddress, const SeqTsEchoHeader &header) |
| UDP Ping RTT Trace function. | |
| void | TraceSentPacket (std::size_t idx, Ptr< const Packet > packet) |
| sink for packet transmissions. | |
Private Attributes | |
| std::array< Ptr< BulkSendApplication >, 4 > | m_bulkSendDown |
| BulkSend Applications for Download flows (tcp_download, rrul tests). | |
| std::array< Ptr< BulkSendApplication >, 4 > | m_bulkSendUp |
| BulkSend Applications for Upload flows (tcp_upload, rrul tests). | |
| std::array< uint32_t, 4 > | m_bytesReceived {} |
| receive data counters | |
| std::array< uint32_t, 4 > | m_bytesSent {} |
| sent data counters | |
| double | m_currTime |
| Derived epoch anchor in seconds. | |
| Address | m_hostAddress |
| Host address. | |
| std::string | m_imageText |
| Text to be included in plot. | |
| Time | m_length |
| Test duration. | |
| Address | m_localBindAddress |
| Local bind address. | |
| std::unique_ptr< Output > | m_output |
| Opaque JSON output document (defined in the .cc file). | |
| std::string | m_outputFilename |
| Output file path (see OutputFilename attribute). | |
| std::array< Ptr< PacketSink >, 4 > | m_packetSinkDown |
| PacketSink Applications for Download flows (tcp_download, rrul tests). | |
| std::array< Ptr< PacketSink >, 4 > | m_packetSinkUp |
| PacketSink Applications for Upload flows (tcp_upload, rrul tests). | |
| Ptr< Ping > | m_ping |
| Ping Application for latency measurement (ping, rrul tests). | |
| Time | m_stepSize |
| Measurement data point step size. | |
| Time | m_t0 |
| Epoch anchor for output timestamps (see T0 attribute). | |
| std::string | m_testName |
| Flent test name. | |
| std::array< Ptr< UdpEchoClient >, 3 > | m_udpClient |
| UdpEchoClient Applications. | |
| std::array< Ptr< UdpEchoServer >, 3 > | m_udpServer |
| UdpEchoServer Applications. | |
| bool | m_useWallClockT0 |
| Use the wall clock instead of m_t0 (see UseWallClockT0 attribute). | |
Additional Inherited Members | |
| Public Types inherited from ns3::Application | |
| typedef void(* | DelayAddressCallback) (const Time &delay, const Address &from) |
| Common callback signature for packet delay and address. | |
| typedef void(* | StateTransitionCallback) (const std::string &oldState, const std::string &newState) |
| Common signature used by callbacks to application's state transition trace source. | |
| Protected Attributes inherited from ns3::Application | |
| Ptr< Node > | m_node |
| The node that this application is installed on. | |
| EventId | m_startEvent |
| The event that will fire at m_startTime to start the application. | |
| Time | m_startTime |
| The simulation time that the application will start. | |
| EventId | m_stopEvent |
| The event that will fire at m_stopTime to end the application. | |
| Time | m_stopTime |
| The simulation time that the application will end. | |
| Related Symbols inherited from ns3::ObjectBase | |
| static TypeId | GetObjectIid () |
| Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
Flent is a network benchmarking tool.
This application provides a basic model of the Flent traffic generator. In practice, Flent is a wrapper around three traffic generation tools: netperf (for TCP), iperf (for UDP) and ping (for ICMP). Flent also provides output in a JSON-formatted data file, and plotting support via matplotlib.
Because FlentApplication binds these peer applications to specific, predefined socket ports (e.g., port 9020 for TCP uploads), you cannot target the same host node with multiple Flent applications at the same time. Doing so will cause the newly installed sinks to clash over the same ports, resulting in socket binding conflicts and simulation failures.
Definition at line 69 of file flent-application.h.
| ns3::FlentApplication::FlentApplication | ( | ) |
Definition at line 122 of file flent-application.cc.
References m_output.
Referenced by GetTypeId().
|
overridedefault |
|
private |
Add Flent metadata to the output document.
Definition at line 226 of file flent-application.cc.
References ns3::InetSocketAddress::ConvertFrom(), ns3::Ipv4Address::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), GetUtcFormatTime(), ns3::InetSocketAddress::IsMatchingType(), ns3::Ipv4Address::IsMatchingType(), m_hostAddress, m_imageText, m_length, m_localBindAddress, m_output, m_outputFilename, m_stepSize, ns3::Application::m_stopTime, m_testName, and NS_FATAL_ERROR.
Referenced by StartApplication().
|
overrideprotectedvirtual |
Reimplemented from ns3::Application.
Definition at line 167 of file flent-application.cc.
References ns3::Application::DoDispose(), m_bulkSendDown, m_bulkSendUp, m_packetSinkDown, m_packetSinkUp, m_ping, m_udpClient, m_udpServer, and NS_LOG_FUNCTION.
|
overrideprotectedvirtual |
In this method, the following tasks are performed: 1) set the host node, which is derived from the host address.
2) put the local bind address as the first address of the first non-loopback interface (if not set by the user explicitly), and 3) override the application stop time from the Length attribute set by the user.
Reimplemented from ns3::Application.
Definition at line 130 of file flent-application.cc.
References ns3::Application::DoInitialize(), ns3::DynamicCast(), m_length, m_localBindAddress, ns3::Application::m_node, ns3::Application::m_startTime, ns3::Application::m_stopTime, NS_LOG_FUNCTION, and ns3::Seconds().
|
private |
Fill x_values parameter in Flent file.
Adds x parameter values with the difference of stepSize
Definition at line 434 of file flent-application.cc.
References m_output, m_stepSize, ns3::Application::m_stopTime, and NS_LOG_DEBUG.
Referenced by StopApplication().
|
private |
Iterates through the node list and finds the node pointer for the given hostAddress.
| [in] | hostAddress | host node IP |
Definition at line 317 of file flent-application.cc.
References ns3::NodeList::Begin(), ns3::NodeList::End(), ns3::Ipv4InterfaceAddress::GetAddress(), and NS_LOG_FUNCTION.
Referenced by StartApplication().
|
static |
Get the type ID.
Definition at line 58 of file flent-application.cc.
References ns3::Application::Application(), FlentApplication(), m_hostAddress, m_imageText, m_length, m_localBindAddress, m_outputFilename, m_stepSize, m_t0, m_testName, m_useWallClockT0, ns3::MakeAddressAccessor(), ns3::MakeAddressChecker(), ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), ns3::MakeStringAccessor(), ns3::MakeStringChecker(), ns3::MakeTimeAccessor(), ns3::MakeTimeChecker(), ns3::MilliSeconds(), ns3::Seconds(), and ns3::TypeId::SetParent().
|
private |
Calculate the Time in UTC time format from the number of seconds.
Definition at line 208 of file flent-application.cc.
References m_currTime.
Referenced by AddMetadata().
|
private |
Goodput calculation for the i-th flow based on the bytes received.
Index i can have various values from 0 to 3 for the four download flows in case of RRUL test.
| [in] | name | Name of the flow |
| [in] | i | index of the flow |
Definition at line 418 of file flent-application.cc.
References data, ns3::Time::GetSeconds(), GoodputSamplingDownload(), m_bytesReceived, m_currTime, m_output, m_stepSize, ns3::Application::m_stopTime, ns3::Simulator::Now(), and ns3::Simulator::Schedule().
Referenced by GoodputSamplingDownload(), and StartApplication().
|
private |
Goodput calculation for the i-th flow based on the bytes sent.
Index i can have various values from 0 to 3 for the four upload flows in case of RRUL test.
| [in] | name | Name of the flow |
| [in] | i | index of the flow |
Definition at line 402 of file flent-application.cc.
References data, ns3::Time::GetSeconds(), GoodputSamplingUpload(), m_bytesSent, m_currTime, m_output, m_stepSize, ns3::Application::m_stopTime, ns3::Simulator::Now(), and ns3::Simulator::Schedule().
Referenced by GoodputSamplingUpload(), and StartApplication().
|
private |
Process raw values and add the processed result in the Flent file.
Definition at line 450 of file flent-application.cc.
References m_currTime, m_output, m_stepSize, ns3::Application::m_stopTime, NS_LOG_DEBUG, and prev.
Referenced by StopApplication().
|
overrideprivatevirtual |
Application specific startup code.
The StartApplication method is called at the start time specified by Start This method should be overridden by all or most application subclasses.
Reimplemented from ns3::Application.
Definition at line 568 of file flent-application.cc.
References AddMetadata(), ns3::InetSocketAddress::ConvertFrom(), ns3::Ipv4Address::ConvertFrom(), ns3::CreateObject(), ns3::CreateObjectWithAttributes(), data, ns3::DEFAULT_PORT, ns3::Ipv4Header::DSCP_CS1, ns3::Ipv4Header::DSCP_CS5, ns3::Ipv4Header::DSCP_EF, ns3::Ipv4Header::DscpDefault, ns3::Ipv4Address::GetAny(), GetHostNode(), ns3::InetSocketAddress::GetIpv4(), ns3::InetSocketAddress::GetPort(), ns3::Time::GetSeconds(), GoodputSamplingDownload(), GoodputSamplingUpload(), ns3::InetSocketAddress::IsMatchingType(), ns3::Ipv4Address::IsMatchingType(), m_bulkSendDown, m_bulkSendUp, m_currTime, m_hostAddress, m_localBindAddress, ns3::Application::m_node, m_output, m_packetSinkDown, m_packetSinkUp, m_ping, ns3::Application::m_startTime, m_stepSize, ns3::Application::m_stopTime, m_t0, m_testName, m_udpClient, m_udpServer, m_useWallClockT0, ns3::MakeCallback(), ns3::Simulator::Now(), NS_FATAL_ERROR, NS_LOG_FUNCTION, packetSize, port, ns3::Simulator::Schedule(), ns3::Seconds(), TraceReceivedPacket(), TraceReceivedPing(), TraceReceivedUdpPing(), and TraceSentPacket().
|
overrideprivatevirtual |
Application specific shutdown code.
The StopApplication method is called at the stop time specified by Stop This method should be overridden by all or most application subclasses.
Reimplemented from ns3::Application.
Definition at line 1061 of file flent-application.cc.
References FillXValues(), m_output, m_outputFilename, m_testName, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ProcessRawValues().
|
private |
sink for packet received.
Definition at line 364 of file flent-application.cc.
References m_bytesReceived.
Referenced by StartApplication().
|
private |
Ping RTT Trace function.
| seq | Echo sequence number |
| rtt | Round Trip Time delta from the sent time |
Definition at line 372 of file flent-application.cc.
References data, ns3::Time::GetSeconds(), m_currTime, m_output, and ns3::Simulator::Now().
Referenced by StartApplication().
|
private |
UDP Ping RTT Trace function.
| idx | Index of the QoS flow (0=BE, 1=BK, 2=EF) |
| Packet | UDP Ping Packet |
| Address | Address of the destination |
| localAddress | Local address of the sender |
| header | SeqTsEchoHeader header |
Definition at line 382 of file flent-application.cc.
References data, ns3::Time::GetSeconds(), ns3::SeqTsEchoHeader::GetTsValue(), m_currTime, m_output, m_stepSize, and ns3::Simulator::Now().
Referenced by StartApplication().
sink for packet transmissions.
| idx | Index of the flow |
| Packet | Pointer to packet sent |
Definition at line 358 of file flent-application.cc.
References m_bytesSent.
Referenced by StartApplication().
|
private |
BulkSend Applications for Download flows (tcp_download, rrul tests).
Definition at line 225 of file flent-application.h.
Referenced by DoDispose(), and StartApplication().
|
private |
BulkSend Applications for Upload flows (tcp_upload, rrul tests).
Definition at line 223 of file flent-application.h.
Referenced by DoDispose(), and StartApplication().
|
private |
receive data counters
Definition at line 209 of file flent-application.h.
Referenced by GoodputSamplingDownload(), and TraceReceivedPacket().
|
private |
sent data counters
Definition at line 208 of file flent-application.h.
Referenced by GoodputSamplingUpload(), and TraceSentPacket().
|
private |
Derived epoch anchor in seconds.
Definition at line 196 of file flent-application.h.
Referenced by GetUtcFormatTime(), GoodputSamplingDownload(), GoodputSamplingUpload(), ProcessRawValues(), StartApplication(), TraceReceivedPing(), and TraceReceivedUdpPing().
|
private |
Host address.
Definition at line 204 of file flent-application.h.
Referenced by AddMetadata(), GetTypeId(), and StartApplication().
|
private |
Text to be included in plot.
Definition at line 206 of file flent-application.h.
Referenced by AddMetadata(), and GetTypeId().
|
private |
Test duration.
Definition at line 199 of file flent-application.h.
Referenced by AddMetadata(), DoInitialize(), and GetTypeId().
|
private |
Local bind address.
Definition at line 205 of file flent-application.h.
Referenced by AddMetadata(), DoInitialize(), GetTypeId(), and StartApplication().
|
private |
Opaque JSON output document (defined in the .cc file).
Json output
Definition at line 198 of file flent-application.h.
Referenced by FlentApplication(), AddMetadata(), FillXValues(), GoodputSamplingDownload(), GoodputSamplingUpload(), ProcessRawValues(), StartApplication(), StopApplication(), TraceReceivedPing(), and TraceReceivedUdpPing().
|
private |
Output file path (see OutputFilename attribute).
Definition at line 200 of file flent-application.h.
Referenced by AddMetadata(), GetTypeId(), and StopApplication().
|
private |
PacketSink Applications for Download flows (tcp_download, rrul tests).
Definition at line 221 of file flent-application.h.
Referenced by DoDispose(), and StartApplication().
|
private |
PacketSink Applications for Upload flows (tcp_upload, rrul tests).
Definition at line 219 of file flent-application.h.
Referenced by DoDispose(), and StartApplication().
Ping Application for latency measurement (ping, rrul tests).
Definition at line 212 of file flent-application.h.
Referenced by DoDispose(), and StartApplication().
|
private |
Measurement data point step size.
Definition at line 207 of file flent-application.h.
Referenced by AddMetadata(), FillXValues(), GetTypeId(), GoodputSamplingDownload(), GoodputSamplingUpload(), ProcessRawValues(), StartApplication(), and TraceReceivedUdpPing().
|
private |
Epoch anchor for output timestamps (see T0 attribute).
Definition at line 202 of file flent-application.h.
Referenced by GetTypeId(), and StartApplication().
|
private |
Flent test name.
Definition at line 201 of file flent-application.h.
Referenced by AddMetadata(), GetTypeId(), StartApplication(), and StopApplication().
|
private |
UdpEchoClient Applications.
Definition at line 231 of file flent-application.h.
Referenced by DoDispose(), and StartApplication().
|
private |
UdpEchoServer Applications.
Definition at line 230 of file flent-application.h.
Referenced by DoDispose(), and StartApplication().
|
private |
Use the wall clock instead of m_t0 (see UseWallClockT0 attribute).
Definition at line 203 of file flent-application.h.
Referenced by GetTypeId(), and StartApplication().