-1

I need to decide if the IP address 130.192.0.0 is a host or network address and which class it belongs to (A/B/C).

I've read about the different ranges that the different classes have of IP addresses. Of course if I look at these ranges I can see that it's a Class B IP address.

I'm wondering if there's a way to calculate if it's a host or network address and which class the address belongs to without memorizing these ranges that the classes have?

2
  • 5
    Also classfull addressing is dead for decades, please forget about it.
    – JFL
    Jan 31 '19 at 13:05
  • An IP address is meaningless without a subnet mask.
    – Kyle
    Feb 2 '19 at 15:37
-3

EDIT: Thanks for the comments. Fixed the mistakes.

How to tell which class an IP Address belongs to?

You need to break down the first octet of the IP Address (130) into binary.

  • If the first octet is <128 or 0b0xxxxxxx, the IP Address belongs to Class A. Range = 1 to 126.

  • If the first octet is >128 and <192 or 0b10xxxxxx, the IP Address belongs to Class B. Range = 128 to 191.

  • If the first octet is >192 and <224 or 0b110xxxxx, the IP Address belongs to Class C. Range = 192 to 223.

and so on.

To find out if it's a host or network address - you need the Subnet Mask.

What is a Subnet Mask?

A subnet mask hides, or "masks," the network part of a system's IP address and leaves only the host part as the machine identifier. A common subnet mask for a Class C IP address is 255.255.255.0

Example: The IP Address 130.192.0.0 is a Class B IP Address and Subnet Mask is 255.255.255.0 or /24 (24 1's - 11111111.11111111.11111111.00000000). Find the Block Size and Number of hosts on the network. Also list the Subnet ID and Broadcast Address.

Block Size = 2^(32 - number of 1's in the subnet mask) = 2^8 = 256

Two IP Addresses in a subnet are reserved - Subnet ID and Broadcast Address.

  • The very first IP Address in THIS subnet (130.192.0.0) will be the subnet ID - depends on the Subnet Mask.
  • Generally, the very last IP Address in the subnet (130.192.0.255) is the broadcast address (it can be configured to network admin's preference).

Maximum Number of Hosts in this subnet = 2^(32 - number of 1's in the subnet mask) - 2 = 254

3
  • 2
    This is not correct. Class A (/8) had 0xxxxxxx in the first octet, Class B (/16) 10xxxxxx, Class C (/24) 110xxxxx, Class D (multicast) 1110xxxx, and Class E (reserved) 1111xxxx.
    – Zac67
    Jan 31 '19 at 15:09
  • 1
    See the last section on Classful Network Addressing in this answer for a real explanation of the deprecated classes.
    – Ron Maupin
    Jan 31 '19 at 15:15
  • 3
    "The very first IP Address in the subnet (130.192.0.0) will be the subnet ID." That depends on what the mask is. For example, 130.192.0.0 is the 4,194,304th host address in the 130.128.0.0/9 network, or the 12,582,912nd host in the 130.0.0.0/8 network.
    – Ron Maupin
    Jan 31 '19 at 16:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.