84
1 Tutorial BGP - GTER BGP v4 – Tutorial 17º GTER Caio Klein

Tutorial BGP Redes de Internet

Embed Size (px)

Citation preview

Page 1: Tutorial BGP Redes de Internet

1Tutorial BGP - GTER

BGP v4 – Tutorial17º GTER

� Caio Klein

Page 2: Tutorial BGP Redes de Internet

2Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 2Tutorial BGP - GTER

Agenda

� Introdução ao BGP v4

� Protocolo BGP e Atributos

� iBGP e eBGP � Políticas de Roteamento BGP

� Intervalo

� Escalando o iBGP Full Mesh

� Route Reflection

� Confederations� Novas facilidades do BGP

� Route Damping

Page 3: Tutorial BGP Redes de Internet

3Tutorial BGP - GTER

Introdução ao BGP v4

Page 4: Tutorial BGP Redes de Internet

4Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 4Tutorial BGP - GTER

BGP – Border Gateway Protocol v4� Algumas referências do BGP v4

� RFCs 1771 e 1772 - BGP v4� RFCs 1965 - Autonomous System Confederations � RFC 1966 - Route Reflection� RFC 1997 - Communities� RFC 2270 - Dedicated AS’s� RFC 2283 - MBGP� RFC 2385 - BGP MD5 Authentication� RFC 2439 - Route Damping� RFC 2842 - Capabilities Negotiation

Page 5: Tutorial BGP Redes de Internet

5Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 5Tutorial BGP - GTER

Autonomous System (AS)

�O que é um AS?

� Grupo de roteadores• Administrados com uma política comum de

roteamento• Operam sob a mesma administração técnica• Percebidos externamente como um único domínio

de roteamento

� Inteiro de 16 bits (1-65535)

� 64512-65535 AS - Privados

Page 6: Tutorial BGP Redes de Internet

6Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 6Tutorial BGP - GTER

Internet - Coleção de ASs

� Técnicas de IGP não são aplicáveis neste ambiente. É necessário maior escalabilidade

� Protocolo deve refletir acordos entre ASs - Flexibilidade

AS 9999

AS 8888 AS 7777

Page 7: Tutorial BGP Redes de Internet

7Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 7Tutorial BGP - GTER

O que é o BGP?

�BGP é um protocolo de roteamento do tipo inter-domínio que transmite informações de prefixos

�BGP é um protocolo do tipo “path vector”

� Similar ao “distance vector”�BGP percebe a Internet como uma coleção de

autonomous systems (AS)

�BGP suporta CIDR

�Roteadores BGP trocam informações de roteamento entre “peers”

Page 8: Tutorial BGP Redes de Internet

8Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 8Tutorial BGP - GTER

Fundamentos do BGP�Rotas consistem de

� Destino – usualmente prefixo IP� Informações que descrevem o caminho até o

destino• Atributos

�Peers BGP anunciam NLRI entre si em mensagens do tipo “update”

�O BGP compara o AS path e outros atributos para selecionar o melhor caminho

�Rotas indisponíveis podem ser anunciadas� Rotas não alcançáveis são removidas

(withdrawn)

Page 9: Tutorial BGP Redes de Internet

9Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 9Tutorial BGP - GTER

Analisando rotas BGP

�Olhando entrada específica na tabela de roteamento

user@host> show route 172.16.0.0 extensiveinet.0: 6 destinations, 6 routes (5 active, 0 holddown, 1 hidden)

+ = Active Route, - = Last Active, * = Both

172.16.0.0/12 (1 entry, 1 announced)

TSI:

BGP_Sync_Any dest 172.16.0.0/12 MED 0

*BGP Preference: 170/-101

Nexthop: 11.1.1.1 via fe-0/0/0.0, selectedState: <Active Int Ext>

Local AS: 29 Peer AS: 29

Age: 1d 9:46:54 Metric2: 0

Task: BGP_29.11.1.1.1+1048

Announcement bits (2): 0-KRT 2-BGP_Sync_Any

AS path: 9999 8888 7777 I

BGP next hop: 11.1.1.1

Localpref: 100Router ID: 172.18.1.1

Page 10: Tutorial BGP Redes de Internet

10Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 10Tutorial BGP - GTER

