7676\DeclareMathOperator {\tzprepush }{z^{\prime }_{\mathrm {pre-push}}}
7777\DeclareMathOperator {\tzprepop }{z^{\prime }_{\mathrm {pre-pop}}}
7878\DeclareMathOperator {\tzpostpop }{z^{\prime }_{\mathrm {post-pop}}}
79+ \DeclareMathOperator {\cinit }{c_{\text {init}}}
80+ \DeclareMathOperator {\emt }{\mathrm {empty}}
7981
8082% theorems
8183\newtheorem {thm}{Theorem}[section]
155157
156158\reqnomode
157159
158- \textbf {Disclaimer }: we assume familiarity with citeOG , adopt its notational conventions, and steal its definitions!
160+ \textbf {Disclaimer }: we assume familiarity with \cite { OG } , adopt its notational conventions, and steal its definitions!
159161
160162Further, we work with a specific subset of \emph {Rio }, denoted $ \Rio $ , namely
161163\begin {align* }
@@ -230,6 +232,44 @@ \section{Structure and Semantics of Rio Trees}
230232% For $t \in \CTopo$ with $t \to t^\prime$, we'll occasionally use $t$ when we really mean the topology of the same shape, $t^\prime$.
231233% \end{abuse}
232234
235+ \begin {figure }[!htb]
236+ \centering
237+ \begin {subfigure }[t]{0.49\linewidth }
238+ \centering
239+ \begin {tikzpicture }[scale = 1.25]
240+ \node [draw, align=left] at (-1,-1.3) {$ A_1 $ };
241+ \node [align=left] at (-1.55,-1.3) {$ A$ };
242+ \node [draw, align=left] at (0,-2.3) {$ B_2 , B_1 $ };
243+ \node [align=left] at (-0.85,-2.3) {$ B$ };
244+ \node [draw, align=left] at (2,-2.3) {$ C_1 $ };
245+ \node [align=left] at (1.45,-2.3) {$ C$ };
246+
247+ \draw (0,0) -- (-1, -1);
248+ \draw (0,0) -- (1, -1);
249+ \draw (1,-1) -- (0, -2);
250+ \draw (1,-1) -- (2, -2);
251+ \end {tikzpicture }
252+ \caption {Over topology $ \Node (\ast , \Node (\ast , \ast ))$ }
253+ \end {subfigure }
254+ \begin {subfigure }[t]{0.49\linewidth }
255+ \centering
256+ \begin {tikzpicture }[scale = 1.25]
257+ \node [draw, align=left] at (-1,-1.3) {$ A_1 $ };
258+ \node [draw, align=left] at (0,-1.3) {$ B_1 $ };
259+ \node [draw, align=left] at (1,-1.3) {\phantom {$ C_1 $ }};
260+ \node [align=left] at (-1,-1.8) {$ A$ };
261+ \node [align=left] at (0,-1.8) {$ B$ };
262+ \node [align=left] at (1,-1.8) {$ C$ };
263+
264+ \draw (0,0) -- (-1, -1);
265+ \draw (0,0) -- (0, -1);
266+ \draw (0,0) -- (1, -1);
267+ \end {tikzpicture }
268+ \caption {Over topology $ \Node (\ast , \ast , \ast )$ }
269+ \end {subfigure }
270+ \caption {Rio trees decorated by classes $ A$ , $ B$ , and $ C$ }
271+ \end {figure }
272+
233273\begin {dfn }
234274 For topology $ t \in \Topo $ , the set $ \RioTree (t)$ of \emph {Rio trees } over $ t$ is defined by
235275 \begin {align* }
@@ -256,12 +296,13 @@ \section{Structure and Semantics of Rio Trees}
256296 \inference {}
257297 {
258298 ts \in \Topo ^n\\
259- rs \in \Rk ^{n}\\
299+ rs \in \Rk ^{n}\\\\
300+ \forall 1 \leq i < j \leq n. \; rs[i] \neq rs[j]\\
260301 \forall 1 \leq i \leq n. \; os[i] \in \OrdTree (ts[i])
261302 }
262303 {\Internal (rs, os) \in \OrdTree (\Node (ts))}
263304 \end {align* }
264- These are trees with each internal node's child given a rank, thereby inducing a total ordering of children.
305+ These are trees with each internal node's child given a \emph { unique } rank, thereby inducing a total ordering of children.
265306\end {dfn }
266307
267308Let $ \flow : \Pkt \to \Class $ be an opaque mapping from packets to the class they belong to (flow inference).
@@ -300,17 +341,27 @@ \section{Structure and Semantics of Rio Trees}
300341 &&
301342 \inference {}
302343 {
303- \exists 1 \leq i \leq |qs|. \; \ pop (qs[i], os[i]) = (\pkt , q)\\
344+ \pop (qs[i], os[i]) = (\pkt , q)\\ \\
304345 \forall 1 \leq j \leq |qs|. \; j \neq i \land \pop (qs[j], os[j]) = (\pkt ^\prime , q^\prime ) \implies rs[i] < rs[j]
305346 }
306347 {\pop (\Internal (qs), \Internal (rs, os)) = (\pkt , \Internal (qs[q/i]))}
307348 \end {align* }
308349 Informally, we recursively pop the smallest ranked, poppable subtree.
309350\end {dfn }
310351
311- \newpage
352+ \section {Modelling Scheduling Algorithms }
353+
354+ Like \cite {OG }, we model scheduling algorithms through a \emph {control }, a thin-layer over the tree policies run on.
355+ They keep track of
356+ \begin {enumerate }
357+ \item a state from a fixed collection $ \St $
358+ \item an underlying tree of buffered packets % is buffered the right word?
359+ \item scheduling transactions that update state and construct auxillary structures to push or pop the tree
360+ \end {enumerate }
361+ They come in two flavors: Rio \& PIFO Controls.
362+ The former determines the order to forward packets at dequeue while latter does so at enqueue.
312363
313- \section { PIFO \& Rio Controls }
364+ \subsection { Controls }
314365
315366\begin {figure }[!htb]
316367 \begin {align* }
@@ -360,8 +411,6 @@ \section{PIFO \& Rio Controls}
360411 \label {fig:control_push_pop }
361412\end {figure }
362413
363- For these notes, we'll refer to \emph {controls } from citeOG as \emph {PIFO controls }.
364-
365414\begin {dfn }
366415 Let $ t \in \Topo $ and \emph {scheduling transactions } $ \zprepush $ and $ \zpostpop $ be partial functions
367416 \begin {align* }
@@ -370,7 +419,7 @@ \section{PIFO \& Rio Controls}
370419 \end {align* }
371420 Define $ \PIFOControl (t, \zprepush , \zpostpop )$ to be the set of quadruples
372421 $$ (s, q, \zprepush , \zpostpop )$$
373- where $ s \in \St $ and $ q \in \PIFOTree (t)$ .
422+ where $ s \in \St $ and well-formed $ q \in \PIFOTree (t)$ .
374423\end {dfn }
375424
376425\begin {dfn }
@@ -387,23 +436,44 @@ \section{PIFO \& Rio Controls}
387436
388437Both controls admit $ \push $ and $ \pop $ operations:
389438\begin {align* }
390- \push &: \PIFOControl (t, \zprepush , \zpostpop ) \times \Pkt \to \PIFOControl (t, \zprepush , \zpostpop )\\
391- \pop &: \PIFOControl (t, \zprepush , \zpostpop ) \to \Pkt \times \PIFOControl (t, \zprepush , \zpostpop )\\
392- \push &: \RioControl (t, \zprepush , \zprepop , \zpostpop ) \times \Pkt \to \RioControl (t, \zprepush , \zprepop , \zpostpop )\\
393- \pop &: \RioControl (t, \zprepush , \zprepop , \zpostpop ) \to \Pkt \times \RioControl (t, \zprepush , \zprepop , \zpostpop )
439+ \push &: \PIFOControl (t, \zprepush , \zpostpop ) \times \Pkt \halfto \PIFOControl (t, \zprepush , \zpostpop )\\
440+ \pop &: \PIFOControl (t, \zprepush , \zpostpop ) \halfto \Pkt \times \PIFOControl (t, \zprepush , \zpostpop )\\
441+ \push &: \RioControl (t, \zprepush , \zprepop , \zpostpop ) \times \Pkt \halfto \RioControl (t, \zprepush , \zprepop , \zpostpop )\\
442+ \pop &: \RioControl (t, \zprepush , \zprepop , \zpostpop ) \halfto \Pkt \times \RioControl (t, \zprepush , \zprepop , \zpostpop )
394443\end {align* }
395444
396445Their semantics are written out in full in \Cref {fig:control_push_pop }.
397446
447+ \subsection {Simulations }
448+
449+ \begin {dfn }
450+ For $ t \in \Topo $ , define $ \emt _t \in \PIFOTree (t)$ such that
451+ \begin {align* }
452+ \inference {}
453+ {p \in \PIFO (\Pkt )\\ \pop (p) \text { is undefined}}
454+ {\emt _{\ast } = \Leaf (p)}
455+ &&
456+ \inference {}
457+ {
458+ ts \in \Topo ^n\\
459+ p \in \PIFO (\{ 1, \ldots , n\} )\\\\
460+ \pop (p) \text { is undefined}\\
461+ \forall 1 \leq i \leq n. \; qs[i] = \emt {ts[i]}
462+ }
463+ {\emt _{\Node (ts)} = \Internal (p, qs)}
464+ \end {align* }
465+ Informally, $ \emt _t$ is a PIFO tree of topology $ t$ , with empty PIFOs at all nodes.
466+ \end {dfn }
467+
398468\begin {dfn }
399469 Define the $ \to \; \subseteq \PIFOControl (t, \zprepush , \zpostpop ) \times \PIFOControl (t, \zprepush , \zpostpop )$ by
400470 \begin {align* }
401471 \inference {}
402- {\pkt \in \Pkt \\ \push c \pkt = c^\prime }
472+ {\pkt \in \Pkt \\ \push (c, \pkt ) = c^\prime }
403473 {c \to c^{\prime }}
404474 &&
405475 \inference {}
406- {\pop c = (\pkt , c^\prime )}
476+ {\pop (c) = (\pkt , c^\prime )}
407477 {c \to c^{\prime }}
408478 \end {align* }
409479 i.e. $ c \to c^\prime $ if $ c^\prime $ is a push or pop from $ c$ .
@@ -414,14 +484,14 @@ \section{PIFO \& Rio Controls}
414484 A partial function
415485 $$
416486 f :
417- \RioControl (t, \zprepush , \zprepop , \zpostpop )
487+ \PIFOControl (t, \zprepush , \zpostpop )
418488 \halfto
419- \PIFOControl (t^\prime , \tzprepush , \tzpostpop )
489+ \RioControl (t^\prime , \tzprepush , \tzprepop , \tzpostpop )
420490 $$
421- is \emph {simulation } if, for all $ \pkt \in \Pkt $ and $ f(c_ 1 ) = c_ 2 $ , the following conditions are satisfied:
491+ is \emph {simulation } if the following conditions are satisfied:
422492 \begin {enumerate }
423- \item There exists $ f( c_{\text { init}}) = c^{ \prime }_{ \text {init}} $ where the trees in $ c_{\text { init}} $ and $ c^ \prime _{ \text {init}} $ hold empty PIFOs at the leaves .
424- \item If $ c_{\text {init}} \to ^\ast c_1 $ ,
493+ \item There exists $ c_{init} = (s, q, \zprepush , \zpostpop ) $ where $ q = \emt _t $ and $ c_{init} \in \operatorname {dom} f $ .
494+ \item When $ c_{\text {init}} \to ^\ast c_1 $ and $ f(c_ 1 ) = c_ 2 $ , we can guarantee the following:
425495 \begin {align }
426496 \pop (c_1) \text { is undefined} &\implies \pop (c_2) \text { is undefined}\\
427497 \pop (c_1) = (\pkt , c^\prime _1) &\implies \pop (c_2) = (\pkt , c^\prime _2) \land f(c_1^\prime ) = c_2^\prime \\
@@ -430,6 +500,7 @@ \section{PIFO \& Rio Controls}
430500 \end {enumerate }
431501\end {dfn }
432502
503+
433504\newpage
434505
435506\section {Enqueue and Dequeue-Side Equivalence }
@@ -441,17 +512,18 @@ \subsection{Round-Robin}
441512\begin {figure }[!htb]
442513 \centering
443514 \begin {subfigure }[t]{0.49\linewidth }
444- \lstinputlisting {sched_trans/rio/z_post-pop.pseudo}
445- \lstinputlisting {sched_trans/rio/z_pre-pop.pseudo}
446- \lstinputlisting {sched_trans/rio/z_pre_push.pseudo}
447- \caption {Rio Control}
448- \end {subfigure }
449- \begin {subfigure }[t]{0.49\linewidth }
450- \lstinputlisting {sched_trans/pifo/z_post-pop.pseudo}
451515 \lstinputlisting {sched_trans/pifo/z_pre-push.pseudo}
516+ \lstinputlisting {sched_trans/pifo/z_post-pop.pseudo}
452517 \caption {PIFO Control}
453518 \end {subfigure }
519+ \begin {subfigure }[t]{0.49\linewidth }
520+ \lstinputlisting {sched_trans/rio/z_pre_push.pseudo}
521+ \lstinputlisting {sched_trans/rio/z_pre-pop.pseudo}
522+ \lstinputlisting {sched_trans/rio/z_post-pop.pseudo}
523+ \caption {Rio Control}
524+ \end {subfigure }
454525 \caption {Scheduling Transactions}
526+ \label {fig:sched_trans }
455527\end {figure }
456528
457529For $ n \in \mathbb N$ , let's put our theory to use by constructing PIFO and Rio controls for
@@ -461,15 +533,21 @@ \subsection{Round-Robin}
461533
462534Both controls use the same underlying topology, namely
463535$$
464- t = \Node (( \underbrace {\ast , \ast , \ldots , \ast }_{n \text { times}}) )
536+ t = \Node (\underbrace {\ast , \ast , \ldots , \ast }_{n \text { times}})
465537$$
466- Figure \Cref {fig:placeholder } describes the scheduling transactions
467-
468-
469-
470- and showing they're in simulation.
471- This would show the equivalence of enqueue and dequeue-side semantics for a specific type of program!
538+ \Cref {fig:sched_trans } describes their scheduling transactions in pseudocode.
539+ Therefore, we have the materials to define
540+ \begin {align* }
541+ \PIFOControl (t, \zprepush , \zpostpop )
542+ &&
543+ \text {and}
544+ &&
545+ \RioControl (t, \tzprepush , \tzprepop , \tzpostpop )
546+ \end {align* }
547+ I.e. the collection of PIFO and Rio controls for our program.
548+ Let's find a simulation between them!
472549
550+ \newpage
473551
474552\renewcommand \refname {\LARGE References}
475553\bibliographystyle {alpha}
0 commit comments