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?

– JFL
Jan 31 '19 at 13:05
– Kyle
Feb 2 '19 at 15:37

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.

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

• 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`.
• "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,304`th host address in the `130.128.0.0/9` network, or the `12,582,912`nd host in the `130.0.0.0/8` network. Jan 31 '19 at 16:01