Browse papers
A

Section A: Long Answer Questions

Attempt any TWO questions.

3 questions·10 marks each
1long10 marks

Assume a Class B network. Divide it into four subnets. Write the subnet ID and broadcast address of each subnet and determine the new subnet mask.

Subnetting a Class B Network into 4 Subnets

Given: A Class B network. Take the example network 172.16.0.0 with the default mask 255.255.0.0 (/16).

Step 1: Number of subnet bits

To create 4 subnets we need nn borrowed bits such that 2n42^n \ge 4.

22=4n=2 borrowed bits2^2 = 4 \Rightarrow n = 2 \text{ borrowed bits}

Step 2: New subnet mask

Class B default is /16. Borrowing 2 bits gives /18.

The third octet borrows the top 2 bits: 110000002=19211000000_2 = 192.

New mask=255.255.192.0  (/18)\text{New mask} = 255.255.192.0 \;(/18)

Step 3: Block size

Block size=256192=64 (in the 3rd octet)\text{Block size} = 256 - 192 = 64 \text{ (in the 3rd octet)}

So subnets increment by 64 in the third octet.

Step 4: Subnet ID and Broadcast addresses

SubnetSubnet ID (Network)Valid Host RangeBroadcast Address
1172.16.0.0172.16.0.1 – 172.16.63.254172.16.63.255
2172.16.64.0172.16.64.1 – 172.16.127.254172.16.127.255
3172.16.128.0172.16.128.1 – 172.16.191.254172.16.191.255
4172.16.192.0172.16.192.1 – 172.16.255.254172.16.255.255

Step 5: Hosts per subnet

Host bits = 3218=1432 - 18 = 14.

Usable hosts=2142=16382 per subnet\text{Usable hosts} = 2^{14} - 2 = 16382 \text{ per subnet}

Result: New subnet mask = 255.255.192.0 (/18), with the four subnets, subnet IDs and broadcast addresses listed above.

subnettingip-addressing
2long10 marks

What is TCP? Explain the TCP segment structure and the three-way handshake mechanism for connection establishment and termination.

TCP (Transmission Control Protocol)

TCP is a connection-oriented, reliable, byte-stream transport-layer protocol of the TCP/IP suite. It provides reliable, in-order, error-checked delivery of data between processes using sequence numbers, acknowledgements, retransmission, flow control (sliding window) and congestion control. It is identified by IP protocol number 6.

TCP Segment Structure

The TCP header is a minimum of 20 bytes (without options). Key fields:

FieldSizePurpose
Source Port16 bitsSending application port
Destination Port16 bitsReceiving application port
Sequence Number32 bitsByte-number of first data byte in segment
Acknowledgement Number32 bitsNext byte expected from the other side
Header Length (Data Offset)4 bitsHeader size in 32-bit words
Reserved6 bitsUnused
Control Flags6 bitsURG, ACK, PSH, RST, SYN, FIN
Window Size16 bitsReceiver buffer space (flow control)
Checksum16 bitsError detection over header + data + pseudo-header
Urgent Pointer16 bitsOffset of urgent data (when URG set)
OptionsvariableMSS, window scale, SACK, timestamp
DatavariableApplication payload

Three-Way Handshake (Connection Establishment)

Client                          Server
  |------- SYN (seq=x) -------->|
  |<-- SYN+ACK (seq=y,ack=x+1)--|
  |------- ACK (ack=y+1) ------>|
   Connection ESTABLISHED
  1. SYN: Client sends a segment with SYN=1 and an initial sequence number xx.
  2. SYN+ACK: Server replies with SYN=1, ACK=1, its own sequence yy, and acknowledgement x+1x+1.
  3. ACK: Client sends ACK=1 with acknowledgement y+1y+1. The connection is now open and data transfer begins.

Connection Termination (Four-Way Handshake)

TCP uses a graceful, four-way close:

