> For the complete documentation index, see [llms.txt](https://notes.mikaelsamvelian.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.mikaelsamvelian.com/linux-fundamentals/networking/signal-routing.md).

# 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="/files/pqETJYVBVxRsnfUgkyJP" 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://notes.mikaelsamvelian.com/linux-fundamentals/networking/signal-routing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
