diff --git a/src/vnet/sctp/sctp.c b/src/vnet/sctp/sctp.c
index 42cc2ac..76a1bf4 100644
--- a/src/vnet/sctp/sctp.c
+++ b/src/vnet/sctp/sctp.c
@@ -615,14 +615,21 @@
   update_cwnd (sctp_conn);
   update_smallest_pmtu_idx (sctp_conn);
 
-  return sctp_conn->sub_conn[sctp_conn->smallest_PMTU_idx].cwnd;
+  u8 idx = sctp_data_subconn_select (sctp_conn);
+
+  return sctp_conn->sub_conn[idx].cwnd;
 }
 
 u16
 sctp_snd_space (sctp_connection_t * sctp_conn)
 {
+  /* RFC 4096 Section 6.1; point (A) */
+  if (sctp_conn->peer_rwnd == 0)
+    return 0;
+
+  u8 idx = sctp_data_subconn_select (sctp_conn);
   /* Finally, let's subtract the DATA chunk headers overhead */
-  return sctp_conn->sub_conn[sctp_conn->smallest_PMTU_idx].cwnd -
+  return sctp_conn->sub_conn[idx].cwnd -
     sizeof (sctp_payload_data_chunk_t) - sizeof (sctp_full_hdr_t);
 }
 
diff --git a/src/vnet/sctp/sctp.h b/src/vnet/sctp/sctp.h
index 32d3ab9..f0ce594 100644
--- a/src/vnet/sctp/sctp.h
+++ b/src/vnet/sctp/sctp.h
@@ -93,7 +93,9 @@
 {
   SCTP_SUBCONN_STATE_DOWN = 0,
   SCTP_SUBCONN_STATE_UP,
-  SCTP_SUBCONN_STATE_ALLOW_HB
+  SCTP_SUBCONN_STATE_ALLOW_HB,
+  SCTP_SUBCONN_AWAITING_SACK,
+  SCTP_SUBCONN_SACK_RECEIVED
 };
 
 #define SCTP_INITIAL_SSHTRESH 65535
@@ -920,6 +922,8 @@
 always_inline u8
 cwnd_fully_utilized (sctp_connection_t * sctp_conn, u8 idx)
 {
+  if (sctp_conn->sub_conn[idx].cwnd == 0)
+    return 1;
   return 0;
 }
 
@@ -928,6 +932,7 @@
 update_cwnd (sctp_connection_t * sctp_conn)
 {
   u8 i;
+  u32 inflight = sctp_conn->next_tsn - sctp_conn->last_unacked_tsn;
 
   for (i = 0; i < MAX_SCTP_CONNECTIONS; i++)
     {
@@ -960,6 +965,12 @@
 	  sctp_conn->sub_conn[i].cwnd =
 	    clib_min (sctp_conn->sub_conn[i].PMTU, 1);
 	}
+
+      /* Section 6.1; point (D) */
+      if ((inflight + SCTP_RTO_BURST * sctp_conn->sub_conn[i].PMTU) <
+	  sctp_conn->sub_conn[i].cwnd)
+	sctp_conn->sub_conn[i].cwnd =
+	  inflight + SCTP_RTO_BURST * sctp_conn->sub_conn[i].PMTU;
     }
 }
 
diff --git a/src/vnet/sctp/sctp_input.c b/src/vnet/sctp/sctp_input.c
index 962534c..5691f0f 100644
--- a/src/vnet/sctp/sctp_input.c
+++ b/src/vnet/sctp/sctp_input.c
@@ -375,7 +375,6 @@
 			  sctp_conn->remote_initial_tsn);
 
   sctp_conn->peer_rwnd = clib_net_to_host_u32 (init_chunk->a_rwnd);
