ccnahub.com
http://www.ccnahub.com/ip-fundamentals/understanding-ip-routing/
Understanding IP Routing Concept
Understanding IP Routing Concept Article covers the following CCNA/ICND1 Exam Topics: Under Operation of IP Data Networks: 1. Recognize the purpose and functions of various network devices such as Routers, Switches, Bridges, and Hubs. 2. Select the components required to meet a given network specification. 3. Predict the data flow between two hosts across a network. Under IP Routing Technologies: 1. Differentiate methods of routing and routing protocols such Static vs. Dynamic. Recommended Study Plan: 1. Download the ICND1v2 Exam Topics Sheet from Cisco Website. 2. Follow the Steps and the Articles under “ IP Networks Fundamentals” by order. Average Time Required Studying this Article: 1 Hour Packets Routing and Frame Forwarding Concept Please Note: I have used the word “Routing Packets” with Layer 3 (which it does) and the word “Forwarding Frames” with Layer 2 to distinguish between the 2 operations. In the end, Routing and Forwarding means the same thing, but it doesn’t make sense to use “Routing” at the Data-link Layer, therefore, I used “Forwarding” instead. So what is IP Routing? IP Routing is an umbrella term, it refers to a set of protocols to determine the best path that an IP Packet can follow in order to travel across multiple networks from its source to its destination. The set of protocols run together at the Network Layer to help hosts and routers route IP packets. IP Routing will involve too many network devices to accomplish an IP Packet’s Routing. Switches, Firewall, and Routers – all of them will be involved to Route the IP Packet. Network Layer deals with ONE major protocol to Route Packets Network Layer defines set of functions based on One Major Logical Protocol. There are two versions of this logical protocol where other layer 3 functions revolve. IPv4 and IPv6, both define network layer routing functions, but with different details for each. This article focuses on IPv4. Internet Protocol (IPv4), and as a Layer 3 protocol, focuses on Routing or guiding the IP packets that carry the Data from the upper Layers as source device to the destination device using Dotted Decimal Notation – known by Logical Addressing or IP Addressing System , then IPv4 Routing handle the Packets to the Data-Link for Framing and finally Physical Layer for transmitting frames as Bit Stream.
What are the required components for IPv4 Routing to happen? 1. The Router itself – the Hardware Piece 2. Router Operating System – Internet Operating System (IOS) 3. IP Addressing System based on Dotted Decimal Notation 4. Routing Protocols – such OSPF or EIGRP creates and maintains an Internet Road Map using IP Addressing System as reference Points Now, Routers can guide what is called “IP Packet” to reach its final destination using an Internet Road Map built by OSPF or EIGRP using IPv4 Addressing System. IP Routing vs. GPS Routing If GPS Routing guide Human to drive from point A to point B, then IP Routing guide Routers to Route IP Packets from point A to point B. If Human understand how to use GPS Road Map, then Routers running Routing Protocols such OSPF or EIGRP understand how to use Internet Road Map. Routing Protocols Create, maintain, and present to the Router an Internet Road Map using IP Addressing System similar to GPS Map Reference Points. Every Router loaded with the required components understand IP Routing Internet MAP. Routers can be dedicated Hardware like Cisco or Software base running in Linux box using the same exact Routing Protocols to create, maintain, and present Internet MAP for the Router to use. A Road MAP system like GPS device won’t really care which method you would use to reach point B, rather, it cares how to represent the right and the closest path to reach point B; it’s up to you to choose which moving method to use, you can walk, fly, ride a bus, car, or train, hence, different Layer! So, Network Layer uses a Universal logical Protocol called either IPv4 or IPv6 to manage the IP Addressing System; Routing Protocols in the other hand such OSPF and EIGRP Create and Maintain an Internet Road MAP using the IP Addressing System as Reference Points called: Public IP Addresses. IPv4 or IPv6 logical addresses are used to route packets from point A to point B across different types of networks regardless of their physical structure type. Imagine that your job is to route people from point A to point B as tourist guide, what will always concern you the most is your MAP accuracy and not how the people will be riding or walking from point A to Point B. There will be another guy (A Data-Link Protocol) who would instruct the tourist to dress special shoes maybe at certain areas and to ride a special car maybe (Physical Cabling) to tour around special Mountain areas. Finally IPv4 manage Logical Addressing or IP Addressing combined with Routing Protocols such OSPF or EIGRP is similar to GPS System combined with Satellite geographical reference points, but it guides IP Packets instead of Humans. How Routers pick the Best Route from their IP Routing Table Router’s logic uses a database table called IP Routing Table, to route Packets from Public IP Address to another Public IP Address, or from Network to Network; the routing table lists IP addresses as groups or blocks, called IP Networks (referring to Classful Addressing) or IP Subnets (referring to Classless Addressing) and some of these addresses were directly learned due to directly and physically connected Networks, and some were learned using Dynamic and Multicasting Routing Protocols such OSPF or EIGRP. IP Routing Table can be filled as follows:
1. Static Route Entries: Routing tables can be filled manually by the Network Engineer. 2. Directly Connected Route Entries: Physically connected links entries automatically get populated by the router once you configure the IP address on the interface. 3. Dynamic Route Entries: Routing Protocol such OSPF or EIGRP is used to shout and inform all neighbors’ routers about its directly connected routes *One of the main and major jobs of the any Routing Protocol is: to dynamically shout and Multicast the physically connected routes to other routers, so they can fill their Routing Table with Entries to build an Internet MAP. When a router receives an IP packet at its Network Layer, it compares the packet’s destination IP address to the entries on the Routing Table and makes a match. This matching entry also lists directions such the exit or via interface to tell the router where to route the packet next. How Routers Route IP Packets? When the frame arrives, the router uses the following logic on the data link frame: Step 1: Use the data link Frame Check Sequence (FCS) field to ensure that the frame had no error; of errors occurred, discard the frame. Step 2: If the frame was not discarded at Step 1, de-encapsulate the frame by striping and discarding its old data link header and trailer, leaving the IP packet. Step 3: Compares the IP packet’s destination IP address to the routing table, and find the route that best matches the destination address. In addition, this route will identify its outgoing interface or exit at the router. Step 4: Once routing decision is made, encapsulates the IP packet inside a new data link header and trailer (New Frame), with source MAC address of the outgoing interface and a destination MAC address based on Address Resolution Protocol (ARP) table, and forward the frame to the next-hop. The next-hop is the receiving router, and its destination MAC address indicates its interface. Note: keep in mind that routers sometimes uses WAN links with protocol either HDLC or PPP, in this case they don’t use source or destination MAC address, instead, they use different method then MAC address. Routers use MAC addresses to route Packets when Ethernet Standards is used. PC Routing the Packet All network devices such Routers and PCs work together to perform IP routing. The host’s OS has software TCP/IP stack, PCs use this software networking model to choose where to send IP packets, oftentimes to a nearby router if the host they are trying to reach is located on different Subnet and Routers make choices of where to send the IP packet next. Together, hosts and routers deliver the IP packet to the correct destination. How a PC uses some simple routing logic when choosing where to send an IP Packet: Step 1: If the destination IP address is in the same IP subnet as I am, forward the packet directly to the destination host using MAC forwarding. No need for default gateway routing. Hint: IP is always needed in either case, so hosts can learn MAC addresses from each other. Step 2: Otherwise, route the IP packet to my default gateway as next-hop (using MAC forwarding) for further routing. Address Resolution Protocol (ARP) Any network device initially needs the help of Address Resolution Protocol (ARP) to be able to Route Packets either
internally or outside the Network. ARP as a Network Layer feature is used only for Ethernet network devices to learn MAC addresses from each other. PCs and Routers must have some way to decide what MAC address to use while building the frame on the downstream of TCP/IP stack. ARP dynamically learns the data link (MAC) addresses of hosts/routers connected to LAN through broadcast address ffff.ffff.ffff. ARP cache guides the Data-Link Layer to assign destination and source MAC addresses while building the frames. PC1’s ARP learning R3’s MAC address for the first time – Detailed Steps In order to send to outside Networks such a web-server, PC1 knows that it has to send its packets through default gateway (R3) to reach the web-server. Therefore, and for the first time, it will send out an ARP broadcast message asking R3 for its MAC address. R3 receives the broadcast message and replies with its f1/0 interface MAC address. Later, when PC1 wants to route packets to web-server through R3, it will include the IP address of web-server as destination IP address at the Network Layer, and includes the MAC address of R3 as destination MAC address at the Data-Link Layer. Step1: PC1’s Network Layer creates an IP packet with R3’s destination IP address (192.168.1.1) and PC1’s source IP address (192.168.1.100) calling ARP for broadcasting mission Step2: PC’1 Data-Link receives, analyze, and encapsulates the IP packet as frame, adds a broadcast destination MAC address (FFFF.FFFF.FFFF) as unknown receiver, adds the PC source MAC address as a sender, and finally forwards the frame using PC’1 NIC interface as outgoing interface through the physical layer heading to R3 as nexthop. Step3: SW2 receives the frame and floods any broadcast message from all ports except the incoming port, as a result, R3 receives the ARP broadcast frame and replies back to PC1 by its MAC address (3001.2222.2222), PC1’s ARP saves R3’s MAC address in its cache table and uses it for any outside routing from now on.
In the figure above, PC1 requests a web-page from the Web-server, PC1 does some analysis, and then chooses to route the IP packet to the near router (R3) so that R3 will forward the packet to the next-hop. PC1 analyzes the destination IP address of the web-server and realize that web-server address (172.16.10.20) is not on the same LAN as PC1. So, PC1’s TCP/IP logic tells the PC you must route the packet to a nearby router which located on the same LAN called Default Gateway. To route the IP packet through default gateway, PC1 forwards a data link frame across the medium to the nearby router; this frame includes the packet in the data portion of the frame. That frame uses data link layer destination
MAC address of R3 as next-hop in the data link header to ensure that nearby router receives the frame for further processing. Next: Understanding Web Browser DNS Lookup Go to top
About Imad Daou He is the founder of CCNA HUB, a CCNA Training HUB to help CCNA students get certified. Imad has more than 10 years of IT experience as Field Service and Consulting Engineer. A+, Network+, Server+, Security+, Storage+, HP, Dell, and IBM Hardware Certified. He's a Professional SMB IT Consultant. Facebook • Twitter • Linkedin • Google • Copyright secured by Digiprove © 2013 Imad DaouSome Rights Reserved Original content here is published under these license terms:
X
License Type:
Attribution, Share Alike
License Summary:
You may copy this content, create derivative work from it, and re-publish it, provided you include an overt attribution to the author(s) and the re-publication must itself be under the terms of this license or similar.
License URL:
http://creativecommons.org/licenses/by-sa/3.0/