2020 question paper

Computer Networks

23 questions

  1. Q1a. An Internet Service Provider (ISP) has the following chunk of CIDR-based IP addresses available with it: 245.248.128.0/20 The ISP wants to give half of this chunk of addresses to organization A, and a quarter to organization B, while retaining the remaining with itself. Which of the following is a valid allocation of addresses to A and B? (i) 245.248.136.0/21 and 245.248.128.0/22 (ii) 245.248.128.0/21 and 245.248.128.0/22 (iii) 245.248.132.0/22 and 245.248.132.0/21 (iv) 245.248.136.0/22 and 245.248.132.0/2120202m

    Module 3: Network Layer & Routing

    An Internet Service Provider (ISP) has the following chunk of CIDR-based IP addresses available with it:

    245.248.128.0/20

    The ISP wants to give half of this chunk of addresses to organization A, and a quarter to organization B, while retaining the remaining with itself. Which of the following is a valid allocation of addresses to A and B?

    (i) 245.248.136.0/21 and 245.248.128.0/22
    (ii) 245.248.128.0/21 and 245.248.128.0/22
    (iii) 245.248.132.0/22 and 245.248.132.0/21
    (iv) 245.248.136.0/22 and 245.248.132.0/21

    View this question on its own page →
    Worked Solution

    Answer: (i) 245.248.136.0/21 and 245.248.128.0/22

    Why: The block 245.248.128.0/20 spans 245.248.128.0 – 245.248.143.255 (4096 addresses), so a half is a /21 (2048 addrs) and a quarter is a /22 (1024 addrs). Option (i) gives A the upper half 136.0 – 143.255 and B the first quarter 128.0 – 131.255: both lie inside the /20 and do not overlap. In (ii) both start at 128.0, so B's /22 is nested inside A's /21 (overlap); in (iii) the sizes are swapped (A gets only 1024) and they overlap; in (iv) A gets a /22 (a quarter, not a half) and overlaps B's /21.

  2. Q1b. Which one of the following tasks is not done by data link layer? (i) Framing (ii) Error control (iii) Flow control (iv) Channel coding20202m

    Module 2: Data Link Layer & MAC Sublayer

    Which one of the following tasks is not done by data link layer?

    (i) Framing
    (ii) Error control
    (iii) Flow control
    (iv) Channel coding

    View this question on its own page →
    Worked Solution

    (iv) Channel coding

    The Data Link layer performs framing (organizing bits into frames), error control (detecting/correcting errors via checksums/CRC), and flow control (regulating transmission rate between sender and receiver).

    Channel coding (adding redundancy to combat channel noise at the signal level, e.g. line coding schemes) is a Physical layer function, not a Data Link layer function — it deals with how bits are represented as signals, which is below the Data Link layer's scope.

  3. Q1c. Frames from one LAN can be transmitted to another LAN via the device (i) Router (ii) Bridge (iii) Repeater (iv) Modem20202m

    Module 1: Physical Layer & Data Communication

    Frames from one LAN can be transmitted to another LAN via the device

    (i) Router
    (ii) Bridge
    (iii) Repeater
    (iv) Modem

    View this question on its own page →
    Worked Solution

    (ii) Bridge

    A bridge operates at the Data Link layer and forwards frames between two LAN segments based on MAC addresses, effectively joining them into one larger logical LAN while still filtering traffic by segment. A repeater only regenerates signals within the same LAN (no frame-level forwarding), a router works at the Network layer forwarding packets between different networks (not LAN frames), and a modem converts digital signals to analog for transmission over telephone lines.

  4. Q1d. ______ refers to the physical or logical arrangement of a network. (i) Topology (ii) Mode of operation (iii) Data flow (iv) None of the above20202m

    Module 1: Physical Layer & Data Communication

    ______ refers to the physical or logical arrangement of a network.

    (i) Topology
    (ii) Mode of operation
    (iii) Data flow
    (iv) None of the above

    View this question on its own page →
    Worked Solution

    (i) Topology

    Network topology describes how nodes and links are physically laid out (physical topology) or how data logically flows between them (logical topology) — e.g. bus, star, ring, mesh.

  5. Q1e. In pure ALOHA, the vulnerable time is ______ the frame transmission time. (i) the same as (ii) two times (iii) three times (iv) None of the above20202m

    Module 2: Data Link Layer & MAC Sublayer

    In pure ALOHA, the vulnerable time is ______ the frame transmission time.

    (i) the same as
    (ii) two times
    (iii) three times
    (iv) None of the above

    View this question on its own page →
    Worked Solution

    (ii) two times

    In pure ALOHA, a station transmits a frame whenever it has data, with no coordination with other stations. A collision occurs if any other station starts transmitting within one frame-time before OR after this station's transmission begins.

             <-- Tfr -->|<-- Tfr -->|<-- Tfr -->
       ...---[frame X starts]------[frame X ends]---...
             ^                                  ^
       vulnerable window                 vulnerable window
       (1 frame-time before)             (1 frame-time after)
    

    So the total vulnerable period = 1 frame-time (before) + 1 frame-time (after) = 2 x frame transmission time. This large vulnerable window is why pure ALOHA has a low maximum throughput (~18.4%), compared to slotted ALOHA's vulnerable time of just 1 frame-time (throughput ~36.8%).

  6. Q1f. What is the default subnet mask for a class A network? (i) 127.0.0.1 (ii) 255.0.0.0 (iii) 255.255.255.0 (iv) 255.255.255.020202m

    Module 3: Network Layer & Routing

    What is the default subnet mask for a class A network?

    (i) 127.0.0.1
    (ii) 255.0.0.0
    (iii) 255.255.255.0
    (iv) 255.255.255.0

    View this question on its own page →
    Worked Solution

    Answer: (ii) 255.0.0.0

    Why: Class A uses the first 8 bits as the network id (first octet 1–126), so the default mask is 255.0.0.0255.0.0.0 i.e. /8, leaving 24 bits for hosts (224−22^{24}-2 hosts). Option (i) 127.0.0.1 is the loopback address, not a mask, and (iii)/(iv) 255.255.255.0 (/24) is the class C default mask.

  7. Q1g. What is the port number for POP3? (i) 110 (ii) 90 (iii) 80 (iv) 4920202m

    Module 5: Application Layer & Security

    What is the port number for POP3?

    (i) 110
    (ii) 90
    (iii) 80
    (iv) 49

    View this question on its own page →
    Worked Solution

    Answer: (i) 110

    Why: POP3 (Post Office Protocol version 3) uses well-known TCP port 110 (995 for POP3 over TLS). Port 80 is HTTP, port 49 is the LOGIN host protocol, and 90 is not assigned to POP3 — so (ii), (iii) and (iv) are all wrong.

  8. Q1h. The IEEE 802 project of the 1980s involved further defining the lower two layers of the OSI model. A number of standards were agreed upon during that time. Which of the following is the standard for ethernet? (i) 802.2 (ii) 802.3 (iii) 802.4 (iv) 802.520202m

    Module 1: Physical Layer & Data Communication

    The IEEE 802 project of the 1980s involved further defining the lower two layers of the OSI model. A number of standards were agreed upon during that time. Which of the following is the standard for ethernet?

    (i) 802.2
    (ii) 802.3
    (iii) 802.4
    (iv) 802.5

    View this question on its own page →
    Worked Solution

    (ii) 802.3

    IEEE 802.3 is the standard for Ethernet (CSMA/CD-based LANs). For reference: 802.2 is Logical Link Control (LLC), 802.4 is Token Bus, and 802.5 is Token Ring.

  9. Q1i. The first network is (i) CNNET (ii) NSFNET (iii) ASAPNET (iv) ARPANET20202m

    Module 1: Physical Layer & Data Communication

    The first network is

    (i) CNNET
    (ii) NSFNET
    (iii) ASAPNET
    (iv) ARPANET

    View this question on its own page →
    Worked Solution

    (iv) ARPANET

    ARPANET (Advanced Research Projects Agency Network), launched in 1969 by the U.S. Department of Defense, is widely recognized as the first operational packet-switched network and the direct precursor to the modern internet.

  10. Q1j. TCP (i) operates at the data link layer (ii) is connection-oriented and unreliable (iii) is connection-oriented and reliable (iv) is connectionless and unreliable20202m

    Module 4: Transport Layer & Congestion Control

    TCP

    (i) operates at the data link layer
    (ii) is connection-oriented and unreliable
    (iii) is connection-oriented and reliable
    (iv) is connectionless and unreliable

    View this question on its own page →
    Worked Solution

    Answer: (iii) is connection-oriented and reliable

    Why: TCP opens a connection with a 3-way handshake and guarantees ordered, error-free, duplicate-free delivery of the byte stream using sequence numbers, cumulative ACKs, a header checksum, retransmission and flow control. It runs at the transport layer, not the data link layer, so (i) is wrong; it is reliable, so (ii) is wrong; and "connectionless and unreliable" describes UDP, not TCP, ruling out (iv).

  11. Budget App•POCKETLY

    Pocketly on Android

    Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.

    Install Pocketly
  12. Q2a. What is the importance of physical layer? Discuss the main duties of the physical layer.20207m

    Module 1: Physical Layer & Data Communication

    What is the importance of physical layer? Discuss the main duties of the physical layer.

    View this question on its own page →
    Worked Solution

    Importance of the Physical Layer

    The Physical layer is the foundation of the entire protocol stack — every bit that any higher layer wants to send must ultimately be converted into a physical signal and pushed onto the medium. Without a correctly functioning Physical layer, no communication (however well-designed at higher layers) can occur at all. It bridges the gap between the abstract, logical world of data (bits, frames, packets) and the physical world of electrical/optical/radio signals.

    Main duties of the Physical Layer

    1. Bit representation — encodes bits (0s and 1s) into signals using a chosen line-coding scheme (e.g. NRZ, Manchester encoding).
    2. Data rate — defines the transmission rate (bits per second) supported by the medium.
    3. Synchronization of bits — sender and receiver clocks must be synchronized so the receiver correctly samples each bit.
    4. Line configuration — specifies whether the connection is point-to-point (two devices) or multipoint (shared medium among many devices).
    5. Physical topology — defines how devices are physically connected (bus, star, ring, mesh).
    6. Transmission mode — defines the direction of signal flow: simplex, half-duplex, or full-duplex.
    7. Mechanical/electrical specification — defines connector shapes, pin assignments, voltage levels, and cable characteristics.
  13. Q2b. Explain how sliding window protocol works at data link layer.20207m

    Module 2: Data Link Layer & MAC Sublayer

    Explain how sliding window protocol works at data link layer.

    View this question on its own page →
    Worked Solution

    The sliding window protocol at the Data Link layer allows a sender to transmit multiple frames before requiring an acknowledgement for each one, improving throughput compared to stop-and-wait, while still providing flow control.

    How it works

    1. Both sender and receiver maintain a window — a range of sequence numbers currently valid for sending (sender's window) or accepting (receiver's window).
    Sender's window (size N):
    
      [sent & ACKed] [sent, unACKed] [can send now] [cannot send yet]
           ...         S1  S2  S3          -            -
                       <----- window (size N) ----->
    
    1. The sender can transmit any frame whose sequence number falls within its current window without waiting for an individual ACK — up to N outstanding (unacknowledged) frames at once.

    2. As the receiver correctly receives frames, it sends back ACKs (either individually or cumulatively, depending on the variant — Go-Back-N uses cumulative ACKs, Selective Repeat uses individual ACKs).

    3. Each time the sender receives an ACK for the oldest outstanding frame (the left edge of its window), the window "slides" forward by one (or more) positions, freeing up room to send new frames.

    4. If a frame is lost or corrupted (detected via timeout or NACK), depending on the variant:

      • Go-Back-N: the sender resends the lost frame and every frame sent after it (since the receiver discards out-of-order frames).
      • Selective Repeat: only the specific lost frame is resent, since the receiver buffers out-of-order frames until the gap is filled.
    5. The receiver's window similarly defines which sequence numbers it's currently willing to accept; for Go-Back-N the receiver window size is 1 (strict in-order only), while for Selective Repeat it matches the sender's window size to allow buffering.

    Purpose: by keeping multiple frames "in flight" at once (pipelining), the sliding window protocol keeps the transmission link busy instead of idling while waiting for each individual ACK's round-trip time, significantly improving throughput on high-bandwidth or long-delay links.

  14. Q3a. Explain random access protocol. Differentiate between pure ALOHA and slotted ALOHA.20207m

    Module 2: Data Link Layer & MAC Sublayer

    Explain random access protocol. Differentiate between pure ALOHA and slotted ALOHA.

    View this question on its own page →
    Worked Solution

    Random access protocols are a category of multiple access (MAC sublayer) protocols in which no station has a scheduled turn or fixed priority — any station with data ready may attempt to transmit at any time, without needing permission or a pre-assigned time slot. Because multiple stations can attempt to transmit simultaneously, collisions are possible, and the protocol must define rules for how stations detect, handle, and recover from them (e.g. random backoff before retrying). Examples include ALOHA, CSMA, CSMA/CD, and CSMA/CA.

    Pure ALOHA vs Slotted ALOHA

    Aspect Pure ALOHA Slotted ALOHA
    Transmission timing A station transmits immediately whenever it has data ready, with no synchronization Time is divided into fixed-length slots (= 1 frame transmission time); a station may only begin transmitting at the start of a slot
    Vulnerable time 2 x frame transmission time (a collision can occur if any other station starts within one frame-time before or after) 1 x frame transmission time (since all stations are synchronized to slot boundaries, overlaps can only happen if two stations pick the same slot)
    Maximum throughput ~18.4% (S = G x e^(-2G), max at G=0.5) ~36.8% (S = G x e^(-G), max at G=1), exactly double pure ALOHA
    Synchronization needed No Yes — requires a global clock/synchronization mechanism among all stations
    Delay at low load Lower (no waiting for slot boundary) Slightly higher (must wait for next slot start)

    By halving the vulnerable time, slotted ALOHA significantly reduces the collision probability at any given load, roughly doubling the maximum achievable throughput compared to pure ALOHA — at the cost of requiring all stations to be time-synchronized.

  15. Q3b. Explain the different types of Ethernet.20207m

    Module 1: Physical Layer & Data Communication

    Explain the different types of Ethernet.

    View this question on its own page →
    Worked Solution

    Ethernet (IEEE 802.3) has evolved through several generations, each increasing speed while largely keeping the same frame format:

    Type Standard Speed Typical Medium
    Standard Ethernet 10BASE5, 10BASE2, 10BASE-T 10 Mbps Coax (bus) or UTP (star, via hub)
    Fast Ethernet 100BASE-TX, 100BASE-FX 100 Mbps Cat 5 UTP or fiber
    Gigabit Ethernet 1000BASE-T, 1000BASE-SX/LX 1 Gbps Cat 5e/6 UTP or fiber
    10-Gigabit Ethernet 10GBASE-T, 10GBASE-SR/LR 10 Gbps Cat 6a UTP or fiber
    Switched Ethernet — Varies Uses switches instead of hubs; each port is its own collision domain, enabling full-duplex, collision-free operation

    Key distinctions:

    • Standard/legacy Ethernet used a shared bus/hub and CSMA/CD for collision handling.
    • Fast and Gigabit Ethernet kept backward-compatible frame formats but increased clock rates and improved encoding schemes to push more bits/sec over the same or better cabling.
    • Switched Ethernet replaced the shared-medium model with point-to-point, full-duplex links to a switch, eliminating collisions altogether and letting all the newer speed standards run without CSMA/CD overhead.
  16. Q4a. How do guided media differ from unguided media? Name the advantages of optical fiber over twisted-pair and coaxial cable.20207m

    Module 1: Physical Layer & Data Communication

    How do guided media differ from unguided media? Name the advantages of optical fiber over twisted-pair and coaxial cable.

    View this question on its own page →
    Worked Solution

    Guided vs Unguided Media

    Aspect Guided Media Unguided Media
    Physical path Signal is confined to a physical conductor (cable) — twisted pair, coaxial, fiber Signal propagates freely through air/space — radio waves, microwaves, infrared
    Direction control Signal direction is fixed by the cable path Signal can spread in multiple directions (omnidirectional) or be focused (directional, e.g. satellite dish)
    Security Harder to intercept without physical access Easier to intercept since signals radiate openly
    Mobility Requires physical connection — no device mobility Supports mobile/untethered devices (Wi-Fi, cellular)
    Typical examples Twisted pair, coaxial cable, fiber optic Radio waves, microwaves, infrared, satellite links

    Advantages of optical fiber over twisted-pair and coaxial cable

    1. Higher bandwidth — supports much higher data rates (multi-Gbps to Tbps) than copper media.
    2. Lower attenuation — signal travels much farther before needing regeneration, reducing the number of repeaters needed.
    3. Immunity to EMI — since it carries light, not electrical current, it's unaffected by electromagnetic interference and doesn't cause crosstalk.
    4. Better security — much harder to tap into without physically breaking the fiber (which is detectable).
    5. Smaller size and lighter weight — easier to route in dense cable runs compared to bulky coaxial cable.
    6. No electrical hazard — since it doesn't carry electrical current, it's safe in electrically noisy or hazardous environments (e.g. near heavy machinery).
  17. Q4b. Why does the transport layer take measures to control congestion when it is primarily handled at the network layer? TCP is provided with techniques to control congestion, but not UDP. Why?20207m

    Module 4: Transport Layer & Congestion Control

    Why does the transport layer take measures to control congestion when it is primarily handled at the network layer? TCP is provided with techniques to control congestion, but not UDP. Why?

    View this question on its own page →
    Worked Solution

    Congestion Control at the Transport Layer

    Congestion occurs when too many hosts inject traffic into a part of the network faster than its links/routers can drain it — queues overflow, packets are dropped, delays rise and throughput can collapse. Detecting congestion and curing it are two different things: routers can detect it, but only the end hosts can reduce the offered load, which is why the transport layer must participate.

    Why transport-layer control is necessary even though congestion is a network-layer problem

    Aspect Network layer Transport layer
    View Local — one router's queue End-to-end across the whole path
    Can detect congestion? Yes (buffer overflow, ECN bits, queue delay) Yes (loss, RTT growth, duplicate ACKs)
    Can throttle traffic? Only per-packet (drop/mark/ECN) — cannot tell the source to slow down persistently Yes — the sender controls its own sending rate
    State kept Ideally stateless (no per-flow state) Per-connection state (cwnd, ssthresh)
    Scope Works only while packet is in that router Adapts to route changes, cross traffic anywhere on path
    • The network layer sees only a local snapshot; congestion is an aggregate, end-to-end phenomenon, so only an end-to-end mechanism can react correctly to it.
    • IP routers are designed to be stateless and forward packets fast; holding per-connection rate information for millions of flows at every router is impractical (scaling, memory, processing).
    • Cross traffic appears/disappears constantly and routes change — the sender must continuously adapt its rate, which only the source can do.
    • Modern IP offers ECN: routers mark packets instead of dropping them, but the reaction (slowing down) still happens in TCP.

    Why TCP has congestion control and UDP does not

    TCP maintains a congestion window (cwnd); the effective sending window is min(cwnd, rwnd). It starts with slow start (exponential growth of cwnd from 1 MSS until ssthresh), then switches to congestion avoidance (linear +1 MSS/RTT). On 3 duplicate ACKs it does fast retransmit/fast recovery (halve cwnd); on RTO it resets cwnd to 1 MSS and doubles ssthresh — the classic AIMD (additive-increase/multiplicative-decrease) behaviour that keeps the network stable and fairly shared.

    UDP has no congestion control because it is connectionless: there is no connection setup, no sequence numbers/ACKs, no retransmission and therefore no feedback signal to tell it that congestion occurred. It also keeps no per-connection state to hold a cwnd. UDP apps (DNS queries, RTP streaming) are typically short, delay-sensitive, or handle quality at the application layer (e.g. RTP/RTCP); if a UDP datagram is lost to congestion, it is simply dropped rather than retransmitted.

    (Note: because uncontrolled UDP harms everyone, mechanisms like LEDBAT and QUIC-over-UDP implement congestion control above the transport — confirming that the control itself must exist somewhere, but not in connectionless UDP itself.)

  18. Q5a. Describe about services provided by the data-link layer.20207m

    Module 2: Data Link Layer & MAC Sublayer

    Describe about services provided by the data-link layer.

    View this question on its own page →
    Worked Solution

    The Data Link layer sits between the Physical layer (raw bit transmission) and the Network layer, and offers the following core services to the layer above it:

    1. Framing
    Organizes the raw bitstream received from the Physical layer into discrete, delimited frames, each carrying its own header (addressing, control info) and trailer (error-check bits), giving the Network layer a well-defined unit of data to work with rather than an undifferentiated bit stream.

    2. Physical (MAC) Addressing
    Attaches source and destination hardware addresses to each frame, allowing correct delivery within a local network segment — distinct from the logical (IP) addressing handled at the Network layer.

    3. Flow Control
    Regulates the rate at which frames are sent so a fast sender doesn't overwhelm a slower receiver's buffering capacity, typically using sliding-window mechanisms.

    4. Error Control
    Detects (and sometimes corrects) bit errors introduced during transmission, using techniques like parity, checksums, or CRC, combined with ACK/retransmission (ARQ) schemes to recover from lost or corrupted frames.

    5. Access Control (Media Access Control)
    On a shared medium (e.g. a LAN), determines which device gets to use the channel at any given time, avoiding or resolving collisions — handled by protocols like CSMA/CD or CSMA/CA within the MAC sublayer.

    Two broad service types offered upward to the Network layer:

    • Connectionless service — each frame is sent independently, with no prior handshake, and delivery is not guaranteed (e.g. Ethernet's basic frame delivery).
    • Connection-oriented service — involves an establishment phase, in-order delivery, and reliable acknowledgement of every frame before the connection is later terminated (e.g. some WAN link-layer protocols like older HDLC-based links).
  19. Q5b. What are the advantages of dividing an Ethernet LAN with a bridge? Why is there no need for CSMA/CD on a full-duplex Ethernet LAN? The address 43:78:6C:DE:10:00 has been shown as the source address in an Ethernet frame. The receiver has discarded the frame. Why?20207m

    Module 2: Data Link Layer & MAC Sublayer

    What are the advantages of dividing an Ethernet LAN with a bridge? Why is there no need for CSMA/CD on a full-duplex Ethernet LAN? The address 43:78:6C:DE:10:00 has been shown as the source address in an Ethernet frame. The receiver has discarded the frame. Why?

    View this question on its own page →
    Worked Solution

    Advantages of dividing an Ethernet LAN with a bridge

    1. Smaller collision domains — each segment becomes an independent collision domain, reducing collisions and improving overall performance.
    2. Traffic filtering — the bridge only forwards a frame to the other segment if the destination actually resides there, keeping local traffic local and reducing unnecessary congestion.
    3. Increased effective bandwidth — since segments operate more independently, total usable bandwidth across the LAN increases.
    4. Fault isolation — problems on one segment (e.g. excessive collisions) don't necessarily degrade the whole network.
    5. Extended reach — lets a LAN span more devices/greater distance than a single segment's physical limits allow.

    Why no need for CSMA/CD on a full-duplex Ethernet LAN

    CSMA/CD exists to handle collisions on a shared medium. In full-duplex Ethernet, each device has a dedicated point-to-point link to the switch with separate transmit/receive paths, so no other device contends for that same link — collisions cannot physically occur. Since the precondition for a collision doesn't exist, CSMA/CD's sensing and backoff mechanism becomes unnecessary and is disabled.

    Why the frame with source address 43:78:6C:DE:10:00 was discarded

    Convert the first byte to binary:

    43 (hex) = 0100 0011 (binary)
    

    In Ethernet addressing, the least significant bit of the first byte indicates whether the address is:

    • 0 → a unicast (individual) address
    • 1 → a multicast/group address

    Here, the least significant bit is 1 (...0011, rightmost bit = 1), meaning this address is formatted as a multicast/group address.

    However, a frame's source address must always be a unicast (individual) address — only a destination address is allowed to be multicast or broadcast; a frame can never legitimately originate from a "group." Since this address was presented as the source address but is bit-pattern-flagged as multicast, the receiver correctly recognizes the frame as malformed/invalid and discards it.

  20. Q6b. An IP datagram is carrying a TCP segment destined for address 130.14.16.17/16. The destination port address is corrupted, and it arrives at destination 130.14.16.19/16. How does the receiving TCP react to this error? Show the entries for the header of a TCP segment that carries a message from an FTP client to an FTP server. Fill the checksum field with Os. Choose an appropriate ephemeral port number and the correct well-known port number. The length of the data is 40 bytes.20207m

    Module 4: Transport Layer & Congestion Control

    An IP datagram is carrying a TCP segment destined for address 130.14.16.17/16. The destination port address is corrupted, and it arrives at destination 130.14.16.19/16. How does the receiving TCP react to this error? Show the entries for the header of a TCP segment that carries a message from an FTP client to an FTP server. Fill the checksum field with Os. Choose an appropriate ephemeral port number and the correct well-known port number. The length of the data is 40 bytes.

    View this question on its own page →
    Worked Solution

    Corrupted Destination Port & TCP Header for an FTP Segment

    1. How the receiving TCP reacts to the corrupted port

    The IP datagram reached host 130.14.16.19/16 (same /16 network as the intended 130.14.16.17), so IP delivers it normally — IP only checks the network/host address, not the transport port. The problem is at TCP:

    1. TCP first verifies its checksum (which covers the TCP header, the pseudo-header of source+destination IP, and the data). A corrupted destination-port field changes the header, so the checksum fails → TCP silently discards the segment and sends no ACK and no ICMP error (TCP never reports errors for damaged segments, to avoid error-reporting storms).
    2. The sender receives no ACK → its retransmission timer expires → it retransmits the segment; the original (correct) segment then reaches 130.14.16.17.
    3. Even if the bad port passed checksum (hypothetically), TCP at .19 would look up the port in its connection table, find no socket bound to that port, discard the segment and reply with a TCP RST (reset) segment to the sender, tearing down the bogus connection attempt.

    Key point: ports are used only for demultiplexing at the endpoints, never for routing — so corruption cannot mis-route the packet; it only causes local delivery failure + retransmission/RST.

    2. TCP header for a message from an FTP client to an FTP server (data = 40 bytes)

    Well-known port = 21 (FTP control). Ephemeral port chosen = 52345 (in the dynamic range 49152–65535). Header length = 20 bytes (5 words), so total segment = 20 + 40 = 60 bytes.

    Field Value Remark
    Source Port 52345 ephemeral port, client side
    Destination Port 21 FTP well-known port
    Sequence No. 1000 (example) first byte of this segment
    Acknowledgment No. 5000 (example) next byte expected from server
    Data Offset 5 5 × 4 = 20-byte header, no options
    Reserved 000 —
    Flags URG=0, ACK=1, PSH=1, RST=0, SYN=0, FIN=0 pure data segment
    Window 8192 advertised receive window (example)
    Checksum 0x0000 filled with 0s as instructed
    Urgent Pointer 0 URG=0, field unused
    Options none header stays 20 bytes
    Data 40 bytes e.g. an FTP command/response

    Total length = 60 bytes.

  21. Q8a. A TCP connection is using a window size of 10,000 bytes, and the previous acknowledgment number was 22,001. It receives a segment with acknowledgment number 24,001 and window size advertisement of 12,000. Draw a diagram to show the situation of the window before and after.20207m

    Module 4: Transport Layer & Congestion Control

    A TCP connection is using a window size of 10,000 bytes, and the previous acknowledgment number was 22,001. It receives a segment with acknowledgment number 24,001 and window size advertisement of 12,000. Draw a diagram to show the situation of the window before and after.

    View this question on its own page →
    Worked Solution

    TCP Sliding Window — Before and After the ACK

    Given: previous ACK number (left edge of window) = 22,001, window size = 10,000 bytes. A segment arrives with ACK = 24,001 and window advertisement = 12,000.

    Before

    • Left edge (SND.UNA) = 22,001 → bytes < 22,001 are already acknowledged.
    • Right edge = 22,001 + 10,000 − 1 = 32,000 → sender may transmit bytes 22,001 … 32,000.
     byte:  ... 21999 | 22001 22002 ............ 32000 | 32001 32002 ...
                      |<-------- window = 10,000 bytes --------->|  cannot
            ACKed      ^ SND.UNA                         right edge   send
                       (next byte expected by receiver = 32,001)
    

    After (ACK = 24,001, new window = 12,000)

    • Bytes 22,001 – 24,000 (2,000 bytes) are now acknowledged → they leave the window.
    • New left edge = 24,001.
    • New right edge = 24,001 + 12,000 − 1 = 36,000.
    • The window has effectively slid forward by 2,000 bytes and grown by 2,000 bytes, opening 4,000 bytes of new sendable space at the right edge.
     byte:  ... 24000 | 24001 24002 ............ 36000 | 36001 36002 ...
                      |<-------- window = 12,000 bytes --------->|  cannot
            ACKed      ^ SND.UNA (new)                right edge     send
                       (next byte expected = 36,001)
    

    Summary

    Item Before After
    ACK / left edge 22,001 24,001
    Window size 10,000 12,000
    Last byte in window 32,000 36,000
    Bytes newly acknowledged — 22,001 – 24,000 (2,000 B)
    Newly sendable bytes — 32,001 – 36,000 (4,000 B)

    The sender may now transmit bytes 24,001 through 36,000 (12,000 bytes total, including any already sent but unacknowledged), and it must keep SND.NXT ≤ 36,001.

  22. Budget App•POCKETLY

    Pocketly on Android

    Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.

    Install Pocketly
  23. Q8b. Show the entries for the header of a TCP segment that carries a message from an FTP client to an FTP server. Fill the checksum field with Os. Choose an appropriate ephemeral port number and the correct well-known port number. The length of the data is 40 bytes.20207m

    Module 4: Transport Layer & Congestion Control

    Show the entries for the header of a TCP segment that carries a message from an FTP client to an FTP server. Fill the checksum field with Os. Choose an appropriate ephemeral port number and the correct well-known port number. The length of the data is 40 bytes.

    View this question on its own page →
    Worked Solution

    TCP Header for an FTP Client → Server Message

    Ports chosen

    • Well-known port (destination) = 21 — FTP control connection is always terminated at port 21 on the server.
    • Ephemeral port (source) = 52345 — any unused port in the dynamic/private range 49152–65535 chosen by the client (e.g. 15151 or 52345 are both acceptable).

    Lengths

    • TCP header with no options = 5 words × 4 = 20 bytes → Data Offset = 5.
    • Data = 40 bytes → total segment length = 20 + 40 = 60 bytes; total TCP length field in IP = 60.
    • Checksum field is filled with 0000 as instructed (in real transmission it would be computed over the pseudo-header + TCP header + data).

    Header entries

    # Field Value Notes
    1 Source Port 52345 ephemeral port (client)
    2 Destination Port 21 FTP well-known port (server)
    3 Sequence Number 1000 (example) sequence number of first data byte
    4 Acknowledgment Number 5000 (example) next byte expected from server
    5 Data Offset 5 20-byte header, no options
    6 Reserved 0 3 bits (4 bits + 4-bit NS in some texts)
    7 Control Bits URG=0, ACK=1, PSH=1, RST=0, SYN=0, FIN=0 acknowledging earlier data + pushing this data
    8 Window 8192 advertised receive window (example)
    9 Checksum 0x0000 all zeros, as specified
    10 Urgent Pointer 0 URG bit is 0, field not used
    11 Options none Data Offset stays 5 (20 bytes)
    12 Data (payload) 40 bytes e.g. an FTP command or file block
     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 = 52345       |    Dest Port = 21            |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                     Sequence Number = 1000                    |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                  Acknowledgment Number = 5000                 |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |  Data |r|A|P|R|S|F|            Window = 8192                   |
    | Offset| |C|S|S|Y|I|                                    0 0 0 0  |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |       Checksum = 0x0000       |     Urgent Pointer = 0        |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                    Data (40 bytes) ...                        |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    

    Result: Source 52345 → Destination 21, 20-byte header + 40 bytes of data = 60-byte TCP segment, checksum 0000.

  24. Q9a. What kinds of file types can FTP transfer? What are the three FTP transmission modes? Describe the functions of the two FTP connections. How does storing a file differ from retrieving a file?20207m

    Module 5: Application Layer & Security

    What kinds of file types can FTP transfer? What are the three FTP transmission modes? Describe the functions of the two FTP connections. How does storing a file differ from retrieving a file?

    View this question on its own page →
    Worked Solution

    File Transfer Protocol (FTP)

    1. File types FTP can transfer

    FTP defines three file types so that files stored in different formats can be moved between unlike machines:

    File type Purpose / conversion
    ASCII Text files. Converted to/from the Network Standard ASCII (NVT-ASCII, 7-bit, CRLF line ends) at each end — used for editor commands and text.
    EBCDIC Mainframe (EBCDIC-coded) text. Converted to ASCII at the sending side and back to EBCDIC at the receiving side.
    Image (binary) Any file treated as an uninterpreted byte stream — copied exactly with no conversion, for executables, graphics, compressed files etc.

    2. The three transmission modes

    • Stream mode — data flows as a continuous stream of bytes over the TCP connection; records have no length field, the receiver must delimit them itself. Flow control is done by TCP.
    • Block mode — data is cut into blocks, each preceded by a 3-byte header (block length + descriptor byte: B = beginning, I = intermediate, D = end, E = error) so the receiver knows record boundaries.
    • Compressed mode — uses run-length encoding: a sequence of n identical bytes is sent as (count, byte), which suits highly repetitive data such as images.

    3. Functions of the two FTP connections

    Control connection Data connection
    Ports server 21 ↔ client ephemeral server 20 ↔ client ephemeral
    Lifetime Opened at start, stays open for the whole session, closed at the end Opened and closed for every data transfer (e.g. each LIST, RETR, STOR)
    Carries ASCII commands and replies (USER, RETR, STOR, response codes) The actual file data / directory listing
    Mode Always client → server initiation Server initiates it back to the client (active mode)

    FTP is therefore an out-of-band protocol: the control connection carries instructions while the data connection carries the payload.

    4. Storing a file vs retrieving a file

    • Retrieving (RETR) = download: the client asks the server for a file, so data flows server → client on the data connection.
    • Storing (STOR) = upload: the client sends a local file to the server, so data flows client → server on the (newly opened) data connection; the server creates or overwrites the file (STOU stores under a unique name, APPE appends).

    The only difference is the direction of data flow — both use the same two-connection mechanism, and both are initiated by a command on the control connection.

  25. Q9b. **An ISP is granted the block 80.70.56.0/21. The ISP needs to allocate addresses for two organizations each with 500 addresses, two organizations each with 250 addresses, and three organizations each with 50 addresses. (i) Find the number and range of addresses in the ISP block. (ii) Find the range of addresses for each organization and the range of unallocated addresses.**20207m

    Module 3: Network Layer & Routing

    **An ISP is granted the block 80.70.56.0/21. The ISP needs to allocate addresses for two organizations each with 500 addresses, two organizations each with 250 addresses, and three organizations each with 50 addresses.

    (i) Find the number and range of addresses in the ISP block.
    (ii) Find the range of addresses for each organization and the range of unallocated addresses.**

    View this question on its own page →
    Worked Solution

    CIDR Allocation from 80.70.56.0/21

    (i) Number and range of addresses in the ISP block

    • Prefix length = 21 → number of addresses = 232−21=211=2^{32-21} = 2^{11} = 2048.
    • Block starts at 80.70.56.0. Third octet = 56 = 00111000; a /21 keeps the first 5 bits of the third octet fixed, so the third octet runs from 56 (56 & 248) to 63 (56 | 7).
    • Range: 80.70.56.0 – 80.70.63.255 (usable hosts: 2048 − 2 = 2046).

    (ii) Allocation — smallest power-of-two block ≥ the requirement

    Organisation Needs Block size (pow. of 2) CIDR Range Usable
    Org 1 500 512 80.70.56.0/23 80.70.56.0 – 80.70.57.255 510 ✔
    Org 2 500 512 80.70.58.0/23 80.70.58.0 – 80.70.59.255 510 ✔
    Org 3 250 256 80.70.60.0/24 80.70.60.0 – 80.70.60.255 254 ✔
    Org 4 250 256 80.70.61.0/24 80.70.61.0 – 80.70.61.255 254 ✔
    Org 5 50 64 80.70.62.0/26 80.70.62.0 – 80.70.62.63 62 ✔
    Org 6 50 64 80.70.62.64/26 80.70.62.64 – 80.70.62.127 62 ✔
    Org 7 50 64 80.70.62.128/26 80.70.62.128 – 80.70.62.191 62 ✔

    Workings: 500 → next power of 2 = 512 = 292^9 → 9 host bits → /23; 250 → 256 = 282^8 → /24; 50 → 64 = 262^6 → /26. Blocks are assigned top-down, contiguously, without overlap, each aligned on its own size boundary (56/58/60/61/62 are all multiples of 2, 4 and 8 respectively as needed).

    Allocated total = 512 + 512 + 256 + 256 + 64 + 64 + 64 = 1728 addresses.

    Unallocated range: 80.70.62.192 – 80.70.63.255 = 320 addresses
    = 80.70.62.192/26 (64) + 80.70.63.0/24 (256) — available for future customers or the ISP's own infrastructure (router interfaces, gateways).

    Check: 1728 + 320 = 2048 = the block size ✔

AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.