\mess
command has an optional parameter which represent a delay
(vertical separation) between tranmission and reception. You just need to use it:
\mess[1]{c}{FIN}{s}
An example using it and explanations about inserting comments and some other style changes can be found in Add bars and annotations when using pgf-umlsd
EDIT
Although John Kormylo has been faster than me. I also think that sometimes i'is easier to draw it by hand instead of using pgf-umlsd
.
\documentclass[tikz, border=5mm]{standalone}
\usetikzlibrary{arrows,shadows,positioning}
\begin{document}
\begin{tikzpicture}[font=\sffamily,>=stealth',thick,
commentl/.style={text width=3cm, align=right},
commentr/.style={commentl, align=left},]
\node[] (init) {\LARGE Initiator};
\node[right=1cm of init] (recv) {\LARGE Receiver};
\draw[->] ([yshift=-1.7cm]init.south) coordinate (fin1o) -- ([yshift=-.7cm]fin1o-|recv) coordinate (fin1e) node[pos=.3, above, sloped] {FIN};
\draw[->] ([yshift=-.3cm]fin1e) coordinate (ack1o) -- ([yshift=-.7cm]ack1o-|init) coordinate (ack1e) node[pos=.3, above, sloped] {ACK};
\draw[->] (ack1e-|recv) coordinate (fin2o) -- ([yshift=-.7cm]fin2o-|init) coordinate (fin2e) node[pos=.3, above, sloped] {FIN};
\draw[->] ([yshift=-.3cm]fin2e) coordinate (ack2o) -- ([yshift=-.7cm]ack2o-|recv) coordinate (ack2e) node[pos=.3, above, sloped] {ACK};
\draw[thick, shorten >=-1cm] (init) -- (init|-ack2e);
\draw[thick, shorten >=-1cm] (recv) -- (recv|-ack2e);
\draw[dotted] (recv.285)--([yshift=2mm]recv.285|-fin1e) coordinate[pos=.5] (aux1);
\draw[dotted] (init.255)--([yshift=2mm]init.255|-fin1o);
\draw[dotted] ([yshift=1mm]init.255|-fin2e) --([yshift=-5mm]init.255|-ack2e) coordinate (aux2);
\node[commentr, right =2mm of ack2e] {\textbf{CLOSED}};
\node[commentr, right =2mm of fin2o] {\textbf{LAST ACK}};
\node[below left = 0mm and 2mm of init.south, commentl]{\textbf{ESTABLISHED}\\[-1.5mm]{\itshape connection}};
\node[left = 2mm of fin1o.west, commentl]{{\itshape active close}\\[-1mm]\textbf{FIN\_WAIT\_1}};
\node[left = 2mm of ack1e.west, commentl]{\textbf{FIN\_WAIT\_2}};
\node[below left = -1mm and 2mm of fin2e.west, commentl]{\textbf{TIME\_WAIT}};
\node[below left = -1mm and 2mm of aux2-|init, commentl]{\textbf{CLOSED}};
\node[right = 2mm of recv|-aux1, commentr]{\textbf{ESTABLISHED}\\[-1.5mm]{\itshape connection}};
\node[right = 2mm of fin1e.west, commentr]{\textbf{CLOSE\_WAIT}\\[-1mm]{\itshape passive close}};
\end{tikzpicture}
\end{document}
![enter image description here](https://i.stack.imgur.com/FOTQq.png)
You could try a canvas transformation but you'd have to recalculate all the coordinates which would probably be a nightmare.
Or...
You can slant arrow heads with the arrows.meta
library in PGF 3.0. However, skewing the non-arrow head end needs be faked using another arrow tip. This won't work if the slanting is much greater that +/-0.5
(there will be a small gap) but this can be customized (see the manual for details).
\documentclass[tikz,border=0.125cm]{standalone}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[line width=4pt]
\draw [red!50!black, -Stealth] (0,0) -- (3,0);
\draw [green!50!black, -{Stealth[slant=-0.5]}] (0,1) -- (3,1);
\draw [blue!50!black, {Square[slant=-0.5,length=\the\pgflinewidth]}-{Stealth[slant=-0.5]}] (0,2) -- (3,2);
\end{tikzpicture}
\end{document}
![enter image description here](https://i.stack.imgur.com/OkseN.png)
Best Answer
Here now everything summed up as answer not as comment. Saw you got it with the relative coordinates.
For changing the arrowhead, you have to use
in your preamble. See the following code example for the most arrow types
For setting labels on paths you can use the following code:
For your code you have to look where you want to place your label and possibly adjust your path definition. Example code to fit your problem:
Hope this answers your questions.