IPv6 network packet: GraphViz block diagram (.dot) source

KS implementation details

License: CC0-1.0
Minimal Kaitai Struct required: 0.8

This page hosts a formal specification of IPv6 network packet using Kaitai Struct. This specification can be automatically translated into a variety of programming languages to get a parsing library.

GraphViz block diagram source

ipv6_packet.dot

digraph {
	rankdir=LR;
	node [shape=plaintext];
	subgraph cluster__ipv6_packet {
		label="Ipv6Packet";
		graph[style=dotted];

		ipv6_packet__seq [label=<<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0">
			<TR><TD BGCOLOR="#E0FFE0">pos</TD><TD BGCOLOR="#E0FFE0">size</TD><TD BGCOLOR="#E0FFE0">type</TD><TD BGCOLOR="#E0FFE0">id</TD></TR>
			<TR><TD PORT="version_pos">0</TD><TD PORT="version_size">4b</TD><TD>b4</TD><TD PORT="version_type">version</TD></TR>
			<TR><TD PORT="traffic_class_pos">0:4</TD><TD PORT="traffic_class_size">1</TD><TD>b8</TD><TD PORT="traffic_class_type">traffic_class</TD></TR>
			<TR><TD PORT="flow_label_pos">1:4</TD><TD PORT="flow_label_size">20b</TD><TD>b20</TD><TD PORT="flow_label_type">flow_label</TD></TR>
			<TR><TD PORT="payload_length_pos">4</TD><TD PORT="payload_length_size">2</TD><TD>u2be</TD><TD PORT="payload_length_type">payload_length</TD></TR>
			<TR><TD PORT="next_header_type_pos">6</TD><TD PORT="next_header_type_size">1</TD><TD>u1</TD><TD PORT="next_header_type_type">next_header_type</TD></TR>
			<TR><TD PORT="hop_limit_pos">7</TD><TD PORT="hop_limit_size">1</TD><TD>u1</TD><TD PORT="hop_limit_type">hop_limit</TD></TR>
			<TR><TD PORT="src_ipv6_addr_pos">8</TD><TD PORT="src_ipv6_addr_size">16</TD><TD></TD><TD PORT="src_ipv6_addr_type">src_ipv6_addr</TD></TR>
			<TR><TD PORT="dst_ipv6_addr_pos">24</TD><TD PORT="dst_ipv6_addr_size">16</TD><TD></TD><TD PORT="dst_ipv6_addr_type">dst_ipv6_addr</TD></TR>
			<TR><TD PORT="next_header_pos">40</TD><TD PORT="next_header_size">...</TD><TD>ProtocolBody</TD><TD PORT="next_header_type">next_header</TD></TR>
			<TR><TD PORT="rest_pos">...</TD><TD PORT="rest_size"></TD><TD></TD><TD PORT="rest_type">rest</TD></TR>
		</TABLE>>];
	}
	ipv6_packet__seq:next_header_type -> protocol_body__seq [style=bold];
}