TCP Traffic in ns-3

1,099 views
Skip to first unread message

Ldong

unread,
Jan 12, 2016, 1:12:56 PM1/12/16
to ns-3-users
I read about traffic generators in ns-3 (for TCP):

I find:

1. Bulk Send Helper   -> This is like FTP traffic (?). I give max packets and that number is sent.

2. OnOff Helper -> This is used for Poisson traffic. On times and off times. 

Any other way to send traffic ?

What is the best way (to send traffic from the source) when I evaluate a Congestion Control (TCP Reno, Vegas) protocol ? I read Poisson is not good, any other model in ns-3?

How to implement TCP pacing i.e. stopping packets for some time and then sending them? I know Schedule(..) has to be used. But how to use it .. where to implement it ? How to stop other packets from being sent then?

Thank you.

Ldong

unread,
Jan 12, 2016, 1:20:39 PM1/12/16
to ns-3-users
What is the meaning of data rate in OnOff Helper ? It has to send traffic -> till the time it stops -> in bursts : On and Off ? So why is data rate here ?

  OnOffHelper source ("ns3::TcpSocketFactory", Address(InetSocketAddress (Ipv4Address ("10.1.1.1"), 10)));
  source.SetAttribute ("OnTime", StringValue ("ns3::ConstantRandomVariable[Constant=1]"));
  source.SetAttribute ("OffTime", StringValue ("ns3::ConstantRandomVariable[Constant=0]"));
  source.SetAttribute ("DataRate",StringValue ("2Mbps"));
  source.SetAttribute ("PacketSize",UintegerValue(1280));

Tommaso Pecorella

unread,
Jan 12, 2016, 5:00:36 PM1/12/16
to ns-3-users
I'll reply to both messages in one go.

BulkSend could be assimilated to FTP because it uses TCP and it tries to send all the data as fast as possible. This behavior is not representative only of FTP, tho.

OnOff is NOT Poisson. Technically it's a 2-state Markov model with constant rate transmission in one state and zero transmission in the other state. It could look like a Poisson traffic generator only for extremely small "on" time, but...
But. The OnOff application "DataRate" attribute specifies the average DataRate of the application, which is equal to the number of bytes in a packet (another attribute) multiplied for the On time and divided by the Off + On time (i.e., the Duty cycle). If On time is almost zero, the DataRate will be almost zero (!). This is a contradiction, also because you can explicitly set the packet length.
The point is: it is not Poisson even if you set the On time to be extremely small, because packets are scheduled in a way to comply to the overall DataRate. If the On time is null, DataRate will be null, and no packet will be sent.

Practically speaking, the system is a two state Markov chain, but when you enter the On state a packet is not immediately scheduled. Instead, it is delayed of the time needed to achieve an overall DataRate.
The end result ? Not Poisson.
On the opposite, it is possible to use OnOff to get isochronous traffic by setting Off time to zero.

Other ways to send traffic: please check the src/application module.

Traffic generators to study the congestion control - whatever models your traffic and fills up the sender buffer. Your research, your decision.
Poisson: no, it's not good, simply because it's not realistic. It has been used in literature just because it's mathematically easy to use. It can still be used for some processes, but not for packet generation.

TCP Pacing (it's not about stopping TCP for some time, it's about scheduling the packets "smoothly"). This is extremely complex, and you should analyze the ns-3 TCP code first. It could be totally not trivial to be implemented.

Have fun,

T.

Ldong

unread,
Jan 13, 2016, 11:33:15 AM1/13/16
to ns-3-users
Thank you.
Reply all
Reply to author
Forward
0 new messages