Mailing List Archive

Connection tracking
Hi!

LVS keeps a table with all established connections. The testLVS
simulates thousands of different clients to make this table
big and "load" the redirector in that way.

How exactly is this table working? What entries are there?
Why are 1000 connections for 1000 clients so much bigger
then 1000 connections for one client?

Is it possible to obtain a big table with the same client-
IP-address, but with different ports?



Thomas

--
float o=0.075,h=1.5,T,r,O,l,I;int _,L=80,s=3200;main(){for(;s%L||(h-=o,T=
-2),s;4-(r=O*O)<(l=I*I)|++ _==L&&write(1,(--s%L?_<L?--_ %6:6:7)+"World!
\n",1)&&(O=I=l=_=r=0,T+=o /2)) O=I*2*O+h,I=l+T-r;}
Re: Connection tracking [ In reply to ]
On Tue, Nov 28, 2000 at 07:35:16PM +0100, Thomas Proell wrote:
> Hi!
>
> LVS keeps a table with all established connections. The testLVS
> simulates thousands of different clients to make this table
> big and "load" the redirector in that way.
>
> How exactly is this table working? What entries are there?
> Why are 1000 connections for 1000 clients so much bigger
> then 1000 connections for one client?
>
> Is it possible to obtain a big table with the same client-
> IP-address, but with different ports?

The table is a hash with buckets. The buckets themselves are a linked list.
The hashing algorithm is based for the in part on the client's IP address
so having 1000 connections from the same client will give different hash
table usage to 1000 connections from the same client. The lookup semantics
of the hash table contributes almost entirely to any performance overhead
LVS has once a connection is established so it seems logical to try an
reproduce hash table usage, as it would occur in the real world, as closely
as possible.


--
Horms
Re: Connection tracking [ In reply to ]
Hi,

Can anyone supply more info on the Hashing done?

10x

Louis.
[...]
> The table is a hash with buckets. The buckets themselves are a linked list.
> The hashing algorithm is based for the in part on the client's IP address
[...]
> Horms
>
> _______________________________________________
> LinuxVirtualServer.org mailing list - lvs-users@LinuxVirtualServer.org
> Send requests to lvs-users-request@LinuxVirtualServer.org
> or go to http://www.in-addr.de/mailman/listinfo/lvs-users
>
Re: Connection tracking [ In reply to ]
Hi!

> The table is a hash with buckets. The buckets themselves are a linked list.
> The hashing algorithm is based for the in part on the client's IP address
> so having 1000 connections from the same client will give different hash
> table usage to 1000 connections from the same client.

So, 1000 different clients fill 1000|many different buckets with one|few
entry each, and 1 client sending on 1000 ports will fill 1 bucket with
1000 entries?

Thomas
Re: Connection tracking [ In reply to ]
>
> The hash table is a 2D table with fixed number of rows and
>unlimited number of columns. The number of the rows can be configured
>from the kernel menu (12 bits default=4096 rows). The columns are
>with different length (double linked lists).
>
> One entry (connection structure) contains info for one
>"connection" or for one "template" used to keep all connections from
>same client to same real server.
>

Any way to view the contents of this table?

-K
_____________________________________________________________________________________
Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com
Re: Connection tracking [ In reply to ]
Sorry, yes. But, I thought these refer to netfilter's masquerade not the
IPVS hash table.

-K

>From: Julian Anastasov <ja@ssi.bg>
>
> > > The hash table is a 2D table with fixed number of rows and
> > >unlimited number of columns. The number of the rows can be configured
> > >from the kernel menu (12 bits default=4096 rows). The columns are
> > >with different length (double linked lists).
> > >
> > > One entry (connection structure) contains info for one
> > >"connection" or for one "template" used to keep all connections from
> > >same client to same real server.
> > >
> >
> > Any way to view the contents of this table?
>
> In Linux 2.2:
>
> netstat -Mn
> cat /proc/net/ip_masquerade
>
> In Linux 2.4:
>
> cat /proc/net/ip_vs_conn
>
>
>
>I'm answering you this question for 2nd time. Did you received this mail:
>
_____________________________________________________________________________________
Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com
Re: Connection tracking [ In reply to ]
Hello,

On Tue, 28 Nov 2000, Thomas Proell wrote:

> Hi!
>
> LVS keeps a table with all established connections. The testLVS
> simulates thousands of different clients to make this table
> big and "load" the redirector in that way.
>
> How exactly is this table working? What entries are there?

The hash table is a 2D table with fixed number of rows and
unlimited number of columns. The number of the rows can be configured
from the kernel menu (12 bits default=4096 rows). The columns are
with different length (double linked lists).

One entry (connection structure) contains info for one
"connection" or for one "template" used to keep all connections from
same client to same real server.

> Why are 1000 connections for 1000 clients so much bigger
> then 1000 connections for one client?

If one client host loops in creating connections to
one remote service (VIP:VPORT for example) the max number of
these connections is 65536 (2-byte TCP and UDP port value). The
real situation is different. For example, Linux uses ports 1024
to 4999 for autoselecting source ports. Of course, you can change
these settings. So, with the default settings you can create
3976 connections from one client host. After tuning you can
achieve ~60000. OTOH, testlvs is not limited because it does not
creates connections nor uses source port autoselection with
connect()/bind().

> Is it possible to obtain a big table with the same client-
> IP-address, but with different ports?

Up to 60000 connections from one client IP after tuning.
Create many client IPs and learn the client program to bind to
these different IP addresses when flooding the server.

> Thomas


Regards

--
Julian Anastasov <ja@ssi.bg>
Re: Connection tracking [ In reply to ]
Hello,

On Tue, 28 Nov 2000, Lorn Kay wrote:

> > The hash table is a 2D table with fixed number of rows and
> >unlimited number of columns. The number of the rows can be configured
> >from the kernel menu (12 bits default=4096 rows). The columns are
> >with different length (double linked lists).
> >
> > One entry (connection structure) contains info for one
> >"connection" or for one "template" used to keep all connections from
> >same client to same real server.
> >
>
> Any way to view the contents of this table?

In Linux 2.2:

netstat -Mn
cat /proc/net/ip_masquerade

In Linux 2.4:

cat /proc/net/ip_vs_conn



I'm answering you this question for 2nd time. Did you received this mail:

------------------------------------------------------------------------
Re: Connection tracking [ In reply to ]
On Tue, Nov 28, 2000 at 06:54:13PM +0000, Louis Harik wrote:
> Hi,
>
> Can anyone supply more info on the Hashing done?
>
> 10x

Please take a look at the source, it has all the goodies.


--
Horms