Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm writing a small manual for our self-developed protocol.

To show the packet structure we like to include a table like it's shown on this Wikipedia page: http://en.wikipedia.org/wiki/User_Datagram_Protocol#Packet_structure

Is there any prebuilt library for this purpose or should it be implemented by myself?

share|improve this question
2  
You might have a look to the bytefield package. –  Claudio Fiandrino Jan 26 '13 at 9:33
add comment

1 Answer 1

You can use the bytefield package, developed exactly with the purpose of drawing protocol packet structures.

An example taken from the manual:

\documentclass[border=10pt,png]{standalone}
\usepackage{bytefield}


\begin{document}

\begin{bytefield}[bitwidth=1.1em]{32}
\bitheader{0-31} \\
\begin{rightwordgroup}{RTP \\ Header}
\bitbox{2}{V=2} & \bitbox{1}{P} & \bitbox{1}{X}
& \bitbox{4}{CC} & \bitbox{1}{M} & \bitbox{7}{PT}
& \bitbox{16}{sequence number} \\
\bitbox{32}{timestamp}
\end{rightwordgroup} \\
\bitbox{32}{synchronization source (SSRC) identifier} \\
\wordbox[tlr]{1}{contributing source (CSRC) identifiers} \\
\wordbox[blr]{1}{$\cdots$} \\
\begin{rightwordgroup}{RTP \\ Payload}
\wordbox[tlr]{3}{MPEG-4 Visual stream (byte aligned)} \\
\bitbox[blr]{16}{}
& \bitbox{16}{\dots\emph{optional} RTP padding}
\end{rightwordgroup}
\end{bytefield}

\end{document}

The result:

enter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.