Skip to content

Commit

Permalink
Rename unfair -> rwnd
Browse files Browse the repository at this point in the history
  • Loading branch information
ccanel committed Feb 29, 2024
1 parent 58188e2 commit 6375aa0
Show file tree
Hide file tree
Showing 57 changed files with 96 additions and 96 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.224.2/containers/docker-existing-dockerfile
{
"name": "unfair",
"image": "ccanel/unfair:latest",
"name": "rwnd",
"image": "ccanel/rwnd:latest",
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
Expand Down
22 changes: 11 additions & 11 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "(d) runtime",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/unfair/runtime/unfair_runtime.py",
"program": "${workspaceFolder}/rwnd/runtime/rwnd_runtime.py",
"console": "integratedTerminal",
"args": [
"-h"
Expand All @@ -26,7 +26,7 @@
"name": "(r) runtime",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/unfair/runtime/unfair_runtime.py",
"program": "${workspaceFolder}/rwnd/runtime/rwnd_runtime.py",
"console": "integratedTerminal",
"args": [
"--model=HistGbdtSklearn",
Expand All @@ -36,7 +36,7 @@
"--cgroup=${workspaceFolder}/test/test_cgroup",
"--inference-interval-ms=100",
"--batch-size=10",
"--log=/tmp/unfairmon.log",
"--log=/tmp/rwnd.log",
"--skip-localhost",
"--listen-ports=9999",
"--debug",
Expand All @@ -56,7 +56,7 @@
"name": "(r) runtime, schedule",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/unfair/runtime/unfair_runtime.py",
"program": "${workspaceFolder}/rwnd/runtime/rwnd_runtime.py",
"console": "integratedTerminal",
"args": [
"--model=HistGbdtSklearn",
Expand All @@ -66,7 +66,7 @@
"--schedule=${workspaceFolder}/test/rwnd_schedule_step.csv",
"--cgroup=${workspaceFolder}/test/test_cgroup",
"--inference-interval-ms=1000",
"--log=/tmp/unfairmon_main.log",
"--log=/tmp/rwnd.log",
// "--disable-inference"
],
"autoReload": {
Expand All @@ -87,14 +87,14 @@
"args": [
"-o",
"/tmp/tmp.prof",
"${workspaceFolder}/unfair/runtime/unfair_runtime.py",
"${workspaceFolder}/rwnd/runtime/rwnd_runtime.py",
"--model=HistGbdtSklearn",
"--model-file=${workspaceFolder}/test/HistGbdtSklearn_fewer_features.pickle",
"--interface=ens3",
"--reaction-strategy=aimd",
"--cgroup=${workspaceFolder}/test/test_cgroup",
"--inference-interval-ms=1000",
"--log=/tmp/unfairmon_main.log",
"--log=/tmp/rwnd.log",
// "--skip-localhost",
"--constrain-port",
"--debug",
Expand All @@ -113,7 +113,7 @@
"name": "(r) train cubic bbr",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/unfair/model/train.py",
"program": "${workspaceFolder}/rwnd/model/train.py",
"console": "integratedTerminal",
"args": [
"--no-rand",
Expand Down Expand Up @@ -147,7 +147,7 @@
"name": "(r) prepare_data",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/unfair/model/prepare_data.py",
"program": "${workspaceFolder}/rwnd/model/prepare_data.py",
"console": "integratedTerminal",
"args": [
"--data-dir=/home/ccanel/fawnstore2/out/cloudlab/2021-5-12/cubic-bbr",
Expand All @@ -172,7 +172,7 @@
"name": "(r) gen_features",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/unfair/model/gen_features.py",
"program": "${workspaceFolder}/rwnd/model/gen_features.py",
"console": "integratedTerminal",
"args": [
"--exp-dir=/home/ccanel/fawnstore2/out/cloudlab/2022-06-10/cubic-bbr/experiments",
Expand All @@ -195,7 +195,7 @@
"name": "(r) eval",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/unfair/scripts/eval.py",
"program": "${workspaceFolder}/rwnd/scripts/eval.py",
"console": "integratedTerminal",
"args": [
"--exp-dir=/home/ccanel/out/cloudlab/2022-4-21/",
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# unfair
Receiver-side mechanisms to address unfair TCP senders
# rwnd
Receiver-side mechanisms for rate control of TCP flows.
2 changes: 1 addition & 1 deletion fstab
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# /etc/fstab configuration for MAAS cluster
192.168.0.11:/volume1/datapository/users/ccanel/unfair /home/ubuntu/fawnstore2 nfs rw,soft,intr,nofail 2 0
192.168.0.11:/volume1/datapository/users/ccanel/rwnd /home/ubuntu/fawnstore2 nfs rw,soft,intr,nofail 2 0
tmpfs /tmp tmpfs defaults,noatime,nosuid,nodev,noexec,mode=1777,size=50G 0 0
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion unfair/model/cl_args.py → rwnd/model/cl_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
from os import path

from unfair.model import defaults, models
from rwnd.model import defaults, models


def add_out(psr, psr_verify=lambda args: args):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion unfair/model/data.py → rwnd/model/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from numpy.lib import recfunctions
import torch

from unfair.model import defaults, features, models, utils
from rwnd.model import defaults, features, models, utils


def get_dataloaders(args, net):
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion unfair/model/features.py → rwnd/model/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import itertools

from unfair.model import defaults
from rwnd.model import defaults


def make_ewma_metric(metric, alpha):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import json
import numpy as np

from unfair.model import cl_args, defaults, features, loss_event_rate, utils
from rwnd.model import cl_args, defaults, features, loss_event_rate, utils


def get_time_bounds(pkts, direction="data"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
DUR_s = 240
# Delay until ACK pacing begins.
WARMUP_s = 60
# Whether to enable unfairness mitigation.
# Whether to enable RateMon.
ENABLE_MITIGATION = False
# Whether to capture pcap traces.
PCAP = True
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import collections
import logging

from unfair.model import features
from rwnd.model import features


class LossTracker:
Expand Down
2 changes: 1 addition & 1 deletion unfair/model/models.py → rwnd/model/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from sklearn import svm
import torch

from unfair.model import defaults, features, utils
from rwnd.model import defaults, features, utils


SMOOTHING_THRESHOLD = 0.4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
# validate the CloudLab parallel testbed.
#
# Usage: ./parse_validation_exps.sh \
# <cmu-snap:unfair repo dir> <iterations dir> <scratch (untar) dir> \
# <cmu-snap:rwnd repo dir> <iterations dir> <scratch (untar) dir> \
# <direction to parse (forward or reverse)>

set -o errexit
set -o nounset

UNFAIR_DIR=$1
RWND_DIR=$1
ITERS_DIR=$2
UNTAR_DIR=$3
DIRECTION=$4
Expand All @@ -23,7 +23,7 @@ parse_iter_batchsize () {
ITER=$1
BATCH_SIZE=$2
EXP_DIR="$ITERS_DIR/iter_$ITER/batchsize_$BATCH_SIZE"
python "$UNFAIR_DIR/model/parse_cloudlab.py" --exp-dir "$EXP_DIR" \
python "$RWND_DIR/model/parse_cloudlab.py" --exp-dir "$EXP_DIR" \
--untar-dir "$UNTAR_DIR" --out-dir "$EXP_DIR" \
--skip-smoothed-features
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import numpy as np

from unfair.model import cl_args, defaults, features, models, utils
from rwnd.model import cl_args, defaults, features, models, utils


SPLIT_NAMES = ["train", "val", "test"]
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion unfair/model/sim.py → rwnd/model/sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


# Path to the ns-3 top-level directory.
# Warning: If you move this file from the directory "unfair/model", then you
# Warning: If you move this file from the directory "rwnd/model", then you
# must update this variable.
NS3_DIR = path.join(path.dirname(path.realpath(__file__)), "..", "ns-3-unfair")
# The name of the ns-3 application to run.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions unfair/model/train.py → rwnd/model/train.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""Trains an unfairness model.
"""Trains a FlowPolicy model.
Based on:
https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html
Expand Down Expand Up @@ -31,7 +31,7 @@

import torch

from unfair.model import cl_args, data, defaults, models, utils
from rwnd.model import cl_args, data, defaults, models, utils


# The threshold of the new throughout to the old throughput above which a
Expand Down
File renamed without changes.
16 changes: 8 additions & 8 deletions unfair/model/utils.py → rwnd/model/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from sklearn import inspection
import torch

from unfair.model import defaults, features
from rwnd.model import defaults, features


# Values considered unsafe for division and min().
Expand Down Expand Up @@ -274,7 +274,7 @@ def __init__(self, sim):
ccas,
flows,
ping_ms,
use_unfairmon,
use_ratemon,
use_bess,
_,
_,
Expand Down Expand Up @@ -306,7 +306,7 @@ def __init__(self, sim):
queue_p,
cca_1_flws,
cca_2_flws,
use_unfairmon,
use_ratemon,
_,
# end_time,
_,
Expand All @@ -329,7 +329,7 @@ def __init__(self, sim):
cca_1_flws,
cca_2_flws,
ping_ms,
use_unfairmon,
use_ratemon,
use_bess,
_,
# end_time,
Expand All @@ -353,7 +353,7 @@ def __init__(self, sim):
bitrate_Mbps_1,
bitrate_Mbps_2,
ping_ms,
use_unfairmon,
use_ratemon,
use_bess,
_,
# end_time,
Expand All @@ -378,7 +378,7 @@ def __init__(self, sim):
bitrate_Mbps_2,
bitrate_Mbps_back,
ping_ms,
use_unfairmon,
use_ratemon,
use_bess,
_,
# end_time,
Expand Down Expand Up @@ -416,8 +416,8 @@ def __init__(self, sim):
# Baseline ping RTT between sender and receiver.
self.ping_ms = float(ping_ms[:-4])
self.ping_us = self.ping_ms * 1e3
# Whether the unfairness monitor was used in this experiment.
self.use_unfairmon = use_unfairmon == "unfairTrue"
# Whether RateMon was used in this experiment.
self.use_ratemon = use_ratemon == "unfairTrue"
# Whether bess was used for bottleneck emulation in this experiment.
self.use_bess = use_bess == "bessTrue"
# Experiment duration (s).
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import threading
import time

from unfair.model import defaults, loss_event_rate, utils
from rwnd.model import defaults, loss_event_rate, utils


class FlowKey(ctypes.Structure):
Expand Down
16 changes: 8 additions & 8 deletions unfair/runtime/inference.py → rwnd/runtime/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
from pyroute2 import IPRoute, protocols
from pyroute2.netlink.exceptions import NetlinkError

from unfair.model import data, defaults, features, gen_features, models, utils
from unfair.runtime import flow_utils, reaction_strategy
from unfair.runtime.reaction_strategy import ReactionStrategy
from rwnd.model import data, defaults, features, gen_features, models, utils
from rwnd.runtime import flow_utils, reaction_strategy
from rwnd.runtime.reaction_strategy import ReactionStrategy


def predict(net, in_fets, debug=False):
Expand Down Expand Up @@ -176,7 +176,7 @@ def make_decision_sender_fairness(
# ]
# ).any():
# logging.info("Mode 2")
# # The current measurement is that the sender is not unfair, but at
# # The current measurement is that the sender is not above target, but at
# # least one of its flows is already being paced. If the bottlenck is
# # not fully utilized, then allow the flows to speed up.
# #
Expand Down Expand Up @@ -246,7 +246,7 @@ def make_decision_sender_fairness(

# else:
# logging.info("Mode 3")
# # The sender is not unfair or it is unfair but the link is not fully
# # The sender is not above target or it is above target but the link is not fully
# # utilized, and none of its flows behaved badly in the past, so leave
# # it alone.
# new_decision = (defaults.Decision.NOT_PACED, None, None)
Expand Down Expand Up @@ -312,7 +312,7 @@ def make_decision_flow_fairness(
# then all is well. Retain the existing pacing decision.
new_decision = flow_to_decisions[flowkey]
else:
# This flow is not already being paced and is not behaving unfairly, so
# This flow is not already being paced and is not above rate, so
# leave it alone.
new_decision = (defaults.Decision.NOT_PACED, None, None)
return new_decision
Expand Down Expand Up @@ -355,7 +355,7 @@ def apply_decision(flowkey, new_decision, flow_to_decisions, flow_to_rwnd):
def make_decision(
args, flowkeys, min_rtt_us, fets, label, flow_to_decisions, flow_to_rwnd
):
"""Make a flow unfairness mitigation decision.
"""Make a rate control mitigation decision.
Base the decision on the flow's label and existing decision. Use the flow's features
to calculate any necessary flow metrics, such as the throughput.
Expand Down Expand Up @@ -417,7 +417,7 @@ def load_bpf():
# Load BPF text.
bpf_flp = path.join(
path.abspath(path.dirname(__file__)),
"unfair_runtime.c",
"rwnd_runtime.c",
)
if not path.isfile(bpf_flp):
logging.error("Could not find BPF program: %s", bpf_flp)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Defines unfairness mitigation strategies."""
"""Defines mitigation strategies for flows that are above their target rate."""

from enum import IntEnum


class MitigationStrategy(IntEnum):
"""Defines unfairness mitigation strategies."""
"""Defines mitigation strategies for flows that are above their target rate."""

RWND_TUNING = 0
ACK_PACING = 1
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 6375aa0

Please sign in to comment.