Wandering's Blog » 日志 » BGP :: BGP 学习笔记
BGP :: BGP 学习笔记
Wandering 发表于 2008-04-22 16:00:14
.
这次 BGP 的学习是直接看的英文版的 Routing TCP/IP Volume 2,看的效率那叫一个低,不停地用 stardict 翻译着自己不理解的单词或词组,时不时的还要去 dict.cn 或百度百科查一查资料,而直到现在,我还对 multihoming 一词不明所已。
BGP 对我来说太抽象了,中午利用吃饭的时间向一位朋友请教他对 BGP 的理解和感受,让我知道了一些 BGP 的名词,今天又重新阅读了几个章节。同样,是怕自己马上就忘了刚刚想到的内容,还是找个地儿赶快记下来,以便不断修正提高吧。
概念:BGP
---------------------
Border Gateway Protocol,是工作于 Autonomous System 间的 path vector routing protocol。与 IGP 相比较,BGP 是站在 AS 的高度处理路由,在 BGP 眼中,只有一个一个的 AS,而 AS 内部的路由处理是由 IGP 完成的。BGP 使用 unicast 通讯,建立面向 179 端口的 TCP 连接。
谈到这里有些朋友可能会问,那为什么还会有 iBGP 呢? 我的理解是只有在一个 AS 需要作为域间路由的 transit 时,才需要应用 iBGP,简单地说 iBGP 的最终目的是把从一个 exterior AS 学来的路由转发给另外一个 exterior AS。
概念: 为什么 peers of iBGP 要建立 full-mesh 结构?
---------------------------------------------------
目的是为了防止路由环路,BGP 在同一 AS 内传递路由时是不会将自己的 AS number 添加到 AS_PATH 中的,而 AS_PATH 正是 BGP 避免路由环路的关键技术,于是,iBGP 为了保证不出现环路,只将 BGP 路由条目发送给自己的 peers,因此,为了保证 BGP 路由条目的有效传递,必须在 iBGP 路由器之间建立 full-mesh 结构连接。
概念:什么是 iBGP 和 IGP 之间的 synchronization?
---------------------------------------------------
Synchronization 的目的是防止路由黑洞 (preventing for routing black hole)。
Black hole 的产生原因是 BGP 路由与 IGP 路由不一致造成的,BGP 路由器之间通信是依赖于 IGP 的。
其工作方式是 iBGP 路由器如果要将从 peer 学来的 BGP 路由条目加进 IGP 路由表或发给其它 peer,就必须使得本路由器运行 IGP 中存在到达该 BGP 路由条目的路由。从其表现来看,就是一种同步现象。
但这样做最大的问题就是会使 IGP 不得不掌握大量的 BGP 路由信息,往往在大型网络中会造成 IGP 路由器直接 down 掉。
概念:如何解决 synchronization 问题?
----------------------------------------
full-mesh 结构可以解决这个问题,但建立 full-mesh 结构对较多数量的 iBGP routers 环境是个比较恐怖的管理问题。
为了解决 full-mesh 的需要,有两个工具应运而生: route reflectors and confederations
概念: BGP 的 metric 是什么?
----------------------------------------
每种路由协议都有自己的一套 metric 计量标准,OSPF 是 cost,RIP 是 hop,EIGRP 是 bandwidth + loading + delay + reliability + mtu 的一个计算结果,那么 BGP 是用什么来进行 metric 度量呢?
答案是 MED (Multi-Exit Discriminator)。
注意: BGP 中的 network 命令
----------------------------------------
在 BGP 中,准确地说是 EGP 中的 network 命令的意义与 IGP 中是完成不同的。
在 IGP 中,network 的作用使与网段相符的一个或多个接口参与 IGP 路由。
在 BGP 中,network 的作用是将 IGP 路由 inject 进 BGP 路由表中。
A maximum of 200 addresses can be specified with the network command. If you must advertise more addresses across a BGP connection, you must use redistribution. (Reference: Routing TCP/IP, volume II)
eBGP IP packet's TTL
-----------------------
For eBGP connections, Cisco IOS defaults the IP packet’s TTL field to a value of 1, based on the assumption that the interface IP addresses will be used for peering.
Thus, "ebgp-multihop" should be used.
Checks Before Becoming BGP Neighbors
-----------------------------------------
1. The router must receive a TCP connection request with a source address that
the router finds in a BGP neighbor command.
2. A router’s ASN (on the router bgp asn command) must match the neighboring
router’s reference to that ASN with its neighbor remote-as asn command.
(This requirement is not true of confederation configurations.)
3. The BGP RIDs of the two routers must not be the same.
4. If configured, MD5 authentication must pass.
Purposefully Resetting BGP Peer Connections
----------------------------------------------
有 2 种方法:
router(config-router)#neighbor <neighbor> shutdown
router(config-router)#no neighbor <neighbor> shutdown
router#clear ip bgp *
两者都是重置 BGP neighbor 之间的 TCP 连接,并且从 BGP Table 中移除所有从被关闭 neighbor 得来的 entries.
BGP Table
------------
The BGP topology table, also called the BGP Routing Information Base (RIB), holds the network layer reachability information (NLRI) learned by BGP, as well as the associated PAs. An NLRI is simply an IP prefix and prefix length.
auto-summary 对 network 的影响
----------------------------------
在 Cisco IOS 12.3 之后,BGP 默认是关闭 auto-summary 的。
当 auto-summary 关闭时,network 的网段需要在 IP routing table 中精确匹配到才会加入 BGP Table.
当 auto-summary 开启时,network 的网段所属的主类网段,只要 IP routing table 中存在任意该主类网段中的子网,即可加入 BGP Table.
......
这次 BGP 的学习是直接看的英文版的 Routing TCP/IP Volume 2,看的效率那叫一个低,不停地用 stardict 翻译着自己不理解的单词或词组,时不时的还要去 dict.cn 或百度百科查一查资料,而直到现在,我还对 multihoming 一词不明所已。
BGP 对我来说太抽象了,中午利用吃饭的时间向一位朋友请教他对 BGP 的理解和感受,让我知道了一些 BGP 的名词,今天又重新阅读了几个章节。同样,是怕自己马上就忘了刚刚想到的内容,还是找个地儿赶快记下来,以便不断修正提高吧。
概念:BGP
---------------------
Border Gateway Protocol,是工作于 Autonomous System 间的 path vector routing protocol。与 IGP 相比较,BGP 是站在 AS 的高度处理路由,在 BGP 眼中,只有一个一个的 AS,而 AS 内部的路由处理是由 IGP 完成的。BGP 使用 unicast 通讯,建立面向 179 端口的 TCP 连接。
谈到这里有些朋友可能会问,那为什么还会有 iBGP 呢? 我的理解是只有在一个 AS 需要作为域间路由的 transit 时,才需要应用 iBGP,简单地说 iBGP 的最终目的是把从一个 exterior AS 学来的路由转发给另外一个 exterior AS。
概念: 为什么 peers of iBGP 要建立 full-mesh 结构?
---------------------------------------------------
目的是为了防止路由环路,BGP 在同一 AS 内传递路由时是不会将自己的 AS number 添加到 AS_PATH 中的,而 AS_PATH 正是 BGP 避免路由环路的关键技术,于是,iBGP 为了保证不出现环路,只将 BGP 路由条目发送给自己的 peers,因此,为了保证 BGP 路由条目的有效传递,必须在 iBGP 路由器之间建立 full-mesh 结构连接。
概念:什么是 iBGP 和 IGP 之间的 synchronization?
---------------------------------------------------
Synchronization 的目的是防止路由黑洞 (preventing for routing black hole)。
Black hole 的产生原因是 BGP 路由与 IGP 路由不一致造成的,BGP 路由器之间通信是依赖于 IGP 的。
其工作方式是 iBGP 路由器如果要将从 peer 学来的 BGP 路由条目加进 IGP 路由表或发给其它 peer,就必须使得本路由器运行 IGP 中存在到达该 BGP 路由条目的路由。从其表现来看,就是一种同步现象。
但这样做最大的问题就是会使 IGP 不得不掌握大量的 BGP 路由信息,往往在大型网络中会造成 IGP 路由器直接 down 掉。
概念:如何解决 synchronization 问题?
----------------------------------------
full-mesh 结构可以解决这个问题,但建立 full-mesh 结构对较多数量的 iBGP routers 环境是个比较恐怖的管理问题。
为了解决 full-mesh 的需要,有两个工具应运而生: route reflectors and confederations
概念: BGP 的 metric 是什么?
----------------------------------------
每种路由协议都有自己的一套 metric 计量标准,OSPF 是 cost,RIP 是 hop,EIGRP 是 bandwidth + loading + delay + reliability + mtu 的一个计算结果,那么 BGP 是用什么来进行 metric 度量呢?
答案是 MED (Multi-Exit Discriminator)。
注意: BGP 中的 network 命令
----------------------------------------
在 BGP 中,准确地说是 EGP 中的 network 命令的意义与 IGP 中是完成不同的。
在 IGP 中,network 的作用使与网段相符的一个或多个接口参与 IGP 路由。
在 BGP 中,network 的作用是将 IGP 路由 inject 进 BGP 路由表中。
A maximum of 200 addresses can be specified with the network command. If you must advertise more addresses across a BGP connection, you must use redistribution. (Reference: Routing TCP/IP, volume II)
eBGP IP packet's TTL
-----------------------
For eBGP connections, Cisco IOS defaults the IP packet’s TTL field to a value of 1, based on the assumption that the interface IP addresses will be used for peering.
Thus, "ebgp-multihop" should be used.
Checks Before Becoming BGP Neighbors
-----------------------------------------
1. The router must receive a TCP connection request with a source address that
the router finds in a BGP neighbor command.
2. A router’s ASN (on the router bgp asn command) must match the neighboring
router’s reference to that ASN with its neighbor remote-as asn command.
(This requirement is not true of confederation configurations.)
3. The BGP RIDs of the two routers must not be the same.
4. If configured, MD5 authentication must pass.
Purposefully Resetting BGP Peer Connections
----------------------------------------------
有 2 种方法:
router(config-router)#neighbor <neighbor> shutdown
router(config-router)#no neighbor <neighbor> shutdown
router#clear ip bgp *
两者都是重置 BGP neighbor 之间的 TCP 连接,并且从 BGP Table 中移除所有从被关闭 neighbor 得来的 entries.
BGP Table
------------
The BGP topology table, also called the BGP Routing Information Base (RIB), holds the network layer reachability information (NLRI) learned by BGP, as well as the associated PAs. An NLRI is simply an IP prefix and prefix length.
auto-summary 对 network 的影响
----------------------------------
在 Cisco IOS 12.3 之后,BGP 默认是关闭 auto-summary 的。
当 auto-summary 关闭时,network 的网段需要在 IP routing table 中精确匹配到才会加入 BGP Table.
当 auto-summary 开启时,network 的网段所属的主类网段,只要 IP routing table 中存在任意该主类网段中的子网,即可加入 BGP Table.
......
相关日志:
收藏:
QQ书签
del.icio.us
订阅:
Google
抓虾
