IAP, Past Papers

Internet Architecture and Protocol (IAP) Past Paper 2019 – BS 5th Term UOS

Internet Architecture and Protocol Past Paper 2019 BS 5th Term UOS

University of Sargodha (UOS) BS 5th term Internet Architecture and Protocol (CS-3513) past paper 2019, with the full question paper in text form and solved answers, including the subnetting question.

Print / download (A4, high quality): Full-size paper

Internet Architecture and Protocol Past Paper 2019 (text version)

University of Sargodha – BS 5th Term Examination 2019, Subject: Computer Science
Paper: Internet Architecture and Protocol (CS-3513) · Time: 2:30 Hours · Maximum marks: 80
Note: Objective part is compulsory. Attempt any three questions from subjective part.

Objective part – Q1: Write short answers of the following in 2-3 lines each on your answer sheet. (16*2)

  1. Why PING is used?
  2. What is the role of time to live field in IP datagram?
  3. If the value in protocol field is 6, which transport layer protocol is used?
  4. What is the function of SMTP protocol?
  5. Give two error detection mechanisms.
  6. When customers do not have Network layer security, which type of security must be provided?
  7. An IP packet has arrived with the first 8 bits 01000010. The receiver discards the packet. Why?
  8. Why address aggregation is used?
  9. Which address field is changed in packet travelling through a datagram network?
  10. What is half close in connectivity?
  11. Which PDU Format is used when bits are received from the network medium by the NIC?
  12. What is the difference between local and global DLCI?
  13. What is the size of mandatory and optional header in IP datagram?
  14. What is the role of bootstrap protocol?
  15. Why packet switching is widely used as compared to circuit switching?
  16. A packet has arrived with an M bit value of 1. Is this the first fragment, the last fragment, or a middle fragment?

Subjective part (3*16)

Q2. Explain the layer 2 protocols in detail.

Q3. Explain the various attributes present in TCP header.

Q4. What is the difference between link state and distance vector routing protocols? Explain any of these in detail

Q5. a): Differentiate between IPv4 and IPv6?
b): Differentiate CSMA/CD and CSMA/CA?

Q6. An ISP is granted a block of addresses starting with 190.100.0.0. The ISP needs to distribute these addresses to three branches including main branch. Give the network address, broad casting address, effective range for each branch

Original paper (scanned copy)

The clean paper above is retyped by Shining Study from this original University of Sargodha question paper. Click the scan to view it full size.

Internet Architecture and Protocol Past Paper 2019 BS 5th Term UOS – original scan

Solved answers

Q1 – Short questions

(i) PING: tests whether a host is reachable and measures round-trip time and packet loss, using ICMP Echo Request and Echo Reply messages.

(ii) TTL: limits the lifetime of a datagram. Each router decrements it by 1; when it reaches 0 the datagram is discarded and an ICMP time-exceeded message is sent – this prevents packets from looping forever. (Traceroute uses it.)

(iii) Protocol = 6 means TCP (1 = ICMP, 17 = UDP).

(iv) SMTP: Simple Mail Transfer Protocol transfers email from the client to the mail server and between mail servers (TCP port 25/587). POP3/IMAP are used to retrieve mail.

(v) Checksum and CRC (also parity check).

(vi) Security at the transport layer (SSL/TLS) or the application layer (e.g. PGP, HTTPS, S/MIME).

(vii) 0100 = version 4 (correct), but HLEN = 0010 = 2, meaning a header of 2 × 4 = 8 bytes. The minimum IPv4 header is 20 bytes (HLEN ≥ 5), so the header length is invalid and the packet is discarded.

(viii) Address aggregation (supernetting/route summarization): combines several contiguous blocks into one larger prefix (e.g. four /24s into one /22), so routers keep fewer entries, routing tables are smaller, lookups faster and routing updates fewer.

(ix) The source and destination MAC (link-layer) addresses change at each hop; IP addresses stay the same.

(x) Half-close: in TCP one side can stop sending data (send FIN) while still receiving data from the other side, which continues sending until it also closes. Example: a client sends all its data, half-closes, and still receives the server’s results.

(xi) The NIC receives a stream of bits from the medium and assembles them into a frame (data-link layer PDU).

(xii) A local DLCI has meaning only on one link between a device and its Frame Relay switch; different links can reuse the same number, and it may change along the path. A global DLCI is unique across the whole Frame Relay network and identifies a particular destination everywhere (rarely used).

