This paper studies PIFO trees from a programming language perspective. PIFO
trees are a recently proposed model for programmable packet schedulers. They
can express a wide range of scheduling algorithms including strict priority,
weighted fair queueing, hierarchical schemes, and more. However, their semantic
properties are not well understood. We formalize the syntax and semantics of
PIFO trees in terms of an operational model. We also develop an alternate
semantics in terms of permutations on lists of packets, prove theorems
characterizing expressiveness, and develop an embedding algorithm for
replicating the behavior of one with another. We present a prototype
implementation of PIFO trees in OCaml and relate its behavior to a hardware
switch on a variety of standard and novel scheduling algorithms.Comment: 25 pages, 12 figure