Browse papers
A

Section A: Long Answer Questions

Attempt all / any as specified.

4 questions
1long12 marks

(a) Compare and contrast the OSI reference model with the TCP/IP protocol suite, clearly mapping the layers of one model onto the other and identifying which OSI layers have no direct counterpart in TCP/IP. [7]

(b) Explain the concepts of encapsulation and de-encapsulation as a data unit travels down and up the protocol stack. Using a suitable diagram, show the Protocol Data Unit (PDU) name and the header information added at the Transport, Network and Data Link layers. [5]

(a) OSI vs. TCP/IP Model [7]

AspectOSI Reference ModelTCP/IP Protocol Suite
Number of layers74 (sometimes shown as 5)
DevelopmentTheoretical, model-first (ISO)Protocol-first, built around working protocols
Layer couplingStrict, well-separated layersLayers more loosely defined
Transport reliabilityBoth connection-oriented & connectionlessTCP (reliable) and UDP (unreliable)
UsageMainly a teaching/reference modelThe model actually used on the Internet

Layer mapping (OSI -> TCP/IP):

OSI LayerTCP/IP Layer
7 Application, 6 Presentation, 5 SessionApplication
4 TransportTransport (TCP/UDP)
3 NetworkInternet (IP)
2 Data Link, 1 PhysicalNetwork Access / Link

OSI layers with no direct counterpart in TCP/IP: The Presentation layer (encoding, encryption, compression) and the Session layer (dialog control, synchronization) have no dedicated layer in TCP/IP; their functions are handled inside the application layer (or by the application itself).

(b) Encapsulation and De-encapsulation [5]

Encapsulation is the process where each layer, as data travels down the stack on the sender, adds its own header (and sometimes a trailer) to the data unit received from the layer above. De-encapsulation is the reverse: as data travels up the stack on the receiver, each layer removes and processes its own header before passing the payload upward.

PDU names and headers added:

LayerPDU nameHeader / control information added
TransportSegment (TCP) / Datagram (UDP)Source & destination port numbers, sequence/ack numbers, checksum
NetworkPacketSource & destination IP addresses, TTL, protocol field
Data LinkFrameSource & destination MAC addresses, plus a trailer (FCS/CRC)

Diagram (described): The application Data is wrapped by the Transport header to form a Segment; the Segment is wrapped by the IP header to form a Packet; the Packet is wrapped by the frame header + trailer to form a Frame, which is then sent as bits on the physical medium. Each successive box encloses the previous one, like nested envelopes.

osi-modeltcp-ip-modelprotocol-layering
2long12 marks

An organization has been allocated the network address 192.168.10.0/24. The network must be divided to support four departments with the following host requirements: Department A = 60 hosts, Department B = 28 hosts, Department C = 12 hosts, Department D = 10 hosts.

(a) Using Variable Length Subnet Masking (VLSM), design the subnetting scheme. For each department give the subnet address, the subnet mask (in CIDR and dotted-decimal form), the usable host range and the broadcast address. [9]

(b) State how much of the address space remains unallocated after this design. [3]

(a) VLSM Design for 192.168.10.0/24 [9]

Allocate largest requirement first. Required hosts -> next power of two (usable = 2h22^h - 2):

  • A: 60 hosts -> 62 usable -> /26/26 (6 host bits)
  • B: 28 hosts -> 30 usable -> /27/27 (5 host bits)
  • C: 12 hosts -> 14 usable -> /28/28 (4 host bits)
  • D: 10 hosts -> 14 usable -> /28/28 (4 host bits)
DeptSubnet AddressCIDRMask (dotted-decimal)Usable Host RangeBroadcast
A (60)192.168.10.0/26255.255.255.192.1 – .62192.168.10.63
B (28)192.168.10.64/27255.255.255.224.65 – .94192.168.10.95
C (12)192.168.10.96/28255.255.255.240.97 – .110192.168.10.111
D (10)192.168.10.112/28255.255.255.240.113 – .126192.168.10.127

(b) Unallocated Address Space [3]

The four subnets consume addresses 192.168.10.0 – 192.168.10.127 (the first half of the /24).

