I'm trying to represent the functionning of a device. It has 2 ports, and make computations on the payload of a data packet.
I use pst-node
from the PSTricks
suite to realise it, b I came across some problems...
I'd like to have a data packet made up of 2 parts :
header
andpayload
. But they
inPayload
causes a bad alignment of the two words. Moreover, it messes up the whole dimensions of the\psframebox
. The 2 packets drawn features the 2 problems.I'd like to have the
Payload
box "concatenated" to theHeader
box. I tried using the[tl]
and[tr]
otpions for therput
command, but it's messed up when it comes to binding boxes... Moreover, as the[cr]
and[cl]
doesn't exist, the data packet boxes aren't vertically aligned with the other (Process
andPort 1
)
My MWE hereunder summarizes all the problems I have :
\documentclass[pstricks, float]{standalone}
\usepackage{graphicx}
\usepackage[table, usenames, dvipsnames]{xcolor}
\usepackage{pstricks, pst-node, pst-circ, pst-plot, pst-3dplot, pst-solides3d, pst-sigsys, pstricks-add, pst-eucl}
\usepackage[frenchb]{babel}
\usepackage[locale=FR, per-mode=symbol, abbreviations]{siunitx}
\begin{document}
\bgroup
%\scalebox{0.8}{
\begin{pspicture}[labelangle=:U, showgrid=false](-5, 1)(13, 6)
\rput[c](-4,4.5){\rnode{priv}{Port 1}}
\rput[cl](12,2.5){\rnode{publ}{Port 1}}
\rput[c](5.5,4.5){\rnode{ipsec}{\psframebox[framesep=10pt,cornersize=absolute,linearc=0.2, linecolor=red]{\textcolor{red}{Process}}}}
\rput[tl](2,4.5){\rnode{header1}{\psframebox[framesep=4pt]{Header}}}
\rput[tr](2,4.5){\rnode{payload1}{\psframebox[framesep=4pt]{Payload 1}}}
\psframe[framearc=.3,linestyle=dashed, linecolor=black!40](-1.5, 1.5)(9.5,5.75)
\rput[c](5.6,2.5){\rnode{header2}{\psframebox[framesep=4pt]{Header}}}
\rput[c](7.25, 2.5){\rnode{payload2}{\psframebox[framesep=4pt]{Paload 2}}}
\ncline{<->}{payload1}{ipsec}
\ncangle[angleA=-90, angleB=180, armB=0, linearc=.5]{<->}{header1}{header2}
\ncangle[angleB=90, armB=0, linearc=.5]{<->}{ipsec}{payload2}
\ncline{<->}{payload2}{publ}
\ncline{<->}{header1}{priv}
\end{pspicture}
%}
\egroup
\end{document}
Any ideas on how to right this ?