Mermaid Sequence Diagram with Ipv6 host as participant

#diagram #host #ipv6 #mermaid #sequence

 

Today I was messing around making a mermaid sequence diagram of an ICMPv6 ping and found that its a bit tricky to get participants with : in the name.

For example, something like this:

Host->>Router: ICMP Echo, HopLimit=64
Router->>ISPa: ICMP Echo, HopLimit=63
ISPa->> ISPb: ICMP Echo, HopLimit=62
ISPb->> 2001:4860:4860::8888: ICMP Echo, HopLimit=61  
2001:4860:4860::8888->> ISPb: ICMP Echo-Reply, HopLimit=64
ISPb->>ISPa: ICMP Echo-Reply, HopLimit=63
ISPa->>Router: ICMP Echo-Reply, HopLimit=62
Router->>Host: ICMP Echo-Reply, HopLimit=61

I first came across this post: https://stackoverflow.com/questions/28121525/mermaid-cli-how-do-you-escape-characters, however, when I tried:

Host->>Router: ICMP Echo, HopLimit=64
Router->>ISPa: ICMP Echo, HopLimit=63
ISPa->> ISPb: ICMP Echo, HopLimit=62
ISPb->> 2001#58;4860#58;4860#58;#58;8888: ICMP Echo, HopLimit=61  
2001#58;4860#58;4860#58;#58;8888->> ISPb: ICMP Echo-Reply, HopLimit=64
ISPb->>ISPa: ICMP Echo-Reply, HopLimit=63
ISPa->>Router: ICMP Echo-Reply, HopLimit=62
Router->>Host: ICMP Echo-Reply, HopLimit=61

However, I found this post: https://github.com/mermaid-js/mermaid/issues/679, where if you do something like this it works:

participant Host
participant Router
participant ISPa
participant ISPb
participant endHost as  2001#58;4860#58;4860#58;#58;8888
Host->>Router: ICMP Echo, HopLimit=64
Router->>ISPa: ICMP Echo, HopLimit=63
ISPa->> ISPb: ICMP Echo, HopLimit=62
ISPb->> endHost: ICMP Echo, HopLimit=61  
endHost->> ISPb: ICMP Echo-Reply, HopLimit=64
ISPb->>ISPa: ICMP Echo-Reply, HopLimit=63
ISPa->>Router: ICMP Echo-Reply, HopLimit=62
Router->>Host: ICMP Echo-Reply, HopLimit=61

Which results in something like this: file


Comments (0)


Leave a Comment

Log in to leave a comment.

Most Recent Post

Building a Better GitHub Stats Card

I've had a GitHub profile stats card for a while now, but I was never fully happy with it. The existing tools each had trade-offs that bugged me, so I ended up building my own by combining the best parts of three different projects. Here's how it went. The Problem There are a few popular projects fo...