community

Статическая и динамическая, протоколы

community

Сообщение spkшник » 01 окт 2009, 15:43

что такое community и для чего они используются
spkшник
проходил мимо
 
Сообщения: 1
Зарегистрирован: 01 окт 2009, 15:22

Re: community

Сообщение root » 01 окт 2009, 17:25

Если речь идет про динамическую маршрутизацию и протокол BGP, то:
их описывает RFC 1997

From Wikipedia, the free encyclopedia:
Communities

BGP communities are attribute tags that can be applied to incoming or outgoing prefixes to achieve some common goal (RFC 1997). While it is common to say that BGP allows an administrator to set policies on how prefixes are handled by ISPs, this is generally not possible, strictly speaking. For instance, BGP natively has no concept to allow one AS to tell another AS to restrict advertisement of a prefix to only North American peering customers. Instead, an ISP generally publishes a list of well-known or proprietary communities with a description for each one, which essentially becomes an agreement of how prefixes are to be treated. Examples of common communities include local preference adjustments, geographic or peer type restrictions, DoS avoidance (black holing), and AS prepending options. An ISP might state that any routes received from customers with community XXX:500 will be advertised to all peers (default) while community XXX:501 will restrict advertisement to North America. The customer simply adjusts their configuration to include the correct community(ies) for each route, and the ISP is responsible for controlling who the prefix is advertised to. It should be noted that the end user has no technical ability to enforce correct actions being taken by the ISP, though problems in this area are generally rare and accidental.

It is a common tactic for end customers to use BGP communities (usually ASN:70,80,90,100) to control the local preference the ISP assigns to advertised routes instead of using MED (the effect is similar). It should also be noted that the community attribute is transitive, but communities applied by the customer very rarely become propagated outside the next-hop AS.

Extended communities

The BGP Extended Community Attribute has been added in 2006 in order to extend the range of such attributes and to provide a community attribute structuring by means of a type field. The extended format consists of one or two octets for the type field followed by 7 or 6 octets for the respective community attribute content. The definition of this Extended Community Attribute is documented in RFC 4360. The IANA administers the registry for BGP Extended Communities Types [4]. The Extended Communities Attribute itself is a transitive optional BGP attribute. However, a bit in the type field within the attribute decides, whether the encoded extended community is of transitive or non-transitive nature. The IANA registry therefore provides different number ranges for the attribute types. Due to the extended attribute range, its usage can be manifold. RFC 4360 exemplarly defines the "Two-Octet AS Specific Extended Community", the "IPv4 Address Specific Extended Community", the "Opaque Extended Community", the "Route Target Community" and the "Route Origin Community". A number of BGP QoS drafts [5] also use this Extended Community Attribute structure for inter-domain QoS signalling.


Communities это так называемый well-known атрибут протокола BGP, но не являющийся основным.
Комъюнити могут "открасить" маршрут и на основании комъюнити можно делать выборку (фильтрацию) из многочисленных маршрутов каких либо конкретных марштутов.
Ну например применяется для распределения трафика по каналам, если твой апстрим предоставляет тебе такую возможность, то послав вместе с анонсом своей подсети определенное апстримом комъюнити, можно например сделать prepend, что ухудшит маршрут через этого апстрима и приведет к снижению трафика на этом канале и повышение на другом/других канале/каналах.
Вот яркий пример описания возможных комъюнити у апстрима (Транстелеком):
Код: Выделить всё
remarks:         |  - To prepand or deny  prefix use 20485:5DNNA, where:        |
remarks:         |                                                              |
remarks:         |       D - destination of the prepend or deny action:         |
remarks:         |               2 - Upstreams                                  |
remarks:         |               3 - International peers                        |
remarks:         |               4 - Russian peers                              |
remarks:         |               9 - Upstreams and Peers                        |
remarks:         |                                                              |
remarks:         |       NN - Upstream or peer number:                          |
remarks:         |                                                              |
remarks:         |           Upstreams:                                         |
remarks:         |               01 - Cable&Wireless (AS1273)                   |
remarks:         |               02 - TeliaSonera (AS1299)                      |
remarks:         |               03 - NTT (AS2914)                              |
remarks:         |               05 - PCCW (AS3491)                             |
remarks:         |               99 - All Upstreams                             |
remarks:         |           International peers:                               |
remarks:         |               01 - SONG (AS3246)                             |
remarks:         |               03 - GOOGLE (AS15169)                          |
remarks:         |               04 - LINX                                      |
remarks:         |               05 - RETN (AS9002, International peer)         |
remarks:         |               99 - All International Peers                   |
remarks:         |           Russian peers:                                     |
remarks:         |               03 - Golden Telecom (AS3216)                   |
remarks:         |              04 - MTU (AS8359)                              |
remarks:         |               05 - RETN (AS9002, Russian peer)               |
remarks:         |               06 - Comcor (AS8732)                           |
remarks:         |               07 - Corbina (AS8402)                          |
remarks:         |               08 - NetByNet (AS12714)                        |
remarks:         |               09 - RBNet & Relarn (AS5568 & AS3316)          |
remarks:         |               99 - All Russian Peers                         |
remarks:         |                                                              |
remarks:         |       A - action:                                            |
remarks:         |                                                              |
remarks:         |               0 - don't announce prefix                     |
remarks:         |               1 - announce with one prepend                  |
remarks:         |               2 - announce with two times prepend            |
remarks:         |               3 - announce with three times prepend          |

