Saturday, July 13, 2013

BGP Community Primer

I’m a big fan of BGP.  It is the one protocol for your network that enables services and evolves a cost-center into a value-center leading to a profit-center.  Will every network be used to generate a profit?  Nope, but that doesn’t mean that it has to continue to suck CapEx and OpEx funds without generating massive value.  If you need to move the network forward and create more value, then you better get familiar with BGP.  NOTE:  Value doesn’t mean profit.
BGP is an interesting beast.  By itself, it doesn’t work so well.  It is more like a facilitator, or broker, of routing information in the network.  It relies on IGPs to provide the necessary reachability information to reach other BGP speakers and to resolve the next-hops of distant networks.  It also carries higher level information that makes VPNs useable.  BGP is extensible and multiprotocol through its use of NLRIs (network layer reachability information).
I wanted to focus on one of the most versatile attributes of BGP – the community attribute.  Communities are a type of tag that is used to identify like prefixes as a single group.  The best parallel I can draw would be something similar to the residential community that you live in right now.  But that only tells part of the story.  You also may belong to the PTA, Scouting, or sports club.  These are communities too.  Just as people belong to different yet simultaneous communities, prefixes can belong to different and simultaneous communities.
Let’s breakdown some of the community types to get a better understanding of what they can be used for in your network.

Community Types

Well-Known Communities

Well known communities are the probably the most used community types used next to the standard user-defined communities.  There are three well-used well-known communities (RFC1997):
  • no-export - If you add this community to your prefixes, the prefix will not leave the autonomous system.  It can be shared within the current autonomous system (iBGP) however. If you add this community to your eBGP advertisements, then the prefixes containing this community will not be advertised beyond the autonomous system you advertised the prefix into.
  • no-advertise - This community prevents the prefix from being advertised beyond the peer (iBGP or eBGP) you advertised it too.
  • no-export-subconfed - To prevent a prefix crossing a eBGP boundary including between confederation member AS.

Standard Communities:

Standard communities are the main work horses.  They are user-defined and extremely helpful in routing policy.  The standard community is four octets long and uses the nomenclature as-number:community-number - example: 65000:12345.  The format uses two octets on either side of the colon (:), giving 65535 possibilities for both the as-number and community number [0-65535]:[0-65535]

Extended Communities

Extended communities have a special purpose.  They are part well-known and part user-defined.  IANA maintains a list of BGP extended communities The format of the community is type:as-number:community-number.  The type field is usually predefined by one of the terms below:
  • Domain-ID - (RFC4577) Helps maintain OSPF information over L3VPN.  Used when the PE-CE protocol is OSPF.  Depending on domain-id match, OSPF routes can appear as type 5|7 externals or type 3 summaries. (domain:xxxxx:xxxxx).
  • Route Target - (RFC4360)The route target is used for MPLS VPNs (target:xxxxx:xxxxx).
  • Origin – (RFC4360) Useful for multihomed CEs to filter route advertisements and prevent the reintroduction of local routes back into source CE network.
  • Link Bandwidth - (IETF Draft) This community is used to share link bandwidth information from external autonomous system links.

Community Use

First, document your community structure before beginning.  This helps you put some thought and structure to the communities you will be using in your network.  It never hurts to plan before you implement.  I suggest creating a spreadsheet with your community definitions.
Examples:
  • 65000:100 – data center routes
  • 65000:101 – wan routes
  • 65000:102 – office networks
  • target:65000:1000-1999 – L3VPNs
  • target:65000:3000-3999 – Layer2 VPNs/VPLS
  • so-on-and-so-forth
Upstream provider community tips:
  • Providers may strip your communities.
  • You should remove any communities from your advertisements to other AS.
  • Providers may have a community structure for customer use.
  • Click on your ISP to see communities you can use to influence traffic in their network.

Ad Inside Post

Comments system

Disqus Shortname