Skip to content
MermaidViewer

Education · Packet Diagram

IPv4 Packet Header

Packet diagram of the IPv4 header with version, IHL, TTL, protocol, checksum and addresses.

Mermaid diagram
mermaid
packet
    title IPv4 header
    0-3: "Version"
    4-7: "IHL"
    8-15: "DSCP / ECN"
    16-31: "Total length"
    32-47: "Identification"
    48-50: "Flags"
    51-63: "Fragment offset"
    64-71: "TTL"
    72-79: "Protocol"
    80-95: "Header checksum"
    96-127: "Source address"
    128-159: "Destination address"
Open in the live editor

About this template

The IPv4 header drawn in classic RFC style, 32 bits per row. Useful for networking classes, certification study and protocol documentation.

How to customise it

  • Add options and padding
  • Draw the IPv6 header instead
  • Use it as a base for your own binary format

This template is a Mermaid packet diagram. See the packet diagram page for the full syntax reference and more examples.

Frequently asked questions

How do I use this ipv4 packet header template?

Click "Use this template" to open it in the MermaidViewer editor. Edit the Mermaid code on the left and the diagram updates instantly. No account is needed.

Can I export the template as an image?

Yes. In the editor use Export to download PNG, SVG or PDF, or copy the image to your clipboard. You can also copy the code as a Markdown block for GitHub, GitLab or Notion.

Can AI customise this template for me?

Yes. Open the AI assistant (Ctrl/Cmd+K) and describe the change, for example "Add options and padding". The updated diagram streams into the editor.

More templates