Overview of TD architecture

(click for larger image)

 

The diagram above illustrates the software architecture of Traffic Dictator.

TD Core handles communication with the network using BGP – which includes collecting topology information via BGP-LS and BGP-LU, and installing SR-TE policies via BGP-SRTE or BGP-LU; it also exposes HTTP API which is useful for network automation. CLI is provided as a separate module which interacts with the API and formats the received outputs in a human-readable format.

Policy Engine calculates SR-TE policies whenever a policy is configured or if there is a change in network topology. It also reserves bandwidth when required and communicates those changes back to TD core. Communication between TD core and PE happens via Kafka. It is also possible to collect telemetry by streaming Kafka messages to InfluxDB, although there is a plan to add GNMI for telemetry in the future versions.

As of the current version, Traffic Dictator core is written in Python and Policy Engine is written in Rust. Such a choice was made to balance development speed and software performance. Note that BGP is not expected to handle the full internet table, but just BGP-LS table which rarely exceeds a few tens of thousands routes, so Python performance is sufficient for that. The performance-critical part is Policy Engine, where fast and stable Rust code can handle recalculation of thousands of policies in a few hundred miliseconds.

Long term vision is to further split the TD core into more modules and rewrite more code in Rust.