Skip to contentSkip to conversation

One question regarding the SCTP write buffer free mechanism

DISCUSSION Mao, Jinhui (NSB - CN/Hangzhou) 2 participants 3 messages Mar 26, 2020 – Mar 27, 2020 SCTP protocol

lore
Share & tools
lore
#0 lore raw

Dear Linux SCTP experts.

Recently we found a SCTP problem in our product, the scenario can be described as follow

Endpoint A Endpoint Z
{App sends 3 messages; strm 0} DATA [TSN=6] ---------------> (ack)

                                                     DATA [TSN=7] ---------------> (lost)
                                                     DATA [TSN=8] ---------------> (gap detected,immediately send ack)
                                                                                              /----- SACK [TSN Ack=6,Block=1, Start=2,End=2]
                                                                                    <-----/ 
                                                                                     ......
                                                   DATA [TSN] ---------------> (gap detected,immediately send ack)
                                                                                               /----- SACK [TSN Ack=6,Block=1, Start=2,End=4]
                                                                                    <-----/       (3 SACK to indicate that TSN=7 lost, fast re-trans triggered)
                                       Re-trans DATA [TSN=7] ---------------> (also lost)
                                                    DATA [TSN] ---------------> (gap detected,immediately send ack)
                                                                                               /----- SACK [TSN Ack=6,Block=1, Start=2,End=5]
                                                                                     <-----/       
                                                                                       ......
                                                  DATA [TSN40] ---------------> (gap detected,immediately send ack)
                                                                                                /----- SACK [TSN Ack=6,Block=1, Start=2,End34]
                                                                                      <-----/       
                       Error happened on Endpoint A when calling SCTP sendmsg to send more to Endpoint B, the error is "Resource temporarily unavailable". Association is not destroyed at this time. 

1 second later RTO Timeout 2nd Re-trans DATA [TSN=7] ---------------> (Acked)

So could you please help to comments on the following question?
- Does this means that if an gap is found in the SACK, those packages sent after this lost packet will stay in the write buffer until the gap is filled? Even if they are successfully SACKed?

Thanks a lot!

Best Regards!

Mao Jinhui

#1 lore raw

On Thu, Mar 26, 2020 at 05:22:46AM +0000, Mao, Jinhui (NSB - CN/Hangzhou) wrote:
...

Review

Quoted 6 lines

Error happened on Endpoint A when calling SCTP sendmsg to send more to Endpoint B, the error is "Resource temporarily unavailable". Association is not destroyed at this time.
1 second later RTO Timeout 2nd Re-trans DATA [TSN=7] ---------------> (Acked)

So could you please help to comments on the following question?

(quoted diff) +0 -1
-	Does this means that if an gap is found in the SACK, those packages sent after this lost packet will stay in the write buffer until the gap is filled? Even if they are successfully SACKed?

Yes and yes. Because the receiver is allowed to drop any data acked in a gap block if it needs more memory to fill in the gap, and in this case, the sender would have to retransmit it.

Seems you're using non-block sockets, otherwise that last sendmsg() would have blocked waiting for the sndbuf space to be available, btw.

Cheers,
Marcelo

#2 lore raw
In reply to Mao, Jinhui (NSB - CN/Hangzhou)

VGhhbmtzIGEgbG90IGZvciB0aGUgcmVzcG9uc2UuIEl0YHMgY2xlYXIgZm9yIG1lIG5vdy4g8J+Y gw0KDQpIYXZlIGEgbmljZSBkYXkhDQoNCkJlc3QgUmVnYXJkcyENCg0KTWFvIEppbmh1aQ0KDQot LS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KRnJvbTogTWFyY2VsbyBSaWNhcmRvIExlaXRuZXIg PG1hcmNlbG8ubGVpdG5lckBnbWFpbC5jb20+IA0KU2VudDogMjAyMOW5tDPmnIgyN+aXpSAzOjI5 DQpUbzogTWFvLCBKaW5odWkgKE5TQiAtIENOL0hhbmd6aG91KSA8amluaHVpLm1hb0Bub2tpYS1z YmVsbC5jb20+DQpDYzogbGludXgtc2N0cEB2Z2VyLmtlcm5lbC5vcmcNClN1YmplY3Q6IFJlOiBP bmUgcXVlc3Rpb24gcmVnYXJkaW5nIHRoZSBTQ1RQIHdyaXRlIGJ1ZmZlciBmcmVlIG1lY2hhbmlz bQ0KDQpPbiBUaHUsIE1hciAyNiwgMjAyMCBhdCAwNToyMjo0NkFNICswMDAwLCBNYW8sIEppbmh1 aSAoTlNCIC0gQ04vSGFuZ3pob3UpIHdyb3RlOg0KLi4uDQo+ICAgICAgICAgICAgICAgICAgICAg ICAgRXJyb3IgaGFwcGVuZWQgb24gRW5kcG9pbnQgQSB3aGVuIGNhbGxpbmcgU0NUUCBzZW5kbXNn IHRvIHNlbmQgbW9yZSB0byBFbmRwb2ludCBCLCB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