Important Questions

CSC263 · Exam intelligence

Computer Networks important questions

From 6 past TU papers: which questions keep coming back, how much they carry, and what is most likely to show up next. Every question links to a model answer.

Most likely in the next examStatistical

Ranked by how often a topic is asked, its marks weight, and whether it is due after skipping the 2081 paper. No guarantees; study the whole syllabus.

1asked 6xavg 7 marks · due (skipped 2081) · Types of Routing
Answer

Differentiate between unicast and multicast routing. [5]

Routing is the process of selecting a path for traffic in a network, directing packet forwarding on the basis of routing tables that maintain records of routes to various network destinations. --- As stated in the notes, unicast is the s...

2asked 7xavg 5 marks · IPv4 Addressing & Sub-netting
Answer

Assume a class C network and divide it into three subnets. What is the value of the new subnet? [5]

Subnetting a Class C Network into Three Subnets

STEP 1 - EXTRACT: Given Data

  • Network Class: Class C
  • Default Subnet Mask: 255.255.255.0 (/24)
  • Network bits: 24, Host bits: 8
  • Required subnets: 3
  • Example network (for illustration, standard assumption): 192.168.1.0

No specific IP address is given in the question, so a representative network 192.168.1.0 is used only for demonstration.


STEP 2 - SOLVE

Step 1: Bits to Borrow

Number of subnets = $2^n$, where $n$ = borrowed bits.

We need at least 3 subnets:

Borrowed bits $n$Subnets $2^n$Enough for 3?
12No
24Yes

So borrow $n = 2$ bits.

Step 2: New Subnet Mask

Remaining host bits = $8 - 2 = 6$.

$$ \text{New mask} = 11111111.11111111.11111111.\underline{11}000000 $$

$$ \boxed{255.255.255.192 ;(/26)} $$

Step 3: New Subnet Value (Block Size / Increment)

$$ \text{Block size} = 2^{\text{remaining host bits}} = 2^{6} = 64 $$

Alternatively, block size = $256 - 192 = 64$.

$$ \boxed{\text{Subnet value} = 64} $$

Step 4: Resulting Subnets (using 192.168.1.0)

SubnetNetworkHost RangeBroadcast
0192.168.1.0.1 - .62192.168.1.63
1192.168.1.64.65 - .126192.168.1.127
2192.168.1.128.129 - .190192.168.1.191
3192.168.1.192.193 - .254192.168.1.255

Three of these four subnets satisfy the requirement.

Step 5: Usable Hosts per Subnet

$$ 2^{6} - 2 = 64 - 2 = 62 \text{ hosts} $$


Summary

ParameterValue
Bits borrowed2
Subnets created4 (3 required)
New Subnet Mask255.255.255.192
New Subnet Value (block size)64
Usable hosts/subnet62
3asked 4xavg 10 marks · due (skipped 2081) · Framing and Flow Control Mechanisms
Answer

What is flow control? How does stop-and-wait ARQ protocol handle error? What are its disadvantages.[10]

Flow Control, Stop-and-Wait ARQ, and Its Disadvantages


1. Flow Control

Flow control is a mechanism used at the Data Link Layer (and also at the Transport Layer) to regulate the rate of data transmission between a sender and a receiver so that the receiver is not overwhelmed by data faster than it can process.

: "The data rate must be constant on both sides else the data may get corrupted."

Without flow control:

  • A fast sender can flood a slow receiver's buffer.
  • Buffer overflow leads to data loss and corruption.

Flow control ensures that the sender transmits data only at a rate the receiver can handle, maintaining reliable and orderly communication.


2. Stop-and-Wait ARQ Protocol

ARQ stands for Automatic Repeat reQuest. It is an error control mechanism that uses acknowledgements (ACK) and retransmissions to ensure reliable delivery of frames.

Stop-and-Wait ARQ is the simplest form of ARQ. The working principle is:

The sender sends one frame at a time and then stops and waits for an acknowledgement (ACK) from the receiver before sending the next frame.


How Stop-and-Wait ARQ Handles Errors

There are three main error scenarios handled by this protocol:


Case 1: Frame Arrives Correctly (No Error)

Sender                        Receiver
  |------- Frame 0 ----------->|
  |<------- ACK 1 -------------|
  |------- Frame 1 ----------->|
  |<------- ACK 0 -------------|
  • Sender sends Frame 0.
  • Receiver receives it correctly and sends ACK 1 (ready for frame 1).
  • Sender sends the next frame upon receiving ACK.

Case 2: Frame is Lost or Damaged (Frame Error)

Sender                        Receiver
  |------- Frame 0 ---X        |   (frame lost/damaged)
  |   (Timer expires)          |
  |------- Frame 0 ----------->|   (retransmit)
  |<------- ACK 1 -------------|
  • The sender starts a timer after sending each frame.
  • If the frame is lost or corrupted, the receiver does not send an ACK.
  • When the timer expires, the sender retransmits the same frame.
  • This continues until a correct ACK is received.

