# Dynamic Routing
## What is Dynamic Routing
Dynamic routing is the process by which routers automatically discover routes and update their routing tables based on information exchanged with neighboring routers through routing protocols. Unlike static routing where an administrator manually configures every route, dynamic routing protocols allow routers to adapt automatically to changes in the network topology such as link failures, new links being added, or changes in link capacity. Dynamic routing is essential in large networks where manually maintaining routes would be impractical.
## How Dynamic Routing Works
Routers running dynamic routing protocols establish neighbor relationships with adjacent routers. They exchange routing information through protocol-specific messages. Each router uses the received information to build its routing table. When the network topology changes, such as when a link goes down, the routers detect the change and exchange updated information. They recalculate their routing tables to reflect the new topology and begin routing traffic through alternative paths. This process is called convergence.
## Interior and Exterior Gateway Protocols
Dynamic routing protocols are classified based on the scope of networks they are designed for. Interior gateway protocols are used for routing within a single autonomous system or organization. Examples include OSPF, EIGRP, RIP, and IS-IS. Exterior gateway protocols are used for routing between different autonomous systems. BGP is the only widely used exterior gateway protocol and is the protocol that makes the global internet work.
## Distance Vector Protocols
Distance vector protocols work by having each router share its routing table with directly connected neighbors. Each router only knows the distance and direction to reach each destination, without having a complete map of the network. RIP is the simplest distance vector protocol. EIGRP is an advanced distance vector protocol. Distance vector protocols are easy to configure and require less memory and CPU than link state protocols but converge more slowly.
## Link State Protocols
Link state protocols work by having every router build a complete map of the network topology. Each router advertises information about its directly connected links to all other routers through a process called flooding. Every router then independently runs a shortest path algorithm to calculate routes. OSPF and IS-IS are link state protocols. Link state protocols converge quickly and are free of routing loops but require more memory and CPU than distance vector protocols.
## Advantages of Dynamic Routing
Dynamic routing automatically adapts to network changes without administrator intervention. It scales to large networks that would be impossible to manage with static routes. It provides redundancy by automatically finding alternative paths when the primary path fails. New networks added to the topology are automatically discovered and routes are updated.
## Disadvantages of Dynamic Routing
Dynamic routing protocols consume bandwidth for exchanging routing updates. They require CPU and memory resources on routers. They introduce some security risk because an unauthorized router could inject false routing information. Configuration can be more complex than static routing, especially for protocols like OSPF and BGP.Back to Subject