\tikzstyle{main}=[rectangle, thick, draw =black!80]
\tikzstyle{connect}=[-latex]
\node (G1) [align=center] {gateway\\controller};
\node (S1) [below=of G1, align=center] {signaling\\gateway};
\node (S0) [left=30mm of S1] {};
\node (M1) [below=of S1, align=center] {media\\gateway};
\node (M0) [left=30mm of M1] {};
\node[rectangle, inner sep=4.4mm,draw=black!100, fit= (G1) (S1) (M1), label=above:gateway] {};
\node (G2) [right=40mm of G1, align=center] {gateway\\controller};
\node (S2) [right=40mm of S1, below=of G2, align=center] {signaling\\gateway};
\node (S3) [right=30mm of S2] {};
\node (M2) [right=40mm of M1, below=of S2, align=center] {media\\gateway};
\node (M3) [right=30mm of M2] {};
\node[rectangle, inner sep=4.4mm,draw=black!100, fit= (G2) (S2) (M2), label=above:gateway] {};
\path
(G1) edge [connect] node [label=below:\footnotesize{control}] {} (G2)
(S0) edge [connect] node [label=below:\footnotesize{signaling tones}] {} (S1)
(S1) edge [connect] node [label=below:\footnotesize{signaling packets}] {} (S2)
(S2) edge [connect] node [label=below:\footnotesize{signaling tones}] {} (S3)
(M0) edge [connect] node [label=below:\footnotesize{samples}] {} (M1)
(M1) edge [connect] node [label=below:\footnotesize{packets}] {} (M2)
(M2) edge [connect] node [label=below:\footnotesize{samples}] {} (M3);
\node[rectangle, inner sep=4.4mm, fit= (S0) (M0) (G1) (S1) (M1), label=below:POTS network] {};
\node[rectangle, inner sep=4.4mm, fit= (G1) (S1) (M1) (G2) (S2) (M2), label=below:IP network] {};
\node[rectangle, inner sep=4.4mm, fit= (G2) (S2) (M2) (S3) (M3), label=below:POTS network] {};