diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-05-20 03:03:42 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-05-20 03:03:42 +0200 |
commit | 7c8ff89e9346227f0e721f7686d4c4d58f9c9135 (patch) | |
tree | 7a5f73baf68e31220396e2391cdd216cdf981d51 /babeld | |
parent | initd: initd-mi.patch (diff) | |
download | frr-7c8ff89e9346227f0e721f7686d4c4d58f9c9135.tar.xz frr-7c8ff89e9346227f0e721f7686d4c4d58f9c9135.zip |
Multi-Instance OSPF Summary
——————————————-------------
- etc/init.d/quagga is modified to support creating separate ospf daemon
process for each instance. Each individual instance is monitored by
watchquagga just like any protocol daemons.(requires initd-mi.patch).
- Vtysh is modified to able to connect to multiple daemons of the same
protocol (supported for OSPF only for now).
- ospfd is modified to remember the Instance-ID that its invoked with. For
the entire life of the process it caters to any command request that
matches that instance-ID (unless its a non instance specific command).
Routes/messages to zebra are tagged with instance-ID.
- zebra route/redistribute mechanisms are modified to work with
[protocol type + instance-id]
- bgpd now has ability to have multiple instance specific redistribution
for a protocol (OSPF only supported/tested for now).
- zlog ability to display instance-id besides the protocol/daemon name.
- Changes in other daemons are to because of the needed integration with
some of the modified APIs/routines. (Didn’t prefer replicating too many
separate instance specific APIs.)
- config/show/debug commands are modified to take instance-id argument
as appropriate.
Guidelines to start using multi-instance ospf
---------------------------------------------
The patch is backward compatible, i.e for any previous way of single ospf
deamon(router ospf <cr>) will continue to work as is, including all the
show commands etc.
To enable multiple instances, do the following:
1. service quagga stop
2. Modify /etc/quagga/daemons to add instance-ids of each desired
instance in the following format:
ospfd=“yes"
ospfd_instances="1,2,3"
assuming you want to enable 3 instances with those instance ids.
3. Create corresponding ospfd config files as ospfd-1.conf, ospfd-2.conf
and ospfd-3.conf.
4. service quagga start/restart
5. Verify that the deamons are started as expected. You should see
ospfd started with -n <instance-id> option.
ps –ef | grep quagga
With that /var/run/quagga/ should have ospfd-<instance-id>.pid and
ospfd-<instance-id>/vty to each instance.
6. vtysh to work with instances as you would with any other deamons.
7. Overall most quagga semantics are the same working with the instance
deamon, like it is for any other daemon.
NOTE:
To safeguard against errors leading to too many processes getting invoked,
a hard limit on number of instance-ids is in place, currently its 5.
Allowed instance-id range is <1-65535>
Once daemons are up, show running from vtysh should show the instance-id
of each daemon as 'router ospf <instance-id>’ (without needing explicit
configuration)
Instance-id can not be changed via vtysh, other router ospf configuration
is allowed as before.
Signed-off-by: Vipin Kumar <vipin@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
Reviewed-by: Dinesh G Dutt <ddutt@cumulusnetworks.com>
Diffstat (limited to 'babeld')
-rw-r--r-- | babeld/babel_main.c | 2 | ||||
-rw-r--r-- | babeld/babel_zebra.c | 10 | ||||
-rw-r--r-- | babeld/babeld.c | 3 |
3 files changed, 9 insertions, 6 deletions
diff --git a/babeld/babel_main.c b/babeld/babel_main.c index 529c3f295..0b3e549f3 100644 --- a/babeld/babel_main.c +++ b/babeld/babel_main.c @@ -187,7 +187,7 @@ babel_init(int argc, char **argv) progname = babel_get_progname(argv[0]); /* set default log (lib/log.h) */ - zlog_default = openzlog(progname, ZLOG_BABEL, + zlog_default = openzlog(progname, ZLOG_BABEL, 0, LOG_CONS|LOG_NDELAY|LOG_PID, LOG_DAEMON); /* set log destination as stdout until the config file is read */ zlog_set_level(NULL, ZLOG_DEST_STDOUT, LOG_WARNING); diff --git a/babeld/babel_zebra.c b/babeld/babel_zebra.c index 75a1e6a84..f584e0396 100644 --- a/babeld/babel_zebra.c +++ b/babeld/babel_zebra.c @@ -99,6 +99,7 @@ babel_zebra_read_ipv6 (int command, struct zclient *zclient, /* Type, flags, message. */ api.type = stream_getc (s); + api.instance = stream_getw (s); api.flags = stream_getc (s); api.message = stream_getc (s); @@ -151,6 +152,7 @@ babel_zebra_read_ipv4 (int command, struct zclient *zclient, /* Type, flags, message. */ api.type = stream_getc (s); + api.instance = stream_getw (s); api.flags = stream_getc (s); api.message = stream_getc (s); @@ -205,7 +207,7 @@ DEFUN (babel_redistribute_type, return CMD_WARNING; } - zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient, type); + zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient, type, 0); return CMD_SUCCESS; } @@ -229,7 +231,7 @@ DEFUN (no_babel_redistribute_type, return CMD_WARNING; } - zclient_redistribute (ZEBRA_REDISTRIBUTE_DELETE, zclient, type); + zclient_redistribute (ZEBRA_REDISTRIBUTE_DELETE, zclient, type, 0); /* perhaps should we remove xroutes having the same type... */ return CMD_SUCCESS; } @@ -332,7 +334,7 @@ debug_babel_config_write (struct vty * vty) void babelz_zebra_init(void) { zclient = zclient_new(); - zclient_init(zclient, ZEBRA_ROUTE_BABEL); + zclient_init(zclient, ZEBRA_ROUTE_BABEL, 0); zclient->interface_add = babel_interface_add; zclient->interface_delete = babel_interface_delete; @@ -362,7 +364,7 @@ zebra_config_write (struct vty *vty) vty_out (vty, "no router zebra%s", VTY_NEWLINE); return 1; } - else if (! zclient->redist[ZEBRA_ROUTE_BABEL]) + else if (! zclient->redist[ZEBRA_ROUTE_BABEL].enabled) { vty_out (vty, "router zebra%s", VTY_NEWLINE); vty_out (vty, " no redistribute babel%s", VTY_NEWLINE); diff --git a/babeld/babeld.c b/babeld/babeld.c index 1ae3f042c..334f64c31 100644 --- a/babeld/babeld.c +++ b/babeld/babeld.c @@ -111,7 +111,8 @@ babel_config_write (struct vty *vty) lines = 1 + babel_enable_if_config_write (vty); /* list redistributed protocols */ for (i = 0; i < ZEBRA_ROUTE_MAX; i++) - if (i != zclient->redist_default && zclient->redist[i]) + if (i != zclient->redist_default && + zclient->redist[i].enabled) { vty_out (vty, " redistribute %s%s", zebra_route_string (i), VTY_NEWLINE); lines++; |