2. Route Exchange
This section discusses the constraints that must be met to exchange routes between an external BGP session with a peer from another AS and internal OSPF routes.
BGP does not carry subnet information in routing updates. Therefore, when referring to a subnetted network in the OSPF routing domain, we consider the equivalent network route in the context of BGP.
Multiple subnet routes for a subnetted network in OSPF are collapsed into one network route when exported into BGP.
2.1. Exporting OSPF routes into BGP
- The administrator must be able to selectively export routes into BGP via an appropriate filter mechanism.
This filter mechanism must support such control with the granularity of a single network.
Additionally, the administrator must be able to filter based on the OSPF tag and the various sub-fields of the OSPF tag. The settings of the tag and the sub-fields are defined in section 4 in more detail.
- By default, no routes must be exported from OSPF into BGP. A single mechanism must permit all OSPF inter-area and intra-area routes to be exported into BGP.
OSPF external routes of type 1 and type 2 must never be exported into BGP unless they are explicitly configured.
-
When configured to export a network, the ASBR must advertise a network route for a subnetted network, as long as at least one subnet in the subnetted network is reachable via OSPF.
-
The network administrator must be able to statically configure the BGP attribute INTER-AS METRIC to be used for any network route.
- By default, the INTER_AS METRIC must default to 1.
Explanatory text: The OSPF cost and the BGP INTER-AS METRIC are of different widths. The OSPF cost is a two level metric. The BGP INTER-AS METRIC is only an optional non-transitive attribute. Hence, a more complex BGP INTER-AS METRIC-OSPF cost mapping scheme is not necessary.
-
When an ASBR is advertising an OSPF route to network Y to external BGP neighbours and learns that the route has become unreachable, the ASBR must immediately propogate this information to the external BGP neighbours.
-
An implementation of BGP and OSPF on an ASBR must have a mechanism to set up a minimum amount of time that must elapse between the learning of a new route via OSPF and subsequent advertisement of the route via BGP to the external neighbours.
- The default value for this setting must be 0, indicating that the route is to be advertised to the neighbour BGP peers instantly.
Note that [RFC1267] mandates a mechanism to dampen the inbound advertisements from adjacent neighbours.
2.2. Importing BGP routes into OSPF
- BGP implementations should allow an AS to control announcements of BGP-learned routes into OSPF. Implementations should support such control with the granularity of a single network. Implementations should also support such control with the granularity of an autonomous system, where the autonomous system may be either the autonomous system that originated the route or the autonomous system that advertised the route to the local system (adjacent autonomous system).
- By default, no routes must be imported from BGP into OSPF. Administrators must configure every route they wish to import.
A mechanism may allow an administrator to configure an ASBR to import all the BGP routes into the OSPF routing domain.
- The administrator must be able to configure the OSPF cost and the OSPF metric type of every route imported into OSPF.
- The OSPF cost must default to 1; the OSPF metric type must default to type 2.
-
Routes learned via IBGP must not be imported into OSPF.
-
The ASBR must never generate a default route into the OSPF routing domain unless explicitly configured to do so.
A possible criterion for generating default into an IGP is to allow the administrator to specify a set of (network route, AS_PATH, default route cost, default route type) tuples. If the ASBR learns of the network route for an element of the set, with the corresponding AS_PATH, then it generates a default route into the OSPF routing domain, with cost "default route cost" and type, "default route type". The lowest cost default route will then be injected into the OSPF routing domain.
This is the recommended method for originating default routes in the OSPF routing domain.