Skip to content

routingalchemy/RFC_tree_viz

Repository files navigation

RFC Tree

The rfc_tree.py script is a data visualiser for relationships between RFCs (Request for Comments) using data from the RFC Index XML file. It can generate a Graphviz DOT file or a PNG diagram showing how RFCs update or obsolete each other.

Features

  • Parses RFC Index XML file.
  • Visualizes RFC relationships (Updated-by, Obsoleted-by).
  • Outputs Graphviz DOT files or PNG diagrams.

Requirements

  • Python 3.10+
  • xmltodict
  • graphviz (for PNG output)
  • Graphviz system binaries (for PNG output)
  1. Clone repo and cd RFC_tree_viz
  2. Create a virtual environment python3 -m venv rfc_tree (optional, just for module separation)
  3. Activate the environment source rfc_tree/bin/activate (optional)
  4. Install Python dependencies from pip install -r requirements.txt
  5. Install Graphviz binaries (Linux) Eg.: apt-get install graphviz
  6. Download latest rfc-index.xml file from IETF

Usage

python3 rfc_tree.py -s RFCXXXX [-i rfc-index.xml] [-o dot|png]

-s, --search: RFC to search (e.g., RFC0791)
-i, --input_file: Path to RFC Index XML file (default: rfc-index.xml)
-o, --output_type: Output type: dot (Graphviz DOT file) or png (diagram image, default: dot)

Example

  • Generate a DOT file for RFC0791: python3 rfc_tree.py -s RFC0791 -o dot
  • Generate a PNG diagram for RFC0791: python3 rfc_tree.py -s RFC0791 -o png

Output (for examlple RFC091)

  • There is a general output of the script about the RFCs visited:
RFC: RFC0791, Updated-by: ['RFC1349', 'RFC2474', 'RFC6864']
RFC: RFC1349, Obsoleted-by: RFC2474
RFC: RFC2474, Updated-by: ['RFC3168', 'RFC3260', 'RFC8436']
RFC: RFC3168, Updated-by: ['RFC4301', 'RFC6040', 'RFC8311']
RFC: RFC4301, Updated-by: ['RFC6040', 'RFC7619']
RFC: RFC6040, Updated-by: RFC9601
RFC: RFC9601
RFC: RFC7619
RFC: RFC8311
RFC: RFC3260
RFC: RFC8436
RFC: RFC6864
digraph RFC_tree {
rankdir=BT;
"RFC0791" [label="RFC0791\nInternet Protocol", style=filled, fillcolor=white];
"RFC1349" [label="RFC1349\nType of Service in the Internet Protocol Suite", style=filled, fillcolor=white];
"RFC0791" -> "RFC1349" [color=blue, label="Updated-by"];
"RFC2474" [label="RFC2474\nDefinition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers", style=filled, fillcolor=white];
"RFC1349" -> "RFC2474" [color=red, style=dashed, label="Obsoleted-by"];
"RFC3168" [label="RFC3168\nThe Addition of Explicit Congestion Notification (ECN) to IP", style=filled, fillcolor=white];
"RFC2474" -> "RFC3168" [color=blue, label="Updated-by"];
"RFC4301" [label="RFC4301\nSecurity Architecture for the Internet Protocol", style=filled, fillcolor=white];
"RFC3168" -> "RFC4301" [color=blue, label="Updated-by"];
...

Notes

  • The RFC Index XML file can be downloaded from IETF.
  • For PNG output, both the Python graphviz package and system Graphviz binaries must be installed.

License

GPL-3.0

Author

Richard Buknicz

About

An RFC updated-by tree visualisation tool

Topics

Resources

License

Stars

Watchers

Forks

Languages