µC/TCP-IP maintains counters and statistics for a variety of expected or unexpected error conditions. Some of these statistics are optional since they require additional code and memory and are enabled only if NET_CTR_CFG_STAT_EN
or NET_CTR_CFG_ERR_EN
is enabled (see Network Counters Configuration)when enabled, see Network Counters Configuration for further information about how to enable and disabled it.
Statistics
µC/TCP-IP maintains run-time statistics on interfaces and most µC/TCP-IP object pools. If desired, an application can thus query µC/TCP-IP to find out how many frames have been processed on a particular interface, transmit and receive performance metrics, buffer utilization and more. An application can also reset the statistic pools back to their initialization values (see net_stat.h
).
...
In order to enable run-time statistics, must be enabled, the macro NET_CTR_CFG_STAT_EN
located within net_cfg.h
must be defined to DEF_ENABLED
. see Network Counters Configuration.
Module pool statistics
You can query the following module to get usage statistics.
Module | Description | Function API or Variables |
---|---|---|
ARP | ARP Cache usage | NetARP_CachePoolStatGet() |
IGMP | IPv4 Multicast group statistics | NetIGMP_HostGrpPoolStat |
NDP | NDP Caches usage | NetCache_AddrNDP_PoolStat NetNDP_DestPoolStat NetNDP_PrefixPoolStat NetNDP_RouterPoolStat |
Buffer | Interface's buffer usage | |
IP connections | IP connections pool usage | NetConn_PoolStatGet() |
Socket | Sockets usage | NetSock_PoolStatGet() |
TCP | TCP connections usage | NetTCP_ConnPoolStatGet() |
Timer | Timer usage | NetTmr_PoolStatGet() |
Error Counters
µC/TCP-IP maintains run-time counters for tracking error conditions within the Network Protocol Stack. If desired, the application may view the error counters in order to debug run-time problems such as low memory conditions, slow performance, packet loss, etc.
Network protocol error counters are kept in an instance of a data structure named Net_ErrCtrs
. This variable may be viewed within a debugger or referenced externally by the application for run-time analysis (see net_statctr.h
).
In order to enable run-time error counters, the macro NET_CTR_CFG_ERR_EN
located within net_cfg.h
must be defined to DEF_ENABLED
must be enabled, see Network Counters Configuration.