trouble formula QoS zigbee with arduino

im working project for monitoring Quality of Service zigbee with 5 module xbee s2c + 5 arduino uno.
i can communicate xbee multihop from end device >> router 3 >> router 2 >> router 1 >> coordinator.
formula for packet loss ratio = (send packet - received packet)/total packet*100%.
what i want to ask is it true if i assume the frame response received (api id=90 zbRx response) the same as packet received and for the total package same as send packet the number of iteration to wait for the response. like code below on coordinator

total_packet++;
if (xbee.getResponse().isAvailable())
   {
         received++;
   
   }
else if (xbee.getResponse().isError()){
{
       //error code 1 count as packet loss loss++
       //error code 3 count as packet received received++
}
else {
     loss++
}
plr=total_packet-received/total_packet*100%;

and for count time packet, should i measure from end dev >> coordinator and back from coordinator to end dev
or just time interval end device to coordinator