Thursday, December 31, 2015

RFC 952 The structure of IP address v4

I have required to taken some time to read and understand some of the RFCs and today I read RFC952 and found an interesting fact of IP addressing pattern/method. For full document http://www.ietf.org/rfc/rfc952.txt

I have some experience during the early days when working on projects for factory automation, the project involve quite a number of hardwares from camera, actuator, motion controllers, barcode scanners, IOs, PLCs etc. The newer ones connected to each other with IP address. Not only that, in our home also we connect various devices thru our home routers; they are our computers, phones, tablet, TV, water heaters, aircon, some power point, lights etc.

But until only today I got to understand why our IP addressing pattern sticks to 10.x.x.x, or 172.x.x.x or 192.x.x.x. I believe you have seen these in the IP settings before. After read to a point in the RFC952 document, I realize that they have reason for that.

IP address numbering maximum goes up to 255.255.255.255 only is because each sets was designed to 8 bit binary. When you convert decimal number 255 to binary it will gives you 1111 1111.


3. If the first bit of the first octet of the address is 0 (zero),
then the next 7 bits of the first octet indicate the network number
(Class A Address). If the first two bits are 1,0 (one,zero), then
the next 14 bits define the net number (Class B Address). If the
first 3 bits are 1,1,0 (one,one,zero), then the next 21 bits define
the net number (Class C Address) [See RFC-943]. This is depicted in the following diagram:
 
+-+------------+--------------+--------------+--------------+
|0| NET <-7-> | LOCAL ADDRESS <-24-> |
+-+------------+--------------+--------------+--------------+ +---+----------+--------------+--------------+--------------+
|1 0| NET <-14-> | LOCAL ADDRESS <-16-> |
+---+----------+--------------+--------------+--------------+ +-----+--------+--------------+--------------+--------------+
|1 1 0| NET <-21-> | LOCAL ADDRESS|
+-----+--------+--------------+--------------+--------------+
 
4. The LOCAL ADDRESS portion of the internet address identifies a
host within the network specified by the NET portion of the address.

Class C Address

From the table illustrations and notice that the first 3 bits actually determine how many device you could connect within your network. For example if you setup a local area network in your home or office or for a project, and if your address pattern is 192.x.x.x, which is 110 for the first 3 bits, then you could only connect up to maximum 255 devices within your network. This is because the first 3 sets (Y.Y.Y.x) is your net address, the x could use from 1 up to 255. You could set any number starts with 192 ~ 223 to fulfill 110 for the first 3 bits criteria. 

The first 3 sets 192.1.2.x is your network number/name. If you set one of the device to 192.1.3.x, then this device is consider in other network and they would not see each other.


Class B Address

For this class, the first 2 bit has to be 1 0 to determine a Class B address. So the address range for the first sets started with 127 up to 191. With this pattern of address, it has to configure (Y.Y.x.x). The first 2 sets (Y.Y.) is your network name/number. The x is your node address. With this class, you could connect up to 255x255=16516350 devices. Which I think its a huge one for a local area network.


Class A Address

This is the INTERNET addressing we are using currently.


And now I have a bigger question. When we go to whatsmyip.org, it show 202.x.x.x on my mac, and my phone ip is 123.x.x.x. I still can ping each other and realize that my Mac falls under class C address and my phone falls in Class A address.



  

No comments:

Post a Comment