Conexões BGP�BGP utiliza conexões TCP

� TCP port 179

� Serviços TCP• Fragmentation, Acknowledgments, Checksums,

Sequencing e Flow Control

� Sem descoberta automática de vizinho�Atualizações do BGP são incrementais

� Sem “refreshes” regulares

� Exceto no estabelecimento da sessão quando o volume de roteamento pode ser grande

Page 11: Tutorial BGP Redes de Internet

11Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 11Tutorial BGP - GTER

BGP Peering

�Sessões BGP são estabelecidas entre peers

� BGP Speakers�Dois tipos de sessões de peering

� E-BGP (externo) peers AS's diferentes

� I-BGP (interno) peers dentro do mesmo AS�Ainda é necessário o interior gateway protocol

(IGPs)

� IGP conecta os BGP speakers dentro do AS

� IGP anuncia rotas internas

Page 12: Tutorial BGP Redes de Internet

12Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 12Tutorial BGP - GTER

BGP Peering

eBGP Peering

AS 9999AS 8888 AS 7777

iBGP Peering

ISIS

OSPFISIS

Page 13: Tutorial BGP Redes de Internet

13Tutorial BGP - GTER

Mensagens do BGPv4

Page 14: Tutorial BGP Redes de Internet

14Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 14Tutorial BGP - GTER

Mensagens do Protocolo BGP

�Quatro tipos de mensagem

� Open

� Update

� Notification

� Keepalive�Utilizam um cabeçalho em comum

Page 15: Tutorial BGP Redes de Internet

15Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 15Tutorial BGP - GTER

Cabeçalho Comum

� 19 bytes de comprimento

�Utilizado para autenticação

Marker Field (16 bytes)

Length Field (2 bytes) Type Field (1 byte)

Page 16: Tutorial BGP Redes de Internet

16Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 16Tutorial BGP - GTER

Mensagem Open

� Após uma conexão TCP ser estabelecida, os peers BGP trocam mensagens “open”para criar uma conexão BGP

� Sobre uma conexão BGP os peers trocam outras mensagens BGP e dados como informações de roteamento

Page 17: Tutorial BGP Redes de Internet

17Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 17Tutorial BGP - GTER

Mensagem Open

Marker Field

Length Field Type Field Version (1 byte)

My Autonomous System Hold Time

BGP Identifier

Opt. Parameters Length

Optional Parameters (Variable Length)

Page 18: Tutorial BGP Redes de Internet

18Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 18Tutorial BGP - GTER

Mensagem Update

�Cada “update” contem um anúncio de caminho com seus atributos e destinos� Muitos destinos (prefixos) podem compartilhar

o mesmo caminho�Sistemas BGP utilizam essa informação para

construir um gráfico descrevendo as relações entre todos os ASs

Page 19: Tutorial BGP Redes de Internet

19Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 19Tutorial BGP - GTER

Mensagem Update

�Mensagens que possuem os mesmos atributos devem ser agrupadas num mesmo update

Withdrawn Routes Length (2 octets)

Header

Path Attributes (Variable Length)

Withdrawn Routes (Variable)

Total Path Attributes (2 octets)

~ ~

Network Layer Reachability information (Variable Length)

Page 20: Tutorial BGP Redes de Internet

20Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 20Tutorial BGP - GTER

Mensagem Keepalive

� Sistemas BGP trocam mensagens keepalive para determinar se um link ou peer falhou ou não está mais disponível

� Mensagens são trocadas frequentemente para o tempo de “hold” não expirar

� Intervalos de 30s entre keepalives e hold timer de 90s são default (JUNOS)

• Hold timer é negociado entre peers

� Contem apenas o BGP header (19 bytes)

Page 21: Tutorial BGP Redes de Internet

21Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 21Tutorial BGP - GTER

Mensagem Notification

� Sistemas BGP enviam mensagens “notification” quando uma condição de erro é detectada

� Após o envio da mensagem “notification” as sessões BGP e a conexão TCP são encerradas

� Mensagem “notification” consiste de • Cabeçalho BGP• Código de erro• Subcódigo• Dados que descrevem o erro

Page 22: Tutorial BGP Redes de Internet

22Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 22Tutorial BGP - GTER

Mensagens “notification”

�Códigos de erro

� 1 – Message header error

� 2 – Open message error

� 3 – Update message error

� 4 – Hold timer expired

� 5 – Finite state machine error

� 6 – Cease

Page 23: Tutorial BGP Redes de Internet

23Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 23Tutorial BGP - GTER

Estados de sessão BGP

3-Active 2-Connect

4-OpenSent

5-OpenConfirm

1-Idle

6-Established

OPEN

OPEN

KEEPALIVE

KEEPALIVEUPDATE

NOTIFICATION

Waiting for a Start Event

Waiting for TCP Connection

Trying to acquire a peer

Waiting for anOPEN message

from a peer

Waiting for aKEEPALIVE orNOTIFICATION

from a peer

Neighbor negotiationis complete

KEEPALIVE

NOTIFICATION

NOTIFICATION

A Stop event

Page 24: Tutorial BGP Redes de Internet

24Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 24Tutorial BGP - GTER

Show BGP Neighboruser@host> show bgp neighborPeer: 11.1.1.2+179 AS 29 Local: 11.1.1.1+1048 AS 29Type: Internal State: Established Flags: <>Last State: OpenConfirm Last Event: RecvKeepAliveLast Error: NoneOptions: <Preference HoldTime>

Holdtime: 90 Preference: 170Number of flaps: 1Error: "Cease" Sent: 1 Recv: 0Peer ID: 11.1.1.2 Local ID: 0.0.0.0 Active Holdtime: 90NLRI advertised by peer: unicastNLRI for this session: unicastGroup Bit: 0 Send state: in syncTable inet.0Active Prefixes: 0Received Prefixes: 0Suppressed due to damping: 0

Table inet.2Active Prefixes: 0Received Prefixes: 0Suppressed due to damping: 0

Last traffic (seconds): Received 25 Sent 21 Checked 21Input messages: Total 4143 Updates 0 Octets 78717Output messages: Total 4156 Updates 10 Octets 79303Output Queue[0]: 0Output Queue[1]: 0

Page 25: Tutorial BGP Redes de Internet

25Tutorial BGP - GTER

Atributos

Page 26: Tutorial BGP Redes de Internet

26Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 26Tutorial BGP - GTER

Atributos BGP

�AS-path�BGP nexthop

� Local-preference

�MED

�Origin

�Diferenças entre iBGP e eBGP

Page 27: Tutorial BGP Redes de Internet

27Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 27Tutorial BGP - GTER

AS-Path�Sequência de ASs que a rota atravessou

�Usado para detecção de loop

�Aplicação de políticas

AS 999911.1.0.0/16

AS 888811.2.0.0/16

AS 777711.3.0.0/16

AS 666611.4.0.0/16

Prefixo AS-Path11.1.0.0/16 7777 8888 999911.2.0.0/16 7777 888811.3.0.0/16 777711.4.0.0/16 I

Page 28: Tutorial BGP Redes de Internet

28Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 28Tutorial BGP - GTER

Next-hop� eBGP – endereço do neighbor externo

� iBGP – Next-hop do eBGP

�BGP speaker deve conhecer caminho para o next-hop

AS 9999

AS 888811.2.0.0/16

AS 777711.3.0.0/16

Prefixo Next-hop11.2.0.0/16 11.2.1.111.3.0.0/16 11.2.1.1

11.2.1.1

11.2.1.2

Page 29: Tutorial BGP Redes de Internet

29Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 29Tutorial BGP - GTER

Resolvendo Next-hops BGP

� 2 métodos comuns

� Nexthop self• Ajusta endereço de BGP Nexthop quando anuncia

para peers internos

� Passive interface• Adiciona subnet de enlace externo à base de

dados do IGP• Permite roteador peer ser “pingado” a partir de

uma rede interna

Page 30: Tutorial BGP Redes de Internet

30Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 30Tutorial BGP - GTER

Next-hop Self�Roteador eBGP modifica o next-hop da rota

aprendida para o endereço da loopback

�Roteadores iBGP devem conhecer loopbacks via IGP

AS 9999

AS 888811.2.0.0/16

AS 777711.3.0.0/16

Prefixo Next-hop11.2.0.0/16 11.2.1.111.3.0.0/16 11.2.1.1

