[En-Nut-Discussion] Counting bytes sent and received on Interfaces (GPRS/CDMA cost watching)

Brett Abbott Brett.Abbott at digital-telemetry.com
Thu May 20 22:54:54 CEST 2004


Hi

Im planning to implement IP traffic monitoring and high traffic alerts to prevent me exceeding my Vodafone (GPRS) plan quota and also to provide stats for billing discussions.

A few questions if I may.

1. Has anyone done this?  Does anyone else need it?
2. Im more than keen to keep my NutOS libraries in their natural state so would like to make changes that will be included.
3. Has it already been added to NutOS (Im a rev behind the latest release but plan to update shortly)

Currently Im leaning towards 2 pair of counters on each network interface - bytes successfully sent and bytes received successfully.  Also Packets sent and received.  A function call to ioctl or equivalent will provide counter values and reset the counters.  This ought to support UDP and TCP.

As well as bytes, I need to count packets sent and received.  Vodafone charge for their wireless IP packet management wrappers as well! (although you wont see that in the printed pricing guide....)

For PPP over mobile, only the IP packets get charged for (the modem strips out the PPP overhead).  So this adds an interesting decision on what and where to count the data.  Im leaning towards incrementing counters in ipout.c and ipin.c and using "unsigned long" as counter size.  (Should they be bigger?)

If anyone sees value in this, I'll implement a generic solution and document it for Harald or Oliver.   Please let me have your feedback/advice.

Thanks
Brett
-----------------------------------------------------------------
Brett Abbott, Managing Director, Digital Telemetry Limited
Email: Brett.Abbott at digital-telemetry.com
PO Box 24 036 Manners Street, Wellington, New Zealand
Phone +64 (4) 5666-860  Mobile +64 (21) 656-144
------------------- Commercial in confidence --------------------





More information about the En-Nut-Discussion mailing list