LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: Manualy killed link Keepalived

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: Manualy killed link Keepalived
From: Roberto Nibali <ratz@xxxxxxxxxxxx>
Date: Fri, 08 Mar 2002 01:25:46 +0100
Salut Alexandre,

Ben j'arrete pas de turbiner... Et j'ai pas assez de temps pour faire tout
ce que je voudrais... mais sinon ca va :)

Dans ce metier tu n'auras jamais assez de temps pour toi-meme. C'est pour que je deviens paysan avec tant de vaches et des chèvres :)

My current problem is exactly that :

1. Constat : Before sending any adverts to the VRRP multicast group, we
need to be sure that we will able to send it. Otherwise we deduce that the
interface is unavailable and we must remove the VRRP VIPs and stop sending
adverts. When interface will come UP we will restart sending VRRP advert.

That's the problem we discussed on the other thread. You might want to check the iproute_get(int argc, char **argv) function in iproute.c of the iproute2 packet in the ip/ directory. You fill up the netlink request and do a rtnl_open() and a rtnl_talk() and check the return values.

2. Current implementation : Currenlty we never stop sending advert even if
if is IFF_DOWN. That way when interface became UP we do not have to restart
sending advert... It is implicit... For me this was a rapid develop way...
But it sound nasty.... I agree....

Make it a flippable bit. Your daemon sending advertising packets only really sends them if rtnl_talk() succeeds. Or if you get IFF_DOWN you set a flag SEND_ADVERT=0 and if you have IFF_UP and route get succeeds you set it to 1. The advertising function checks for SEND_ADVERT and sends advertising packets if (SEND_ADVERT==1).

3. Requested code modification (adding full 1. ) :
  3.1 Create a netlink func in the vrrp_ipaddress.c called
netlink_address_ipv4_isset(...) performing a netlink call to retreive info
on a specific IP address and return 1 or 0 if IP address is set on an
interface (can verify that the IP is set on the proper interface too)

Et voilà, here we are :) I should maybe read the whole emails before replying.

  3.2 If IP is set throught our netlink call, we need to create a func to
retreive specifics link state. For example if SWITCH/HUB where the NIC is
plugged into burnt, then NIC link will be down... So we need to determine
this event... What is the best way to code this ? netlink ? MII register
fetched ? => MII register gave nice informations but it is not a generic
chipset present on all NIC :/

This is a pain, I know. When I took Julian's routing patches I had this problem for the ROUTE_DEAD flag. I modified the network driver to set this flag ;). Meanwhile I see that the ethtool developed by Jeff Garzik and Dave Miller has a generic support for this for most cards. Maybe you have a look at the source of the ethtool.

  => I need some point of view/cons here... What is the most effective way
to handle this ?

I honestly don't know. You might want to ask at linux-net@xxxxxxxxxxxxxxx for more wisdom.

4. Integration in the keepalived code :
  4.1 Integrate a call of that 2 func into the VRRP code : vrrp.c in func
vrrp_send_pkt(...) before calling sendto(...).

  4.2 When we can't send advert according to the 3. func we register a
thread_timer(...) to periodicaly pool for interface state... If became
avalable need to register the sending advert thread.

Ok.

  4.3 If using VRRP with IPSEC-AH we need to handle something like a "ipsec
seq_number recover" to not send VRRP adverts with a seq_number already
proceeded, otherwise it will be dropped by receivers...

What seq_number do you mean?

This is my current wishes for VRRP framework.

Excellent. It looks promising. Good evening,
Roberto Nibali, ratz



<Prev in Thread] Current Thread [Next in Thread>