10 Ip Addressing And Subnetting

Network and Data Communications · Unit 10

IP Addressing and Subnetting

Exam-focused notes for IP Addressing and Subnetting (Network and Data Communications, BIT254): what the TU syllabus asks and how it has actually been tested, with 3 solved past questions from this unit.

IP Addressing and Subnetting in short

Every host on the Internet needs an IP address. This chapter covers IPv4, IPv6, subnetting with worked calculations, and how hubs, switches and routers differ.

IP Addressing and Subnetting: notes

IPv4 protocol

IPv4 (Internet Protocol version 4) is the main network layer protocol. It is connectionless and unreliable. It delivers packets on a best-effort basis, and higher layers such as TCP add reliability.

An IPv4 address is 32 bits, written as four decimal numbers called octets, for example 192.168.10.5. The total is $2^{32} = 4{,}294{,}967{,}296$ addresses.

An address has a network part and a host part. Classful addressing:

ClassFirst octetDefault maskUse
A1 to 126255.0.0.0 (/8)Very large networks
B128 to 191255.255.0.0 (/16)Medium networks
C192 to 223255.255.255.0 (/24)Small networks
D224 to 239NoneMulticast
E240 to 255NoneReserved

Modern networks use CIDR, written as address/prefix, for example 10.1.0.0/20. The IPv4 header is 20 bytes or more, with fields such as version, header length, TTL, protocol, source address and destination address.

IPv6 protocol

IPv6 was made because IPv4 addresses are running out. An IPv6 address is 128 bits, written as eight groups of four hex digits:

2001:0db8:0000:0000:0000:ff00:0042:8329

Short form rules: drop leading zeros in a group, and replace one run of all-zero groups with ::. The address above becomes 2001:db8::ff00:42:8329.

Number of addresses: $2^{128} \approx 3.4 \times 10^{38}$.

Features:

  • Very large address space.
  • Fixed 40-byte header, simpler for routers.
  • No broadcast, uses multicast and anycast instead.
  • Built-in support for IPsec and autoconfiguration.
  • No header checksum, and no fragmentation by routers.

What this unit covers

  • IPv4 protocol
  • IPv6 protocol
  • IPv4 vs IPv6 differences
  • Subnetting concept
  • Subnet ID calculation
  • Subnet mask determination
  • Broadcast address calculation
  • Network range identification
  • Subnetting advantages
  • Switch router and hub differentiation

IPv4 vs IPv6 differences

2082 · 5 marks

Write down the major difference between IPv4 and IPv6 protocol. [5]

Note: Reference notes were not available for this topic. The following answer is based on standard networking curriculum covered in BSc CSIT. --- Feature IPv4 IPv6 --------- Address Length 32-bit address 128-bit address Address Notation Dotted decimal notation (e.g., 192.168.1.1) Hexadecimal colo...

Open this answer on its own page →

Subnetting concept

2081 · 10 marks

Divide the network 192.168.2.0/24 into subnets having 48 hosts each.Find the subnet ID, subnet mask, broadcast address and network ranges. What are the advantages of subnetting?[7+3]

Show solved answer

Subnetting 192.168.2.0/24 into Subnets of 48 Hosts Each

Given Data

  • Network: $192.168.2.0/24$
  • Required hosts per subnet: $48$

Step 1: Host Bits Required

Need $2^n - 2 \geq 48$:

$n$$2^n - 2$Sufficient?
530No
662Yes ✓

So host bits = 6.


Step 2: Subnet Mask / New Prefix

  • Total bits = 32, original network bits = 24
  • Borrowed subnet bits = $32 - 24 - 6 = 2$
  • New prefix = $/24 + 2 = /26$

Fourth octet: $11000000_2 = 192$

Subnet Mask = 255.255.255.192 (/26)


Step 3: Number of Subnets and Block Size

  • Subnets = $2^2 = 4$
  • Block size (increment) = $2^6 = 64$
  • Usable hosts per subnet = $2^6 - 2 = 62$ (≥ 48 ✓)

Step 4: Subnet Table

SubnetSubnet IDSubnet MaskFirst HostLast HostBroadcast
1192.168.2.0255.255.255.192192.168.2.1192.168.2.62192.168.2.63
2192.168.2.64255.255.255.192192.168.2.65192.168.2.126192.168.2.127
3192.168.2.128255.255.255.192192.168.2.129192.168.2.190192.168.2.191
4192.168.2.192255.255.255.192192.168.2.193192.168.2.254192.168.2.255

Step 5: Network Ranges

SubnetRange
1192.168.2.0 - 192.168.2.63
2192.168.2.64 - 192.168.2.127
3192.168.2.128 - 192.168.2.191
4192.168.2.192 - 192.168.2.255

Advantages of Subnetting

  1. Efficient IP address utilization - reduces address wastage by sizing blocks appropriately.
  2. Reduced broadcast traffic / smaller broadcast domains - improves performance.
  3. Improved network performance - less congestion within segments.
  4. Enhanced security - inter-subnet traffic passes through routers where access control can be applied.
  5. Easier management and troubleshooting - logical, smaller segments.
  6. Scalability - new subnets added without full redesign.
Open this answer on its own page →

Switch router and hub differentiation

2079 · 5 marks

Differentiate between switch, router, and hub. [5]

Note: Reference notes were not available for this topic; the following answer is based on standard networking concepts as taught in BSc CSIT curriculum. --- Feature Hub Switch Router ------------ OSI Layer Layer 1 (Physical) Layer 2 (Data Link) Layer 3 (Network) Address Used None MAC Address IP A...

Open this answer on its own page →