Client                          Server
  |------- FIN (seq=u) -------->|
  |<------ ACK (ack=u+1) -------|
  |<------ FIN (seq=v) ---------|
  |------- ACK (ack=v+1) ------>|
   Connection CLOSED
  1. Client sends FIN to close its side.
  2. Server replies with ACK.
  3. Server sends its own FIN when ready.
  4. Client replies with ACK (then waits in TIME_WAIT before fully closing).

This ensures both directions of the full-duplex connection are closed independently and reliably.

tcptransport-layer
3long10 marks

Explain the various error detection and correction techniques used in the data link layer, including CRC and Hamming code with examples.

Error Detection and Correction in the Data Link Layer

Transmission over physical media introduces errors (single-bit or burst errors). The data link layer uses redundant bits to detect and sometimes correct them.

A. Error Detection Techniques

  1. Parity Check – One redundant bit makes the number of 1s even (even parity) or odd. Detects single-bit errors only; fails on even-numbered bit errors.
  2. Two-Dimensional (LRC) Parity – Parity computed per row and column; detects most burst errors.
  3. Checksum – Data divided into kk-bit words, summed using 1's-complement arithmetic; the complemented sum is sent. Receiver re-adds; result of all 1s means no error.
  4. Cyclic Redundancy Check (CRC) – Strong polynomial-based detection (below).

B. CRC (Cyclic Redundancy Check) – Example

CRC treats the bit string as a polynomial and divides by a generator using modulo-2 (XOR) division.

Data = 1010, Generator G=1011G = 1011 (degree 3, so append 3 zeros).

Dividend = 1010000. Perform modulo-2 division by 1011:

1010000 ÷ 1011
1010 XOR 1011 = 0001
 bring down -> 00010 ...
Result: quotient ignored, Remainder (CRC) = 011

Transmitted frame = data + remainder = 1010 + 011 = 1010011.

At the receiver, the frame is divided by GG again; a zero remainder means no error, otherwise an error is detected. CRC detects all single-bit, double-bit, odd-numbered, and most burst errors.

C. Hamming Code (Error Correction) – Example

Hamming code adds parity bits at positions 20,21,22,2^0, 2^1, 2^2, \dots to detect and correct single-bit errors. For mm data bits we need rr parity bits where:

2rm+r+12^r \ge m + r + 1

Example: 4 data bits 1011 (positions for d). 2r4+r+1r=32^r \ge 4 + r + 1 \Rightarrow r = 3. Total 7 bits.

Layout (positions 1–7), parity at 1,2,4; data at 3,5,6,7 = 1,0,1,1:

Pos1 (P1)2 (P2)34 (P4)567
Bit??1?011
  • P1P1 covers bits 1,3,5,7 → 1,0,1 → for even parity P1=0P1 = 0
  • P2P2 covers bits 2,3,6,7 → 1,1,1 → P2=1P2 = 1
  • P4P4 covers bits 4,5,6,7 → 0,1,1 → P4=0P4 = 0

Codeword = 0110011 (positions 1–7).

Correction: At the receiver, recompute the three parity checks; the binary value of the failing parity positions gives the position of the erroneous bit, which is then flipped to correct it.

Summary

  • Detection: Parity, 2-D parity, Checksum, CRC.
  • Correction: Hamming code (and FEC codes) correct single-bit errors using the error-position syndrome.
error-detectiondata-link-layer
B

Section B: Short Answer Questions

Attempt any EIGHT questions.

9 questions·5 marks each
4short5 marks

Explain the difference between connection-oriented and connectionless services.

Connection-Oriented vs Connectionless Services

FeatureConnection-OrientedConnectionless
SetupConnection established before data transfer (handshake)No prior setup; send immediately
ReliabilityReliable – acknowledgements and retransmissionUnreliable – best-effort, no guarantee
OrderingData delivered in orderPackets may arrive out of order
PathOften a logical path/circuit maintainedEach packet routed independently
OverheadHigher (state, ACKs, sequencing)Lower, faster
Example protocolTCP (transport), virtual circuitsUDP (transport), IP, datagram
Use caseFile transfer, web, emailDNS, streaming, VoIP, gaming