Case 3: ACK is Lost or Damaged (ACK Error)

Sender                        Receiver
  |------- Frame 0 ----------->|
  |        ACK 1 ---X          |   (ACK lost)
  |   (Timer expires)          |
  |------- Frame 0 ----------->|   (retransmit)
  |<------- ACK 1 -------------|
  • The receiver correctly receives Frame 0 and sends ACK 1, but the ACK is lost.
  • The sender's timer expires and it retransmits Frame 0.
  • The receiver gets a duplicate frame (Frame 0 again).
  • The receiver discards the duplicate (because it already received Frame 0) and resends ACK 1.
  • Sequence numbers (0 and 1) are used to detect duplicates.

Case 4: ACK is Delayed (Late ACK)

  • If an ACK arrives after the timer has expired and the sender has already retransmitted:
    • The sender receives a delayed ACK.
    • It ignores the delayed ACK because it has already retransmitted and is waiting for a fresh ACK.
    • Sequence numbers help distinguish old ACKs from new ones.

Summary of Error Handling Mechanisms

MechanismPurpose
TimerDetects lost frames or lost ACKs
RetransmissionResends frame when timer expires
Sequence Numbers (0, 1)Detects and discards duplicate frames
Acknowledgement (ACK)Confirms successful receipt of a frame

3. Disadvantages of Stop-and-Wait ARQ

1. Very Low Efficiency / Poor Throughput

  • The sender sends only one frame at a time and then sits idle waiting for an ACK.
  • If propagation delay is large (e.g., satellite links), the channel is wasted for most of the time.
  • Efficiency = 1 / (1 + 2a) where a = propagation delay / transmission time
  • For large values of a, efficiency drops drastically.

2. Slow Data Transfer

  • Because only one frame is in transit at any time, the overall data transfer rate is very slow compared to the available bandwidth.

3. Wastes Bandwidth

  • The communication channel remains idle while the sender waits for an ACK, leading to severe underutilization of the available bandwidth.

4. Not Suitable for Long-Distance Communication

  • On links with high propagation delay (e.g., satellite or intercontinental links), the round-trip time is very large, making Stop-and-Wait extremely inefficient.

5. Performance Degrades with Errors

  • Every time an error occurs, the sender must wait for the timer to expire before retransmitting, adding significant delay.

6. Only One Frame Buffered

  • The sender needs to keep only one frame in its buffer, but this severely limits the pipeline and throughput.

Conclusion

Stop-and-Wait ARQ is a simple and easy-to-implement error control protocol that handles frame loss, frame damage, ACK loss, and duplicate frames using timers, retransmissions, and sequence numbers. However, its one-frame-at-a-time approach makes it highly inefficient, especially over high-latency or high-bandwidth links. More advanced protocols like Go-Back-N ARQ and Selective Repeat ARQ were developed to overcome these limitations by allowing multiple frames to be in transit simultaneously (pipelining).

4asked 4xavg 5 marks · due (skipped 2081) · Circuit, Message & Packet Switching
Answer

What do you understand by circuit switching? Explain. What are its advantage and disadvantage? [5]

Circuit switching is a switching technique that establishes a dedicated path or channel between the sender and receiver before data transmission begins. Once this dedicated path is established, it remains open and reserved exclusively fo...

5asked 3xavg 8 marks · due (skipped 2081) · Transport Protocols
Answer

Explain TCP header with a neat diagram. Highlight on its uses.[10]

TCP Header - Explanation with Diagram

Introduction

TCP (Transmission Control Protocol) is a connection-oriented, reliable transport layer protocol. It ensures that data is delivered accurately and in order between two communicating hosts. The TCP header contains all the control information necessary to manage this reliable communication.


TCP Header Diagram

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Source Port          |       Destination Port        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        Sequence Number                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Acknowledgment Number                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Data  |Reserv.|U|A|P|R|S|F|                                   |
|Offset |  (6)  |R|C|S|S|Y|I|         Window Size              |
|  (4)  |       |G|K|H|T|N|N|                                   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Checksum            |         Urgent Pointer        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Options (if any)           |    Padding    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          Data                                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Minimum TCP Header Size = 20 bytes (without options)


Detailed Explanation of Each Field

1. Source Port (16 bits)

  • Identifies the port number of the sending application on the source host.
  • Port numbers range from 0 to 65535.
  • Example: A web browser may use port 1025 as source port.

Use: Helps the receiving host know which application sent the data, enabling proper reply routing.


2. Destination Port (16 bits)

  • Identifies the port number of the receiving application on the destination host.
  • Example: HTTP uses port 80, HTTPS uses port 443, FTP uses port 21.

Use: Directs the incoming segment to the correct application/process on the destination machine.


