Switching and Routing: Samson A School of Electrical & Computer Engineering, Hawassa Institute of Technology
Switching and Routing: Samson A School of Electrical & Computer Engineering, Hawassa Institute of Technology
Samson A
[email protected]
School of Electrical & Computer Engineering,
Hawassa Institute of Technology
Switching
• Introduction
• Switching Techniques
• Circuit Switching
• Message Switching
• Packet Switching
• Cell Switching
• Routing Techniques
Least Cost Algorithms
• Dijkstra algorithm and
• Bellman-Ford algorithm
• After connection setup, the datagrams can all follow the same path
• Graph Theory
• Routing Protocols
• Interior Gateway Routing Protocol
• Distance Vector Routing Protocol
• Link State Routing Protocl
• Routing Algorithm
• Least Cost Algorithm
• Dijkstra
• Bellman Ford
• Exterior Gateway Routing Protocol
Examples
•Communication networks
• Companies, telephone wires
•Social networks
• People, friendship/contacts
•Information networks
• Web sites, hyperlinks
•Biological networks
• Species, predation (food web). Or metabolic
pathways
07/16/21 Switching & Routing 27
Routing Algorithms
Distance Vector
Link-State
• Link-state routing protocols - road map
• Knows topological map used by each router
• Each router determines the shortest path to each
network
• Each router learns about its own links, its own directly connected networks.
This is done by detecting that an interface is in the up state.
• Each router is responsible for meeting its neighbors on directly connected
networks. Link state routers do this by exchanging Hello packets with other
link-state routers on directly connected networks.
• Each router builds a Link-State Packet (LSP) containing the state of each
directly connected link. This is done by recording all the pertinent
information about each neighbor, including neighbor ID, link type, and
bandwidth.
• Each router floods the LSP to all neighbors, who then store all LSPs
received in a database. Neighbors then flood the LSPs to their neighbors
until all routers in the area have received the LSPs. Each router stores a
copy of each LSP received from its neighbors in a local database.
• Each router uses the database to construct a complete map of the topology
and computes the best path to each destination network. Like having a
road map, the router now has a complete map of all destinations in the
topology and the routes to reach them. The shortest path first (SPF)
algorithm is used to construct the map of the topology and to determine the
best path to each network. Switching & Routing
07/16/21 34
Least Cost Algorithms
2 3 E
S 1
1 2
C D
1
for (y 1 to N)
6{
7 if (y is a neighbor)
8 D[y] c[myself ][y]
9 else
10 D[y] ∞
11 }
12 send vector {D[1], D[2], …, D[N]} to all neighbors
13 // Update (improve the vector with the vector received from a
neighbor)
14 repeat (forever)
15 {
16 wait (for a vector D from a neighbor w or any change in the link)
w
17 for (y 1 to N)
18 {
19 D[y] min [D[y], (c[myself ][w] D [y ])] // Bellman-Ford equation
w
20 }
21 if (any change in the vector)
22 send vector {D[1], D[2], …, D[N]} to all neighbors
23 }
24 } // End of Distance Vector
2 3 E
S 1
1 2
C D
1
Note:
• Works by repeatedly testing the vertices in the graph.
• The total number of iteration will be number of nodes minus
one.
• But the algorithm can converge before the final iteration.
07/16/21 Switching & Routing 42
. Source S A B C D E
Cost 0 2 5 1 ∞ ∞
Predecessor - S S S - -
Source S A B C D E
Cost 0 2 3 1 2 4
Predecessor - S D S C D
Source S A B C D E
Cost 0 2 3 1 2 4
Predecessor - S D S C D
07/16/21 Switching & Routing 43
5
3 B
. A
5
2
2 3 E
S 1
1 2
C D
1