第七章 路由协议原理
什么是路由? 通过查找路由表确定到达目标网络的路径, 进行转发。为此,路由器必须: 发现所有可能的路径 选择最佳路径 维护和管理路由表 Slide 1 of 2 Purpose: This figure introduces students to routing. The router must accomplish the items listed in the figure for routing to occur. Emphasize: Path determination occurs at Layer 3, the network layer. The path determination function enables a router to evaluate the available paths to a destination and to establish the best path. Routing services use network topology information when evaluating network paths. This information can be configured by the network administrator (static routes) or collected through dynamic processes (routing protocols) running in the network. Transition: How do you represent the path to the packet’s destination?
什么是路由? 通过查看其活动接口的IP地址和网络号,自动生成直连路由 必须学习到达非直连网络的路由(静态路由和动态路由) Slide 2 of 2 Purpose: This figure explains that routers must learn about paths that are not directly connected. Emphasize: The router already knows about directly connected networks. It must learn about those networks that are not connected. This chapter describes how routers learn about those paths. 通过查看其活动接口的IP地址和网络号,自动生成直连路由 必须学习到达非直连网络的路由(静态路由和动态路由)
静态路由和动态路由 静态路由 动态路由 由网络管理员手工输入到路由器中的路由信息 不能适应网络拓扑结构及流量的变化 通过路由选择协议自动学习到的路由 根据网络拓扑或流量的变化,路由协议会自动调整路由信息 Purpose: This figure introduces students to static and dynamic routes. Emphasize: Static knowledge is administered manually—a network administrator enters it into the router’s configuration. The administrator must manually update this static route entry whenever an internetwork topology change requires an update. Static knowledge can be private—by default it is not conveyed to other routers as part of an update process. You can, however, configure the router to share this knowledge. Dynamic knowledge works differently. After the network administrator enters configuration commands to start dynamic routing, route knowledge is updated automatically by a routing process. Whenever new topology information is received from the internetwork, routers update neighbors about the route change.
适用于中、小型的网络,网络不发生频繁变化的场合 静态路由优缺点 优点: 1、对路由器CPU没有管理性开销 2、在路由器间没有带宽占用 3、增加安全性 缺点: 1、必须真正了解网络拓扑 2、对于新添网络配置繁琐 3、对于大型网络工作量巨大 适用于中、小型的网络,网络不发生频繁变化的场合
静态路由配置命令 省略子网掩码则使用分类网络默认的子网掩码 任何时候指定下一跳路由器IP地址都是允许的,但对于点到点链路也可以指定输出接口 Router(config)#ip route network [mask] {address | interface}[distance] [permanent] 省略子网掩码则使用分类网络默认的子网掩码 任何时候指定下一跳路由器IP地址都是允许的,但对于点到点链路也可以指定输出接口 可任意改变静态路由的管理距离。若忽略,则使用静态路由默认的管理距离(1或0) Purpose: This figure describes the command syntax used to establish an IP static route. Emphasize: A static route allows manual configuration of the routing table. No dynamic changes to this table entry will occur as long as the path is active. Routing updates are not sent on a link that is only defined by a static route; hence, conserving bandwidth. The ip route field descriptions are as follows: network—Destination network or subnet mask—Subnet mask address—IP address of next-hop router interface—Name of the interface to use to get to the destination network Transition: The next figure provides a static route configuration example. 静态路由的删除: 2501(config)#no ip route 172.16.1.0 255.255.255.0
Stub Network:末端网络(或称为叶子节点) 静态路由实例 Purpose: This figure gives an example of a static route configuration. 这里仅配置了一条单方向的路由,您还必须配置一条相反方向的路由 Stub Network:末端网络(或称为叶子节点)
静态路由实例 使用缺省路由,末端网络可以到达位于路由器A以外的网络 Purpose: This figure gives an example of a default route configuration. Emphasize: With an address and subnet mask of 0.0.0.0 0.0.0.0 in the ip route statement, packets for any network not listed in the routing table will be sent to the next hop, 172.16.2.2. 使用缺省路由,末端网络可以到达位于路由器A以外的网络
缺省静态路由 缺省路由就是在没有找到任何匹配的路由项情况下,才使用的路由。即只有当无任何合适的路由时,缺省路由才被使用。 在路由表中,缺省路由以到网络0.0.0.0(掩码为0.0.0.0)的路由形式出现。 缺省路由,通常用于stub network的外出连接,安全性不好。 Router(config)#ip route 0.0.0.0 0.0.0.0 s0
在使用了缺省路由时,必须添加ip classless命令。 缺省情况下,路由器都是有类的。图中路由器会想当然认为网络10.0.0.0/8和自己是直连的,包括子网10.3.3.0/24。若路由表中没有10.3.3.0/24的路由项,则认为该子网目前没有使用。因此收到目标为10.3.3.0/24的数据包,必然会丢弃,而不是使用缺省路由。 在使用了缺省路由时,必须添加ip classless命令。 Enabled by default in Cisco IOS Software Release 11.3 and later.
验证静态路由的配置 10.0.0.0/8 is subnetted, 1 subnets router#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route Gateway of last resort is 0.0.0.0 to network 0.0.0.0 10.0.0.0/8 is subnetted, 1 subnets C 10.1.1.0 is directly connected, Serial0 S* 0.0.0.0/0 is directly connected, Serial0 Slide 2 of 6 Purpose: This figure shows how the show frame-relay LMI command is used to verify the LMI type used for signaling. Emphasize: Describe the highlighted output to the students.
什么是路由协议? 路由协议 用于路由器选择路径和管理路由表(提供交通线路信息) 一旦选择了一条路径后,路由器将路由被路由协议(数据包的运输工具) Network Protocol Destination Network Connected RIP IGRP 10.120.2.0 172.16.1.0 172.17.3.0 Exit Interface E0 S0 S1 172.17.3.0 172.16.1.0 10.120.2.0 E0 S0 Purpose: This figure introduces students to routing protocols and compares routing protocols to routed protocols. Emphasize: If network 10.120.2.0 wants to know about network 172.16.2.0, it must learn it from its S0 (or possibly S1) interface. Note: The two routing protocols that will be taught in this course are RIP and IGRP. They are both distance vector routing protocols. 被路由协议:IP,IPX…… 路由协议: RIP, IGRP……
自治系统的概念 AS:由同一机构管理控制下的一组网络。 IGPs:在单个自治系统中处理路由选择的路由协议 EGPs:在不同自治系统间处理路由选择的路由协议,目前仅有BGP一个。
管理距离(路由的可信度) 管理距离主要用于不同路由协议之间的可信度,其范围是0~255,该值越小,可信度越高。 直连路由:0 静态路由:1或0 EIGRP:90 IGRP:100 OSPF:110 RIP:120 默认值 Router B Router A Purpose: This figure introduces administrative distance. Emphasize: An administrative distance is a rating of the trustworthiness of a routing information source, such as an individual router or a group of routers. In a large network, some routing protocols and some routers can be more reliable than others as sources of routing information. The default administrative distance for static routes and various routing protocols is listed in the student guide. The lower the distance, the more trustworthy the route is. For example, in the figure, the packet would learn the route learned via IGRP. E Router C Router D 5
管理距离(路由的可信度) 5 IGRP Administrative Distance=100 RIP Administrative Router D Router B Router A Router C RIP Administrative Distance=120 E I need to send a packet to Network E. Both router B and C will get it there. Which route is best? Purpose: This figure introduces administrative distance. Emphasize: An administrative distance is a rating of the trustworthiness of a routing information source, such as an individual router or a group of routers. In a large network, some routing protocols and some routers can be more reliable than others as sources of routing information. The default administrative distance for static routes and various routing protocols is listed in the student guide. The lower the distance, the more trustworthy the route is. For example, in the figure, the packet would learn the route learned via IGRP. 5
路由协议分类 距离矢量:RIPv1、IGRP 混合协议:EIGRP 链路状态:OSPF、IS-IS Purpose: This figure introduces the three classes of routing protocols. Emphasize: There is no single best routing protocol. Note: Distance vector routing protocol operation is covered in detail later in this course. Link state and hybrid are only briefly explained after the distance vector discussion. Refer students to the ACRC to learn more about link-state and hybrid routing protocols. 链路状态:OSPF、IS-IS
有类的路由协议 通告路由信息时不携带子网掩码 不支持VLSM(同一个有类网络中,只可以使用一个子网掩码) 路由通告穿过有类边界时,自动汇总到有类网络号 不支持不连续子网设计 有类路由协议的例子: RIPv1 IGRP
无类路由协议 通告路由信息时携带子网掩码 支持VLSM 支持手动路由汇总 支持不连续子网设计(但不推荐) 无类路由协议的例子: RIPv2 EIGRP OSPF IS-IS
各种路由协议比较