def from_bytes(self, raw):
        '''Return an Ethernet object reconstructed from raw bytes, or an
           Exception if we can't resurrect the packet.'''
        if len(raw) < TCP._MINLEN:
            raise NotEnoughDataError("Not enough bytes ({}) to reconstruct an TCP object".format(len(raw)))
        fields = struct.unpack(TCP._PACKFMT, raw[:TCP._MINLEN])
        self._src = fields[0]
        self._dst = fields[1]
        self._seq = fields[2]        
        self._ack = fields[3]
        offset = fields[4] >> 12
        self._flags = fields[4] & 0x01ff
        self._window = fields[5]
        csum = fields[6]
        self._urg = fields[7]
        headerlen = offset * 4
        optlen = headerlen - TCP._MINLEN
        self._options.from_bytes(raw[TCP._MINLEN:headerlen])
        return raw[headerlen:]