Routing Tables and IP Packet Routing

routing table a host or a router has a routing n.w
1 / 10
Embed
Share

Learn about static and dynamic routing tables in networking, the importance of routing protocols like RIP and OSPF, and how routers efficiently route IP packets based on destination addresses and subnet masks. Discover the role of routers in forwarding packets between different subnets and networks.

  • Routing Tables
  • IP Packet Routing
  • Networking Basics
  • Routing Protocols
  • Subnet Masking

Uploaded on | 2 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Routing Table A host or a router has a routing table with an entry for each destination, or a combination of destinations, to route IP packets. The routing table can be either static or dynamic. Static Routing Table A static routing table contains information entered manually. The administrator enters the route for each destination into the table. When a table is created, it cannot update automatically when there is a change in the Internet. The table must be manually altered by the administrator. A static routing table can be used in a small internet that does not change very often, or in an experimental internet for troubleshooting. It is poor strategy to use a static routing table in a big internet such as the Internet. Dynamic Routing Table A dynamic routing table is updated periodically by using one of the dynamic routing protocols such as RIP, OSPF, or BGP. Whenever there is a change in the Internet, such as a shutdown of a router or breaking of a link, the dynamic routing protocols update all the tables in the routers (and eventually in the host) automatically. The routers in a big internet such as the Internet need to be updated dynamically for efficient delivery of the IP packets.

  2. Routing table for a local host .. > route print -4 On-link means that they are addresses that can be resolved locally. They don't need a gateway because they don't need to be routed.

  3. Routing with Hierarchy of IP addresses

  4. When the host wants to send a packet to a certain IP address, the first thing it does is to perform a bitwise AND between its own subnet mask and the destination IP address. If the result equals the subnet number of the sending host, then it knows that the destination host is on the same subnet and the packet can be delivered directly over the subnet. If the results are not equal, the packet needs to be sent to a router to be forwarded to another subnet. For example, if PC1 is sending to PC3, then PC1 ANDs its subnet mask (255.255.255.0) with the address for PC3 (192.168.20.5) to obtain 192.168.20.0. This does not match the network/subnet number for PC1 (192.168.34.0) so PC1 knows that PC3 is on a different network. Since PC1 cannot deliver the packet to PC3 directly over the network, it sends the packet to its default router R1. For this example the routing table for router R1 would have the entries shown in the following table : Network id / destination subnet 0.0.0.0 192.168.34.0 192.168.20.0 128.156.0.0 192.168.40.0 NetMask /SubnetMask 0.0.0.0 255.255.255.0 255.255.255.0 255.255.0.0 255.255.255.0 Next hop / Gateway R2 Local Local R2 R3 Interface Metric 2 1 2 2 2 1 0 0 1 1

  5. No when PC1 sent to PC3, R1 would AND PC3s address (192.168.20.5) with the subnet mask of the first entry and compare the result with the network number for that entry. Since this is not a match, it proceeds to the next entry and also no match, it proceeds to the next entry. This time a match does occur, so R1 delivers the datagram to PC3 using interface 2, which is the interface connected to the same network as PC3. Routers keep one routing table for each protocol, because each protocol has its own addressing scheme and metrics. If you run IP (IPv4), IPv6, and AppleTalk on the same router, that router will keep a routing table for IPv4, a routing table for IPv6, and a routing table for AppleTalk.

  6. Example : show the entries of R! routing table and the steps required to send a message from H1 to H2

  7. When the host wants to send a packet to a certain IP address, the first thing it does is to perform a bitwise AND between its own subnet mask and the destination IP address. If the result equals the subnet number of the sending host, then it knows that the destination host is on the same subnet and the packet can be delivered directly over the subnet. If the results are not equal, the packet needs to be sent to a router to be forwarded to another subnet. For example, if H1 is sending to H2, then H1 ANDs its subnet mask (255.255.255.128) with the address for H2 (128.96.34.139) to obtain 128.96.34.128. This does not match the subnet number for H1 (128.96.34.0) so H1 knows that H2 is on a different subnet. Since H1 cannot deliver the packet to H2 directly over the subnet, it sends the packet to its default router R1. For simple IP, a router has a forwarding table that consists of entries of the form NetworkNum, NextHop. To support subnetting, the table must now hold entries of the form SubnetNumber, SubnetMask, NextHop. For example router R1 would have the entries shown in the following table :

  8. For example, if H1 sent to H2, R1 would AND H2s address (128.96.34.139) with the subnet mask of the first entry (255.255.255.128) and compare the result (128.96.34.128) with the network number for that entry (128.96.34.0). Since this is not a match, it proceeds to the next entry. This time a match does occur, so R1 delivers the datagram to H2 using interface 1, which is the interface connected to the same network as H2. Routers keep one routing table for each protocol, because each protocol has its own addressing scheme and metrics. If you run IP (IPv4), IPv6, and AppleTalk on the same router, that router will keep a routing table for IPv4, a routing table for IPv6, and a routing table for AppleTalk.

  9. Routing Table for Classful Addressing

  10. Forwarding Process Example 1: The router receives a packet for destination 192.16.7.1. For each row, the mask is applied to the destination address until a match with the destination address is found. In this example, the router sends the packet through interface m0 (host specific). Example 2: The router receives a packet for destination 193.14.5.22. For each row, the mask is applied to the destination address until a match with the next-hop address is found. In this example, the router sends the packet through interface m2 (network specific). Example 3: The router receives a packet for destination 200.34.12.34. For each row, the mask is applied to the destination address, but no match is found. In this example, the router sends the packet through the default interface m0.

Related


More Related Content