\documentclass[10pt,journal,compsoc]{IEEEtran}
\usepackage{tikz,pgfplots,pgfplotstable}
\usetikzlibrary{fit,matrix,positioning,decorations.pathreplacing,calc,shapes,arrows,shadows,patterns}
% correct bad hyphenation here
\hyphenation{op-tical net-works semi-conduc-tor}
\newdimen\zerolinewidth
\begin{document}
\tikzstyle{redRectangle} = [
rectangle,
draw,
fill=red!20,
node distance=0.65 cm,
text width=7 em,
text centered,
rounded corners,
minimum height=4 em,
minimum width=3 cm,
thick
]
\tikzstyle{blueRectangle} = [
rectangle,
draw,
fill=blue!20,
node distance=1.5 cm,
text width=7 em,
text centered,
rounded corners,
minimum height=4 em,
minimum width=3 cm,
thick
]
\tikzstyle{yellowRectangle} = [
rectangle,
draw,
fill=yellow!20,
node distance=1.5 cm,
text width=7 em,
text centered,
rounded corners,
minimum height=4 em,
minimum width=3 cm,
thick
]
\tikzstyle{greenRectangle} = [
rectangle,
draw,
fill=green!20,
node distance=1.5 cm,
text width=7 em,
text centered,
rounded corners,
minimum height=4 em,
minimum width=3 cm,
thick
]
\tikzstyle{blueDiamond} = [
diamond,
draw,
fill=blue!20,
node distance=1.5 cm,
text width=7 em,
text badly centered,
inner sep=0pt,
thick
]
\tikzstyle{blueEllipse} = [
ellipse,
draw,
fill=blue!20,
node distance=1.5 cm,
text width=7 em,
thick
]
\tikzstyle{container} = [
rectangle,
draw,
inner sep=0.5 cm,
rounded corners
]
\tikzstyle{empty} = [
]
\tikzstyle{line} = [
draw,
-latex',
thick
]
\begin{tikzpicture}[auto]
\node [empty](origin){};
\node [redRectangle, right=of origin] (aa) {aa};
\node [redRectangle, left=of origin] (bb) {bb};
\node [redRectangle, below=of bb] (cc) {cc};
\node [redRectangle, below=of aa] (dd) {dd};
\path [line] (bb) -- (aa);
\path [line] (bb) -- (cc);
\path [line] (aa) -- (dd);
\node [redRectangle, right=of aa] (pp) {pp};
\node [redRectangle, right=of pp] (rr) {rr};
\node [redRectangle, below right=of pp] (qq) {qq};
\node [container, fit=(aa)(origin)(bb)(cc)(dd)](container1){};
\node [container, fit=(pp)(rr)(qq)](container2){};
\end{tikzpicture}
\end{document}
- Wants to increase distance between container1 and containder2 while keeping them next to each other horizontally.
- Wants to place node qq below and in the middle of pp and rr.
- Wants to place an another container above and in the middle of container1 and containder2.
- Wants to draw an another container around all the containers
Any help will be highly appreciable. I am using the given Reference code

right=2cm of. And the big container can simply be done by\node [container, fit=(container1)(container2)](big container){};. And you may want to replace\tikzstyleby the correspondign\tikzsetsyntax. – Jun 10 '18 at 19:36