Summary: Connection-oriented service is like a telephone call — a dedicated logical connection is set up, used, then released, with guaranteed reliable in-order delivery. Connectionless service is like the postal system — each datagram is independent, requires no setup, and is delivered on a best-effort basis with lower overhead.

transport-layer
5short5 marks

What is UDP? Explain the UDP header format.

UDP (User Datagram Protocol)

UDP is a connectionless, unreliable transport-layer protocol (IP protocol number 17). It provides no handshake, no acknowledgement, no retransmission, no flow/congestion control and no guaranteed ordering. It simply adds port-based multiplexing and an optional checksum on top of IP, making it fast and low-overhead. It suits real-time and query/response applications such as DNS, DHCP, TFTP, SNMP, VoIP, online gaming and video streaming.

UDP Header Format

The UDP header is a fixed 8 bytes (64 bits) with four 16-bit fields:

 0                   16                  31
 +--------------------+--------------------+
 |    Source Port     |  Destination Port  |
 +--------------------+--------------------+
 |      Length        |     Checksum       |
 +--------------------+--------------------+
 |             Data (payload)              |
 +-----------------------------------------+
FieldSizeDescription
Source Port16 bitsPort of the sending process (optional, may be 0)
Destination Port16 bitsPort of the receiving process
Length16 bitsTotal length of header + data in bytes (min 8)
Checksum16 bitsError check over pseudo-header + UDP header + data (optional in IPv4)

Key point: Because the header is only 8 bytes versus TCP's 20 bytes, UDP has much lower overhead but offers no reliability guarantees.

udptransport-layer
6short5 marks

Explain CIDR (Classless Inter-Domain Routing) with an example.

CIDR (Classless Inter-Domain Routing)

CIDR is an IP addressing and routing scheme (RFC 1519) that replaces the rigid Class A/B/C boundaries with a variable-length prefix. An address is written as IP/prefix-length (slash notation), where the prefix length states how many leading bits form the network portion. CIDR enables efficient use of the IPv4 address space and route aggregation (supernetting), which shrinks routing tables.

Notation

Address=a.b.c.d/n\text{Address} = a.b.c.d/n

where nn = number of network bits, so host bits =32n= 32 - n and usable hosts =232n2= 2^{32-n} - 2.

Example

Consider 192.168.1.0/26:

  • Prefix length n=26n = 26 \Rightarrow subnet mask = 255.255.255.192
  • Host bits =3226=6= 32 - 26 = 6
  • Usable hosts =262=62= 2^6 - 2 = 62
  • Network address: 192.168.1.0, Broadcast: 192.168.1.63
  • Host range: 192.168.1.1 – 192.168.1.62

Supernetting Example

Four networks 200.1.0.0/24, 200.1.1.0/24, 200.1.2.0/24, 200.1.3.0/24 can be aggregated into a single CIDR route 200.1.0.0/22, advertised as one entry instead of four.

Advantages: flexible subnet sizing, reduced address wastage, smaller routing tables through aggregation.

cidrip-addressing
7short5 marks

Differentiate between a hub, a switch, and a router.

Hub vs Switch vs Router

FeatureHubSwitchRouter
OSI LayerPhysical (Layer 1)Data Link (Layer 2)Network (Layer 3)
Forwarding basisNone – repeats bits to all portsMAC address (MAC table)IP address (routing table)
AddressingNo addressingPhysical/MAC addressLogical/IP address
Collision domainSingle (all ports share)One per portOne per port
Broadcast domainSingleSingle (unless VLANs)Separate per interface
IntelligenceDumb broadcastLearns MAC addresses, filtersRoutes between networks, runs routing protocols
ConnectsDevices in same LAN segmentDevices in same LANDifferent networks/LANs to WAN/Internet
Data unitBitsFramesPackets

Summary:

  • A hub is a dumb Layer-1 repeater that floods incoming bits to every port (one collision domain).
  • A switch is an intelligent Layer-2 device that learns MAC addresses and forwards frames only to the destination port (separate collision domain per port).
  • A router is a Layer-3 device that forwards packets between different IP networks using routing tables and separates broadcast domains, connecting LANs to the Internet.
