Skip to content

Is WFQ agnostic to packet features? #52

@polybeandip

Description

@polybeandip

pifo-tree-artifact has a scheduling transaction for WFQ on a ternary tree: Node(✻, ✻, ✻).

let wfq_helper s weight var_last_finish pkt_len time : Rank.t * State.t =
  (* The WFQ-style algorithms have a common pattern,
      so we lift it into this helper method.
  *)
  let rank =
    if State.isdefined var_last_finish s then
      max (Time.to_float time) (State.lookup var_last_finish s)
    else Time.to_float time
  in
  let s' = State.rebind var_last_finish (rank +. (pkt_len /. weight)) s in
  (Rank.create rank time, s')
 
let scheduling_transaction s pkt =
  let time = Packet.time pkt in
  let flow = Packet.find_flow pkt in
  let var_last_finish = Printf.sprintf "%s_last_finish" (Flow.to_string flow) in
  let var_weight = Printf.sprintf "%s_weight" (Flow.to_string flow) in
  let weight = State.lookup var_weight s in
  let rank_for_root, s' =
    wfq_helper s weight var_last_finish (Packet.len pkt) time
  in
  let int_for_root =
    (* Put flow A into leaf 0, flow B into leaf 1, and flow C into leaf 2. *)
    match flow with
    | A -> 0
    | B -> 1
    | C -> 2
    | n -> failwith Printf.(sprintf "Don't know how to route flow %s." (Flow.to_string n))
  in
  ([ (int_for_root, rank_for_root); (0, Rank.create 0.0 time) ], s')

In particular, notice our algorithm uses Packet.len pkt (i.e. pkt_len in wfq_helper) to update var_last_finish in our state.

This is in contradiction of the entry for WFQ in our glossary of scheduling policies since the glossary says

Agnostic to packets' own features, but accepts user-set weights for prioritizing classes of packets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions