Design and Analysis of Beamforming in mmWave Networks