Bug 2220

Summary: RAM usage reduction through reduction of retransmission events
Product: ns-3 Reporter: natale.patriciello
Component: tcpAssignee: natale.patriciello
Status: RESOLVED MOVED    
Severity: enhancement CC: ns-bugs, pdbarnes, tomh, tommaso.pecorella
Priority: P5    
Version: pre-release   
Hardware: PC   
OS: Linux   
Attachments: Event saving patch

Description natale.patriciello 2015-11-16 06:18:00 EST
Created attachment 2188 [details]
Event saving patch

Currently, for each ACK receive the implementation cancel the old retransmission events and insert a new events, since the retransmit timer expiration time is moved forward in the future.

One approach to reduce RAM and execution time is to avoid such cancel / insert with a "Replace" approach. It could be handled in core, but I don't know how much is feasible. What I propose is a TCP-only patch, which works in this way:

* New ack arrives *

-> Calculate the time at which it should expire (m_realRTO=now+m_rto)
-> if m_retxEvent < m_realRTO, don't cancel/set anything, set a flag to false
-> if m_retxEvent > m_realRTO, cancel the old event, and set a new RTO event, flag to true

** Rto expires **

-> Check the flag; if it is set, it means that the triggered event is not a real RTO. Set another retx event, at time m_realRTO - now.
-> If it is not set, RTO is a real rto and it is expired; do the retransmission.
Comment 1 Tommaso Pecorella 2015-11-18 18:22:58 EST
I assume that you did check that the code is faster and that it does produce equivalent traces.
If te assumption holds tue, I have no objections to the changes. I'd only add a small note in a moment explaining why the "strange" approach was chosen.

As a side note...
  if (Simulator::Now () + m_rto > Simulator::Now() + Simulator::GetDelayLeft (m_retxEvent))
change to
  if (m_rto > Simulator::GetDelayLeft (m_retxEvent))

and please initialize m_realRTO in the constructors (it silences the warning).
Comment 2 Tom Henderson 2020-02-23 18:24:52 EST
moved to https://gitlab.com/nsnam/ns-3-dev/issues/136