Query regarding instantaneous RTT in socket-base

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Query regarding instantaneous RTT in socket-base

Viyom Mittal
Hello everyone,

I am currently working on a project that requires instantaneous RTT in the
tcp-socket-base. In the current implementation, it is calculated in
EstimateRTT function and is not available out of its scope. It is stored in
'm' variable which is local to this function.

Will renaming this variable to m_instRtt and making it protected variable
of the TcpSocketBase class would be correct? Please let me know if there is
a better approach to do so.

Thanks in advance.

Regards,
Viyom Mittal
Reply | Threaded
Open this post in threaded view
|

Re: Query regarding instantaneous RTT in socket-base

Tom Henderson-2
On 04/14/2017 08:03 AM, Viyom Mittal wrote:
> Hello everyone,  > > I am currently working on a project that requires instantaneous
RTT > in the tcp-socket-base. In the current implementation, it is >
calculated in EstimateRTT function and is not available out of its >
scope. It is stored in 'm' variable which is local to this function. > >
Will renaming this variable to m_instRtt and making it protected >
variable of the TcpSocketBase class would be correct? Please let me >
know if there is a better approach to do so. > > Thanks in advance. > >
Regards, Viyom Mittal

Hi Viyom,

The answer depends on how you want to access this.  If you want a
subclass to access the last received sample by polling the value when
desired, you could make a protected method that returned the last
reported sample (stored in a new member variable).  If you want
asynchronous notification when a new sample arrives, you could add a
protected callback.  If you want to make it publicly accessible, the
ns-3 way of doing it would be to add a new TraceSource as an attribute.  
Note that if you make it a TracedValue such as presently done for 'RTT'
attribute, you will be notified of any changed values, but you will not
be notified of any samples that are identical to the last reported
value.  So if you want to obtain all samples even if they are identical,
you will probably want to instead create a TracedCallback<Time> in
TcpSocketBase and connect methods to it.

- Tom