# Signal Routing

### **Network Addresses**

In networks with routers, nodes need a way to address each other. Even if a router forwards signals to all its links like a hub, nodes must determine if they are the intended recipients of messages.&#x20;

This is achieved by assigning a unique identifier, called a **network address**, to each node. **Each message includes the recipient's identifier, allowing routers to know where to forward communications.** This system works best when addresses are assigned based on the network's geographical structure rather than randomly.

<figure><img src="https://1588585907-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MTwgToRvLjYdjfpAVgP%2Fuploads%2F7OOD6PiKvlLU4V01rmTR%2Fimage.png?alt=media&#x26;token=8e4e0eb6-1c76-4b89-b373-d5c78bd764ba" alt=""><figcaption><p>Nodes with addresses according to the router they’re connected to</p></figcaption></figure>

### **Routing Tables**

Routing is the process of selecting a path between two nodes across a network. Routers handle this task using a routing table, which tells the router where to forward communication for each node. For example, in the routing table below, router A forwards messages for node A2 on link 2, regardless of where it receives them from.

**Example Routing Table for Router A:**

| Destination | Link | Cost |
| ----------- | ---- | ---- |
| A1          | 1    | 4    |
| A2          | 2    | 2    |
| B?          | 3    | 5    |
| B?          | 4    | 8    |
| C?          | 3    | 9    |
| C?          | 4    | 6    |

The router chooses routes based on cost, which could be based on network delay or transmission cost. In this case, router A forwards communications for nodes starting with C on link 4 because it has a lower cost.

### **Forwarding Tables**

A forwarding table is a simplified version of the routing table. It only contains the optimal routes, which makes it smaller and faster for lookup, important for low-latency routing.

**Example Forwarding Table for Router A:**

| Destination | Link |
| ----------- | ---- |
| A1          | 1    |
| A2          | 2    |
| B?          | 3    |
| C?          | 4    |

### **Routing Protocols**

Routers can fail, and new nodes are added to networks often. To keep routing tables current, routers use routing protocols to communicate changes. For instance, if router A stops hearing from router C, it will update its table to send communications to C through router B.

### **Signal Relaying**

Signals can be relayed through a network using either circuit switching or packet switching.

### **Circuit Switching**

In a circuit-switched network, a dedicated communication channel is established for the duration of the call.

* **Example**: Early telephone networks required a switchboard operator to connect two telephones, creating a closed circuit.
* **Advantages**: Signal delay remains constant, and messages arrive in the same order.
* **Disadvantages**: Inefficient use of capacity, as other users cannot access the channel when it's idle (e.g., during pauses in conversation).

### **Packet Switching**

In a packet-switched network, data is divided into packets, which consist of a header and a payload.

* **Header**: Contains delivery information, such as sender and recipient addresses.
* Each router has a queue for incoming packets and forwards them based on its forwarding table.
* Packet-switching routers do not maintain state, meaning no channels are opened or closed at the routing level.
