Browse papers
A

Section A: Long Answer Questions

Attempt all / any as specified.

4 questions
1long14 marks

(a) Describe the seven layers of the OSI reference model, clearly stating the principal function and at least one protocol or PDU associated with each layer. (8)

(b) Compare the OSI model with the TCP/IP model. With the help of a diagram, show how the layers of the two models map onto one another and justify why the TCP/IP model became the de facto standard for the Internet. (6)

(a) The Seven Layers of the OSI Reference Model (8)

The OSI (Open Systems Interconnection) model is a 7-layer reference architecture standardized by ISO. Data flows down from layer 7 to layer 1 at the sender and up at the receiver.

#LayerPrincipal FunctionProtocol / PDU
7ApplicationProvides network services directly to end-user applications (file transfer, mail, web).HTTP, FTP, SMTP, DNS / Data
6PresentationTranslation, encryption/decryption, and compression of data; ensures a common data format (syntax).TLS/SSL, JPEG, ASCII / Data
5SessionEstablishes, manages, synchronizes and terminates dialogues (sessions) between hosts.NetBIOS, RPC, PPTP / Data
4TransportEnd-to-end delivery, segmentation/reassembly, flow control, error control, port-based multiplexing.TCP, UDP / Segment (TCP), Datagram (UDP)
3NetworkLogical addressing and routing of packets across multiple networks (path determination).IP, ICMP, OSPF / Packet
2Data LinkNode-to-node delivery on the same link, framing, MAC addressing, error detection (CRC), media access control.Ethernet, PPP, HDLC / Frame
1PhysicalTransmission of raw bits over the physical medium; defines voltages, connectors, encoding and data rates.Ethernet (10BASE-T), RS-232, USB / Bit

(b) OSI vs TCP/IP Model (6)

Layer mapping diagram:

        OSI (7 layers)              TCP/IP (4 layers)
  +----------------------+      +----------------------+
  | 7 Application        |      |                      |
  | 6 Presentation       | ---> |  Application         |
  | 5 Session            |      |                      |
  +----------------------+      +----------------------+
  | 4 Transport          | ---> |  Transport (TCP/UDP) |
  +----------------------+      +----------------------+
  | 3 Network            | ---> |  Internet (IP)       |
  +----------------------+      +----------------------+
  | 2 Data Link          | ---> |  Network Access      |
  | 1 Physical           |      |  (Link)              |
  +----------------------+      +----------------------+

Comparison:

AspectOSITCP/IP
Layers74 (Application, Transport, Internet, Network Access)
OriginTheoretical/reference model (ISO)Built around real protocols (DARPA)
Application splitThree separate layers (5,6,7)One Application layer
ApproachProtocol-independent referenceProtocol-specific, implementation-driven
Transport reliabilityConnection-oriented only at this layer historicallySupports both connection-oriented (TCP) and connectionless (UDP)

Why TCP/IP became the de facto Internet standard:

  • It was implemented and deployed first in working systems (ARPANET, BSD UNIX) while OSI remained largely a paper specification.
  • It is simpler, leaner and flexible, with protocols proven in real networks.
  • It was freely available and vendor-neutral, bundled with UNIX, encouraging rapid adoption.
  • The Internet grew on TCP/IP, creating an installed base too large to displace.
osi-modeltcp-ip-model
2long14 marks

An organization has been allocated the block 192.168.40.0/24.

(a) The organization needs to create four departmental subnets requiring 60, 28, 12 and 5 usable hosts respectively. Using Variable Length Subnet Masking (VLSM), allocate appropriate subnets and for each subnet specify the network address, subnet mask, valid host range and broadcast address. (10)

(b) Explain the difference between classful and classless (CIDR) addressing, and state why CIDR was introduced. (4)

(a) VLSM Subnetting of 192.168.40.0/24 (10)

Allocate subnets largest-first (descending host requirement). Required usable hosts: 60, 28, 12, 5.

Determine prefix per requirement (usable hosts =2h2= 2^h - 2):

  • 60 hosts -> need 262=62602^6-2 = 62 \ge 60 -> 6 host bits -> /26 (mask 255.255.255.192)
  • 28 hosts -> need 252=30282^5-2 = 30 \ge 28 -> 5 host bits -> /27 (mask 255.255.255.224)
  • 12 hosts -> need 242=14122^4-2 = 14 \ge 12 -> 4 host bits -> /28 (mask 255.255.255.240)
  • 5 hosts -> need 232=652^3-2 = 6 \ge 5 -> 3 host bits -> /29 (mask 255.255.255.248)

