In a H.323 network the gatekeeper is a crucial component, providing address resolution, call routing, number rewriting, call authorization, etc. In addition it can provide advanced features like routing control channels and logical channels. The use of these features creates a single point of failure, so running redundant gatekeepers is clearly important. GnuGk supports the notion of an alternate gatekeeper by forwarding RRQ and URQ messages. By using VRRP (Virtual Router Redundancy Protocol) two gatekeepers can be setup up in an active/passive mode. In the case that the master gatekeeper fails, the backup gatekeeper will take over operations within seconds with complete endpoint state information. After the first machine resumes operation, it becomes the backup so endpoint state information is not lost.
freevrrpd is a VRRP implementation for FreeBSD. In a VRRP cluster, both machines share an IP address and optionally a virtual MAC address. In this configuration, both machines have the same priority. Normally one machine has a higher priority, so after a failure it is promoted back to the master. Since client state is shared between gatekeepers, a failed gatekeeper should come back online as the backup so it can start receiving endpoint state information.
VRRP uses Multicast(220.127.116.11) for all communications. Below is a basic setup for a machine with one interface(em0). The addr is set to the shared IP address. It should be noted that the password is sent as clear text as specified by RFC2338. To improve security of your cluster, use ipf (or your favorite packet filter) to only accept packets from the other machine in your cluster destined for 18.104.22.168. For more infomation read the RFC and man page.
Master Script - /usr/local/bin/master_script.sh
Backup Script - /usr/local/bin/master_script.sh
FreeBSD GnuGk rc script - /usr/local/etc/rc/001.gnugk.sh
FreeBSD freevrrpd rc script - /usr/local/etc/rc/002.freevrrpd.sh
Start order is fairly important. GnuGk is started first in backup mode. Then, freevrrpd starts and determines what state the machine is in(master or backup). The coresponding script is then run that copies the correct gatekeeper config and sends the gatekeeper process a HUP signal.
Putting it all together
Now, we have two machines running GnuGk, gatekeeper 1 operating as the master gatekeeper and gatekeeper 2 as the backup. If the master gatekeeper fails, the backup detects this. freevrrpd then adds 192.168.1.20 as an alias to interface em0. The master_script.sh runs, replacing our gatekeeper config and sending a HUP singal to reread the config. The key here is that GnuGk HUPs correctly. It rereads its config, starts listening on the new address, all without loosing any endpoint information or current connections. Gatekeeper 2 is now operating as the master. If gatekeeper 1 comes back online, it will become the backup and start receiving forwarded state information from the master.
Created by: Andrew Olson, 2005-09-22
Last updated: 04. May 2017
Page maintained by Jan Willamowius