Implementation of route server.

This commit is contained in:
Ondrej Zajicek 2008-11-01 12:55:43 +01:00
parent e16466b379
commit a92fe60717
5 changed files with 24 additions and 7 deletions

View file

@ -62,9 +62,10 @@ a statically configured table.
<p>A <em/Routing Daemon/ is in UNIX terminology a non-interactive program running on <p>A <em/Routing Daemon/ is in UNIX terminology a non-interactive program running on
background which does the dynamic part of Internet routing, that is it communicates background which does the dynamic part of Internet routing, that is it communicates
with the other routers, calculates routing tables and sends them to the OS kernel with the other routers, calculates routing tables and sends them to the OS kernel
which does the actual packet forwarding. There already exist other such routing daemons: routed (RIP only), GateD<HTMLURL URL="http://www.gated.org/"> which does the actual packet forwarding. There already exist other such routing
(non-free), Zebra<HTMLURL URL="http://www.zebra.org"> and MRTD<HTMLURL URL="http://www.zcu.cz/ftp/mirrors/mmrz/mrtd">, but their capabilities are limited and daemons: routed (RIP only), GateD (non-free), Zebra<HTMLURL URL="http://www.zebra.org">
they are relatively hard to configure and maintain. and MRTD<HTMLURL URL="http://sourceforge.net/projects/mrt">, but their capabilities are
limited and they are relatively hard to configure and maintain.
<p>BIRD is an Internet Routing Daemon designed to avoid all of these shortcomings, <p>BIRD is an Internet Routing Daemon designed to avoid all of these shortcomings,
to support all the routing technology used in the today's Internet or planned to be to support all the routing technology used in the today's Internet or planned to be
@ -730,8 +731,8 @@ for each neighbor using the following configuration parameters:
<tag>password <m/string/</tag> Use this password for MD5 authentication <tag>password <m/string/</tag> Use this password for MD5 authentication
of BGP sessions. Default: no authentication. of BGP sessions. Default: no authentication.
<tag>rr client</tag> Be a route reflector and treat neighbor as <tag>rr client</tag> Be a route reflector and treat the neighbor as
route reflection client. Default: disabled. a route reflection client. Default: disabled.
<tag>rr cluster id <m/IPv4 address/</tag> Route reflectors use cluster id <tag>rr cluster id <m/IPv4 address/</tag> Route reflectors use cluster id
to avoid route reflection loops. When there is one route reflector in a cluster to avoid route reflection loops. When there is one route reflector in a cluster
@ -740,6 +741,15 @@ for each neighbor using the following configuration parameters:
use a common cluster id. Clients in a cluster need not known their cluster use a common cluster id. Clients in a cluster need not known their cluster
id and this option is not allowed to them Default: a same as router id. id and this option is not allowed to them Default: a same as router id.
<tag>rs client</tag> Be a route server and treat the neighbor
as a route server client. A route server is used as a
replacement for full mesh EBGP routing in Internet exchange
points in a similar way to route reflectors used in IBGP routing.
Bird does not implement obsoleted RFC 1863, but uses ad-hoc implementation,
which behaves like plain EBGP but reduces modifications to advertised route
attributes to be transparent (for example does not prepend its AS number to
AS PATH attribute and keep MED attribute). Default: disabled.
<tag>enable as4 <m/switch/</tag> BGP protocol was designed to use 2B AS numbers <tag>enable as4 <m/switch/</tag> BGP protocol was designed to use 2B AS numbers
and was extended later to allow 4B AS number. BIRD supports 4B AS extension, and was extended later to allow 4B AS number. BIRD supports 4B AS extension,
but by disabling this option it can be persuaded not to advertise it and but by disabling this option it can be persuaded not to advertise it and

View file

