Example to verify TCP FACK performance based on Mathis & Mahdavi paper. More...
#include "ns3/applications-module.h"#include "ns3/core-module.h"#include "ns3/flow-monitor-module.h"#include "ns3/internet-module.h"#include "ns3/network-module.h"#include "ns3/point-to-point-module.h"#include "ns3/traffic-control-module.h"Go to the source code of this file.
Functions | |
| static void | BytesInFlightTracer (Ptr< OutputStreamWrapper > stream, uint32_t oldval, uint32_t newval) |
| Trace BytesInFlight in segments. | |
| void | CheckQueueSize (Ptr< QueueDisc > qd) |
| Check and trace the queue size. | |
| static void | CwndTracer (Ptr< OutputStreamWrapper > stream, uint32_t oldval, uint32_t newval) |
| Trace congestion window. | |
| static void | FackAwndTracer (Ptr< OutputStreamWrapper > stream, uint32_t oldval, uint32_t newval) |
| Trace FACK's inflight(AWND) in segments. | |
| void | TraceBytesInFlight (uint32_t nodeId, uint32_t socketId) |
| Bind the BytesInFlight trace source. | |
| void | TraceCwnd (uint32_t nodeId, uint32_t socketId) |
| Bind the Congestion Window trace source. | |
| void | TraceFackAwnd (uint32_t nodeId, uint32_t socketId) |
| Bind the FackAwnd trace source. | |
| static void | TracePacketDrop (Ptr< OutputStreamWrapper > stream, Ptr< const QueueDiscItem > item) |
| Trace packets dropped at Queue. | |
| static void | TraceThroughput (Ptr< FlowMonitor > monitor) |
| Calculate and trace throughput. | |
Variables | |
| std::string | g_dir |
| Output directory. | |
| std::ofstream | g_individualLostSegments |
| Lost segments output stream. | |
| uint32_t | g_prev = 0 |
| Previous throughput byte count. | |
| Time | g_prevTime |
| Previous throughput measurement time. | |
| std::ofstream | g_queueSize |
| Queue size output stream. | |
| uint32_t | g_segmentSize = 1448 |
| Segment size. | |
| std::ofstream | g_throughput |
| Throughput output stream. | |
Example to verify TCP FACK performance based on Mathis & Mahdavi paper.
The network topology used in this example is based on the Fig. 1 described in Mathis, M., & Mahdavi, J. (1996, August). Forward acknowledgement: Refining TCP congestion control.
This program runs by default for 100 seconds and creates a new directory called 'fack-results' in the ns-3 root directory. The program creates one sub-directory called 'pcap' in 'fack-results' directory (if pcap generation is enabled) and six .dat files.
This example allows the user to quantitatively verify two key mechanisms described in the Mathis & Mahdavi paper:
To observe these insights, you must run the simulation twice with different configurations:
SPECIFIC OBSERVATIONS:
A. Preservation of Self-Clock (Compare 'bytesInFlight.dat'):
B. Overdamping and Queue Draining (Compare 'cwnd.dat' vs 'bytesInFlight.dat'):
Definition in file fack-example.cc.
|
static |
Trace BytesInFlight in segments.
| stream | The output stream |
| oldval | Old value |
| newval | New value |
Definition at line 181 of file fack-example.cc.
References g_segmentSize, ns3::Time::GetSeconds(), and ns3::Simulator::Now().
Referenced by TraceBytesInFlight().
Check and trace the queue size.
| qd | The queue disc |
Definition at line 133 of file fack-example.cc.
References CheckQueueSize(), g_queueSize, ns3::Time::GetSeconds(), ns3::Simulator::Now(), ns3::Simulator::Schedule(), and ns3::Seconds().
Referenced by CheckQueueSize(), CheckQueueSize(), CheckQueueSize(), and experiment().
|
static |
Trace congestion window.
| stream | The output stream |
| oldval | Old value |
| newval | New value |
Definition at line 168 of file fack-example.cc.
References g_segmentSize, ns3::Time::GetSeconds(), and ns3::Simulator::Now().
Referenced by ConnectSocketTraces(), TraceCwnd(), TraceCwnd(), TraceCwnd(), and TraceCwnd().
|
static |
Trace FACK's inflight(AWND) in segments.
| stream | The output stream |
| oldval | Old value |
| newval | New value |
Definition at line 194 of file fack-example.cc.
References g_segmentSize, ns3::Time::GetSeconds(), and ns3::Simulator::Now().
Referenced by TraceFackAwnd().
Bind the BytesInFlight trace source.
| nodeId | The node ID. |
| socketId | The socket ID. |
Definition at line 222 of file fack-example.cc.
References BytesInFlightTracer(), ns3::Config::ConnectWithoutContext(), ns3::AsciiTraceHelper::CreateFileStream(), g_dir, and ns3::MakeBoundCallback().
Bind the Congestion Window trace source.
| nodeId | The node ID. |
| socketId | The socket ID. |
Definition at line 206 of file fack-example.cc.
References ns3::Config::ConnectWithoutContext(), ns3::AsciiTraceHelper::CreateFileStream(), CwndTracer(), g_dir, and ns3::MakeBoundCallback().
Referenced by experiment(), and InstallBulkSend().
Bind the FackAwnd trace source.
| nodeId | The node ID. |
| socketId | The socket ID. |
Definition at line 238 of file fack-example.cc.
References ns3::Config::ConnectWithoutContext(), ns3::AsciiTraceHelper::CreateFileStream(), FackAwndTracer(), g_dir, and ns3::MakeBoundCallback().
|
static |
Trace packets dropped at Queue.
| stream | The output stream |
| item | The queue disc item dropped |
Definition at line 146 of file fack-example.cc.
References g_segmentSize, ns3::Time::GetSeconds(), ns3::TcpHeader::GetSequenceNumber(), ns3::SequenceNumber< NUMERIC_TYPE, SIGNED_TYPE >::GetValue(), and ns3::Simulator::Now().
|
static |
Calculate and trace throughput.
| monitor | The flow monitor |
Definition at line 108 of file fack-example.cc.
References g_prev, g_prevTime, g_throughput, ns3::Time::GetSeconds(), ns3::Now(), ns3::Simulator::Schedule(), ns3::Seconds(), TraceThroughput(), and ns3::Time::US.
Referenced by TraceThroughput(), TraceThroughput(), and TraceThroughput().
| std::string g_dir |
Output directory.
Definition at line 94 of file fack-example.cc.
Referenced by TraceBytesInFlight(), TraceCwnd(), and TraceFackAwnd().
| std::ofstream g_individualLostSegments |
Lost segments output stream.
Definition at line 97 of file fack-example.cc.
| uint32_t g_prev = 0 |
Previous throughput byte count.
Definition at line 99 of file fack-example.cc.
Referenced by TraceThroughput().
| Time g_prevTime |
Previous throughput measurement time.
Definition at line 100 of file fack-example.cc.
Referenced by TraceThroughput().
| std::ofstream g_queueSize |
Queue size output stream.
Definition at line 96 of file fack-example.cc.
Referenced by CheckQueueSize().
| uint32_t g_segmentSize = 1448 |
Segment size.
Definition at line 101 of file fack-example.cc.
Referenced by BytesInFlightTracer(), CwndTracer(), FackAwndTracer(), and TracePacketDrop().
| std::ofstream g_throughput |
Throughput output stream.
Definition at line 95 of file fack-example.cc.
Referenced by TraceThroughput().