Skip to contentSkip to conversation

How to mark and queue

LARTC Josip Gracin [email protected] 2 participants 5 messages Oct 19, 2000

lore
Share & tools
lore

Josip Gracin [email protected]

author
#0 lore raw

<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>

#1 lore raw

<PRE>On Thu, Oct 19, 2000 at 10:15:28AM +0200, Josip Gracin wrote:
&gt;<i> Hello!
</I>&gt;<i>
</I>&gt;<i> I would like to set up a machine to introduce random (but controllable) </I>&gt;<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.

&gt;<i> traffic because I want some traffic shaping. The obvious solution is to </I>&gt;<i> QUEUE packets to user level and if they are ACCEPTed, put a MARK </I>&gt;<i> (--set-mark) on them for classifying. This would seem logical:
</I>&gt;<i>
</I>&gt;<i> iptables -A FORWARD -j QUEUE -j MARK
</I>&gt;<i>
</I>&gt;<i> Of course, it is not possible. How do I do this than? That is, how to do </I>&gt;<i> it without using two identical rules, one with QUEUE action and another </I>&gt;<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>
author
#2 lore raw
In reply to Josip Gracin [email protected]

<PRE>Thanks for the reply!

bert hubert (<A HREF="mailto:[email protected]">[email protected]</A>) wrote:
&gt;<i> On Thu, Oct 19, 2000 at 10:15:28AM +0200, Josip Gracin wrote:
</I>&gt;<i> &gt; I would like to set up a machine to introduce random (but controllable) </I>&gt;<i> &gt; dropping of packets that are being forwarded. I also need to classify the </I>&gt;<i>
</I>&gt;<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.

&gt;<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>

author
#3 lore raw
In reply to Josip Gracin [email protected]

<PRE>bert hubert (<A HREF="mailto:[email protected]">[email protected]</A>) wrote:
&gt;<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>

#4 lore raw
In reply to Josip Gracin [email protected]

<PRE>On Thu, Oct 19, 2000 at 01:42:29PM +0200, Josip Gracin wrote:

&gt;<i> &gt; Try to make a u32 match on a part of the header that changes a lot. I </I>&gt;<i>
</I>&gt;<i> But than I would not be able to control the randomness of drops. I need a </I>&gt;<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.

&gt;<i> &gt; Try asking the netfilter mailinglist.
</I>&gt;<i>
</I>&gt;<i> Oops, I thought this was a perfect list to ask the question. Sorry, I'll </I>&gt;<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>