Extremely confused with subnetting

Network ID is the first address of a subnet.

First IP address that is usable on a host is the very next one in line.

Last is 2 before the next subnet.

It's easier to use a really high mask to understand the concept.

A /30 network leaves two bits for hosting.

Like this.

XXXXXXXX.XXXXXXXX.XXXXXXXX.XXXXXX*YY

Where X is the network and Y is the host portion.

So, with a /30 network how many TOTAL hosts can you have?

well, how many different ways can those last two bits be orientated?

Well that's easy. Since binary is either 1 or 0.

The answer is 4. 00 01 10 11

That's ALL you can do with two bits.

So that's four hosts.

So, The network ID of this is 00, the first usable Addresss to assign to a host is 01, the last usable host is is 10 and the broadcast address is 11.

This four block of numbers is a subnet.

Allowing for more hosts bits also allows for more subnets.

For example, I'll use a real IP address.

192.168.0.0 255.255.255.252 (same as the example subnet up there all the x's = 255s and the two Ys are 252)

So, using the same logic up there

192.168.0.0 = the network ID

192.168.0.1 = the first usable IP address

192..168.0.2 = the 2nd usable IP address