MODULE – 3��Network Layer
Text Book 1: Chapter 18.1, 18.3, 18.4, 19.1, 22.2, 20.1-20.3.3, 21.3.2
Communication at the network layer
Introduction to Network Layer
Introduction to Network Layer
Introduction to Network Layer
Packetizing
Packetizing
Routing and Forwarding
Routing
Routing and Forwarding
Forwarding
Routing = Deciding where to go.
Forwarding = Actually sending the packet through interface.
Routing and Forwarding
Figure shows the idea of the forwarding process in a router.
This diagram shows how a router forwards packets using a forwarding table:
Forwarding value identifies output interface; router sends packet accordingly.
Forwarding value is the piece of information inside a packet that the router/switch uses to decide where to send it next.
Other Services
Error Control
Other services expected from the network layer
Other Services
Flow Control
Other Services
Congestion Control
Other Services
Quality of Service
Other Services
Security
NETWORK-LAYER PERFORMANCE
NETWORK-LAYER PERFORMANCE
Time taken for a packet to travel from source to destination.
NETWORK-LAYER PERFORMANCE
1. Delay
b. Propagation Delay
NETWORK-LAYER PERFORMANCE
1. Delay
b. Propagation Delay
Vacuum / Free space/wireless | | |
Optical fiber | | |
Copper cable (UTP, coax) | |
For example, if the distance of a cable link in a point-to-point WAN is 2000 meters and the propagation speed of the bits in the cable is 2 × 108 meters/second, then the propagation delay is 10 microseconds.
NETWORK-LAYER PERFORMANCE
1. Delay
c. Processing Delay
NETWORK-LAYER PERFORMANCE
1. Delay
d. Queuing Delay
NETWORK-LAYER PERFORMANCE
1. Delay
Total Delay: Assuming equal delays for the sender, routers, and receiver, the total delay (source-to- destination delay) a packet encounters can be calculated if we know the number of routers, n, in the whole path.
If a packet goes from source → n routers → destination:
NETWORK-LAYER PERFORMANCE
NETWORK-LAYER PERFORMANCE
Throughput
Step 3: Data reaches Router R2 (Link3 starts)
Link3 has a capacity of 150 kbps.
But the incoming data rate from Link2 is only 100 kbps.
Since there isn’t enough data (only 100 kbps available), Link3 also operates at 100 kbp
Step 4: Conclusion
The overall throughput of the path is 100 kbps.
Why? Because throughput is always limited by the bottleneck link (the slowest link).
Here, the bottleneck is Link2 (100 kbps).
General Formula
Throughput = minimum {TR₁, TR₂, …, TRₙ}`
NETWORK-LAYER PERFORMANCE
Throughput
NETWORK-LAYER PERFORMANCE
Throughput
NETWORK-LAYER PERFORMANCE
Packet Loss
NETWORK-LAYER PERFORMANCE
Congestion Control
Mechanism for improving performance
NETWORK-LAYER PERFORMANCE
Congestion Control
open-loop congestion control (prevention) and closed-loop congestion control (removal).
NETWORK-LAYER PERFORMANCE
Open-Loop Congestion Control
NETWORK-LAYER PERFORMANCE
Open-Loop Congestion Control
NETWORK-LAYER PERFORMANCE
Open-Loop Congestion Control
NETWORK-LAYER PERFORMANCE
Closed-Loop Congestion Control
NETWORK-LAYER PERFORMANCE
Closed-Loop Congestion Control
Backpressure
NETWORK-LAYER PERFORMANCE
Node III in the figure has more input data than it can handle. It drops some packets in its input buffer and informs node II to slow down. Node II, in turn, may be congested because it is slowing down the output flow of data. If node II is congested, it informs node I to slow down, which in turn may create congestion. If so, node I informs the source of data to slow down.
Closed-Loop Congestion Control
Backpressure
NETWORK-LAYER PERFORMANCE
Closed-Loop Congestion Control
Choke Packet
NETWORK-LAYER PERFORMANCE
Closed-Loop Congestion Control
Implicit Signaling
Explicit Signaling
IPV4 ADDRESSES
Address Space
IPV4 ADDRESSES
Notation: There are three common notations to show an IPv4 address:
IPV4 ADDRESSES
IPV4 ADDRESSES
IPV4 ADDRESSES
Figure shows the prefix and suffix of a 32-bit IPv4 address
Address Space
Hierarchy in Addressing
IPV4 ADDRESSES
Class A
Class B
IPV4 ADDRESSES
Class C
Class D is not divided into prefix and suffix. It is used for multicast addresses(sending data to a group of hosts at once).
Class E is not divided into prefix and suffix and is used as reserve.
IPV4 ADDRESSES
Class A
0.0.0.0 to 127.0.0.0
IPV4 ADDRESSES
Classful Addressing
Identifies the network Identifies a specific device
First octet: 0-127 (binary: 00000000-01111111)
Class B
IPV4 ADDRESSES
Classful Addressing
135.168.24.14 First octet: 128-191 (binary: 10000000-10111111)
Class C
192.168.178.1
IPV4 ADDRESSES
Classful Addressing
First octet: 192-223 (binary: 11000000-11011111)
Class D
227.16.6.176
IPV4 ADDRESSES
Classful Addressing
Class E
243.164.89.28
IPV4 ADDRESSES
Classful Addressing
IPV4 ADDRESSES
Classful Addressing
Most organizations didn’t need millions of devices, maybe only thousands.
IPV4 ADDRESSES
Classful Addressing
Two strategies were proposed to address depletion: subnetting and supernetting.
IPV4 ADDRESSES
Classful Addressing
IPV4 ADDRESSES
Classful Addressing
IPV4 ADDRESSES
An ISP has the address block 192.168.0.0/24 (256 addresses).
A customer needs 64 addresses → ISP can assign 192.168.0.0/26
Another customer needs 32 addresses → ISP can assign 192.168.0.64/27
Another customer needs 16 addresses → ISP can assign 192.168.0.96/28
IPV4 ADDRESSES
000000 → 192.168.0.0
000001 → 192.168.0.1
000010 → 192.168.0.2
...
111111 → 192.168.0.63
32 addresses
So, a block of 32 addresses = /27
IPV4 ADDRESSES
IPV4 ADDRESSES
Classless Addressing
IPV4 ADDRESSES
The IPv4 header
IPV4 ADDRESSES
The IPv4 header/ IPV4 Datagram
IPV4 ADDRESSES
The IPv4 header/ IPV4 Datagram
Header:
IPV4 ADDRESSES
IPV4 ADDRESSES
IPV4 ADDRESSES
Fragmentation in IPv4:�If a packet is too large for a network (exceeds the MTU-Maximum Transmission Unit), routers can fragment it into smaller packets.
Extracting Information from an Address Block
IPV4 ADDRESSES
Classless Addressing
Example: if /27, then N = 2^(32−27) = 32 addresses.
Change the remaining bits (host part) to 0s.
This gives the starting address of the block.
Change the remaining bits to 1s.
This gives the ending address of the block.
Extracting Information from an Address Block
IPV4 ADDRESSES
Classless Addressing
00010 → last bit = 0 → address = 167.199.170.66
167.199.170.64
IPV4 ADDRESSES
Classless Addressing
Address Mask
IPV4 ADDRESSES
Classless Addressing
Step 1: Subnet mask
11111111.11111111.11111111.11100000
Step 2: Number of addresses
Mask: 11111111.11111111.11111111.11100000
NOT(mask): 00000000.00000000.00000000.00011111
Address Mask
IPV4 ADDRESSES
Classless Addressing
Step 4: Last address
Address: 10100111.11000111.10101010.01010010
NOT(mask): 00000000.00000000.00000000.00011111
------------------------------------------------
Result: 10100111.11000111.10101010.01011111
Step 3: First address
Address: 10100111.11000111.10101010.01010010
Mask: 11111111.11111111.11111111.11100000
-------------------------------------------
Result: 10100111.11000111.10101010.01000000
Network Address
IPV4 ADDRESSES
Network Address
IPV4 ADDRESSES
Block Allocation
IPV4 ADDRESSES
Block Allocation
IPV4 ADDRESSES
Subnetting
IPV4 ADDRESSES
Designing subnets
The steps need to be carefully followed to guarantee the proper operation of the subnetworks.
Subnetting
IPV4 ADDRESSES
Subnetting
Example: An organization has a block starting at 14.24.74.0/24, with 256 addresses, and needs three subnetworks: one with 120, one with 60, and one with 10 addresses.
The remaining 48 addresses are reserved, ranging from 14.24.74.208 to 14.24.74.255.
IPV4 ADDRESSES
Subnetting
IPV4 ADDRESSES
Address Aggregation
Example: An ISP has four smaller blocks, each serving a separate organization, but it can combine them into one larger advertised block. This consolidation streamlines routing for all incoming traffic destined for the ISP.
IPV4 ADDRESSES
Address Aggregation
IPV4 ADDRESSES
Special IPv4 Addresses
IPv4 includes addresses reserved for specific purposes:
IPV4 ADDRESSES
DHCP – DYNAMIC HOST CONFIGURATION PROTOCOL
DHCP – DYNAMIC HOST CONFIGURATION PROTOCOL
How DHCP works
DHCP – DYNAMIC HOST CONFIGURATION PROTOCOL
DHCP – DYNAMIC HOST CONFIGURATION PROTOCOL
DHCP message format
DHCP – DYNAMIC HOST CONFIGURATION PROTOCOL
DHCP message format
DHCP – DYNAMIC HOST CONFIGURATION PROTOCOL
DHCP message format
DHCP – DYNAMIC HOST CONFIGURATION PROTOCOL
DHCP message format
DHCP messages have a specific format, shown in Figure 18.25. The key fields in a DHCP message include:
Options: Contains settings and parameters, divided into:
DHCP – DYNAMIC HOST CONFIGURATION PROTOCOL
DHCP message format
The tag field’s value may vary depending on the option type. For instance, if the tag is 53, the value field specifies one of the eight DHCP message types, as seen in Figure 18.26.
These message types help manage the IP address assignment process, making it easier for network devices to connect dynamically to networks.
Option format
DHCP – DYNAMIC HOST CONFIGURATION PROTOCOL
DHCP message format
Option format
DHCP – DYNAMIC HOST CONFIGURATION PROTOCOL
DHCP Operation
DHCP lease time is the amount of time a device is allowed to use a specific IP address from a DHCP server.
DHCP – DYNAMIC HOST CONFIGURATION PROTOCOL
DHCP Operation
DHCP – DYNAMIC HOST CONFIGURATION PROTOCOL
DHCP – DYNAMIC HOST CONFIGURATION PROTOCOL
Two Well-Known Ports
DHCP – DYNAMIC HOST CONFIGURATION PROTOCOL
Error Control in DHCP
DHCP employs two strategies:
The checksum helps detect errors in data during transmission.� It checks if the message was damaged or changed while traveling through the network.
2. Clients use random timers for retransmissions to avoid congestion when multiple clients request IPs simultaneously.
Network Address Translation (NAT)
NAT (Network Address Translation) helps manage limited public IP addresses by allowing a network to use private IP addresses internally. When a device on this network connects to the Internet, the NAT router swaps its private IP with a single public IP address that the ISP provides. This way, the network stays hidden from the outside Internet, making it more secure.
Public IP (49.207.118.25)
Your Wi-Fi router connects all your home devices (like phone, laptop, and TV) using private IP addresses — for example:
Phone → 192.168.1.2
Laptop → 192.168.1.3
TV → 192.168.1.4
Network Address Translation (NAT)
Device | Interface | IP Address | Network |
PC1 | FastEthernet 0 | 192.168.1.10 | 192.168.1.0/24 |
PC2 | FastEthernet 0 | 192.168.1.11 | 192.168.1.0/24 |
Router (Inside Interface) | GigabitEthernet 0/0 | 192.168.1.1 | GATEWAY |
Device | Interface | IP Address | Network |
Router (Outside Interface) | GigabitEthernet 0/1 | 203.0.113.1 | 203.0.113.0/24 |
Web Server | Ethernet 0 | 203.0.113.50 | 203.0.113.0/24 |
Network Address Translation (NAT)
Using One IP Address
Basic NAT configurations involve a translation table with two columns: private and external addresses. Communication must be initiated from the private network to maintain proper routing for responses
Network Address Translation (NAT)
Using a Pool of IP Addresses
To let many private devices connect to the internet at the same time, NAT can use a pool of public (global) IP addresses.�This means several private devices can reach the same website, but the number of active connections may depend on how many public IPs are available.
To handle many-to-many connections more efficiently, NAT also uses port numbers along with IP addresses.�Each device gets a different port number, so even if they all use the same public IP, the router can still tell which response belongs to which device.
THE IPv6 PROTOCOL
In the new design, options are kept separate from the main header and added only when needed.�This makes routing faster and easier, because routers don’t have to waste time checking extra, unused options.
New Options:
Protocol Extension:
THE IPv6 PROTOCOL
IPv6 Packet Format
The IPv4 base header size is 20 bytes.
If options are added, the header can grow up to 60 bytes
THE IPv6 PROTOCOL
IPv6 Packet Format
Base Header Fields:
THE IPv6 PROTOCOL
IPv6 Packet Format
IPv6 uses 128 bits for addressing, compared to IPv4's 32-bit address space.
THE IPv6 PROTOCOL
IPv6 Packet Format
IPv6 datagram
Information for routing and handling the packet through the network
Actual data being transmitted
THE IPv6 PROTOCOL
IPv6 Packet Format
Payload Structure:
Next Header (8 bits):
THE IPv6 PROTOCOL
IPv6 Packet Format
Concept of Flow and Priority:
THE IPv6 PROTOCOL
IPv6 Packet Format
Fragmentation and Reassembly in IPv6
In IPv6, fragmentation and reassembly of datagrams are handled differently compared to IPv4.
1. Source Fragmentation Only:
IPv6 Restriction: Only the source host is allowed to fragment packets. Routers are not permitted to perform fragmentation, which streamlines their processing and enhances routing efficiency.
2. Reassembly at Destination:
Reassembly Process: The reassembly of fragmented packets occurs at the destination host. This approach minimizes the processing load on routers, allowing them to forward packets more quickly.
THE IPv6 PROTOCOL
IPv6 Packet Format
Fragmentation and Reassembly in IPv6
3. Source Control:
4. Router Handling:
THE IPv6 PROTOCOL
Extension Header
An IPv6 packet consists of a base header (40 bytes) followed by optional extension headers. Up to six types of extension headers can be added to enhance functionality.
Types of Extension Headers
Example: A “Router Alert” option tells the router: “Hey, pay attention to this packet for special processing”.
THE IPv6 PROTOCOL
Extension Header
2. Destination Option
3. Source Routing
4. Fragmentation
THE IPv6 PROTOCOL
Extension Header
5. Authentication
6. Encrypted Security Payload (ESP)
THE IPv6 PROTOCOL
Comparison of Options between IPv4 and IPv6
IPv4: Uses No-Operation (NOP) for 1 byte, End-of-Option (EOO) to mark the end.
IPv6: Uses Pad1 (1 byte) and PadN (multiple bytes) → simpler and more efficient.
IPv4: Can record the path the packet takes.
IPv6: Not implemented → rarely used in IPv4.
IPv4: Can record timestamps at each router.
IPv6: Not implemented → rarely used in IPv4.
THE IPv6 PROTOCOL
Comparison of Options between IPv4 and IPv6
IPv4: Loose or strict source routing in the options field.
IPv6: Source Routing Extension Header → separate extension header for specifying the route.
IPv4: Fragmentation fields are in the main header; routers can fragment.
IPv6: Fragmentation moved to a separate extension header; only the source can fragment.
IPv4: No built-in security headers.
IPv6: Adds Authentication Header (AH) and Encrypted Security Payload (ESP) extension headers.
Chapter 20 �Unicast Routing
Unicast Routing
Unicast Routing
Graph Model: The Internet can be modeled as a graph where:
Unicast Routing
Least-Cost Trees in Unicast Routing
Unicast Routing
Least-Cost Trees in Unicast Routing: Properties of Least-Cost Trees:
Bidirectional Equivalence: The least-cost path from one router to another has the same cost in both directions, even though the sequence of routers is reversed.
Route Combination: To find the best route from one router to another, you can split the journey between two points.
Unicast Routing
Least-Cost Trees in Unicast Routing:
can be constructed using both Bellman-Ford and Dijkstra's Algorithm
ROUTING ALGORITHMS
Distance-Vector Routing
ROUTING ALGORITHMS
Distance-Vector Routing
Three Keys to understand the working of Distance Vector Routing Algorithm:
Knowledge about the whole network: Each router shares its knowledge through the entire network. The Router sends its collected knowledge about the network to its neighbors.
Routing only to neighbors: The router sends its knowledge about the network to only those routers which have direct links. The router sends whatever it has about the network through the ports. The information is received by the router and uses the information to update its own routing table.
Information sharing at regular intervals: Within 30 seconds, the router sends the information to the neighboring routers.
ROUTING ALGORITHMS
Distance-Vector Routing
ROUTING ALGORITHMS
The term min₍v₎ means we consider all the neighbors of x. After going from x to a neighbor v, the total path cost to y is c(x, v) + Dᵥ(y). The least cost from x to y is the smallest of these values among all neighbors.
Distance-Vector Routing
ROUTING ALGORITHMS
Distance-Vector Routing
ROUTING ALGORITHMS
Distance-Vector Routing
if distance[u] + w < distance[v]: distance[v] = distance[u] + w
ROUTING ALGORITHMS
Bellman-Ford Equation
Bellman ford algorithm is a single-source shortest path algorithm.
This algorithm is used to find the shortest distance from the single vertex to all the other vertices of a weighted graph.
Initial State
Bellman-Ford Equation
Each route option has two parts:
Bellman-Ford Equation
Bellman-Ford Equation
Bellman-Ford Equation
Step 1: Let the given source vertex be 0. Initialize all distances as infinite, except the distance to the source itself. Total number of vertices in the graph is 5, so all edges must be processed 4 times.�
Bellman-Ford Equation
Step 2: Let all edges are processed in the following order: (B, E), (D, B), (B, D), (A, B), (A, C), (D, C), (B, C), (E, D). We get the following distances when all edges are processed the first time. The first row shows initial distances. The second row shows distances when edges (B, E), (D, B), (B, D) and (A, B) are processed. The third row shows distances when (A, C) is processed. The fourth row shows when (D, C), (B, C) and (E, D) are processed.
Bellman-Ford Equation
Step 3: The first iteration guarantees to give all shortest paths which are at most 1 edge long. We get the following distances when all edges are processed second time (The last row shows final values).
Bellman-Ford Equation
Step 4: The second iteration guarantees to give all shortest paths which are at most 2 edges long. The algorithm processes all edges 2 more times. The distances are minimized after the second iteration, so third and fourth iterations don’t update the distances.�
Bellman-Ford
Vertex | Initial (∞ except A=0) | After 1st Iteration | After 2nd Iteration | After 3rd Iteration | After 4th Iteration |
A | 0 | 0 | 0 | 0 | 0 |
B | ∞ → 2 (A→B) | 2 | 2 | 2 | 2 |
C | ∞ → 2 (A→C) | 2 | 2 | 2 | 2 |
D | ∞ → 5 (B→D) → 1 (E→D) | 5 | 1 | 1 | 1 |
E | ∞ → 6 (C→E) | 6 | 6 | 6 | 6 |
Bellman-Ford Equation
Bellman-Ford Equation
Bellman-Ford Equation
Bellman-Ford Equation
Bellman-Ford Equation
Bellman-Ford Equation
Bellman-Ford Equation
Bellman-Ford Equation
Distance-vector routing
Two-Node Loop Example:�When router A’s link to destination X fails, A marks X as unreachable.�But router B doesn’t know yet and still thinks it can reach X.�So B tells A it can reach X, and A updates its table to use B as the path.�Then A tells B the same thing — this keeps repeating.�As a result, packets loop between A and B until both realize that X is truly unreachable.
Distance-vector routing
Distance-vector routing
Solutions
Link-State Routing
Link-State Routing
In Bellman-Ford:
In Dijkstra:
Link-state database (LSDB).
Link-state database (LSDB).
Steps in Dijkstra’s Link-State Routing
Link-state database (LSDB).
The three keys to understand the Link State Routing algorithm:
Link State Packet
Link State Packet
Link State Routing has two phases:
Link State Packet
Link State Packet
Notations Used:
Link State Packet
Algorithm
Formation of Least-Cost Trees (Dijikstra’s Algorithm)
To create a least-cost tree for itself, using the shared LSDB, each node needs to run the famous Dijkstra Algorithm. This iterative algorithm uses the following steps:
1. The node chooses itself as the root of the tree, creating a tree with a single node, and sets the total cost of each node based on the information in the LSDB.
2. The node selects one node, among all nodes not in the tree, which is closest to the root, and adds this to the tree. After this node is added to the tree, the cost of all other nodes not in the tree needs to be updated because the paths may have been changed.
3. The node repeats step 2 until all nodes are added to the tree.
Dijkstra's algorithm
Dijkstra's algorithm - is a solution to the single-source shortest path problem in graph theory.
Works on both directed and undirected graphs. However, all edges must have nonnegative weights.
Approach: Greedy
Input: Weighted graph G={E,V} and source vertex v∈V, such that all edge weights are nonnegative
Output: Lengths of shortest paths (or the shortest paths themselves) from a given source vertex v∈V to all other vertices
Dijkstra's algorithm - Pseudocode
dist[s] ←0 (distance to source vertex is zero)�for all v ∈ V–{s}� do dist[v] ←∞ (set all other distances to infinity) �S←∅ (S, the set of visited vertices is initially empty) �Q←V (Q, the queue initially contains all vertices) �while Q ≠∅ (while the queue is not empty) �do u ← mindistance(Q,dist) (select the element of Q with the min. distance) � S←S∪{u} (add u to list of visited vertices) � for all v ∈ neighbors[u] � do if dist[v] > dist[u] + w(u, v) (if new shortest path found)� then d[v] ←d[u] + w(u, v) (set new value of shortest path)
(if desired, add traceback code)
return dist
Dijkstra’s Example
Dijkstra’s Example
Dijkstra’s Example
Dijkstra’s Example
Dijkstra Animated Example
Dijkstra’s Example
Dijkstra’s Example
Dijkstra’s Example
Dijkstra’s Example
Bellman Ford vs Dijkstra’s
Path-Vector Routing
Path-Vector Routing
Path-Vector Routing
Path-Vector Routing
Path-Vector Routing
Spanning trees
all possible intermediate nodes
Path-Vector Routing
Path-Vector Routing
Path-Vector Routing
Path-Vector Routing
Path-Vector Routing
3. Node C: Knows paths to its neighbors B, D, and E, so it lists routes to B (through C), itself (directly), D (through C), and E (through C).
4. Node D: Knows paths to its neighbors B, C, and E. Its path vector lists routes to B, C, D, and E, showing how it can reach these nodes.
5. Node E: Lists paths to its neighbors C and D and itself. Its path vector shows routes to C, D, and E.
Path-Vector Routing
�
1. Wait for a neighbor to send new path information.
2. For each destination:
3. If anything changes, tell all neighbors the new paths.
�UNICAST ROUTING PROTOCOLS �
�UNICAST ROUTING PROTOCOLS �
�UNICAST ROUTING PROTOCOLS �
Hierarchical routing
Hierarchical Routing
�UNICAST ROUTING PROTOCOLS �
Hosts that are physically or logically close in the network should have the same prefix.
Host A: 192.168.1.5
Host B: 192.168.1.8
Host C: 192.168.2.3
Hierarchical Routing
�UNICAST ROUTING PROTOCOLS �
Hierarchical Routing
Components of Hierarchical Routing:
�UNICAST ROUTING PROTOCOLS �
Hierarchical Routing
Autonomous Systems (AS)
�UNICAST ROUTING PROTOCOLS �
Hierarchical Routing
Autonomous Systems (ASs)
�UNICAST ROUTING PROTOCOLS �
Stub AS:
Multihomed AS:
Hierarchical Routing
Autonomous Systems (ASs)
�UNICAST ROUTING PROTOCOLS �
Multiple networks can exist inside a single AS, but they are all managed together under one ASN.
AS 65001
├─ Network 1 → Hosts A, B, C
├─ Network 2 → Hosts D, E
└─ Network 3 → Hosts F, G, H
Routing Information Protocol
Routing Information Protocol
Routing Information Protocol
Routing Information Protocol
How is hop count determined?
Routing Information Protocol
Routing Information Protocol
Routing Information Protocol
If there are 8 routers in a network where Router 1 wants to send the data to Router 3.
If the network is configured with RIP, it will choose the route which has the least number of hops. There are three routes in the above network, i.e., Route 1, Route 2, and Route 3.
The Route 2 contains the least number of hops, i.e., 2 where Route 1 contains 3 hops, and Route 3 contains 4 hops, so RIP will choose Route 2.
Routing Information Protocol
RIP Algorithm
Routing Information Protocol
In RIP, when a router receives a route update from a neighbor, it follows these rules to update its forwarding table:
New Route: If the received route doesn't exist in the old table, it is added.
Better Cost: If the received route has a lower cost (fewer hops), it is preferred.
Same Next-Hop: If the received route has a higher cost but the next-hop router is the same, the received route is chosen.
Routing Information Protocol
Number of hops from source router A to various subnets
Routing Information Protocol
Routing Information Protocol
How RIP updates its Routing table
→ modifies the local routing-table and
→ propagates then this information by sending advertisements to its neighbors.
Routing Information Protocol
How RIP updates its Routing table
→ list of up to 25 destination subnets within the AS and
→ sender’s distance to each of those subnets. Response-messages are also known as advertisements.
• Both types of messages are sent over UDP using port# 520.
• The UDP segment is carried between routers in an IP datagram.
Routing Information Protocol
How RIP updates its Routing table
How RIP updates its Routing table
Routing Information Protocol
Performance of RIP (Routing Information Protocol)
Routing Information Protocol
Performance of RIP (Routing Information Protocol)
Routing Information Protocol
OSPF - Open Shortest Path First
OSPF - Open Shortest Path First
To send a packet from one area to another:
OSPF Protocol
OSPF Protocol
Imagine a company network (AS):
Divide the network into areas:
Routers:
How a packet travels:
OSPF Protocol- OSPF Working Steps:�
A neighbor relationship in OSPF, it first establishes a Router ID (RID):
Router ID (RID): A unique identifier in the format of an IPv4 address, which distinguishes each router on the network.
Setting the RID: The router ID can be set manually by the network administrator or automatically by the router. If set automatically, the router typically selects the highest IP address on its active interfaces.
The following is the logic that the router chooses to set the router ID:
OSPF Protocol
OSPF Protocol - Types of links in OSPF
3. Stub Link: A network with only one router connection, all traffic goes through that router.
4. Virtual Link: A backup link set by the admin when the direct connection fails; may take a longer path.
OSPF Protocol – transition states
OSPF Protocol
Advanced Features of OSPF:
Security:
OSPF exchanges can be authenticated to ensure only trusted routers participate.
Two types of authentication:
3. Multiple Same-Cost Paths: OSPF supports load balancing by allowing multiple paths to a destination if they have the same cost.
OSPF Protocol
Advanced Features of OSPF:
Integrated Unicast and Multicast Routing:
Hierarchical Structure:
BGP(Border Gateway Protocol )
BGP(Border Gateway Protocol )
Using BGP
BGP(Border Gateway Protocol )
BGP(Border Gateway Protocol )
• Two types of session:
1) External BGP (eBGP) session
Is a BGP session established between two routers in different autonomous systems (AS). This session is used to exchange routing information across AS boundaries, allowing routers to communicate routes between distinct networks
2) Internal BGP (iBGP) session
An Internal BGP (iBGP) session is a BGP session established between routers within the same autonomous system (AS). Unlike eBGP, which connects different ASs, iBGP is used to exchange routing information between routers in the same AS.
BGP(Border Gateway Protocol ) - Operation of External BGP (eBGP):�
BGP(Border Gateway Protocol )
BGP(Border Gateway Protocol )
Update Messages in eBGP:
Routing Table Updates:
BGP(Border Gateway Protocol )
Limitations in eBGP:
Solution - iBGP:
BGP(Border Gateway Protocol )
eBGP and iBGP sessions
BGP(Border Gateway Protocol )
Path Attributes and BGP Routes
BGP selects the best route based on path attributes. Path attributes are used to store and display information about the path in the routing table, which follows the path-vector routing approach. These attributes help BGP determine the best route.
Multicast Link State (MOSPF)
Multicast Link State (MOSPF)
Multicast Link State (MOSPF)
A university campus network (inside one AS) is streaming a live lecture from the main server to students in different departments who have joined the multicast group 224.1.1.1.
Multicast Link State (MOSPF)
Multicast Link State (MOSPF)
The main intention of the whole process is to deliver packets from the source (S) to all routers that have G1 members.
If a path has no active G1 users, the router stops sending packets there (prunes it). So packets travel only where G1 is active.
(a) Active groups: Some routers have users who joined groups like G1, G2, or G3. The network shows where these group members are located.
(b) S–G1 shortest-path tree Source S starts sending data to G1 members. The shortest paths from S to all G1 receivers are built.
(c) S–G1 subtree (router view): Each router looks at only its part of the tree. It checks which paths go toward G1 members.
(d) S–G1 pruned subtree: Routers remove paths that have no G1 members. Only the branch with real G1 receivers is kept to save bandwidth.