1.
(2 Marks)
Question:
An ISP is granted a block of addresses starting with 190.100.0.0/16 (65,536
addresses). The ISP needs to distribute these addresses to three groups of
customers as follows:
i) The first group has 64 customers; each needs 256 addresses.
ii) The second group has 128 customers; each needs 128 addresses.
iii) The third group has 128 customers; each needs 64 addresses.
Design the sub-blocks and find out how many addresses are still available after
these allocations.
Answer:
Total addresses = 65,536 (from /16)
Group 1: 64 × 256 = 16,384 addresses
Group 2: 128 × 128 = 16,384 addresses
Group 3: 128 × 64 = 8,192 addresses
Total used = 16,384 + 16,384 + 8,192 = 40,960
Remaining = 65,536 − 40,960 = 24,576 addresses
✅After assigning all groups, 24,576 addresses are still available.
✅2. (1 Mark)
Question:
Find errors, if any, in the following IPv4 addresses:
i) 111.56.045.78
ii) 110101.23.14.69
iii) 75.35.325.12
iv) EF6.23.00011.6
Answer:
i) 045 – ✅Invalid → Octal form, not allowed.
ii) 110101 – ✅Invalid → Greater than 255
iii) 325 – ✅Invalid → Greater than 255
iv) EF6 – ✅Invalid → Hexadecimal, IPv4 uses only decimal
✅All four are invalid IPv4 addresses.
✅3. (1 Mark)
Question:
In an IPv4 datagram, the total-length field is (00A0)₁₆ and the header-length
(HLEN) is (5)₁₆.
How many bytes of payload are in the datagram?
What is the efficiency (payload length ÷ total length)?
Answer:
Total length = 00A0 = 160 bytes
Header length = 5 × 4 = 20 bytes
Payload = 160 − 20 = 140 bytes
Efficiency = 140 ÷ 160 = 0.875 = 87.5%
Payload = 140 bytes, Efficiency = 87.5%
Question:
What is NAT? How can NAT help in address depletion? Explain with a necessary
diagram.
Answer:
NAT (Network Address Translation) allows many devices in a private network to
share one public IP address.
It translates private IPs (e.g., 192.168.x.x) into a public IP when sending data to
the internet.
How NAT helps:
Saves public IPv4 addresses
Allows reuse of private IPs
Adds security (hides internal network)
✅Diagram:
nginx
CopyEdit
Private Devices NAT Router Internet
192.168.0.2 ──┐
192.168.0.3 ──┤──► 100.1.1.1 (Public IP) ──► Google.com
192.168.0.4 ──┘
✅NAT solves IPv4 shortage by using one public IP for many users.
5. (2 Marks)
Question:
Draw the IPv4 datagram format. What do you know about circuit switching and
packet switching?
Answer:
IPv4 Datagram Format (Main Fields):
Version, Header Length
Total Length
Identification, Flags
TTL (Time to Live)
Protocol
Source IP, Destination IP
Data
Circuit Switching:
Fixed path is made before communication starts
Resources are reserved
Example: Telephone call
Less efficient for data
Packet Switching:
Data split into packets
No fixed path, packets may take different routes
Better for internet
More efficient and flexible
Packet switching is used in modern networks.
6. (1 Mark)
Question:
Switch is a ‘self-learning’ device. What does it learn when time progresses? How
does it learn?
Answer:
A switch learns the MAC addresses of devices connected to it.
When a device sends data, the switch records the source MAC and port in its
table.
Over time:
It builds a MAC address table
Sends future data directly to correct device
Reduces unnecessary traffic
This makes switching faster and smarter.
1. What is protocol needed? For n devices in a network, what is the number of
cable links required for a mesh, ring, bus, and star topology?
Answer:
A protocol is a set of rules that devices follow to communicate in a network. It
defines how data is sent, received, and understood.
Without protocols, computers would not understand each other, even if they are
connected.
Examples:
HTTP (used for web)
TCP/IP (used for internet data transfer)
FTP (for file transfer)
Number of cable links needed:
Let’s say n = number of devices
Topology Formula for Links Explanation
Each device is connected to every other
Mesh n(n−1)/2
device
Each device connects to 2 neighbors (in a
Ring n
loop)
1 main cable + n drop
Bus All devices share one backbone cable
lines
Star n All devices connect to a central hub
✅So, the number of links depends on topology type. Mesh uses the most cables,
but is most reliable.
✅2. What is the protocol data unit (PDU) employed at each lower layer?
Answer:
Each layer in the network model uses its own Protocol Data Unit (PDU):
Layer PDU Name
Transport Segment
Network Packet
Layer PDU Name
Data Link Frame
Physical Bits
✅These units help pass data from one layer to the next during communication.
✅3. In Fig. 1, assume the communication is between a process running at
computer A with port q and a process at computer D with port p. Show the
contents of packets and frames at the network, data link, and transport layer for
each hop.
Answer:
There are 2 hops:
Hop 1 = A to R1
Hop 2 = R1 to D
At Transport Layer:
Source Port: q
Destination Port: p
Data is in a Segment
At Network Layer:
Source IP: IP of A
Destination IP: IP of D
Data is in a Packet
At Data Link Layer (changes at each hop):
First hop (A → R1):
Source MAC: A
Destination MAC: R1
Frame = *MAC A → MAC R1+
Second hop (R1 → D):
Source MAC: R1
Destination MAC: D
Frame = *MAC R1 → MAC D+
✅The IPs and ports stay the same across hops, but the MAC addresses (data link
layer) change at every hop.
✅4. How does information get passed from one layer to the next in the Internet
model?
Answer:
In the Internet model (TCP/IP or OSI), each layer passes data to the next using a
process called encapsulation.
Steps:
1. Application layer creates the message (e.g., a web request).
2. The transport layer adds source and destination ports.
3. The network layer adds source and destination IP addresses.
4. The data link layer adds MAC addresses.
5. The physical layer converts it into bits for sending.
At the receiving side, the reverse process happens — called decapsulation.
✅Each layer adds its own header to the data, and the next layer understands it by
reading the header.
✅5. If the data link layer can detect errors between hops, why do you think we
need another checking mechanism at the transport layer?
Answer:
The data link layer only checks for errors between two directly connected
devices (like switch to router).
But data may pass through many devices before reaching its final destination.
Why we still need checking at transport layer:
End-to-end error checking (from source to final receiver)
Ensures all packets are received and in correct order
Resends lost or damaged packets (done by TCP)
So, transport layer provides reliability and full message checking, even if errors
were missed earlier.
✅6. What is the difference between a port address, a logical address, and a
physical address?
Answer:
Type Meaning Example
Identifies a specific process or service on a
Port Address Port 80 = HTTP
computer
Logical IP address; used for device identification
192.168.1.10
Address across networks
Physical MAC address; burned into the network card
00:1A:2B:3C:4D:5E
Address (NIC)
Port: software-level (used by programs)
Logical: used to route data across networks
Physical: used within a local area (LAN)
All three work together to ensure data reaches the correct device and
application.