From a92fe607173b52cf28256f00399953c623788c35 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Sat, 1 Nov 2008 12:55:43 +0100 Subject: Implementation of route server. --- doc/bird.sgml | 20 +++++++++++++++----- proto/bgp/attrs.c | 2 +- proto/bgp/bgp.c | 4 ++++ proto/bgp/bgp.h | 2 ++ proto/bgp/config.Y | 3 ++- 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/doc/bird.sgml b/doc/bird.sgml index 8fa55f8..9a12a71 100644 --- a/doc/bird.sgml +++ b/doc/bird.sgml @@ -62,9 +62,10 @@ a statically configured table.

A - (non-free), Zebra and MRTD, but their capabilities are limited and -they are relatively hard to configure and maintain. +which does the actual packet forwarding. There already exist other such routing +daemons: routed (RIP only), GateD (non-free), Zebra +and MRTD, but their capabilities are +limited and they are relatively hard to configure and maintain.

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 @@ -730,8 +731,8 @@ for each neighbor using the following configuration parameters: password Use this password for MD5 authentication of BGP sessions. Default: no authentication. - rr client Be a route reflector and treat neighbor as - route reflection client. Default: disabled. + rr client Be a route reflector and treat the neighbor as + a route reflection client. Default: disabled. rr cluster id Route reflectors use cluster id 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 id and this option is not allowed to them Default: a same as router id. + rs client 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. + enable as4 BGP protocol was designed to use 2B AS numbers 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 diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c index 2210cbe..811d52e 100644 --- a/proto/bgp/attrs.c +++ b/proto/bgp/attrs.c @@ -828,7 +828,7 @@ bgp_update_attrs(struct bgp_proto *p, rte *e, ea_list **attrs, struct linpool *p { eattr *a; - if (!p->is_internal) + if (!p->is_internal && !p->rs_client) { bgp_path_prepend(e, attrs, pool, p->local_as); diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index 0d580be..a34545b 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -492,6 +492,8 @@ bgp_start_locked(struct object_lock *lock) p->rr_client = cf->rr_client; } + p->rs_client = cf->rs_client; + if (!p->neigh) { 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"); if ((c->local_as != c->remote_as) && (c->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 diff --git a/proto/bgp/bgp.h b/proto/bgp/bgp.h index 1d67e33..ea64584 100644 --- a/proto/bgp/bgp.h +++ b/proto/bgp/bgp.h @@ -28,6 +28,7 @@ struct bgp_config { int enable_as4; /* Enable local support for 4B AS numbers [RFC4893] */ u32 rr_cluster_id; /* Route reflector cluster ID, if different from local ID */ 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 hold_time, initial_hold_time; unsigned keepalive_time; @@ -66,6 +67,7 @@ struct bgp_proto { u32 remote_id; /* BGP identifier of the neighbor */ u32 rr_cluster_id; /* Route reflector cluster ID */ 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 outgoing_conn; /* Outgoing connection we're working with */ struct bgp_conn incoming_conn; /* Incoming connection we have neither accepted nor rejected yet */ diff --git a/proto/bgp/config.Y b/proto/bgp/config.Y index 8524b2d..73b584f 100644 --- a/proto/bgp/config.Y +++ b/proto/bgp/config.Y @@ -21,7 +21,7 @@ CF_KEYWORDS(BGP, LOCAL, NEIGHBOR, AS, HOLD, TIME, CONNECT, RETRY, KEEPALIVE, ERROR, START, DELAY, FORGET, WAIT, ENABLE, DISABLE, AFTER, BGP_PATH, BGP_LOCAL_PREF, BGP_MED, BGP_ORIGIN, BGP_NEXT_HOP, BGP_ATOMIC_AGGR, BGP_AGGREGATOR, BGP_COMMUNITY, SOURCE, ADDRESS, - PASSWORD, RR, CLIENT, CLUSTER, ID, AS4) + PASSWORD, RR, RS, CLIENT, CLUSTER, ID, AS4) CF_GRAMMAR @@ -55,6 +55,7 @@ bgp_proto: } | bgp_proto RR CLUSTER ID expr ';' { BGP_CFG->rr_cluster_id = $5; } | 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 STARTUP HOLD TIME expr ';' { BGP_CFG->initial_hold_time = $5; } | bgp_proto CONNECT RETRY TIME expr ';' { BGP_CFG->connect_retry_time = $5; } -- cgit v1.2.3