<font face="times new roman" size="3"><p style="margin:0;padding:0;">Hi Michael -</p>
<p style="margin:0;padding:0;"> </p>
<p style="margin:0;padding:0;">In specific, what my code did was this:</p>
<p style="margin:0;padding:0;"> </p>
<p style="margin:0;padding:0;">It observed the IPv4 headers of *large* TCP/IP datagrams going upstream, so that it could construct "no-op" "content-free" datagrams that would certainly pass muster through all the filters and be routed exactly the same as the TCP/IP datagrams  that were carrying large flows.  It would remember only the most recent one.</p>
<p style="margin:0;padding:0;"> </p>
<p style="margin:0;padding:0;">Every K bytes of upstream traffic (K chosen so that the overhead [= minimal TCP/IP datagram divided by K] is a tiny percentage) it would construct a NO-OP TCP/IP datagram that appears to be part of that flow (same source/dest addr/port info, and just for grins, a duplicate sequence number and no content bytes at all), and set its TTL to make it time out very close to the "other side" of the CMTS, and queue it normally.</p>
<p style="margin:0;padding:0;"> </p>
<p style="margin:0;padding:0;">The TTL expiration causes an ICMP packet to be sent back.   My code intercepts that packet based on its contents, and removes it as "handled" before it gets processed by the TCP/IP state machines.</p>
<p style="margin:0;padding:0;"> </p>
<p style="margin:0;padding:0;">The time between the queueing of the TCP/IP NO-OP and the return of the ICMP packet is a direct measure of the queueing delays through the cable modem and CMTS.  When this grows by around "1 full datagram" from its minimum, the upload queue is becoming congested, and it's time to stop sending content for a bit.  Immediately when content is held on the egress link into the cable modem from the router, we send another NO-OP with the short TTL, and as soon as its ICMP comes back, you  know the queue in the CMTS is drained, so you can resume sending into an empty CMTS, at a lower rate (you've just gotten a good estimate of the rate that you should reduce to, if you've been keeping track of how many bytes are flowing over the egress link.)</p>
<p style="margin:0;padding:0;"> </p>
<p style="margin:0;padding:0;">Symmetrically, you can periodically (less frequently) experiment with a possible rate *increase* by sending a small NO-OP packet immediately followed by a large/maximal sized NO-OP datagram, and using the "packet pair" concept to determine the bottleneck rate by measuring the time between ICMP responses.  The time between the ICMP responses is an estimator of the achievable peak rate through the upstream path.</p>
<p style="margin:0;padding:0;"> </p>
<p style="margin:0;padding:0;">This assumes that the downstream (incoming) path is uncongested.   But you can elaborate this scheme further.</p>
<p style="margin:0;padding:0;"> </p>
<p style="margin:0;padding:0;">The goal of the "tcptraceroute" method is to get a "loopback" that follows the same path as an existing TCP connection, in order to get timing right.</p>
<p style="margin:0;padding:0;"> </p>
<p style="margin:0;padding:0;">If options exist to get intermediate timestamps on a route, you can also use similar techniques under TCP with the "NO-OP" datagram technique.</p>
<p style="margin:0;padding:0;"> </p>
<p style="margin:0;padding:0;">-----Original Message-----<br />From: "Michael Richardson" <mcr@sandelman.ca><br />Sent: Monday, November 26, 2012 1:11pm<br />To: dpreed@reed.com<br />Cc: cerowrt-users@lists.bufferbloat.net, cerowrt-devel@lists.bufferbloat.net<br />Subject: Re: [Cerowrt-devel] [Cerowrt-users] QOS settings vs speedboost and random bandwidth<br /><br /></p>
<div id="SafeStyles1353954132"><br />>>>>> "dpreed" == dpreed  <dpreed@reed.com> writes:<br /> dpreed> But I've thought about coding it again for cerowrt.  Where<br /> dpreed> to modularly slot it in seems to be worth thinking about.<br /> dpreed> Perhaps in two key pieces: an iptables/xfilter module and a<br /> dpreed> routing/traffic control module - with some direct<br /> dpreed> interaction between the two using some appropriate<br /> dpreed> intermodule bus/link/coordination link. <br /><br />So an uplink bitrate value with an easy to reach sysctl that<br />userspace can toggle?  It would be an enhancement to existing tc/qos code.<br /><br /> dpreed> I'd be happy to think about defining the pieces, but I<br /> dpreed> really don't have time to code it, given all the other stuff<br /> dpreed> I've done.  I wonder if by putting it in these modules, one<br /> dpreed> can use existing kernel APIs. <br /><br />How precise timing do you think we need?<br /><br />As I understand what you are saying, by periodically sending a few ICMP<br />messages (does it help if they are back to back?) and looking when they <br />are returned, one can calculate the uplink bandwidth?<br /><br />Or are you saying that we are measuring the point in uplink usage where<br />the latency begins to peak?<br /><br />-- <br />]       He who is tired of Weird Al is tired of life!           |  firewalls  [<br />]   Michael Richardson, Sandelman Software Works, Ottawa, ON    |net architect[<br />] mcr@sandelman.ottawa.on.ca http://www.sandelman.ottawa.on.ca/ |device driver[<br /> Kyoto Plus: watch the video <http://www.youtube.com/watch?v=kzx1ycLXQSE><br /> then sign the petition.</div></font>