11.2.1.1

11.2.1.2

loopback11.3.1.1

Prefixo Next-hop11.2.0.0/16 11.3.1.111.3.0.0/16 11.3.1.1

Política Next-Hop Self

OSPF

Page 31: Tutorial BGP Redes de Internet

31Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 31Tutorial BGP - GTER

Passive interface�Estende o roteamento IGP até as interfaces

externas

� Funciona apenas quando peers utilizam IP das interfaces

AS 888811.2.0.0/16

AS 777711.3.0.0/16

11.2.1.1

11.2.1.2

Prefixo Next-hop11.2.0.0/16 11.2.1.111.3.0.0/16 11.2.1.1

Insere interface “passive”no

roteamento IGP

AS 9999

OSPF

Page 32: Tutorial BGP Redes de Internet

32Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 32Tutorial BGP - GTER

Next-hop em iBGP�Geralmente next-hop é loopback do roteador iBGP

�Roteamento recursivo

� IGP deve informar sobre loopbacks

Prefixo Next-hop11.2.100.0/24 11.2.2.211.2.101.0/24 11.2.2.1

Loopback11.2.2.2

Loopback11.2.2.1

AS 8888

11.2.100.0/24

11.2.101.0/24

Page 33: Tutorial BGP Redes de Internet

33Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 33Tutorial BGP - GTER

Local Preference�Determina melhor caminho para tráfego saínte

�Caminho com maior local-preference vence

� Local-preference default 100 (JUNOS)

AS 999911.1.0.0/16

AS 8888

AS 7777

AS 6666

Prefixo Local Pref11.1.0.0/16 100*11.1.0.0/16 120

100

120

Page 34: Tutorial BGP Redes de Internet

34Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 34Tutorial BGP - GTER

Multi-Exit Descriminator (MED)� Inter-AS não transitivo

�Determina melhor caminho para tráfego entrante

�Seu uso deve ser acordado entre ASs

AS 999911.1.0.0/16

AS 8888

500

600

Prefixo MED*11.1.0.0/16 50011.1.0.0/16 600

Page 35: Tutorial BGP Redes de Internet

35Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 35Tutorial BGP - GTER

Origin

� Informa a origem do prefixo� Influencia seleção do melhor caminho

� Três tipos:

� IGP – configurada de forma explícita no BGP (agregado, policy)

� EGP – gerada pelo EGP

� Incomplete – redistribuida por outro protocolo de roteamento

Page 36: Tutorial BGP Redes de Internet

36Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 36Tutorial BGP - GTER

Exterior BGP (eBGP)

�Utilizado para passar rotas entre ASs

�Características

� BGP nexthop é modificado

� AS-Path é adicionado

� Peer geralmente entre endereços de interfaces físicas

�AS-Path é utilizado como mecanismo de prevenção de loop de roteamento

Page 37: Tutorial BGP Redes de Internet

37Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 37Tutorial BGP - GTER

Exterior BGP

eBGP Peering

AS 9999AS 8888 AS 7777

Page 38: Tutorial BGP Redes de Internet

38Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 38Tutorial BGP - GTER

Interior BGP (iBGP)� iBGP é utilizado no interior de um AS

�Next-hop BGP não é modificado

�AS-Path não é adicionado

�É implementado tipicamente com peers totalmente interconectados (full mesh)

� Análise de AS-PATH não é aplicável para prevenir loops internos

� Roteador não pode repassar via iBGP rotas aprendidas através de outros peers iBGP

Page 39: Tutorial BGP Redes de Internet

39Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 39Tutorial BGP - GTER

Interior BGP

iBGP Peering

AS 9999

AS 7777AS 8888

Page 40: Tutorial BGP Redes de Internet

40Tutorial BGP - GTER

Política de Roteamento BGP“Routing Policy”

Page 41: Tutorial BGP Redes de Internet

41Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 41Tutorial BGP - GTER

JUNOS Route Preference � Nexthop é alcançável?

� -1 = Not reachable� Preferência menor

