Commit b570d7b8 authored by jan.koester's avatar jan.koester
Browse files

test

parent 3a82092e
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -1055,7 +1055,17 @@ namespace netplus {
		std::map<uint64_t, uint64_t> _pending_max_stream_data;

		// ---- Congestion Control (NewReno, RFC 9002) ----
		uint64_t _cwnd = 10 * 1024 * 1024;         // 10MB initial cwnd (aggressive start)
		// RFC 9002 §7.2: kInitialWindow = min(10*max_datagram_size,
		// max(2*max_datagram_size, 14720)). The previous 10MB value
		// bypassed congestion control entirely for any transfer under
		// ~10MB, letting the sender burst far more data than the kernel's
		// UDP receive buffer (already maxed out at this host's
		// net.core.rmem_max of 4MB) can hold — measured 10,502 real
		// kernel-level RcvbufErrors (genuine packet loss, confirmed via
		// /proc/net/snmp) in one benchmark run, which in turn drove
		// spurious PACKET_THRESHOLD retransmissions.
		uint64_t _cwnd = std::min<uint64_t>(10 * _max_udp_payload,
		                                     std::max<uint64_t>(2 * _max_udp_payload, 14720));
		uint64_t _ssthresh = UINT64_MAX;           // slow start threshold
		uint64_t _bytes_in_flight = 0;             // unacknowledged bytes
		static constexpr uint64_t MIN_CWND = 2 * 1472; // minimum cwnd (2 * MTU)