Routing Protocol and Concepts หลักสู ตรผูเ้ ชี่ยวชาญระบบโครงข่ายการศึกษาขั้นพื้นฐาน (OBEC Network) © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1 Routing Protocol and Concepts © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 2 Routing Protocol and Concepts ลักษณะการส่ ง Packet ใน IP Network จะส่ งทีละ Hop จาก Network หนึ่ง ไปยังอีก Network หนึ่ง Router จะทาหน้าที่ดงั กล่าว เนื่องจาก Router เป็ นตัวเชื่อมระหว่าง Network การส่ งจะดูที่ส่วน Prefix ของ IP Address ดังนั้น Router จะต้อง Run IP Protocol คือทางานในระดับ Layer 3 ที่ Router จะมีตารางชื่อ Routing Table ที่กาหนด IP Address ของ Next Hop © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 3 Routing Protocol and Concepts Static Routing : หมายถึงตาราง Routing Table ของ Router แต่ละตัว จะไม่เปลี่ยน ปกติตารางนี้จะถูกกาหนดจาก Network Administration คือตารางนี้จะได้จากการทา Configuration ของ Router Dynamic Routing : หมายถึงตาราง Routing Table สามารถเปลี่ยนได้ ตามสภาวะความคับคัง่ ของ Network ขณะนั้นหรื อจากปัจจัยอื่นๆ โดยมันจะมีการ Update ตลอดเวลา © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 4 Routing Protocol and Concepts หน้าที่หลักของ router • การพิจารณาคัดเลือกเส้นทางในการส่ งผ่านข้อมูลไปยัง เครื อข่ายคอมพิวเตอร์อื่น ๆ (Internetworking Device) การ ส่ งผ่านข้อมูลของ Router จะใช้โปรโตคอล IP โดยทางานอยู่ บนระดับชั้นที่ 3 ของแบบจาลอง OSI Model • Routers generally have 2 connections: -WAN connection (Connection to ISP) -LAN connection © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 5 Routing Protocol and Concepts Data is sent in form of packets between 2 end devices Routers are used to direct packet to its destination © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 6 Routing Protocol and Concepts Routers examine a packet’s destination IP address and determine the best path by enlisting the aid of a routing table © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 7 Routing Protocol and Concepts ส่ วนประกอบของ router และ ฟังก์ชนั่ การทางาน • CPU • Random access memory (RAM) • Read-only memory (ROM) • Non-volatile RAM (NVRAM) • Flash memory • Interfaces • -Ethernet / fast Ethernet interfaces • -Serial interfaces • -Management interfaces © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 8 Routing Protocol and Concepts Router components © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 9 Routing Protocol and Concepts กระบวนการทางานของ router • Test router hardware • Power-On Self Test (POST) • Execute bootstrap loader • Locate & load Cisco IOS software • -Locate IOS • -Load IOS • Locate & load startup configuration file or enter setup mode • -Bootstrap program looks for configuration file © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 10 Routing Protocol and Concepts การตรวจสอบข้อมูลของตัว router -The show version command is used to view information about the router during the bootup process. Information includes: • Platform model number • Image name & IOS version • Bootstrap version stored in ROM • Image file name & where it was loaded from • Number & type of interfaces • Amount of NVRAM • Amount of flash • Configuration register © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 11 Routing Protocol and Concepts © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 12 Routing Protocol and Concepts • Router Interface is a physical connector that enables a router to send or receive packets • Each interface connects to a separate network • Consist of socket or jack found on the outside of a router • Types of router interfaces: -Ethernet -Fastethernet -Serial -DSL -ISDN -Cable © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 13 Routing Protocol and Concepts Two major groups of Router Interfaces LAN Interfaces: Are used to connect router to LAN network Has a layer 2 MAC address Can be assigned a Layer 3 IP address Usually consist of an RJ-45 jack WAN Interfaces Are used to connect routers to external networks that interconnect LANs. Depending on the WAN technology, a layer 2 address may be used. Uses a layer 3 IP address © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 14 Routing Protocol and Concepts Routers and the Network Layer Routers use destination IP address to forward packets The path a packet takes is determined after a router consults information in the routing table. After router determines the best path Packet is encapsulated into a frame Frame is then placed on network medium in form of Bits © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 15 Routing Protocol and Concepts Routers Operate at Layers 1, 2 & 3 Router receives a stream of encoded bits Bits are decoded and passed to layer 2 Router de-encapsulates the frame Remaining packet passed up to layer 3 -Routing decision made at this layer by examining destination IP address Packet is then re-encapsulated & sent out outbound interface © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 16 Static Routing หลักสู ตรผูเ้ ชี่ยวชาญระบบโครงข่ายการศึกษาขั้นพื้นฐาน (OBEC Network) © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 17 General Role of the Router Functions of a Router Best Path Selections Forwarding packets to destination Introducing the Topology 3 1800 series routers connected via WAN links Each router connected to a LAN represented by a switch and a PC © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 18 General Role of the Router Connections of a Router for WAN -A router has a DB-60 port that can support 5 different cabling standards Connections of a Router for Ethernet -2 types of connectors can be used: Straight through and Cross- over Straight through used to connect: -Switch-to-Router, Switch-to-PC, Router-to-Server, Hub-toPC, Hub-to-Server Cross-over used to connect: -Switch-to-Switch, PC-to-PC, Switch-to-Hub, Hub-to-Hub, Router-to-Router © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 19 Interfaces Examining Router Interfaces -Show IP router command – used to view routing table -Show Interfaces command – used to show status of an interface -Show IP Interface brief command – used to show a portion of the interface information -Show running-config command – used to show configuration file in RAM © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 20 Interfaces Configuring an Ethernet interface -By default all serial and Ethernet interfaces are down -To enable an interface use the No Shutdown command © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 21 Interfaces Verifying Ethernet interface -Show interfaces for fastEthernet 0/0 – command used to show status of fast Ethernet port -Show ip interface brief -Show running-config Ethernet interfaces participate in ARP © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 22 Interfaces Configuring a Serial interface -Enter interface configuration mode -Enter in the ip address and subnet mask -Enter in the no shutdown command Example: -R1(config)#interface serial 0/0 -R1(config-if)#ip address 172.16.2.1 255.255.255.0 -R1(config-if)#no shutdown © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 23 Interfaces Examining Router Interfaces -Physically connecting a WAN Interface. -A WAN Physical Layer connection has sides: Data Circuit-terminating Equipment (DCE) – This is the service provider. CSU/DSU is a DCE device. Data Terminal Equipment (DTE) – Typically the router is the DTE device. © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 24 Interfaces Configuring serial links in a lab environment One side of a serial connection must be considered a DCE This requires placing a clocking signal – use the clock rate command. Example: -R1(config)#interface serial 0/0 -R1(config-if)#clockrate 64000 Serial Interfaces require a clock signal to control the timing of the communcations. © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 25 Routing Table and CDP Protocol Purpose of the debug ip routing command Allows you to view changes that the router performs when adding or removing routes Example: -R2#debug ip routing -IP routing debugging is on © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 26 Routing Table and CDP Protocol To configure an Ethernet interface Example: -R2(config)#interface fastethernet 0/0 -R2(config-if)#ip address 172.16.1.1 255.255.255.0 -R2(config-if)#no shutdown © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 27 Routing Table and CDP Protocol When a router only has its interfaces configured & no other routing protocols are configured then: -The routing table contains only the directly connected networks -Only devices on the directly connected networks are reachable © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 28 Routing Table and CDP Protocol © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 29 Routing Table and CDP Protocol Checking each route in turn The ping command is used to check end to end connectivity © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 30 Routing Table and CDP Protocol Purpose of CDP A layer 2 cisco proprietary tool used to gather information about other directly connected Cisco devices. Concept of neighbors -2 types of neighbors Layer 3 neighbors Layer 2 neighbors © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 31 Routing Table and CDP Protocol CDP show commands Show cdp neighbors command -Displays the following information: Neighbor device ID Local interface Holdtime value, in seconds Neighbor device capability code Neighbor hardware platform Neighbor remote port ID Show cdp neighbors detail command -Useful in determining if an IP address configuration error © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 32 Routing Table and CDP Protocol Disabling CDP To disable CDP globally use the following command Router(config)#no cdp run © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 33 Static Routes with Exit Interfaces Purpose of a static route A manually configured route used when routing from a network to a stub network © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 34 Static Routes with Exit Interfaces IP route command To configure a static route use the following command: ip route Example: -Router(config)# ip route network-address subnet-mask {ipaddress | exit-interface } © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 35 Static Routes with Exit Interfaces Dissecting static route syntax ip route - Static route command 172.16.1.0 – Destination network address 255.255.255.0 - Subnet mask of destination network 172.16.2.2 - Serial 0/0/0 interface IP address on R2, which is the "next-hop" to this network © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 36 Static Routes with Exit Interfaces Configuring routes to 2 or more remote networks Use the following commands for R1 -R1(config)#ip route 192.168.1.0 255.255.255.0 172.16.2.2 -R1(config)#ip route 192.168.2.0 255.255.255.0 172.16.2.2 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 37 Static Routes with Exit Interfaces Zinin’s 3 routing principles Principle 1: "Every router makes its decision alone, based on the information it has in its own routing table.“ Principle 2: "The fact that one router has certain information in its routing table does not mean that other routers have the same information.“ Principle 3: "Routing information about a path from one network to another does not provide routing information about the reverse, or return path." © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 38 Static Routes with Exit Interfaces Using Zinin’s 3 routing principles, how would you answer the following? -Would packets from PC1 reach their destination? Yes, packets destined for 172.16.1.0/24 and 192.168.1.0/24 networks would reach their destination. -Does this mean that any packets from these networks destined for 172.16.3.0/24 network will reach their destination? No, because neither R2 nor R3 router has a route to the 172.16.3.0/24 network. © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 39 Static Routes with Exit Interfaces Modifying Static routes Existing static routes cannot be modified. The old static route must be deleted by placing no in front of the ip route Example: -no ip route 192.168.2.0 255.255.255.0 172.16.2.2 A new static route must be rewritten in the configuration © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 40 Static Routes with Exit Interfaces Verifying the Static Route Configuration -Use the following commands Step 1 show running-config Step 2 verify static route has been entered correctly Step 3 show ip route Step 4 verify route was configured in routing table Step 5 issue ping command to verify packets can reach destination and that Return path is working © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 41 Static Routes with Exit Interfaces Ethernet interfaces and ARP. – If a static route is configured on an Ethernet link -If the packet is sent to the next-hop router then… the destination MAC address will be the address of the next hop’s Ethernet interface This is found by the router consulting the ARP table. If an entry isn’t found then an ARP request will be sent out © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 42 Summary and Default Route Summarizing routes reduces the size of the routing table. Route summarization is the process of combining a number of static routes into a single static route. © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 43 Summary and Default Route Configuring a summary route Step 1: Delete the current static route Step 2: Configure the summary static route Step 3: Verify the new static route © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 44 Summary and Default Route Default Static Route This is a route that will match all packets. Stub routers that have a number of static routes all exiting the same interface are good candidates for a default route. -Like route summarization this will help reduce the size of the routing table Configuring a default static route Similar to configuring a static route. Except that destination IP address and subnet mask are all zeros Example: -Router(config)#ip route 0.0.0.0 0.0.0.0 [exit-interface | ipaddress ] © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 45 Summary and Default Route Static routes and subnet masks The routing table lookup process will use the most specific match when comparing destination IP address and subnet mask Default static routes and subnet masks Since the subnet mask used on a default static route is 0.0.0.0 all packets will match. © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 46 Summary ข้อดีของ Static Routing คือง่าย และไม่ตอ้ งใช้ Routing Software(Router จะทางานน้อยลง) นอกจากนี้จะไม่ใช้ Resource ของ Network เพราะ Router ไม่ตอ้ งแลกเปลี่ยนข้อมูลกัน ข้อเสี ยคือ ตารางเปลี่ยนไม่ได้ ถ้ามี Link Down หรื อ Router Down เส้นทาง นั้นจะใช้ไม่ได้ ทาให้การส่ งข้อมูลที่กาหนดเส้นทางนั้นหยุดชะงักหรื อใช้ กาหนดสาหรับ Host ที่เชื่อมต่อกับ Network ที่มีทางออกผ่าน Router ตัว เดียว(คือค่า Gateway) การใช้ Static Route ควรมีการกาหนด Default Route เสมอ การทา Static Route ต้องตรวจสอบให้ดีวา่ จะไม่มี Route Loop © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 47 Basic Static Route (LAB 2.8.1) หลักสู ตรผูเ้ ชี่ยวชาญระบบโครงข่ายการศึกษาขั้นพื้นฐาน (OBEC Network) © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 48 Dynamic Routing Protocol หลักสู ตรผูเ้ ชี่ยวชาญระบบโครงข่ายการศึกษาขั้นพื้นฐาน (OBEC Network) © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 49 Dynamic Routing Protocols Function(s) of Dynamic Routing Protocols: -Dynamically share information between routers. -Automatically update routing table when topology changes. -Determine best path to a destination. © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 50 Dynamic Routing Protocols The purpose of a dynamic routing protocol is to: -Discover remote networks -Maintaining up-to-date routing information -Choosing the best path to destination networks -Ability to find a new best path if the current path is no longer available © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 51 Dynamic Routing Protocols Components of a routing protocol Algorithm In the case of a routing protocol algorithms are used for facilitating routing information and best path determination Routing protocol messages These are messages for discovering neighbors and exchange of routing information © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 52 Dynamic Routing Protocols Advantages of static routing -It can backup multiple interfaces/networks on a router -Easy to configure -No extra resources are needed -More secure Disadvantages of static routing -Network changes require manual reconfiguration -Does not scale well in large topologies © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 53 Classifying Routing Protocols Dynamic routing protocols are grouped according to characteristics. Examples include: -RIP -IGRP -EIGRP -OSPF -IS-IS -BGP Autonomous System is a group of routers under the control of a single authority. © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 54 Classifying Routing Protocols Types of routing protocols: -Interior Gateway Protocols (IGP) -Exterior Gateway Protocols (EGP) © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 55 Classifying Routing Protocols Interior Gateway Routing Protocols (IGP) -Used for routing inside an autonomous system & used to route within the individual networks themselves. -Examples: RIP, EIGRP, OSPF Exterior Routing Protocols (EGP) -Used for routing between autonomous systems -Example: BGPv4 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 56 Classifying Routing Protocols IGP: Comparison of Distance Vector & Link State Routing Protocols Distance vector – routes are advertised as vectors of distance & direction. – incomplete view of network topology. –Generally, periodic updates. Link state – complete view of network topology is created. – updates are not periodic. © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 57 Classifying Routing Protocols Distance-vector algorithms (Bellman-Ford algorithms) แต่ละ router ส่ งข้อมูลทั้งหมดหรื อบางส่ วนของ routing table ของตัวเองแต่ส่งให้ เฉพาะ router ที่อยูต่ ิดกัน จุดสาคัญ link-state algorithms ส่ ง small update ไปทุก ๆ ที่ขณะที่ distance-vector algorithms ส่ ง large update ไปเฉพาะ router ที่อยูต่ ิดกัน Distance-vector algorithms จะทราบข้อมูลเกี่ยวกับ router ที่อยูต่ ิดกันเท่านั้น © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 58 Classifying Routing Protocols Link-state algorithms (shortest path first algorithms) จะส่ ง routing information ถึงทุก node ใน internetwork แต่ละ router ส่ งบางส่ วนของ routing table ที่อธิบายสถานะของการเชื่อมโยงของตัวเอง ใน link-state algorithms แต่ละ router สร้างภาพของเครื อข่ายทั้งหมดใน routing tables © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 59 Classifying Routing Protocols © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 60 Classifying Routing Protocols Classful routing protocols Do NOT send subnet mask in routing updates Classless routing protocols Do send subnet mask in routing updates. © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 61 Classifying Routing Protocols Convergence is defined as when all routers’ routing tables are at a state of consistency © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 62 Routing Protocols Metrics Metric A value used by a routing protocol to determine which routes are better than others. © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 63 Routing Protocols Metrics Metrics used in IP routing protocols -Bandwidth -Cost -Delay -Hop count -Load -Reliability © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 64 Routing Protocols Metrics The Metric Field in the Routing Table Metric used for each routing protocol -RIP - hop count -IGRP & EIGRP Bandwidth (used by default), Delay (used by default), Load, Reliability -IS-IS & OSPF – Cost, Bandwidth (Cisco’s implementation) © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 65 Routing Protocols Metrics Load balancing This is the ability of a router to distribute packets among multiple same cost paths © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 66 Administrative Distance of a Route Purpose of a metric It’s a calculated value used to determine the best path to a destination Purpose of Administrative Distance It’s a numeric value that specifies the preference of a particular route © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 67 Administrative Distance of a Route Identifying the Administrative Distance (AD) in a routing table It is the first number in the brackets in the routing table © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 68 Administrative Distance of a Route Dynamic Routing Protocols © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 69 Administrative Distance of a Route Directly connected routes Have a default AD of 0 Static Routes Administrative distance of a static route has a default value of 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 70 Administrative Distance of a Route Directly connected routes -Immediately appear in the routing table as soon as the interface is configured © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 71 Summary Dynamic routing protocols fulfill the following functions -Dynamically share information between routers -Automatically update routing table when topology changes -Determine best path to a destination Routing protocols are grouped as either -Interior gateway protocols (IGP)Or -Exterior gateway protocols(EGP) Types of IGPs include -Classless routing protocols - these protocols include subnet mask in routing updates -Classful routing protocols - these protocols do not include subnet mask in routing update © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 72 Summary Metrics are used by dynamic routing protocols to calculate the best path to a destination. Administrative distance is an integer value that is used to indicate a router’s “trustworthiness” Components of a routing table include: -Route source -Administrative distance -Metric © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 73 Basic RIP Configuration (Lab 7.5.1) หลักสู ตรผูเ้ ชี่ยวชาญระบบโครงข่ายการศึกษาขั้นพื้นฐาน (OBEC Network) © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 74 Basic EIGRP Configuration (Lab 9.6.1) หลักสู ตรผูเ้ ชี่ยวชาญระบบโครงข่ายการศึกษาขั้นพื้นฐาน (OBEC Network) © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 75 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 76