Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is WFQ agnostic to packet features? #52

Open
polybeandip opened this issue Aug 2, 2024 · 1 comment
Open

Is WFQ agnostic to packet features? #52

polybeandip opened this issue Aug 2, 2024 · 1 comment

Comments

@polybeandip
Copy link
Contributor

polybeandip commented Aug 2, 2024

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.

@anshumanmohan
Copy link
Contributor

anshumanmohan commented Aug 5, 2024

Good catch, thanks. Let's update either the code or the glossary. Probably the easy/safe move is to review Demers et al, SIGCOMM '89, see what they do, and run with that. A slightly better move would be to investigate what WFQ has come to mean since Demers' paper in 1989! And cite that and run with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants