How to mark and queue
Josip Gracin [email protected]
<PRE>Hello!
I would like to set up a machine to introduce random (but controllable) dropping of packets that are being forwarded. I also need to classify the traffic because I want some traffic shaping. The obvious solution is to QUEUE packets to user level and if they are ACCEPTed, put a MARK (--set-mark) on them for classifying. This would seem logical:
iptables -A FORWARD -j QUEUE -j MARK
Of course, it is not possible. How do I do this than? That is, how to do it without using two identical rules, one with QUEUE action and another with MARK action which does not seem to be a nice solution.
Thanks!
Josip
</PRE>
bert hubert [email protected]
<PRE>On Thu, Oct 19, 2000 at 10:15:28AM +0200, Josip Gracin wrote:
><i> Hello!
</I>><i>
</I>><i> I would like to set up a machine to introduce random (but controllable) </I>><i> dropping of packets that are being forwarded. I also need to classify the </I>
Try to make a u32 match on a part of the header that changes a lot. I suspect the IP packet id would be a good candidate, but you need to make sure that resends of the same packet do get through. If you match, route to loopback.
><i> traffic because I want some traffic shaping. The obvious solution is to </I>><i> QUEUE packets to user level and if they are ACCEPTed, put a MARK </I>><i> (--set-mark) on them for classifying. This would seem logical:
</I>><i>
</I>><i> iptables -A FORWARD -j QUEUE -j MARK
</I>><i>
</I>><i> Of course, it is not possible. How do I do this than? That is, how to do </I>><i> it without using two identical rules, one with QUEUE action and another </I>><i> with MARK action which does not seem to be a nice solution. </I>
Try asking the netfilter mailinglist.
Regards,
bert hubert
Signature · 6 lines
PowerDNS Versatile DNS Services Trilab The Technology People 'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet </PRE>
Josip Gracin [email protected]
<PRE>Thanks for the reply!
bert hubert (<A HREF="mailto:[email protected]">[email protected]</A>) wrote:
><i> On Thu, Oct 19, 2000 at 10:15:28AM +0200, Josip Gracin wrote:
</I>><i> > I would like to set up a machine to introduce random (but controllable) </I>><i> > dropping of packets that are being forwarded. I also need to classify the </I>><i>
</I>><i> Try to make a u32 match on a part of the header that changes a lot. I </I>
But than I would not be able to control the randomness of drops. I need a drop policy based on various stochastic functions.
><i> Try asking the netfilter mailinglist.
</I>
Oops, I thought this was a perfect list to ask the question. Sorry, I'll ask there.
Best regards,
Josip
</PRE>
Josip Gracin [email protected]
<PRE>bert hubert (<A HREF="mailto:[email protected]">[email protected]</A>) wrote:
><i> You could also use RED or GRED with strange configuration values. RED also </I>
I understand that what you are suggesting would be much better for router that handles high volumes of traffic. But, I will be using this for simulating a *slow* and congested (WAN) link between several machines so there won't be too much traffic and consequently the performance is not an issue.
Best regards,
Josip
</PRE>
bert hubert [email protected]
<PRE>On Thu, Oct 19, 2000 at 01:42:29PM +0200, Josip Gracin wrote:
><i> > Try to make a u32 match on a part of the header that changes a lot. I </I>><i>
</I>><i> But than I would not be able to control the randomness of drops. I need a </I>><i> drop policy based on various stochastic functions.
</I>
You could also use RED or GRED with strange configuration values. RED also does random dropping of packets, but normally only when routing a lot of traffic. You might be able to get it to drop in ways that please you.
><i> > Try asking the netfilter mailinglist.
</I>><i>
</I>><i> Oops, I thought this was a perfect list to ask the question. Sorry, I'll </I>><i> ask there.
</I>
For what you want, netfilter is suited best.
Regards,
bert hubert
Signature · 6 lines
PowerDNS Versatile DNS Services Trilab The Technology People 'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet </PRE>