IAP, Past Papers

Internet Architecture and Protocol (IAP) Past Paper 2017 – BSCS 5th Term UOS

Internet Architecture and Protocol Past Paper 2017 BSCS 5th Term UOS

University of Sargodha (UOS) BSCS 5th term Internet Architecture & Protocol (CS-3513) past paper 2017 – clean printable paper, text version and solved answers, including the IP checksum example and the address-block design.

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

University of Sargodha
BS 5th Term Examination 2017

Subject: Computer Science
Paper: Internet Architecture & Protocol (CS: 3513)
Time Allowed: 2:30 Hours
Maximum Marks: 80

Objective Part (Compulsory)

Q.1: Write short answers of the following in 2-3 lines each on your answer sheet. (2*16)
i. How many bits are there in IPv6?
ii. What is the purpose of Address Resolution Protocol?
iii. What is the role of time to live field in IP datagram?
iv. An address space has a total of 512 addresses. How many bits are needed to represent an address?
v. What is the difference between transmission delay and propagation delay?
vi. What is switched WAN?
vii. Why internet architecture is based on tiers?
viii. What is internetworking? Give any example.
ix. What is frame relay?
x. What is a socket address? Give any example.
xi. How congestion is controlled in TCP?
xii. Give two error detection mechanisms.
xiii. What is the difference between Fast Ethernet and Gigabit Ethernet?
xiv. Which address field is changed in packet travelling through a datagram network?
xv. What is a client-server model in networks? Give any example.

Subjective Part (3*16)

Q.2:
a) Explain the Frame format of PPP.
b) What different functions are performed by NCP?

Q.3: Explain the various attributes present in UDP header. Give few applications of UDP.

Q.4:
a) How checksum is calculated in IP? Solve with example.
b) How flow control is performed by various protocols.

Q.5:
a) Differentiate between CSMA/CD and CSMA/CA.
b) Assume a destination computer receives messages from several computers. How can it be sure that the fragments from one source is not mixed with the fragments from another source?

Q.6: An ISP is granted a block of addresses starting with 150.80.0.0/16. The ISP wants to distribute these blocks to 2600 customers as follows:
a. The first group has 200 medium-size businesses; each needs approximately 128 addresses.
b. The second group has 400 small businesses; each needs approximately 16 addresses.
c. The third group has 1900 households; each needs 4 addresses.
Design the sub blocks and give the slash notation for each sub block.

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 2017 BSCS 5th Term UOS – original scan

Solved answers

Q1 – Short questions

(i) An IPv6 address has 128 bits.

(ii) ARP: maps a known IP (logical) address of the next hop to its MAC (physical) address on the local network, using a broadcast ARP request and a unicast ARP reply.

(iii) TTL: limits how long a datagram can travel; each router decreases it by one and discards the packet at zero, preventing endless loops.

(iv) 512 = 2⁹, so 9 bits.

(v) Transmission delay is the time to push all bits of a packet onto the link = packet size / bandwidth. Propagation delay is the time for one bit to travel from sender to receiver = distance / propagation speed.

(vi) Switched WAN: a wide area network built from switches connected by links that carries data between many endpoints using virtual circuits or packet switching, e.g. ATM, Frame Relay, X.25.

(vii) The Internet is organized in tiers (Tier-1 backbone ISPs, Tier-2 regional ISPs, Tier-3/local ISPs and customers) because no single network can reach everyone; the hierarchy makes it scalable, lets ISPs connect through peering and transit agreements, and lets traffic travel efficiently across the world.

(viii) Internetworking: connecting two or more different networks (LANs, WANs) through routers so they work as one larger network, e.g. the Internet, or a company’s branch LANs joined over a WAN.

(ix) Frame Relay: a virtual-circuit WAN technology working at the physical and data-link layers; it carries variable-length frames at higher speed than X.25 with little error control, using DLCIs to identify virtual circuits.

(x) Socket address: IP address + port number, e.g. 172.16.5.10:443.

(xi) TCP congestion control: using a congestion window (cwnd): slow start (cwnd doubles each RTT until ssthresh), congestion avoidance (additive increase by one MSS per RTT), and on loss – timeout resets cwnd to 1 MSS; three duplicate ACKs trigger fast retransmit and fast recovery (cwnd halved). Sending window = min(rwnd, cwnd).