(xiii) Mandatory (fixed) header = 20 bytes; options = 0 to 40 bytes; so the header is 20–60 bytes.

(xiv) BOOTP: the Bootstrap Protocol lets a diskless host (or a host booting up) obtain its IP address, the server address and the name of a boot file from a BOOTP server using UDP (ports 67/68). It uses static tables; DHCP is its extension with dynamic leases.

(xv) Packet switching shares link bandwidth among many users on demand (statistical multiplexing), so it uses resources efficiently for bursty data traffic, does not need a call setup, is robust because packets can be rerouted around failures, and supports many simultaneous connections – ideal for the Internet. Circuit switching reserves a fixed path even when idle.

(xvi) M = 1 means more fragments follow, so it is not the last fragment. If its fragmentation offset is 0 it is the first fragment; if the offset is non-zero it is a middle fragment. (Without the offset value, we can only say it is the first or a middle fragment.)

Q2 – Layer 2 (data-link layer) protocols

The data-link layer moves frames between two directly connected nodes. Its duties: framing, physical (MAC) addressing, error control (detection with CRC, retransmission), flow control, and media access control on shared links. IEEE divides it into the LLC sublayer (flow and error control, interface to network layer) and MAC sublayer (media access, addressing).

Data link control protocols (noiseless/noisy channels):

  • Simplest / Stop-and-Wait: send one frame and wait for an ACK before the next – simple flow control.
  • Stop-and-Wait ARQ: adds sequence numbers (0/1), timers and retransmission of lost/damaged frames.
  • Go-Back-N ARQ: sliding window – sender may send up to N frames; on an error, it resends that frame and all following ones.
  • Selective Repeat ARQ: only the damaged/lost frames are resent; receiver buffers out-of-order frames.

Practical protocols:

  • HDLC: bit-oriented protocol (flag 01111110, bit stuffing) with I-frames, S-frames and U-frames; supports normal response mode and asynchronous balanced mode.
  • PPP: byte-oriented point-to-point protocol with LCP, authentication (PAP/CHAP) and NCPs (IPCP); used in dial-up, DSL (PPPoE).
  • Ethernet (IEEE 802.3): LAN protocol with 48-bit MAC addresses, frame format (preamble, SFD, destination, source, type/length, data 46–1500 bytes, CRC) and CSMA/CD for half-duplex; modern switched full-duplex Ethernet.
  • Wi-Fi (IEEE 802.11): wireless LAN using CSMA/CA with RTS/CTS and acknowledgments.
  • Multiple-access protocols: random access (ALOHA, CSMA, CSMA/CD, CSMA/CA), controlled access (reservation, polling, token passing), channelization (FDMA, TDMA, CDMA).
  • Others: Frame Relay, ATM (WAN), ARP (maps IP to MAC), STP and VLAN tagging (802.1Q) in switched networks.

Q3 – TCP header fields

The TCP header is 20 bytes without options (up to 60 bytes with options):

0                   15 16                  31
+----------------------+----------------------+
|   Source port (16)   | Destination port (16)|
+----------------------+----------------------+
|            Sequence number (32)             |
+---------------------------------------------+
|        Acknowledgment number (32)           |
+------+------+--------+----------------------+
| HLEN | Rsvd | Flags  |   Window size (16)   |
| (4)  | (6)  |  (6)   |                      |
+------+------+--------+----------------------+
|    Checksum (16)     |  Urgent pointer (16) |
+----------------------+----------------------+
|           Options and padding               |
+---------------------------------------------+
  • Source and destination port (16 bits each): identify the sending and receiving application processes.
  • Sequence number (32): number of the first byte of data in this segment; in SYN it carries the initial sequence number (ISN).
  • Acknowledgment number (32): the next byte the receiver expects (valid when ACK = 1) – cumulative acknowledgment.
  • Header length / data offset (4): header length in 4-byte words (5–15 → 20–60 bytes).
  • Reserved (6): for future use.
  • Control flags (6): URG (urgent pointer valid), ACK (acknowledgment valid), PSH (push data immediately), RST (reset connection), SYN (synchronize – connection setup), FIN (finish – connection close). (Newer TCP adds ECE, CWR, NS.)
  • Window size (16): receive window (rwnd) in bytes – flow control.
  • Checksum (16): error detection over pseudo-header, header and data (mandatory in TCP).
  • Urgent pointer (16): offset of the last urgent byte when URG = 1.
  • Options (0–40 bytes): MSS, window scale factor, SACK, timestamps, NOP, end of option list.

