Skip to contentSkip to conversation

Max Concurrent Session

DISCUSSION Miguel Angel Amador L 4 participants 6 messages Dec 10, 2004 – Dec 15, 2004

lore
Share & tools
lore
#0 lore raw

Hi All
I need implement a firewall that support 2000 concurrent sessions, it
is posible with Iptables/Netfiler ??
What need to do?

Thanks for all

regards
Miguel Angel Amador L.

#1 lore raw
Quoted 4 lines · Miguel Angel Amador L

Hi All
I need implement a firewall that support 2000 concurrent sessions, it
is posible with Iptables/Netfiler ??
What need to do?

depending on your architecture and netfilter kernel options--each conntrack entry will take up somewhere around 300 bytes. on my specific machine here--it's 332 bytes per conntrack. another machine i have (with more POM patches applied), that value is 360 bytes. let's be safe and assume each conntrack entry takes 400 bytes.

400 * 2000 = 800000 bytes = 781 kilobytes

so you would need 781 kb of non-pageable kernel memory available for iptables connection tracking.

normally, ip_conntrack_max is set to:

$TOTAL_RAM_IN_BYTES / 16384 = ip_conntrack_max

the minimum value this auto-calculation will use 128 and the max is 65536.

so to support 2000 tracked connections--you would need at least:

2000 * 16384 = 32 MB

the point of all this is that the breaking point in your case is not the number of simultaneous connections--how much bandwidth are those 2000 connections going to be pushing through this firewall? 1.544 Mbps? 100 Mbps? 1 Gbps?

-j

PS -- all these calculations are for i386 architecture only.

--
"I have thought this through. First, I will send Bart the money to
fly home. Then I will murder him."
--The Simpsons

#2 lore raw
In reply to Miguel Angel Amador L
Quoted 10 lines · Miguel Angel Amador L

Hi All
I need implement a firewall that support 2000 concurrent sessions, it
is posible with Iptables/Netfiler ??
What need to do?

Thanks for all

regards
Miguel Angel Amador L.

In theory you should have no problems or netfilter limitations on that matter. What you will need it's enough memory and a powerful CPU. It's very important that you optimize the rules as much as you can, having in mind how the packets traverse the chains and the rules and trying that the sessions traverse the minimum number of rules. You should also use connection tracking so related and established connections are accepted with just a few rules.

Signature · 12 lines
Jose Maria Lopez Hernandez
Director Tecnico de bgSEC
[email protected]
bgSEC Seguridad y Consultoria de Sistemas Informaticos
http://www.bgsec.com
ESPAÑA

The only people for me are the mad ones -- the ones who are mad to live,
mad to talk, mad to be saved, desirous of everything at the same time,
the ones who never yawn or say a commonplace thing, but burn, burn, burn
like fabulous yellow Roman candles.
                -- Jack Kerouac, "On the Road"
#4 lore raw
In reply to Miguel Angel Amador L

Hi Miguel
we run iptables 1.2.9 on a Dell PowerEdge 750.

It protects 128 IPs adresses which host many Internet services (www, mail, ftp, ssl, ssh, ...).

Current connections are above 2000 :
[root@Cerberux root]# cat /proc/net/ip_conntrack |wc -l
2168

Current load :
[root@Cerberux root]# uptime
10:10:24 up 156 days, 21:54, 1 user, load average: 0.00, 0.00, 0.00

About 250 mos of RAM is used.

Maximum connections is set here :
[root@Cerberux root]# cat /proc/sys/net/ipv4/ip_conntrack_max 16368

This value may be set higher but ensure you have enough RAM.

The higher value I ever seen is 5000 (happens when many worms scan our network concurrently), and we didnt noticed any network slowdown.

Have a nice day

Maxime Ducharme
Programmeur / Spécialiste en sécurité réseau

----- Original Message -----
From: "Miguel Angel Amador L" <[email protected]>
To: "NetFilter Users" <[email protected]>
Sent: Friday, December 10, 2004 2:11 PM
Subject: Max Concurrent Session

Quoted 10 lines

Hi All
I need implement a firewall that support 2000 concurrent sessions, it
is posible with Iptables/Netfiler ??
What need to do?

Thanks for all

regards
Miguel Angel Amador L.

#5 lore raw
Quoted 29 lines · Maxime Ducharme

Hi Miguel
we run iptables 1.2.9 on a Dell PowerEdge 750.

It protects 128 IPs adresses which host many Internet services (www, mail, ftp, ssl, ssh, ...).

Current connections are above 2000 :
[root@Cerberux root]# cat /proc/net/ip_conntrack |wc -l
2168

Current load :
[root@Cerberux root]# uptime
10:10:24 up 156 days, 21:54, 1 user, load average: 0.00, 0.00, 0.00

About 250 mos of RAM is used.

Maximum connections is set here :
[root@Cerberux root]# cat /proc/sys/net/ipv4/ip_conntrack_max 16368

This value may be set higher but ensure you have enough RAM.

The higher value I ever seen is 5000 (happens when many worms scan our network concurrently), and we didnt noticed any network slowdown.

Have a nice day

Quoted 8 lines

Maxime Ducharme
Programmeur / Spécialiste en sécurité réseau

----- Original Message -----
From: "Miguel Angel Amador L" <[email protected]>
To: "NetFilter Users" <[email protected]>
Sent: Friday, December 10, 2004 2:11 PM
Subject: Max Concurrent Session

[... Mi last comments...]

Thanks, I needed another opinion and I am secure now.

(PD:Is because some comercial firewall have limits for concurrent session , and I needed compare this )

__
Miguel Angel Amador L
fono: +562 204 8611 #231
fax: +562 204 8603
e-mail: [email protected]

#3 lore raw
In reply to Jose Maria Lopez
Quoted 8 lines

In theory you should have no problems or netfilter limitations on that matter. What you will need it's enough memory and a powerful CPU. It's very important that you optimize the rules as much as you can, having in mind how the packets traverse the chains and the rules and trying that the sessions traverse the minimum number of rules. You should also use connection tracking so related and established connections are accepted with just a few rules.

Gracias necesitaba corroborar esto para poder cambiar un fw comercial que no me aguantaba esta capacidad y requeria estar seguro que esto funcionaria.

Saludos
__
Miguel Angel Amador L
fono: +562 204 8611 #231
fax: +562 204 8603
e-mail: [email protected]