� 0 = directly connected� 5 = static routes� 7 = RSVP� 9 = LDP� 10 = OSPF internal� 15 = ISIS L1 internal � 18 = ISIS L2 internal� 100 = RIP� 130 = Aggregate or generated� 150 = OSPF external� 160 = ISIS L1 external� 165 = ISIS L2 external� 170 = BGP

Page 42: Tutorial BGP Redes de Internet

42Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 42Tutorial BGP - GTER

Seleção de rotas BGP - JUNOS

�Menor “route preference”�Maior “local preference”

�AS-path mais curto

�Menor “Origin” (IGP < EGP < incomplete)

�Menor MED�Externa sobre “confederation” sobre interna

�Menor métrica do IGP

�Menor “cluster list”

�Menor router-id

Page 43: Tutorial BGP Redes de Internet

43Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 43Tutorial BGP - GTER

Anúncio de rotas BGP - JUNOS

�Regras de anúncio BGP default

� Apenas rotas ativas• Todas as rotas aprendidas via BGP (exceto regra iBGP)• Anúncio de rotas inativas é possível via configuração

� É necessário configuração explícita para:• Anunciar rotas estáticas• Anunciar rotas agregadas• Anunciar rota default• Redistribuir rotas no BGP

Page 44: Tutorial BGP Redes de Internet

44Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 44Tutorial BGP - GTER

Routing Policy

�Controla as transferências de informações de roteamento entre a tabela de roteamento e cada protocolo de roteamento

� Informação de roteamento entrante pode ser ignorada ou modificada

� Informação de roteamento saínte pode ser suprimida ou modificada

Page 45: Tutorial BGP Redes de Internet

45Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 45Tutorial BGP - GTER

Quando aplicar uma política

�Não se quer importar para a tabela de roteamento todas as rotas aprendidas

�Não se quer anunciar todas as rotas da tabela de roteamento para os roteadores vizinhos

�Se deseja que um protocolo receba rotas a partir de outro protocolo

�Se deseja modificar informações associadas a uma rota

Page 46: Tutorial BGP Redes de Internet

46Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 46Tutorial BGP - GTER

Routing Policy

� Políticas de entrada afetam o que vai para a tabela de roteamento

� Políticas de saída manipulam o conteúdo da tabela de roteamento que é exportado

��������

������

���������� �

������������� �

��������

������

��������� ������

����� �����

��

��������� ������

��������� ������

��������� ������

Page 47: Tutorial BGP Redes de Internet

47Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 47Tutorial BGP - GTER

Sintaxe de uma política no JUNOS

�Sintaxe básicapolicy-options {

policy-statement nome-politica {term nome-termo {

from {condicao-de-match;

}to {

condicao-de-match;}then {

acao;}

}acao-final;

}}

���������� ������� ������������������������! ��� ���! ��� ������������

Page 48: Tutorial BGP Redes de Internet

48Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 48Tutorial BGP - GTER

Visualização de rotas BGP

� Rotas recebidas de um peer antes de aplicar uma policy

� Rotas anunciadas para um peer específicouser@host> show route advertising-protocol bgp 11.1.1.2

inet.0: 10 destinations, 10 routes (8 active, 0 holddown, 2 hidden)

Prefix Nexthop MED Lclpref AS path

10.0.0.0/8 Self 100 I

172.16.0.0/12 Self 100 I

user@host> show route receive-protocol bgp 11.1.1.1

inet.0: 6 destinations, 6 routes (5 active, 0 holddown, 1 hidden)

Prefix Nexthop MED Lclpref AS path

10.0.0.0/8 11.1.1.1 100 I

172.16.0.0/12 11.1.1.1 100 I

Page 49: Tutorial BGP Redes de Internet

49Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 49Tutorial BGP - GTER

Políticas muito utilizadas

� Filtro de rotas “marcianas”� Filtros de tamanho de prefíxo

�Anuncia agregado e suprime específicas

�Preferência por rotas de clientes sobre qualquer outra

�Preferência por rotas de peers sobre rotas de trânsito

�Marcação de rotas com communities

Page 50: Tutorial BGP Redes de Internet

50Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 50Tutorial BGP - GTER

Communities

�Marcação dada a um grupo de prefixos que partilham uma propriedade em comum

�Decisões de roteamento podem estar baseadas na community da rota

� Facilita e simplifica o controle das informações de rotas

