CN - Unit 5
CN - Unit 5
Network Layer
Karan Padhiyar
IT Dept.
BVM
What is Network Layer?
Contents
1. Network Layer Design Issues [From Attached PDF]
Routing Algorithms:
Shortest Path Routing,
Flooding,
[From Attached PDF as
2. Distance Vector Routing,
well as Forouzan Ch-22]
Link State Routing,
Broadcast,
Multicast routing
[From Attached PDF as
3. Congestion Control Algorithms
well as Forouzan Ch-24]
4. Quality of Service [Forouzan Ch-24]
fig 5-1
Services Provided to the Transport Layer
• S er v i c es s h o u l d be i n d e p e n d e n t o f ro u t e r
technology
• Th e n etw o r k a ddr es s es ma de a va i l a bl e to
transport layer should use a uniform numbering
plan, even across LANs and WANs
Implementation of Connectionless Service
Routing within a diagram subnet.
Implementation of Connection-Oriented Service
Routing within a virtual-circuit subnet.
Comparison of Virtual-Circuit and Datagram Subnets
5-4
Routing Algorithms
• The Optimality Principle
• Shortest Path Routing
• Flooding
• Distance Vector Routing
• Link State Routing
• Broadcast Routing
• Multicast Routing
The Optimality Principle
It is
very simple to setup and implement, since a router
may know only its neighbours.
It is
extremely robust. Even in case of malfunctioning of a
large number routers, the packets find a way to reach the
destination.
(a) A subnet. (b) The link state packets for this subnet.
I n g e n e ra l , w e c a n d i v i d e c o n g e s t i o n c o n t r o l
mechanisms into two broad categories:
1. open-loop congestion control (prevention) and
2. closed-loop congestion control (removal).
Congestion
Congestion occurs when too many packets are
present in the network, causing network devices
such as routers and switches to become overloaded.
This can lead to packet loss, high latency, and
reduced network performance.
Congestion in a network typically happens when the
demand for network resources (like bandwidth)
exceeds the available capacity, causing excessive
packet queuing and potential packet drops.
Congestion Control vs Flow Control
Congestion Control: Focuses on preventing or
managing overload within the network (i.e., between
routers, switches, and other intermediary devices).
FIFO is the simplest type of scheduling where packets are processed in the
order they arrive. It does not prioritize any packet over another, so it may lead
to delays for time-sensitive packets if the queue is large.
1. 2 Scheduling – Priority queuing
This approach assigns a priority level to packets. Higher priority packets are sent first, while
lower priority packets may have to wait. This method ensures that critical packets, such as
voice or video data, are sent quickly, reducing latency for important applications.
In WFQ, different types of traffic are assigned different weights based on their importance or
bandwidth requirements. Packets are then sent in proportion to their assigned weights,
ensuring that more critical or bandwidth-intensive traffic receives more resources, while still
serving other types of traffic.
• RSVP Messages
Path messages
Resv messages
• Reservation merging
Figure 24.22 Path messages
Path Message: The sender sends a Path message downstream to establish a path
for the data packets. This message carries information about the sender and the
characteristics of the data flow.
Figure 24.23 Resv messages
Resv Message: The receivers respond with a Resv (reservation) message, which
travels upstream. This message specifies the resources that the receiver requires
(e.g., bandwidth).
Figure 24.24 Reservation merging
Resource Allocation: Routers along the path process these messages and allocate the
necessary resources. They maintain reservation states that dictate how much
bandwidth has been reserved for each flow.
Figure 24.25 Reservation styles
When several routers are attached in a network, they are known as a transient link.
Unrealistic topology: When all the routers are connected to each other, it is known as an
unrealistic topology.
Realistic topology: When some designated router exists in a network then it is known as a
realistic topology. Here designated router is a router to which all the routers are connected.
All the packets sent by the routers will be passed through the designated router.
Figure 22.28 Stub link
Stub link: It is a network that is connected to the single router. Data enters to the network
through the single router and leaves the network through the same router.
Figure 22.29 Example of an AS and its graphical representation in OSPF
Virtual link: If the link between the two routers is broken, the administration creates the
virtual path between the routers, and that path could be a long one also.
The Example Protocol – BGP
• Border Gateway Protocol
It is an interdomain routing protocol, and it uses the path-
vector routing. It is a gateway protocol that is used to
exchange routing information among the autonomous
system on the internet.
Figure 22.32 Internal and external BGP sessions
20-2 IPv4
8.Time to Live (TTL) (8 bits): The TTL f ie ld represents the maximum number of hops (routers or
network segments) that the packet can traverse before it is discarded. Each router decrements
this value by one.
9.Protocol (8 bits): This f ie ld indicates the type of protocol used in the data portion of the packet,
such as TCP, UDP, ICMP, or others.
10.Header Checksum (16 bits): The header checksum field is used to verify the integrity of the IPv4
header during transmission. Routers and devices recalculate this checksum to check for errors.
11.Source IP Address (32 bits): This f ie ld contains the IP address of the sender or source of the
packet.
12.Destination IP Address (32 bits): This f ield holds the IP address of the recipient or destination of
the packet.
Figure 20.6 Service type or differentiated services
Table 20.1 Types of service
Table 20.2 Default types of service
Table 20.3 Values for codepoints
Note
Solution
The HLEN value is 8, which means the total number
of bytes in the header is 8 × 4, or 32 bytes. The first 20
bytes are the base header, the next 12 bytes are the
options.
Example 20.3
Solution
The HLEN value is 5, which means the total number
of bytes in the header is 5 × 4, or 20 bytes (no
options). The total length is 40 bytes, which means
the packet is carrying 20 bytes of data (40 − 20).
Example 20.4
19.11
0
Figure 19.1 Dotted-decimal notation and binary notation for an IPv4 address
19.11
1
Example 19.1
Solution
We replace each group of 8 bits with its equivalent
decimal number (see Appendix B) and add dots for
separation.
19.11
2
Example 19.2
Solution
We replace each decimal number with its binary
equivalent (see Appendix B).
19.11
3
Example 19.3
Solution
a. There must be no leading zero (045).
b. There can be no more than four numbers.
c. Each number needs to be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal
notation is not allowed.
19.11
4
Figure 19.2 Finding the classes in binary and dotted-decimal notation
19.11
5
Example 19.4
Solution
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a
class C
address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E. 19.11
6
Table 19.1 Number of blocks and block size in classful IPv4 addressing
19.11
7
Table 19.2 Default masks for classful addressing
19.11
8
Figure 19.3 A block of 16 addresses granted to a small organization
19.11
9
Note
19.12
0
Note
19.12
1
Example 19.6
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 0010000
or
205.16.37.32.
This is actually the block shown in Figure 19.3. 19.12
2
Note
19.12
3
Example 19.7
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32 − 28 rightmost bits to 1, we get
11001101 00010000 00100101 00101111
or
205.16.37.47
This is actually the block shown in Figure 19.3.
19.12
4
Note
19.12
5
Example 19.8
Solution
The value of n is 28, which means that number
of addresses is 2 32−28 or 16.
19.12
6