Allocation table:

SubnetHostsNetwork AddressMaskValid Host RangeBroadcast
A60192.168.40.0/26255.255.255.192192.168.40.1 – 192.168.40.62192.168.40.63
B28192.168.40.64/27255.255.255.224192.168.40.65 – 192.168.40.94192.168.40.95
C12192.168.40.96/28255.255.255.240192.168.40.97 – 192.168.40.110192.168.40.111
D5192.168.40.112/29255.255.255.248192.168.40.113 – 192.168.40.118192.168.40.119

Remaining address space 192.168.40.120 – 192.168.40.255 stays free for future growth. Each block fits exactly without overlap.

(b) Classful vs Classless (CIDR) Addressing (4)

Classful addressing divides the IPv4 space into fixed classes by leading bits:

  • Class A: /8 (16M hosts), Class B: /16 (65K hosts), Class C: /24 (254 hosts). The boundary between network and host portions is fixed by class, so an organization needing, say, 2000 hosts had to take a whole Class B, wasting tens of thousands of addresses.

Classless (CIDR) addressing uses a variable-length prefix written as a.b.c.d/n, where n is the number of network bits. The network/host boundary can fall anywhere, allowing address blocks of any power-of-two size.

Why CIDR was introduced:

  • To stop rapid exhaustion of IPv4 addresses caused by rigid class boundaries.
  • To allow efficient, right-sized allocation (no wasted addresses).
  • To enable route aggregation (supernetting), reducing the size of Internet routing tables.
ip-addressingsubnetting
3long12 marks

(a) Differentiate between distance-vector and link-state routing protocols, giving one example of each. (6)

(b) Consider the network below where the number on each link is its cost:

        2        3
   A -------- B -------- C
   |          |          |
  1|         4|         2|
   |          |          |
   D -------- E -------- F
        1          5

Apply Dijkstra's shortest-path algorithm from source node A and determine the shortest path and total cost from A to every other node. Show the working at each step. (6)

(a) Distance-Vector vs Link-State Routing (6)

AspectDistance-VectorLink-State
Information sharedEntire routing table (distance to all destinations)Link-state advertisements about directly connected links only
Shared withDirectly connected neighbours onlyFlooded to all routers in the area
View of networkKnows only direction & distance ("routing by rumour")Each router builds a complete topology map
AlgorithmBellman–FordDijkstra's shortest-path
ConvergenceSlower; prone to routing loops, count-to-infinityFaster, loop-free
Resource useLow CPU/memoryHigher CPU/memory
ExampleRIP (also IGRP)OSPF (also IS-IS)

(b) Dijkstra's Algorithm from Source A (6)

Link costs: A-B=2, B-C=3, A-D=1, B-E=4, C-F=2, D-E=1, E-F=5.

Initialize distances: A=0, all others = ∞. At each step pick the unvisited node with smallest tentative distance, mark it permanent, and relax its neighbours.

StepPermanent (chosen)ABCDEF
Init0
1A (0)021
2D (1)0212 (1+1)
3B (2)025 (2+3)12
4E (2)025127 (2+5)
5C (5)025127 (min(7, 5+2)=7)
6F (7)025127

Note: when C becomes permanent (cost 5), F via C = 5+2 = 7, equal to existing 7 via E, so cost stays 7.

Shortest paths and total costs from A:

DestinationPathCost
BA → B2
CA → B → C5
DA → D1
EA → D → E2
FA → D → E → F (or A→B→C→F)7
routing-protocols
4long12 marks

(a) Using a timing diagram, explain TCP's three-way handshake for connection establishment and the connection-termination procedure. (6)

(b) Explain how TCP achieves reliable data transfer and congestion control. In your answer, describe slow start, congestion avoidance and the role of the congestion window (cwnd). (6)

(a) TCP Three-Way Handshake and Connection Termination (6)

Connection establishment (three-way handshake):

  Client                                Server
    |  ---- SYN, seq=x ------------------>  |   (1)
    |  <--- SYN+ACK, seq=y, ack=x+1 -----   |   (2)
    |  ---- ACK, ack=y+1 --------------->   |   (3)
    |        Connection ESTABLISHED         |
  1. Client sends SYN with initial sequence number x.
  2. Server replies SYN+ACK: its own ISN y plus acknowledgement x+1.
  3. Client sends ACK = y+1. Both sides now have synchronized sequence numbers; data transfer begins.

