Sending a packet from one router to another router means routing. It refers to the process of selecting the shortest and the most reliable path intelligently over which it sends data to its ultimate destination through the routing protocol. Routing protocol makes the distinction between hosts and gateways. A host is the end system to which data is ultimately deliverable. A gateway is a router that accomplishes the act of routing data between two networks. The routing process usually forwards packets on the basis of routing tables, which maintain a record of the routes to various network destinations. Thus constructing routing tables, which are held in the router’s memory, is very important for efficient routing. Most routing algorithms use only one network path at a time. Multipath routing techniques enable the use of multiple alternative paths.
Routing protocol: Routing protocol is used between routers to determine paths and maintain routing tables. Example: RIP, IGRP, EIGRP, OSPF, etc.
Routed protocol: A routed protocol is a network layer protocol that can be used to send the user data from one network to another. Routed protocol carries user traffic such as e-mails, file transfer, etc. Example: IP, IPX, AppleTalk, etc.
Types of Routing: There are three types of Routing.
- Static Routing
- Default Routing
- Dynamic Routing
Static Routing: Static routing is f form of routing that occurs when a router uses a manually-configured routing entry. Rather than information from dynamic routing traffic. In any case, static routes are manually configured by a network administrator by adding the entries into a routing table. Unlike dynamic routing, static routes are fixed and do not change if the network is changed or reconfigured.
- Static routing can be used to define an exit point from a router when no other routes are available or necessary. This is called a default route.
- Static routing can be used for small networks that requires only one or two routes. This is often more efficient since a link is not being wasted by exchanging dynamic routing information.
- Static routing Is often used as a complement to dynamic routing to provide a failsafe backup in the event that a dynamic route is unavailable.
- Static routing Is often used to help transfer routing information from one routing protocol to another that is known as routing redistribution.
In any case, static routes are manually configured. This increases the potential of human errors.
When there is a change in the network or a failure occur between two statically define devices, traffic will not be re-routed. The network is down until the failure is overcome or the static route is manually reconfigured by an administrator.
Static routes must be configured on each router in the networks. This configuration can take a long time if there are many routers.
Syntax: ip route[destination network]
[destination network mask]
[next-hop address or exit interface]
IP route: is the standard announcement of the static route command
Destination network: is the IP address of the network to include in the routing table.
Mask: is the mask of that network.
Next hop address: is the address of the next-hop router that will receive packets from you and forward then to the destined network.
Exit interface: instead of next-hop address you can declare the exit interface on your router.
Command to enable static route:
Router A> enable
Router A# configuration terminal
Router A(config)# ip route 192.168.2.0 255.255.255.0 192.168.1.2
The static route can also be added by specifying the exit interface rather than the “next hop” IP address of the router.
Router A(config)# ip route 192.168.2.0 255.255.255.0 serial 0/0/0
Administrative Distance (AD): Administrative Distance defines the cost or weight of the routing protocols. If multiple routes or multiple routing protocols are configs on a router you can define which protocol or route to be used for specific networks.
Default Route: Default routing is used in the case of the Stub network. A Stub network is a network, which has only one outgoing interface to access all networks. A router that has only one exit or outgoing interface will always have one default gateway for any or all network. There is only one gateway for all networks. It is applied on the boundary and border routers and on the remaining router are configured as a static route. That means if there are three routers connected to each other, router one is your boundary, and router three is your border, the remaining router that is router two can be configured as a static route. It adds the router in the form of 0. It reduces the routing table.
Syntax: ip route 0.0.0.0 0.0.0.0. default-gateway.
The first portion 0.0.0.0 represents any network whereas the second portion 0.0.0.0 represents any subnet mask. The last part is the default gateway for outgoing traffic.
Router A(config)# ip router 0.0.0.0 0.0.0.0 192.168.1.2
Dynamic Routing: Dynamic routing is an alternate method of routing. This method uses layer-3 protocols to automatically find neighboring routers and creates or updates the routing tables on routers. This method is easy to configure and maintain, but however, this method is resource-intensive i.e. they require more CPU process, memory, and bandwidth of router. Dynamic routing protocols are used in large networks. Dynamic routing protocols are classified into 2 categories