Tuesday, 1 October 2013

STATIC ROUTING

      Static routing has some enormous advantages over dynamic routing. Chief among these advantages is predictability. Because the network administrator computes the routing table in advance, the path a packet takes between two destinations is always known precisely, and can be controlled exactly. With dynamic routing, the path taken depends on which devices and links are functioning, and how the routers have interpreted the updates from other routers.

        Additionally, because no dynamic routing protocol is needed, static routing doesn't impose any overhead on the routers or the network links. While this overhead may be minimal on an FDDI ring, or even on an Ethernet segment, it could be a significant portion of network bandwidth on a low-speed dial-up link. Consider a network with 200 network segments. Every 30 seconds, as required by the RIP specification, the routers all send an update containing reachability information for all 200 of these segments. With each route taking 16 octets of space, plus a small amount of overhead, the minimum size for an update in this network is over three kilobytes. Each router must therefore send a 3 Kb update on each of its interfaces every 30 seconds. As you can see, for a large network, the bandwidth devoted to routing updates can add up quickly.

         Finally, static routing is easy to configure on a small network. The network administrator simply tells each router how to reach every network segment to which it is not directly attached. This network has three routers connecting five network segments together. Clearly, the only path from Router1 to a host on 172.16.3.0/24 goes through Router2. Likewise, the only path to hosts on subnet 172.16.4.0/24 goes through Router3.

  

 Here are the relevant fragments of the configurations of these three routers using static routing. Note that each router configuration must contain a static route for the networks attached to the other routers, but not those directly attached to the router itself.

Configuration for Router1:
hostname router1
!
interface ethernet 0
 ip address 172.16.1.1 255.255.255.0
!
interface ethernet 1
 ip address 172.16.2.1 255.255.255.0
!
ip route 172.16.3.0 255.255.255.0 172.16.1.2
ip route 172.16.4.0 255.255.255.0 172.16.1.2
ip route 172.16.5.0 255.255.255.0 172.16.1.2
Configuration for Router2:
hostname router2
!
interface ethernet 0
 ip address 172.16.1.2 255.255.255.0
!
interface ethernet 1
 ip address 172.16.3.1 255.255.255.0
!
interface ethernet 2
 ip address 172.16.5.1 255.255.255.0
!
ip route 172.16.2.0 255.255.255.0 172.16.1.1
ip route 172.16.4.0 255.255.255.0 172.16.3.2
 
Configuration for Router3:

hostname router3
!
interface ethernet 0
 ip address 172.16.3.2 255.255.255.0
!
interface ethernet 1
 ip address 172.16.4.1 255.255.255.0
!
ip route 172.16.1.0 255.255.255.0 172.16.3.1
ip route 172.16.2.0 255.255.255.0 172.16.3.1
ip route 172.16.5.0 255.255.255.0 172.16.3.1

Each configuration starts by giving the router a name, and then defines an IP address and subnet mask for each of the router's interfaces. For example, on Router2, the second Ethernet interface (ethernet 1) is assigned the IP address 172.16.3.1, and the netmask 255.255.255.0. Similar commands defining addresses and netmasks for local interfaces will appear in all router configurations, regardless of whether a router is participating in a dynamic routing protocol. If the configurations stopped here, each router would have entries in its routing table for the networks attached to its own interfaces, and no others. But the configurations go on to define static routes showing how to reach networks attached to the other routers. Each ip route statement defines a static route to the destination indicated by the network number and mask by way of the router IP address listed. For example, the first ip route statement in Router3's configuration defines a route to 172.16.1.0, with a mask of 255.255.255.0 (172.16.1.0/24) via the router at 172.16.3.1. The static routes, together with the the local interfaces, let each router populate its routing table with information about each destination and the next hop to reach it.
While this small network doesn't require many static routes to achieve complete connectivity, and Router1 and Router3 could get by with static default routes pointing to Router2, it is easy to see that the configurations for a large network with hundreds of network segments and routers would be very complex. 

DISADVANTAGES

   While static routing has advantages over dynamic routing, it is not without its disadvantages. The price of its simplicity is a lack of scalability. For five network segments on three routers, computing an appropriate route from every router to every destination is not difficult. However, many networks are much larger. Consider what the routing might look like for a network with 200 network segments interconnected by more than a dozen routers. To implement static routing, you would need to compute the next hop for each network segment for each router, or more than 2,400 routes! As you can see, the task of precomputing routing tables quickly becomes a burden, and is prone to errors.
       
          you could argue that this computation need only occur once, when the network is first built. But what happens when a network segment moves, or is added? While the computation may be relatively easy, to implement the change, you would have to update the configuration for every router on the network. If you miss one, in the best case, segments attached to that router will be unable to reach the moved or added segment. In the worst case, you'll create a routing loop that affects many routers.

       Finally, because static routing is, by definition, static, it cannot use redundant network links to adapt to a failure in the network. Consider what would happen to our network if we add an additional interface to Router3 and connected it to 172.16.2.0/24, but left routing unchanged. If Router2 fails, Router3 would be unable to adapt to the change in the network topology and would still be unable to reach hosts on 172.16.1.0/24. This inability to adapt to network failures, even when redundant paths are available, and the problems associated with scaling, are the primary motivations behind dynamic routing.

No comments:

Post a Comment