(xii) Checksum and CRC.

(xiii) RIP and OSPF (also BGP, EIGRP).

(xiv) Fast Ethernet (802.3u) runs at 100 Mbps over Cat5 UTP or fiber (100Base-TX, 100Base-FX). Gigabit Ethernet (802.3z/ab) runs at 1000 Mbps (10× faster), over Cat5e/6 UTP or fiber (1000Base-T, 1000Base-SX/LX), mostly full-duplex.

(xv) The source and destination link-layer (MAC) addresses change at each hop.

(xvi) Client–server model: a client process requests a service and a server process (always running) provides it, e.g. a web browser (client) requesting pages from a web server; email clients and mail servers.

Q2

(a) PPP frame format (byte-oriented):

| Flag | Address | Control | Protocol | Payload        | FCS      | Flag |
| 1 B  | 1 B     | 1 B     | 1-2 B    | variable       | 2 or 4 B | 1 B  |
| 7E   | FF      | 03      | e.g.0021 | up to 1500 B   | CRC      | 7E   |
  • Flag (01111110 / 7E): marks the start and end of a frame; byte stuffing with escape 7D is used if 7E appears in data.
  • Address (11111111 / FF): broadcast address – not needed on a point-to-point link, may be omitted by negotiation.
  • Control (00000011 / 03): unnumbered frame (no sequence numbers); can also be omitted.
  • Protocol (1–2 bytes): identifies what the payload carries – user data (IP 0021) or control packets (LCP C021, PAP C023, CHAP C223, IPCP 8021).
  • Payload: data or control information, default maximum 1500 bytes (negotiable MRU).
  • FCS: 2- or 4-byte CRC for error detection.

(b) Functions of NCP (Network Control Protocol): after LCP has opened the link and authentication has succeeded, an NCP configures the link for a particular network-layer protocol. There is a separate NCP for each protocol: IPCP for IPv4, IPv6CP, IPXCP, AppleTalk CP, etc. Functions: negotiate and configure network-layer parameters – assign/negotiate IP addresses, DNS server addresses, header compression (Van Jacobson); enable and disable the network-layer protocol on the link (Configure-Request/Ack/Nak/Reject, Terminate-Request/Ack); allow several network protocols to run over one PPP link at the same time. NCP packets carry no user data – only configuration.

Q3 – UDP header

0              15 16             31
+-----------------+-----------------+
| Source port     | Destination port|
| (16 bits)       | (16 bits)       |
+-----------------+-----------------+
| Total length    | Checksum        |
| (16 bits)       | (16 bits)       |
+-----------------+-----------------+
|              Data                 |
  • Source port number (16 bits): port of the sending process (ephemeral for a client, well-known for a server); optional (0 if unused).
  • Destination port number (16 bits): port of the receiving process, e.g. 53 for DNS.
  • Total length (16 bits): length of header + data in bytes (minimum 8, maximum 65,535).
  • Checksum (16 bits): error detection over a pseudo-header (source/destination IP, protocol 17, UDP length), the header and data; optional in IPv4 (0 = not used), mandatory in IPv6.

The header is a fixed 8 bytes. UDP is connectionless and unreliable: no handshake, no acknowledgments, no flow or congestion control – so it is fast with low overhead.

Applications: DNS (53), DHCP/BOOTP (67/68), TFTP (69), SNMP (161), RIP (520), NTP (123), VoIP and video streaming, online games, multicasting/broadcasting – anything needing speed or simple request–response more than reliability.

Q4

(a) IPv4 header checksum: computed only over the header. Sender: set the checksum field to 0, divide the header into 16-bit words, add them with one’s-complement arithmetic (wrap any carry back into the sum), then take the one’s complement of the result – this is the checksum. Receiver: add all 16-bit words including the checksum; if the complement of the result is 0, the header is accepted, otherwise discarded. Routers recompute it because TTL changes at each hop.