network-devices
8short5 marks

What is ARP? Explain how ARP resolves a logical address to a physical address.

ARP (Address Resolution Protocol)

ARP is a protocol that maps a known logical (IP) address to its corresponding physical (MAC) address on a local network. It operates between the network and data-link layers, because frames on a LAN are delivered using MAC addresses, while hosts are addressed logically by IP.

How ARP Resolves IP to MAC

  1. Check ARP cache: When host A wants to send a packet to IP address BB on the same LAN, it first checks its ARP cache (table of IP→MAC mappings). If found, it uses it directly.
  2. ARP Request (broadcast): If not cached, A broadcasts an ARP Request frame to the MAC broadcast address FF:FF:FF:FF:FF:FF, asking "Who has IP BB? Tell A." This reaches every host on the LAN.
  3. ARP Reply (unicast): Only the host owning IP BB responds with an ARP Reply (unicast back to A) containing its MAC address.
  4. Update cache: Host A stores the IP→MAC mapping in its ARP cache (with a timeout) and uses the MAC address to build and send the frame.
A --- broadcast ---> "Who has 192.168.1.5?"  (ARP Request)
B --- unicast -----> "192.168.1.5 is at 00:1A:2B:3C:4D:5E" (ARP Reply)

Related: RARP / DHCP do the reverse (MAC→IP). The cache avoids repeating ARP for every packet. If the destination is on a different network, ARP resolves the default gateway's IP instead.

arpnetwork-layer
9short5 marks

Explain the working of the HTTP protocol.

HTTP (HyperText Transfer Protocol)

HTTP is the application-layer, request-response protocol used by the World Wide Web to transfer hypertext (web pages, images, etc.) between a client (browser) and a web server. It runs over TCP, typically on port 80 (HTTPS uses TLS on port 443), and is stateless — each request is independent (state is maintained via cookies/sessions).

Working of HTTP

  1. Connection: The client opens a TCP connection to the server (three-way handshake) on port 80.
  2. Request: The browser sends an HTTP request consisting of:
    • a request line — method + URL + version, e.g. GET /index.html HTTP/1.1
    • headers (Host, User-Agent, Accept, etc.)
    • an optional body (for POST/PUT).
  3. Server processing: The server locates/generates the requested resource.
  4. Response: The server returns an HTTP response with:
    • a status line — version + status code, e.g. HTTP/1.1 200 OK
    • headers (Content-Type, Content-Length, Date)
    • the body (the requested HTML/data).
  5. Render/Close: The browser renders the content. In HTTP/1.0 the connection closes per request; HTTP/1.1 uses persistent (keep-alive) connections for multiple requests.

Common Methods & Status Codes

  • Methods: GET, POST, PUT, DELETE, HEAD.
  • Status codes: 200 OK, 301 Moved, 404 Not Found, 500 Internal Server Error.
Client: GET /index.html HTTP/1.1
        Host: www.example.com
Server: HTTP/1.1 200 OK
        Content-Type: text/html
        <html>...</html>
httpapplication-layer
10short5 marks

What is NAT? Explain its types and uses.

NAT (Network Address Translation)

NAT is a technique implemented on a router/firewall that translates private IP addresses (used inside a LAN) into one or more public IP addresses (used on the Internet), and vice versa. It conserves the limited IPv4 public address space and hides the internal network structure, adding a layer of security.

Types of NAT

  1. Static NAT (one-to-one): A fixed, permanent mapping of one private IP to one public IP. Used when an internal server must be reachable from outside.
  2. Dynamic NAT: Maps private IPs to public IPs from a pool on a first-come, first-served basis. Mappings are temporary; the number of simultaneous users is limited by the pool size.
  3. PAT / NAT Overload (many-to-one): Many private IPs share one public IP, distinguished by different port numbers. This is the most common form (e.g., home routers).