@ -828,7 +828,7 @@ bgp_update_attrs(struct bgp_proto *p, rte *e, ea_list **attrs, struct linpool *p
{ {
eattr *a; eattr *a;
if (!p->is_internal) if (!p->is_internal && !p->rs_client)
{ {
bgp_path_prepend(e, attrs, pool, p->local_as); bgp_path_prepend(e, attrs, pool, p->local_as);

View file

@ -492,6 +492,8 @@ bgp_start_locked(struct object_lock *lock)
p->rr_client = cf->rr_client; p->rr_client = cf->rr_client;
} }
p->rs_client = cf->rs_client;
if (!p->neigh) if (!p->neigh)
{ {
log(L_ERR "%s: Invalid next hop %I", p->p.name, p->next_hop); log(L_ERR "%s: Invalid next hop %I", p->p.name, p->next_hop);
@ -644,6 +646,8 @@ bgp_check(struct bgp_config *c)
cf_error("Neighbor AS number out of range"); cf_error("Neighbor AS number out of range");
if ((c->local_as != c->remote_as) && (c->rr_client)) if ((c->local_as != c->remote_as) && (c->rr_client))
cf_error("Only internal neighbor can be RR client"); cf_error("Only internal neighbor can be RR client");
if ((c->local_as == c->remote_as) && (c->rs_client))
cf_error("Only external neighbor can be RS client");
} }
static void static void

View file

@ -28,6 +28,7 @@ struct bgp_config {
int enable_as4; /* Enable local support for 4B AS numbers [RFC4893] */ int enable_as4; /* Enable local support for 4B AS numbers [RFC4893] */
u32 rr_cluster_id; /* Route reflector cluster ID, if different from local ID */ u32 rr_cluster_id; /* Route reflector cluster ID, if different from local ID */
int rr_client; /* Whether neighbor is RR client of me */ int rr_client; /* Whether neighbor is RR client of me */
int rs_client; /* Whether neighbor is RS client of me */
unsigned connect_retry_time; unsigned connect_retry_time;
unsigned hold_time, initial_hold_time; unsigned hold_time, initial_hold_time;
unsigned keepalive_time; unsigned keepalive_time;
@ -66,6 +67,7 @@ struct bgp_proto {
u32 remote_id; /* BGP identifier of the neighbor */ u32 remote_id; /* BGP identifier of the neighbor */
u32 rr_cluster_id; /* Route reflector cluster ID */ u32 rr_cluster_id; /* Route reflector cluster ID */
int rr_client; /* Whether neighbor is RR client of me */ int rr_client; /* Whether neighbor is RR client of me */
int rs_client; /* Whether neighbor is RS client of me */
struct bgp_conn *conn; /* Connection we have established */ struct bgp_conn *conn; /* Connection we have established */
struct bgp_conn outgoing_conn; /* Outgoing connection we're working with */ struct bgp_conn outgoing_conn; /* Outgoing connection we're working with */
struct bgp_conn incoming_conn; /* Incoming connection we have neither accepted nor rejected yet */ struct bgp_conn incoming_conn; /* Incoming connection we have neither accepted nor rejected yet */

View file

@ -21,7 +21,7 @@ CF_KEYWORDS(BGP, LOCAL, NEIGHBOR, AS, HOLD, TIME, CONNECT, RETRY, KEEPALIVE,
ERROR, START, DELAY, FORGET, WAIT, ENABLE, DISABLE, AFTER, ERROR, START, DELAY, FORGET, WAIT, ENABLE, DISABLE, AFTER,
BGP_PATH, BGP_LOCAL_PREF, BGP_MED, BGP_ORIGIN, BGP_NEXT_HOP, BGP_PATH, BGP_LOCAL_PREF, BGP_MED, BGP_ORIGIN, BGP_NEXT_HOP,
BGP_ATOMIC_AGGR, BGP_AGGREGATOR, BGP_COMMUNITY, SOURCE, ADDRESS, BGP_ATOMIC_AGGR, BGP_AGGREGATOR, BGP_COMMUNITY, SOURCE, ADDRESS,
PASSWORD, RR, CLIENT, CLUSTER, ID, AS4) PASSWORD, RR, RS, CLIENT, CLUSTER, ID, AS4)
CF_GRAMMAR CF_GRAMMAR
@ -55,6 +55,7 @@ bgp_proto:
} }
| bgp_proto RR CLUSTER ID expr ';' { BGP_CFG->rr_cluster_id = $5; } | bgp_proto RR CLUSTER ID expr ';' { BGP_CFG->rr_cluster_id = $5; }
| bgp_proto RR CLIENT ';' { BGP_CFG->rr_client = 1; } | bgp_proto RR CLIENT ';' { BGP_CFG->rr_client = 1; }
| bgp_proto RS CLIENT ';' { BGP_CFG->rs_client = 1; }
| bgp_proto HOLD TIME expr ';' { BGP_CFG->hold_time = $4; } | bgp_proto HOLD TIME expr ';' { BGP_CFG->hold_time = $4; }
| bgp_proto STARTUP HOLD TIME expr ';' { BGP_CFG->initial_hold_time = $5; } | bgp_proto STARTUP HOLD TIME expr ';' { BGP_CFG->initial_hold_time = $5; }
| bgp_proto CONNECT RETRY TIME expr ';' { BGP_CFG->connect_retry_time = $5; } | bgp_proto CONNECT RETRY TIME expr ';' { BGP_CFG->connect_retry_time = $5; }