CAT2! Computer Network Answer Key
CAT2! Computer Network Answer Key
No:
B
Mannivakkam, Chennai-48
Write the difference between Distance vector routing and Link state routing
8 Distance Vector Link State
Algorithm characteristics Slower but more versatile Faster but less versatile
Best path calculated Based on shortest distance Based on cost (link state) R
PART-B (5 x 13 = 65Marks)
Q. No. Split up CO CL
11 (a) Explain any two-error detection mechanism in detail. 13 3
Basic Concepts of Error Detection
Error detection is a crucial aspect of data communication that ensures the integrity
and reliability of data transmitted across networks. It involves identifying errors
that may occur during data transmission due to noise, interference, or other
impairments.
Types of Errors
1. Single-Bit Error: This occurs when a single bit in the data unit is altered
during transmission. For example, a bit value of 0 may change to 1 or vice
versa.
2. Multiple-Bit Error: This type of error affects more than one bit in the
data unit. Although less common than single-bit errors, they can still occur
in high-noise environments2.
3. Burst Error: This occurs when several consecutive bits are altered during
transmission, resulting in a sequence of incorrect values 2.
Error Detection Methods
1. Simple Parity Check: This method involves adding an extra bit to the
data unit to make the total number of 1s either even (even parity) or odd
(odd parity). It is simple to implement but can only detect single-bit
errors2.
2. Two-Dimensional Parity Check: This method extends the simple parity
check by adding parity bits for both rows and columns of the data matrix.
It can detect and correct single-bit errors and detect multiple-bit errors2.
3. Checksum: In this method, the data is divided into segments, and a
checksum is calculated using 1's complement arithmetic. The checksum is
sent along with the data, and the receiver performs the same calculation to
verify the integrity of the data2. R
4. Cyclic Redundancy Check (CRC): CRC is a more robust method that
involves appending a sequence of redundant bits to the data unit. The data
unit is divided by a predetermined binary number, and the remainder is
used as the CRC. The receiver performs the same division to check for
errors2.
Advantages and Disadvantages
Advantages
• Increased Data Reliability: Error detection ensures that the data received
is accurate and reliable2.
• Improved Network Performance: Identifying and isolating errors can
enhance overall network performance2.
• Enhanced Data Security: Error detection helps ensure that the data has
not been tampered with during transmission2.
Disadvantages
• Overhead: Error detection requires additional resources and processing
power, leading to increased overhead2.
• False Positives: Error detection mechanisms can sometimes generate false
positives, resulting in unnecessary retransmissions2.
• Limited Error Correction: Error detection can only identify errors but
cannot correct them
[OR]
(b) Write short notes on i) DHCP ii) ICMP. 13 3
The Dynamic Host Configuration Protocol (DHCP) is a client/server protocol
designed to provide the four pieces of information for a diskless computer or a
computer that is booted for the first time.
DHCP operation:
The DHCP client and server can either be on the same network or on different
networks.
• Same Network :
Although the practice is not very common, the administrator may put the client and
the server on the same network as shown in Figure1.
Fig1: Client and server on the same network
In this case, the operation can be described as follows:
i. The DHCP server issues a passive open command on UDP port number 67 and
waits for a client.
ii. A booted client issues an active open command on port number 68. The message
is encapsulated in a UDP user datagram, using the destination port number 67 and
the source port number 68. The UDP user datagram, in turn, is encapsulated in an
IP datagram.
iii. The client uses all 0sas the source address and all 1s as the destination address.
iv. The server responds with either a broadcast or a unicast message using UDP
source port number 67 and destination port number 68. The response can be unicast
because the server knows the IP address of the client.
v. It also knows the physical address of the client, which means it does not need the
services of ARP for logical to physical address mapping
ICMP stands for Internet Control Message Protocol. It is a network layer
protocol used primarily for error handling and diagnostic purposes in network
communications12. R
Purpose and Functionality
ICMP is utilized by network devices, such as routers, to send error messages and
operational information. For instance, it can indicate that a requested service is not
available or that a host or router could not be reached 1. Unlike transport protocols
like TCP and UDP, ICMP is not typically used to exchange data between systems
but is essential for network diagnostics and error reporting 2.
Key Uses of ICMP
1. Error Reporting: ICMP is used to report errors when data packets cannot
reach their destination. For example, if a message is too large for the
receiver, the receiver will drop the message and reply with an ICMP error
message to the source1.
2. Network Diagnosis: ICMP is used in tools like ping and traceroute to
diagnose network issues. The ping utility uses ICMP echo request and
echo reply messages to measure the time taken for data to reach the
destination and return to the source13.
How ICMP Works
ICMP operates at the network layer and is a connectionless protocol, meaning it
does not establish a connection before sending messages. ICMP packets are
transmitted as datagrams containing an IP header followed by ICMP data 12. The
protocol is integral to the IP suite and is used for various control and error
messages2.
ICMP Packet Format
An ICMP packet consists of several fields:
• Type (8-bit): Indicates the type of message (e.g., echo reply, destination
unreachable).
• Code (8-bit): Provides additional information about the error message.
• Checksum (16-bit): Used to verify the integrity of the message12.
Common ICMP Message Types
• Echo Reply (Type 0): Used in response to an echo request (ping).
• Destination Unreachable (Type 3): Indicates that the destination cannot
be reached.
• Redirect Message (Type 5): Informs a host to send packets on an
alternate route.
• Echo Request (Type 8): Used to ping a device to check its availability.
• Time Exceeded (Type 11): Indicates that the time to live (TTL) of a
packet has expired12.
ICMP in DDoS Attacks
ICMP can be exploited in various types of Distributed Denial of Service (DDoS)
attacks, such as:
• Ping of Death: Sending oversized packets that cause buffer overflow.
• ICMP Flood Attack: Sending a large number of ICMP echo requests to
overwhelm the target.
• Smurf Attack: Sending ICMP packets with a spoofed source IP address
to flood the target1.
ICMP is a crucial protocol for maintaining and diagnosing network health,
providing essential feedback for error handling and network management
[OR]
(b) Explain about IPv6? Compare IPv4 and IPv6 13 3
IPv6, or Internet Protocol version 6, is the latest version of the Internet Protocol
designed to replace IPv4. It addresses the limitations of IPv4, most notably its
shortage of available IP addresses. IPv6 uses a 128-bit address format, enabling a
practically limitless number of unique IP addresses, compared to IPv4's 32-bit
format.
IPv4 vs IPv6 Comparison
Aspect IPv4 IPv6
Address Length 32-bit (e.g., 192.168.1.1) 128-bit (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334)
Address Space ~4.3 billion addresses Virtually unlimited (~340 undecillion addresses)
Header Format Simpler, fewer fields Complex, more fields but optimized for better performance
U
Requires manual or DHCP
Configuration Supports auto-configuration
configuration
Security Basic (IPSec optional) Integrated IPSec for enhanced security
Quality of Service Limited Better support for QoS and prioritization
Routing Less efficient routing Improved routing with simpler packet processing
Compatibility Widely adopted Still in transition, but gaining traction globally
Benefits of IPv6:
1. Larger Address Space: Vastly more addresses for devices and networks.
2. Improved Security: IPSec is built-in for robust encryption and
authentication.
3. Enhanced Performance: Auto-configuration simplifies setup, and
efficient routing reduces latency.
4. Future Proof: Designed to support the growing needs of the internet as
more devices come online.
IPv4 is still prevalent due to legacy systems, but the transition to IPv6 is essential
as it ensures the scalability of the internet. If you're curious about any specific
aspect, I'd be happy to explore further!
13 (a) Discuss about address Resolution protocols 7 3
Address Resolution Protocols (ARP) are essential in computer networking. ARP
is responsible for mapping an IP address (logical address) to a physical address,
such as a MAC address, within a local network. This process enables devices to
communicate effectively across a network. Let's delve deeper:
How ARP Works
1. Broadcasting a Request: When a device wants to send data to another
device, it broadcasts an ARP request on the network, asking, "Who has
this IP address?"
2. Receiving a Response: The device with the matching IP address responds
with its MAC address.
3. Updating the ARP Table: The requesting device updates its ARP
cache/table with the IP-MAC pair for future communication.
Types of ARP
1. Normal ARP: Used for resolving MAC addresses in IPv4 networks.
2. Proxy ARP: Allows one device (like a router) to respond to ARP requests
on behalf of another device.
3. Reverse ARP (RARP): Maps a MAC address to an IP address, typically U
used by devices without an IP address.
4. Gratuitous ARP: Devices announce their presence on the network by
broadcasting their own IP-MAC mapping.
[OR]
(b) Explain DVMRP multicast routing in detail 7 3
DVMRP (Distance Vector Multicast Routing Protocol) is an interior gateway
protocol designed to support multicast data delivery within a network. It is based on
the distance-vector routing algorithm and operates similarly to the Routing
Information Protocol (RIP) but is specifically tailored for multicast traffic. DVMRP
plays a key role in enabling efficient multicast communication, such as video
U
streaming or live broadcasts, where data is sent to multiple recipients
simultaneously.
How DVMRP Works
1. Reverse Path Forwarding (RPF):
o DVMRP uses RPF to forward multicast packets. When a router
receives a multicast packet, it checks if the packet arrived on the
interface that is on the shortest path (reverse path) to the source.
If yes, it forwards the packet; otherwise, it discards it to prevent
loops.
2. Building a Multicast Tree:
o DVMRP constructs a multicast delivery tree using a technique
known as the flood-and-prune method:
▪ Flooding: Initially, multicast packets are flooded to all
routers in the network.
▪ Pruning: Routers that do not have any members in the
multicast group send "prune" messages upstream to stop
receiving the unwanted multicast traffic.
3. Periodic Updates:
o Similar to distance-vector protocols, DVMRP routers exchange
periodic routing updates to maintain an updated view of the
network topology and prune or build new branches as necessary.
Key Features of DVMRP
• Distance Vector Algorithm: Utilizes hop count as the metric to
determine the best path to the multicast source.
• Flood-and-Prune Mechanism: Ensures multicast traffic reaches all
interested receivers while removing unnecessary paths.
• Dense Mode Protocol: Designed for networks with densely distributed
multicast group members.
• Tunnel Support: In networks where multicast support is limited,
DVMRP can encapsulate multicast packets within unicast packets to
traverse non-multicast routers.
Challenges of DVMRP
• Scalability Issues: DVMRP is most suitable for smaller or densely
populated networks. In larger networks, the flood-and-prune approach
may lead to excessive overhead.
• Inefficiency in Sparse Networks: Flooding the entire network can be
resource-intensive in scenarios where multicast group members are
sparsely distributed.
• Compatibility: As the protocol predates IPv6, it is not natively
compatible with IPv6, which uses newer protocols like PIM (Protocol
Independent Multicast) for multicast routing.
Applications of DV
14 (a) Two hosts are in a CSMA/CD network and the medium has a data transfer 13 4
capacityof 1Gbps. The minimum frame length is fixed to 1,000 bits and the
propagation speed is 2 ×108 m/s. i) What will be the distance between the hosts? ii)
If it is an Ethernet network, what is the efficiency when the hosts have a maximum
distance between them? If the distance is reduced to 1 m, does it impact the
efficiency.
Let's break the problem into steps and solve it mathematically:
i) Distance Between Hosts
In a CSMA/CD network, for collision detection to work, the propagation delay A
must be less than or equal to the time required to transmit the smallest frame. The
propagation delay is given by:
[ \text{Propagation delay} = \frac{\text{Distance}}{\text{Propagation speed}} ]
And the transmission time for the smallest frame is:
[ \text{Transmission time} = \frac{\text{Minimum frame size}}{\text{Data
transfer capacity}} ]
For collision detection: [ 2 \times \text{Propagation delay} \leq \text{Transmission
time} ]
Given:
• Minimum frame size = 1,000 bits
• Data transfer capacity = 1 Gbps = (1 \times 10^9) bits per second
• Propagation speed = (2 \times 10^8) m/s
1. Calculate the transmission time: [ \text{Transmission time} = \frac{1,000
\ \text{bits}}{1 \times 10{-6} \ \text{seconds} ]
2. Using the collision detection condition: [ 2 \times
\frac{\text{Distance}}{\text{Propagation speed}} \leq \text{Transmission
time} ]
[OR]
(b) Given a remainder of 111, a data unit of 10110011 and a divisor of1001, is there 13 4 A
anerror in the data unit. Justify your answer with necessary principles.
To check if there is an error in the given data unit, we apply the Cyclic Redundancy
Check (CRC) principles. CRC works by performing binary division of the
transmitted data by the divisor and comparing the calculated remainder with the
given remainder. If the remainders match, the data is error-free; otherwise, an error
occurred during transmission.
Step-by-Step Process
1. CRC Overview
• Data Unit (Dividend): 10110011
• Divisor (Generator Polynomial): 1001
• Given Remainder: 111
2. Append Zero Bits to Data Unit
Before performing the division, the CRC algorithm appends three zero bits (equal to
the length of the divisor minus one) to the data unit: [ \text{Modified Data Unit
(Dividend)} = 10110011000 ]
3. Perform Binary Division
Perform XOR-based binary division of (10110011000) by (1001). This step mimics
long division in binary:
1. Align the divisor with the leftmost bits of the dividend.
2. Perform bitwise XOR between the dividend and divisor.
3. Bring down the next bit and repeat the process until all bits are processed.
After division, calculate the remainder.
4. Compare Remainders
• If the calculated remainder matches the given remainder (111), the data
unit is error-free.
• If the calculated remainder is different from 111, an error exists.
Conclusion
Manually performing the binary division or using a programmatic approach will
reveal whether the calculated remainder matches the given remainder. If you'd like,
I can walk you through the division steps or summarize the results for clarity! Let
me know.
Flow control mechanisms are essential in computer networks to regulate data flow
between sender and receiver, ensuring that the receiver is not overwhelmed by too
much data. Below are explanations of the three commonly used mechanisms:
i) Stop-and-Wait Protocol
• Working Principle:
o In this simplest flow control protocol, the sender transmits a data
frame and waits for an acknowledgment (ACK) from the receiver
before sending the next frame.
o If the ACK is received, the sender proceeds with the next frame. If
not (or if a timeout occurs), the sender retransmits the same frame.
• Advantages:
o Simple to implement.
o Ensures reliable delivery.
• Disadvantages:
o Inefficient for long-distance or high-bandwidth networks due to
idle waiting time.
o Limited throughput as only one frame can be in transit at a time.
[OR]
(b) Describe the CSMA/CD protocol and comment on its performance for medium 13 4 U
access
CSMA/CD (Carrier Sense Multiple Access with Collision Detection) is a
network protocol used in shared media access environments like Ethernet to
manage data transmission efficiently. It ensures that only one device transmits data
at a time, reducing collisions on the network.
Performance of CSMA/CD
1. Efficiency:
o CSMA/CD is highly efficient in low-traffic scenarios since
devices can easily sense and access the medium without much
delay.
o However, as the number of devices increases or the traffic load
becomes heavy, collisions become more frequent, reducing
overall efficiency.
2. Scalability:
o CSMA/CD does not scale well in large or high-traffic networks
because of the increased likelihood of collisions and
retransmissions, leading to significant delays.
3. Bandwidth Utilization:
o The performance of CSMA/CD is optimal when the network's
utilization is below 30–40%.
o Beyond this threshold, collisions and retransmission overhead
reduce throughput significantly.
4. Latency:
o With frequent collisions, the protocol introduces additional
latency due to retransmissions and backoff intervals.
5. Advantages:
o Simple and cost-effective to implement.
o Works well in small, lightly loaded networks.
6. Disadvantages:
o Poor performance in high-traffic or large-scale networks.
o Largely unsuitable for modern full-duplex Ethernet, which
eliminates collisions.
Modern Relevance
With the advent of switched Ethernet and full-duplex communication, the need
for CSMA/CD has declined, as collisions are no longer a concern in these setups.
However, understanding CSMA/CD remains important for legacy network
environments and as a foundational concept in networking.
If you'd like, I can further explore how CSMA/CD compares to other protocols or
its implementation in Ethernet networks!
PART-C (1 x 15 = 15Marks)
Q. No. Split up CO CL
16 (a) Explain Link state routing with Dijkstra's algorithm for the following graph 15 4 U
A 0 0 0 0 0 0 0 0
B ∞ 4 4 4 4 4 4 4
C ∞ ∞ 12 12 12 12 12 12
D ∞ 8 8 8 8 8 8 8
E ∞ ∞ 10 10 10 10 10 10
F ∞ ∞ ∞ 16 16 16 16 16
G ∞ ∞ ∞ ∞ 26 26 26 26
Note:
• Node labels are assumed from left to right and top to bottom as A, B, C,
D, E, F, and G.
• This table shows the progressive update of shortest distances from node A.
• In a real network scenario, each node would perform this calculation
independently to determine its routing table.
• The link state routing protocol ensures that each router has a consistent
view of the network topology, allowing for accurate shortest-path
calculations.
• Dijkstra's algorithm efficiently computes the shortest paths from a source
node to all other nodes in the network.
[OR]
(b) Explain Distance Vector Routing Algorithm for the graph given below 15 4 U
A A:0, B:∞, A:0, B:12, A:0, B:12, A:0, B:12, A:0, B:12,
C:2, D:10, C:2, D:10, C:2, D:10, C:2, D:10, C:2, D:10,
E:∞, F:∞ E:21, F:28 E:13, F:16 E:13, F:16 E:13, F:16
B A:∞, B:0, A:12, B:0, A:12, B:0, A:12, B:0, A:12, B:0,
C:∞, D:2, C:12, D:2, C:3, D:2, C:3, D:2, C:3, D:2,
E:1 E:1, F:8 E:1, F:8 E:1, F:8 E:1, F:8
C A:2, B:∞, A:2, B:12, A:2, B:3, A:2, B:3, A:2, B:3,
C:0, D:1, C:0, D:1, C:0, D:1, C:0, D:1, C:0, D:1,
E:∞, F:18 E:12, F:18 E:12, F:7 E:12, F:7 E:12, F:7
D A:10, B:2, A:10, B:2, A:10, B:2, A:10, B:2, A:10, B:2,
C:1, D:0, C:1, D:0, C:1, D:0, C:1, D:0, C:1, D:0,
E:11, F:6 E:3, F:6 E:3, F:6 E:3, F:6 E:3, F:6
E A:∞, B:1, A:21, B:1, A:13, B:1, A:13, B:1, A:13, B:1,
C:∞, C:12, D:3, C:12, D C:12, D:3, C:12, D:3,
D:11, E:0, E:0, F:2 Brown:3, E:0, F:2 E:0, F:2
F:2 E:0, F:2
F A:∞, B:∞, A:28, B:8, A:16, B:8, A:16, B:8, A:16, B:8,
C:18, D:6, C:18, D:6, C:7, D:6, C:7, D:6, C:7, D:6,
E:2, F:0 E:2, F:0 E:2, F:0 Easp:2, F:0 E:2, F:0
After the third exchange, the distance vectors converge, and the final distance
vectors represent the shortest paths between all pairs of nodes.