2080.1

CSC263 · TU past paper

Computer Networks 2080.1 question paper

The complete TU 2080.1 exam paper for Computer Networks (CSC263), all 12 questions with solved model answers written to the mark scheme.

Tap a question to open its answer.

  1. 110 marksClass-full and Classless AddressingAnswer

    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...

  2. 210 marksFraming and Flow Control MechanismsAnswer

    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).

  3. 310 marksTransport ProtocolsAnswer

    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.

  4. 45 marksOverview of Network TopologiesAnswer

    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...

  5. 55 marksCircuit, Message & Packet SwitchingAnswer

    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...

  6. 65 marksOverview of Logical Link ControlAnswer

    State the functionality of logical link control. Briefly explain HDLC. [5]

    --- LLC is the upper sublayer of the Data Link Layer in the OSI reference model. Its key functionalities are: 1. Interface between Layers: It acts as an interface between the Network Layer and the MAC sublayer, hiding the details of the ...

  7. 75 marksTypes of RoutingAnswer

    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...

  8. 85 marksTraffic Shaping AlgorithmsAnswer

    What is the difference between port and socket? Explain leaky bucket algorithm with example. [5]

    Port vs Socket and Leaky Bucket Algorithm


    Part 1: Difference Between Port and Socket

    FeaturePortSocket
    DefinitionA port is a logical number assigned to identify a specific process or service on a hostA socket is a combination of an IP address and a port number
    PurposeIdentifies a specific application/service on a machineIdentifies both the machine (via IP) and the service (via port) on a network
    RepresentationJust a number (e.g., 80, 443, 21)Represented as IP:Port (e.g., 192.168.1.1:80)
    ScopeLocal to a single machineUsed for end-to-end communication across a network
    CommunicationCannot alone establish communicationActs as one endpoint of a two-way communication link between two programs running on the network
    ExamplePort 80 (HTTP), Port 21 (FTP)192.168.1.5:80

    A socket is one endpoint of a two-way communication link between two programs running on the network.


    Part 2: Leaky Bucket Algorithm

    Definition

    The Leaky Bucket Algorithm is used to control the rate of data transmission in a network. It is implemented as a single server queue with constant service time. The key idea is:

    • Input rate can vary (bursty traffic)
    • Output rate remains constant
    • If the bucket (buffer) overflows, packets are discarded

    It converts bursty traffic into fixed-rate (smooth) traffic by averaging the data rate.


    How It Works

    Incoming packets (variable rate)
            |
            v
       [ BUCKET / BUFFER ]
            |
            v
    Outgoing packets (constant rate)
    
    1. Packets arrive at irregular/bursty intervals and enter the bucket (queue).
    2. The bucket leaks (outputs) packets at a fixed constant rate.
    3. If the bucket is full, any new incoming packet is dropped/discarded.
    4. This ensures the network receives a smooth, uniform flow of data.

    Example

    Suppose:

    • Bucket size (buffer capacity) = 10 packets
    • Output rate = 2 packets per second
    Time (sec)Packets ArrivingBucket BeforePackets SentPackets DroppedBucket After
    150203
    263207
    3872310
    4110209
    509207
    • At time 3: 7 (existing) + 8 (arriving) = 15, but bucket size is only 10, so 3 packets are dropped.
    • Output is always a constant 2 packets/sec, regardless of how many arrive.

    Advantages

    • Prevents network congestion by smoothing out bursty traffic.
    • Ensures a constant output rate for downstream devices.

    Disadvantage

    • Bursty traffic that exceeds bucket size leads to packet loss.
  9. 95 marksDNS and the Query TypesAnswer

    What do you understand by DNS? Explain FTP and SFTP. [5]

    --- DNS is a hierarchical, distributed naming system used on the Internet that translates human-readable domain names (e.g., www.google.com) into machine-readable IP addresses (e.g., 142.250.64.100). - Without DNS, users would have to re...

  10. 105 marksOverview of SDN and its Features, Data andAnswer

    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...

  11. 115 marksIPv4 Addressing & Sub-nettingAnswer

    Write short notes on : a. IPv4 b. Infrared [5]

    --- IPv4 is the fourth version of the Internet Protocol and is one of the core protocols of the Internet Protocol Suite. It is a connectionless protocol used for transmitting data packets across networks. - Address Size: IPv4 uses a 32-b...

  12. 125 marksNumericalIPv4 Addressing & Sub-nettingAnswer

    Suppose you are given an IP address 192.168.0.0, perform subnetting and divide the given network in 2 subnets. Calculate total number of host that can be configured, range of IP address. [5]

    • IP address: 192.168.0.0 - Required number of subnets: 2 The first octet is 192, which lies in the range 192-223, so this is a Class C address. - Default subnet mask: $255.255.255.0$ (/24) - Network bits = 24, Host bits = 8 To create 2 ...