* Re: [LARTC] Q: best solution to stop traffic to huge amount of
2002-08-22 7:38 [LARTC] Q: best solution to stop traffic to huge amount of unregistered hosts Karl Gaissmaier
@ 2002-08-22 20:44 ` Karl Gaissmaier
2002-08-22 20:55 ` Karl Gaissmaier
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Karl Gaissmaier @ 2002-08-22 20:44 UTC (permalink / raw)
To: lartc
Marian Jancar schrieb:
>
> On Thu, 22 Aug 2002 09:38:58 +0200
> "Karl Gaissmaier" <karl.gaissmaier@rz.uni-ulm.de> wrote:
>
> > I'm running a class B University network with approx 10k hosts
> > attached. I would now like to stop traffic from and to hosts
> > in my network not already registered in my DNS server.
> >
> > This means I've to handle with approx 50k rules|routes. Sure
> > I can summarize the unalloctaed address space a little bit
> > with masks to approx 30k rules, anyway this seems to be a problem.
>
> Create tree with decreasing netmask, you will have more rules in total
> but packets will have to travel through only few of them.
Yep, I thought already about this. If I set decreasing netmasks from /17
to /32 I would end up with 2^16 chains but after 16 comparisons
I would have a match. This would be the extreme!
If I create 256 different chains based on a /24 netmask
then I would have a match at least after 256 + 256 = 512
comparisons. The first max 256 comparisons select the
next chain and the last max 256 comparisons select the
/32 address in this special chain.
Anyway I find this ugly with iptables that we have no
MADDR match (in analogy to MPORT). If you build a firewall
you try always to build groups of services (mport) and
groups of servers/clients (maddr). With iptables you have
to reply the same rule n times for n similar servers/clients.
This is ugly and a performance bottleneck because these
similar rules are cheched sequentially.
Best regards and thanks for your tip.
Charly
--
Karl Gaissmaier Computing Center,University of Ulm,Germany
Email:karl.gaissmaier@rz.uni-ulm.de Network Administration
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [LARTC] Q: best solution to stop traffic to huge amount of
2002-08-22 7:38 [LARTC] Q: best solution to stop traffic to huge amount of unregistered hosts Karl Gaissmaier
2002-08-22 20:44 ` [LARTC] Q: best solution to stop traffic to huge amount of Karl Gaissmaier
@ 2002-08-22 20:55 ` Karl Gaissmaier
2002-08-22 21:04 ` Karl Gaissmaier
2002-09-03 11:13 ` Karl Gaissmaier
3 siblings, 0 replies; 5+ messages in thread
From: Karl Gaissmaier @ 2002-08-22 20:55 UTC (permalink / raw)
To: lartc
Robert Collier schrieb:
>
> Hi Karl,
>
> I don't have any suggestions for an easy way to solve your problem -
> but:
>
> On Thu, Aug 22, 2002 at 09:38:58AM +0200, Karl Gaissmaier wrote:
> > With ip route I think I have to describe all unregistered hosts
> > to stop traffic and not the smaller amount of registered hosts.
> > Does the FIB and route cache scale well to approx 30k routes?
>
> With 'large routing tables' enabled the kernel works just fine with a
> full internet routing table of 115,000 routes so a mere 30,000 should
> be a doddle.
>
> Your main problem will be getting the routes into the kernel.
Yes this is a problem. I tried for fun to build a 64k routing table
with:
ip route add type prohibit 10.0.i.j
(i=0..255; j=0..255)
and this took more than one hour on my home desktop (old pentium 90)
to fill the routing table.
Even if I know that this is pretty old stuff I was astonished over this
slow progress.
The question that arises is now for me, how long does it take
for a full internet routing table to get synchronized after
a route flush with a linux router?
Anyway, you told me that the kernel works fine with 115k routes
but be aware I will use this with Gigabit Interfaces.
What is the average forwarding time in ms for a packet with
115k routes?
Best regards and thanks for your answer
Charly
--
Karl Gaissmaier Computing Center,University of Ulm,Germany
Email:karl.gaissmaier@rz.uni-ulm.de Network Administration
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LARTC] Q: best solution to stop traffic to huge amount of
2002-08-22 7:38 [LARTC] Q: best solution to stop traffic to huge amount of unregistered hosts Karl Gaissmaier
2002-08-22 20:44 ` [LARTC] Q: best solution to stop traffic to huge amount of Karl Gaissmaier
2002-08-22 20:55 ` Karl Gaissmaier
@ 2002-08-22 21:04 ` Karl Gaissmaier
2002-09-03 11:13 ` Karl Gaissmaier
3 siblings, 0 replies; 5+ messages in thread
From: Karl Gaissmaier @ 2002-08-22 21:04 UTC (permalink / raw)
To: lartc
Gerry Creager N5JXS schrieb:
>
> The answers are not necessarily pretty.
>
> I've done a similar task with a Juniper M5 router. It will handle up to
> about 180,000 rules at wire speed. But it is expensive.
>
> If your switches were a little newer, we could use 802.1x to enable the
> switch-use capability flag (:-) and solve the problem.
you know, 10k hosts are never attached to a network with homogenous
new network devices :-(
>
> Instead of policing at a single edge point, you might consider policing
> at dormatory and building edges, where the load is smaller and you can
> use masking and diminsh the ruleset some more.
but the management is very difficult, see above
>
> With a sufficiently fast box, or series of boxes, doing specific tasks,
> you should be able to do this. Folks like Juniper achieve it by being
> able to classify and mark in ASIC without having to go to the processor.
Netfilter and iproute2/tc is very good but I miss just a fast
matching module for a "pool" of ip addresses and the missing tc-cref
or better documented tc examples, especially dealing with general
ingress policing.
Best regards
Charly
--
Karl Gaissmaier Computing Center,University of Ulm,Germany
Email:karl.gaissmaier@rz.uni-ulm.de Network Administration
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [LARTC] Q: best solution to stop traffic to huge amount of
2002-08-22 7:38 [LARTC] Q: best solution to stop traffic to huge amount of unregistered hosts Karl Gaissmaier
` (2 preceding siblings ...)
2002-08-22 21:04 ` Karl Gaissmaier
@ 2002-09-03 11:13 ` Karl Gaissmaier
3 siblings, 0 replies; 5+ messages in thread
From: Karl Gaissmaier @ 2002-09-03 11:13 UTC (permalink / raw)
To: lartc
Hi Don,
Don Cohen schrieb:
>
> Just reading mail that arrived while I was on vacation ...
>
> Several points.
> - In order to use the current tc you don't have to match all of the
> illegal addresses (64K - 10K) - it would be easier to default to
> disallow packets and match the smaller 10K that are allowed.
>
actually I can do this with three independent ore loosely coupled
systems:
iproute2
netfilter
tc
netfilter is to slow for 10k rules and if I use hierarchical prefixes
I have a lot of chains and still ca. 500 rules in worst case.
With iproute2 I could do this with a prohibit rule, but then I have
the bigger amount of disallowd addresses.
I think in the moment tc is the best solution, but how could this
be handled on ingress shaping to a 0 kbps queue?
> - What you really want, of course, is a new module that does a simple
> table lookup to decide whether to classify a packet. This should be
> easy to write. The hard part is filling the table - I don't even know
> where your data comes from.
the comes programmatically from the DNS system by a walk throug.
I check once a day all Class B addresses whether they are registered.
>
> - I'd expect your addresses to not be uniformly distributed. A
right!
> reasonable routing scheme would assign different class-c's to
> different departments/dorms; many class c's don't exist and you
> can eliminate those immediately; those that do probably go to other
> routers and those can do further filtering.
> An additional benefit of this more distributed solution is that,
this must be done a the central FW, because the other routers
are from different vendors with even different capabilities.
This would not be manageable.
> at least for traffic originating inside your network, earlier
> filtering prevents one class c from denying (outbound) service to
> others. I'd guess that you're less concerned with outside attackers
> sending to these bogus addresses without provocation from inside.
Regards
Charly
--
Karl Gaissmaier Computing Center,University of Ulm,Germany
Email:karl.gaissmaier@rz.uni-ulm.de Network Administration
Tel.: ++49 731 50-22499
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
^ permalink raw reply [flat|nested] 5+ messages in thread