Networking Assignment
Computer Networks — Subnetting, IP, Fragmentation & VLSM
Question 1: Subnets — Advantages and Disadvantages
What is a Subnet?
A subnet (subnetwork) is a logical subdivision of an IP network. Subnetting divides a large
network into smaller, more manageable segments called subnets.
Advantages
• Improved network performance: Reduces broadcast traffic by confining broadcasts to
smaller segments.
• Enhanced security: Isolates network segments, limiting unauthorized access and the
spread of threats.
• Efficient IP address utilization: Allocates IP addresses more precisely to match the
needs of each department or segment.
• Simplified management: Smaller networks are easier to troubleshoot and monitor.
• Scalability: Subnets allow networks to grow modularly without major redesign.
Disadvantages
• Increased complexity: Requires careful planning of IP addressing schemes and subnet
masks.
• Additional hardware: Routers are needed between subnets, adding cost and latency.
• Administrative overhead: Managing multiple subnets can be time-consuming.
• Potential waste: Poorly planned subnets may leave many IP addresses unused.
Question 2: Supernets — Advantages and Disadvantages
What is a Supernet?
Supernetting (route aggregation or CIDR) combines multiple smaller networks into a single
larger network block. It reduces the number of routing table entries by summarizing routes.
Advantages
• Reduced routing tables: Fewer entries lead to faster routing decisions and lower memory
usage on routers.
• Scalability: Simplifies routing as the internet grows.
• Efficient address allocation: CIDR allows blocks of IP addresses to be allocated based
on actual need.
• Reduced router processing: Less work for routers to maintain and advertise routes.
Disadvantages
• Less granular control: Aggregated routes make it harder to apply specific policies to
individual networks.
• Complex configuration: Requires careful planning to ensure supernet boundaries align
correctly.
• Risk of route leakage: Improperly configured supernets can advertise incorrect routes.
Question 3: Fields of the IPv4 Header
The IPv4 header contains the following key fields:
Field Size Description
Version 4 bits IP version number (4 for IPv4)
IHL (Header Length) 4 bits Length of the header in 32-bit words
DSCP / ECN 8 bits Differentiated Services Code Point and Explicit Congestion
Notification
Total Length 16 bits Total size of the packet (header + data) in bytes
Identification 16 bits Unique ID for fragment reassembly
Flags 3 bits Control fragmentation (DF, MF bits)
Fragment Offset 13 bits Position of this fragment in the original datagram
TTL (Time to Live) 8 bits Maximum number of hops before the packet is discarded
Protocol 8 bits Upper-layer protocol (TCP=6, UDP=17, ICMP=1)
Header Checksum 16 bits Error-checking for the header
Source IP Address 32 bits IP address of the sender
Destination IP Address 32 bits IP address of the receiver
Field Size Description
Options Variable Optional settings (rarely used)
Data (Payload) Variable The actual data being transmitted
Question 4: Concept of Fragmentation
Fragmentation is the process of breaking a large IP datagram into smaller pieces (fragments) so
they can be transmitted over a network with a smaller Maximum Transmission Unit (MTU).
How It Works
1. A router receives a packet larger than the outgoing link's MTU.
2. The router divides the packet into fragments, each small enough for the MTU.
3. Each fragment carries the same Identification field as the original packet.
4. The Fragment Offset field records the position of each fragment in the original data.
5. The MF (More Fragments) flag is set on all fragments except the last one.
6. The destination host reassembles all fragments into the original datagram.
Key Fields Used
• Identification: Same value across all fragments of one datagram.
• Flags: MF (More Fragments) bit set to 1 for all except the last fragment.
• Fragment Offset: Specifies the position (in 8-byte units) of the fragment in the original
data.
Question 5: How TTL Works — With Example
TTL (Time to Live) is an 8-bit field in the IPv4 header that limits the lifetime of a packet to
prevent it from circulating endlessly on a network (routing loops).
How It Works
• The sender sets an initial TTL value (commonly 64, 128, or 255).
• Each router that forwards the packet decrements the TTL by 1.
• If the TTL reaches 0, the router discards the packet and sends an ICMP Time Exceeded
message back to the sender.
Example
A packet is sent from Host A with TTL = 3:
Hop Device TTL Value Action
Start Host A (sender) 3 Packet created with TTL=3
Hop 1 Router 1 2 TTL decremented from 3 to 2, packet forwarded
Hop 2 Router 2 1 TTL decremented from 2 to 1, packet forwarded
Hop 3 Router 3 0 TTL reaches 0 — packet DISCARDED, ICMP
Hop Device TTL Value Action
sent to Host A
This mechanism prevents routing loops and orphaned packets consuming network resources
indefinitely.
Question 6: Fragmentation Calculation
Given
• Packet size: 3500 bytes (including 20-byte IP header)
• MTU: 1200 bytes
Step-by-Step Solution
Data payload = 3500 - 20 = 3480 bytes
Maximum data per fragment = 1200 - 20 = 1180 bytes. This must be a multiple of 8.
1180 / 8 = 147.5 => round down to 147 x 8 = 1176 bytes per fragment.
Number of fragments = ceil(3480 / 1176) = ceil(2.959) = 3 fragments
Fragmen Data Total Size Offset
Offset (/8) MF Flag
t Bytes (bytes) (bytes)
1 1176 1176 + 20 = 0 0 1 (more follow)
1196
2 1176 1176 + 20 = 1176 147 1 (more follow)
1196
3 1128 1128 + 20 = 2352 294 0 (last fragment)
1148
Number of fragments created: 3
Size of each fragment: Fragment 1: 1196 bytes | Fragment 2: 1196 bytes | Fragment 3: 1148
bytes
Fragment offset values: Fragment 1: 0 | Fragment 2: 147 | Fragment 3: 294
Question 7: Difference Between IGP and EGP
Aspect IGP (Interior Gateway Protocol) EGP (Exterior Gateway Protocol)
Definition Routes within a single autonomous Routes between different autonomous
system (AS) systems
Scope Intra-domain (internal) Inter-domain (external)
Aspect IGP (Interior Gateway Protocol) EGP (Exterior Gateway Protocol)
Examples RIP, OSPF, EIGRP, IS-IS BGP (Border Gateway Protocol)
Metric Hop count, bandwidth, delay, cost Policy-based (AS path, MED, etc.)
Scalability Designed for smaller internal networks Designed for the global internet
Control Controlled by one organization Controlled by multiple organizations
Speed Generally faster convergence Slower convergence due to complexity
Question 8: Supernet Calculation
Given Networks
• [Link]/24
• [Link]/24
• [Link]/24
• [Link]/24
Solution
Convert to binary to find common prefix:
Network 3rd Octet (Binary)
[Link] 0000 1000
[Link] 0000 1001
[Link] 0000 1010
[Link] 0000 1011
Common bits in the 3rd octet: 000010xx => first 6 bits match.
New prefix = 16 (first two octets) + 6 = /22
Parameter Value
Supernet Address [Link]
New CIDR Prefix /22
Subnet Mask [Link]
Broadcast Address [Link]
Question 9: Actual Data in IPv4 Packet (HLEN=11, Total
Length=0x02BC)
Given
• HLEN = 11
• Total Length = 0x02BC
Solution
Header length = HLEN x 4 = 11 x 4 = 44 bytes
Total length = 0x02BC = (2 x 256) + (11 x 16) + 12 = 512 + 176 + 12 = 700 bytes
Actual data = Total Length - Header Length = 700 - 44 = 656 bytes
Answer: 656 bytes of actual data are being carried.
Question 10: Actual Data in IPv4 Packet (HLEN=13, Total
Length=0x03E8)
Given
• HLEN = 13
• Total Length = 0x03E8
Solution
Header length = HLEN x 4 = 13 x 4 = 52 bytes
Total length = 0x03E8 = (3 x 256) + (14 x 16) + 8 = 768 + 224 + 8 = 1000 bytes
Actual data = Total Length - Header Length = 1000 - 52 = 948 bytes
Answer: 948 bytes of actual data are being carried.
Question 11: VLSM Subnetting for [Link]/18
Given Requirements
Hosts Hosts Needed (with
Department Subnet Size
Required N/W & Broadcast)
Engineering 6000 6002 /19 = 8190 hosts
Operations 3200 3202 /20 = 4094 hosts
Sales 1800 1802 /21 = 2046 hosts
HR 900 902 /22 = 1022 hosts
Admin 400 402 /23 = 510 hosts
IT Support 120 122 /25 = 126 hosts
Guest Network 50 52 /26 = 62 hosts
WAN Link A 2 4 /30 = 2 hosts
Hosts Hosts Needed (with
Department Subnet Size
Required N/W & Broadcast)
WAN Link B 2 4 /30 = 2 hosts
WAN Link C 2 4 /30 = 2 hosts
VLSM Allocation (Starting from [Link]/18, range: [Link] - [Link])
Subnets are allocated from largest to smallest (VLSM best practice):
Prefi
Dept Subnet Mask Range Broadcast
x
Engineerin [Link] /19 [Link] [Link] - [Link] [Link]
g
Operation [Link] /20 [Link] [Link] - [Link]
s [Link]
Sales [Link] /21 [Link] [Link] - [Link]
[Link]
HR [Link] /22 [Link] [Link] - [Link]
[Link]
Admin [Link] /23 [Link] [Link] - [Link]
[Link]
IT Support [Link] /25 [Link] [Link] - [Link]
8 [Link]
Guest [Link] /26 [Link] [Link] - [Link]
Network 8 2 [Link]
WAN Link [Link] /30 [Link] [Link] - [Link]
A 2 2 [Link]
WAN Link [Link] /30 [Link] [Link] - [Link]
B 6 2 [Link]
WAN Link [Link] /30 [Link] [Link] - [Link]
C 0 2 [Link]
All subnets fit within the assigned block [Link]/18 ([Link] - [Link]). VLSM ensures
efficient utilization with minimal address waste.
End of Assignment