# Routing in FE Electrical

Understanding routing in the FE Electrical exam is crucial for success per the NCEES® FE Electrical exam guidelines and syllabus. It not only helps students pass the exam with a high passing margin but lets them succeed in the diverse electrical engineering career as an Electrical or Communication engineer.

This study guide will help you unwrap the critical routing concepts in the FE Electrical exam. Let’s discuss this in detail.

## Basics of Routing

Routing determines the optimal path for data packets to travel from a source to a destination across a network. It operates at the OSI model’s network layer (Layer 3) and involves making decisions based on logical addressing, such as IP addresses.

Fundamentally, it deals with IP Address Management in the routing table and choosing the most accurate route to forward packets. Routers are the devices responsible for executing routing functions.

Let’s discuss the basics of Routing in FE Electrical that you must know.

### How Routing Works?

Let’s go through the critical technicalities of routing step-by-step to understand how it works.

#### The Layer of Operation

• Routing operates at the OSI model’s network layer (Layer 3), differentiating it from switching.

Read our detailed guide of this series to understand switching in the FE Electrical exam.

• Routers use logical addressing, typically IP addresses, to make forwarding decisions.

#### Routing Table

• Each router maintains a routing table, which lists known networks and the corresponding paths to reach them.
• Entries in the routing table include destination network addresses, next-hop routers, and associated metrics.

#### Route Determination

• When a router receives a packet, it examines the destination IP address.
• The router consults its routing table to determine the best path to reach the destination network.

#### Routing Algorithms

• It includes routing algorithms, such as the Shortest Path First (SPF) algorithm or the Routing Information Protocol (RIP).
• RIPs calculate the best path based on hop count, link cost, or bandwidth. [Details will be discussed in the following sections].

#### Packet Forwarding

• Once the router determines the best path, it forwards the packet to the next-hop router or directly to the destination network.

#### Inter-Network Communication

• Routers enable communication between different networks by forwarding packets across network boundaries.
• They use logical addressing to distinguish between different networks.

### Introduction to Routing Algorithms

Routing algorithms determine how data packets are transmitted across a network. There are two main types of routing algorithms: static and dynamic.

#### Static Routing

##### How Does It Work?

Let’s uncover how static routing works.

###### Manual Configuration

Network administrators manually perform VLAN configuration to configure the routing table on each router. The administrator specifies the destination network and the corresponding next hop for each entry in the routing table.

###### Routing Table

The routing table contains entries that define specific routes for each destination in the network. Each entry typically includes the destination IP address or network, the subnet mask, and the next-hop IP address or exit interface.

Once configured, the routing table remains unchanged unless a network administrator manually updates it. Unlike dynamic routing, it entertains no dynamic adaptation to changes in the network topology.

##### Efficiency
• Fast – Static routing is generally faster because routers do not need to engage in the process of dynamically updating and recalculating routes.
• Low Overhead – There is minimal overhead on the routers as they don’t need to exchange routing information with other routers.
##### Timing
• Changes to the routing table take effect immediately after manual configuration.
##### Cost
• Static routing is cost-effective as it doesn’t require the implementation of dynamic routing protocols or continuous communication between routers.
##### Packet Flow
• Routing Table Update – When a packet is transmitted, the router uses the preconfigured static routes in its routing table to determine the next hop.
• Routing Decision – The router checks the destination IP address of the packet against its static routing table to decide the appropriate outgoing interface or next-hop IP address.
• Transmission – The packet is then forwarded to the next hop based on the static route information.

#### Dynamic Routing

##### How Does it Work?
###### Neighbor Discovery

Routers use dynamic routing protocols to discover and maintain neighbor relationships. Standard dynamic routing protocols include RIP (Routing Information Protocol), OSPF (Open Shortest Path First), and EIGRP (Enhanced Interior Gateway Routing Protocol).

###### Routing Information Exchange

Routers periodically exchange routing information or in response to changes in the network topology. Information exchanged includes the network topology, reachable destinations, and associated metrics.

Routers update their routing tables dynamically based on the received routing information. The routing algorithm adapts to changes in the network by recalculating routes in response to new information.

