I often find myself in the situation of wanting to write a breakdown of the protocol that some program (either my own or some other by reading its code or RCE) uses for its network communication, but there is just no standard on how to document the structure of packets in those.
What I usually do is to write the protocol documentation with Markdown and specify packet structures like this:
[uint32 size] [uint32 command] [var parameters]
However, I am looking for a convenient and standardized way of solving this.