The Global Statistics (comId 31 TRDP_GLOBAL_STATS_REPLY_COMID from D.3.2) does not contain accurate data about ProtocolError, CRCError and TopoCountError.
In trdp_mdRecvPacket() in trdp_mdcom.c ,trdp_mdCheck() is called to check sanity of packet and depending on its results the respective errors (if any) like numCrcErr, numProtErr, numTopoErr are logged in stats.
But in trdp_mdRecvPacket(), before this check trdp_mdRecvUDPPacket() is called which is actually responsible for receiving the UDP packet. This function also has a check for MD header and calls trdp_mdCheck() and if there any error is found, the packet is thrown away!
Hence, there are no errors logged in stats as effectively packets with errors are thrown away before that can be done.
Proposal: Stats logging must be done before throwing the packet inside trdp_mdRecvUDPPacket() itself.
This all should be applicable to MD-TCP also.
Attached diff for the fix for MD UDP and TCP statistics.
Fixed by not exiting immediately in trdp_mdRecvPacket(), but proceeding to error counters.