Computer Networks - Module 3 - 2024
Computer Networks - Module 3 - 2024
Network Layer
• Packet Switching
• The packets are then received, buffered, processed and forwarded by the
numerous routers along the way.
• Hence, there is a certain delay encountered at each router.
• Advantages:
• Since the bandwidth of a link is not dedicated (but shared with packets
from numerous hosts), the utilisation of the bandwidth is much higher.
• No set-up time.
• They define the logical addressing of the hosts as well as the datagram
(packet) format.
• The logical address is used to route the datagram from router to router, till
they are delivered to the destination host.
• Class D addresses are used for multicasting while class E is not used
• Therefore Class A networks are very large and can accommodate a huge
number of hosts within them, while Class C networks are very small.
• When leave the network of the organization, the private addresses are
converted to public addresses by the proxy server, and vice-versa.
• Private addresses:
– Class A: 10.0.0.0 to 10.255.255.255 --- 1 network
– Class B: 172.16.0.0 to 172.31.255.255 --- 16 networks
– Class C: 192.168.0.0 to 192.168.255.255 --- 256 networks
• Having subnets also leads to efficient routing of packets within the network.
• The subnet ID is created by borrowing bits from the host portion of the IP
address
• The mask for a Class A network with 4 subnets will have 10 ones followed by
22 zeros: 11111111 11000000 00000000 00000000, which is 255.192.0.0
• The mask for a Class A network with 256 subnets will 255.255.0.0 (same
as the default mask for Class B)
• Thus, the smallest allocation and routing block contained only 256 addresses - too
small for most enterprises, and the next larger block contained 65536 addresses -
too large to be used efficiently by even large organizations.
• In the CIDR notation for an IP address, the network address (or routing prefix)
is written with a suffix that indicates the number of bits of the prefix, such as
192.168.2.0/24.
• When a packet is divided into smaller fragments to comply with the MTU
restriction, each fragment of the packet will have the same Identification field
as the parent packet.
• Of the three bits in the Flag field, the first one is not currently defined/ used.
• In Datagram Packet switching, this decision must be made anew for every
arriving packet since the ‘best route’ may have changed since the last packet.
• In VC Packet switching, these decisions (at every router along the way) are
made when the VC is being set up. Thereafter, the packets are forwarded on
the pre-decided route.
• The output of the routing algorithm is stored as a Routing (look-up) Table, one
for each router.
Computer Networks - Prof Ashok Herur 46
Issues in Routing
• Finding the ‘best’ route is not always easy.
• The topology keeps changing: Lines may be added, may go down and would
be brought back later.
• A packet may have to travel through heterogeneous networks.
• Delay variability is high.
• Have to deal with Congestion in the network.
• Multicasting and broadcasting is difficult.
• The chosen routes remain static for a long period of time (could be days or
weeks too).
• They do not base their routing decisions on estimates of the current traffic or
short-term changes in topology.
• Flooding
• Path: A – B – E – F – H
• Distance metric = 8 units
B B 4
C F 8
D F 9
E F 5
F F 3
G F 12
H F 14
• Each node tries to forward every message to every one of its neighbours.
• This results in every message eventually being delivered to all reachable
parts of the network.
C
5
B
5
3 4
4 D
6 E 4
A
6
2 1
3 0 3
H
F 1 G 2
0
B C 8
C C 3
D D 4
E - 0
F F 2
G D 7
H D 9
5 3 5 3 Delay from E
Computer Networks - Prof Ashok Herur 67
Updated Distance Vector of router E
Destination Outgoing Delay (ms)
line
• The entry for Self (E A A 5
to E) will not be B C 8
determined by the
C C 3
updating method
shown in the D D 5
previous slide. E - 0
F F 3
• It will always be “0”.
G C 7
H C 9
Computer Networks - Prof Ashok Herur 68
Count-to-infinity problem
• One of the main drawbacks of the Distance Vector Routing algorithm is that
while “good news” travels fast, “bad news” take a long time to reach all the
routers in the subnet.
• The latter part is called “Count-to-infinity” problem.
• “Good news” is, for example, a link that was down earlier, coming back into
service.
• Then, Dijkstra’s algorithm can be run at each router to find the shortest path
to every other router.
Region 1 Region 2
1B
1A 1C
1B 1B 1
1C 1C 1
2 1B 2
3 1C 2
4 1C 3
5 1C 4