Bug 2111

Summary: Feature request: add receiver timestamp to SeqTsHeader.
Product: ns-3 Reporter: Tom Henderson <tomh>
Component: applicationsAssignee: Tommaso Pecorella <tommaso.pecorella>
Status: PATCH PENDING ---    
Severity: enhancement CC: mattator, ns-bugs, tommaso.pecorella
Priority: P5    
Version: ns-3-dev   
Hardware: All   
OS: All   
See Also: https://www.nsnam.org/bugzilla/show_bug.cgi?id=2214
Attachments: new header
new headers

Description Tom Henderson 2015-05-04 15:36:13 EDT
From this post:

http://mailman.isi.edu/pipermail/ns-developers/2015-March/012622.html

Initial discussion suggested that perhaps a new header would be a better solution to this.

Deferring until after ns-3.23
Comment 1 Tom Henderson 2015-05-04 15:36:34 EDT
patch is pending in the codereview issue
Comment 2 Tom Henderson 2016-01-04 18:26:53 EST
This is a bump of this issue:

https://codereview.appspot.com/214420043/

do we want to modify this header or add another header?
Comment 3 Tommaso Pecorella 2016-01-05 12:19:10 EST
I stand my point: a new header is a better choice (backward-compatibility wise)
Comment 4 Tommaso Pecorella 2016-04-02 19:24:08 EDT
Created attachment 2367 [details]
new header

The new header, slightly modified with respect to the original ones proposed by Matt.
Comment 5 Matthieu Coudron 2016-04-04 09:35:58 EDT
you might want to change "Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>" ?

As it stands the header is not used in ns3: if it results in adding deadcode, thus it should not be added to ns3. My initial stance was to add a feature (while keeping backwards compatibility).
Comment 6 Tommaso Pecorella 2016-04-04 09:44:32 EDT
(In reply to Matthieu Coudron from comment #5)
> you might want to change "Author: Mathieu Lacage
> <mathieu.lacage@sophia.inria.fr>" ?
> 
> As it stands the header is not used in ns3: if it results in adding
> deadcode, thus it should not be added to ns3. My initial stance was to add a
> feature (while keeping backwards compatibility).

I'll change the author. About adding a functionality and preserving backward compatibility, they are two conflicting goals.

Adding functionality means adding bytes, and this changes the actual behaviour.
Practically speaking, the applications that are using SeqTs header will change their minimum payload size from 12 bytes to 20 bytes.

About the dead code, if this header is included we could add a simple modification to UdpEcho apps and use it there (showing how to calculate a round trip delay at application layer). Also this is a behaviour change, but I'd rather do this. People could have used SeqTs in their work and rely on the fact that it's 12 bytes long.
Comment 7 Tom Henderson 2016-04-04 14:27:22 EDT
(In reply to Tommaso Pecorella from comment #6)
> (In reply to Matthieu Coudron from comment #5)
> > you might want to change "Author: Mathieu Lacage
> > <mathieu.lacage@sophia.inria.fr>" ?
> > 
> > As it stands the header is not used in ns3: if it results in adding
> > deadcode, thus it should not be added to ns3. My initial stance was to add a
> > feature (while keeping backwards compatibility).
> 
> I'll change the author. About adding a functionality and preserving backward
> compatibility, they are two conflicting goals.
> 
> Adding functionality means adding bytes, and this changes the actual
> behaviour.
> Practically speaking, the applications that are using SeqTs header will
> change their minimum payload size from 12 bytes to 20 bytes.
> 
> About the dead code, if this header is included we could add a simple
> modification to UdpEcho apps and use it there (showing how to calculate a
> round trip delay at application layer). Also this is a behaviour change, but
> I'd rather do this. People could have used SeqTs in their work and rely on
> the fact that it's 12 bytes long.

I lean towards adding separate header also; we could add an example on how it is used.

I have two questions:

1) what about aligning field names and class name more with TCP Timestamps?

http://freesoft.org/CIE/RFC/1323/8.htm

so, for instance, we would have a "TsValue" and a "TsEchoReply" field instead of "Transmit" and "Receive" value.

We could also perhaps change the name to "SeqTsEchoHeader" which IMO may be clearer to users than "SeqTxRxTsHeader" (i.e. we can document to use "SeqTsHeader" if you do not care about adding the Echo field).

2) I don't like the asymmetry of setting the Ts with uint64_t but getting with class Time.  Why not this instead (on top of the name change I suggest above)?

-  void SetRxTs (uint64_t ts);
-  void SetTxTs (uint64_t ts);
+ void SetRxTs (Time ts);
+ void SetTxTs (Time ts);
Comment 8 Tommaso Pecorella 2016-04-04 16:41:29 EDT
(In reply to Tom Henderson from comment #7)
> ... 
> I lean towards adding separate header also; we could add an example on how
> it is used.
> 
> I have two questions:
> 
> 1) what about aligning field names and class name more with TCP Timestamps?
> 
> http://freesoft.org/CIE/RFC/1323/8.htm
> 
> so, for instance, we would have a "TsValue" and a "TsEchoReply" field
> instead of "Transmit" and "Receive" value.
> 
> We could also perhaps change the name to "SeqTsEchoHeader" which IMO may be
> clearer to users than "SeqTxRxTsHeader" (i.e. we can document to use
> "SeqTsHeader" if you do not care about adding the Echo field).

Fine by me. I wasn't particularly happy with the name, but I couldn't think to something better. This is better.


> 2) I don't like the asymmetry of setting the Ts with uint64_t but getting
> with class Time.  Why not this instead (on top of the name change I suggest
> above)?
> 
> -  void SetRxTs (uint64_t ts);
> -  void SetTxTs (uint64_t ts);
> + void SetRxTs (Time ts);
> + void SetTxTs (Time ts);

Mmmm... right. But this raises one problem: the time resolution.
Since we're using a completely new header, we can go bold and use a full 128 bit serialization, what do you think ?
Comment 9 Tom Henderson 2016-04-04 17:37:24 EDT
> > 2) I don't like the asymmetry of setting the Ts with uint64_t but getting
> > with class Time.  Why not this instead (on top of the name change I suggest
> > above)?
> > 
> > -  void SetRxTs (uint64_t ts);
> > -  void SetTxTs (uint64_t ts);
> > + void SetRxTs (Time ts);
> > + void SetTxTs (Time ts);
> 
> Mmmm... right. But this raises one problem: the time resolution.
> Since we're using a completely new header, we can go bold and use a full 128
> bit serialization, what do you think ?

I'm not following; the time value is an underlying int64_t.  Why must resolution be carried?
Comment 10 Tommaso Pecorella 2016-04-04 18:33:57 EDT
Created attachment 2368 [details]
new headers

(In reply to Tom Henderson from comment #9)
> > > 2) I don't like the asymmetry of setting the Ts with uint64_t but getting
> > > with class Time.  Why not this instead (on top of the name change I suggest
> > > above)?
> > > 
> > > -  void SetRxTs (uint64_t ts);
> > > -  void SetTxTs (uint64_t ts);
> > > + void SetRxTs (Time ts);
> > > + void SetTxTs (Time ts);
> > 
> > Mmmm... right. But this raises one problem: the time resolution.
> > Since we're using a completely new header, we can go bold and use a full 128
> > bit serialization, what do you think ?
> 
> I'm not following; the time value is an underlying int64_t.  Why must
> resolution be carried?

Right, I was totally sure that the internal Time representation was 128 bits. Scratch the 128 bits idea, here's the new patch.
It's drycoded, so I could have missed something.