##### Efficiency
• Adaptive – Dynamic routing adapts to changes in the network, making it suitable for environments where the topology is subject to frequent modifications.
• Scalable – Dynamic routing can efficiently handle large and complex networks.
##### Timing
• Convergence time, the time it takes for routers to adjust to changes in the network, can vary and may take some time to stabilize.
##### Cost
• Low Cost – Dynamic routing requires more computational resources as routers communicate continuously to exchange routing information.
• Bandwidth Utilization – There is an additional cost regarding bandwidth utilization for the transmission of routing updates.
##### Packet Flow
• Routing Table Update – Routers periodically exchange routing updates containing information about network changes.
• Dynamic Decision – The router dynamically recalculates the best path to reach the destination based on the received routing updates and associated metrics.
• Forwarding – The packet is then forwarded to the next hop determined by the dynamic routing algorithm.

#### Static or Dynamic Routing – Which One is Better?

The choice between static and dynamic routing depends on factors such as network size, stability, and the need for adaptability. Static routing is more straightforward and more suitable for small, stable networks, while dynamic routing is scalable and better suited for large, dynamic networks where adaptability to changes is crucial.

### Routing Tables and Routing Information Protocol (RIP)

#### Routing Tables

A routing table is a crucial component of a router’s functionality, providing a roadmap for packet forwarding within a network. It contains information about the paths to different destination networks and helps the router decide where to send packets.

##### How do Routing Tables Work?

Let’s uncover the process of routing operations in the routing table.

###### Entry Format and Subnetting Techniques

Each entry in the routing table typically consists of the destination network or host, the subnet mask, the gateway or next-hop IP address, and the interface through which the packet should be forwarded.

###### Routing Decision

When a router receives a packet, it checks its routing table to determine the best path forwarding it. The router looks for the most specific match between the destination IP address of the packet and the entries in its routing table.

###### Static vs. Dynamic Entries
• Static Entries: Configured manually by network administrators.
• Dynamic Entries: Generated automatically through dynamic routing protocols.
###### Default Route

A default route is used when there is no specific match for the destination IP address in the routing table. It is often denoted as 0.0.0.0/0.

#### Routing Information Protocol (RIP)

RIP is one of the oldest network routing protocols used to exchange routing information between routers in a network. It falls under the distance-vector routing protocols, where routers exchange information about the distance (hop count) to reach different networks.

##### How Does RIP Work?
###### Algorithm

RIP uses the Bellman-Ford algorithm to determine the best path to a destination based on the number of hops.

###### Metric

RIP uses hop count as its metric. Each router advertises the number of hops it is away from a particular network.

###### RIP Versions
• RIP v1: Classful routing protocol that does not include subnet information in routing updates.
• RIP v2: Supports classless inter-domain routing (CIDR) and includes subnet information in updates.
###### Routing Table Update

RIP routers periodically send routing updates to neighboring routers. Updates contain information about the router’s directly connected networks and the associated hop count.

###### Split Horizon

RIP employs the split horizon rule to prevent routing loops. If a route is learned from a neighbor, it is not advertised back to that neighbor.

###### Route Poisoning

When a network becomes unreachable, RIP routers use route poisoning to inform other routers that the route is no longer valid. The metric is set to infinity (16 for RIP).

##### Information Exchange in RIP

Let’s see how information exchange takes place in RIP.

###### Routing Update Message

RIP routers send periodic updates containing information about the networks they can reach and the associated hop counts.

###### Routing Table Update

Upon receiving an update, a router updates its routing table based on the new information. It recalculates the best path to each destination network.

###### Split Horizon and Route Poisoning

Split horizon prevents a router from advertising routes back to the router from which it learned them. Route poisoning ensures that unreachable routes are communicated with an infinite metric.

##### Blocking Users

To block a user from connecting using routing table configurations:

###### Access Control Lists (ACLs)
• Use ACLs to filter traffic based on source or destination IP addresses.
• Deny the user’s IP address or range in the ACL.
###### Null Routes
• Create a null route for the user’s IP address, effectively discarding packets destined for that address.
• This can be done using a command like ip route <user_IP_address> 255.255.255.255 null0.
###### Policy-Based Routing (PBR)
• Implement PBR to route traffic based on user-specific criteria.
• Create a policy that denies traffic from the user and applies it to the appropriate interface.

## Routing Protocols for Routing in FE Electrical Exam

Let’s discuss Routing Protocols that are integral in founding and supervising modern routing algorithms.

### Open Shortest Path First (OSPF)

OSPF is a link-state routing protocol that provides a standardized way of calculating the shortest path between routers in an autonomous system (AS).

#### Why There is a Need for OSPF

