Blog
Internet Architecture and Protocol BSCS 5th Term Past Paper 2016 UOS
University of Sargodha Internet Architecture & Protocol (CS-3513) past paper for BS Computer Science 5th term 2016, retyped from the original paper, with solved answers below.
Solved answers
Q1 – Short questions
(i) Is 192.168.256.80 valid? No. Each octet of an IPv4 address must be 0–255; 256 is out of range, so it is invalid.
(ii) Why protocols are required: communicating devices may differ in hardware, software and data formats; a protocol is an agreed set of rules (syntax, semantics, timing) that defines how data is formatted, transmitted, received and acknowledged, so communication is possible and reliable.
(iii) Role of DS bits: the 8-bit Differentiated Services field (formerly Type of Service) marks the priority/class of a datagram — DSCP bits for quality of service (e.g. low delay for voice) and ECN bits for congestion notification — so routers can treat packets differently.
(iv) Bits for 1,024 addresses: log₂(1024) = 10 bits.
(v) Types of delay in packet-switched networks: four — processing delay, queuing delay, transmission delay and propagation delay (total nodal delay is their sum).
(vi) Broadcast vs point-to-point networks: in a broadcast network all devices share one channel and a packet sent by one is received by all (Ethernet LAN, Wi-Fi). A point-to-point network has dedicated links between pairs of devices, and packets travel from one specific sender to one receiver, possibly via intermediate nodes.
(vii) Point-to-Point Protocol (PPP): a data-link layer protocol for direct links between two nodes (dial-up, DSL); it provides framing, link control (LCP), authentication (PAP/CHAP) and network-layer configuration (NCP, e.g. IPCP).
(viii) Address field changed in a datagram network: the data-link (MAC) addresses change at every hop; the source and destination IP addresses stay the same end to end.
(ix) Peer-to-peer model: each host acts as both client and server and communicates directly with others without a central server, e.g. BitTorrent file sharing or Skype calls.
(x) Why internet architecture is tiered: the internet is a network of networks organised as Tier-1 backbone ISPs, Tier-2 regional ISPs and Tier-3 local/access ISPs. Tiers make it scalable and manageable, allow traffic to flow through peering and transit agreements, and spread cost and responsibility.
(xi) Internetworking: connecting two or more different networks so they work as one, using routers and a common protocol (IP). Example: the internet, or connecting a university LAN to the ISP network.
(xii) X.25: an early ITU-T standard for packet-switched wide-area networks using virtual circuits, with extensive error and flow control at each hop; used before Frame Relay and ATM.
(xiii) Socket address: the combination of an IP address and a port number that uniquely identifies a process on a host, e.g. 192.168.1.10:80.
(xiv) TCP congestion control: using a congestion window with slow start, congestion avoidance (additive increase), and multiplicative decrease on loss (time-out or three duplicate ACKs, with fast retransmit and fast recovery).
(xv) Two error-detection mechanisms: checksum and cyclic redundancy check (CRC); parity check is another.
(xvi) Two routing protocols: RIP and OSPF (also BGP).
Q2 (a) – ATM architecture and ATM cells
ATM (Asynchronous Transfer Mode) is a cell-relay, connection-oriented switching technology that carries voice, video and data using small fixed-size cells.
- Cell: 53 bytes — 5-byte header and 48-byte payload. Fixed size makes switching fast in hardware and delay predictable.
- Header fields (UNI): GFC (4 bits), VPI (8), VCI (16), PT payload type (3), CLP cell loss priority (1), HEC header error control (8).
- Connections: virtual paths (VP) contain virtual circuits (VC); a connection is identified by VPI/VCI and set up before data transfer (PVC or SVC).
- Layers: physical layer (SONET/SDH, transmission), ATM layer (routing, switching and multiplexing cells using VPI/VCI) and ATM adaptation layer (AAL1 for constant bit rate, AAL2 for variable bit rate audio/video, AAL3/4 and AAL5 for data) which segments user data into 48-byte payloads and reassembles them.
- Devices: user-to-network interface (UNI) between end systems and switches, network-to-network interface (NNI) between switches.
Q2 (b) – Functions of LCP
The Link Control Protocol (part of PPP) establishes, configures, maintains and terminates the link; negotiates options (maximum receive unit, authentication protocol, compression, magic number); tests link quality and detects loops (echo request/reply); and uses configure, terminate, code-reject, protocol-reject, echo and discard packets.
Q3 – Attributes of the IPv4 header
- Version (4 bits): 4 for IPv4.
- HLEN (4 bits): header length in 4-byte words (20–60 bytes).
- DS / Type of service (8 bits): priority and QoS.
- Total length (16 bits): header + data, up to 65,535 bytes.
- Identification (16 bits): identifies fragments of the same datagram.
- Flags (3 bits): reserved, DF (do not fragment), MF (more fragments).
- Fragmentation offset (13 bits): position of the fragment in units of 8 bytes.
- Time to live (8 bits): maximum hops; decremented by each router; discarded at 0.
- Protocol (8 bits): upper-layer protocol (1 ICMP, 6 TCP, 17 UDP).
- Header checksum (16 bits): error detection for the header.
- Source and destination IP addresses (32 bits each).
- Options + padding (0–40 bytes): record route, timestamp, source routing.
Q4 (a) – UDP checksum calculation with example
The UDP checksum covers a pseudo-header (source IP, destination IP, zero byte, protocol = 17, UDP length), the UDP header (with checksum field set to 0) and the data. All are divided into 16-bit words, added using one’s complement arithmetic (wrap-around carries are added back), and the result is complemented. The receiver adds everything including the checksum; a result of all 1s means no error.
Simple example with three 16-bit words:
| Step | Value |
|---|---|
| Word 1 | 0110 0110 0110 0000 |
| Word 2 | 0101 0101 0101 0101 |
| Sum | 1011 1011 1011 0101 |
| Word 3 | 1000 1111 0000 1100 |
| Sum (17 bits) | 1 0100 1010 1100 0001 |
| Wrap carry → add 1 | 0100 1010 1100 0010 |
| Checksum = one’s complement | 1011 0101 0011 1101 |
The sender places 1011 0101 0011 1101 in the checksum field. At the receiver, the sum of the three words plus the checksum = 1111 1111 1111 1111, so no error is detected.
Q4 (b) – Connectionless vs connection-oriented services
| Connection-oriented | Connectionless |
|---|---|
| A connection is set up before data transfer and released afterwards | No connection set-up; each packet is sent independently |
| Packets follow the same path and arrive in order | Packets may take different paths and arrive out of order |
| Reliable — acknowledgements, retransmission, flow and congestion control | Unreliable / best-effort — no guarantees |
| More overhead and delay at start | Low overhead and faster |
| Examples: TCP, virtual-circuit networks (ATM, X.25), telephone calls | Examples: UDP, IP datagram networks, postal letters |
Q5 (a) – CSMA/CD vs CSMA/CA
| CSMA/CD | CSMA/CA |
|---|---|
| Carrier sense multiple access with collision detection | Carrier sense multiple access with collision avoidance |
| Used in wired Ethernet (IEEE 802.3) | Used in wireless LANs (IEEE 802.11 Wi-Fi) |
| Stations transmit when the medium is idle and detect collisions while sending | Collisions cannot be reliably detected in wireless, so stations try to avoid them |
| On collision: send jam signal, stop, wait a random back-off time and retry | Uses interframe space (IFS), random back-off contention window, optional RTS/CTS handshake and acknowledgements |
| Effective after a collision occurs | Works before transmission to prevent collisions |
Q5 (b) – Role of ICMP
IP is unreliable and has no error-reporting or query mechanism; ICMP (Internet Control Message Protocol), carried inside IP datagrams, fills this gap. Error-reporting messages: destination unreachable, source quench (congestion), time exceeded (TTL = 0 — used by traceroute), parameter problem and redirection. Query messages: echo request and reply (used by ping), timestamp request/reply. ICMP thus helps diagnose network problems and informs senders about delivery failures.
Q6 – Allocating 120.60.4.0/20 to 100 organisations (8 addresses each)
The block /20 contains 2³² ⁻ ²⁰ = 4,096 addresses: 120.60.4.0 to 120.60.19.255. Each organisation needs 8 = 2³ addresses, so each sub-block has prefix 32 − 3 = /29.
| Organisation | Sub-block | Address range |
|---|---|---|
| 1 | 120.60.4.0/29 | 120.60.4.0 – 120.60.4.7 |
| 2 | 120.60.4.8/29 | 120.60.4.8 – 120.60.4.15 |
| 3 | 120.60.4.16/29 | 120.60.4.16 – 120.60.4.23 |
| … | … | … |
| 32 | 120.60.4.248/29 | 120.60.4.248 – 120.60.4.255 |
| 33 | 120.60.5.0/29 | 120.60.5.0 – 120.60.5.7 |
| … | … | … |
| 100 | 120.60.7.24/29 | 120.60.7.24 – 120.60.7.31 |
Organisation n receives the block starting at 120.60.4.0 + 8(n − 1). The 100 blocks use 100 × 8 = 800 addresses (120.60.4.0 – 120.60.7.31).
Addresses still available: 4,096 − 800 = 3,296, from 120.60.7.32 to 120.60.19.255.
Answers prepared by Shining Study for revision. Check them against your class notes and teacher’s guidance.
