tikz-pgf – Positioning a Node Next to Another Using TikZ

tikz-pgf

I want to write a code to get a network package structure.

        1          var         4
-------------------------------------
|   Control   |    Casa   |   Mia   |

Currently I have the code below, but I have noticed that I get two lines in stead of 1 between the cell Control and Casa. Any help?

\documentclass{article}

\usepackage[latin9]{inputenc}
%\usepackage[utf8x]{inputenc}
%\usepackage[spanish]{babel}
%\usepackage[spanish]{translator}
\usepackage[OT1]{fontenc}

%TikZ stuff
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{pgf}
\usetikzlibrary{shapes,arrows,automata,plotmarks,positioning} 


\begin{document}


\begin{tikzpicture}%[scale=1.5]
    \tikzstyle{every path}=[draw, font=\small]

    \node[right,draw, minimum width=2cm,minimum height=0.8cm,fill=white](b0) {Control};
    \node[right=0cm of b0, draw, minimum width=2cm,minimum height=0.8cm,fill=white](b0) {Casa};
\end{tikzpicture}

\end{document}

Edit 1:

Now I have this, but figure is not center, and don't now how to make a line from the corners of control to get to the total of the other rowenter image description here

\begin{figure}    
\newcommand{\size}{\linewidth}

\begin{tikzpicture}%[scale=1]
    \tikzstyle{every path}=[draw, font=\small]

    \node[right,draw, minimum width=0.15*\size,minimum height=0.8cm,fill=white](b0) {Control};
    \node[above=-0.2 of b0, minimum width=0.15*\size,minimum height=0.8cm] {1};
    \node[above left=-0.2 and -0.5 of b0, minimum width=0.2*\size,minimum height=0.8cm] {byte};

    \node[right=0cm of b0, draw, minimum width=0.2*\size,minimum height=0.8cm,fill=white](b1) {Longitud};
    \node[above=-0.2 of b1, minimum width=0.2*\size,minimum height=0.8cm] {1};      

    \node[right=0cm of b1, draw, minimum width=0.6*\size,minimum height=0.8cm,fill=white](b2) {Valor};
    \node[above=-0.2 of b2, minimum width=0.6*\size,minimum height=0.8cm] {8};      


    \node[below left=1 and -2 of b0 ,draw, minimum width=0.2*\size,minimum height=0.8cm,fill=white](h0) {Bloqueo};
    \node[below=-0.2 of h0, minimum width=0.15*\size,minimum height=0.8cm] {1};
    \node[below left=-0.2 and -0.5 of h0, minimum width=0.15*\size,minimum height=0.8cm] {bit};

    \node[right=0cm of h0, draw, minimum width=0.3*\size,minimum height=0.8cm,fill=white](h1) {M\'{a}ximo n$^o$ intentos};
    \node[below=-0.2 of h1, minimum width=0.2*\size,minimum height=0.8cm] {3};      

    \node[right=0cm of h1, draw, minimum width=0.2*\size,minimum height=0.8cm,fill=white](h2) {RSV};
    \node[below=-0.2 of h2, minimum width=0.2*\size,minimum height=0.8cm] {1};      

    \node[right=0cm of h2, draw, minimum width=0.4*\size,minimum height=0.8cm,fill=white](h3) {Intentos restantes};
    \node[below=-0.2 of h3, minimum width=0.4*\size,minimum height=0.8cm] {3};



\end{tikzpicture}
\caption{Mi figura}
\end{figure}

Best Answer

As was suggested, I think matrix is a good option to draw byte and bit fields. Next code show how to use two matrices with two rows each one and how to join their corners to represent that the second one is a detailed field.

\documentclass[tikz,border=2mm]{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{lmodern}
\usepackage{textcomp}
\usetikzlibrary{matrix,positioning}

\begin{document}

%\begin{figure}    
\newcommand{\size}{\linewidth}

\begin{tikzpicture}[
    every path/.style={draw, font=\small},
     labelfield/.style={outer sep=0pt, minimum height=5mm,font=\small, anchor=center},
    field/.style={outer sep=0pt, draw, minimum height=8mm,
    minimum width=#1\size,font=\small,anchor=center}]

    \matrix (A) [matrix of nodes, column sep=-\pgflinewidth,
    row 1/.style={nodes=labelfield}, row 2/.style={nodes={field=.15}}] {
    byte & 1 & 1 & 8 \\
     &  Control & |[field=.2]|Longitud &  |[field=.6]| Valor\\
    };

    \matrix (B) [matrix of nodes, column sep=-\pgflinewidth, 
            below=5mm of A,
            row 2/.style={nodes=labelfield}, 
            row 1/.style={nodes={field=.15}}] {
     &  |[field=.2]| Bloqueo & |[field=.3]|Màximo n\textdegree{}  intentos &  |[field=.2]| RSV & |[field=.2]| Intentos restantes\\
    bit & 1 & 3 & 1 & 3\\
    };

    \draw (A-2-2.south west) -- (B-1-2.north west);
    \draw (A-2-2.south east) -- (B-1-5.north east);

\end{tikzpicture}
\end{document}

enter image description here