In a class C address for example 192.168.1.1 255.255.255.252, the network portion i.e. 192.168.1 how is it derived.
-> Since you're talking about class, let's start with classful ip addressing. Defined class C as below:-
Class: C
Leading Bits: 110 (leading bits must always 110, example: 11000000.00000000.00000000.00000000 or 192.0.0.0)
Size of Network Number Bit field: 24
Size of Rest Bit field: 8
Number of Networks: 2097152 (2^14 -2)
Hosts per Network: 254 (2^8 -2)
I assume the 192.168 comes from class C, what about the third octet 1 does it have any bearing on how many hosts or subnets there are, if the number is changed to 10 to read 192.168.10.1 what changes can be expected in the number of hosts or octets.
-> In class C, first 24 bits always represent network address. Thus, first 3 octets are reserved for network addresses, leaving last octet for hosts (2^8 -2 = 254 maximum ).
If you use "either one", 192.168.1.0 or 192.168.10.0 or 192.168.x.0, the number of usable hosts always 254. Thus, in this scenario third octet does not have any bearing on number of hosts or subnets. Only the fourth octet.
To subnet, you borrow bit from host bits only, i.e. from the fourth octet. Assuming that you borrow 1 bit, your network bit or netmask now changed from 11111111.11111111.11111111.00000000 to 11111111.11111111.11111111.10000000 or from 255.255.255.0 to 255.255.255.128.
Here:-
Number of subnets are 2^1=2, where 1 is borrowed bit. (Rule is 2^borrowed bit)
Number of usable hosts for each subnet are 2^7 -2=126. (Rule is 2^remaining bit -2)
Increment of network address=128 (Rule is decimal value of last bit borrowed=128)
Subnet Network Address Host Range Broadcast Address
0 192.168.x.0 192.168.x.1-126 192.168.x.127
1 192.168.x.128 192.168.x.129-254 192.168.x.255
If you borrow 2 bits, your netmask is 11111111.11111111.11111111.11000000 or 255.255.255.192
Here:-
Number of subnets are 2^2=4,
Number of usable hosts for each subnet are 2^6 -2=62.
Increment of network address=decimal value of last bit borrowed=64
Subnet Network address Host Range Broadcast Address
0 192.168.x.0 192.168.x.1-62 192.168.x.63
1 192.168.x.64 192.168.x.65-126 192.168.x.127
2 192.168.x.128 192.168.x.129-190 192.168.x.191
3 192.168.x.192 192.168.x.193-254 192.168.x.255
Note:
Some old routers cannot use subnet 0 and the last subnet thus number of subnets=2^borrowed bit -2. You must borrow at least 2 bits for 2 usable subnets.
--------
We can use 192.168.1.0 with netmask 255.255.0.0 or 192.168.1.0/16 but it is no longer classful. First 2 octets (16 bits) are network addresses. To subnet you must borrow from host bits, i.e. in this example from 3rd and fourth octets. Subnetting method is pretty much the same.