-
   /*
    * If the length specified in the INIT message is bigger than the size in bytes of our structure it means that
    * optional parameters have been sent with the INIT chunk and we need to parse them.
@@ -725,7 +724,7 @@
       return 0;
     }
 
-  if (is_gapping != 0)
+  if (is_gapping)
     {
       SCTP_CONN_TRACKING_DBG
 	("gapping != 0: CONN_INDEX = %u, sctp_conn->ack_state = %u",
@@ -733,6 +732,7 @@
       return 0;
     }
 
+  sctp_conn->ack_state += 1;
   if (sctp_conn->ack_state >= MAX_ENQUEABLE_SACKS)
     {
       SCTP_CONN_TRACKING_DBG
@@ -741,8 +741,6 @@
       return 0;
     }
 
-  sctp_conn->ack_state += 1;
-
   return 1;
 }
 
@@ -826,12 +824,15 @@
     }
   sctp_conn->last_rcvd_tsn = tsn;
 
-  *next0 = sctp_next_drop (sctp_conn->sub_conn[idx].c_is_ip4);
-
   SCTP_ADV_DBG ("POINTER_WITH_DATA = %p", b->data);
 
   if (!sctp_is_sack_delayable (sctp_conn, idx, is_gapping))
-    sctp_prepare_sack_chunk (sctp_conn, idx, b);
+    {
+      *next0 = sctp_next_output (sctp_conn->sub_conn[idx].c_is_ip4);
+      sctp_prepare_sack_chunk (sctp_conn, idx, b);
+    }
+  else
+    *next0 = sctp_next_drop (sctp_conn->sub_conn[idx].c_is_ip4);
 
   sctp_conn->sub_conn[idx].enqueue_state = error;
 
@@ -1022,13 +1023,13 @@
 
 		  sctp_connection_timers_init (new_sctp_conn);
 
+		  sctp_init_cwnd (new_sctp_conn);
+
 		  error0 =
 		    sctp_handle_init_ack (sctp_hdr, sctp_chunk_hdr,
 					  new_sctp_conn, idx, b0,
 					  sctp_implied_length);
 
-		  sctp_init_cwnd (new_sctp_conn);
-
 		  if (session_stream_connect_notify
 		      (&new_sctp_conn->sub_conn[idx].connection, 0))
 		    {
@@ -1505,12 +1506,15 @@
 		  sctp_connection_t * sctp_conn, u8 idx, vlib_buffer_t * b0,
 		  u16 * next0)
 {
+
   /* Check that the LOCALLY generated tag is being used by the REMOTE peer as the verification tag */
   if (sctp_conn->local_tag != sack_chunk->sctp_hdr.verification_tag)
     {
       return SCTP_ERROR_INVALID_TAG;
     }
 
+  sctp_conn->sub_conn[idx].state = SCTP_SUBCONN_SACK_RECEIVED;
+
   sctp_conn->sub_conn[idx].last_seen = sctp_time_now ();
 
   /* Section 7.2.2; point (2) */
@@ -1710,12 +1714,12 @@
 
 	      sctp_init_snd_vars (child_conn);
 
+	      sctp_init_cwnd (child_conn);
+
 	      error0 =
 		sctp_handle_init (sctp_hdr, sctp_chunk_hdr, child_conn, b0,
 				  sctp_implied_length);
 
-	      sctp_init_cwnd (child_conn);
-
 	      if (error0 == SCTP_ERROR_NONE)
 		{
 		  if (stream_session_accept
diff --git a/src/vnet/sctp/sctp_output.c b/src/vnet/sctp/sctp_output.c
index a4ba960..9ac3feb 100644
--- a/src/vnet/sctp/sctp_output.c
+++ b/src/vnet/sctp/sctp_output.c
@@ -463,6 +463,8 @@
   vnet_sctp_set_chunk_length (&init_chunk->chunk_hdr, chunk_len);
   vnet_sctp_common_hdr_params_host_to_net (&init_chunk->chunk_hdr);
 
+  sctp_init_cwnd (sctp_conn);
+
   init_chunk->a_rwnd = clib_host_to_net_u32 (sctp_conn->sub_conn[idx].cwnd);
   init_chunk->initiate_tag = clib_host_to_net_u32 (random_u32 (&random_seed));
   init_chunk->inboud_streams_count =
@@ -1405,7 +1407,12 @@
   SCTP_ADV_DBG_OUTPUT ("POINTER_WITH_DATA = %p, DATA_OFFSET = %u",
 		       b->data, b->current_data);
 
-  sctp_conn->last_unacked_tsn = sctp_conn->next_tsn;
+  if (sctp_conn->sub_conn[idx].state != SCTP_SUBCONN_AWAITING_SACK)
+    {
+      sctp_conn->sub_conn[idx].state = SCTP_SUBCONN_AWAITING_SACK;
+      sctp_conn->last_unacked_tsn = sctp_conn->next_tsn;
+    }
+
   sctp_conn->next_tsn += data_len;
 
   u32 inflight = sctp_conn->next_tsn - sctp_conn->last_unacked_tsn;
