Level 2 — RecallComputer Networks

Computer Networks

30 minutes40 marksprintable — key stays hidden on paper

Difficulty: Level 2 — Recall & Standard Textbook Problems Time Limit: 30 minutes Total Marks: 40


Instructions: Answer all questions. Show working for numerical problems. Use ...... for any math.


Q1. List the 7 layers of the OSI model in order (top to bottom), and name the Protocol Data Unit (PDU) at the Transport, Network, and Data Link layers. (5 marks)

Q2. State the Nyquist formula for the maximum data rate of a noiseless channel. A noiseless channel has a bandwidth of 30003000 Hz and uses 44 signal levels. Compute the maximum data rate. (4 marks)

Q3. Using the Shannon–Hartley theorem, compute the maximum channel capacity for a channel of bandwidth 30003000 Hz and signal-to-noise ratio SNR=1023\text{SNR} = 1023 (i.e. 30.130.1 dB approx). Give the formula and the result in bits/s. (4 marks)

Q4. Given the IPv4 address 192.168.10.130192.168.10.130 with subnet mask /26/26 (i.e. 255.255.255.192255.255.255.192): (a) Compute the network address. (b) Compute the broadcast address. (c) State the number of usable host addresses per subnet. (5 marks)

Q5. Define NAT and briefly distinguish between SNAT, DNAT, and PAT. (4 marks)

Q6. Describe the TCP 3-way handshake, naming the flags exchanged in each of the three segments. (4 marks)

Q7. Match the following DNS record types to their purpose: A, AAAA, CNAME, MX, NS. (5 marks)

Q8. Explain the difference between CSMA/CD (Ethernet, 802.3) and CSMA/CA (Wi-Fi, 802.11) in two or three sentences. (4 marks)

Q9. A subnet uses mask /28/28. How many subnets and how many usable hosts per subnet result when a class C (/24/24) network is divided using this mask? Show the host-bit calculation. (5 marks)


End of paper

Answer keyMark scheme & solutions

Q1. (5 marks) Layers top→bottom: Application, Presentation, Session, Transport, Network, Data Link, Physical. (3 marks — deduct for order errors) PDUs: Transport = Segment (TCP) / Datagram (UDP); Network = Packet; Data Link = Frame. (2 marks) Why: PDU names reflect encapsulation at each layer.


Q2. (4 marks) Nyquist: C=2Blog2MC = 2B\log_2 M. (2 marks) C=2×3000×log24=2×3000×2=12000C = 2 \times 3000 \times \log_2 4 = 2 \times 3000 \times 2 = 12000 bits/s. (2 marks) Why: log24=2\log_2 4 = 2; noiseless bound depends only on bandwidth and levels.


Q3. (4 marks) Shannon: C=Blog2(1+SNR)C = B\log_2(1 + \text{SNR}). (2 marks) C=3000×log2(1+1023)=3000×log21024=3000×10=30000C = 3000 \times \log_2(1+1023) = 3000 \times \log_2 1024 = 3000 \times 10 = 30000 bits/s. (2 marks) Why: 1+1023=1024=2101+1023 = 1024 = 2^{10}, so log2=10\log_2 = 10.


Q4. (5 marks) /26/26 → block size =256192=64= 256-192 = 64 in last octet. (a) 192.168.10.130192.168.10.130: 130130 falls in block 128128191191, so network = 192.168.10.128. (2 marks) (b) Broadcast = 192.168.10.191. (2 marks) (c) Host bits =3226=6262=62= 32-26 = 6 \Rightarrow 2^6 - 2 = 62 usable hosts. (1 mark) Why: subtract network+broadcast from 2host2^{host}.


Q5. (4 marks) NAT = translating private IPs to public IP(s) at a router border, conserving IPv4 space and hiding internal topology. (1 mark)

  • SNAT (Source NAT): rewrites source address of outbound packets (e.g. private→public). (1)
  • DNAT (Destination NAT): rewrites destination address, used for port-forwarding/inbound. (1)
  • PAT (Port Address Translation / NAT overload): many hosts share one public IP, distinguished by port numbers. (1)

Q6. (4 marks)

  1. Client → Server: SYN (seq = x). (1)
  2. Server → Client: SYN, ACK (seq = y, ack = x+1). (1.5)
  3. Client → Server: ACK (ack = y+1). (1.5) Why: both sides synchronize initial sequence numbers before data transfer.

Q7. (5 marks) (1 mark each)

  • A → maps hostname to IPv4 address.
  • AAAA → maps hostname to IPv6 address.
  • CNAME → canonical name / alias to another domain name.
  • MX → mail exchange server for a domain.
  • NS → authoritative name server for a zone.

Q8. (4 marks) CSMA/CD: used on wired Ethernet; a station listens, transmits, and detects collisions while sending, then aborts and backs off. (2) CSMA/CA: used on wireless where collision detection is impractical; stations avoid collisions via random backoff, waiting for idle medium, and optional RTS/CTS handshakes. (2)


Q9. (5 marks) Class C default /24/24, new mask /28/28. Subnet bits borrowed =2824=424=16= 28-24 = 4 \Rightarrow 2^4 = 16 subnets. (2) Host bits =3228=4242=14= 32-28 = 4 \Rightarrow 2^4 - 2 = 14 usable hosts per subnet. (2) Block size =16= 16 addresses each. (1)


[
  {"claim":"Nyquist rate = 12000 bits/s","code":"B=3000; M=4; C=2*B*log(M,2); result = (C==12000)"},
  {"claim":"Shannon capacity = 30000 bits/s","code":"B=3000; SNR=1023; C=B*log(1+SNR,2); result = (C==30000)"},
  {"claim":"/26 gives 62 usable hosts","code":"result = (2**(32-26)-2 == 62)"},
  {"claim":"/28 from /24 gives 16 subnets and 14 hosts","code":"result = (2**(28-24)==16 and 2**(32-28)-2==14)"}
]