BGP协议基础PPT课件.ppt_第1页
BGP协议基础PPT课件.ppt_第2页
BGP协议基础PPT课件.ppt_第3页
BGP协议基础PPT课件.ppt_第4页
BGP协议基础PPT课件.ppt_第5页
已阅读5页,还剩57页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

BGP BorderGatewayProtocol BGP的应用环境BGP的工作方法摘要BGP邻居关系的建立BGP进阶BGP属性的应用简化BGP的配置提高网络的稳定性构造大型BGP网络 1 缺点1 没有发现路由环路的能力缺点2 不支持复杂的基于策略的路由缺点3 不能充分地与IGP互相合作缺点4 公布网络变化相当慢 BGP的前任 EGP 2 Internet ISP 1 ISP 2 ISP 3 n3 n4 n1 n2 n5 n6 n3 n4 n1 n2 n5 n6 n5 n6 n1 n2 n3 n4 EBGPIBGP路由数据 BGP的应用环境 穿透域 3 BGP工作方法摘要 在自治系统 AS 之间传递路由信息使用TCP协议保证信息传递的可靠性 179 使用OPEN信息建立邻居关系使用UPDATE信息传递路由信息使用KEEPALIVE信息保持邻居关系使用NOTIFICATION报告错误 中止邻居关系维护一张带有版本号的BGP表 在路由更新时增加版本号路由器根据BGP表中各表项的值计算到接邻AS的路由 4 Internet AS3 AS56 AS251 n3 n4 n1 n2 n5 n6 EBGP EBGP IBGP R1 R2 R4 R5 R3 BGP邻居关系的建立 邻居 5 BGP邻居关系的建立 AS号 自治域的标号两个字节的无符号整数 0 65535 64512 65535是私有自治域号具有相同AS号的邻居建立IBGP关系具有不同AS号的邻居建立EBGP关系 6 BGP邻居关系的建立 状态机 空闲 Idle 连接 Connect 活动 Active 开放发送 OpenSent 开放确认 OpenConfirm 连接建立 Established 7 BGP邻居关系的建立 消息 OPEN 协商BGP邻居的各项参数UPDATE 进行路由信息的交换NOTIFICATION 报告错误KEEPALIVE 维持邻居关系 8 BGP邻居关系的建立 Open消息格式 9 UnfeasibleRouteLength 2bytes WithdrawRoutes variable TotalAttributeLength 2bytes Attributes variable 网络层可到达性信息 NetworkLayerReachabilityInformation Length 1byte Prefix variable 不可到达路由信息 属性信息 BGP邻居关系的建立 Update消息格式 10 BGP邻居关系的建立 Update消息规则 在消息中可以撤销多条路由在消息中通告的多条路由一定要具有相同的属性 11 AS100 RT1 33 0 24 L1 3 3 3 3 32 L1 1 1 1 1 32 L1 2 2 2 2 32 11 1 24 地址空间 200 200 x x RT2 AS200 RT3 23 3 24 23 2 24 interfaceloopback1ipaddress1 1 1 1 24routerbgp100bgprouter id1 1 1 1neighbor200 200 13 2remote as100network200 200 11 0 24 13 1 24 13 2 24 interfaceloopback1ipaddress2 2 2 2 24routerbgp100bgprouter id2 2 2 2neighbor200 200 13 1remote as100neighbor200 200 23 3remote as200 interfaceloopback1ipaddress3 3 3 3 24routerbgp200bgprouter id3 3 3 3neighbor200 200 23 2remote as100network200 200 33 0 24 EBGP IBGP BGP邻居关系的建立 基本配置 12 AS3 AS56 AS251 EBGP EBGP IBGP R1 R2 R6 R5 R4 R3 L1 5 5 5 5 32 L1 6 6 6 6 32 L1 3 3 3 3 32 BGP邻居关系的建立 多跳 13 AS3 AS56 AS251 EBGP EBGP IBGP R1 R2 R6 R5 R4 R3 L1 5 5 5 5 32 L1 6 6 6 6 32 L1 3 3 3 3 32 neighborpeer addressebgp multihop ttl BGP邻居关系的建立 多跳 14 RouterA config showipbgpneiBGPneighboris200 200 13 2 remoteAS100 localAS100 internallinkBGPversion4 remoterouterID2 2 2 2BGPstate Established upfor00 00 06Lastread00 00 06Holdtimeis180 keepaliveintervalis60secondsNeighborcapabilities Routerefresh advertisedandreceived oldandnew AddressfamilyIPv4Unicast advertisedandreceivedReceived2messages 0notifications 0inqueueSent4messages 0notifications 0inqueue1 0inqueue2 debugipbgpeventsdebugipbgpkeepalives BGP邻居关系的建立 验证 15 AS3 AS56 AS251 EBGP IBGP R2 R6 R5 R4 R3 L1 5 5 5 5 32 L1 6 6 6 6 32 L1 3 3 3 3 32 EBGP 200 200 2 0 24 R6路由表 200 200 2 0 245 5 5 5 R5的BGP表 200 200 2 0 24200 200 23 2 200 200 23 2 24 200 200 23 3 24 R3的BGP表 200 200 2 0 24200 200 23 2 BGP进阶 下一跳 16 R4 R5 R3 10 10 10 0 24 OSPF 3 4 5 EBGP 11 11 11 0 24 R3的BGP表 11 11 11 0 2410 10 10 5 BGP进阶 下一跳 广播环境 17 R4 R5 R3 10 10 10 0 24 OSPF 3 4 5 EBGP 11 11 11 0 24 R3的BGP表 11 11 11 0 2410 10 10 5 R4 router config neighbor10 10 10 3next hop self BGP进阶 下一跳 NBMA环境 18 AS3 AS251 IBGP R2 R5 R4 R3 L1 5 5 5 5 32 L1 3 3 3 3 32 EBGP 200 200 2 0 24 R5的BGP表 200 200 2 0 24200 200 23 2 200 200 23 2 24 200 200 23 3 24 R3的BGP表 200 200 2 0 24200 200 23 2 Next hop self R5的BGP表 200 200 2 0 243 3 3 3 到底选用哪种方式取决于想不想与DMZ区通信 BGP进阶next hop self与DMZ宣告 19 AS3 AS56 AS251 EBGP IBGP R2 R6 R5 R4 R3 L1 5 5 5 5 32 L1 6 6 6 6 32 L1 3 3 3 3 32 EBGP 200 200 2 0 24 200 200 2 0 24 BGP进阶 同步开关 20 AS3 AS56 AS251 EBGP IBGP R2 R6 R5 R4 R3 L1 5 5 5 5 32 L1 6 6 6 6 32 L1 3 3 3 3 32 EBGP 200 200 2 0 24 R6路由表 200 200 2 0 245 5 5 5 R5路由表 200 200 2 0 24200 200 23 2 200 200 23 2 24 200 200 23 3 24 R4路由表 没有200 200 2 0 24路由 R3路由表 200 200 2 0 24200 200 23 2 BGP进阶 同步开关 续 21 BGP进阶 同步开关 续 问题解决方法 所有路由器都跑IBGP把BGP路由重分布到IGP中 22 AS3 AS251 OSPF IBGP R2 R5 R4 R3 L1 5 5 5 5 32 L1 3 3 3 3 32 EBGP R3 router config Redistributeospf BGP进阶 向BGP注入路由 纯动态 使用redistribute命令把IGP路由发往BGP缺点是IGP的不稳定会造成BGP内的路由动荡另一缺点是可能引入错误的路由一般不采用 23 AS3 AS251 OSPF IBGP R2 R5 R4 R3 L1 5 5 5 5 32 L1 3 3 3 3 32 EBGP R3 router config network5 5 5 5 32 BGP进阶 向BGP注入路由 半动态 使用network命令把IGP路由发往BGP对发出的路由进行了有效的控制 稳定性有所增强 24 AS3 AS251 OSPF IBGP R2 R5 R4 R3 L1 5 5 5 5 32 L1 3 3 3 3 32 EBGP R3 router config network5 5 5 5 32R3 config iproute5 5 5 5 32eth1 0 E1 0 2 2 34 3 24 BGP进阶 向BGP注入路由 静态 使用network及静态路由命令把IGP路由发往BGP增强了稳定性损失了准确性 25 r2 r5 r4 OSPFarea0 OSPFAreaG r1 RIPVersion2 OSPFArea 16 G ASG Inte0 1 123 2 24 Inte0 6 12 2 24 Inte0 7 12 1 24 Inte0 2 123 3 24 Inte0 0 123 1 24 Inte0 4 35 3 24 E0 0 35 5 24 Inte0 3 34 3 24 E0 0 34 4 24 172 16 0 G 24 r3 RR r6 R3 config Routerbgp1R3 config RedistributeospfR3 config RedistributeripR3 config Redistributecon BGP进阶 路由聚合 26 未聚合前R1上的路由 r011 config showipbgpBGPtableversionis0 localrouterIDis172 17 1 1Statuscodes ssuppressed ddamped hhistory valid best i internalOrigincodes i IGP e EGP incompleteNetworkNextHopMetricLocalPrfPath i172 17 2 2 32172 17 123 22100 i172 17 3 3 32172 17 3 30100 i172 17 4 4 32172 17 34 42100 i172 17 5 5 32172 17 35 51100 i172 17 34 0 24172 17 3 30100 i172 17 35 0 24172 17 3 30100 i172 17 123 0 24172 17 3 30100 172 17 210 210 320 0 0 00i i172 17 220 220 32172 17 2 2100i i172 17 230 230 32172 17 3 3100iTotalnumberofprefixes10 BGP进阶 路由聚合 续 27 未聚合前R6上的路由 r052 config showipbgpBGPtableversionis0 localrouterIDis172 21 2 2Statuscodes ssuppressed ddamped hhistory valid best i internalOrigincodes i IGP e EGP incompleteNetworkNextHopMetricLocalPrfPath 172 17 2 2 32172 16 0 181 172 17 3 3 32172 16 0 181 172 17 4 4 32172 16 0 181 172 17 5 5 32172 16 0 181 172 17 34 0 24172 16 0 181 172 17 35 0 24172 16 0 181 172 17 123 0 24172 16 0 181 172 17 210 210 32172 16 0 1801i 172 17 220 220 32172 16 0 181i 172 17 230 230 32172 16 0 181iTotalnumberofprefixes10 BGP进阶 路由聚合 续 28 使用aggregate address命令聚合路由routerbgp1bgprouter id172 17 1 1nosynchronizationnetwork172 17 210 210 32aggregate address172 17 0 0 16summary onlyneighbor172 16 0 17remote as5neighbor172 17 3 3remote as1neighbor172 17 3 3update sourceloopback1 BGP进阶 路由聚合 续 29 聚合后R1上的路由 r011 config showipbgpBGPtableversionis0 localrouterIDis172 17 1 1Statuscodes ssuppressed ddamped hhistory valid best i internalOrigincodes i IGP e EGP incompleteNetworkNextHopMetricLocalPrfPath 172 17 0 00 0 0 0is i172 17 2 2 32172 17 123 22100 s i172 17 3 3 32172 17 3 30100 s i172 17 4 4 32172 17 34 42100 s i172 17 5 5 32172 17 35 51100 s i172 17 34 0 24172 17 3 30100 s i172 17 35 0 24172 17 3 30100 s i172 17 123 0 24172 17 3 30100 s 172 17 210 210 320 0 0 00is i172 17 220 220 32172 17 2 2100is i172 17 230 230 32172 17 3 3100iTotalnumberofprefixes11 BGP进阶 路由聚合 续 30 聚合后R6上的路由 r052 config showipbgpBGPtableversionis0 localrouterIDis172 21 2 2Statuscodes ssuppressed ddamped hhistory valid best i internalOrigincodes i IGP e EGP incompleteNetworkNextHopMetricLocalPrfPath 172 17 0 0172 16 0 181iTotalnumberofprefixes1 BGP进阶 路由聚合 续 31 AS2 AS1 R1 R2 R4 R3 E0 1 192 68 6 2 EBGP E0 1 192 68 6 1 192 68 10 1 E0 0 192 68 5 2 192 68 5 1 172 16 65 1 172 16 1 2 172 16 1 1 L0 172 16 2 254 32 172 16 20 2 E0 0 172 16 20 1 EBGP IBGP AS3 OSPF R3 showiprouteB192 68 10 0 24 20 0 via172 16 20 2 BGP进阶 后门 backdoors 32 BGP属性 概论 BGP属性是描述一个路由特性的一组参数 BGP根据路由的属性选择最佳路由属性分为四大类 公认必遵 Well knownmandatory 公认自决 Well knowndiscretionary 可选过渡 Optionaltransitive 可选非过渡 Optionalnon transitive 33 BGP属性 概论 续 OriginAS PathNexthopMEDLocal PreferenceAtomic AggregateAggregatorCommunityOriginator IDCluster List 34 AS3 AS251 OSPF IBGP R2 R5 R4 R3 L1 5 5 5 5 32 L1 3 3 3 3 32 EBGP 使用redistribute命令分布44 44 44 0 24到BGP 用network宣告22 22 22 0 24到BGP 使用network命令宣告5 5 5 5 32到BGP BGP属性 Origin 属于Well knownmandatory类型IGP 路由是用network命令注入到BGP路由表中的EGP 路由是通过EBGP得知的Incomplete 路由是用redistribute命令注入到BGP路由表中的优先级是IGP EGP Incomplete 优先级高的进入路由表 35 IBGP IBGP IBGP EBGP EBGP AS2 AS5 AS1 ASPath ASSequ41 18 0 0 0 8 18 0 0 0 8 ASSequ41ASSequ321 AS4 AS3 ASPath ASSequ321 R1 R2 R3 BGP属性 AS PATH 36 BGP属性 AS PATH 续 属于Well knownmandatory类型用在EBGP 防止路由环路用于控制路由AS PATH越短 优先级越高 37 R2 config route map1permit5R2 config route map setas pathprepend44R2 config routerbgp5R2 router config neighbor4 4 4 4remote as3R2 router config neighbor4 4 4 4route map1in IBGP IBGP IBGP EBGP EBGP AS2 AS5 AS1 18 0 0 0 8 AS4 AS3 ASPath ASSequ321 R1 R2 R3 ASPath ASSequ4441 18 0 0 0 8 ASSequ4441 ASSequ321 BGP属性 AS PATH例1 38 IBGP IBGP IBGP EBGP EBGP AS2 AS5 AS1 18 0 0 0 8 AS4 AS3 ASPath ASSequ321 R1 R2 R3 ASPath ASSequ4441 18 0 0 0 8 ASSequ4441 ASSequ321 R2 config ipas pathaccess list1deny 1 R2 config ipas pathaccess list1permit R2 config routerbgp5R2 config router neighbor4 4 4 4remote as3R2 config router neighbor4 4 4 4filter list1in BGP属性 AS PATH例2 39 正则表达式 RegularExpress BGP属性 AS PATH 40 AS3 AS4 5 0 0 0 8 1 1 1 1 1 1 1 2 1 1 1 3 3 1 1 1 3 1 1 2 2 1 1 1 2 1 1 2 4 1 1 1 属于Well knownmandatory类型 AS2 AS1 5 0 0 0 8NextHop 3 1 1 1 8 5 0 0 0 8NextHop 3 1 1 1 8 5 0 0 0 8NextHop 1 1 1 1 8 5 0 0 0 8NextHop 1 1 1 1 8 BGP属性 Next hop 41 NextHop 4 4 4 4 8 RC AS1 AS2 RB RD MED 50 MED 200 MED 120 128 213 0 0 16 AS3 R1 R3 R2 R4 BGP属性 MED 属于Optional nontransitive属性优选较低的 除非配置了 always compare med 其它时候永远只比较来自同一AS的路径 不跨AS传播 42 IBGP IBGP IBGP EBGP EBGP AS2 AS5 AS1 18 0 0 0 8 AS4 AS3 Localpref 200 R1 R2 R3 Localpref 100 18 0 0 0 8 LocalPref200LocalPref100 BGP属性 Localpreference 属于well knowndiscretionary属性优选较高值 只在自治域内有效 43 BGP属性 Atomic Aggregate 属于well knowndiscretionary属性在路由聚合时用于表示信息的缺失当路由聚合时能够携带 AS set 信息时就不需再附加此属性 44 AS3 R3 192 213 1 0 24 AS1 R1 192 213 2 0 24 AS2 R2 Router id 193 0 34 1 ATOMIC AGGREGATE 192 213 0 0 22AGGREGATOR 2 193 0 34 1 BGP属性 Aggregator 属于Optionaltransitive属性它说明了进行路由聚合操作的路由器这个值通常是路由器ID 45 AS3 AS4 5 0 0 0 86 0 0 0 87 0 0 0 8 匹配1 80 匹配1 80匹配1 100 AS4只需要B类路径 AS3需要所有路径 设置团体属性 A类路径 5 0 0 0 8 1 100B类路径 6 0 0 0 8 1 80B类路径 7 0 0 0 8 1 80 AS1 AS2 BGP属性 Community 46 BGP属性 Community 续 属于Optionaltransitive类型一组有相同性质的目的地 一种给路由打标记的方法 用来实现路由过滤和路由选择长度为4个字节 表示为aa nn两个公认的community No export 不通告给AS外的BGP邻居No advertise 不通告给任何BGP邻居 47 BGP属性 Originator ID Cluster List 属于Optionalnontransitive类型被用于路由反射器环境中保证没有路由循环Originator ID指出本AS中产生此路由的路由器ID当一个路由反射器向cluster外部的非客户端发送一条路由时就将自己的Cluster ID附在这个列表里 48 BGP路由的决策过程 如果路由的下一跳地址不可达 则丢弃该路由具有更大的local pref值的路由具有更短的AS PATH的路由具有最优Origin类型的路由具有更低MED的路由在AS内部遵从最优的IGP路由到达EBGP邻居的下一跳地址具有更低路由器ID发来的路由 49 IBGP R1 R2 R3 R4 R5 AS100 AS200 EBGP 简化BGP的配置 对等组 对等组 peergroup 的作用是简化配置不影响实际的邻居关系的建立与路由的传递方式 50 没有使用对等组时的R1配置Routerbgpneighbor5 5 5 5remote as200neighbor2 2 2 2remote as100neighbor2 2 2 2filter list1inneighbor2 2 2 2update sourcelo0neighbor3 3 3 3remote as100neighbor3 3 3 3filter list1inneighbor3 3 3 3update sourcelo0neighbor4 4 4 4remote as100neighbor4 4 4 4filter list1inneighbor4 4 4 4update sourcelo0 使用对等组时的R1配置Routerbgpneighbor5 5 5 5remote as200neighborIBGPpeer groupneighborIBGPremote as100neighborIBGPfilter list1inneighborIBGPupdate sourcelo0neighbor2 2 2 2peer groupIBGPneighbor3 3 3 3peer groupIBGPneighbor4 4 4 4peer groupIBGP 简化BGP的配置 对等组 例子 51 为了解决Full mash的IBGP所带来的问题 13个路由器需要建立78IBGP会话 IBGP会话数 n n 1 2 简化BGP的配置 路由反射器 52 AS65000 A X C B RouteReflector AS65000 C A B 保持IBGP路由的属性 简化BGP的配置 路由反射器的行为 53 概念 client client nonclient AS100 client AS200 简化BGP的配置 路由反射器的规则 RR从clients和nonclients收路由更新从client收到的更新 反射到nonclients和clients从nonclient收到的更新 反射到clients从EBGP邻居收到的更新 反射到所有nonclients和clients 54 routerbgp65000neighbor172 16 12 1remote as65000neighbor172 16 12 1route reflector clientneighbor172 16 17 2remote as65000neighbor172 16 17 2route reflector client AS65500 AS65000 172 16 12 1 RouteReflector 172 16 17 2 B A AS64500 C 简化BGP的配置 路由反射器的配置 55 惩罚值 时间 抑止门限 再使用门限 被抑止 提高网络的稳定性 路由衰减 引入了惩罚值的概念 对频繁更新的路由 惩罚值到一定程度后抑止该路由 直至其恢复稳定方可重新投入使用

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论