|
A BGP community is a group of destinations
that share some common property. A community is not restricted to one
network or one AS.
Communities are used to simplify routing
policies by identifying routes based on an easily configurable property
rather than an IP prefix or an AS number. A BGP speaker can use the
Community attribute in conjunction with other attributes to control which
routes to accept, prefer, and pass on to other BGP neighbors. A route map
is configured to manipulate Community values.
The Community attribute (type code 8) is an
optional transitive attribute. Some community values are well known -
that is, they have a global meaning among all BGP routers. Well-known
Community values include:
- NO_EXPORT - A route carrying
this community value should not be advertised to peers outside a
confederation (or the AS, if it is the only AS in the confederation).
- NO_ADVERTISE - A route carrying
this community value, when received, should not be advertised to any
BGP peer.
- Internet - A route carrying this
community value, when received, should be advertised to all other
routers.
- Local-as - A route carrying this
community value, when received, should be advertised to peers within
the AS, but not advertised to peers in an external system.
Besides these well-known Community
attributes, private Community attributes can be defined for special uses.
These Community attributes are identified by a numeric value, such as 10 or
777. A common practice is to use the first two bytes of the Community
attribute for the AS number and the last two bytes to define a value in
relation to that AS. A provider (AS 256, for example), who wants to define
a private community called "my-peer-routers" could use the
Community 256:1 represented in a decimal notation. The number 256
indicates that this provider has defined the community, and the 1 has
special meaning to the provider; in this case it is
"my-peer-routers."
A route can have more than one Community
attribute, much the same way that a route can have more than one AS number
in its AS_Path. A BGP speaker that sees multiple Community attributes in a
route can act based on one, some, or all of the attributes. A router has
the option of adding or modifying Community attributes before passing
routes on to other peers. The figure shows a simple use of the community
attribute.
RTC updates RTB with three routes. Two of
these routes (RouteX and RouteY) are sent with a NO_EXPORT Community
attribute by RTC. The third route, RouteZ is sent without a Community
attribute. Thus, RTB will send only RouteZ to RTA in AS 100; RouteX and
RouteY will not be sent because of the NO_EXPORT attribute. This example
shows how the Community attribute can be used to dynamically influence the
routing decisions of another AS.
|