From f9f7d48e72ea8ef00209616ff95fbb2093195bb4 Mon Sep 17 00:00:00 2001 From: Akilan Selvacoumar Date: Mon, 21 Feb 2022 02:38:58 +0400 Subject: [PATCH 1/4] added fix to nak interval --- udt/congestion_native.go | 13 ++++++------- udt/udtsocket_send.go | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/udt/congestion_native.go b/udt/congestion_native.go index 44847aa..b774b06 100644 --- a/udt/congestion_native.go +++ b/udt/congestion_native.go @@ -31,7 +31,7 @@ func (ncc *NativeCongestionControl) Init(parms CongestionControlParms, synTime t // This value should be adjusted at runtime according to congestion. parms.SetACKInterval(4) - + ncc.slowStart = false ncc.lastAck = parms.GetSndCurrSeqNo() ncc.loss = false @@ -87,7 +87,7 @@ func (ncc *NativeCongestionControl) OnACK(parms CongestionControlParms, ack pack } if ncc.loss { ncc.loss = false - parms.SetCongestionWindowSize(cWndSize) + //parms.SetCongestionWindowSize(cWndSize) return } /* @@ -189,14 +189,13 @@ func (ncc *NativeCongestionControl) OnNAK(parms CongestionControlParms, losslist ncc.nakCount++ if ncc.decRandom != 0 && ncc.nakCount%ncc.decRandom != 0 { ncc.decCount++ + // 0.875^5 = 0.51, rate should not be decreased by more than half within a congestion period + parms.SetPacketSendPeriod(pktSendPeriod * 1125 / 1000) + ncc.lastDecSeq = parms.GetSndCurrSeqNo() return } } - ncc.decCount++ - - // 0.875^5 = 0.51, rate should not be decreased by more than half within a congestion period - parms.SetPacketSendPeriod(pktSendPeriod * 1125 / 1000) - ncc.lastDecSeq = parms.GetSndCurrSeqNo() + //ncc.decCount++ } } diff --git a/udt/udtsocket_send.go b/udt/udtsocket_send.go index 660bffc..5dbc598 100644 --- a/udt/udtsocket_send.go +++ b/udt/udtsocket_send.go @@ -93,6 +93,7 @@ func (s *udtSocketSend) goSendEvent() { } sendPeriod := s.sndPeriod.get() + if sendPeriod == 0 { return nil } From e45dddd6f5b842f9b4b5b7a43dd59764bdf71f51 Mon Sep 17 00:00:00 2001 From: Peter Kleissner Date: Mon, 21 Feb 2022 00:29:49 +0100 Subject: [PATCH 2/4] Update congestion_native.go Remove non-used lines --- udt/congestion_native.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/udt/congestion_native.go b/udt/congestion_native.go index b774b06..ff91a39 100644 --- a/udt/congestion_native.go +++ b/udt/congestion_native.go @@ -87,7 +87,6 @@ func (ncc *NativeCongestionControl) OnACK(parms CongestionControlParms, ack pack } if ncc.loss { ncc.loss = false - //parms.SetCongestionWindowSize(cWndSize) return } /* @@ -195,7 +194,6 @@ func (ncc *NativeCongestionControl) OnNAK(parms CongestionControlParms, losslist return } } - //ncc.decCount++ } } From 66e351ca64016e27c3647ca93a0d40e9a1c5f261 Mon Sep 17 00:00:00 2001 From: Peter Kleissner Date: Mon, 21 Feb 2022 00:30:30 +0100 Subject: [PATCH 3/4] Update udtsocket_send.go --- udt/udtsocket_send.go | 1 - 1 file changed, 1 deletion(-) diff --git a/udt/udtsocket_send.go b/udt/udtsocket_send.go index 5dbc598..660bffc 100644 --- a/udt/udtsocket_send.go +++ b/udt/udtsocket_send.go @@ -93,7 +93,6 @@ func (s *udtSocketSend) goSendEvent() { } sendPeriod := s.sndPeriod.get() - if sendPeriod == 0 { return nil } From 332fbbf82978c394a2c2fe5a238eeeb897f51d1e Mon Sep 17 00:00:00 2001 From: Peter Kleissner Date: Mon, 21 Feb 2022 00:31:15 +0100 Subject: [PATCH 4/4] Update congestion_native.go --- udt/congestion_native.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/udt/congestion_native.go b/udt/congestion_native.go index ff91a39..ff93a17 100644 --- a/udt/congestion_native.go +++ b/udt/congestion_native.go @@ -31,7 +31,7 @@ func (ncc *NativeCongestionControl) Init(parms CongestionControlParms, synTime t // This value should be adjusted at runtime according to congestion. parms.SetACKInterval(4) - + ncc.slowStart = false ncc.lastAck = parms.GetSndCurrSeqNo() ncc.loss = false