Q4 – Link-state vs distance-vector routing

Distance vectorLink state
Each router knows only its neighbours and the distance to each destinationEach router knows the complete topology of the area
Sends its whole routing table to neighbours onlyFloods LSAs about its own links to all routers
Periodic updates (RIP: 30 s)Triggered updates when links change, plus periodic refresh
Bellman–Ford algorithmDijkstra (SPF) algorithm
Slow convergence, count-to-infinity, routing loopsFast convergence, loop-free
Little memory/CPU; simple; small networksMore memory/CPU; complex; large networks with areas
Metric: hop count (RIP)Metric: cost based on bandwidth (OSPF)
Examples: RIP, IGRPExamples: OSPF, IS-IS

Link-state routing in detail (OSPF):

  1. Discover neighbours: each router sends Hello packets on its links to find neighbours and check they are alive.
  2. Measure link cost: each link gets a cost (OSPF: 10⁸/bandwidth).
  3. Build an LSP/LSA: each router creates a link-state packet listing its ID, neighbours and costs, with a sequence number and age.
  4. Flooding: LSAs are sent reliably to every router; each router keeps the newest copy, so all build the same link-state database (topology map).
  5. Shortest path tree: each router runs Dijkstra with itself as root – repeatedly moving the closest tentative node to the permanent tree and updating neighbours’ costs – and builds its routing table from the tree.
  6. Changes: when a link fails, new LSAs are flooded and routers recompute. OSPF uses areas (area 0 backbone), DR/BDR on multi-access networks, and authentication.

Q5(a) – IPv4 vs IPv6

IPv4IPv6
32-bit address (~4.3 billion), dotted decimal 192.168.1.1128-bit address (3.4 × 10³⁸), hexadecimal colon notation 2001:db8::1
Header 20–60 bytes, variable, 12+ fieldsFixed 40-byte base header with 8 fields; extension headers for options
Header checksumNo header checksum (faster processing)
Fragmentation by routers and senderFragmentation only by the source (path MTU discovery)
Broadcast addresses existNo broadcast; uses multicast and anycast
Configured manually or by DHCP; NAT widely usedStateless auto-configuration (SLAAC) or DHCPv6; NAT not needed
IPsec optionalIPsec support built in
ARP for address resolutionNeighbor Discovery Protocol (ICMPv6)
No flow identificationFlow label for QoS

Q5(b) – CSMA/CD vs CSMA/CA

CSMA/CDCSMA/CA
Carrier Sense Multiple Access with Collision DetectionCarrier Sense Multiple Access with Collision Avoidance
Used in wired Ethernet (half-duplex)Used in wireless LANs (IEEE 802.11)
Station transmits when the medium is idle and listens while sending; on collision it stops, sends a jam signal and retries after binary exponential back-offCollisions cannot be detected reliably in wireless, so the station waits DIFS plus a random back-off before sending; optional RTS/CTS reserve the channel; receiver sends ACK
Deals with collisions after they happenTries to prevent collisions before they happen
Minimum frame size needed to detect collisionsUses NAV (network allocation vector), handles hidden terminals with RTS/CTS
Less overhead; efficient on wiresMore overhead (waiting, ACKs)

Q6 – Distributing 190.100.0.0 among three branches

190.100.0.0 is a class B address, so the ISP’s block is 190.100.0.0/16 (65,536 addresses). The question gives no branch sizes, so we assume the main branch gets half the block and the other two branches a quarter each (3 is not a power of 2, so three equal blocks are not possible):

BranchNetwork addressBroadcast addressEffective (usable) rangeAddresses
Main branch190.100.0.0/17190.100.127.255190.100.0.1 – 190.100.127.25432,768
Branch 2190.100.128.0/18190.100.191.255190.100.128.1 – 190.100.191.25416,384
Branch 3190.100.192.0/18190.100.255.255190.100.192.1 – 190.100.255.25416,384

Masks: /17 = 255.255.128.0 and /18 = 255.255.192.0. (If equal blocks are preferred, the ISP can give each branch a /18 – 190.100.0.0/18, 190.100.64.0/18, 190.100.128.0/18 – and keep 190.100.192.0/18 in reserve.)

Answers prepared by Shining Study for revision. Check them against your class notes and teacher’s guidance.

About Saif R

An educator and technology enthusiast passionate about empowering students through quality education and digital learning. Dedicated to making academic resources and opportunities accessible to everyone.