Repository navigation
queueing: report a RED early drop as congestion - #1328
Merged
Merged
Conversation
adamgeorge309
force-pushed
the
topic/gy/red-drop-reason-congestion
branch
from
October 15, 2026 10:25
ed9923e to
b870821
Compare
This was referenced Oct 15, 2026
Contributor
|
Could you please rebase this to master again? |
RedDropper (Random Early Detection, RED) declares packetDropCongestion, which counts packetDropped signals with reason CONGESTION, but emitted every drop with OTHER_PACKET_DROP, so the statistic always read 0. It did not override PacketFilterBase::dropPacket(Packet *), the hook that 27c5803 added for a filter to name its drop reason. The statistic came with a CONGESTION reason in the old queue package; when b63e232 added the queueing package that replaced it, the statistic line was carried over and the reason was not. RedDropper now overrides the hook, with the result of the decision that handlePacketFiltered() stores before each drop. A drop that RED decides from the average queue length (random between minth and maxth, forced at or above maxth) is reported as CONGESTION. A drop because the queue holds packetCapacity packets is reported as QUEUE_OVERFLOW, as PacketQueue reports a full buffer, so packetDropCongestion counts only the drops RED decides on. Which packets are dropped does not change. In 1 s of a 20 Mb/s User Datagram Protocol (UDP) flow into a 10 Mb/s RedDropperQueue (minth 3, maxth 4, packet capacity 24), RED drops 1324 packets; packetDropCongestion counts 0 of them before this commit and 1324 after it. tests/module/RedDropper_congestion_drop_reason.test runs that scenario for 0.5 s and checks that packetDropCongestion is not 0; it fails before this commit. No fingerprint changes. Statistical baselines that record packetDropCongestion move where RED makes early drops: netperfmeter SCTP-with-OLIA (41 of its 108 drops) and dctcp TcpRenoIncast (27 of 27). Change: src.queueing.RedDropper | behavior.change.fix | statistical test whatsnew
adamgeorge309
force-pushed
the
topic/gy/red-drop-reason-congestion
branch
from
October 19, 2026 12:31
cf1977e to
c255ad8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RedDropper(Random Early Detection, RED) declares one statistic of its own,packetDropCongestion, which counts drops with reasonCONGESTION, but it emitted every drop withOTHER_PACKET_DROP, so the statistic always read 0 while RED dropped packets.RedDroppernow reports an early drop asCONGESTIONand a drop at its packet capacity asQUEUE_OVERFLOW, asPacketQueuedoes for a full buffer.Risk: only the reason attached to the
packetDroppedsignal changes; which packets are dropped, and when, does not. ThepacketDropCongestionscalars and vectors of every RED queue that makes early drops, including the RED filters insideEthernetQosRedQueueand the Differentiated ServicesAFxyQueue, become non-zero, and any analysis that splits drops by reason counts those drops asCONGESTIONinstead ofOTHER_PACKET_DROP. No fingerprint changes.Closes #1327
One commit:
queueing: fix: report a RED early drop as congestion.The problem
RedDropper.ned:51declares the statistic:When
RedDropper::matchesPacket()returns false,PacketFilterBasedrops the packet throughdropPacket(Packet *), which hard-codes the reason (src/inet/queueing/base/PacketFilterBase.cc:264-267):RedDropperdid not override it. That overload was added for this purpose by27c58038a9("to allow specifying the reason in derived classes"), andProtocolCheckeroverrides it to reportNO_PROTOCOL_FOUND. The statistic was introduced with aCONGESTIONreason in7b79379969, in the old queue package'sAlgorithmicDropperBase::dropPacket(); whenb63e2327d9added the queueing package that replaced it, the@statisticline was carried over to the newRedDropper.nedand the reason was not.The fix
RedDropper::dropPacket(Packet *)passes the reason from the result of the last RED decision (lastResult, stored byhandlePacketFiltered(), whichPacketFilterBasecalls before each drop, at the start of a streamed packet):RANDOMLY_ABOVE_LIMITandABOVE_MAX_LIMIT, the early drops of a packet that is not marked with Explicit Congestion Notification (ECN):CONGESTION;QUEUE_FULL, the queue already holdspacketCapacitypackets:QUEUE_OVERFLOW, the reasonPacketQueue,CompoundPacketQueueBaseandPacketBuffergive for a full buffer. This keepspacketDropCongestionto the drops RED decides on, and departs from the oldAlgorithmicDropperBase, which reported full-buffer drops asCONGESTIONas well.OTHER_PACKET_DROP, as before.Architectural surface
RedDropperoverrides one more virtual function,dropPacket(Packet *), declared inPacketFilterBase, and keeps one more protected member,lastResult. The one contract that changes is the reason in thePacketDropDetailsthatRedDropperattaches topacketDropped:CONGESTIONorQUEUE_OVERFLOWinstead ofOTHER_PACKET_DROP. No Network Description (NED) parameter, statistic declaration, message field or feature descriptor changes.Verification
Reproduction:
client --100Mbps-- router --10Mbps-- server, IPv4, aRedDropperQueueon the router's 10 Mb/s interface (minth = 3,maxth = 4,maxp = 1,wq = 1,packetCapacity = 24), and User Datagram Protocol (UDP) traffic of 1000 B every 0.4 ms (20 Mb/s) from t=8 s to t=9 s. A second run adds a probe statistic to the RED module,@statistic[packetDropUndefined](source=packetDropReasonIsUndefined(packetDropped); record=count), which counts drops with reasonOTHER_PACKET_DROP.router.eth[1].queue.reddroppedPackets:countrouter.eth[1].queue.redpacketDropCongestion:countrouter.eth[1].queue.redpacketDropUndefined:count(probe)server.app[0]packetReceived:countThe queue behind RED peaks at 4 packets, so all 1324 drops are early drops.
tests/module/RedDropper_congestion_drop_reason.testruns the same network with 0.5 s of traffic, to keep the test short, and checks thatpacketDropCongestion:countis not 0; it fails on master and passes with this change.Release build (
make MODE=releasein the root andtests/module/lib), each suite run on master1cdb362a2awith the new test file added, and with this change, before the rebase onto41eee1d619:tests/fingerprint: ./fingerprinttest -s -F tyftests/module: inet_run_module_tests -m release --no-build -l ERRORRedDropper_congestion_drop_reasonpassesThe 5 fingerprint failures are rows of
mipv6-refactoring.csvwhose recorded~tNlbfingerprints are stale on master. Of the 63 errors, 62 are configurations whose optional features are not built, and one is marked as expected. The drop reason is not a fingerprint ingredient, so no passing row moves, including those ofexamples/inet/redmarkerandexamples/inet/dctcp, which useRedDropperQueue. Of the 279 module failures on master, 264 aretcp_*tests, one is the new test, and 14 are unrelated to queueing; all but the new test fail with this change as well.After the rebase onto master
41eee1d619, which contains741a0baa6b(RedDropperdecides in the constmatchesPacket()and stores the state inhandlePacketFiltered()), with and without this change: the reproduction gives the same numbers as above; the new test fails on master and passes with this change;tests/queueing: inet_run_queueing_tests -m release --no-build -l ERRORgives the same results (75 run, 63 pass, the same 12 fail,RedDropper_1among them, because it expectsEV_DEBUGlines that a release build compiles out); and./fingerprinttest -s -F tyf -m 'RedDropper|onedomain|dctcp|netperfmeter|redmarker'passes its 24 rows.Debug build, before the rebase (
make MODE=debugin the root andtests/module/lib, exit 0, no compiler warning inRedDropper):cd tests/module && inet_run_module_tests -m debug --no-build -l ERROR -f RedDropperpasses the new test.Statistical baselines (the separate
statisticsrepository at8fdf7f5, where076c3e9and8fdf7f5re-recorded the RED configurations after741a0baa6b): of the configurations whose recorded results contain a RED module, three record drops. Each was run with this change on41eee1d619. All three are also fingerprint rows that pass unchanged, so the drops themselves do not change:packetDropCongestion:countwith this changepacketDropCongestion:count(droppedPackets:count)tutorials/queueingRedDropperexamples/inet/netperfmeterSCTP-with-OLIA(Stream Control Transmission Protocol with the Opportunistic Linked-Increases Algorithm)examples/inet/dctcpTcpRenoIncastexamples/inet/dctcpDcTcpIncastrecords no RED drops, in the baseline and with this change. TheSCTP-with-OLIAandTcpRenoIncastbaselines need re-recording forpacketDropCongestion. They are not updated here: they belong in a commit to the statistics repository after this merges, naming this one. Not verified by a test: aQUEUE_FULLdrop reported asQUEUE_OVERFLOW; in the reproduction the buffer never fills.Gates:
check-pull-request.sh --base origin/master(commits, classification, includes, NED parameters, description),check-source-seals.sh --base origin/masterandcheck-architecture.sh src/inet/queueingpass.Relationship to other pull requests
#1250 (RED with ECN for IPv6) mentions this as a side observation and does not change it. #1322, #1324, #1326 and #1334 also add an entry under "Notable bug fixes" in
WHATSNEW; whichever merges later renumbers.