Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tornettools/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ def __generate_shadow_config(args, network, authorities, relays, tgen_servers, p
config["network"]["graph"]["file"]["path"] = str(args.atlas_path)
config["network"]["graph"]["file"]["compression"] = "xz"

# Optional per-edge bandwidth limiting flags (purely opt-in)
if getattr(args, "use_edge_bandwidth_limiting", False):
logging.info("Enabling edge bandwidth limiting in Shadow config")
config.setdefault("experimental", {})
config["experimental"]["edge_bandwidth_limiting_enabled"] = True
config["experimental"]["edge_bandwidth_algorithm"] = "token-bucket"
config["experimental"]["edge_bandwidth_burst_ratio"] = 1.5

used_addresses = set()

for (fp, authority) in sorted(authorities.items(), key=lambda kv: kv[1]['nickname']):
Expand Down
6 changes: 6 additions & 0 deletions tornettools/tornettools
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,12 @@ def main():
action="store", dest="geoip_path",
default=None)

# Optional per-edge bandwidth limiting in generated configs
generate_parser.add_argument('--use-edge-bandwidth-limiting',
help="Enable per-edge bandwidth limiting. Adds flags to Shadow config.",
action="store_true", dest="use_edge_bandwidth_limiting",
default=False)

############
# simulate #
############
Expand Down