-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Packet structure diagrams #948
Comments
I checked the link provided, but I'm not sure which diagram you are referring to replicating. |
@PFigs very good idea! |
Hi! I am not aware of any proper tool. I see a lot of people using word, visio, powerpoint or plain ascii tables for this purpose. Not ideal! |
@sesm @PFigs I was able to finda tool which generates an ASCII diagram for custom packet structures at https://github.com/luismartingarcia/protocol Here's some example usage:
Another example:
|
Wow quite cool 😎 thanks! |
Cool idea. How would you imagine the syntax? |
For hints on syntax, see also the extremely basic tool packetdiag
|
yes, I am missing this diagram type in mermaid as well, for example if I need to document protocol headers in communication protocols, or memory layout of operating systems |
I'd like to pick this up - any objections? |
@harvester-software None at all - If you are still interested lets get this assigned to you! |
Hi, I was testing the #4839 , This is great work! I had a couple questions, that are thinly veiled features requests:
|
Playing around with the package diagram on mermaid.live, this is really useful, I've used the block diagram in to fill this need in the past. Another feature that'd be useful to see is reversing the order of the bits. I'm using it to describe the meaning of bits being packed into an int64, but it's easier to reason about it in little-endian. Perhaps listing the bits in reverse order could make it display the other way. |
#5978 is related to this discussion. |
A lot of messages have payloads of variable length, usually indicated by a field in the header or a terminating symbol. It would be great if the syntax and diagram supported that, resorting to showing names instead of number for positions in that case. Maybe, something like this?
If this is allowed, I don't know how to decide how "wide" to go before dropping down to the next row? Maybe it doesn't? Such a diagram just grows horizontally forever, unless there is an explicit indication of where to "break"? Maybe throw a |
How about add configuration for endianness? Big-endian is old but still exists. |
I'd like to be able to reverse the bit-order, ie writing from highest number to lowest. This is a imo more intuitive when describing bit-fields since many of us write numbers with the highest value-digit at the left.
|
Perhaps a bit late and perhaps i should open a new issue for this? I'm afraid the packet inclusion in mermaid 11, while nice, is a bit too limited. I was looking for ways to describe bits in a byte or just x number of bits. I'm looking for a diagram like one of the following:
It's nice and visually appealing! But it lacks a bit of verbosity. A more verbose style (from here): Or this one, perhaps even better. It's from here and generated by the code there in latex. Lastly, apparently the Latex bytefield package allows the creation of diagrams like this too (from here): Any of these diagrams would be very sweet to have and in general would help writing very technical documents in markdown. As mermaid is often included in markdown 😄 |
Is your feature request related to a problem? Please describe.
No, this is an idea for a new diagram type.
Describe the solution you'd like
Ideally the diagram definition would consist of a box identifier where the text and bit numbering would visible, eg:
PacketDiagram
M[0:32]: Address
Additional context
https://www.thegeekstuff.com/2012/03/ip-protocol-header/
The text was updated successfully, but these errors were encountered: