Computer Networks CS601 Exam Solutions

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Computer Networks CS601 Exam Solutions

Group A (Multiple Choice Type Questions)

1. Repeater works at:

a) Data link Layer

b) Application Layer

c) Physical Layer

d) Network Layer

Answer: c) Physical Layer

2. Stop and wait protocol is suitable for:

a) LAN and Big packet

b) WAN and Big packet

c) LAN and small packet

d) WAN and small packet

Answer: c) LAN and small packet

3. Responsible for framing:

a) Physical Layer

b) Data link Layer

c) Network Layer

d) Transport Layer

Answer: b) Data link Layer


Computer Networks CS601 Exam Solutions

4. 168.38.24.15/26. How many IP addresses are there in this CIDR block?

a) 4

b) 64

c) 16

d) 32

Answer: b) 64

5. Connection oriented Protocol:

a) TCP

b) UDP

c) Both TCP and UDP

d) Neither TCP nor UDP

Answer: a) TCP

6. Number of flag bits in TCP header:

a) 2

b) 4

c) 6

d) 8

Answer: c) 6

7. Vulnerable time in Pure ALOHA:


Computer Networks CS601 Exam Solutions

a) Tt

b) 2Tt

c) Tp

d) 2Tp

Answer: b) 2Tt

Group B (Short Answer Type Questions)

1. Explain TCP header structure in detail:

The TCP header consists of the following fields:

- Source Port (16 bits): Identifies the sending port.

- Destination Port (16 bits): Identifies the receiving port.

- Sequence Number (32 bits): Keeps track of the number of bytes sent.

- Acknowledgment Number (32 bits): If the ACK flag is set, this field contains the value of the next

sequence number that the sender is expecting.

- Data Offset (4 bits): Indicates where the data begins.

- Reserved (3 bits): Reserved for future use and should be set to zero.

- Flags (9 bits): Controls flags (e.g., URG, ACK, PSH, RST, SYN, FIN).

- Window Size (16 bits): Size of the sender's receive window.

- Checksum (16 bits): Used for error-checking the header and data.

- Urgent Pointer (16 bits): If the URG flag is set, this field is an offset from the sequence number

indicating the last urgent data byte.

- Options (Variable length): Used for additional options.

- Padding: Added to ensure the header is a multiple of 32 bits.


Computer Networks CS601 Exam Solutions

2. IP address 10.13.8.15/12. Write class, Netid and subnet mask of this IP:

- Class: A (10.0.0.0 to 10.255.255.255 range)

- Netid: 10.8.0.0

- Subnet Mask: 255.240.0.0

3. Explain handshaking mechanism in TCP:

The TCP handshaking mechanism is a three-step process known as the three-way handshake:

1. SYN: The client sends a TCP segment with the SYN flag set to the server to initiate a connection.

2. SYN-ACK: The server responds with a TCP segment with both SYN and ACK flags set to

acknowledge receipt of the client's SYN and to synchronize the connection.

3. ACK: The client sends a final TCP segment with the ACK flag set, confirming the connection is

established.

4. Compare between Pure ALOHA and Slotted ALOHA:

- Pure ALOHA:

- No time slots; data packets can be transmitted at any time.

- Higher chances of collision.

- Efficiency is approximately 18.4%.

- Slotted ALOHA:

- Time is divided into slots; packets can only be sent at the beginning of these slots.

- Lower chances of collision compared to Pure ALOHA.

- Efficiency is approximately 36.8%.

5. List the disadvantages of Stop and Wait flow control:


Computer Networks CS601 Exam Solutions

- Inefficient use of bandwidth, especially over high-speed or long-distance links.

- Low throughput due to waiting for acknowledgments after every packet.

- High latency since each packet must be acknowledged before the next one is sent.

6. Compare circuit switching and packet switching:

- Circuit Switching:

- Establishes a dedicated communication path between two nodes.

- Suitable for continuous and constant data streams.

- Example: Traditional telephone networks.

- Packet Switching:

- Data is divided into packets that are routed independently.

- More efficient use of network resources.

- Example: Internet.

7. Explain Hamming code for error detection and correction with a suitable diagram:

The Hamming code is a method for error detection and correction. It works by adding redundant bits

to the data, allowing for the detection and correction of single-bit errors.

**Steps:**

1. Determine the number of redundant bits needed (r) for data bits (d): 2^r >= d + r + 1.

2. Place the redundant bits in positions that are powers of 2 (1, 2, 4, 8, etc.).

3. Calculate the values of the redundant bits based on parity (even or odd).

4. For error detection and correction, calculate the parity bits from the received data and determine

the position of any error.

**Example Diagram:**
Computer Networks CS601 Exam Solutions

Let's consider a 4-bit data: 1011.

Add 3 redundant bits: _ _ 1 _ 0 1 1.

Set redundant bits based on parity:

- r1 (position 1): 1 (parity for bits 1, 3, 5, 7)

- r2 (position 2): 0 (parity for bits 2, 3, 6, 7)

- r4 (position 4): 1 (parity for bits 4, 5, 6, 7)

Final code: 1010111.

You might also like