From: Antony Stone <Antony@Soft-Solutions.co.uk>
To: netfilter@lists.netfilter.org
Subject: Re: ethernet headers and iptables counters
Date: Mon, 10 Nov 2003 23:21:49 +0000 [thread overview]
Message-ID: <200311102321.hAANLsj17218@agate.rockstone.co.uk> (raw)
In-Reply-To: <200311100940.hAA9eij16696@agate.rockstone.co.uk>
On Monday 10 November 2003 10:25 pm, Marc Lucke wrote:
> Antony - my thanks to you. I rather suspected your answer would be
> true. My problem is that I am getting very large differences in the
> usage I track using iptables and the usage that my ISP reports.
> iptables reports much more traffic - up to 12% in fact. I have checked
> with the ISP who say they too only count layer 3 IP.
12% is a lot, and the fact that you think you have 12% more traffic than your
ISP does is more strange than if it were the other way around.
It does occur to me to wonder whether the ISP counts IP headers, but I really
would expect them to do so, and even so, an IP header is only 24 bytes, with
up to 1452 bytes of data inside the packet (assuming an MTU of 1500). For
24 bytes to make 12% difference your data would be only 200 bytes on average,
and this is far too low to be plausible.
> Just to be sure in terms of working out why I have such a large
> discrepancy with my ISP, is there a way that the MASQ rule could be
> having some sort of unwanted effect when examining the counters in the
> FORWARD rule? My thought is not.
I agree with you. The FORWARD chain counts bytes being forwarded (routed)
through the netfilter box. The nat tables in PREROUTING and/or POSTROUTING
are quite separate and willshow very different byte counts (in fact these two
will be wildly inaccurate and much lower than your true usage, because they
do not show automagically de-NATted reply packets).
So, you have higher traffic counts in your netfilter rules than the ISP says
is going across your external link.
What do your interface packet/byte counters say if you look at the output of
ifconfig? Do these agree with your netfilter measurements, with the ISPs
numbers, or are they different again!?
The only other thing I can suggest is that you try putting in a very simple
rule at the top of each of the INPUT, FORWARD and OUTPUT chains to count the
traffic independently of your rules, and see if these counts agree with any
other measurement being made:
iptables -I INPUT -i eth0
iptables -I FORWARD -i eth0
iptables -I FORWARD -o eth0
iptables -I OUTPUT -o eth0
(Yes, that's right, those rules are *very* simple - they don't even have a -j
target at the end of them. They're perfectly valid, and will do absolutely
nothing to your packets except count them for when you come to look at
"iptables -L -n -v -x")
Hope something amongst all this helps.
Antony.
--
The only problem with the Universe as a platform, though, is that it is
currently running someone else's program.
- Ken Karakotsios, author of SimLife
Please reply to the list;
please don't CC me.
next prev parent reply other threads:[~2003-11-10 23:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-10 9:14 ethernet headers and iptables counters Marc Lucke
2003-11-10 9:40 ` Antony Stone
2003-11-10 23:21 ` Antony Stone [this message]
2003-11-10 23:34 ` Simon Kitching
2003-11-10 23:45 ` Antony Stone
2003-11-11 13:37 ` Leonardo Rodrigues Magalhães
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200311102321.hAANLsj17218@agate.rockstone.co.uk \
--to=antony@soft-solutions.co.uk \
--cc=netfilter@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox