Blog
CCN BSCS Final Past Paper – UOS Main Campus
University of Sargodha main campus CCN (Computer Communication and Networks) final exam for BSCS (Self), 50 marks, 2 hours. Retyped from the original paper (the switch diagram has been redrawn), with solved answers below.
Solved answers
Q1 – Virtual circuit tables (10)
Port connections read from the figure: Switch 1 — port 0 D, 1 Switch 2, 2 A, 3 C. Switch 2 — port 0 Switch 3, 1 Switch 4, 2 E, 3 Switch 1. Switch 3 — port 0 Switch 2, 1 J, 2 I, 3 B. Switch 4 — port 0 H, 1 G, 2 F, 3 Switch 2. On each link the lowest unused VCI is chosen, and connections stay up (cumulative).
(a) A → B (path S1 → S2 → S3)
| Switch | Incoming port | Incoming VCI | Outgoing port | Outgoing VCI |
|---|---|---|---|---|
| Switch 1 | 2 | 0 | 1 | 0 |
| Switch 2 | 3 | 0 | 0 | 0 |
| Switch 3 | 0 | 0 | 3 | 0 |
(b) C → G (path S1 → S2 → S4). The S1–S2 link already uses VCI 0, so VCI 1 is used there.
| Switch | Incoming port | Incoming VCI | Outgoing port | Outgoing VCI |
|---|---|---|---|---|
| Switch 1 | 3 | 0 | 1 | 1 |
| Switch 2 | 3 | 1 | 1 | 0 |
| Switch 4 | 3 | 0 | 1 | 0 |
(c) E → I (path S2 → S3). The S2–S3 link already uses VCI 0, so VCI 1 is used.
| Switch | Incoming port | Incoming VCI | Outgoing port | Outgoing VCI |
|---|---|---|---|---|
| Switch 2 | 2 | 0 | 0 | 1 |
| Switch 3 | 0 | 1 | 2 | 0 |
(d) D → B (path S1 → S2 → S3). S1–S2 already uses VCIs 0 and 1, S2–S3 uses 0 and 1, S3–B uses 0.
| Switch | Incoming port | Incoming VCI | Outgoing port | Outgoing VCI |
|---|---|---|---|---|
| Switch 1 | 0 | 0 | 1 | 2 |
| Switch 2 | 3 | 2 | 0 | 2 |
| Switch 3 | 0 | 2 | 3 | 1 |
Final switching table of each switch = all rows above for that switch: Switch 1 has 3 entries (a, b, d), Switch 2 has 4 (a, b, c, d), Switch 3 has 3 (a, c, d), Switch 4 has 1 (b).
Q2 – s1 to s4 communication design (30)
1. Assumptions: voice channel = 64 kbps; s1–s2 is a long-haul digital backbone; the s2–s3 “proceedings” are one-way broadcast audio in 4 languages; s3–s4 users need different budgets and speeds.
2. Design model: s1 ═(fiber, digital, TDM)═ s2 ~(analog, FDM, modem)~ s3 ═(digital, mixed media)═ s4. Draw s1 → [MUX] → fiber → [DEMUX + modem (D/A)] s2 → analog link → [modem (A/D)] s3 → switch → three user groups → s4.
3. Medium: s1–s2 (2,000 km, 1 Gb, 20 users): single-mode optical fiber — low attenuation over long distance, high bandwidth, immune to noise. s2–s3 (analog, 500 listeners): coaxial cable (or microwave) carrying 4 FDM audio channels, one per language. s3–s4 (250 m): very low budget users → UTP (Cat-5e/6); 500 Mbps users needing multiple frequencies → coaxial cable with FDM; 1 Gbps users → multimode optical fiber (or Cat-6 Gigabit Ethernet).
4. Encoding / modulation: s1–s2: 4 voice + 4 data channels combined with synchronous TDM, line coding with scrambling (B8ZS/HDB3 with AMI, or 4B/5B + NRZ-I) so long runs of zeros do not lose synchronization over long distance. s2–s3: digital-to-analog with QAM (or QPSK) for bandwidth efficiency, and FDM so the 4 languages are sent simultaneously on 4 frequency bands. s3–s4: the link has synchronization problems, so use a self-clocking code — Manchester / Differential Manchester (or 4B/5B / 8B/10B block coding for the 1 Gbps users).
5. Conversions: analog to digital at s3 uses PCM: sampling at ≥ 2 × highest frequency (Nyquist; 8,000 samples/s for 4 kHz voice), quantization into levels, and encoding each level as bits (8 bits × 8,000 = 64 kbps). Digital to analog at s2 uses a modem: the bit stream changes the amplitude and phase of a carrier (QAM/PSK); at s3 the demodulator recovers the bits.
6. Processing 100110: Manchester (0 = high→low, 1 = low→high): 1 → low→high, 0 → high→low, 0 → high→low, 1 → low→high, 1 → low→high, 0 → high→low. With QPSK on the analog link (2 bits per symbol, mapping 00 = 45°, 01 = 135°, 11 = 225°, 10 = 315°): 10 | 01 | 10 → 315°, 135°, 315° (3 signal elements for 6 bits).
Q3 – Subnetting 194.16.10.0 (10)
194.16.10.0 is a class C address (default mask /24). We need at least 3 usable addresses per network: 2h − 2 ≥ 3 → h = 3 host bits. So 8 − 3 = 5 bits are borrowed for subnets.
- New mask: /29 = 255.255.255.248, block size 8.
- Maximum subnets: 25 = 32 (30 if the first and last subnets are not used, as in old classful rules). Usable hosts per subnet: 23 − 2 = 6.
- First subnet: 194.16.10.0/29 — first host 194.16.10.1, last host 194.16.10.6, broadcast 194.16.10.7.
- Second subnet (for reference): 194.16.10.8 — hosts .9 to .14, broadcast .15.
- Last subnet: 194.16.10.248/29 — first host 194.16.10.249, last host 194.16.10.254, broadcast 194.16.10.255.
If only 2 hosts per network are needed, /30 (255.255.255.252) gives 64 subnets with 2 hosts each: first 194.16.10.0 (hosts .1–.2, broadcast .3), last 194.16.10.252 (hosts .253–.254, broadcast .255).
