Information

Author(s) Olivier Bonaventure
Deadline No deadline
Submission limit 3 submissions

Sign in

[TRTP] Identify Packet Types

The packet header of our simple protocol has the following format:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|t y|T|   Win   |       Length (16 bits)        |    Seqnum     |
|p e|R|   dow   |                               |               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          Timestamp                            |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                            CRC1                               |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Payload (max 512 bytes)                    |
|                                                               |
|                             ...                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        CRC2 (optional)                        |
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

In this exercise, we focus on the first byte of this header.


Identify the packets of type PTYPE_DATA
The two high order bits of the first byte indicate the packet type. Four packet types are defined in this protocol:
  • PTYPE_FEC (value 0, i.e. 00 in binary) corresponds to FEC packets
  • PTYPE_DATA (value 1, i.e. 01 in binary) corresponds to data packets
  • PTYPE_ACK (value 2, i.e. 10 in binary) corresponds to acknowledgements
  • PTYPE_NACK (value 3, i.e. 11 in binary) corresponds to negative acknowledgements

In the hexademical representations below, select the ones that correspond to a data packet.