Content is user-generated and unverified.

CSE 2207 Data Communication Assignment-2

IPv4 Address Classes - Calculation Summary

Introduction to IPv4 Address Classes

IPv4 (Internet Protocol version 4) addresses are 32-bit binary numbers divided into network and host portions. The classful addressing system divides IPv4 addresses into five classes (A, B, C, D, E) based on the first few bits of the address.

Class A Networks

Range Calculation:

  • First octet range: 0-127 (binary: 0xxxxxxx)
  • First bit is always 0
  • Calculation: 2^7 = 128 possible values (0-127)
  • Reserved addresses: 0 (network address) and 127 (loopback)
  • Usable range: 1-126

Network and Host Calculations:

  • Default subnet mask: 255.0.0.0 (/8)
  • Network bits: 8 (first octet)
  • Host bits: 24 (last three octets)
  • Number of networks: 2^7 - 2 = 126 networks
  • Hosts per network: 2^24 - 2 = 16,777,214 hosts

Mathematical Breakdown:

  • Total addresses in Class A: 2^7 × 2^24 = 2^31 = 2,147,483,648
  • Network portion: N.H.H.H (N=Network, H=Host)
  • Example: 10.0.0.0 to 10.255.255.255

Class B Networks

Range Calculation:

  • First octet range: 128-191 (binary: 10xxxxxx)
  • First two bits are always 10
  • Calculation: 128 + (2^6 - 1) = 128 + 63 = 191
  • Usable range: 128-191

Network and Host Calculations:

  • Default subnet mask: 255.255.0.0 (/16)
  • Network bits: 16 (first two octets)
  • Host bits: 16 (last two octets)
  • Number of networks: 2^14 = 16,384 networks
  • Hosts per network: 2^16 - 2 = 65,534 hosts

Mathematical Breakdown:

  • Total addresses in Class B: 2^14 × 2^16 = 2^30 = 1,073,741,824
  • Network portion: N.N.H.H
  • Example: 172.16.0.0 to 172.31.255.255

Class C Networks

Range Calculation:

  • First octet range: 192-223 (binary: 110xxxxx)
  • First three bits are always 110
  • Calculation: 192 + (2^5 - 1) = 192 + 31 = 223
  • Usable range: 192-223

Network and Host Calculations:

  • Default subnet mask: 255.255.255.0 (/24)
  • Network bits: 24 (first three octets)
  • Host bits: 8 (last octet)
  • Number of networks: 2^21 = 2,097,152 networks
  • Hosts per network: 2^8 - 2 = 254 hosts

Mathematical Breakdown:

  • Total addresses in Class C: 2^21 × 2^8 = 2^29 = 536,870,912
  • Network portion: N.N.N.H
  • Example: 192.168.1.0 to 192.168.1.255

Class D Networks (Multicast)

Range Calculation:

  • First octet range: 224-239 (binary: 1110xxxx)
  • First four bits are always 1110
  • Calculation: 224 + (2^4 - 1) = 224 + 15 = 239
  • Range: 224-239

Purpose and Calculations:

  • Used for multicast addressing
  • No subnet mask (not divided into network/host)
  • Total addresses: 2^28 = 268,435,456
  • No host calculation as it's for group communication
  • Example: 224.0.0.1 (All Systems Multicast)

Class E Networks (Experimental)

Range Calculation:

  • First octet range: 240-255 (binary: 1111xxxx)
  • First four bits are always 1111
  • Calculation: 240 + (2^4 - 1) = 240 + 15 = 255
  • Range: 240-255

Purpose and Calculations:

  • Reserved for experimental and future use
  • Not available for general use
  • Total addresses: 2^28 = 268,435,456
  • No practical network/host division

Summary Table of Calculations

ClassFirst OctetBinary PatternNetworksHosts/NetworkSubnet Mask
A1-1260xxxxxxx12616,777,214255.0.0.0
B128-19110xxxxxx16,38465,534255.255.0.0
C192-223110xxxxx2,097,152254255.255.255.0
D224-2391110xxxxMulticastN/AN/A
E240-2551111xxxxReservedN/AN/A

Key Mathematical Formulas

For any class:

  • Number of networks = 2^(network bits) - 2
  • Number of hosts = 2^(host bits) - 2
  • Total addresses = 2^32 = 4,294,967,296

Subnet Calculations:

  • Network address: First address in range
  • Broadcast address: Last address in range
  • Usable addresses: Total - 2 (network and broadcast)

Practical Examples

Class A Example (10.0.0.0/8):

  • Network: 10.0.0.0
  • First host: 10.0.0.1
  • Last host: 10.255.255.254
  • Broadcast: 10.255.255.255

Class B Example (172.16.0.0/16):

  • Network: 172.16.0.0
  • First host: 172.16.0.1
  • Last host: 172.16.255.254
  • Broadcast: 172.16.255.255

Class C Example (192.168.1.0/24):

  • Network: 192.168.1.0
  • First host: 192.168.1.1
  • Last host: 192.168.1.254
  • Broadcast: 192.168.1.255

Limitations of Classful Addressing

  1. Address Wastage: Fixed class sizes don't match actual requirements
  2. Routing Table Size: Large routing tables in internet routers
  3. Inflexibility: Cannot efficiently allocate addresses based on actual needs

Modern Solutions

  • VLSM (Variable Length Subnet Masking): Allows different subnet sizes
  • CIDR (Classless Inter-Domain Routing): Eliminates class boundaries
  • NAT (Network Address Translation): Allows private address reuse
  • IPv6: Provides much larger address space

Note: This assignment requires handwritten submission with appropriate diagrams. Include binary representations, network diagrams, and calculation examples for each class.

Content is user-generated and unverified.
    CSE 2207 IPv4 Address Classes Assignment Answer | Claude