�Deveria ser marcada pelo roteador de entrada

�RFC 1997 and 1998

Page 51: Tutorial BGP Redes de Internet

51Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 51Tutorial BGP - GTER

Well Known Communities

�NO_EXPORT (0xFFFFFF01)

� Não anuncia para outros peers eBGP�NO_ADVERTISE (0xFFFFFF02)

� Não anuncia para nenhum peer�NO_EXPORT_SUBCONFED (0xFFFFFF03)

� Não anuncia para outros ASs, incluindo membros de uma confederation

Page 52: Tutorial BGP Redes de Internet

52Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 52Tutorial BGP - GTER

Exemplos de Communities

�AS#:120� Rotas de clientes� Marca “local preference” para 120

�AS#:110� Rotas backup de clientes

�AS#:90� Rotas de “Private peer”

�AS#:80� Rotas de trânsito

�AS#:70� Rotas de “Public peer”

Page 53: Tutorial BGP Redes de Internet

53Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 53Tutorial BGP - GTER

Exemplo de configuração

policy-statement TRANSITO-IN {term REJEITA-TAM-PREF {

from policy TAM-PREF;then reject;

}term REJEITA-MARCIANAS {

from policy MARCIANAS;then reject;

}term PERMITE-RESTO {

then {community set TRANSIT-ROUTES;local-preference 80;accept;

}}

}community TRANSIT-ROUTES members 6666:70;

� Inspeção de rotas de entrada

Page 54: Tutorial BGP Redes de Internet

54Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 54Tutorial BGP - GTER

Agregação de rotas� Sumarização de um grupo de rotas com prefixo em

comum

� Reduz a tabela de rotas, anúncios de roteamento e instabilidade