• OSPF is designed for scalability and faster convergence in large networks.
• It uses a hierarchical structure with areas to reduce the amount of routing information exchanged.
• OSPF adapts to changes in network topology quickly.

#### How Does OSPF Work?

###### Neighbor Discovery

Routers discover neighboring routers using OSPF Hello packets and neighbors establish bidirectional communication to exchange routing information.

###### Shortest Path Calculation

OSPF routers use the Dijkstra algorithm to calculate the shortest path tree. The tree determines the best path to each network in the OSPF domain.

###### LSA Flooding

Routers flood LSAs to their neighbors, propagating information about link states. LSAs are only flooded within an OSPF area, reducing the amount of information exchanged.

###### Database Synchronization

Routers synchronize their LSDBs, ensuring a consistent view of the network topology. OSPF routers within an area have the same LSDB, facilitating accurate SPF tree calculation.

###### Routing Table Update

OSPF routers use the SPF tree to update their routing tables. Each router determines the next hop for each destination network based on the calculated shortest path.

### Enhanced Interior Gateway Routing Protocol (EIGRP)

EIGRP is a hybrid routing protocol, incorporating aspects of distance-vector and link-state protocols. It focuses on efficiency by minimizing the amount of information exchanged.

#### Why There is a Need for EIGRP?

• EIGRP provides rapid convergence by incrementally updating only routes that have changed.
• It supports unequal-cost load balancing, allowing routers to use multiple paths simultaneously.
##### How Does EIGRP Work?
###### Neighbor Discovery

Routers discover neighbors through Hello packets. EIGRP establishes neighbor relationships based on configurable parameters like the autonomous system number.

Routers exchange full routing tables during the initial neighbor establishment. Each router learns about each destination’s feasible successors (backup paths).

###### DUAL Algorithm

EIGRP uses the Diffusing Update Algorithm (DUAL) to calculate the best path to each destination. DUAL considers both the primary and backup paths, facilitating fast convergence.

###### Route Update and Queries

Incremental updates are sent when there is a change in the network. Routers query neighbors to find a feasible successor if a route is lost.

###### Topology Table Update

The topology table is updated based on information received from neighbors, and feasible successors are maintained for each destination to ensure quick recovery.

###### Routing Table Update

The best path is selected for each destination, and the routing table is updated accordingly.

### Border Gateway Protocol (BGP)

BGP is an inter-domain routing protocol between different autonomous systems (AS). It uses a path vector algorithm, considering policy-based routing decisions.

#### Why There is a Need for BGP?

• BGP is designed for the Internet’s scale, allowing diverse and policy-driven routing.
• It accommodates multiple paths to a destination, supporting path selection based on policies.

#### How Does BGP Work?

###### Neighbor Establishment

BGP routers establish TCP connections with neighboring routers. Peering relationships are established, forming the basis for BGP communication.

BGP routers advertise routes to their neighbors using UPDATE messages. Routes include path attributes such as AS path, next-hop, and route origin.

###### Path Selection

BGP uses the path vector algorithm to select the best route to a destination, and its decision factors include the shortest AS path, route origin, and local preferences.

###### Policy Enforcement

BGP routers enforce routing policies based on local configurations. These policies influence route selection and filtering.

###### Route Aggregation

BGP supports route aggregation to reduce the size of the routing tables. Aggregated routes represent a summary of multiple more minor routes.

###### Path Attributes and Route Filtering

BGP routers exchange information about path attributes to make informed routing decisions. Filtering mechanisms allow administrators to control which routes are accepted or rejected.

### Inter-Domain Routing

Inter-domain routing (IDR) is a broader term encompassing protocols like BGP for routing between different autonomous systems.

#### Why There is a Need for IDR?

• IDR is essential for connecting diverse networks, such as those operated by different Internet service providers (ISPs).
• It enables the Internet to function as a collection of interconnected ASes.

#### How Does IDR Work?

###### AS Number Assignment

Each autonomous system is assigned a unique Autonomous System Number (ASN). It identifies an AS on the Internet.

###### BGP Routing

BGP is commonly used for IDR between autonomous systems. BGP routers exchange routing information, allowing them to reach networks in other ASes.

###### Route Aggregation

IDR often involves route aggregation to minimize the size of routing tables. Aggregated routes represent multiple more minor routes, reducing the number of entries.

###### Policy-Based Routing

IDR allows for policy-based routing decisions between ASes. Policies define how routing decisions are made and influence route propagation.

###### Internet Exchange Points (IXPs)

