What is subnetting? Subnetting with networkid, hostid , subnetid ? How to create logical network?

Subnetting allow to create multiple logical network that exist with single IP classes A,B,C,D. with introducing Subnetting IP address were divided into three parts: network id, host id, subnet id, network id is normal one, host part is divided into two part is host id and subnet id, example for class B(but really subnet is classless ip)Also see the topic: IP address Classes IP Address Classes With Network Id And Host Id Class A,B,C,D
This is ordinary example for Class B Example:
172.168.0.1
Network id: 172.168.0.0
Subnet: 255.255.0.0
But in subnet are the classes less IP. So for the following IP It is not for class A, B, C.
172.168.0.1/20->8+8+4=20
Network id: 172.168.0.1
Host id: 0.0.255.255
Subnet mask: 255.255.240.0
If you doubt see the post: how to calculate the subnet mask value

Related post