1. 04 9月, 2008 20 次提交
    • G
      dccp ccid-3: Always perform receiver RTT sampling · 2b81143a
      Gerrit Renker 提交于
      This updates the CCID-3 receiver in part with regard to errata 610 and 611
      (http://www.rfc-editor.org/errata_list.php), which change RFC 4342 to use the
      Receive Rate as specified in rfc3448bis, requiring to constantly sample the
      RTT (or use a sender RTT).
      
      Doing this requires reusing the RX history structure after dealing with a loss.
      
      The patch does not resolve how to compute X_recv if the interval is less
      than 1 RTT. A FIXME has been added (and is resolved in subsequent patch).
      
      Furthermore, since this is all TFRC-based functionality, the RTT estimation
      is now also performed by the dccp_tfrc_lib module. This further simplifies
      the CCID-3 code.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      2b81143a
    • G
      dccp ccid-3: Remove duplicate RX states · 2f3e3bba
      Gerrit Renker 提交于
      The only state information that the CCID-3 receiver keeps is whether initial 
      feedback has been sent or not. Further, this overlaps with use of feedback:
      
       * state == TFRC_RSTATE_NO_DATA as long as no feedback has been sent;
       * state == TFRC_RSTATE_DATA    as soon as the first feedback has been sent.
      
      This patch reduces the duplication, by memorising the type of the last feedback.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      2f3e3bba
    • G
      dccp tfrc: Let dccp_tfrc_lib do the sampling work · 34a081be
      Gerrit Renker 提交于
      This migrates more TFRC-related code into the dccp_tfrc_lib:
       * sampling of the packet size `s' (which is only needed until the first
         loss interval is computed (ccid3_first_li));
       * updating the byte-counter `bytes_recvd' in between sending feedbacks.
      The result is a better separation of CCID-3 specific and TFRC specific
      code, which aids future integration with ECN and e.g. CCID-4.
      
      Further changes:
      ----------------
       * replaced magic number of 536 with equivalent constant TCP_MIN_RCVMSS;
         (this constant is also used when no estimate for `s' is available).
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      34a081be
    • G
      dccp tfrc: Return type of update_i_mean is void · 3ca7aea0
      Gerrit Renker 提交于
      This changes the return type of tfrc_lh_update_i_mean() to void, since that 
      function returns always `false'. This is due to 
      
       	len = dccp_delta_seqno(cur->li_seqno, DCCP_SKB_CB(skb)->dccpd_seq) + 1;
       
       	if (len - (s64)cur->li_length <= 0)	/* duplicate or reordered */
      		return 0;
      
      which means that update_i_mean can only increase the length of the open loss
      interval I_0, and hence the value of I_tot0 (RFC 3448, 5.4). Consequently the
      test `i_mean < old_i_mean' at the end of the function always evaluates to false.
      
      There is no known way by which a loss interval can suddenly become shorter,
      therefore the return type of the function is changed to void. (That is, under
      the given circumstances step (3) in RFC 3448, 6.1 will not occur.)
      
      Further changes:
      ----------------
       * the function is now called from tfrc_rx_handle_loss, which is equivalent
         to the previous way of calling from rx_packet_recv (it was called whenever
         there was no new or pending loss, now  it is also updated when there is
         a pending loss - this increases the accuracy a bit);
       * added a FIXME to possibly consider NDP counting as per RFC 4342 (this is
         not implemented yet).
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      3ca7aea0
    • G
      dccp tfrc: Perform early loss detection · d20ed95f
      Gerrit Renker 提交于
      This enables the TFRC code to begin loss detection (as soon as the module
      is loaded), using the latest updates from rfc3448bis-06, 6.3.1:
      
       * when the first data packet(s) are lost or marked, set
       * X_target = s/(2*R) => f(p) = s/(R * X_target) = 2,
       * corresponding to a loss rate of ~ 20.64%.
      
      The handle_loss() function is now called right at the begin of rx_packet_recv()
      and thus no longer protected against duplicates: hence a call to rx_duplicate()
      has been added.  Such a call makes sense now, as the previous patch initialises
      the first entry with a sequence number of GSR.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      d20ed95f
    • G
      dccp tfrc: Receiver history initialisation routine · 24b8d343
      Gerrit Renker 提交于
      This patch 
       1) separates history allocation and initialisation, to facilitate early
          loss detection (implemented by a subsequent patch);
      
       2) removes duplication by using the existing tfrc_rx_hist_purge() if the
          allocation fails. This is now possible, since the initialisation routine
       3) zeroes out the entire history before using it. 
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      24b8d343
    • G
      dccp ccid-3: Simplified handling of TX states · d0c05fe4
      Gerrit Renker 提交于
      Since CCIDs are only used during the established phase of a connection,
      they have very little internal state; this specifically reduces to:
      
       * "no packet sent" if and only if s == 0, for the TX packet size s;
      
       * when the first packet has been sent (i.e. `s' > 0), the question is whether
         or not feedback has been received:
         - if a feedback packet is received, "feedback = yes" is set,
         - if the nofeedback timer expires,  "feedback = no"  is set.
      
      Thus the CCID only needs to remember state about whether or not feedback
      has been received. This is now implemented using a boolean flag, which is
      toggled when a feedback packet arrives or the nofeedback timer expires.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      d0c05fe4
    • G
      dccp ccid-3: Runtime verification of timer resolution · f76fd327
      Gerrit Renker 提交于
      The DCCP base time resolution is 10 microseconds (RFC 4340, 13.1 ... 13.3).
      
      Using a timer with a lower resolution was found to trigger the following
      bug warnings/problems on high-speed networks (e.g. local loopback):
       * RTT samples are rounded down to 0 if below resolution;
       * in some cases, negative RTT samples were observed;
       * the CCID-3 feedback timer complains that the feedback interval is 0,
         since the feedback interval is in the order of 1 RTT or less and RTT
         measurement rounded this down to 0;
      On an Intel computer this will for instance happen when using a
      boot-time parameter of "clocksource=jiffies".
      
      The following system log messages were observed:
        11:24:00 kernel: BUG: delta (0) <= 0 at ccid3_hc_rx_send_feedback()
        11:26:12 kernel: BUG: delta (0) <= 0 at ccid3_hc_rx_send_feedback()
        11:26:30 kernel: dccp_sample_rtt: unusable RTT sample 0, using min
        11:26:30 last message repeated 5 times
      
      This patch defines a global constant for the time resolution, adds this in
      timer.c, and checks the available clock resolution at CCID-3 module load time.
      
      When the resolution is worse than 10 microseconds, module loading exits with
      a message "socket type not supported".
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      f76fd327
    • G
      dccp: Return-value convention of hc_tx_send_packet() · f4a66ca4
      Gerrit Renker 提交于
      This patch reorganises the return value convention of the CCID TX sending
      function, to permit more flexible schemes, as required by subsequent patches.
      
      Currently the convention is 
       * values < 0     mean error,
       * a value == 0   means "send now", and
       * a value x > 0  means "send in x milliseconds".
      
      The patch provides symbolic constants and a function to interpret return values.
      In addition, it caps the maximum positive return value to 0xFFFF milliseconds,
      corresponding to 65.535 seconds. 
      
      This is possible since in CCID-3 the maximum inter-packet gap is t_mbi = 64 sec.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      f4a66ca4
    • G
      dccp ccid-3: Remove dead states · d0995e6a
      Gerrit Renker 提交于
      This patch is thanks to an investigation by Leandro Sales de Melo and his
      colleagues. They worked out two state diagrams which highlight the fact that
      the xxx_TERM states in CCID-3/4 are in fact not necessary.
      
      And this can be confirmed by in turn looking at the code: the xxx_TERM states
      are only ever set in ccid3_hc_{rx,tx}_exit(). These two functions are part
      of the following call chain:
      
       * ccid_hc_{tx,rx}_exit() are called from ccid_delete() only;
       * ccid_delete() invokes ccid_hc_{tx,rx}_exit() in the way of a destructor:
         after calling ccid_hc_{tx,rx}_exit(), the CCID is released from memory;
       * ccid_delete() is in turn called only by ccid_hc_{tx,rx}_delete();
       * ccid_hc_{tx,rx}_delete() is called only if 
         - feature negotiation failed   (dccp_feat_activate_values()),
         - when changing the RX/TX CCID (to eject the current CCID),
         - when destroying the socket   (in dccp_destroy_sock()).
      
      In other words, when CCID-3 sets the state to xxx_TERM, it is at a time where
      no more processing should be going on, hence it is not necessary to introduce
      a dedicated exit state - this is implicit when unloading the CCID.
      
      The patch removes this state, one switch-statement collapses as a result.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      d0995e6a
    • G
      dccp: Unused argument in CCID tx function · c506d91d
      Gerrit Renker 提交于
      This removes the argument `more' from ccid_hc_tx_packet_sent, since it was
      nowhere used in the entire code.
      
      (Anecdotally, this argument was not even used in the original KAME code where
       the function originally came from; compare the variable moreToSend in the
       freebsd61-dccp-kame-28.08.2006.patch now maintained by Emmanuel Lochin.)
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      c506d91d
    • G
      dccp ccid-3: Remove redundant 'options_received' struct · ce177ae2
      Gerrit Renker 提交于
      The `options_received' struct is redundant, since it re-duplicates the existing
      `p' and `x_recv' fields. This patch removes the sub-struct and migrates the
      format conversion operations (cf. below) to ccid3_hc_tx_parse_options().
      
                           Why the fields are redundant
                           ----------------------------
      The Loss Event Rate p and the Receive Rate x_recv are initially 0 when first 
      loading CCID-3, as ccid_new() zeroes out the entire ccid3_hc_tx_sock. 
      
      When Loss Event Rate or Receive Rate options are received, they are stored by
      ccid3_hc_tx_parse_options() into the fields `ccid3or_loss_event_rate' and
      `ccid3or_receive_rate' of the sub-struct `options_received' in ccid3_hc_tx_sock.
      
      After parsing (considering only the established state - dccp_rcv_established()),
      the packet is passed on to ccid_hc_tx_packet_recv(). This calls the CCID-3
      specific routine ccid3_hc_tx_packet_recv(), which performs the following copy
      operations between fields of ccid3_hc_tx_sock:
      
       * hctx->options_received.ccid3or_receive_rate is copied into hctx->x_recv,
         after scaling it for fixpoint arithmetic, by 2^64;
       * hctx->options_received.ccid3or_loss_event_rate is copied into hctx->p,
         considering the above special cases; in addition, a value of 0 here needs to
         be mapped into p=0 (when no Loss Event Rate option has been received yet).
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      ce177ae2
    • G
      dccp tfrc/ccid-3: Computing Loss Rate from Loss Event Rate · 535c55df
      Gerrit Renker 提交于
      This adds a function to take care of the following cases occurring in the
      computation of the Loss Rate p:
      
       * 1/(2^32-1) is mapped into 0% as per RFC 4342, 8.5;
       * 1/0        is mapped into the maximum of 100%;
       * we want to avoid that p = 1/x is rounded down to 0 when x is very large,
         since this means accidentally re-entering slow-start (indicated by p==0).
      
      In the last case, the minimum-resolution value of p is returned.
      
      Furthermore, a bug in ccid3_hc_rx_getsockopt is fixed (1/0 was mapped into ~0U),
      which now allows to consistently print the scaled p-values as
      
              printf("Loss Event Rate = %u.%04u %%\n", rx_info.tfrcrx_p / 10000, 
                                                       rx_info.tfrcrx_p % 10000);
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      535c55df
    • G
      dccp: Add packet type information to CCID-specific option parsing · 3306c781
      Gerrit Renker 提交于
      This patch ...
       1. adds packet type information to ccid_hc_{rx,tx}_parse_options(). This is 
          necessary, since table 3 in RFC 4340, 5.8 leaves it to the CCIDs to state
          which options may (not) appear on what packet type.
       
       2. adds such a check for CCID-3's {Loss Event, Receive} Rate as specified in
          RFC 4340 8.3 ("Receive Rate options MUST NOT be sent on DCCP-Data packets")
          and 8.5 ("Loss Event Rate options MUST NOT be sent on DCCP-Data packets").
      
       3. removes an unused argument `idx' from ccid_hc_{rx,tx}_parse_options(). This
          is also no longer necessary, since the CCID-specific option-parsing routines
          are passed every single parameter of the type-length-value option encoding.
      
      Also added documentation and made argument naming scheme consistent.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      3306c781
    • G
      dccp ccid-3: Simplify and consolidate tx_parse_options · 47a61e7b
      Gerrit Renker 提交于
      This simplifies and consolidates the TX option-parsing code:
      
       1. The Loss Intervals option is not currently used, so dead code related to
          this option is removed. I am aware of no plans to support the option, but
          if someone wants to implement it (e.g. for inter-op tests), it is better
          to start afresh than having to also update currently unused code.
      
       2. The Loss Event and Receive Rate options have a lot of code in common (both
          are 32 bit, both have same length etc.), so this is consolidated.
      
       3. The test against GSR is not necessary, because
          - on first loading CCID3, ccid_new() zeroes out all fields in the socket; 
          - ccid3_hc_tx_packet_recv() treats 0 and ~0U equivalently, due to
      
      	pinv = opt_recv->ccid3or_loss_event_rate;
      	if (pinv == ~0U || pinv == 0)
      		hctx->p = 0;
      
          - as a result, the sequence number field is removed from opt_recv.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      47a61e7b
    • G
      dccp ccid-3: Remove ugly RTT-sampling history lookup · 63b3a73b
      Gerrit Renker 提交于
      This removes the RTT-sampling function tfrc_tx_hist_rtt(), since
      
       1. it suffered from complex passing of return values (the return value both
          indicated successful lookup while the value doubled as RTT sample);
      
       2. when for some odd reason the sample value equalled 0, this triggered a bug
          warning about "bogus Ack", due to the ambiguity of the return value;
      
       3. on a passive host which has not sent anything the TX history is empty and
          thus will lead to unwanted "bogus Ack" warnings such as
          ccid3_hc_tx_packet_recv: server(e7b7d518): DATAACK with bogus ACK-28197148
          ccid3_hc_tx_packet_recv: server(e7b7d518): DATAACK with bogus ACK-26641606.
      
      The fix is to replace the implicit encoding by performing the steps manually.					       
      
      Furthermore, the "bogus Ack" warning has been removed, since it can actually be
      triggered due to several reasons (network reordering, old packet, (3) above),
      hence it is not very useful.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      63b3a73b
    • G
      dccp ccid-3: Bug fix for the inter-packet scheduling algorithm · de6f2b59
      Gerrit Renker 提交于
      This fixes a subtle bug in the calculation of the inter-packet gap and shows
      that t_delta, as it is currently used, is not needed. And hence replaced.
      
      The algorithm from RFC 3448, 4.6 below continually computes a send time t_nom,
      which is initialised with the current time t_now; t_gran = 1E6 / HZ specifies
      the scheduling granularity, s the packet size, and X the sending rate:
      
        t_distance = t_nom - t_now;		// in microseconds
        t_delta    = min(t_ipi, t_gran) / 2;	// `delta' parameter in microseconds
      
        if (t_distance >= t_delta) {
      	reschedule after (t_distance / 1000) milliseconds;
        } else {
        	t_ipi  = s / X;			// inter-packet interval in usec
      	t_nom += t_ipi;			// compute the next send time
      	send packet now;
        }
      
      
      1) Description of the bug
      -------------------------
      Rescheduling requires a conversion into milliseconds, due to this call chain:
      
       * ccid3_hc_tx_send_packet() returns a timeout in milliseconds,
       * this value is converted by msecs_to_jiffies() in dccp_write_xmit(),
       * and finally used as jiffy-expires-value for sk_reset_timer().
      
      The highest jiffy resolution with HZ=1000 is 1 millisecond, so using a higher
      granularity does not make much sense here.
      
      As a consequence, values of t_distance < 1000 are truncated to 0. This issue 
      has so far been resolved by using instead
      
        if (t_distance >= t_delta + 1000)
      	reschedule after (t_distance / 1000) milliseconds;
      
      The bug is in artificially inflating t_delta to t_delta' = t_delta + 1000. This
      is unnecessarily large, a more adequate value is t_delta' = max(t_delta, 1000).
      
      
      2) Consequences of using the corrected t_delta'
      -----------------------------------------------
      Since t_delta <= t_gran/2 = 10^6/(2*HZ), we have t_delta <= 1000 as long as
      HZ >= 500. This means that t_delta' = max(1000, t_delta) is constant at 1000.
      
      On the other hand, when using a coarse HZ value of HZ < 500, we have three
      sub-cases that can all be reduced to using another constant of t_gran/2.
      
       (a) The first case arises when t_ipi > t_gran. Here t_delta' is the constant
           t_delta' = max(1000, t_gran/2) = t_gran/2.
      
       (b) If t_ipi <= 2000 < t_gran = 10^6/HZ usec, then t_delta = t_ipi/2 <= 1000,
           so that t_delta' = max(1000, t_delta) = 1000 < t_gran/2. 
      
       (c) If 2000 < t_ipi <= t_gran, we have t_delta' = max(t_delta, 1000) = t_ipi/2.
      
      In the second and third cases we have delay values less than t_gran/2, which is
      in the order of less than or equal to half a jiffy. 
      
      How these are treated depends on how fractions of a jiffy are handled: they
      are either always rounded down to 0, or always rounded up to 1 jiffy (assuming
      non-zero values). In both cases the error is on average in the order of 50%.
      
      Thus we are not increasing the error when in the second/third case we replace
      a value less than t_gran/2 with 0, by setting t_delta' to the constant t_gran/2.
      
      
      3) Summary
      ----------
      Fixing (1) and considering (2), the patch replaces t_delta with a constant,
      whose value depends on CONFIG_HZ, changing the above algorithm to:
       
        if (t_distance >= t_delta')
      	reschedule after (t_distance / 1000) milliseconds;
      
      where t_delta' = 10^6/(2*HZ) if HZ < 500, and t_delta' = 1000 otherwise.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      de6f2b59
    • G
      dccp ccid-3: No more CCID control blocks in LISTEN state · b2e317f4
      Gerrit Renker 提交于
      The CCIDs are activated as last of the features, at the end of the handshake,
      were the LISTEN state of the master socket is inherited into the server
      state of the child socket. Thus, the only states visible to CCIDs now are
      OPEN/PARTOPEN, and the closing states.
      
      This allows to remove tests which were previously necessary to protect
      against referencing a socket in the listening state (in CCID3), but which
      now have become redundant.
      
      As a further byproduct of enabling the CCIDs only after the connection has been
      fully established, several typecast-initialisations of ccid3_hc_{rx,tx}_sock
      can now be eliminated:
       * the CCID is loaded, so it is not necessary to test if it is NULL,
       * if it is possible to load a CCID and leave the private area NULL, then this
          is a bug, which should crash loudly - and earlier,
       * the test for state==OPEN || state==PARTOPEN now reduces only to the closing
         phase (e.g. when the node has received an unexpected Reset).		  
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      Acked-by: NIan McDonald <ian.mcdonald@jandi.co.nz>
      b2e317f4
    • G
      dccp ccid-3: Remove ccid3hc{tx,rx}_ prefixes · 842d1ef1
      Gerrit Renker 提交于
      This patch does the same for CCID-3 as the previous patch for CCID-2:
      
              s#ccid3hctx_##g;
              s#ccid3hcrx_##g;
      
      plus manual editing to retain consistency.
      
      Please note: expanded the fields of the `struct tfrc_tx_info' in the hc_tx_sock,
      since using short #define identifiers is not a good idea. The only place where
      this embedded struct was used is ccid3_hc_tx_getsockopt().
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      842d1ef1
    • G
      dccp: Toggle debug output without module unloading · 43264991
      Gerrit Renker 提交于
      This sets the sysfs permissions so that root can toggle the `debug'
      parameter available for nearly every DCCP module. This is useful 
      since there are various module inter-dependencies. The debug flag
      can now be toggled at runtime using
      
        echo 1 > /sys/module/dccp/parameters/dccp_debug
        echo 1 > /sys/module/dccp_ccid2/parameters/ccid2_debug
        echo 1 > /sys/module/dccp_ccid3/parameters/ccid3_debug
        echo 1 > /sys/module/dccp_tfrc_lib/parameters/tfrc_debug
      
      The last is not very useful yet, since no code at the moment calls
      the tfrc_debug() macro.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      43264991
  2. 13 7月, 2008 2 次提交
    • G
      dccp ccid-3: Fix a loss detection bug · b552c623
      Gerrit Renker 提交于
      This fixes a bug in the logic of the TFRC loss detection:
       * new_loss_indicated() should not be called while a loss is pending;
       * but the code allows this;
       * thus, for two subsequent gaps in the sequence space, when loss_count
         has not yet reached NDUPACK=3, the loss_count is falsely reduced to 1.
      
      To avoid further and similar problems, all loss handling and loss detection is
      now done inside tfrc_rx_hist_handle_loss(), using an appropriate routine to
      track new losses.
      
      Further changes:
      ----------------
       * added a reminder that no RX history operations should be performed when
         rx_handle_loss() has identified a (new) loss, since the function takes
         care of packet reordering during loss detection;
       * made tfrc_rx_hist_loss_pending() bool (thanks to an earlier suggestion
         by Arnaldo);		 
       * removed unused functions.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      b552c623
    • G
      dccp: Upgrade NDP count from 3 to 6 bytes · 5b5d0e70
      Gerrit Renker 提交于
      RFC 4340, 7.7 specifies up to 6 bytes for the NDP Count option, whereas the code
      is currently limited to up to 3 bytes. This seems to be a relict of an earlier 
      draft version and is brought up to date by the patch.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      5b5d0e70
  3. 11 6月, 2008 2 次提交
    • G
      dccp: Fix sparse warnings · 1e2f0e5e
      Gerrit Renker 提交于
      This patch fixes the following sparse warnings:
       * nested min(max()) expression:
         net/dccp/ccids/ccid3.c:91:21: warning: symbol '__x' shadows an earlier one
         net/dccp/ccids/ccid3.c:91:21: warning: symbol '__y' shadows an earlier one
         
       * Declaration of function prototypes in .c instead of .h file, resulting in
         "should it be static?" warnings. 
      
       * Declared "struct dccpw" static (local to dccp_probe).
       
       * Disabled dccp_delayed_ack() - not fully removed due to RFC 4340, 11.3
         ("Receivers SHOULD implement delayed acknowledgement timers ...").
      
       * Used a different local variable name to avoid
         net/dccp/ackvec.c:293:13: warning: symbol 'state' shadows an earlier one
         net/dccp/ackvec.c:238:33: originally declared here
      
       * Removed unused functions `dccp_ackvector_print' and `dccp_ackvec_print'.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      1e2f0e5e
    • G
      dccp ccid-3: Bug-Fix - Zero RTT is possible · 3294f202
      Gerrit Renker 提交于
      In commit $(825de27d) (from 27th May, commit
      message `dccp ccid-3: Fix "t_ipi explosion" bug'), the CCID-3 window counter
      computation was fixed to cope with RTTs < 4 microseconds.
      
      Such RTTs can be found e.g. when running CCID-3 over loopback. The fix removed
      a check against RTT < 4, but introduced a divide-by-zero bug.
      
      All steady-state RTTs in DCCP are filtered using dccp_sample_rtt(), which
      ensures non-zero samples. However, a zero RTT is possible on initialisation,
      when there is no RTT sample from the Request/Response exchange.
      
      The fix is to use the fallback-RTT from RFC 4340, 3.4.
      
      This is also better than just fixing update_win_count() since it allows other
      parts of the code to always assume that the RTT is non-zero during the time
      that the CCID is used.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      3294f202
  4. 27 5月, 2008 1 次提交
    • G
      dccp ccid-3: Fix "t_ipi explosion" bug · 825de27d
      Gerrit Renker 提交于
      The identification of this bug is thanks to Cheng Wei and Tomasz
      Grobelny.
      
      To avoid divide-by-zero, the implementation previously ignored RTTs
      smaller than 4 microseconds when performing integer division RTT/4.
      
      When the RTT reached a value less than 4 microseconds (as observed on
      loopback), this prevented the Window Counter CCVal value from
      advancing. As a result, the receiver stopped sending feedback. This in
      turn caused non-ending expiries of the nofeedback timer at the sender,
      so that the sending rate was progressively reduced until reaching the
      minimum of one packet per 64 seconds.
      
      The patch fixes this bug by handling integer division more
      intelligently. Due to consistent use of dccp_sample_rtt(),
      divide-by-zero-RTT is avoided.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      825de27d
  5. 03 5月, 2008 1 次提交
  6. 29 1月, 2008 14 次提交