Function createHandshakePacket