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.
- Parses RFC Index XML file.
- Visualizes RFC relationships (Updated-by, Obsoleted-by).
- Outputs Graphviz DOT files or PNG diagrams.
- Python 3.10+
- xmltodict
- graphviz (for PNG output)
- Graphviz system binaries (for PNG output)
- Clone repo and
cd RFC_tree_viz - Create a virtual environment
python3 -m venv rfc_tree(optional, just for module separation) - Activate the environment
source rfc_tree/bin/activate(optional) - Install Python dependencies from
pip install -r requirements.txt - Install Graphviz binaries (Linux) Eg.:
apt-get install graphviz - Download latest rfc-index.xml file from IETF
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)
- 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
- 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
- DOT file: RFC0791_rfc_tree.dot
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"];
...
- PNG diagram: RFC0791_rfc_tree.png
- 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.
GPL-3.0
Richard Buknicz
