Subject: [tsvwg] When SCTP client is restarted, DATA chunks start piggy backing in heart beat and sack chunks only in direction server to client only..

From: Prafulla Sarode <[email-masked]>
Date: Fri, 10 Aug 2012 17:04:36 +0530 (IST)

Hi; 

I am using a linux kernel 2.6.30 on ppc machine. 
I have a one-to-many style server and client running on different machines. (socket(AF_INET,SOCK_SEQPACKET,IPPROTO_SCTP)) type connection. 

Initially every thing works fine. All messages transported properly from both direction. 

Now when client restarts without sending the SHUTDOWN chunk (i.e. due to eth down or some other reason), the server(application) receives the SCTP_RESTART event, when client comes up and tries the association. Now what ever message is sent by server, it will only be transmitted whenever either heartbeat,SACK, heartbeat-ack is transmitted. All the messages are delivered to client properly but are sent on the wire piggy backed on either heartbeat,sack,heartbeatack only. The messages sent by client are transmitted on wire as usual and normal. 

I have done more analysis and it was found that when client is restarted without the knowledge of server(without sending SHUTDOWN) and before receiving any INIT from client, if server has sent any message and then received the INIT from client at this time the server first receives the send_failed and then SCTP_RESTART event and the problem starts. 

If between the restart of client (without sending SHUTDOWN) and INIT after client application restart, if server has not sent any message, then even if server receives the SCTP_RESTART event there is no such problem and communication is normal. 

If client restarts first by sending the SHUTDOWN and then restarting application and sending INIT there is no problem. 

My application is 2 machines sharing same ip-address one at a time at both server and client sites(Typical hot-standby application). First client (working) has established connection with working server, when ever working client detect ethernet down it releaves the control of ip-address and restarts (As there is not ethernet available the SHUTDOWN does not reach the server), and immediately standby client becomes primary acquires the ip-address,send GARP packet and establishes the connection with the server, and server receives the SCTP_RESTART event. 

The problem occurs only when some message is transmitted by server between the period the old client is shutdown and new client has restarted.(sent INIT) 

Attaching the wirehark capture for reference. 
Client shared ip-address-192.168.0.111 - server ip address 192.168.0.115 
frames 33 and 34 which is retransmission of the 33 data chunk are the packets transmitted between client restart. frame 35 is the first INIT of the new client(192.168.0.111). 

The problem can be seen in frames from server(0.115) to client (0.111) in frames 40,43,47,52,65,68,70,82 etc. 

Please suggest some solution. 

Regards 
PRAFULLA SARODE 
Coral Telecom Ltd 
E-2 Sect-63 Noida 

"PLEASURE IN THE JOB PUT PERFECTION IN THE WORK"

---

From: Michael Tuexen <[email-masked]>
Date: Sat, 11 Aug 2012 10:26:08 +0200

On Aug 10, 2012, at 1:34 PM, Prafulla Sarode wrote:

> Now when client restarts without sending the SHUTDOWN chunk (i.e. due to eth down or some other reason), the server(application) receives the SCTP_RESTART event, when client comes up and tries the association. Now what ever message is sent by server, it will only be transmitted whenever either heartbeat,SACK, heartbeat-ack is transmitted. All the messages are delivered to client properly but are sent on the wire piggy backed on either heartbeat,sack,heartbeatack only. The messages sent by client are transmitted on wire as usua l and normal.
> 
> My application is 2 machines sharing same ip-address one at a time at both server and client sites(Typical hot-standby application). First client (working) has established conne ction with working server, when ever working client detect ethernet down it releaves the control of ip-address and restarts (As there is not ethernet available the SHUTDOWN does not reach the server), and immediately standby client becomes primary acquires the ip-address,send GARP packet and establishes the connection with the server, and server receives the SCTP_RESTART event.
> 
> Please suggest s ome solution.
I don't think that this is a protocol issue, it is an implementation issue of the Linux
kernel SCTP implementation. You might want to ask this question on the LKSCTP mailing
list: [email-masked]

If I remember it correctly, there were some bugs related to association restart and they
were fixed. So the first suggestion you might get it is use a more recent version of the
OS. I think the version you are using is more than 3 years old.

Best regards
Michael
> <sctp_restart_prob.pcap>