Remaining: 192.168.10.128 – 192.168.10.255 = 128 addresses unallocated (a contiguous block equal to a 192.168.10.128/25). These can be used for future departments or further subnetting.

ip-addressingsubnettingvlsm
3long12 marks

(a) Distinguish between Distance Vector routing and Link State routing with respect to the information exchanged, convergence speed and scalability. [5]

(b) Consider the network graph below where edge labels are link costs:

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

Apply Dijkstra's shortest-path algorithm to compute the shortest path tree and least-cost path from node A to every other node. Show the working at each iteration. [7]

(a) Distance Vector vs. Link State Routing [5]

CriterionDistance VectorLink State
Information exchangedEntire routing table (distances to all destinations) shared only with directly connected neighborsLink-state advertisements (cost of its own links) flooded to all routers
Knowledge of topologyEach router knows only neighbor-reported distances ("routing by rumor")Every router builds a complete map of the whole topology
AlgorithmBellman-FordDijkstra (SPF)
Convergence speedSlow; prone to count-to-infinity / routing loopsFast convergence
ScalabilityLimited (e.g. RIP, hop limit 15)Scales well (e.g. OSPF, IS-IS), uses more CPU/memory

(b) Dijkstra from node A [7]

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

Let D(v)D(v) = current least-cost estimate; N' = finalized set.

StepN' (finalized)D(B)D(C)D(D)D(E)D(F)
Init{A}1,A4,A
1{A,B}4,B4,A3,B
2{A,B,E}4,B4,A4,E
3{A,B,E,C}4,A4,E
4{A,B,E,C,D}4,E
5{A,B,E,C,D,F}

(At each step the unfinalized node with smallest D is added; ties broken arbitrarily.)

Shortest-path tree / least-cost paths from A:

DestinationCostPath
B1A → B
E3A → B → E
C4A → B → C
D4A → D
F4A → B → E → F

The shortest-path tree uses edges: A–B, A–D, B–C, B–E, E–F.

routing-algorithmsdistance-vectorlink-state
4long12 marks

(a) Differentiate between symmetric-key and asymmetric-key (public-key) cryptography, mentioning one practical algorithm and one key-distribution challenge for each. [5]

(b) In the RSA algorithm, two primes are chosen as p = 7 and q = 11 and the public exponent is e = 13. Compute the value of n, the totient φ(n) and the private key d. Then show how the plaintext message M = 5 would be encrypted and decrypted. [7]

(a) Symmetric vs. Asymmetric Cryptography [5]

AspectSymmetric-keyAsymmetric (Public-key)
KeysSingle shared secret key for encrypt & decryptKey pair: public key (encrypt) + private key (decrypt)
SpeedFast, efficient for bulk dataSlow, computationally heavy
Example algorithmAES (or DES/3DES)RSA (or ECC, Diffie-Hellman)
Key-distribution challengeSecurely sharing the secret key with every party; n(n1)/2n(n-1)/2 keys for nn usersAuthenticating that a public key truly belongs to its owner (needs a PKI / certificates to stop man-in-the-middle)

(b) RSA with p = 7, q = 11, e = 13 [7]

Step 1 – Modulus: n=p×q=7×11=77n = p \times q = 7 \times 11 = 77.

Step 2 – Totient: φ(n)=(p1)(q1)=6×10=60\varphi(n) = (p-1)(q-1) = 6 \times 10 = 60.

Step 3 – Private key d: find dd with de1(mod60)d \cdot e \equiv 1 \pmod{60}, i.e. 13d1(mod60)13d \equiv 1 \pmod{60}. 13×37=481=8×60+1481mod60=113 \times 37 = 481 = 8 \times 60 + 1 \Rightarrow 481 \bmod 60 = 1. So d=37d = 37.

  • Public key = (e,n)=(13,77)(e, n) = (13, 77)
  • Private key = (d,n)=(37,77)(d, n) = (37, 77)

Step 4 – Encryption of M=5M = 5: C=Memodn=513mod77C = M^e \bmod n = 5^{13} \bmod 77. 52=25,  54=625mod77=9,  58=92=81mod77=45^2 = 25,\; 5^4 = 625 \bmod 77 = 9,\; 5^8 = 9^2 = 81 \bmod 77 = 4. 513=585451=495=180mod77=265^{13} = 5^8 \cdot 5^4 \cdot 5^1 = 4 \cdot 9 \cdot 5 = 180 \bmod 77 = 26.

