CNN Assignment 3 PDF
CNN Assignment 3 PDF
Assignment-3
Q1. What do you mean by routing algorithm? Explain the differences between
adaptive and non-adaptive algorithms.
Ans. In computer networks, a routing algorithm is a set of rules that a computer network
uses to determine the best path for data to travel from one device to another. When
data is sent over a network, it is broken down into packets that need to travel through
various network devices to reach their destination. The routing algorithm helps
determine the most efficient and reliable path for the packets to take.
Routing algorithms consider various factors when determining the best path for packets,
such as the network topology, available bandwidth, and destination address. They may
also consider factors like network congestion, packet loss rates, and the reliability of
different network devices.
Different routing algorithms use different techniques to determine the best path for
packets. For example, distance vector routing algorithms use a simple hop count to
determine the shortest path between devices, while link-state routing algorithms
consider factors like the quality of links between devices and the overall network
topology.
Here are some differences between adaptive and non-adaptive algorithms in a tabular
manner:
Note that these are general differences between adaptive and non-adaptive algorithms
and not all algorithms may fit perfectly into one category or the other.
Q2. What do you mean by count to infinity problem in routing algorithm, discuss
it with an example.
Ans. The count to infinity problem is a potential issue that can occur in distance-vector routing
algorithms, where routers in a network may generate incorrect routing tables due to slow
convergence or incorrect updates.
In distance-vector routing algorithms, each router maintains a table that lists the
shortest path to every other router in the network. Routers periodically exchange routing
information with their neighbors, and based on this information, they update their routing
tables. The routers also use a metric, such as hop count or delay, to determine the
shortest path to other routers.
Suppose that the link between router B and router C fails. Router B will then send an
update to router A, indicating that the link to router C is no longer available. However,
suppose that router A does not receive this update immediately due to network
congestion or other factors. Router A will continue to advertise the link to router C to its
other neighbor, router B, assuming that the link is still active. Router B will then continue
to advertise this link to router C, which will in turn advertise it back to router A.
As a result, router A will incorrectly assume that the hop count to router C is decreasing,
eventually reaching infinity, causing a routing loop. This can cause packets to be
continuously forwarded between the routers, leading to network congestion and
performance degradation.
To prevent the count to infinity problem, distance-vector routing algorithms often use
techniques like route poisoning or hold-down timers, which allow routers to detect and
react to changes in the network topology more quickly.
Ans. Congestion in computer networking refers to a situation where there is more traffic on a
network than it can handle. This can lead to delays, packet loss, and reduced network
performance. Congestion control refers to techniques used to manage network congestion and
prevent it from becoming too severe.
Ans.
Parameter
Metric distance as the metric for path bandwidth, delay, and reliability, to
Convergence router must wait for updates from router has a complete view of the
to be shared. neighbors.
Can be less robust in the face of Can be more robust in the face of
System (IS-IS)
Ans. IPv4 and IPv6 are both Internet Protocol versions used for communicating data over
networks, but they have some significant differences in their frame structures.
IPv4 uses a 32-bit address, which limits the number of unique addresses that can be
assigned to devices on a network. This limitation has led to the depletion of available
IPv4 addresses, which has necessitated the adoption of IPv6. IPv6 uses a 128-bit
address, which allows for a significantly larger number of unique addresses to be
assigned to devices on a network.
In terms of their frame structures, IPv4 and IPv6 differ in the following ways:
1. Header Size: IPv4 headers are fixed in size, while IPv6 headers are larger and
have more flexible options. IPv4 headers are 20 bytes long and can be extended
by adding options. In contrast, IPv6 headers are at least 40 bytes long and
include a larger number of fields.
2. Checksum: IPv4 includes a checksum in the header to detect errors, while IPv6
does not have a checksum in its header. IPv6 relies on upper-layer protocols,
such as TCP and UDP, to handle error detection and correction.
3. Fragmentation: IPv4 routers can fragment packets if they exceed the Maximum
Transmission Unit (MTU) of a network, but IPv6 routers rely on end-to-end
fragmentation. This means that the sender is responsible for breaking up packets
that are too large for the destination network.
4. Options: IPv4 includes a limited number of options, while IPv6 includes a larger
number of options that provide greater flexibility. For example, IPv6 options can
be used to support mobility, security, and quality of service (QoS) features.
5. Addressing: IPv4 addresses are represented in dotted decimal notation (e.g.,
192.168.1.1), while IPv6 addresses are represented in hexadecimal notation with
colons (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334).
Q6. Explain the classification of different IP addresses. What do you mean by
subnetting? Explain with an example.
Ans. IP addresses are classified based on the number of bits used to identify the
network and host portions of the address. The most commonly used IP addressing
scheme is IPv4, which uses a 32-bit address space. The IPv4 address space is divided
into five classes, as follows:
1. Class A addresses: The first octet of a class A address is used to identify the
network, and the remaining three octets are used to identify the host. Class A
addresses range from 1.0.0.0 to 126.0.0.0, and they can support up to 126 different
networks, with each network supporting up to 16,777,214 hosts.
2. Class B addresses: The first two octets of a class B address are used to identify the
network, and the remaining two octets are used to identify the host. Class B addresses
range from 128.0.0.0 to 191.255.0.0, and they can support up to 16,384 different
networks, with each network supporting up to 65,534 hosts.
3. Class C addresses: The first three octets of a class C address are used to identify
the network, and the remaining octet is used to identify the host. Class C addresses
range from 192.0.0.0 to 223.255.255.0, and they can support up to 2,097,152 different
networks, with each network supporting up to 254 hosts.
4. Class D addresses: Class D addresses are used for multicast, which is a method of
sending a message to a group of hosts on a network. Class D addresses range from
224.0.0.0 to 239.255.255.255.
5. Class E addresses: Class E addresses are reserved for future use and are not
currently used in the public Internet.
In this example, each subnet has a network ID of 26 bits (the first three octets plus two
bits from the fourth octet), which allows for 64 possible hosts per subnet. By using
subnetting, we can divide a single Class C network into four smaller subnets, each with
its own network ID and range of available IP addresses.
Ans. The address "4F :: A234 :: 2" is an IPv6 address. It consists of 8 groups of 4
hexadecimal digits separated by colons, for a total of 128 bits.
In this address, each group has a value of 16 bits (4 hex digits), so the total length of the
address is 8 x 16 = 128 bits, which is the length of an IPv6 address. As the leftmost byte
can be written as, 004F which corresponds to:
Type prefix
Ans. Path-vector routing protocol is a type of routing protocol used in computer networks,
particularly in large-scale networks such as the Internet. It is a distance-vector protocol that
makes use of path information to determine the best path for data to travel between two
network nodes.
In path-vector routing, each router maintains a list of all the available paths to each
destination network in the network topology. Each entry in the routing table contains not
only the next hop for the destination network, but also the complete path to the
destination network, including the routers that the data must pass through to reach the
destination. This path information is known as the "vector" in path-vector routing.
When a router receives a routing update from a neighboring router, it compares the
vector for the updated path with its own vector for the same destination network. If the
new vector represents a better path than the current one, the router updates its routing
table with the new vector and propagates the update to its neighboring routers.
Path-vector routing is used primarily in border gateway protocol (BGP), which is used for
routing traffic between different autonomous systems (ASes) in the Internet. In BGP,
each router maintains a path vector that represents the complete path to the
destination AS, including the autonomous systems that the data must traverse to reach
the destination. This allows BGP routers to make more informed routing decisions
based on the full path information, rather than just the next hop.
One advantage of path-vector routing is that it allows for more granular control over
routing decisions, particularly in large-scale networks with complex routing policies.
However, it also requires more memory and processing power than simpler routing
protocols, and can be more prone to routing loops and other types of instability if not
configured properly.
Q9. What is the netmask of the gateway interface in a subnetwork where a maximum
of 25 hosts exist and the IP address of one of the hosts is 192.168.1.1?
Ans. To determine the netmask for the gateway interface in this subnetwork, we first need to
determine the number of host bits required to accommodate the maximum of 25 hosts.
The closest power of 2 that is greater than 25 is 32 (2^5). Therefore, we need 5 host bits
to accommodate 25 hosts. The remaining bits will be used for the network address.
The IP address of one of the hosts is given as 192.168.1.1. This IP address belongs to
the network address of the subnetwork. Therefore, we can use the first 3 octets (24
bits) for the network address, and the remaining 8 bits for the host address.
To determine the netmask, we can set all the network bits to 1s and all the host bits to
0s. The netmask in binary would be:
11111111.11111111.11111111.11100000
255.255.255.224
Therefore, the netmask for the gateway interface in this subnetwork is
255.255.255.224.
Q10. Give the IP address 180.25.21.172 and the subnet mask 255.255.192.0, what is
the subnet address?
IP Address:
10110100 00011001 00010101 10101100
Subnet mask:
11111111 11111111 10000000 00000000
Q11. A large FDDI ring has 100 stations and a token rotation time of 40 msec. The
token holding time is 10 msec. What is the maximum achievable efficiency of the ring?
Ans. Assumptions:
Every station has unlimited data to send
Data is sent for the whole token holding time
Q13. If a class B network on the internet has a subnet mask of 255.255.248.0. What is
the maximum number of hosts per subnet?
There are 21 bits set in subset. So, 11 bits are left for host ids. Total possible values of
host ids is 2**11 = 2048.
Out of those 2048 values 2 addresses are reserved.
Hence, the number of addresses usable for addressing specific hosts in each network is
2048 - 2 = 2046.
IP (Binary):
11001000 11000011 10111100 00000000
Subnet (Binary):
11111111 11111111 11111111 11100000
Subnet address:
11001000 11000011 10111100 11100000
1 1 1 0 0 0 0 0