OnOffApplication with TCP retransmission

413 Views Asked by At

I was doing some experiments. And I used OnOffApplication to generate the traffic.

However things didn't seem right.

And i use MaxBytes to send the amount of traffic that I want.

And the traffic is heavy. So there will be some packets being dropped.

And it seems OnOffApplication doesn't care about the dropped packets. ( I'm not sure. It's my guess)

It only send the packets until it reaches MaxBytes , and doesn't care about whether the packet is received or not.

Is my guess right?

And, if my guess is right, then is there any alternative choice that I can use. To generate traffic that each flow has a certain size, and have to re-transmit until all packets in the same flow is received.

My code is in below

OnOffHelper source ("ns3::TcpSocketFactory", Address (InetSocketAddress(r_ipaddr, port)));
source.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
source.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
source.SetAttribute ("DataRate", DataRateValue (DataRate(linkBw))); 
source.SetAttribute("PacketSize",UintegerValue (packetSize));
source.SetAttribute ("MaxBytes", UintegerValue (tempsize*1000));
1

There are 1 best solutions below

0
On BEST ANSWER

From the application point of view, OnOff is only a packet generator. It sends packets with specific characteristics (rate, max number etc). It does not track them. That's by design.

If you use TCP though, then the socket will track and make sure that any lost segments are re-transmitted.

The application will generate the MaxBytes in terms of load, but the actual packets transmitted on the wire (or the air) may differ due to the fact that TCP (by design) does not respect the message boundaries, as it is a bytestream oriented protocol. So it may boundle data packets together, or packet segments, with re-trasnmitted segmets etc.