Informações

Autores Olivier Bonaventure
Prazo de entrega Sem prazo
Limite de submissão 3 submissões

Entrar

[TRTP] PTYPE_FEC packets

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 length field of PTYPE_FEC packets.


Understanding the how the XOR works in FEC packets
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 hexadecimal representations below, select the one that contains a valid length field for a PTYPE_FEC packet given the 4 PTYPE_DATA packets used to generate it.