Skip to contentSkip to conversation

issue with the quota match

DISCUSSION Borja Pacheco 4 participants 4 messages Mar 28, 2005 – Apr 3, 2005 netfilter

lore
Share & tools
lore
#0 lore raw

Hi all,

I've tried the quota extension and I have a big question about it, because the module and the kernel counter doesn't agree with the packets number that have traversed the interfaces...

Here it's the example I tried:

In a first moment I insert a rule with an initial quota of 1000 bytes...

    0     0 ACCEPT     all  --  *      *       0.0.0.0/0

0.0.0.0/0 quota: 1000 bytes

Next, I generate packets and here it's the amazing result....

    8   448 ACCEPT     all  --  *      *       0.0.0.0/0

0.0.0.0/0 quota: 712 bytes

Theoretically, 1000 assigned bytes minus total traffic generated (448 bytes), must originate the remaining quota the rule has: 552. BUT IT SAYS 712 BYTES!!!!!

What's wrong????

Thanks in advance for your clarifications.
Best regards.

#1 lore raw
Quoted 10 lines · Borja Pacheco

In a first moment I insert a rule with an initial quota of 1000 bytes...

    0     0 ACCEPT     all  --  *      *       0.0.0.0/0

0.0.0.0/0 quota: 1000 bytes

Next, I generate packets and here it's the amazing result....

    8   448 ACCEPT     all  --  *      *       0.0.0.0/0

0.0.0.0/0 quota: 712 bytes

Theoretically, 1000 assigned bytes minus total traffic generated (448 bytes), must originate the remaining quota the rule has: 552. BUT IT SAYS 712 BYTES!!!!!

quota doesn't count the ip headers (20 bytes). Some maths:

8 packets x 20 bytes = 160 bytes
552 + 160 = 712 bytes

--
Pablo

#2 lore raw
Quoted 10 lines · Pablo Neira
Quoted 8 lines · Borja Pacheco

In a first moment I insert a rule with an initial quota of 1000 bytes...

    0     0 ACCEPT     all  --  *      *       0.0.0.0/0

0.0.0.0/0 quota: 1000 bytes

Next, I generate packets and here it's the amazing result....

    8   448 ACCEPT     all  --  *      *       0.0.0.0/0

0.0.0.0/0 quota: 712 bytes

Quoted 15 lines
Quoted 2 lines

Theoretically, 1000 assigned bytes minus total traffic generated (448 bytes), must originate the remaining quota the rule has: 552. BUT IT SAYS 712 BYTES!!!!!

quota doesn't count the ip headers (20 bytes). Some maths:

8 packets x 20 bytes = 160 bytes
552 + 160 = 712 bytes

Signature · 4 lines
Pablo


!DSPAM:42491732223341143723889!

I had submitted a patch at one time that added an option to the quota match to tell it to count the headers... If anyone's interested I could post it again (or you could try searching the list archive), but it is probably a little dated at the moment since I haven't done any work on it in quite a while...

-Brad

#3 lore raw
Quoted 1 line · Brad Fisher

I had submitted a patch at one time that added an option to the quota match to tell it to count the headers... If anyone's interested I could post it again (or you could try searching the list archive), but it is probably a little dated at the moment since I haven't done any work on it in quite a while...

This is _ip_-tables, so not counting the IP-header doesn't make much sense too me. I would prefer makeing this the default behaviour, with a warning in the help-text.

Regards
Patrick