Repository navigation
Add rank examples LAS and EDF, with SP-PIFO and AIFO next to the PIFO - #124
Merged
Merged
Conversation
p4-pifo-las and p4-pifo-edf build their network four times in one simulation, with the same traffic, and serve the ranks of the P4 program in four ways: a FIFO, SP-PIFO on the eight priority queues, AIFO on one FIFO, and ns3::P4PifoScheduler. - las.p4: least attained service; the rank is the bytes that the packet's TCP flow sent through the switch before it (AIFO's drops do not count). Short TCP flows pass two long ones; the example prints their completion times. - edf.p4: earliest deadline first; the rank is the arrival time plus the deadline of the packet's class, and the egress counts the late packets per class. - pifo_approx/sp_pifo.p4 and aifo.p4: SP-PIFO (NSDI 2020) and AIFO (SIGCOMM 2021) as P4 controls that a program applies once it knows the rank and the egress port. - examples/pifo-example.h: the network, the Poisson source and the register access, also used by p4-pifo-stfq now (its output is unchanged). - Docs: examples.md (rows, results, references), switch.md, README, TODO.md; the test list runs both examples. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mingyumaz
added a commit
that referenced
this pull request
Dec 1, 2026
Add rank examples LAS and EDF, with SP-PIFO and AIFO next to the PIFO (re-land of #124)
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.
Motivation
#123 gives v1model a PIFO per port (
ns3::P4PifoScheduler) and one rank example (STFQ). Two questions remain for users: which other rank functions work, and how close does a switch without PIFOs get, with the scheduling approximations that run on today's hardware (SP-PIFO on strict-priority queues, AIFO on one FIFO)? This PR adds two examples that answer both, side by side. It is based on #123 (feat/pifo); please review that first.What changes
p4-pifo-las(least attained service): the rank is the bytes that the packet's TCP flow sent through the switch before it, so short flows pass two long ones without the switch knowing flow sizes. Prints the flow completion times (FCT) of the short flows and the long flows' goodput.p4-pifo-edf(earliest deadline first): the rank is the arrival time plus the deadline of the packet's class (1, 2, 4 ms); three Poisson UDP flows keep a 100 Mbps port 94 % busy. The egress counts the late packets per class.examples/p4src/pifo_approx/sp_pifo.p4,aifo.p4: SP-PIFO (Alcoz et al., NSDI 2020) and AIFO (Yu et al., SIGCOMM 2021) as P4 controls that any program applies after it has computed the rank;las.p4andedf.p4include them. A registerapproximationswitches them on.examples/pifo-example.h: the network, a Poisson source and register access;p4-pifo-stfquses it now (its output is byte-identical).examples.md(rows, results tables, references),switch.md(PIFO section), README,TODO.md.Results (ns-3.39, default arguments):
p4-pifo-lasEDF, the class that missed its deadline most: FIFO 23.3 %, SP-PIFO 7.5 %, AIFO 12.6 %, PIFO 1.0 %.
AIFO drops instead of reordering. LAS ranks only grow, so a long flow's own earlier packets look smaller, and AIFO drops the flow, its retransmissions too, once the queue holds more than 1/8 of its capacity; each lost retransmission costs TCP a 200 ms timeout. The docs explain this; it is a property of AIFO with LAS, not a bug I could find.
Scope
p4-pifo-las --seconds=1,p4-pifo-edf).run-tests.shpasses: 24 suites, 253 cases, 46 example runs; build without warnings.p4-pifo-stfqis byte-identical.--seconds=1): the PIFO's mean FCT is 7–17× below the FIFO's (ns-3.49: 10–24×), SP-PIFO's at most 1.2× the PIFO's. EDF: the worst class misses 0–7.9 % with the PIFO, 14–26 % with the FIFO (same on both versions).Two reviews are needed before merging.
🤖 Generated with Claude Code