Commit 9ac4f08b authored by Sridhar Samudrala's avatar Sridhar Samudrala

[SCTP] Update cwnd/ssthresh as per the sctpimpguide modifications.

Signed-off-by: default avatarSridhar Samudrala <sri@us.ibm.com>
parent ac49b054
...@@ -482,14 +482,15 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc, ...@@ -482,14 +482,15 @@ struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *asoc,
/* 7.2.1 Slow-Start /* 7.2.1 Slow-Start
* *
* o The initial cwnd before data transmission or after a * o The initial cwnd before DATA transmission or after a sufficiently
* sufficiently long idle period MUST be <= 2*MTU. * long idle period MUST be set to
* min(4*MTU, max(2*MTU, 4380 bytes))
* *
* o The initial value of ssthresh MAY be arbitrarily high * o The initial value of ssthresh MAY be arbitrarily high
* (for example, implementations MAY use the size of the * (for example, implementations MAY use the size of the
* receiver advertised window). * receiver advertised window).
*/ */
peer->cwnd = asoc->pmtu * 2; peer->cwnd = min(4*asoc->pmtu, max_t(__u32, 2*asoc->pmtu, 4380));
/* At this point, we may not have the receiver's advertised window, /* At this point, we may not have the receiver's advertised window,
* so initialize ssthresh to the default value and it will be set * so initialize ssthresh to the default value and it will be set
......
...@@ -421,15 +421,15 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport, ...@@ -421,15 +421,15 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport,
{ {
switch (reason) { switch (reason) {
case SCTP_LOWER_CWND_T3_RTX: case SCTP_LOWER_CWND_T3_RTX:
/* RFC 2960 Section 7.2.3, sctpimpguide-05 Section 2.9.2 /* RFC 2960 Section 7.2.3, sctpimpguide
* When the T3-rtx timer expires on an address, SCTP should * When the T3-rtx timer expires on an address, SCTP should
* perform slow start by: * perform slow start by:
* ssthresh = max(cwnd/2, 2*MTU) * ssthresh = max(cwnd/2, 4*MTU)
* cwnd = 1*MTU * cwnd = 1*MTU
* partial_bytes_acked = 0 * partial_bytes_acked = 0
*/ */
transport->ssthresh = max(transport->cwnd/2, transport->ssthresh = max(transport->cwnd/2,
2*transport->asoc->pmtu); 4*transport->asoc->pmtu);
transport->cwnd = transport->asoc->pmtu; transport->cwnd = transport->asoc->pmtu;
break; break;
...@@ -439,15 +439,15 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport, ...@@ -439,15 +439,15 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport,
* were last sent, according to the formula described in * were last sent, according to the formula described in
* Section 7.2.3. * Section 7.2.3.
* *
* RFC 2960 7.2.3, sctpimpguide-05 2.9.2 Upon detection of * RFC 2960 7.2.3, sctpimpguide Upon detection of packet
* packet losses from SACK (see Section 7.2.4), An endpoint * losses from SACK (see Section 7.2.4), An endpoint
* should do the following: * should do the following:
* ssthresh = max(cwnd/2, 2*MTU) * ssthresh = max(cwnd/2, 4*MTU)
* cwnd = ssthresh * cwnd = ssthresh
* partial_bytes_acked = 0 * partial_bytes_acked = 0
*/ */
transport->ssthresh = max(transport->cwnd/2, transport->ssthresh = max(transport->cwnd/2,
2*transport->asoc->pmtu); 4*transport->asoc->pmtu);
transport->cwnd = transport->ssthresh; transport->cwnd = transport->ssthresh;
break; break;
...@@ -467,23 +467,24 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport, ...@@ -467,23 +467,24 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport,
if ((jiffies - transport->last_time_ecne_reduced) > if ((jiffies - transport->last_time_ecne_reduced) >
transport->rtt) { transport->rtt) {
transport->ssthresh = max(transport->cwnd/2, transport->ssthresh = max(transport->cwnd/2,
2*transport->asoc->pmtu); 4*transport->asoc->pmtu);
transport->cwnd = transport->ssthresh; transport->cwnd = transport->ssthresh;
transport->last_time_ecne_reduced = jiffies; transport->last_time_ecne_reduced = jiffies;
} }
break; break;
case SCTP_LOWER_CWND_INACTIVE: case SCTP_LOWER_CWND_INACTIVE:
/* RFC 2960 Section 7.2.1, sctpimpguide-05 Section 2.14.2 /* RFC 2960 Section 7.2.1, sctpimpguide
* When the association does not transmit data on a given * When the endpoint does not transmit data on a given
* transport address within an RTO, the cwnd of the transport * transport address, the cwnd of the transport address
* address should be adjusted to 2*MTU. * should be adjusted to max(cwnd/2, 4*MTU) per RTO.
* NOTE: Although the draft recommends that this check needs * NOTE: Although the draft recommends that this check needs
* to be done every RTO interval, we do it every hearbeat * to be done every RTO interval, we do it every hearbeat
* interval. * interval.
*/ */
if ((jiffies - transport->last_time_used) > transport->rto) if ((jiffies - transport->last_time_used) > transport->rto)
transport->cwnd = 2*transport->asoc->pmtu; transport->cwnd = max(transport->cwnd/2,
4*transport->asoc->pmtu);
break; break;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment