RTT and PLR(Packet Loss Ratio)

One thing is clear. This is not a project for a complete beginner with Arduino. You started off using terms like RTT so I guess your course has an element of communications in it and is not at a basic level.

Anyway, you asked (PM) about the "serialNumber" in post #5. This is simply a number which starts at 0 the first time it used. It is incremented by one each time it is used. The idea is that the receiver notices if packets are dropped. For example, if the last packet received has a serial number 57 and the next received has a serial number of 60, the receiver 'knows' that 2 packets, that is packets 58 and 59 have been dropped.

A slightly easier way of doing this has occurred to me:
The transmitter part continually sends packets at say every 10 mS. The content is irrelevant.
The receiver part, on receiving a packet, sets a timer say lastPacketReceivedAtMs = millis() ;
The value of the formula: millis() - lastPacketReceivedAtMs is continually checked and if it is greater that the 10 mS transmission interval, that indicates a lost packet. The number of missing packets can be determined by dividing the previous formula by 10.