3. Sequence Number (32 bits)

  • Indicates the position (byte number) of the first byte of data in this segment within the overall data stream.
  • During connection establishment (SYN), it carries the Initial Sequence Number (ISN).

Use: Enables the receiver to reorder segments that arrive out of order and detect missing data.


4. Acknowledgment Number (32 bits)

  • When the ACK flag is set, this field contains the next sequence number the sender of the acknowledgment expects to receive.
  • It acknowledges all bytes received up to (but not including) this number.

Use: Provides reliable delivery by confirming receipt of data and requesting the next expected byte.


5. Data Offset / Header Length (4 bits)

  • Specifies the length of the TCP header in 32-bit words.
  • Minimum value is 5 (20 bytes), maximum is 15 (60 bytes).

Use: Tells the receiver where the actual data begins in the TCP segment.


6. Reserved (6 bits)

  • These bits are reserved for future use and must be set to zero.

7. Control Flags (6 bits)

Each flag is 1 bit and serves a specific control purpose:

FlagFull NameUse
URGUrgentIndicates urgent pointer field is significant
ACKAcknowledgmentAcknowledgment number is valid
PSHPushReceiver should pass data to application immediately
RSTResetResets the connection abruptly
SYNSynchronizeUsed during connection establishment (3-way handshake)
FINFinishUsed to terminate a connection gracefully

Use: These flags control the state of the TCP connection - establishment, data transfer, and termination.


8. Window Size (16 bits)

  • Specifies the number of bytes the sender is willing to accept from the receiver (receive buffer size).
  • Maximum window size = 65,535 bytes (can be scaled using options).

Use: Implements flow control - prevents the sender from overwhelming the receiver by sending too much data at once.


9. Checksum (16 bits)

  • A 16-bit error-detection field computed over the TCP header, data, and a pseudo-header (containing source IP, destination IP, protocol, and TCP length).

Use: Ensures data integrity - detects any corruption that may have occurred during transmission.


10. Urgent Pointer (16 bits)

  • Valid only when the URG flag is set.
  • Points to the last byte of urgent data within the segment.

Use: Allows TCP to send out-of-band (priority) data that should be processed immediately by the receiving application.


11. Options (Variable, 0 to 40 bytes)

  • Used for optional parameters that are negotiated when the connection is set up, such as the maximum segment size, the window scale factor, selective acknowledgment permission, and timestamps.
  • Present only when the data offset is greater than 5, which is why the header can grow from 20 bytes up to 60 bytes.

Use: Lets TCP extend its behaviour beyond the fixed 20-byte header, for example by agreeing on a larger window or a segment size that avoids fragmentation.


12. Padding (Variable)

  • Extra zero bits added after the options so that the header ends on a 32-bit word boundary.

Use: Keeps the header length an exact multiple of 4 bytes, so the value carried in the data offset field remains valid.


Uses of the TCP Header

PurposeFields that provide it
Process to process deliverySource Port, Destination Port
Ordered delivery and reassemblySequence Number
Reliability and retransmissionAcknowledgment Number, ACK flag
Connection setup and teardownSYN, ACK, FIN, RST flags
Flow controlWindow Size
Error detectionChecksum
Priority dataURG flag, Urgent Pointer
Header extensionData Offset, Options, Padding

Conclusion

Every field of the TCP header exists to support one of the guarantees TCP makes. The port numbers deliver the segment to the right process, the sequence and acknowledgment numbers together with the checksum make the delivery reliable and in order, the flags manage the life of the connection, and the window size keeps a fast sender from overwhelming a slow receiver. This is why the minimum header is 20 bytes and can grow to 60 bytes when options are negotiated.

Most repeated questions

Topics asked at least twice, most-asked first.

asked 7xavg 5 marks · 2081, 2080.1, 2080, 2079, 2078...
Answer

Assume a class C network and divide it into three subnets. What is the value of the new subnet? [5]

Subnetting a Class C Network into Three Subnets

STEP 1 - EXTRACT: Given Data

  • Network Class: Class C
  • Default Subnet Mask: 255.255.255.0 (/24)
  • Network bits: 24, Host bits: 8
  • Required subnets: 3
  • Example network (for illustration, standard assumption): 192.168.1.0

No specific IP address is given in the question, so a representative network 192.168.1.0 is used only for demonstration.


STEP 2 - SOLVE

Step 1: Bits to Borrow

Number of subnets = $2^n$, where $n$ = borrowed bits.

We need at least 3 subnets:

Borrowed bits $n$Subnets $2^n$Enough for 3?
12No
24Yes

So borrow $n = 2$ bits.

Step 2: New Subnet Mask

Remaining host bits = $8 - 2 = 6$.

$$ \text{New mask} = 11111111.11111111.11111111.\underline{11}000000 $$

$$ \boxed{255.255.255.192 ;(/26)} $$

Step 3: New Subnet Value (Block Size / Increment)

$$ \text{Block size} = 2^{\text{remaining host bits}} = 2^{6} = 64 $$

Alternatively, block size = $256 - 192 = 64$.

$$ \boxed{\text{Subnet value} = 64} $$

Step 4: Resulting Subnets (using 192.168.1.0)

SubnetNetworkHost RangeBroadcast
0192.168.1.0.1 - .62192.168.1.63
1192.168.1.64.65 - .126192.168.1.127
2192.168.1.128.129 - .190192.168.1.191
3192.168.1.192.193 - .254192.168.1.255

Three of these four subnets satisfy the requirement.

Step 5: Usable Hosts per Subnet

$$ 2^{6} - 2 = 64 - 2 = 62 \text{ hosts} $$


Summary

ParameterValue
Bits borrowed2
Subnets created4 (3 required)
New Subnet Mask255.255.255.192
New Subnet Value (block size)64
Usable hosts/subnet62
asked 6xavg 7 marks · 2080.1, 2080, 2079, 2078, 2076
Answer

Differentiate between unicast and multicast routing. [5]

Routing is the process of selecting a path for traffic in a network, directing packet forwarding on the basis of routing tables that maintain records of routes to various network destinations. --- As stated in the notes, unicast is the s...

asked 4xavg 10 marks · 2080.1, 2080, 2078, 2076
Answer

What is flow control? How does stop-and-wait ARQ protocol handle error? What are its disadvantages.[10]

Flow Control, Stop-and-Wait ARQ, and Its Disadvantages


1. Flow Control

Flow control is a mechanism used at the Data Link Layer (and also at the Transport Layer) to regulate the rate of data transmission between a sender and a receiver so that the receiver is not overwhelmed by data faster than it can process.

: "The data rate must be constant on both sides else the data may get corrupted."

Without flow control:

  • A fast sender can flood a slow receiver's buffer.
  • Buffer overflow leads to data loss and corruption.

Flow control ensures that the sender transmits data only at a rate the receiver can handle, maintaining reliable and orderly communication.


2. Stop-and-Wait ARQ Protocol

ARQ stands for Automatic Repeat reQuest. It is an error control mechanism that uses acknowledgements (ACK) and retransmissions to ensure reliable delivery of frames.

Stop-and-Wait ARQ is the simplest form of ARQ. The working principle is:

The sender sends one frame at a time and then stops and waits for an acknowledgement (ACK) from the receiver before sending the next frame.


How Stop-and-Wait ARQ Handles Errors

There are three main error scenarios handled by this protocol:


Case 1: Frame Arrives Correctly (No Error)

Sender                        Receiver
  |------- Frame 0 ----------->|
  |<------- ACK 1 -------------|
  |------- Frame 1 ----------->|
  |<------- ACK 0 -------------|
  • Sender sends Frame 0.
  • Receiver receives it correctly and sends ACK 1 (ready for frame 1).
  • Sender sends the next frame upon receiving ACK.

Case 2: Frame is Lost or Damaged (Frame Error)

Sender                        Receiver
  |------- Frame 0 ---X        |   (frame lost/damaged)
  |   (Timer expires)          |
  |------- Frame 0 ----------->|   (retransmit)
  |<------- ACK 1 -------------|
  • The sender starts a timer after sending each frame.
  • If the frame is lost or corrupted, the receiver does not send an ACK.
  • When the timer expires, the sender retransmits the same frame.
  • This continues until a correct ACK is received.

Case 3: ACK is Lost or Damaged (ACK Error)

Sender                        Receiver
  |------- Frame 0 ----------->|
  |        ACK 1 ---X          |   (ACK lost)
  |   (Timer expires)          |
  |------- Frame 0 ----------->|   (retransmit)
  |<------- ACK 1 -------------|
  • The receiver correctly receives Frame 0 and sends ACK 1, but the ACK is lost.
  • The sender's timer expires and it retransmits Frame 0.
  • The receiver gets a duplicate frame (Frame 0 again).
  • The receiver discards the duplicate (because it already received Frame 0) and resends ACK 1.
  • Sequence numbers (0 and 1) are used to detect duplicates.

Case 4: ACK is Delayed (Late ACK)

  • If an ACK arrives after the timer has expired and the sender has already retransmitted:
    • The sender receives a delayed ACK.
    • It ignores the delayed ACK because it has already retransmitted and is waiting for a fresh ACK.
    • Sequence numbers help distinguish old ACKs from new ones.

Summary of Error Handling Mechanisms

MechanismPurpose
TimerDetects lost frames or lost ACKs
RetransmissionResends frame when timer expires
Sequence Numbers (0, 1)Detects and discards duplicate frames
Acknowledgement (ACK)Confirms successful receipt of a frame

3. Disadvantages of Stop-and-Wait ARQ

