0% found this document useful (0 votes)
12 views

CNN Assignment 3 PDF

c
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

CNN Assignment 3 PDF

c
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Computer Network (KCS-603)

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:

Factor Adaptive Routing Non-Adaptive Routing


Algorithm Algorithm

Definition A type of algorithm that A type of algorithm that


can change its behavior has a fixed behavior that
based on the changes in does not change
the input or the regardless of the input or
environment. environment changes.

Response to Change Can adjust to changes in Cannot adjust to changes


the input or environment and will produce the same
by changing its behavior or output regardless of
parameters. changes in the input or
environment.
Complexity Tend to be more complex Tend to be less complex
as they need to continually as they have a fixed
adapt to changes. behavior.

Performance Tend to have better Tend to have a lower


performance as they can performance as they have
optimize their behavior a fixed behavior that may
based on the input or not be optimal for all
environment. situations.

Implementation Requires more complex Can be implemented on


hardware and software simpler hardware and
implementations. software.

Examples OSPF, RIP, BGP Distance Vector Routing


Protocol (DVRP), Link
State Routing Protocol

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.

For example: consider a simple network consisting of three routers A, B, and C, as


shown below:
(2)
A ---------------- B
\ /
\ /
(5) (1)
\ /
\ /
C

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.

Q3. What do you mean by congestion? Explain open-loop and closed-loop


congestion control techniques.

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.

Open-loop congestion control techniques are also known as preventative or proactive


congestion control techniques. They aim to prevent congestion from occurring in the
first place by controlling the rate at which data is sent into the network. One common
open-loop technique is traffic shaping, which regulates the flow of traffic by delaying or
queuing packets at the network edge before they enter the congested area. By
controlling the rate of traffic entering the network, traffic shaping can prevent congestion
from occurring and ensure that the network operates within its capacity limits.
Closed-loop congestion control techniques, also known as reactive or feedback-based
techniques, are used to respond to congestion after it has occurred. These techniques
rely on feedback from the network to adjust the rate at which data is sent. One common
closed-loop technique is called explicit congestion notification (ECN), which involves
routers marking packets with an indication of congestion before they are dropped. The
receiving end can use this information to adjust the transmission rate and reduce the
amount of traffic on the network.
Another example of a closed-loop technique is the transmission control protocol (TCP),
which is used for reliable data transmission over the internet. TCP uses a congestion
control algorithm that constantly monitors the network and adjusts the transmission rate
accordingly. When congestion is detected, TCP reduces its transmission rate to reduce
the amount of traffic on the network. Once the congestion has cleared, TCP gradually
increases the transmission rate again.

Q4. Differentiate between distance vector and linked state routing.

Ans.

Distance Vector Routing Protocol Link State Routing Protocol

Parameter

Each router shares information about


Each router shares its routing
Information Shared the entire network with all routers in the
table with its neighbors.
network.

Typically uses hop count or Can use a variety of metrics, such as

Metric distance as the metric for path bandwidth, delay, and reliability, to

selection. select paths.


Algorithm Uses the Bellman-Ford algorithm. Uses the Dijkstra algorithm.

Slower convergence because each Faster convergence because each

Convergence router must wait for updates from router has a complete view of the

its neighbors. network topology.

Can be less scalable in larger Can be more scalable in larger

networks because of the amount networks because each router only


Scalability
of routing information that needs needs to know about its immediate

to be shared. neighbors.

Stores only next-hop information Stores a complete map of the network


Routing Table
for each destination. topology.

Can be less robust in the face of Can be more robust in the face of

network changes or failures network changes or failures because


Robustness
because routers may not have an routers have a complete view of the

up-to-date view of the network. network topology.


Open Shortest Path First (OSPF),

Example Protocol Routing Information Protocol (RIP) Intermediate System to Intermediate

System (IS-IS)

Q5. Differentiate between IPV4 and IPV6 with it’s frame.

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.

Subnetting is a technique used to divide a single network into smaller subnetworks, or


subnets. This allows for more efficient use of IP addresses and can help to improve
network performance and security. Subnetting involves borrowing bits from the host
portion of the address to create a new network ID. For example, if a network with a
Class C address (192.168.1.0) needs to be divided into four subnets, we can borrow
two bits from the host portion of the address to create four new network IDs:

- Subnet 1: 192.168.1.0/26 (64 hosts)


- Subnet 2: 192.168.1.64/26 (64 hosts)
- Subnet 3: 192.168.1.128/26 (64 hosts)
- Subnet 4: 192.168.1.192/26 (64 hosts)

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.

Q7. What is the type of the following address? -> 4F :: A234 :: 2.

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:

0000 0000 0100 1111

Type prefix

Thus, the given address is a reserved address.

Q8. Explain path-vector routing protocol.

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

In dotted decimal notation, this corresponds to:

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?

Ans. IP address = 180.25.21.172


Subnet mask = 255.255.192.0

IP Address:
10110100 00011001 00010101 10101100

Subnet mask:
11111111 11111111 10000000 00000000

By applying AND operation on the above two, we get


Subnet Address:
10110100 00011001 00000000 00000000

Therefore, subnet address is = 180.25.0.0

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

One token circulation takes time = 100 x 10 + 40


= 1040 ms
Efficiency * Total time = Time used for data transmission
So, Efficiency = 1000/1040
= 0.96
Q12. A computer owns 10 mbps network, and the token bucket is filled at a rate of 2
mbps. Initially, the bucket was filled up to 16 mb. What is the maximum duration for
which a computer can transmit at the full 10 mbps.

Ans. Maximum rate = (capacity + rate * time)/time


So , maximum rate = 16+ 2*t/t
10t = 16 +2t
8t = 16
t = 2 sec
So, time taken is 2 seconds.

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?

Ans. The binary representation of subnet mask is


11111111 11111111 11111000 00000000

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.

Q14. The IP network 200.198.160.0 is using subnet mask 255.255.255.224. Design


the subnets.
Ans.
IP: 200.198.168.0
Subset mask: 255.255.255.224

IP (Binary):
11001000 11000011 10111100 00000000

Subnet (Binary):
11111111 11111111 11111111 11100000

Subnet address:
11001000 11000011 10111100 11100000

Subnet address: 200.198.168.224


We have borrowed 3 bit from host field to identify the subnet

1 1 1 0 0 0 0 0

Subnet counting range Host Counting range

We use 3 bit for sunetting so 8 subnets are possible.

Subnet are as follow:


S1: 200.198.168.0 - 200.198.168.31
S2: 200.198.168.32 - 200.198.168.63
S3: 200.198.168.64 - 200.198.168.95
S4: 200.198.168.96 - 200.198.168.127
S5: 200.198.168.128 - 200.198.168.159
S6: 200.198.168.160 - 200.198.168.191
S7: 200.198.168.192 - 200.198.168.223
S8: 200.198.168.224 - 200.198.168.225

You might also like