Uses / Advantages

  • Conserves public IPv4 addresses — many hosts share a few public IPs.
  • Security/privacy — internal addresses are hidden from the outside.
  • Flexibility — internal addressing can change without affecting public addresses.
  • Enables multiple devices on a home/office LAN to access the Internet through a single public IP.

Disadvantage: Breaks end-to-end connectivity and complicates some protocols (e.g., requires ALGs for FTP/SIP).

nat
11short5 marks

Explain the FTP protocol and its working.

FTP (File Transfer Protocol)

FTP is an application-layer, client-server protocol used to transfer files between a client and a server over a TCP/IP network. It runs over TCP and is reliable. A distinctive feature is that FTP uses two separate connections:

  • Control connection (port 21): carries commands and replies; stays open for the whole session.
  • Data connection (port 20 in active mode): carries the actual file data; opened/closed for each transfer.

Working of FTP

  1. Connection & login: The client opens a control connection to the server on port 21 and authenticates with a username and password (anonymous FTP allows guest login).
  2. Commands: Over the control channel the client sends commands such as USER, PASS, LIST, RETR (download), STOR (upload), CWD, QUIT.
  3. Data transfer modes:
    • Active mode: server initiates the data connection from port 20 to a client-specified port.
    • Passive mode: server opens a port and the client initiates the data connection (firewall-friendly).
  4. File transfer: Data is sent over the separate data connection in ASCII or binary mode; the control connection remains open to issue further commands.
  5. Termination: The client sends QUIT and the connections close.
Client --(control, port 21)--> Server : USER, PASS, RETR file.txt
Client <==(data, port 20)===== Server : file contents

Note: FTP transmits credentials in plaintext, so secure variants FTPS (FTP over TLS) and SFTP (over SSH) are preferred for security.

ftpapplication-layer
12short5 marks

What is the purpose of ICMP? List some common ICMP message types.

ICMP (Internet Control Message Protocol)

ICMP is a network-layer protocol of the TCP/IP suite (IP protocol number 1) used to send error-reporting and control/diagnostic messages about the operation of IP. Because IP is unreliable and connectionless, ICMP feeds back information when packets cannot be delivered or when network conditions need to be reported. ICMP messages are encapsulated inside IP datagrams.

Purpose

  • Report errors (e.g., destination unreachable, time exceeded).
  • Provide diagnostics and reachability testing — used by tools like ping (Echo) and traceroute (Time Exceeded).
  • Flow/redirect control between routers and hosts.

Common ICMP Message Types

TypeMessageMeaning
0Echo ReplyReply to a ping
3Destination UnreachableHost/network/port not reachable
5RedirectUse a better route/gateway
8Echo RequestPing request
11Time ExceededTTL expired (used by traceroute)
12Parameter ProblemBad IP header field
13/14Timestamp Request/ReplyTime synchronization

In short: ICMP is the troubleshooting and error-signalling companion of IP; without it, hosts would have no standard way to learn why a packet failed to reach its destination.

icmp

Frequently asked questions

Where can I find the BSc CSIT (TU) Computer Networks (BSc CSIT, CSC258) question paper 2081?
The full BSc CSIT (TU) Computer Networks (BSc CSIT, CSC258) 2081 (regular) question paper is available free on Kekkei. You can read every question online and attempt the paper under timed exam conditions.
Does the Computer Networks (BSc CSIT, CSC258) 2081 paper come with solutions?
Yes. Every question on this Computer Networks (BSc CSIT, CSC258) past paper includes a step-by-step solution, plus instant AI feedback when you attempt it on Kekkei.
How many marks is the BSc CSIT (TU) Computer Networks (BSc CSIT, CSC258) 2081 paper?
The BSc CSIT (TU) Computer Networks (BSc CSIT, CSC258) 2081 paper carries 60 full marks and is meant to be completed in 180 minutes, across 12 questions.
Is practising this Computer Networks (BSc CSIT, CSC258) past paper free?
Yes — reading and attempting this Computer Networks (BSc CSIT, CSC258) past paper on Kekkei is completely free.