: New RX History Step 4 - Receiver RTT sampling
PATCH 11/43 : New RX History Step 4 - Receiver RTT sampling
[CCID 3]: New RX History Step 4 - Receiver RTT sampling
The CCID 3 receiver needs an RTT estimate only once, to compute the initial loss interval (RFC 3448, 6.3.1). A function to realise this is provided by this patch. It uses a much-optimised variant of the algorithm presented in RFC 4342, 8.1, relying on timestamps and CCVal counters. If RTT estimation fails (e.g. due to early loss), the fall-back value from [RFC 4340, 3.4] is used.
A l g o r i t h m D e t a i l s [not necessarily commit msg]
---------------------------------------------------------------
The RTT sampling algorithm requires up to three history entries:
(1) last = hist[0] is always used as the point of reference against which either the current packet or a previously suitable candidate packet (see below) is evaluated with regard to the difference of CCVal values;
(2) hist[1] is used as dummy' entry when the difference between current and last'
CCVal is 0, and when no previous candidate packet has been recorded;
(3) prev = hist[2] is used to store a suitable candidate which is such that its CCVal difference D to the last = hist[0] packet is in the range 1..3 (and thus sub-optimal).
All three cases are controlled by a single variable, `prev_sample', which is initialised to 0. The variable, an alias for loss_start, is also used in determining where the current packet's details are to be stored (for the purpose of tracking the highest received sequence number). The details of the current packet are always stored in the entry
last_rcv = hist[(loss_start + loss_count) & NUMDUPACK]
which, since loss_count = 0 during RTT sampling and since prev_sample < 3, simplifies to
last_rcv = hist[prev_sample] = hist[loss_start]
Hence setting prev_sample to a non-0 value avoids overwriting the `last' entry (hist[0]) with the details of the current packet. In addition, a prev_sample of 2 indicates that a previously suitable candidate entry has been recorded for possible later use.
See also section 5 of http://www.erg.abdn.ac.uk/users/gerrit/dccp/docs/ccid3_packet_reception/
--- net/dccp/ccids/ccid3.c | 68 +++--------------------------------- net/dccp/ccids/lib/packet_history.c | 47 ++++++++++++++++++++++++ net/dccp/ccids/lib/packet_history.h | 1 3 files changed, 55 insertions(+), 61 deletions(-)
net/dccp/ccids/lib/packet_history.h +1 -0
@@ -221,6 +221,7 @@ static inline void tfrc_rx_hist_update(sdccp_rx_hist_entry_from_skb (last_rcv (h), skb, ndp); } +extern u32 tfrc_rx_sample_rtt (struct tfrc_rx_hist *,struct sk_buff *);extern int tfrc_rx_hist_init (struct tfrc_rx_hist *);extern void tfrc_rx_hist_cleanup (struct tfrc_rx_hist *);
net/dccp/ccids/lib/packet_history.c +47 -0
53 lines not on this page · raw message
net/dccp/ccids/ccid3.c +7 -61
95 lines not on this page · raw message
Quoted 2 lines · Gerrit Renker
[CCID 3]: New RX History Step 4 - Receiver RTT sampling
Looks like nice clean implementation as I know original BSD one wasn't quite right. I had tried to hack it but still not got it right.
Signature · 3 lines
Web: http://wand.net.nz/~iam4/ Blog: http://iansblog.jandi.co.nz WAND Network Research Group