IXPs facilitate the exchange of traffic between different ASes. Multiple ASes connect to a common point to exchange traffic efficiently.

###### Global Routing Table

The global routing table comprehensively views the Internet’s routing information. It includes entries for networks in various ASes and forms the basis for global Internet routing.

If you are looking for a one-stop shop resource to make your FE Electrical exam study, take a look at our FE Electrical Exam Prep resource.

We have helped thousands of FE exam students pass their exam with our proven, on-demand content, and live-training.

## Real-World Examples of Routing in Electrical Engineering

Understanding routing protocols goes beyond memorizing algorithms; it’s about optimizing data flow within electrical systems. For FE Electrical exam takers, grasping the practical applications of routing is crucial. Let’s explore how routing protocols play a vital role in various electrical engineering domains:

• Smart Grids: Imagine a network of interconnected power plants, substations, and renewable energy sources within a smart grid. Routing protocols like Open Shortest Path First (OSPF) ensure efficient communication between these components. OSPF dynamically calculates the most efficient paths for data packets carrying critical information like power generation data, energy consumption statistics, and control signals. This real-time data exchange is essential for optimizing power distribution, minimizing energy losses, and ensuring grid stability.
• Industrial Automation: Routing protocols are key in communication between programmable logic controllers (PLCs) and other devices within a factory automation system. Ethernet Routing Protocol (ERP) enables efficient data exchange between sensors, actuators, and control units. ERP ensures that control commands reach the intended devices promptly, optimizing production processes and maintaining system reliability.
• Building Automation Systems: Modern buildings rely on complex networks for lighting control, HVAC systems, and security functions. Routing protocols like Routing Information Protocol (RIP) facilitate communication between various building automation devices. RIP helps ensure efficient data flow for temperature regulation, lighting adjustments, and access control, contributing to energy efficiency and occupant comfort.

Understanding how routing protocols operate and their role in optimizing data flow equips electrical engineers to design and implement efficient communication networks, which are crucial for the functionality and performance of various electrical systems.

## Routing Algorithms for Routing in FE Electrical

Routing protocols are crucial components of network communication, facilitating the exchange of routing information between routers to determine the optimal path for data packets. This is called routing table optimization. Two fundamental categories of routing protocols are Distance Vector Routing and Link-State Routing.

### Distance Vector Routing vs. Link-State Routing

#### Distance Vector Routing

##### Working Algorithm
• Based on the Bellman-Ford algorithm.
• Routers exchange routing tables with their neighbors.
• Each router maintains a vector of distances (metrics) to reach destination networks.
##### Metric
• Typically uses hop count as the metric.
• Decisions are made based on the number of router hops to reach a destination.
##### Examples

Routing Information Protocol (RIP) is a classic distance vector protocol.

##### Working Algorithm
• Based on Dijkstra’s algorithm.
• Each router constructs a complete map (link-state database) of the network.
##### Metric
• Various metrics like bandwidth, delay, and reliability can be considered.
• Decisions are based on the shortest path calculated from the link-state database.
##### Examples

Open Shortest Path First (OSPF) is a standard link-state protocol.

### Metrics

Routing protocols use metrics to determine the best path to reach a destination. Common metrics include hop count, bandwidth, delay, reliability, and cost.

#### Critical Routing Protocol Metrics

##### Hop Count
• The number of routers or hops a packet must traverse to reach a destination.
• Commonly used in distance vector routing protocols.
• The shortest path is determined by the minimum hop count.
##### Bandwidth
• The amount of data that can be transmitted over a network link in a given time.
• Used to measure the capacity of a link.
• High bandwidth links are preferred for data-intensive applications.
##### Delay
• The time it takes for a packet to travel from source to destination.
• Reflects the propagation delay and transmission delay.
• Low delay values are favored for real-time applications.

### Routing Protocol Convergence and Path Selection Algorithms

#### Routing Protocol Convergence

It is defined as the time it takes for routers to agree on the network’s topology after a change.

##### Factors Influencing Convergence
• Topology Changes: Events like link failures trigger convergence.
• Routing Protocol Design: Distance vector protocols generally take longer to converge than link-state protocols.
##### Path Selection Algorithms
###### Dijkstra’s Algorithm
• It is used in link-state routing.
• It calculates the shortest path to each destination based on link weights.
###### Bellman-Ford Algorithm
• It is used in distance vector routing.
• It iteratively updates distance vectors until convergence is reached.