[go: up one dir, main page]

0% found this document useful (0 votes)
37 views8 pages

Complete Networking QA Answers

Uploaded by

aryaman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views8 pages

Complete Networking QA Answers

Uploaded by

aryaman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

1. Provide an overview of Automatic Repeat reQuest (ARQ) protocols.

How do
Stop-and-Wait, Go-Back-N, and Selective Repeat ARQ protocols differ in their
approach to error recovery?
Automatic Repeat reQuest (ARQ) is an error control method used in data communications.
It ensures the accurate delivery of data by using acknowledgments and retransmissions. If
the sender does not receive an acknowledgment (ACK) within a certain time or receives a
negative acknowledgment (NACK), it retransmits the data.

There are three main types of ARQ protocols:

1. Stop-and-Wait ARQ:
In this protocol, the sender transmits one frame and waits for its acknowledgment before
sending the next. If the ACK is not received within a specific time, the sender retransmits the
same frame. This method is simple and ensures reliability but is inefficient for long-distance
or high-latency links due to idle time.

2. Go-Back-N ARQ:
Here, the sender can transmit several frames specified by a window size without waiting for
an ACK. However, if an error is detected or a frame is lost, the sender goes back and
retransmits all frames from that point onward. This protocol improves utilization but leads
to more retransmissions.

3. Selective Repeat ARQ:


In this advanced protocol, the sender also transmits multiple frames, but only the erroneous
or lost frames are retransmitted, not all subsequent frames. The receiver must buffer out-of-
order frames and reorder them. It is more efficient than Go-Back-N but more complex to
implement.

Comparison:
- Stop-and-Wait has the lowest efficiency but is simplest.
- Go-Back-N improves throughput but can waste bandwidth on retransmissions.
- Selective Repeat offers high efficiency by minimizing retransmissions but requires
additional complexity in handling out-of-order frames.

In conclusion, the choice of ARQ protocol depends on the requirements of the


communication system — simplicity vs. efficiency.
2. Solve the following example using CRC technique at sender and receiver side.
Data Stream: 10110011 Generator Polynomial: 10011
To solve this using Cyclic Redundancy Check (CRC), follow these steps:

Data Stream: 10110011


Generator Polynomial: 10011 (degree = 4)

Step 1: Append 4 zeros (degree of generator) to the data stream:


Data becomes: 101100110000

Step 2: Perform modulo-2 division:


Use binary division (XOR operations) between 101100110000 and 10011. The result
(remainder) is the CRC.

Step-by-step XOR:
Divide 10110 by 10011 → XOR → Remainder = 00101
Continue the process through all bits.

Final CRC Remainder: 1110

Step 3: Append CRC to original data stream:


Transmitted Frame = 101100111110

Receiver Side:
Receiver divides received data (101100111110) by 10011:
If remainder = 0000, then no error is detected.

Since we constructed the data with correct CRC, the division yields 0000, confirming no
error.

Conclusion:
- CRC provides strong error detection by treating data as polynomials.
- Modulo-2 division ensures only specific patterns are accepted.
- It's efficient and commonly used in Ethernet, HDLC, etc.
3. Describe how Hamming Code is used for error detection and correction.
Discuss the principles behind Hamming Code and provide an example.
Hamming Code is a technique for error detection and correction developed by Richard
Hamming. It can detect and correct single-bit errors in data transmission. The idea is to add
redundant parity bits at positions that are powers of two (1, 2, 4, etc.) to help identify error
locations.

For a data word of 4 bits, say 1011, we add 3 parity bits (P1, P2, P4) at positions 1, 2, and 4,
resulting in a 7-bit code: P1 P2 D1 P4 D2 D3 D4.

Step-by-step:
Original data: D1 = 1, D2 = 0, D3 = 1, D4 = 1
Calculate parity bits:
P1 = parity of bits 1, 3, 5, 7 → P1 = parity(1, 0, 1) = 0
P2 = parity of bits 2, 3, 6, 7 → P2 = parity(1, 1, 1) = 1
P4 = parity of bits 4, 5, 6, 7 → P4 = parity(0, 1, 1) = 0

Final Hamming Code: 0 1 1 0 0 1 1

At the receiver:
- Parity bits are recalculated.
- If there's a mismatch, the binary combination of incorrect parity bits gives the error
position.
- Flip that bit to correct the error.

Advantages:
- Detects and corrects single-bit errors.
- Detects two-bit errors.
- Simple to implement in hardware.

Hamming Code is widely used in RAM, digital communication systems, and computer
memory.
4. Explain various types of errors? Discuss the error detection techniques in
brief.
In data communication, errors occur due to noise, interference, or faulty hardware.
Understanding the types of errors and how to detect them is essential for reliable
communication.

Types of Errors:
1. Single-bit Error: Only one bit in the data unit is changed.
2. Burst Error: Two or more bits in a sequence are changed. These are common in noisy
channels.
3. Random Errors: Occur independently across the bit stream.
4. Systematic Errors: Follow a pattern due to consistent interference or hardware failure.

Error Detection Techniques:


1. Parity Bit:
- Adds an extra bit to make the number of 1s even (even parity) or odd (odd parity).
- Can detect single-bit errors but fails for even-numbered burst errors.

2. Checksum:
- Adds all data segments using binary addition, and appends the complement of the result as
the checksum.
- The receiver performs the same calculation to verify data integrity.
- Common in TCP/IP.

3. Cyclic Redundancy Check (CRC):


- Treats data as a binary polynomial and divides it by a predetermined generator
polynomial.
- The remainder is appended as the CRC.
- Very effective at detecting burst errors.

4. Hamming Code:
- Adds redundant bits to enable both error detection and correction.
- Useful for single-bit error correction.

Conclusion:
These techniques enhance data reliability. The selection depends on the system's
complexity, error tolerance, and efficiency requirements.
5. Analyze the various multiple access protocols used in the Data Link Layer
(e.g., ALOHA, CSMA/CD, CSMA/CA). How does CSMA attempt to avoid collisions
in a shared channel? Provide scenarios where each of these protocols would be
most suitable.
Multiple access protocols in the Data Link Layer allow multiple users to share a
communication channel effectively. Common protocols include:

1. ALOHA:
- Pure ALOHA: Stations transmit whenever they have data. If collision occurs, wait random
time and retransmit.
- Slotted ALOHA: Time is divided into slots; transmission starts at the beginning of a slot.
More efficient than pure ALOHA.
- Best used in low-traffic wireless networks like satellite systems.

2. CSMA (Carrier Sense Multiple Access):


- A station senses the medium before transmitting.
- Reduces chances of collision by checking if the channel is free.

Types of CSMA:
a) CSMA/CD (Collision Detection):
- Used in Ethernet.
- Transmit while sensing; if collision occurs, abort and back off.
- Works well in wired LANs.

b) CSMA/CA (Collision Avoidance):


- Used in wireless networks.
- Avoids collision by waiting for a clear channel and sending control signals like RTS/CTS
before transmission.
- Suitable for Wi-Fi, where collision detection is difficult.

Collision Avoidance in CSMA:


- Uses Interframe Space (IFS), contention window, and random backoff times.
- Reduces chances of collisions by spacing out attempts.

Comparison:
- ALOHA: High collision, simple.
- CSMA/CD: Good for wired LAN.
- CSMA/CA: Ideal for wireless networks.

Conclusion:
These protocols are essential for efficient communication in shared networks. Their
application depends on the network type and traffic behavior.
6. Write in detail the mechanism of (a) ARP (b) RARP (c) TTL
(a) ARP (Address Resolution Protocol):
- ARP maps IP addresses to MAC addresses.
- When a device knows the IP address but not the MAC, it sends an ARP request as a
broadcast.
- The target responds with its MAC address.
- ARP is used in IPv4-based local networks and helps in direct communication on LAN.

(b) RARP (Reverse ARP):


- RARP maps MAC addresses to IP addresses.
- Used by diskless computers during booting to discover their IP addresses from a RARP
server.
- It sends a RARP request to the server with its MAC address.
- The server responds with the assigned IP.
- RARP is now obsolete and replaced by DHCP.

(c) TTL (Time To Live):


- TTL is a field in the IP header.
- It limits the lifespan of a packet in the network by reducing the TTL value by 1 at each
router.
- If TTL becomes 0, the packet is discarded, and an ICMP error message is sent.
- Prevents packets from looping indefinitely.

Summary:
- ARP enables IP-to-MAC mapping.
- RARP (now obsolete) performed MAC-to-IP mapping.
- TTL ensures packets do not circulate endlessly, enhancing network efficiency.
7. Explain in detail with neat diagram the operations of Stop-and-Wait Protocol.
Illustrate the error correction technique with suitable example.
The Stop-and-Wait protocol is a simple flow control and error handling method used in data
communication. It ensures reliable transmission by sending one frame at a time and waiting
for an acknowledgment (ACK) before sending the next.

Working:
1. Sender sends a data frame to the receiver.
2. Sender waits until it receives an ACK.
3. If ACK is received, the sender sends the next frame.
4. If ACK is not received within timeout, the sender resends the frame.

Diagram:
Sender → [Frame 1] → Receiver
Sender ← [ACK 1] ← Receiver
Sender → [Frame 2] → Receiver
Sender ← [ACK 2] ← Receiver

Error Handling:
- If frame is lost or damaged, no ACK is received.
- Sender resends the same frame after timeout.
- Receiver detects duplicates using sequence numbers (0 and 1).

Example:
Send frame with seq = 0.
If receiver gets it and sends ACK, sender sends next frame with seq = 1.
If ACK is lost, sender resends frame with seq = 0.
Receiver identifies it as duplicate and discards it.

Advantages:
- Simple to implement.
- Ensures reliability.

Disadvantages:
- Inefficient for long delays or high-speed links due to idle waiting.

Conclusion:
Stop-and-Wait is ideal for simple, low-volume communication systems. For better
efficiency, advanced protocols like Go-Back-N and Selective Repeat are used.

You might also like