Implements the stats service to count discarded and total datagrams processed.