Routers forward packets using either route information from route table entries that configured manually or the route information that is calculated using dynamic routing algorithms. Static routes, which define explicit paths between two routers, cannot be automatically updated; you must manually reconfigure static routes when network changes occur. Static routes use less bandwidth than dynamic routes. No CPU cycles are used to calculate and analyze routing updates.
Static routes are used in environments where network traffic is predictable and where the network design is simple. You should not use static routes in large, constantly changing networks because static routes cannot react to network changes. Most networks use dynamic routes to communicate between routers but might have one or two static routes configured for special cases. Static routes are also useful for specifying a gateway of last resort (a default router to which all unrouteable packets are sent).
How to Setup Static Routes
In NetSim, static routes can be configured either prior to the simulation or during the simulation.
Static route configuration prior to simulation:
- Via static route GUI configuration
- Via file input (Interactive-Simulation/SDN)
Static route configuration during the simulation:
- Via device NetSim Console (Interactive-Simulation/ SDN)
Static route configuration via GUI
Open NetSim, Select Examples->Internetworks->Configuring Static Route then click on the tile in the middle panel to load the example as shown in Figure.
The following network diagram illustrates what the NetSim UI displays when you open the example configuration file for Configuring Static Routing in NetSim as shown below Figure.
- Environment Grid length: 500m * 500m.
- Create a Scenario as shown in above screenshot.
- Generate CBR Traffic Between Wired node 6 and Wired node 7 and set the transport layer protocol as UDP.
- The default routing protocol is OSPF in application layer of Routers.
- Wired link Properties are default.
- Enable packet trace and plots.
- Run simulation for 10 seconds.
Observe in Animation Window packet flows from Wired Node 6 -> Router 1-> Router 5-> Router 4-> Wired Node 6 as shown in below Figure.
With Static Route#
Static routing configuration
- Open Router 1 properties->Network_Layer. Enable - Static IP Route ->Click on Configure Static Route IP and set the properties as per the screenshot below and click on Add and then click on OK.
route ADD 184.108.40.206 MASK 255.255.0.0 220.127.116.11 METRIC 1 IF 1 route ADD destination_ip MASK subnet_mask gateway_ip METRIC metric_value IF Interface_Id
route ADD: command to add the static route.
destination_ip: is the Network address for the destination network.
MASK: is the Subnet mask for the destination network.
gateway_ip: is the IP address of the next-hop router/node.
METRIC: is the value used to choose between two routes.
IF: is the Interface to which the gateway_ip is connected. The default value is 1.
Similarly Configure Static Route for all the routers as given in below Table.
Devices NetworkDestination Gateway Subnet Mask Metrics Interface ID Router 1 18.104.22.168 22.214.171.124 255.255.0.0 1 1 Router 2 126.96.36.199 188.8.131.52 255.255.0.0 1 2 Router 3 184.108.40.206 220.127.116.11 255.255.0.0 1 2 Router 4 18.104.22.168 22.214.171.124 255.255.0.0 1 3
After configuring the router properties.
- Run the simulation for 10 seconds and check packet animation window.
- Observe in Animation Window packet flows from Wired Node 6 -> Router 1-> Router 2-> Router 3-> Router 4-> Wired Node 7 as shown in below Figure
Disabling Static Routing
- If static routes were configured via GUI, it can be manually removed prior to the simulation from the Static IP Routing Dialogue or from the file input.
- If static routes were configured during the run time, the entries can be deleted using route delete command during runtime.