@Override
        protected void parseFrame() throws MessageValidationAssertionException {
            // Initial parsing of IP message.
            // BACnet/IP
            if (queue.pop() != (byte) 0x81)
                throw new MessageValidationAssertionException("Protocol id is not BACnet/IP (0x81)");

            final byte function = queue.pop();
            if (function != 0xa && function != 0xb && 
            	function != 0x4 && function != 0x0)
                throw new MessageValidationAssertionException("Function is not "
                		+ "unicast, broadcast, forward or foreign device reg "
                		+ "anwser (0xa, 0xb, 0x4 or 0x0)");
            final int length = BACnetUtils.popShort(queue);
            if (length != queue.size() + 4)
                throw new MessageValidationAssertionException("Length field does"
                		+ " not match data: given=" + length + ", expected=" 
                		+ (queue.size() + 4));
            // Answer to foreign device registration
            if (function == 0x0) {
                final int result = BACnetUtils.popShort(queue);
                if (result != 0)
                    LOG.info("Foreign device registration not successful! result: " + result);
                // not APDU received, bail
                return;
            }
            if (function == 0x4) {
                // A forward. Use the address/port as the link service address.
                byte[] addr = new byte[6];
                queue.pop(addr);
                linkService = new OctetString(addr);
            }
        }