Information

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

Tags

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|  Window   |     Length (13 bits)    |       Seqnum        |
|p e| (6 bits)  |                         |      (11 bits)      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          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 of the header indicate the packet type. Four packet types are defined in this protocol:
  • PTYPE_DATA (value 1, i.e. 01 in binary) corresponds to data packets
  • PTYPE_ACK (value 2, i.e. 10 in binary) corresponds to positive acknowledgements
  • PTYPE_SACK (value 3, i.e. 11 in binary) corresponds to selective, positive acknowledgments

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