1. Very Low Efficiency / Poor Throughput

  • The sender sends only one frame at a time and then sits idle waiting for an ACK.
  • If propagation delay is large (e.g., satellite links), the channel is wasted for most of the time.
  • Efficiency = 1 / (1 + 2a) where a = propagation delay / transmission time
  • For large values of a, efficiency drops drastically.

2. Slow Data Transfer

  • Because only one frame is in transit at any time, the overall data transfer rate is very slow compared to the available bandwidth.

3. Wastes Bandwidth

  • The communication channel remains idle while the sender waits for an ACK, leading to severe underutilization of the available bandwidth.

4. Not Suitable for Long-Distance Communication

  • On links with high propagation delay (e.g., satellite or intercontinental links), the round-trip time is very large, making Stop-and-Wait extremely inefficient.

5. Performance Degrades with Errors

  • Every time an error occurs, the sender must wait for the timer to expire before retransmitting, adding significant delay.

6. Only One Frame Buffered

  • The sender needs to keep only one frame in its buffer, but this severely limits the pipeline and throughput.

Conclusion

Stop-and-Wait ARQ is a simple and easy-to-implement error control protocol that handles frame loss, frame damage, ACK loss, and duplicate frames using timers, retransmissions, and sequence numbers. However, its one-frame-at-a-time approach makes it highly inefficient, especially over high-latency or high-bandwidth links. More advanced protocols like Go-Back-N ARQ and Selective Repeat ARQ were developed to overcome these limitations by allowing multiple frames to be in transit simultaneously (pipelining).

asked 4xavg 5 marks · 2080.1, 2080, 2079, 2076
Answer

What do you understand by circuit switching? Explain. What are its advantage and disadvantage? [5]

Circuit switching is a switching technique that establishes a dedicated path or channel between the sender and receiver before data transmission begins. Once this dedicated path is established, it remains open and reserved exclusively fo...

asked 3xavg 8 marks · 2080.1, 2080, 2079
Answer

Explain TCP header with a neat diagram. Highlight on its uses.[10]

TCP Header - Explanation with Diagram

Introduction

TCP (Transmission Control Protocol) is a connection-oriented, reliable transport layer protocol. It ensures that data is delivered accurately and in order between two communicating hosts. The TCP header contains all the control information necessary to manage this reliable communication.


TCP Header Diagram

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          Source Port          |       Destination Port        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        Sequence Number                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Acknowledgment Number                      |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Data  |Reserv.|U|A|P|R|S|F|                                   |
|Offset |  (6)  |R|C|S|S|Y|I|         Window Size              |
|  (4)  |       |G|K|H|T|N|N|                                   |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|           Checksum            |         Urgent Pointer        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                    Options (if any)           |    Padding    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          Data                                 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Minimum TCP Header Size = 20 bytes (without options)


Detailed Explanation of Each Field

1. Source Port (16 bits)

  • Identifies the port number of the sending application on the source host.
  • Port numbers range from 0 to 65535.
  • Example: A web browser may use port 1025 as source port.

Use: Helps the receiving host know which application sent the data, enabling proper reply routing.


2. Destination Port (16 bits)

  • Identifies the port number of the receiving application on the destination host.
  • Example: HTTP uses port 80, HTTPS uses port 443, FTP uses port 21.

Use: Directs the incoming segment to the correct application/process on the destination machine.


3. Sequence Number (32 bits)

  • Indicates the position (byte number) of the first byte of data in this segment within the overall data stream.
  • During connection establishment (SYN), it carries the Initial Sequence Number (ISN).

Use: Enables the receiver to reorder segments that arrive out of order and detect missing data.


4. Acknowledgment Number (32 bits)

  • When the ACK flag is set, this field contains the next sequence number the sender of the acknowledgment expects to receive.
  • It acknowledges all bytes received up to (but not including) this number.

Use: Provides reliable delivery by confirming receipt of data and requesting the next expected byte.


5. Data Offset / Header Length (4 bits)

  • Specifies the length of the TCP header in 32-bit words.
  • Minimum value is 5 (20 bytes), maximum is 15 (60 bytes).

Use: Tells the receiver where the actual data begins in the TCP segment.


6. Reserved (6 bits)

  • These bits are reserved for future use and must be set to zero.

7. Control Flags (6 bits)

Each flag is 1 bit and serves a specific control purpose:

FlagFull NameUse
URGUrgentIndicates urgent pointer field is significant
ACKAcknowledgmentAcknowledgment number is valid
PSHPushReceiver should pass data to application immediately
RSTResetResets the connection abruptly
SYNSynchronizeUsed during connection establishment (3-way handshake)
FINFinishUsed to terminate a connection gracefully

Use: These flags control the state of the TCP connection - establishment, data transfer, and termination.


8. Window Size (16 bits)

  • Specifies the number of bytes the sender is willing to accept from the receiver (receive buffer size).
  • Maximum window size = 65,535 bytes (can be scaled using options).

Use: Implements flow control - prevents the sender from overwhelming the receiver by sending too much data at once.


9. Checksum (16 bits)

  • A 16-bit error-detection field computed over the TCP header, data, and a pseudo-header (containing source IP, destination IP, protocol, and TCP length).

Use: Ensures data integrity - detects any corruption that may have occurred during transmission.


10. Urgent Pointer (16 bits)

  • Valid only when the URG flag is set.
  • Points to the last byte of urgent data within the segment.

Use: Allows TCP to send out-of-band (priority) data that should be processed immediately by the receiving application.


11. Options (Variable, 0 to 40 bytes)

  • Used for optional parameters that are negotiated when the connection is set up, such as the maximum segment size, the window scale factor, selective acknowledgment permission, and timestamps.
  • Present only when the data offset is greater than 5, which is why the header can grow from 20 bytes up to 60 bytes.

Use: Lets TCP extend its behaviour beyond the fixed 20-byte header, for example by agreeing on a larger window or a segment size that avoids fragmentation.


12. Padding (Variable)

  • Extra zero bits added after the options so that the header ends on a 32-bit word boundary.

Use: Keeps the header length an exact multiple of 4 bytes, so the value carried in the data offset field remains valid.


Uses of the TCP Header

PurposeFields that provide it
Process to process deliverySource Port, Destination Port
Ordered delivery and reassemblySequence Number
Reliability and retransmissionAcknowledgment Number, ACK flag
Connection setup and teardownSYN, ACK, FIN, RST flags
Flow controlWindow Size
Error detectionChecksum
Priority dataURG flag, Urgent Pointer
Header extensionData Offset, Options, Padding

Conclusion

Every field of the TCP header exists to support one of the guarantees TCP makes. The port numbers deliver the segment to the right process, the sequence and acknowledgment numbers together with the checksum make the delivery reliable and in order, the flags manage the life of the connection, and the window size keeps a fast sender from overwhelming a slow receiver. This is why the minimum header is 20 bytes and can grow to 60 bytes when options are negotiated.

asked 3xavg 5 marks · 2080.1, 2079, 2076
Answer

Explain different types of network topologies. [5]

Network Topology refers to the physical or logical layout of a network. It defines the way different nodes are placed and interconnected with each other, and also describes how data is transferred between these nodes. Network topology is...

asked 3xavg 8 marks · 2081, 2078, 2076
Answer

Explain any two wireless transmission media. [5]

Wireless (unguided) media refers to transmission media where no physical medium is required for the transmission of electromagnetic signals. The signal is broadcasted through air and is used for larger distances, though it is considered ...

asked 3xavg 7 marks · 2081, 2080.1, 2076
Answer

What are the features of the application layer? Why is DNS required? Explain about recursive, non-recursive, and iterative DNS queries.[10]

Application Layer: Features, DNS, and Query Types


1. Features of the Application Layer

The Application Layer is Layer 7 of the OSI model (also called the Desktop Layer). It is implemented by network applications that produce data to be transferred over the network. It serves as a window for application services to access the network and display received information to the user.

Key Features / Functions:

FeatureDescription
File TransferAllows users to access, retrieve, and manage files on a remote computer (e.g., FTP)
Mail ServicesProvides the basis for email forwarding and storage facilities (e.g., SMTP, POP3)
Directory ServicesProvides database source access for global information about various services
Network Virtual TerminalAllows a user to log on to a remote host and work as if connected locally
User InterfaceResponsible for node-to-node communication and controls user-interface specifications
Access to Network ResourcesEnables browsers, messengers, Skype, and other applications to communicate over the network
Protocol SupportSupports protocols such as HTTP, HTTPS, SSH, DNS, FTP, SMTP, etc.

2. Why is DNS Required?

DNS (Domain Name System) is a hierarchical, distributed naming system used on the Internet.

The Core Problem:

  • Computers communicate using IP addresses (e.g., 142.250.190.46)
  • Humans find it easy to remember domain names (e.g., www.google.com)
  • There is a need for a system that translates domain names into IP addresses automatically

Reasons DNS is Required:

  1. Human Readability: It is nearly impossible for users to memorize numeric IP addresses for every website. DNS maps easy-to-remember names to IP addresses.

  2. Scalability: The Internet has billions of devices. A single centralized host file (like the old HOSTS.TXT) cannot scale. DNS uses a distributed hierarchical database to handle this.

  3. Dynamic IP Management: IP addresses of servers can change. DNS allows the domain name to remain constant even if the underlying IP address changes.

  4. Load Distribution: DNS can map one domain name to multiple IP addresses, enabling load balancing across servers.

  5. Service Location: DNS supports different record types (MX, CNAME, etc.) to locate mail servers, aliases, and other services.

In short: DNS acts as the "phone book" of the Internet, making it usable and accessible for humans.