Connection termination (four-way handshake):

  Client                                Server
    |  ---- FIN, seq=u --------------->    |   (1)
    |  <--- ACK, ack=u+1 -------------     |   (2)
    |  <--- FIN, seq=v ---------------     |   (3)
    |  ---- ACK, ack=v+1 ------------->    |   (4)
    |   (TIME_WAIT, then CLOSED)            |

Each side closes its half of the connection independently with a FIN, acknowledged by the other side. The active closer enters TIME_WAIT before fully closing.

(b) Reliable Data Transfer and Congestion Control (6)

Reliable data transfer is achieved through:

  • Sequence numbers on every byte and cumulative ACKs so lost/out-of-order data is detected.
  • Retransmission on timeout (RTO) or on 3 duplicate ACKs (fast retransmit).
  • Checksums to detect corruption; flow control via the receiver's advertised window (rwnd) to avoid overrunning the receiver.

Congestion control limits the sending rate using a congestion window (cwnd); the sender may transmit up to min(cwnd, rwnd) unacknowledged bytes.

  • Slow Start: cwnd starts at ~1 MSS and doubles every RTT (exponential growth) until it reaches the slow-start threshold ssthresh or a loss occurs.
  • Congestion Avoidance: once cwnd ≥ ssthresh, cwnd grows linearly (about +1 MSS per RTT) to probe bandwidth cautiously (additive increase).
  • On loss: if a timeout occurs, ssthresh = cwnd/2 and cwnd resets to 1 MSS (back to slow start). On 3 duplicate ACKs, TCP performs fast retransmit + fast recovery (cwnd halved, not reset). This gives the characteristic AIMD (Additive Increase, Multiplicative Decrease) sawtooth behaviour.
transport-layertcp
B

Section B: Short Answer Questions

Attempt all / any as specified.

7 questions
5short7 marks

Compare TCP and UDP in terms of connection orientation, reliability, ordering, header overhead and typical applications. Give two real-world applications best suited to each protocol and justify your choice.

TCP vs UDP

FeatureTCPUDP
ConnectionConnection-oriented (handshake before data)Connectionless (no setup)
ReliabilityReliable: ACKs, retransmission, error recoveryUnreliable: best-effort, no retransmission
OrderingGuarantees in-order delivery (sequence numbers)No ordering; packets may arrive out of order
Header overhead20 bytes (min), more options8 bytes (lightweight)
Flow/congestion controlYes (rwnd, cwnd)None
SpeedSlower (overhead)Faster, low latency

Applications best suited to TCP (need reliability/ordering):

  1. Web browsing (HTTP/HTTPS) – every byte of a page must arrive intact and in order.
  2. Email (SMTP) / File transfer (FTP) – data corruption or loss is unacceptable.

Applications best suited to UDP (need speed, tolerate loss):

  1. Live video/voice (VoIP, video conferencing) – low latency matters more than the odd lost packet; retransmitting late audio is useless.
  2. DNS lookups / online gaming – short, single-request transactions where TCP setup overhead would add unnecessary delay.
transport-layerudptcp
6short7 marks

(a) Explain the working of the Domain Name System (DNS), describing the roles of root, top-level-domain and authoritative name servers, and the difference between iterative and recursive queries. (5)

(b) Differentiate between HTTP and HTTPS. (2)

(a) Working of the Domain Name System (DNS) (5)

DNS is a hierarchical, distributed database that translates human-readable domain names (e.g. www.example.com) into IP addresses. It uses UDP/TCP port 53.

Server roles (hierarchy):

  • Root name servers: top of the hierarchy; they do not know the final answer but direct queries to the correct TLD server based on the suffix (.com, .org, .np).
  • Top-Level-Domain (TLD) servers: manage a TLD (e.g. .com) and point to the authoritative server for the specific domain.
  • Authoritative name servers: hold the actual DNS records (A, AAAA, MX, CNAME) for a domain and give the final, definitive answer.

A local/recursive resolver also caches results to speed up future lookups.

Recursive vs Iterative queries:

  • Recursive query: the client asks the resolver for the final answer; the resolver does all the work and returns either the IP or an error. (Client ↔ resolver.)
  • Iterative query: the queried server returns the best referral it has (e.g. "ask this TLD server") rather than the final answer; the resolver then follows the referrals itself. (Resolver ↔ root/TLD/authoritative.)

Typically the host makes a recursive request to its resolver, and the resolver makes iterative requests to root, TLD, then authoritative servers.

(b) HTTP vs HTTPS (2)

