Subject: Re: [vserver] Multicast ip configuration scalability problem
From: Herbert Poetzl <herbert@13thfloor.at>
Date: Sun, 3 Apr 2011 16:35:32 +0200

On Fri, Apr 01, 2011 at 11:13:45AM +0200, Furgerot Julien wrote:

> Hi all,

> I have a scalability problem related to ip configuration.

> If you remember my system, I have a distributed VoIP system
> using multicast addresses for communications. If I have
> understood correctly, binding a socket to listen on a multicast
> address requires a 'nodev' network interface configured like
> this :

> /etc/vservers/VM/interfaces/XX/ :

> ip : "224.0.0.10", prefix : 24 nodev

> This is a good workaround, but now I'm testing scalability,
> let say 1000 VoIP units with 2500 communications. Since I have
> one multicast IP by communication, I need to declare 2500
> interfaces on each VM. When doing that, all vserver command
> (start/stop/enter) are taking a long time to execute, between 1
> and 5 minutes.

> Could you help me to resolve this issue ? Would you happen to
> have any hint to work that around, for instance by declaring
> network ranges of address ?

the kernel knows both, an IP range (A-B) as well as
an address and mask (A & M) for specifying the network
contexts IP subset

this is done via NXA_TYPE_MASK and NXA_TYPE_RANGE in
VCMD_net_add_ipv4 and VCMD_net_add_ipv6 (note that ipv6
does not support ranges yet)

naddress supports them (with --mask and --range) for
a while now (note that I just realized that the range
has a bug in the current implementation, which will be
fixed shortly :)

naddress --nid 666 --set --ip 192.168.0.1 \
	--mask 192.168.1.0/255.255.255.240 \
	--range 192.168.2.23-192.168.2.42

for example, sets the addresses to

 192.168.0.1
 192.168.1.0  - 192.168.1.15  (mask)
 192.168.2.23 - 192.168.2.42  (range)

also note that this will lead to a rather performant
check inside the kernel, as it results in only 3 entries
compared to the 36 entries required with single IPs
(not to speak of 2500 single IPs)

HTC,
Herbert

> Sincerely, Julien