C=26C = 26

Step 5 – Decryption: M=Cdmodn=2637mod77=5M = C^d \bmod n = 26^{37} \bmod 77 = 5, recovering the original plaintext M=5M = 5. ✓

cryptographysymmetric-encryptionpublic-key-cryptography
B

Section B: Short Answer Questions

Attempt all / any as specified.

9 questions
5short6 marks

With the help of a diagram, explain the TCP three-way handshake used for connection establishment. State the role of the SYN, SYN-ACK and ACK segments and the purpose of the initial sequence numbers.

TCP Three-Way Handshake [6]

Before data transfer, TCP establishes a connection and synchronizes sequence numbers using three segments:

   Client                          Server
     |  -------- SYN (seq=x) ------->  |   (1)
     |  <--- SYN-ACK (seq=y, ack=x+1) -|   (2)
     |  -------- ACK (ack=y+1) ------->|   (3)
   ESTABLISHED                    ESTABLISHED
  1. SYN: The client sends a segment with the SYN flag set and an Initial Sequence Number (ISN) xx, requesting a connection.
  2. SYN-ACK: The server replies with both SYN and ACK flags set, its own ISN yy, and acknowledgement number x+1x+1 (acknowledging the client's SYN).
  3. ACK: The client sends an ACK with acknowledgement number y+1y+1, confirming the server's SYN. The connection is now ESTABLISHED.

Purpose of initial sequence numbers (ISNs): Each side chooses a (random) ISN so both ends agree on the starting byte numbers used to order data, detect lost/duplicate segments, and reassemble the byte stream correctly. Randomizing the ISN also prevents old or spoofed segments from a previous connection being mistakenly accepted.

transport-layertcpconnection-management
6short6 marks

Compare TCP and UDP across at least five criteria (connection orientation, reliability, ordering, header size and overhead). Give one example application for which UDP is more suitable than TCP and justify your choice.

TCP vs. UDP [6]

CriterionTCPUDP
Connection orientationConnection-oriented (3-way handshake)Connectionless
ReliabilityReliable – acknowledgements & retransmissionUnreliable – best-effort, no retransmission
OrderingGuarantees in-order delivery (sequence numbers)No ordering guarantee
Flow & congestion controlYes (windowing, congestion control)None
Header size20 bytes (min)8 bytes
Overhead / speedHigher overhead, slowerLow overhead, fast

Example where UDP is preferred: Real-time applications such as live video/voice (VoIP), online gaming, or DNS queries.

Justification: In live VoIP, low latency matters far more than perfect reliability. TCP's retransmission and ordering would introduce delay; a few lost packets cause only a tiny glitch, but waiting to retransmit them would stall the conversation. UDP's lightweight, connectionless delivery keeps latency low, making it the better fit.

transport-layertcpudp
7short6 marks

Explain the working of the Domain Name System (DNS). Describe the difference between recursive and iterative DNS queries, and outline the steps involved in resolving the name www.example.com to an IP address.

Domain Name System (DNS) [6]

Working: DNS is a hierarchical, distributed database that translates human-readable domain names (e.g. www.example.com) into IP addresses. It uses a tree of servers: root serversTop-Level Domain (TLD) servers (e.g. .com) → authoritative servers for each domain. Clients query through a local/recursive resolver which caches results to speed up future lookups. DNS normally runs over UDP port 53.

Recursive vs. iterative queries:

  • Recursive query: The client asks the resolver for the final answer and the resolver does all the work, contacting other servers on the client's behalf and returning only the final IP (or an error).
  • Iterative query: The queried server returns the best answer it has — typically a referral to the next server to ask — and the requester must follow up itself.

Resolving www.example.com:

  1. The client sends a recursive query to its local DNS resolver.
  2. The resolver sends an iterative query to a root server, which refers it to the .com TLD server.
  3. The resolver queries the .com TLD server, which refers it to the authoritative server for example.com.
  4. The resolver queries the authoritative server, which returns the IP address of www.example.com.
  5. The resolver caches the result and returns the IP to the client.
application-layerdnsprotocols
8short6 marks

(a) Differentiate between HTTP persistent and non-persistent connections. [3]

(b) Briefly describe the roles of SMTP, POP3 and IMAP in the electronic mail system. [3]

(a) HTTP Persistent vs. Non-Persistent Connections [3]

  • Non-persistent (HTTP/1.0 default): A separate TCP connection is opened for each object (HTML page, each image, etc.) and closed after one request–response. Fetching a page with nn objects needs n+1n+1 connections, incurring repeated handshake (and slow-start) overhead and extra RTTs.
  • Persistent (HTTP/1.1 default): A single TCP connection is kept open to send multiple requests/responses, reducing connection-setup overhead and latency. It also supports pipelining. The connection is closed after an idle timeout.

(b) Roles of SMTP, POP3 and IMAP [3]

  • SMTP (Simple Mail Transfer Protocol): A push protocol used to send mail — from the sender's client to the mail server and between mail servers (port 25/587).
  • POP3 (Post Office Protocol v3): A pull/retrieval protocol that downloads mail from the server to the client, typically deleting it from the server afterwards; suited to single-device access (port 110).
  • IMAP (Internet Message Access Protocol): A retrieval protocol that lets the client read and manage mail while it stays on the server, with folder sync across multiple devices (port 143).
application-layerhttpemail-protocols
9short6 marks

Define the security goals of Confidentiality, Integrity and Availability (the CIA triad). For each goal, name one type of attack that threatens it and one countermeasure used to protect it.

CIA Triad [6]

The CIA triad defines the three fundamental security goals of an information system:

  • Confidentiality: Ensuring information is accessible only to authorized parties — preventing unauthorized disclosure.
  • Integrity: Ensuring information is accurate and unaltered — preventing unauthorized or accidental modification.
  • Availability: Ensuring information and services are accessible when needed by authorized users.
GoalExample Attack (threat)Countermeasure
ConfidentialityEavesdropping / packet sniffing (interception)Encryption (e.g. AES, TLS) and access control
IntegrityMessage tampering / man-in-the-middle modificationHashing, message authentication codes (MAC), digital signatures
AvailabilityDenial-of-Service (DoS/DDoS) attackFirewalls, rate limiting, redundancy, load balancing
network-securitysecurity-attackssecurity-services
10short6 marks

What is a digital signature? Explain how a digital signature is generated and verified using a hash function and public-key cryptography, and state how it provides both authentication and non-repudiation.

Digital Signature [6]

A digital signature is a cryptographic value attached to a message that lets the receiver verify the message's origin (authenticity) and that it has not been altered (integrity), using a hash function and public-key cryptography.

Generation (by sender, using the sender's private key):

  1. Compute a fixed-length hash (digest) of the message: h=H(M)h = H(M).
  2. Encrypt the hash with the sender's private key to form the signature: S=Epriv(h)S = E_{priv}(h).
  3. Send the message MM together with the signature SS.

Verification (by receiver, using the sender's public key):

  1. Compute the hash of the received message: h1=H(M)h_1 = H(M).
  2. Decrypt the signature with the sender's public key: h2=Dpub(S)h_2 = D_{pub}(S).
  3. If h1=h2h_1 = h_2, the signature is valid — the message is authentic and unmodified; otherwise it is rejected.

Authentication & non-repudiation: Because only the sender holds the private key, a valid signature proves the message came from that sender (authentication). Since no one else could have produced that signature, the sender cannot later deny having sent the message (non-repudiation). The hash comparison additionally guarantees integrity.

network-securityauthenticationdigital-signature
11short6 marks

Explain the function of a firewall in a network. Differentiate between a packet-filtering firewall and a stateful inspection firewall, and discuss the role of a Demilitarized Zone (DMZ) in network design.

Firewall, Filtering Types and DMZ [6]

Function of a firewall: A firewall is a hardware/software security barrier placed between a trusted internal network and an untrusted external network (e.g. the Internet). It inspects incoming and outgoing traffic and permits or blocks it according to a configured security policy (rule set), protecting the network from unauthorized access and attacks.

Packet-filtering vs. stateful inspection firewall:

AspectPacket-Filtering FirewallStateful Inspection Firewall
Basis of decisionExamines each packet's header in isolation (source/dest IP, ports, protocol)Tracks the state of active connections and judges packets in the context of the whole session
Memory of connectionsStateless — no memory of prior packetsMaintains a state table of connections
SecurityWeaker; can be fooled by spoofed/out-of-context packetsStronger; only allows packets belonging to a valid established session
SpeedFast, low overheadMore processing, slightly slower

Demilitarized Zone (DMZ): A DMZ is a separate perimeter subnetwork that sits between the internal LAN and the external network and hosts public-facing servers (web, mail, DNS). Servers that must be reachable from the Internet are placed in the DMZ so that, even if one is compromised, the attacker is isolated from the internal trusted network. It is typically created between two firewalls (or two interfaces of one firewall), adding a layer of defense in depth.

firewallspacket-filteringnetwork-security
12short6 marks

What is a Virtual Private Network (VPN)? Explain the concept of tunneling and differentiate between the transport mode and tunnel mode of IPSec.

VPN, Tunneling and IPSec Modes [6]

Virtual Private Network (VPN): A VPN creates a secure, encrypted connection (a "private tunnel") over a shared public network such as the Internet, allowing remote users or sites to communicate as if they were on the same private network. It provides confidentiality, integrity and authentication for the traffic.

Tunneling: Tunneling is the technique of encapsulating an entire packet inside the payload of another packet. The original (inner) packet — often encrypted — is wrapped with a new outer header for transport across the public network, then de-encapsulated at the far end. This hides the inner addressing/contents and lets private traffic traverse untrusted networks securely.

IPSec transport mode vs. tunnel mode:

AspectTransport ModeTunnel Mode
What is protectedOnly the payload of the IP packet; original IP header keptThe entire original IP packet (header + payload) is encrypted and encapsulated
New headerOriginal IP header reusedA new outer IP header is added
Typical useHost-to-host (end-to-end) communicationGateway-to-gateway / site-to-site VPNs (e.g. router-to-router)
Header visibilityOriginal source/dest IP visibleOriginal IP addresses hidden inside the tunnel
vpnipsectunneling
13short4 marks

List four key differences between IPv4 and IPv6 addressing, including address length, header complexity and support for address autoconfiguration.

IPv4 vs. IPv6 [4]

#FeatureIPv4IPv6
1Address length32-bit (4.3×109\approx 4.3 \times 10^9 addresses), written in dotted decimal128-bit (vastly larger space), written in hexadecimal colon notation
2Header complexityVariable-length header (20–60 bytes) with many fields incl. checksumSimplified fixed 40-byte header; no header checksum, options moved to extension headers
3Address autoconfigurationNeeds DHCP or manual configurationSupports Stateless Address Autoconfiguration (SLAAC) — hosts self-configure
4Security & broadcastIPSec optional; uses broadcastIPSec support built into the design; no broadcast, uses multicast/anycast instead
ip-addressingipv4-ipv6

Frequently asked questions

Where can I find the BE Computer Engineering (IOE, TU) Computer Networks and Security (IOE, CT 703 / ENCT 304) question paper 2078?
The full BE Computer Engineering (IOE, TU) Computer Networks and Security (IOE, CT 703 / ENCT 304) 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 and Security (IOE, CT 703 / ENCT 304) 2078 paper come with solutions?
Yes. Every question on this Computer Networks and Security (IOE, CT 703 / ENCT 304) 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 (IOE, TU) Computer Networks and Security (IOE, CT 703 / ENCT 304) 2078 paper?
The BE Computer Engineering (IOE, TU) Computer Networks and Security (IOE, CT 703 / ENCT 304) 2078 paper carries 80 full marks and is meant to be completed in 180 minutes, across 13 questions.
Is practising this Computer Networks and Security (IOE, CT 703 / ENCT 304) past paper free?
Yes — reading and attempting this Computer Networks and Security (IOE, CT 703 / ENCT 304) past paper on Kekkei is completely free.