P2P: parse network datastream into header/data components

Prevents peer from sending garbage attack.