routing-options {aggregate {

route 8.8.0.0/16; {passive;

}}

Page 55: Tutorial BGP Redes de Internet

55Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 55Tutorial BGP - GTER

Agregação de rotas

policy-options {

policy-statement SUPPRESS-SPECIFICS {

from route-filter 8.8/16 longer reject;

}

� Supressão explícita das rotas contribuíntes

� Atributo “atomic-aggregate”

� Indica perda de informação devido à agregação� Atributo “aggregator”

� Especifica o nº do AS e o router-id do roteador agregador

� RFC 2519

Page 56: Tutorial BGP Redes de Internet

56Tutorial BGP - GTER

Escalando o iBGP Full Mesh

Page 57: Tutorial BGP Redes de Internet

57Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 57Tutorial BGP - GTER

Escalando o iBGP Full Mesh

�Problema N2

� 1 roteador novo deve possuir peer com todos os outros. Os outros devem adicionar peer com o roteador novo

�Adiciona sobrecarga de processamento TCP

�Aumenta tamanho das tabelas de roteamento� 2 métodos para escalar

� Route Reflection (RFC 2796)

� Confederations (RFC 1965)

Page 58: Tutorial BGP Redes de Internet

58Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 58Tutorial BGP - GTER

Route Reflection

�Permite um peer iBGP anunciar uma rota aprendida via iBGP para outro peer iBGP

�Reduz iBGP full mesh

�RR apenas reflete o melhor caminho

�RR não modifica os atributos BGP

Page 59: Tutorial BGP Redes de Internet

59Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 59Tutorial BGP - GTER

AS 9999AS 8888 AS 7777

Route Reflection

iBGP Full Mesh Peering

RR Peering

Page 60: Tutorial BGP Redes de Internet

60Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 60Tutorial BGP - GTER

Route Reflection � Isso não cria a possibilidade de loops?

�Novos atributos

� Cluster-id • Identifica o “route reflection cluster”• Adicionado à rota pelo RR

� Cluster-list• Sequência de cluster-ids que um update

atravessou • Similar ao AS-path list

� Originator-id• Identifica o roteador que originou a rota no AS• Adicionado à rota pelo RR

Page 61: Tutorial BGP Redes de Internet

61Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 61Tutorial BGP - GTER

Exemplo de Configuração

routing-options {autonomous-system 6666;

}protocols {

bgp {damping;

group ibgp-mesh {export [ nexthopself send-connected ];local-address 8.8.254.253;peer-as 6666;neighbor 1.2.3.4;neighbor 2.3.4.5;neighbor 3.4.5.6;

}group rr-cluster {

cluster 1.1.1.1;export [ nexthopself send-connected ];local-address 8.8.254.253;peer-as 6666;neighbor 4.5.6.7;

Page 62: Tutorial BGP Redes de Internet

62Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 62Tutorial BGP - GTER

RJO

CTAPAE

SDR

Full iBGP Mesh

Route Reflection

SPO

BSA

RRCluster1.1.1.1

RRCluster2.2.2.2

eBGP Peering

AS 7777

Route Reflection

Page 63: Tutorial BGP Redes de Internet

63Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 63Tutorial BGP - GTER

Route Reflection redundante

�É possível fazer full-mesh de clientes de um RR

� No-client-reflect• RR não reflete rotas intra-cluster

Page 64: Tutorial BGP Redes de Internet

64Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 64Tutorial BGP - GTER

Confederations

�Outro método de reduzir o iBGP full mesh�Quebra o AS em múltiplos sub-ASs

�Sub-ASs

� Podem utilizar número de AS privados

� iBGP full mesh dentro do sub-AS ou RR�AS é visto externamente como único AS

�Sub-ASs não contabilizados como AS-path hops

Page 65: Tutorial BGP Redes de Internet

65Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 65Tutorial BGP - GTER

RJO

SDR

Full iBGP Mesh

Route Reflection

eBGP Peering

Confederations

Confederation 6666Central Sub-AS 65100

(ISIS)

SPO POPSub-AS65102

(OSPF)

PAE POPSub-AS

65101 (ISIS)

Peer ISPPeer ISP

Peer ISP

Peer ISP Clientes

Clientes

Page 66: Tutorial BGP Redes de Internet

66Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 66Tutorial BGP - GTER

Confederation BGP

� cBGP (ou e-iBGP)

� É eBGP ou iBGP?�BGP nexthop�AS-path

� Local-preference

Page 67: Tutorial BGP Redes de Internet

67Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 67Tutorial BGP - GTER

Confederations/RRs� Vantagens de confederations sobre RR?

� Anexação de outro ISP

� Pode facilitar a migração/integração de redes adquiridas

� Pode rodar múltiplos IGPs� Desvantagens

� Migração abrupta de uma rede iBGP full mesh

� Aparenta ser um pouco mais complicado

� Roteamento sub-ótimo dentro da confederation

Page 68: Tutorial BGP Redes de Internet

68Tutorial BGP - GTER

Novas Funcionalidades no BGP v4

Page 69: Tutorial BGP Redes de Internet

69Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 69Tutorial BGP - GTER

Negociação de Capacidades

�Permite negociação de capacidades entre peers BGP

�RFC 1771

� Se a mensagem de Open contém funcionalidade não suportada, envia Notification com subcode 4 “Unsupported Optional Parameter” e termina sessão

� Não facilita a introdução de novas funcionalidade no BGP

�RFC 2842

Page 70: Tutorial BGP Redes de Internet

70Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 70Tutorial BGP - GTER

Communities Estendidas

�Duas melhorias importantes� Faixa estendida (4 para 8 octetos)� Adiciona campo TYPE (2 octetos)

�Route target community� Identifica o destino da rota

�Route origin community� Identifica a origem da rota

�Utilizada para controlar a distribuição de MPLS VPNs

� draft-ramachandra-bgp-ext-communities-04.txt

Page 71: Tutorial BGP Redes de Internet

71Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 71Tutorial BGP - GTER

Communities Estendidas

[edit]policy-options {

community test-a members [target:9999:70];community test-b members [target:1.1.1.1:90];community test-c members [origin:6666:110];

}

Page 72: Tutorial BGP Redes de Internet

72Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 72Tutorial BGP - GTER

Capacidade de Route Refresh

� Forma dinâmica de requisitar o re-anúncio de rotas de um peer

� JUNOS guarda cópias inalteradas de todas as rotas na RIB-In

� draft-ietf-idr-bgp-route-refresh-01.txt

user@host> clear bgp neighbor 11.1.1.1 soft-inbound

user@host> show route receive-protocol bgp 11.1.1.1

Page 73: Tutorial BGP Redes de Internet

73Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 73Tutorial BGP - GTER

MBGP

�Extensão que permite o BGP carregar informação de múltiplas camadas de rede e famílias de endereços

�Utilizado para Multicast

�Utilizado pelo MPLS VPNs para carregar labels

� MP_REACH_NLRI• VPN-IPv4 + Label

user@host# set nlri [ multicast | unicast | any ]

Page 74: Tutorial BGP Redes de Internet

74Tutorial BGP - GTER

Route Damping

Page 75: Tutorial BGP Redes de Internet

75Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 75Tutorial BGP - GTER

Route Damping

�Reduz a carga de “update” para rotas bem comportadas

�Geralmente aplicado para rotas eBGP

� Pode ser usado com confederation�Configurado a partir de um conjunto de

parâmetros que inspecionam a atividade das rotas mal comportadas

�Deve-se habilitar o BGP damping

�Quantos ISPs ainda utilizam damping?

�RFC 2439

Page 76: Tutorial BGP Redes de Internet

76Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 76Tutorial BGP - GTER

AS 8888

AS 7777

Route Flap Damping

Rotas instáveis anunciadas e

removidas pelo AS 7777

AS 8888 aguarda as rotas

estabilizarem para aceitá-las

Page 77: Tutorial BGP Redes de Internet

77Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 77Tutorial BGP - GTER

Damping—Figura de Mérito�Nova rota recebe figura de mérito 0

� Figura de mérito incrementa a cada incidente

� Withdrawn route–1000

� Mudança de atributo–500�Rota é suprimida quando a figura de mérito

excede o limiar de supressão

� Limiar de supressão default é 3000�Rota é reutilizada quando a figura de mérito cai

abaixo do limiar de reutilização

� Limiar de reutilização default é 750

Page 78: Tutorial BGP Redes de Internet

78Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 78Tutorial BGP - GTER

Damping—Figura de Mérito

�Decaimento exponencial

� Reduz a figura de mérito com o tempo

� Half-life default de 15 min� Limite máximo de tempo de supressão

� Default é 60 min� Figura de mérito máxima

� Limita incremento quando o teto é atingido

� Determinado por fórmula

� Não configurável de forma explícita

Page 79: Tutorial BGP Redes de Internet

79Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 79Tutorial BGP - GTER

Route Damping

Figureof Merit

Time

Suppressed

Reused750

3000

1000

2000

Flap 1

Flap 2

Flap 3

Flap 4

Flap 5

Half-life Half-life

Page 80: Tutorial BGP Redes de Internet

80Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 80Tutorial BGP - GTER

Damping—Configuração

�Definição de parâmetros de damping é semelhante à definição de community

policy-options {damping name {

half-life minutes;

max-suppress minutes;

reuse number;

suppress number;

}

}

Page 81: Tutorial BGP Redes de Internet

81Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 81Tutorial BGP - GTER

Damping—Example

policy-options {policy-statement damp {

from {route-filter 11/8 exact damping high;route-filter 15/8 exact damping medium;route-filter 0/0 upto /24 damping none;

}then accept;

}damping high {

half-life 15;suppress 3000;reuse 2500;max-suppress 50;

}damping medium {

half-life 3;max-suppress 4;

}damping none {

disable;}

}

Page 82: Tutorial BGP Redes de Internet

82Copyright © 2003 Juniper Networks, Inc. Proprietary and Confidential www.juniper.net 82Tutorial BGP - GTER

Show BGP Summary

� Informações básicas sobre neighbors BGP

user@host> show bgp summary

Groups: 12 Peers: 26 Unestablished peers: 2

Peer AS InPkt OutPkt OutQ Flaps Last Up/Dn State|#Act/Recv/Damp

131.103.0.2 45 1225 55263 50511 2 18:22:14 47769/50591/67

192.168.1.1 33 911 0 0 0 18:22:27 Active

192.168.1.97 23 10458 2201 41043 0 18:22:03 0/0/0

192.168.1.100 432 10458 163 17643 0 17:01:18 Active

Page 83: Tutorial BGP Redes de Internet

83Tutorial BGP - GTER

Perguntas?

[email protected]

Page 84: Tutorial BGP Redes de Internet

84Tutorial BGP - GTER

Obrigado!