HTTPHTTPS
Hypertext Transfer Protocol; data sent in plaintextHTTP over TLS/SSL; data is encrypted
Default port 80Default port 443
No authentication of server identityServer authenticated via digital certificate; protects confidentiality & integrity
application-protocolsdns
7short7 marks

Differentiate between a hub, a switch and a router with respect to the OSI layer at which they operate, their handling of collision and broadcast domains, and their addressing mechanism. Use a table where appropriate.

Hub vs Switch vs Router

FeatureHubSwitchRouter
OSI layerLayer 1 (Physical)Layer 2 (Data Link)Layer 3 (Network)
Forwarding decisionNone – broadcasts to all portsUses MAC address tableUses IP routing table
AddressingNone (just repeats bits)MAC (physical) addressesIP (logical) addresses
Collision domainsOne shared collision domain (all ports)One per port (each port is its own)One per port
Broadcast domainsOne (single broadcast domain)One (forwards broadcasts to all ports)One per interface – routers separate broadcast domains
Intelligence / functionDumb repeater; half-duplexFilters/forwards frames within a LANConnects different networks, performs path selection

Key points:

  • A hub simply repeats incoming bits to every other port, so all devices share one collision domain and bandwidth, causing many collisions.
  • A switch learns MAC addresses and forwards frames only to the destination port, breaking the LAN into separate collision domains (microsegmentation) but still passing broadcasts.
  • A router works with IP addresses, forwards packets between different networks/subnets, and stops broadcasts, so it separates both collision and broadcast domains.
network-devices
8short7 marks

(a) Explain the CSMA/CA mechanism used in IEEE 802.11 wireless LANs and state why CSMA/CD is unsuitable for wireless networks. (4)

(b) What is the hidden terminal problem, and how do RTS/CTS frames help mitigate it? (3)

(a) CSMA/CA in IEEE 802.11 and Why CSMA/CD Is Unsuitable for Wireless (4)

CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance): since wireless stations cannot reliably detect collisions while transmitting, 802.11 tries to avoid collisions instead of detecting them:

  1. Carrier sense: a station listens to the medium; if busy it defers.
  2. DIFS + random backoff: if the channel is idle for a DIFS interval, the station picks a random backoff counter from the contention window and counts down only while the medium is idle; it transmits when the counter reaches zero. This randomization avoids two waiting stations transmitting simultaneously.
  3. Positive acknowledgement: because the sender cannot hear collisions, the receiver returns an ACK after a SIFS interval. No ACK ⇒ assume collision/loss ⇒ retransmit with a doubled contention window.

Why CSMA/CD is unsuitable for wireless:

  • A wireless transceiver generally cannot transmit and listen at the same time, so it cannot detect a collision on its own signal as wired Ethernet does.
  • Signal strength falls off rapidly with distance and the hidden terminal problem means a sender may not even hear a colliding station. Hence collision detection is impractical; collision avoidance is used.

(b) Hidden Terminal Problem and RTS/CTS (3)

Hidden terminal problem: two stations A and C are both in range of access point/station B but out of range of each other. A and C cannot sense one another's transmissions, so they may transmit to B simultaneously, causing a collision at B that neither sender detects.

RTS/CTS mitigation:

  • Before sending data, a station sends a short RTS (Request To Send) to the receiver.
  • The receiver replies with a CTS (Clear To Send), which is heard by all stations in the receiver's range (including the hidden ones).
  • The RTS/CTS carry a duration field that sets the NAV (Network Allocation Vector), so hidden stations defer for the announced time, reserving the channel and preventing the collision.
wireless-networks
9short6 marks

Explain the operation of the DHCP protocol. Describe the four messages exchanged in the DHCP DORA process and the purpose of each.

Operation of DHCP and the DORA Process

DHCP (Dynamic Host Configuration Protocol) automatically assigns IP configuration (IP address, subnet mask, default gateway, DNS servers, lease time) to hosts, removing the need for manual configuration. It uses UDP ports 67 (server) and 68 (client) and works through a four-message exchange known as DORA:

  Client                               Server
    | -- DHCP DISCOVER (broadcast) -->  |   (D)
    | <-- DHCP OFFER -----------------  |   (O)
    | -- DHCP REQUEST (broadcast) --->  |   (R)
    | <-- DHCP ACK -------------------  |   (A)
  1. DISCOVER: the client, having no IP, broadcasts a DHCPDISCOVER (source 0.0.0.0, destination 255.255.255.255) to locate any available DHCP server.
  2. OFFER: each server replies with a DHCPOFFER proposing an available IP address along with mask, gateway, DNS and lease duration.
  3. REQUEST: the client broadcasts a DHCPREQUEST formally accepting one offer (identifying the chosen server), so other servers know their offers were declined.
  4. ACK: the chosen server sends a DHCPACK confirming the lease and finalizing the configuration. The client may run an ARP check, then begins using the address. (If the address is no longer available, the server sends a DHCPNAK and the process restarts.)
