Flows
Sources, sinks, traffic generation, routing, and dependencies.
Flows are specified in TOML and expanded into source/sink actors attached to host switches.
Core types:
FlowandFlowType(src/flows/flow.rs)TrafficCharacteristics(src/flows/mod.rs)PacketSource/PacketSinkenums (src/flows/source.rs,src/flows/sink.rs)
Flow types
FlowType determines which source/sink implementation is instantiated:
PacketDistribution: distribution-driven packet source + basic sinkTCP: TCP source + TCP sink (ACK-based, congestion control)DCQCN: DCQCN source + DCQCN sink (featuredcqcn)
Traffic model
Every flow has TrafficCharacteristics:
- start delay:
initial_delay - termination: either
size(bytes) orduration(seconds) - packet arrival distribution:
arr_dist - packet size distribution:
pkt_size_dist
Optional per-flow protocol config:
- TCP:
tcp.cc_algorithm(Reno/CUBIC/BBR) andtcp.ecn(send ECN-capable packets) - DCQCN:
dcqcn.*parameters (rate bounds, alpha gain, pacing, CNP settings)
Routing
Paths are computed in Flow::compute_path(...):
ShortestPath: usespetgraphA* to find a shortest pathECMP: finds all equal-cost paths and selects one deterministically per flowPathFromConfig: uses an explicitpath = [...]from TOML
Computed paths include endpoints:
[source_endpoint_id] + [switch nodes...] + [sink_endpoint_id]The topology builder then installs forwarding table entries (fib and r_fib) into each switch for each flow ID.
Dependencies
Flows can declare ordering constraints:
starts_after = [flow_id, ...]starts_before = [flow_id, ...]
These are wired by sending FlowFinishMsg when a flow completes (either from the sink for distribution flows, or from the source for TCP/DCQCN flows).
Collectives
Collectives (src/flows/collective.rs) generate sets of flows from higher-level patterns:
Broadcast,Gather,AllReduce, andRingAllReduce
They are expanded into concrete flows inside Topology::process_collectives (src/topos/topo.rs) before routing happens.