3. Types of DNS Queries

When a client needs to resolve a domain name, the DNS system uses three types of queries:


3.1 Recursive DNS Query

Client --> Local DNS Resolver --> Root DNS --> TLD DNS --> Authoritative DNS
         <--(final answer)------<-----------<-----------<------------------
  • In a recursive query, the client asks the DNS resolver to do all the work and return the final answer.
  • The DNS resolver (usually the ISP's DNS server) takes full responsibility for resolving the query.
  • It contacts other DNS servers on behalf of the client and returns the complete resolved IP address or an error.
  • The client only makes one request and waits for the complete answer.

Steps:

  1. Client sends query to Local DNS Resolver: "What is the IP of www.example.com?"
  2. Local Resolver queries Root DNS Server
  3. Root DNS refers to TLD (.com) DNS Server
  4. TLD DNS refers to Authoritative DNS Server
  5. Authoritative DNS returns the IP address
  6. Local Resolver returns the final IP back to the client

Advantage: Simple for the client
Disadvantage: Heavy load on the DNS resolver


3.2 Non-Recursive (Iterative) DNS Query

Note: In many textbooks, "non-recursive" and "iterative" are used interchangeably. They describe the same process where the resolver is directed step-by-step.

Client --> Local DNS Resolver
           |
           +--> Root DNS Server  --> "Ask TLD Server at X.X.X.X"
           |
           +--> TLD DNS Server   --> "Ask Authoritative Server at Y.Y.Y.Y"
           |
           +--> Authoritative DNS Server --> "IP is Z.Z.Z.Z"
           |
Client <-- Final Answer
  • In an iterative (non-recursive) query, the DNS server does not do the full resolution itself.
  • Instead, it returns the best answer it currently has -- which may be a referral (address of another DNS server that might know the answer).
  • The resolver itself is responsible for following up with each referred server.
  • The process continues until the authoritative answer is found.

Steps:

  1. Client asks Local Resolver: "What is the IP of www.example.com?"
  2. Local Resolver asks Root DNS: Root says "I don't know, but ask the TLD server at 192.5.6.30"
  3. Local Resolver asks TLD DNS: TLD says "I don't know, but ask the Authoritative server at 205.251.196.1"
  4. Local Resolver asks Authoritative DNS: Returns "IP = 93.184.216.34"
  5. Local Resolver returns the IP to the client

Advantage: Distributes the load across multiple DNS servers
Disadvantage: More round trips required


3.3 Summary Comparison Table

FeatureRecursive QueryIterative (Non-Recursive) Query
Who does the work?DNS Resolver does all the workResolver follows referrals step by step
Response to clientFinal IP address (complete answer)Referral or final answer at each step
Load on resolverHighDistributed
Number of client requestsOneOne (but resolver makes multiple)
Typical useClient to Local ResolverLocal Resolver to other DNS servers
Error handlingReturns error if not foundReturns "not found" at each step
asked 3xavg 5 marks · 2081, 2080.1, 2080
Answer

Explain the working mechanism of token bucket. [5]

The Token Bucket algorithm is a traffic shaping mechanism that controls the amount and rate of traffic sent to the network. Unlike the leaky bucket, it allows variable output rate depending on the size of the burst, making it more flexib...

asked 2xavg 10 marks · 2080.1, 2080
Answer

What is classful addressing? Explain link state routing with a suitable example.[10]

--- Classful addressing is a method of organizing and allocating IPv4 addresses in which the 32-bit address space is divided into five fixed classes: A, B, C, D, and E. Each class occupies a specific portion of the address space, and the...

asked 2xavg 5 marks · 2080, 2076
Answer

Explain different types of network types. [5]

A network is a collection of interconnected devices that can communicate and share resources with each other. Networks are classified based on their size, geographic coverage, and purpose. The main types of networks are described below: ...

asked 2xavg 5 marks · 2079
Answer

Define Protocol. Why do we need standards? [5]

--- A protocol is a set of rules that governs communication between devices in a network. It defines how data is transmitted, received, and interpreted across a network. The three key elements of a protocol are: Element Description -----...

asked 2xavg 5 marks · 2079, 2078
Answer

What is a virtual circuit network? Explain frame relay as a virtual circuit-wide area network. [5]

A virtual circuit network is a type of connection-oriented packet switching network in which a dedicated logical path (virtual circuit) is established between the source and destination before data transmission begins. Key characteristic...

asked 2xavg 5 marks · 2080.1, 2079
Answer

Explain architecture of SDN. [5]

--- SDN is a network architecture approach that separates the control plane from the data plane, allowing network administrators to manage network behavior programmatically through centralized controllers. --- SDN architecture is divided...

asked 2xavg 10 marks · 2081, 2079
Answer

A bit stream 1101011011 is transmitted using the standard CRC method. The generator polynomial is 10011. What is the actual bit transmitted?[10]

CRC Method - Worked Solution

STEP 1 - EXTRACT: Given Data

  • Message bit stream (M): $1101011011$ (10 bits)
  • Generator polynomial (G): $10011$ (5 bits)
  • Degree r = 5 - 1 = 4, so append 4 zeros

STEP 2 - SOLVE

Step 1: Append r = 4 zeros

$$\text{Augmented message} = 11010110110000$$

Step 2: Modulo-2 Division by 10011

I will perform the division carefully, XOR at each step where the leading bit is 1.

Dividend: 1 1 0 1 0 1 1 0 1 1 0 0 0 0
Divisor:  1 0 0 1 1

Take leading 5 bits: 11010

  11010
^ 10011
  -----
  01001   -> bring down next bit (1): 10011
  10011
^ 10011
  -----
  00000   -> bring down next bit (1): 00001

Leading bit 0, no XOR. Bring down bits successively (append divisor 0):

  00001 -> bring 0 -> 00010 -> bring 1 -> 00101 -> bring 1 -> 01011 -> bring 0 -> 10110

Let me track the remaining message bits after position used. Augmented = 1 1 0 1 0 1 1 0 1 1 0 0 0 0

After consuming first 6 bits (110101) we had remainder 00001 with bits 10110000 remaining. Let me do this position by position (standard shift method).

Working register method:

Start reg = first 5 bits 11010, remaining stream = 110110000

  1. reg=11010, MSB=1 → XOR 10011 = 01001; shift in next bit 1 → 10011; remaining 10110000
  2. reg=10011, MSB=1 → XOR 10011 = 00000; shift in 1 → 00001; remaining 0110000
  3. reg=00001, MSB=0 → shift in 0 → 00010; remaining 110000
  4. reg=00010, MSB=0 → shift in 1 → 00101; remaining 10000
  5. reg=00101, MSB=0 → shift in 1 → 01011; remaining 0000
  6. reg=01011, MSB=0 → shift in 0 → 10110; remaining 000
  7. reg=10110, MSB=1 → XOR 10011 = 00101; shift in 0 → 01010; remaining 00
  8. reg=01010, MSB=0 → shift in 0 → 10100; remaining 0
  9. reg=10100, MSB=1 → XOR 10011 = 00111; shift in 0 → 01110; remaining (none)

Now all message+zero bits consumed. The register holds a 5-bit value 01110, but the remainder is the last r = 4 bits = 1110.

Let me verify with clean long division check on final steps. After step 9 the register = 01110. Taking the low 4 bits gives remainder.

Remainder (FCS) = 1110

Step 3: Transmitted Codeword

$$\text{Transmitted} = \text{Message} ;+; \text{Remainder} = 1101011011 ;+; 1110$$

$$\boxed{\text{Transmitted bits} = 110101101,1,1110 = 11010110111110}$$


Verification (Receiver Side)

Divide $11010110111110$ by $10011$ → remainder should be $0000$.

Quick check using register method on 11010110111110:

  1. 11010^10011=01001, in 1 →10011, rem stream 0111110
  2. 10011^10011=00000, in 0 →00000, rem 111110
  3. 00000 in 1 →00001, rem 11110
  4. 00001 in 1 →00011, rem 1110
  5. 00011 in 1 →00111, rem 110
  6. 00111 in 1 →01111, rem 10
  7. 01111 in 1 →11111, rem 0
  8. 11111^10011=01100, in 0 →11000, rem (none)

Remainder low 4 bits = 1000 ≠ 0. This indicates my remainder needs rechecking.

Recheck division carefully (full long division):

11010110110000 : 10011

11010
10011
-----
 10011 (0)  <- next bit 0? 

Doing textbook long division:

  11010110110000
  10011
  ----------------
  0100110110000
   10011
   ---------------
   000000110000
        (bring bits) 110000
        10011
        ------
        010010 -> 10010... 

Let me be fully systematic aligning positions:

  • Pos1: 11010110110000; 10011 fits at start: XOR top 5 11010^10011=01001 → 0100110110000 (13 more)
  • Leading 0s, next 1 at pos2: 100110110000; 1001... take 5 bits 10011^10011=00000 → 0000110110000...
  • next 1: 110110000; 11011^10011=01000 → 010000000... take next: 10000000; 10000^10011=00011 → 0011000... continue: 11000^10011=01011→10110; 10110^10011=00101→01010→10100; 10100^10011=00111→01110

Final remainder = 1110 (last 4 bits).

The receiver-check arithmetic above had a shift error; the correct remainder is 1110, matching the division. The transmitted codeword is:

$$\boxed{11010110111110}$$


Summary

ComponentBits
Message1101011011
Appended zeros0000
Generator10011
CRC Remainder1110
Transmitted codeword11010110111110

Study every one of these with model answers, flashcards, and MCQs.

Open CSC263 study modes