ну например ты не хочешь анонсировать свой префикс в MTU через этого апстрима
тогда тебе небходимо отправить вместе с анонсом своего префикса community (см. в описание):
To prepand or deny prefix use 20485:5DNNA

4 - Russian peers

04 - MTU (AS8359)

0 - don't announce prefix

таким образом у нас получается: 20485:54040
таким образом, апстрим получив твой анонс увидит, что в нем установлено комъюнити и в соответствии с ним не будет анонсировать твой префикс своему пиру MTU

Так же "расскрашиваем" маршруты. ТрансТелеком "красит" вот так:
Код: Выделить всё
remarks:         +---------------------------------------------------------------
remarks:         |       Communities for prefix classification         |
remarks:         +---------------------------------------------------------------
remarks:         | All inbound prefixes are marked with BGP communities         |
remarks:         | which describe their source and geographical region.         |
remarks:         | The format for the second component of community             |
remarks:         | (number after 20485:) is set at five digits.                 |
remarks:         | This format is 20485:SNNRR where the fields are:             |
remarks:         |                                                              |
remarks:         |       S - source of the prefix:                              |
remarks:         |                                                              |
remarks:         |               1 - Customer                                   |
remarks:         |               2 - Upstream                                   |
remarks:         |               3 - International peer                         |
remarks:         |               4 - Russian peer                               |
remarks:         |                                                              |
remarks:         |       NN - Upstream, peer or customer number:                |
remarks:         |                                                              |
remarks:         |           Customers:                                         |
remarks:         |               11 - BGP with Internal Internet Access         |
remarks:         |               13 - BGP with Partial Internet Access          |
remarks:         |               17 - BGP with Global Internet Access           |
remarks:         |               19 - BGP with TTK-Retail Network
remarks:         |               Static routes from CTTC allocations: 20485:61RR|
remarks:         |           Upstreams:                                         |
remarks:         |               01 - Cable&Wireless (AS1273)                   |
remarks:         |               02 - TeliaSonera (AS1299)                      |
remarks:         |               03 - NTT (AS2914)                              |
remarks:         |               05 - PCCW (AS3491)                             |
remarks:         |           International peers:                               |
remarks:         |               01 - SONG (AS3246)                             |
remarks:         |               03 - GOOGLE (AS15169)                          |
remarks:         |               04 - LINX                                      |
remarks:         |               05 - RETN (AS9002, International peers)        |
remarks:         |           Russian peers:                                     |
remarks:         |               03 - Golden Telecom (AS3216)                   |
remarks:         |               04 - MTU (AS8359)                              |
remarks:         |               05 - RETN (AS9002, Russian peers)              |
remarks:         |               06 - Comcor (AS8732)                           |
remarks:         |               07 - Corbina (AS8402)                          |
remarks:         |               08 - NetByNet (AS12714)                        |
remarks:         |               09 - RBNet & Relarn (AS5568 & AS3316)          |
remarks:         |                                                              |
remarks:         |       RR - Geographical region code:                         |
remarks:         |                                                              |
remarks:         |               02 - Ufa                                       |
remarks:         |               16 - Kazan                                     |
remarks:         |               23 - Krasnodar                                 |
remarks:         |               24 - Krasnoyarsk                               |
remarks:         |               25 - Vladivostok                               |
remarks:         |               26 - Stavropol                                 |
remarks:         |               27 - Khabarovsk                                |
remarks:         |               31 - Belgorod                                  |
remarks:         |               34 - Volgograd                                 |
remarks:         |               36 - Voronezh                                  |
remarks:         |               38 - Irkutsk, Bratsk                           |
remarks:         |               39 - Kaliningrad                               |
remarks:         |               52 - Nizhny Novgorod                           |
remarks:         |               54 - Novosibirsk                               |
remarks:         |               55 - Omsk                                      |
remarks:         |               59 - Perm                                      |
remarks:         |               60 - Pskov                                     |
remarks:         |               61 - RostovDon                                 |
remarks:         |               63 - Samara                                    |
remarks:         |               64 - Saratov                                   |
remarks:         |               66 - Ekaterinburg                              |
remarks:         |               72 - Tumen                                     |
remarks:         |               73 - Ulyanovsk                                 |
remarks:         |               74 - Chelyabinsk                               |
remarks:         |               75 - Chita                                     |
remarks:         |               76 - Yaroslavl                                 |
remarks:         |               77 - Moscow                                    |
remarks:         |               78 - St.Petersburg                             |
remarks:         |               86 - Surgut                                    |
remarks:         |               99 - London                                    |
remarks:         |               00 - Amsterdam                                 |

соответсвенно посмотреть все маршруты, которые пришли, ну скажем из Лондона через Телию, можно будет так:
1. найдем искомое комъюнити, смотрим в "табличку" (как и в пред. варианте), находим его:
2 - Upstream

02 - TeliaSonera (AS1299)

99 - London

получаем комъюнити 20485:20299
2. теперь зная комъюнити мы можем увидеть на роутере все маршруты, в которых оно содержится:
Код: Выделить всё
show ip bgp community 20485:20299


соответственно ты можешь использовать communities в своих маршрутных картах, на основании community фильтруя маршрут, завышать ему метрику и т.д. и т.п.

Вот пример из жизни, в одном из топиков у нас на форуме.
С уважением, root

Изображение
------------
www.mega-net.ru - IT аутсорсинг
Аватара пользователя
root
Site Admin
 
Сообщения: 1894
Зарегистрирован: 11 июн 2008, 13:05
Откуда: Moscow, Russia


Вернуться в Маршрутизация / Routing

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 8

cron