Subnetting: engineers hidden secret

Tonight a short guide in the world of subnetting. What is subnetting? Well taken from Wikipedia it’s:

A subnetworks or subnet is a logical subdivision of an IP network.
The practice of dividing a network into two or more networks is called subnetting.

cables.jpg
Patch cables

So it’s like this we have hosts, clients and network stations. Hosts are usually main computers, servers or mainframes. Clients are usually computers from users. Network stations are switches, routers and other network devices. To make things work we connect this devices in to network that we provide information flow. Every device in ethernet environment has IP. We can configure this IP’s in logical network. We have different topologies, but that’s not relevant now.

Binary World

First we have to understand the numbers. In the binary world we have IP address, as Cisco says:

An IP address is an address used in order to uniquely identify a device on an IP network.  The address is made up of 32 binary bits, which can be divisible into a network portion and host portion with the help of a subnet mask.  The 32 binary bits are broken into four octets (1 octet = 8 bits). Each octet is converted to decimal and separated by a period (dot).  For this reason, an IP address is said to be expressed in dotted decimal format (for example, 172.16.81.100).  The value in each octet ranges from 0 to 255 decimal, or 00000000 – 11111111 binary.

Here is how binary octets convert to decimal: The right most bit, or least significant bit, of an octet holds a value of 20. The bit just to the left of that holds a value of 21.  This continues until the left-most bit, or most significant bit, which holds a value of 27. So if all binary bits are a one, the decimal equivalent would be 255 as shown here:

    1  1  1  1 1 1 1 1
  128 64 32 16 8 4 2 1 (128+64+32+16+8+4+2+1=255)

Here is a sample octet conversion when not all of the bits are set to 1.

  0  1 0 0 0 0 0 1
  0 64 0 0 0 0 0 1 (0+64+0+0+0+0+0+1=65)

And this sample shows an IP address represented in both binary and decimal.

        10.       1.      23.      19 (decimal)
  00001010.00000001.00010111.00010011 (binary)

However if this whole IP world is new to you – this is really good and simple article, I’ve searched over many articles online and this explanation is the fastest way to learn subnetting:

https://www.howtogeek.com/133943/geek-school-learning-windows-7-ip-addressing-fundamentals/

Classful Networks:

By the RFC 1918 we have different so-called groups:

The Internet Assigned Numbers Authority (IANA) has reserved the
   following three blocks of the IP address space for private internet:

     10.0.0.0        –   10.255.255.255  (10/8 prefix)
     172.16.0.0      –   172.31.255.255  (172.16/12 prefix)
     192.168.0.0     –   192.168.255.255 (192.168/16 prefix)

This article on Wikipedia, has further explanation on types of class A, class B and class C.

subnetting_1
Classes of IP addresses depends on class of subnet and mask

 

We have different IP’s and so we have different groups. This groups tell us how much numbers we have for specific subnet and it’s clients (devices). There is rule that the first client IP and last is reserved for network configuration.

I’m going just share this example from Cisco, which I used to learn basics of subnetting:

Your task is to determine if these devices are on the same subnet or different subnets. You can use the address and mask of each device in order to determine to which subnet each address belongs.

DeviceA: 172.16.17.30/20
DeviceB: 172.16.28.15/20

Determine the Subnet for DeviceA:

172.16.17.30  –   10101100.00010000.00010001.00011110
255.255.240.0 –   11111111.11111111.11110000.00000000
                  —————–| sub|————
subnet =          10101100.00010000.00010000.00000000 = 172.16.16.0

Looking at the address bits that have a corresponding mask bit set to one, and setting all the other address bits to zero (this is equivalent to performing a logical “AND” between the mask and address), shows you to which subnet this address belongs. In this case, DeviceA belongs to subnet 172.16.16.0.

Determine the Subnet for DeviceB:

172.16.28.15  –   10101100.00010000.00011100.00001111
255.255.240.0 –   11111111.11111111.11110000.00000000
                  —————–| sub|————
subnet =          10101100.00010000.00010000.00000000 = 172.16.16.0

From these determinations, DeviceA and DeviceB have addresses that are part of the same subnet.

They also have this amazing tool Packet Tracer with which you can emulate real network and configure all the Cisco machines.

Take care and configure safely!

Source and know how for this article powered by Cisco and How to Geek:

http://www.cisco.com/c/en/us/support/docs/ip/routing-information-protocol-rip/13788-3.html#figone

https://www.howtogeek.com/133943/geek-school-learning-windows-7-ip-addressing-fundamentals/

 

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s