Example (header: version 4, HLEN 5, TOS 0, total length 28, identification 1, flags/offset 0, TTL 4, protocol 17, source 10.12.14.5, destination 12.6.7.9):

4,5,0       ->  4500
28          ->  001C
1           ->  0001
0,0         ->  0000
4,17        ->  0411
checksum    ->  0000
10.12       ->  0A0C
14.5        ->  0E05
12.6        ->  0C06
7.9         ->  0709
               ------
Sum         =   74 4E  (in hex: 4500+001C+0001+0000+0411+0000+0A0C+0E05+0C06+0709 = 744E)
Checksum    = one's complement of 744E = 8BB1

The sender puts 8BB1 in the checksum field. The receiver’s sum is 744E + 8BB1 = FFFF, whose complement is 0000 → no error detected.

(b) Flow control in various protocols: flow control stops a fast sender from overflowing a slow receiver.

  • Data-link layer: Stop-and-Wait (one frame, wait for ACK); sliding-window protocols – Go-Back-N and Selective Repeat – where the sender may have up to a window of unacknowledged frames; HDLC uses RR/RNR (receive ready / not ready) frames; Ethernet full-duplex uses PAUSE frames.
  • Transport layer – TCP: end-to-end, byte-oriented sliding window. The receiver advertises its free buffer space as rwnd in every segment; the sender keeps unacknowledged data ≤ min(rwnd, cwnd). A zero window stops the sender, which sends persist (probe) segments; silly-window-syndrome avoidance (Nagle, Clark) prevents tiny segments.
  • UDP: provides no flow control – the application must handle it.
  • Frame Relay/ATM: use congestion bits (FECN/BECN) and traffic shaping (committed information rate) to slow senders.

Q5

(a) CSMA/CD vs CSMA/CA: CSMA/CD (wired Ethernet) senses the carrier, transmits when idle, keeps listening and, if a collision is detected, stops, sends a jam signal and retries after random binary exponential back-off – it deals with collisions after they occur. CSMA/CA (wireless 802.11) cannot detect collisions, so it tries to avoid them: after the channel is idle it waits DIFS and a random back-off, may reserve the channel with RTS/CTS (NAV), and the receiver confirms every frame with an ACK. CSMA/CD needs a minimum frame size; CSMA/CA has more overhead but handles hidden stations.

(b) Fragments are matched by several header fields together: the source IP address, the identification number (the same for all fragments of one datagram and unique for each datagram from that source), the destination address and the protocol field. The destination reassembles only fragments having the same source address + identification (+ protocol + destination). It then uses the fragmentation offset to put them in order and the M (more fragments) flag to recognise the last fragment, with a reassembly timer to discard incomplete datagrams. So fragments from different sources (or different datagrams) are never mixed.

Q6 – Sub-blocks from 150.80.0.0/16

Group 1: 200 businesses × 128 addresses: 128 = 2⁷ → prefix /25. Total 25,600 addresses.

1st customer   : 150.80.0.0/25    – 150.80.0.127/25
2nd customer   : 150.80.0.128/25  – 150.80.0.255/25
...
200th customer : 150.80.99.128/25 – 150.80.99.255/25
Group 1 total  : 150.80.0.0 – 150.80.99.255

Group 2: 400 businesses × 16 addresses: 16 = 2⁴ → prefix /28. Total 6,400 addresses.

1st customer   : 150.80.100.0/28   – 150.80.100.15/28
2nd customer   : 150.80.100.16/28  – 150.80.100.31/28
...
400th customer : 150.80.124.240/28 – 150.80.124.255/28
Group 2 total  : 150.80.100.0 – 150.80.124.255

Group 3: 2000 households × 4 addresses: 4 = 2² → prefix /30. Total 8,000 addresses.

1st customer    : 150.80.125.0/30  – 150.80.125.3/30
2nd customer    : 150.80.125.4/30  – 150.80.125.7/30
...
2000th customer : 150.80.156.60/30 – 150.80.156.63/30
Group 3 total   : 150.80.125.0 – 150.80.156.63

Allocated = 25,600 + 6,400 + 8,000 = 40,000. Available for future use = 65,536 − 40,000 = 25,536 addresses, starting at 150.80.156.64.

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.