application-protocols
10short6 marks

(a) What is the role of the Simple Network Management Protocol (SNMP)? Describe the components of an SNMP-managed network (manager, agent, MIB). (4)

(b) List any two faults that network management aims to detect and one corrective action for each. (2)

(a) Role and Components of SNMP (4)

SNMP (Simple Network Management Protocol) is an application-layer protocol (UDP ports 161/162) used to monitor and manage network devices — routers, switches, servers, printers — from a central station. It allows reading device status, changing configuration, and receiving alerts.

Components of an SNMP-managed network:

  • Manager (NMS – Network Management Station): the central software that polls agents (GET/GET-NEXT/GET-BULK), sets values (SET), and receives unsolicited traps. It presents data to administrators.
  • Agent: software running on each managed device that collects local information and responds to the manager's requests; it sends traps/notifications when significant events occur.
  • MIB (Management Information Base): a hierarchical, standardized database of managed objects (each identified by an OID – Object Identifier) describing the parameters that can be read or written on a device.

(b) Two Faults Detected by Network Management + Corrective Actions (2)

  1. Link/interface failure (device down): detected via missing responses or down-traps → corrective action: reroute traffic via a backup path and restart/replace the failed interface or device.
  2. Network congestion / high utilization: detected via high interface utilization or packet-loss counters → corrective action: apply traffic shaping/QoS or upgrade link bandwidth to relieve the bottleneck.
network-management
11short6 marks

Write short notes on any TWO of the following:

(a) Network Address Translation (NAT)

(b) IPv4 versus IPv6 header and address space

(c) ARP and its working

(Answering any two of the three as required.)

(a) Network Address Translation (NAT)

NAT lets multiple hosts on a private network share one or a few public IP addresses. A NAT-enabled router rewrites the source IP (and port, in PAT/overload) of outgoing packets to its public address and keeps a translation table to map replies back to the correct internal host.

  • Benefits: conserves scarce public IPv4 addresses and hides internal addressing (adds a layer of security).
  • Types: Static NAT (1-to-1), Dynamic NAT (pool), and PAT/NAT Overload (many private hosts to one public IP, distinguished by port number) — the most common form in home/office routers.

(c) ARP and Its Working

ARP (Address Resolution Protocol) maps a known IPv4 address to a MAC (hardware) address on a local network, because frames on a LAN are delivered by MAC address.

  • When a host wants to send to an IP on its subnet and lacks the MAC, it broadcasts an ARP Request ("Who has IP X? Tell me your MAC").
  • The host owning IP X replies with a unicast ARP Reply containing its MAC.
  • The sender caches the mapping in its ARP table for future use, avoiding repeated broadcasts.

(b) IPv4 vs IPv6 (alternative)

FeatureIPv4IPv6
Address size32-bit (~4.3 billion)128-bit (~3.4×10³⁸)
NotationDotted decimal 192.168.1.1Hex, colon-separated 2001:db8::1
HeaderVariable length, 12+ fields, has checksumFixed 40-byte header, simplified, no header checksum
ConfigurationManual / DHCPStateless autoconfiguration (SLAAC) + DHCPv6
OtherNeeds NAT; broadcast supportedHuge space removes NAT need; uses multicast/anycast, built-in IPsec
ip-addressingsubnetting

Frequently asked questions

Where can I find the BE Computer Engineering (Pokhara University) Computer Networks (PU, CMP 344) question paper 2078?
The full BE Computer Engineering (Pokhara University) Computer Networks (PU, CMP 344) 2078 (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 (PU, CMP 344) 2078 paper come with solutions?
Yes. Every question on this Computer Networks (PU, CMP 344) past paper includes a step-by-step solution, plus instant AI feedback when you attempt it on Kekkei.
How many marks is the BE Computer Engineering (Pokhara University) Computer Networks (PU, CMP 344) 2078 paper?
The BE Computer Engineering (Pokhara University) Computer Networks (PU, CMP 344) 2078 paper carries 100 full marks and is meant to be completed in 180 minutes, across 11 questions.
Is practising this Computer Networks (PU, CMP 344) past paper free?
Yes — reading and attempting this Computer Networks (PU, CMP 344) past paper on Kekkei is completely free.