split out socket functions, started raw socket frame header