Past Papers
Past Papers
Que no 5
Answer: Subnetting the Class C Network 172.16.0.0 with Subnet Mask 255.255.255.192
Given:
IP Address (Class C): 172.16.0.0 (Actually, this is Class B, but we will treat it like Class C for subnetting purposes)
Subnet Mask: 255.255.255.192
Step 1: Convert Subnet Mask
255.255.255.192 = /26 in CIDR
So, we're borrowing 2 bits from the host portion.
1) Number of networks:
With 2 borrowed bits:
Number of subnets = 2² = 4 subnets
2) Number of hosts per network:
Number of host bits = 6 (since /26 = 32 - 26 = 6)
Hosts per subnet = 2⁶ - 2 = 62 usable hosts
3) Usable address ranges from the first two networks:
Each subnet increment = 64 (because 256 - 192 = 64)
First subnet (0th):
Network Address: 172.16.0.0
First Usable: 172.16.0.1
Last Usable: 172.16.0.62
Broadcast: 172.16.0.63
Second subnet (1st):
Network Address: 172.16.0.64
First Usable: 172.16.0.65
Last Usable: 172.16.0.126
Broadcast: 172.16.0.127
4) Broadcast addresses for the first two networks:
First subnet: 172.16.0.63
Second subnet: 172.16.0.127
……………………………………………………………………………………………………………………………………………………………………..
Question no 4
a. Describe three-way handshake in TCP connection establishment. Also, TCP opens a connection for Computer
A using an initial sequence number (ISN) of 14,137. The other Computer B opens the connection with an ISN of
18,332. Show the three TCP Segments during the connection establishment.
Three -Way Handshake in TCP Connection Establishment
The three-way handshake is a process used by TCP (Transmission Control Protocol) to establish a reliable
connection between two devices (e.g., Computer A and Computer B). It ensures that both sides are ready to
communicate and synchronize their sequence numbers (ISN) before data transfer begins.
Steps in the Three-Way Handshake
1) SYN (Synchronize) – Computer A → Computer B
Computer A initiates the connection by sending a SYN segment with:
• SYN = 1 (flag set)
• Initial Sequence Number (ISN) = 14,137 (randomly chosen)
2) SYN-ACK (Synchronize-Acknowledge) – Computer B → Computer A
Computer B acknowledges Computer A's SYN and sends its own SYN with:
• SYN = 1, ACK = 1 (flags set)
• ISN = 18,332 (its own initial sequence number)
• Acknowledgment Number (Ack) = 14,138 (Computer A's ISN + 1)
3) ACK (Acknowledge) – Computer A → Computer B
Computer A acknowledges Computer B's SYN by sending:
• ACK = 1 (flag set)
• Sequence Number (Seq) = 14,138 (previous Ack)
• Acknowledgment Number (Ack) = 18,333 (Computer B's ISN + 1)
• Summary of the Three TCP Segments
Step Direction TCP Segment
• After this exchange, the TCP connection is fully established, and data transmission can begin reliably.
Key Points:
• SYN packets are used to initiate and synchronize sequence numbers.
• ACK packets confirm receipt and readiness for communication.
• The Acknowledgment Number is always the received sequence number + 1.
This ensures a reliable and error-checked connection before any actual data is transmitted.
Question no 4
a) The content of a UDP header in hexadecimal format C8B4000D001C001C then what is the total length
of the user datagram and what is the destination port number?
Step-by-Step Breakdown
The header is C8B4 000D 001C 001C, which we split into 2-byte (16-bit) fields:
1. Source Port (Bytes 0-1) → C8B4
2. Destination Port (Bytes 2-3) → 000D
3. Length (Bytes 4-5) → 001C
4. Checksum (Bytes 6-7) → 001C
Final Summary
Connection Dedicated physical path established before No dedicated path; packets take
Type communication. independent routes.
Data Handling Entire data travels as a continuous stream. Data split into packets, sent separately.
Question no 2
b. briefly describe Address Resolution Protocol with diagram and its different cases
Address Resolution Protocol (ARP) is a network protocol used to map an IP address (logical address) to a
MAC address (physical address) in a local area network (LAN). It operates at the Link Layer of the OSI model
and is essential for enabling communication between devices on the same network.
Question no 3
How traffic flow control , error control and congestion control are handled over transport layer, explain with
examples
Purpose:
To prevent the sender from overwhelming the receiver with too much data at once.
How it works:
The sender adjusts its sending rate based on the receiver's ability to process the data.
Example (TCP - Sliding Window Protocol):
• The receiver advertises a window size (e.g., 5 segments).
• The sender can only send 5 segments without waiting for an acknowledgment.
• If the receiver gets busy, it might reduce the window size to 2 or 0, signaling the sender to slow down or
pause.
2. Error Control
Purpose:
To ensure reliable delivery of data by detecting and retransmitting lost or corrupted segments.
How it works:
• Uses checksums to detect errors in each segment.
• Acknowledgments (ACKs) are used to confirm receipt.
• Retransmission occurs if an acknowledgment is not received in time (due to packet loss or corruption).
Example (TCP):
• Sender sends 5 packets.
• Receiver gets packets 1, 2, 4, 5 (packet 3 is lost).
• Receiver sends an ACK for packet 2 and maybe duplicate ACKs for packet 2.
• Sender uses timeout or duplicate ACKs (Fast Retransmit) to detect loss and retransmits packet 3.
3. Congestion Control
Purpose:
To prevent network congestion by controlling the amount of data entering the network.
How it works:
TCP uses algorithms like:
• Slow Start
• Congestion Avoidance
• Fast Retransmit
• Fast Recovery
Example (TCP - Slow Start & Congestion Avoidance):
• Initially, the sender starts with a small congestion window (e.g., 1 segment).
• With each ACK, the window size doubles (exponential growth).
• When a threshold is hit or loss is detected, growth becomes linear or is reduced (to avoid congestion).
Summary Table
o Control Type o Goal o Mechanism o Example (TCP)
Question no 2
What are Transmission Impairments in computer networks. briefly describe each one
Answer:
In computer networks, transmission impairments refer to issues that can distort or degrade the quality
of signals as they travel through a communication medium. There are three main types of transmission
impairments:
1. Attenuation
• Definition: Loss of signal strength as it travels through the medium.
• Cause: Natural resistance in cables or wireless path over distance.
• Effect: The signal becomes weaker and harder to detect.
• Solution: Use amplifiers or repeaters to boost the signal at intervals.
2. Noise
• Definition: Unwanted electrical signals that interfere with the original data signal.
• Types:
o Thermal Noise – Caused by random motion of electrons.
o Induced Noise – From other devices (e.g., motors, fluorescent lights).
o Crosstalk – Interference from adjacent wires.
o Impulse Noise – Spikes caused by external factors (e.g., lightning).
• Effect: Causes errors in data reception.
• Solution: Shielded cables, proper grounding, and error detection techniques.
3. Distortion
• Definition: Signal changes its shape or form as it travels.
• Cause: Different signal components (frequencies) travel at different speeds.
• Effect: Data becomes misaligned or unreadable at the destination.
• Solution: Use equalizers and proper synchronization.
…………………………………………………………………………………………………………………………………………
Question no 3
Define TCP or IP header in detail
192.168.1.1
Each IPv4 address has two parts:
• Network part: Identifies the network.
• Host part: Identifies the specific device on that network.
Benefits:
• No waste of IPs.
• Flexible subnetting.
• Better routing performance.