<?xml version="1.0" encoding="utf-8"?>
<!-- generator="" -->
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<title type="text">IP Protocol</title>
	<subtitle type="text">Leading Network Security &amp; Cyber Security site. Cisco Routing/Switching, VPN, Microsoft, SASE, SSE, F5, PaloAlto Firewalls, Protocol Analysis, Tips &amp; more.</subtitle>
	<link rel="alternate" type="text/html" href="https://www.firewall.cx"/>
	<id>https://www.firewall.cx/networking/network-protocols/ip-protocol.feed</id>
	<updated>2026-04-11T12:39:24+10:00</updated>
	<author>
		<name>Firewall.cx Website</name>
	</author>
	<generator uri="https://www.joomla.org"></generator>
	<link rel="self" type="application/atom+xml" href="https://www.firewall.cx/networking/network-protocols/ip-protocol.feed?type=atom"/>
	<entry>
		<title>IP Protocol - Part 3: IP Classes, Network &amp; Host IDs</title>
		<link rel="alternate" type="text/html" href="https://www.firewall.cx/networking/network-protocols/ip-protocol/protocols-ip-network-id.html"/>
		<published>2011-05-18T05:08:31+10:00</published>
		<updated>2011-05-18T05:08:31+10:00</updated>
		<id>https://www.firewall.cx/networking/network-protocols/ip-protocol/protocols-ip-network-id.html</id>
		<author>
			<name>Administrator</name>
		</author>
		<summary type="html">&lt;p style=&quot;text-align: justify;&quot;&gt;This article explains the '&lt;strong&gt;Network-ID&lt;/strong&gt;' and '&lt;strong&gt;Host-ID&lt;/strong&gt;' concept found in IP addressing and subnetting. We analyse the &lt;strong&gt;structure of IP addresses&lt;/strong&gt; and &lt;strong&gt;network classes&lt;/strong&gt; and show their &lt;strong&gt;Network-IDs&lt;/strong&gt; and &lt;strong&gt;Host-IDs&lt;/strong&gt; in &lt;strong&gt;binary format&lt;/strong&gt; to make evident how the system works.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;To help understand the network class analysis, we show examples of well-known ip address ranges and calculate their valid networks and hosts depending on their class and subnetmask.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The information provided in this article is extremely important for engineers who want to really understand IP addressing and subnetting.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Every protocol suite defines some type of addressing that identifies computers and networks. IP Addresses are no exception to this &quot;rule&quot;. There are certain values that an IP Address can take and these have been defined by the IEEE committee (as most things).&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;A simple IP Address is a lot more than just a number. It tells us the network that the workstation is part of and the node ID. If you don't understand what I am talking about, don't let it worry you too much because we are going to analyse everything here :)&lt;/p&gt;
&lt;h2&gt;IP Address Classes and Structure&lt;/h2&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;When the IEEE committee sat down to sort out the range of numbers that were going to be used by all computers, they came out with 5 different ranges or, as we call them, &quot;Classes&quot; of IP Addresses and when someone applies for IP Addresses they are given a certain range within a specific &quot;Class&quot; depending on the size of their network.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;To keep things as simple as possible, let's first have a look at the 5 different Classes:&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-classes-1.gif&quot; alt=&quot;ip-classes-1&quot; width=&quot;400&quot; height=&quot;184&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;In the above table, you can see the 5 Classes. Our first Class is A and our last is E. The first 3 classes ( A, B and C) are used to identify workstations, routers, switches and other devices whereas the last 2 Classes ( D and E) are reserved for special use.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;As you would already know an IP Address consists of 32 Bits, which means it's 4 bytes long. The first octet (first 8 Bits or first byte) of an IP Address is enough for us to determine the Class to which it belongs. And, depending on the Class to which the IP Address belongs, we can determine which portion of the IP Address is the Network ID and which is the Node ID.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;For example, if I told you that the first octet of an IP Address is &quot;168&quot; then, using the above table, you would notice that it falls within the 128-191 range, which makes it a Class B IP Address.&lt;/p&gt;
&lt;h2 style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Understanding the Classes&lt;/h2&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;We are now going to have a closer look at the 5 Classes. If you remember earlier I mentioned that companies are assigned different IP ranges within these classes, depending on the size of their network. For instance, if a company required 1000 IP Addresses it would probably be assigned a range that falls within a Class B network rather than a Class A or C.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The Class A IP Addresses were designed for large networks, Class B for medium size networks and Class C for smaller networks.&lt;/p&gt;
&lt;h2 style=&quot;text-align: justify;&quot;&gt;Introducing Network ID and Node ID concepts&lt;/h2&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;We need to understand the Network ID and Node ID concept because it will help us to fully understand why Classes exist. Putting it as simply as possible, an IP Address gives us 2 pieces of valuable information:&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;1) It tells us which network the device is part of (Network ID).&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;2) It identifies that unique device within the network (Node ID).&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Think of the Network ID as the suburb you live in and the Node ID your street in that suburb. You can tell exactly where someone is if you have their suburb and street name. In the same way, the Network ID tells us which network a particular computer belongs to and the Node ID identifies that computer from all the rest that reside in the same network.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The picture below gives you a small example to help you understand the concept:&lt;/p&gt;
&lt;p align=&quot;left&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-classes-2.gif&quot; alt=&quot;ip-classes-2&quot; width=&quot;459&quot; height=&quot;369&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p align=&quot;left&quot;&gt;Explanation:&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;In the above picture, you can see a small network. We have assigned a Class C IP Range for this network. Remember that Class C IP Addresses are for small networks. Looking now at Host A, you will see that its IP Address is 192.168.0.2. The Network ID portion of this IP Address is in blue, while the Host ID is in orange.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;I suppose the next question someone would ask is: How do I figure out which portion of the IP Address is the Network ID and which is the Host ID?&amp;nbsp; That's what we are going to answer next.&lt;/p&gt;
&lt;h2 style=&quot;text-align: justify;&quot;&gt;The Network and Node ID of each Class&lt;/h2&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The network Class helps us determine how the 4 byte, or 32 Bit, IP Address is divided between network and node portions.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The table below shows you (in binary) how the Network ID and Node ID changes depending on the Class:&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-classes-3.gif&quot; alt=&quot;ip-classes-3&quot; width=&quot;455&quot; height=&quot;305&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;Explanation:&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The table above might seem confusing at first but it's actually very simple. We will take Class A as an example and analyse it so you can understand exactly what is happening here:&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Any Class A network has a total of 7 bits for the Network ID (bit 8 is always set to 0) and 24 bits for the Host ID. Now all we need to do is calculate how much 7 bits is:&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;2 to the power of 7 = 128 Networks and for the hosts : 2 to the power of 24 = 16,777,216 hosts in each Network, of which 2 cannot be used because one is the &lt;strong&gt;Network Address&lt;/strong&gt; and the other is the &lt;strong&gt;Network Broadcast address&lt;/strong&gt; (see the table towards the end of this page). This is why when we calculate the &quot;valid&quot; hosts in a network we always subtract &quot;2&quot;. So if I asked you how many &quot;valid&quot; hosts can you have a on Class A Network, you should answer &lt;strong&gt;16,777,214&lt;/strong&gt; and &lt;strong&gt;not&lt;/strong&gt; &lt;strong&gt;16,777,216&lt;/strong&gt;.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Below you can see all this in one picture:&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-classes-4.gif&quot; alt=&quot;ip-classes-4&quot; width=&quot;455&quot; height=&quot;305&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;A similar technique applies for the other two Classes we use, that's Class B and Class C, the only difference is that the number of networks and hosts changes because the bits assigned to them are different for each class.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Class B networks&lt;/strong&gt; have 14 bits for the Network ID (Bits 15, 16 are set and can't be changed) and 16 bits for the Host ID, that means you can have up to '2 to the power of 14' = 16,384 Networks and '2 to the power of 16' = 65,536 Hosts in each Network, of which 2 cannot be used because one is the Network Address and the other is the Network Broadcast address (see the table towards the end of this page). So if I asked you how many &quot;valid&quot; hosts can you have a on Class B Network, you should answer 65,534 and NOT 65,536.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-classes-5.gif&quot; alt=&quot;ip-classes-5&quot; width=&quot;455&quot; height=&quot;305&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Class C networks&lt;/strong&gt; have 21 bits for the Network ID (Bits 22, 23, 24 are set and can't be changed) and 8 bits for the Host ID, that means you can have up to '2 to the power of 21' = 2,097,152 Networks and '2 to the power of 8' = 256 Hosts in each Network, of which 2 cannot be used because one is the Network Address and the other is the Network Broadcast address (see the table towards the end of this page). So if I asked you how many &quot;valid&quot; hosts can you have a on Class C Network, you should answer 254 and NOT 256.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Now, even though we have 3 Classes of IP Addresses that we can use, there are some IP Addresses that have been reserved for special use. This doesn't mean you can't assign them to a workstation but in the case that you did, it would create serious problems within your network. For this reason it's best that you avoid using these IP Addresses.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The following table shows the IP Addresses that you should avoid using:&lt;/p&gt;
&lt;table border=&quot;1&quot; style=&quot;width: 90%;&quot; align=&quot;center&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;width: 23%; background-color: #330099;&quot;&gt;
&lt;div align=&quot;center&quot;&gt;&lt;span style=&quot;color: #ffffff;&quot;&gt;&lt;strong&gt;IP Address&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;width: 77%; background-color: #330099;&quot;&gt;
&lt;div align=&quot;center&quot;&gt;&lt;span style=&quot;color: #ffffff;&quot;&gt;&lt;strong&gt;Function&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width: 23%; height: 26px;&quot;&gt;
&lt;div align=&quot;center&quot;&gt;Network 0.0.0.0&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;width: 77%; height: 26px;&quot;&gt;
&lt;div align=&quot;left&quot;&gt;Refers to the default route. This route is to simplify routing tables used by IP.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width: 23%; height: 35px;&quot;&gt;
&lt;div align=&quot;center&quot;&gt;Network 127.0.0.0&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;width: 77%; height: 35px;&quot; align=&quot;center&quot;&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;p align=&quot;left&quot;&gt;Reserved for Loopback. The Address 127.0.0.1 is often used to refer to the local host. Using this Address, applications can address a local host as if it were a remote host.&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center; width: 23%;&quot;&gt;IP Address with all &lt;strong&gt;host&lt;/strong&gt; bits set to &quot;0&quot; (Network Address) e.g 192.168.0.&lt;strong&gt;0&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;width: 77%;&quot;&gt;
&lt;div align=&quot;left&quot;&gt;Refers to the actual network itself. For example, network 192.168.0.0 (Class C) can be used to identify network 192.168.0. This type of notation is often used within routing tables.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center; width: 23%;&quot;&gt;IP Address with all &lt;strong&gt;node bits&lt;/strong&gt; set to &quot;1&quot; (Subnet / Network Broadcast) e.g 192.168.&lt;strong&gt;255&lt;/strong&gt;.&lt;strong&gt;255&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;width: 77%;&quot;&gt;
&lt;div align=&quot;left&quot;&gt;IP Addresses with all &lt;strong&gt;node bits&lt;/strong&gt; set to &quot;1&quot; are local network broadcast addresses and must &lt;strong&gt;NOT&lt;/strong&gt; be used.Some examples: 125.&lt;strong&gt;255.255.255&lt;/strong&gt; (Class A) , 190.30.255.255 (Class B), 203.31.218.255 (Class C). See &quot;&lt;a href=&quot;https://www.firewall.cx/networking/network-fundamentals/network-multicast.html&quot; target=&quot;_blank&quot; title=&quot;Multicasts&quot;&gt;Multicasts&lt;/a&gt;&quot; &amp;amp; &quot;&lt;a href=&quot;https://www.firewall.cx/networking/network-fundamentals/network-broadcast.html&quot; target=&quot;_blank&quot; title=&quot;Network Broadcasts&quot;&gt;Network Broadcasts&lt;/a&gt;&quot; for more info.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center; width: 23%;&quot;&gt;IP Address with &lt;strong&gt;all bits&lt;/strong&gt; set to &quot;1&quot; (Network Broadcast) e.g &lt;strong&gt;255.255.255.255&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;width: 77%;&quot;&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;p&gt;The IP Address with all bits set to &quot;1&quot; is a broadcast address and must &lt;strong&gt;NOT&lt;/strong&gt; be used. These are destined for all nodes on a network, no matter what IP Address they might have.&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Now make sure you keep to the above guidelines because you're going to bump into a lot of problems if you don't !&lt;/p&gt;
&lt;table border=&quot;1&quot; style=&quot;width: 98%; height: 114px;&quot; align=&quot;center&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;div style=&quot;text-align: justify;&quot; align=&quot;center&quot;&gt;&lt;strong&gt;IMPORTANT NOTE:&lt;/strong&gt; It is imperative that every network, regardless of Class and size, has a Network Address (first IP Address e.g 192.168.0.0 for Class C network) and a Broadcast Address (last IP Address e.g 192.168.0.255 for Class C network), as mentioned in the table and explanation diagrams above, which &lt;strong&gt;cannot&lt;/strong&gt; be used.
&lt;p style=&quot;text-align: justify;&quot; align=&quot;center&quot;&gt;So when calculating available IP Addresses in a network, always remember to subtract 2 from the number of IP Addresses within that network.&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Next, is the &lt;a href=&quot;https://www.firewall.cx/networking/network-protocols/subnetting.html&quot; target=&quot;_blank&quot; title=&quot;Subnetting Section&quot;&gt;&lt;strong&gt;Subnetting section&lt;/strong&gt;&lt;/a&gt;, and before you proceed, make sure you're comfortable with the new concepts and material we have covered, otherwise subnetting will be very hard to understand. Alternatively you can visit the &lt;a href=&quot;https://www.firewall.cx/networking/network-protocols/ip-protocol.html&quot; target=&quot;_blank&quot; title=&quot;IP Protocol Section&quot;&gt;IP Protocol section&lt;/a&gt; for more articles covering the Internet Protocol, IP Header analysis and much more.&lt;/p&gt;</summary>
		<content type="html">&lt;p style=&quot;text-align: justify;&quot;&gt;This article explains the '&lt;strong&gt;Network-ID&lt;/strong&gt;' and '&lt;strong&gt;Host-ID&lt;/strong&gt;' concept found in IP addressing and subnetting. We analyse the &lt;strong&gt;structure of IP addresses&lt;/strong&gt; and &lt;strong&gt;network classes&lt;/strong&gt; and show their &lt;strong&gt;Network-IDs&lt;/strong&gt; and &lt;strong&gt;Host-IDs&lt;/strong&gt; in &lt;strong&gt;binary format&lt;/strong&gt; to make evident how the system works.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;To help understand the network class analysis, we show examples of well-known ip address ranges and calculate their valid networks and hosts depending on their class and subnetmask.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The information provided in this article is extremely important for engineers who want to really understand IP addressing and subnetting.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Every protocol suite defines some type of addressing that identifies computers and networks. IP Addresses are no exception to this &quot;rule&quot;. There are certain values that an IP Address can take and these have been defined by the IEEE committee (as most things).&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;A simple IP Address is a lot more than just a number. It tells us the network that the workstation is part of and the node ID. If you don't understand what I am talking about, don't let it worry you too much because we are going to analyse everything here :)&lt;/p&gt;
&lt;h2&gt;IP Address Classes and Structure&lt;/h2&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;When the IEEE committee sat down to sort out the range of numbers that were going to be used by all computers, they came out with 5 different ranges or, as we call them, &quot;Classes&quot; of IP Addresses and when someone applies for IP Addresses they are given a certain range within a specific &quot;Class&quot; depending on the size of their network.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;To keep things as simple as possible, let's first have a look at the 5 different Classes:&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-classes-1.gif&quot; alt=&quot;ip-classes-1&quot; width=&quot;400&quot; height=&quot;184&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;In the above table, you can see the 5 Classes. Our first Class is A and our last is E. The first 3 classes ( A, B and C) are used to identify workstations, routers, switches and other devices whereas the last 2 Classes ( D and E) are reserved for special use.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;As you would already know an IP Address consists of 32 Bits, which means it's 4 bytes long. The first octet (first 8 Bits or first byte) of an IP Address is enough for us to determine the Class to which it belongs. And, depending on the Class to which the IP Address belongs, we can determine which portion of the IP Address is the Network ID and which is the Node ID.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;For example, if I told you that the first octet of an IP Address is &quot;168&quot; then, using the above table, you would notice that it falls within the 128-191 range, which makes it a Class B IP Address.&lt;/p&gt;
&lt;h2 style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Understanding the Classes&lt;/h2&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;We are now going to have a closer look at the 5 Classes. If you remember earlier I mentioned that companies are assigned different IP ranges within these classes, depending on the size of their network. For instance, if a company required 1000 IP Addresses it would probably be assigned a range that falls within a Class B network rather than a Class A or C.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The Class A IP Addresses were designed for large networks, Class B for medium size networks and Class C for smaller networks.&lt;/p&gt;
&lt;h2 style=&quot;text-align: justify;&quot;&gt;Introducing Network ID and Node ID concepts&lt;/h2&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;We need to understand the Network ID and Node ID concept because it will help us to fully understand why Classes exist. Putting it as simply as possible, an IP Address gives us 2 pieces of valuable information:&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;1) It tells us which network the device is part of (Network ID).&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;2) It identifies that unique device within the network (Node ID).&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Think of the Network ID as the suburb you live in and the Node ID your street in that suburb. You can tell exactly where someone is if you have their suburb and street name. In the same way, the Network ID tells us which network a particular computer belongs to and the Node ID identifies that computer from all the rest that reside in the same network.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The picture below gives you a small example to help you understand the concept:&lt;/p&gt;
&lt;p align=&quot;left&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-classes-2.gif&quot; alt=&quot;ip-classes-2&quot; width=&quot;459&quot; height=&quot;369&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p align=&quot;left&quot;&gt;Explanation:&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;In the above picture, you can see a small network. We have assigned a Class C IP Range for this network. Remember that Class C IP Addresses are for small networks. Looking now at Host A, you will see that its IP Address is 192.168.0.2. The Network ID portion of this IP Address is in blue, while the Host ID is in orange.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;I suppose the next question someone would ask is: How do I figure out which portion of the IP Address is the Network ID and which is the Host ID?&amp;nbsp; That's what we are going to answer next.&lt;/p&gt;
&lt;h2 style=&quot;text-align: justify;&quot;&gt;The Network and Node ID of each Class&lt;/h2&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The network Class helps us determine how the 4 byte, or 32 Bit, IP Address is divided between network and node portions.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The table below shows you (in binary) how the Network ID and Node ID changes depending on the Class:&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-classes-3.gif&quot; alt=&quot;ip-classes-3&quot; width=&quot;455&quot; height=&quot;305&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;Explanation:&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The table above might seem confusing at first but it's actually very simple. We will take Class A as an example and analyse it so you can understand exactly what is happening here:&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Any Class A network has a total of 7 bits for the Network ID (bit 8 is always set to 0) and 24 bits for the Host ID. Now all we need to do is calculate how much 7 bits is:&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;2 to the power of 7 = 128 Networks and for the hosts : 2 to the power of 24 = 16,777,216 hosts in each Network, of which 2 cannot be used because one is the &lt;strong&gt;Network Address&lt;/strong&gt; and the other is the &lt;strong&gt;Network Broadcast address&lt;/strong&gt; (see the table towards the end of this page). This is why when we calculate the &quot;valid&quot; hosts in a network we always subtract &quot;2&quot;. So if I asked you how many &quot;valid&quot; hosts can you have a on Class A Network, you should answer &lt;strong&gt;16,777,214&lt;/strong&gt; and &lt;strong&gt;not&lt;/strong&gt; &lt;strong&gt;16,777,216&lt;/strong&gt;.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Below you can see all this in one picture:&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-classes-4.gif&quot; alt=&quot;ip-classes-4&quot; width=&quot;455&quot; height=&quot;305&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;A similar technique applies for the other two Classes we use, that's Class B and Class C, the only difference is that the number of networks and hosts changes because the bits assigned to them are different for each class.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Class B networks&lt;/strong&gt; have 14 bits for the Network ID (Bits 15, 16 are set and can't be changed) and 16 bits for the Host ID, that means you can have up to '2 to the power of 14' = 16,384 Networks and '2 to the power of 16' = 65,536 Hosts in each Network, of which 2 cannot be used because one is the Network Address and the other is the Network Broadcast address (see the table towards the end of this page). So if I asked you how many &quot;valid&quot; hosts can you have a on Class B Network, you should answer 65,534 and NOT 65,536.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-classes-5.gif&quot; alt=&quot;ip-classes-5&quot; width=&quot;455&quot; height=&quot;305&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Class C networks&lt;/strong&gt; have 21 bits for the Network ID (Bits 22, 23, 24 are set and can't be changed) and 8 bits for the Host ID, that means you can have up to '2 to the power of 21' = 2,097,152 Networks and '2 to the power of 8' = 256 Hosts in each Network, of which 2 cannot be used because one is the Network Address and the other is the Network Broadcast address (see the table towards the end of this page). So if I asked you how many &quot;valid&quot; hosts can you have a on Class C Network, you should answer 254 and NOT 256.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Now, even though we have 3 Classes of IP Addresses that we can use, there are some IP Addresses that have been reserved for special use. This doesn't mean you can't assign them to a workstation but in the case that you did, it would create serious problems within your network. For this reason it's best that you avoid using these IP Addresses.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The following table shows the IP Addresses that you should avoid using:&lt;/p&gt;
&lt;table border=&quot;1&quot; style=&quot;width: 90%;&quot; align=&quot;center&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style=&quot;width: 23%; background-color: #330099;&quot;&gt;
&lt;div align=&quot;center&quot;&gt;&lt;span style=&quot;color: #ffffff;&quot;&gt;&lt;strong&gt;IP Address&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;width: 77%; background-color: #330099;&quot;&gt;
&lt;div align=&quot;center&quot;&gt;&lt;span style=&quot;color: #ffffff;&quot;&gt;&lt;strong&gt;Function&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width: 23%; height: 26px;&quot;&gt;
&lt;div align=&quot;center&quot;&gt;Network 0.0.0.0&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;width: 77%; height: 26px;&quot;&gt;
&lt;div align=&quot;left&quot;&gt;Refers to the default route. This route is to simplify routing tables used by IP.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;width: 23%; height: 35px;&quot;&gt;
&lt;div align=&quot;center&quot;&gt;Network 127.0.0.0&lt;/div&gt;
&lt;/td&gt;
&lt;td style=&quot;width: 77%; height: 35px;&quot; align=&quot;center&quot;&gt;
&lt;div align=&quot;center&quot;&gt;
&lt;p align=&quot;left&quot;&gt;Reserved for Loopback. The Address 127.0.0.1 is often used to refer to the local host. Using this Address, applications can address a local host as if it were a remote host.&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center; width: 23%;&quot;&gt;IP Address with all &lt;strong&gt;host&lt;/strong&gt; bits set to &quot;0&quot; (Network Address) e.g 192.168.0.&lt;strong&gt;0&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;width: 77%;&quot;&gt;
&lt;div align=&quot;left&quot;&gt;Refers to the actual network itself. For example, network 192.168.0.0 (Class C) can be used to identify network 192.168.0. This type of notation is often used within routing tables.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center; width: 23%;&quot;&gt;IP Address with all &lt;strong&gt;node bits&lt;/strong&gt; set to &quot;1&quot; (Subnet / Network Broadcast) e.g 192.168.&lt;strong&gt;255&lt;/strong&gt;.&lt;strong&gt;255&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;width: 77%;&quot;&gt;
&lt;div align=&quot;left&quot;&gt;IP Addresses with all &lt;strong&gt;node bits&lt;/strong&gt; set to &quot;1&quot; are local network broadcast addresses and must &lt;strong&gt;NOT&lt;/strong&gt; be used.Some examples: 125.&lt;strong&gt;255.255.255&lt;/strong&gt; (Class A) , 190.30.255.255 (Class B), 203.31.218.255 (Class C). See &quot;&lt;a href=&quot;https://www.firewall.cx/networking/network-fundamentals/network-multicast.html&quot; target=&quot;_blank&quot; title=&quot;Multicasts&quot;&gt;Multicasts&lt;/a&gt;&quot; &amp;amp; &quot;&lt;a href=&quot;https://www.firewall.cx/networking/network-fundamentals/network-broadcast.html&quot; target=&quot;_blank&quot; title=&quot;Network Broadcasts&quot;&gt;Network Broadcasts&lt;/a&gt;&quot; for more info.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style=&quot;text-align: center; width: 23%;&quot;&gt;IP Address with &lt;strong&gt;all bits&lt;/strong&gt; set to &quot;1&quot; (Network Broadcast) e.g &lt;strong&gt;255.255.255.255&lt;/strong&gt;&lt;/td&gt;
&lt;td style=&quot;width: 77%;&quot;&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;p&gt;The IP Address with all bits set to &quot;1&quot; is a broadcast address and must &lt;strong&gt;NOT&lt;/strong&gt; be used. These are destined for all nodes on a network, no matter what IP Address they might have.&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Now make sure you keep to the above guidelines because you're going to bump into a lot of problems if you don't !&lt;/p&gt;
&lt;table border=&quot;1&quot; style=&quot;width: 98%; height: 114px;&quot; align=&quot;center&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;div style=&quot;text-align: justify;&quot; align=&quot;center&quot;&gt;&lt;strong&gt;IMPORTANT NOTE:&lt;/strong&gt; It is imperative that every network, regardless of Class and size, has a Network Address (first IP Address e.g 192.168.0.0 for Class C network) and a Broadcast Address (last IP Address e.g 192.168.0.255 for Class C network), as mentioned in the table and explanation diagrams above, which &lt;strong&gt;cannot&lt;/strong&gt; be used.
&lt;p style=&quot;text-align: justify;&quot; align=&quot;center&quot;&gt;So when calculating available IP Addresses in a network, always remember to subtract 2 from the number of IP Addresses within that network.&lt;/p&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Next, is the &lt;a href=&quot;https://www.firewall.cx/networking/network-protocols/subnetting.html&quot; target=&quot;_blank&quot; title=&quot;Subnetting Section&quot;&gt;&lt;strong&gt;Subnetting section&lt;/strong&gt;&lt;/a&gt;, and before you proceed, make sure you're comfortable with the new concepts and material we have covered, otherwise subnetting will be very hard to understand. Alternatively you can visit the &lt;a href=&quot;https://www.firewall.cx/networking/network-protocols/ip-protocol.html&quot; target=&quot;_blank&quot; title=&quot;IP Protocol Section&quot;&gt;IP Protocol section&lt;/a&gt; for more articles covering the Internet Protocol, IP Header analysis and much more.&lt;/p&gt;</content>
		<category term="IP Protocol" />
	</entry>
	<entry>
		<title>IP Protocol - Part 2: The Internet Protocol (IP) Header</title>
		<link rel="alternate" type="text/html" href="https://www.firewall.cx/networking/network-protocols/ip-protocol/protocols-ip-header.html"/>
		<published>2011-05-18T04:40:39+10:00</published>
		<updated>2011-05-18T04:40:39+10:00</updated>
		<id>https://www.firewall.cx/networking/network-protocols/ip-protocol/protocols-ip-header.html</id>
		<author>
			<name>Administrator</name>
		</author>
		<summary type="html">&lt;p&gt;This article examines the Internet Protocol (IP) and its position within the OSI Model. We take a look at the IP Header and all fields contained within an Ethernet frame. Further examination of the IP header is covered in the next pages that follow.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Just like every other protocol, the Internet Protocol has a place in the OSI Model. Because it's such an important protocol and other protocols depend upon it, it needs to be placed before them, which is why you will find it in Layer 3 of the OSI model:&lt;/p&gt;
&lt;p align=&quot;left&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-header-1.gif&quot; alt=&quot;ip-header-1&quot; width=&quot;382&quot; height=&quot;328&quot; style=&quot;margin: 5px; float: left;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;When a computer receives a packet from the network, the computer will firstly check the destination MAC address of the packet at the Datalink layer (2) and if it passes, it's then passed on to the Network layer&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;At the Network layer it will check the packet to see if the destination IP Address matches with the computer's IP Address (if the packet is a broadcast, it will pass the network layer anyway).&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;From there, the packet is processed as required by the upper layers.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;On the other hand, if the computer is generating a packet to send to the network then, as the packet travels down the OSI model and reaches the Network layer, the destination and source IP Address of this packet are added in the IP Header.&lt;/p&gt;
&lt;h2 align=&quot;left&quot;&gt;The IP Header&lt;/h2&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Now we are going to analyse the Internet Protocol header, so you can see the fields it has and where they are placed. In here you will find the destination and source IP Address field which is essential to every packet using the protocol.&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-header-2.gif&quot; alt=&quot;ip-header-2&quot; width=&quot;532&quot; height=&quot;283&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-header-3.gif&quot; alt=&quot;ip-header-3&quot; width=&quot;276&quot; height=&quot;450&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;It's worth noting that the 9th field, which is the &quot;Protocol&quot; field, contains some important information that the computer uses to find out where it must pass the datagram once it strips off the IP header.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;If you remember, TCP and UDP exist on layer 4 of the OSI Model, which is the transport layer. When data arrives at a computer and the packet is processed by each layer, it needs to know whereabouts above to pass the data. This protocol field tells the computer to give the remaining data to either the TCP or UDP protocol, which is directly above it.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Also, the Destination IP Address is another important field which contains the IP Address of the destination machine.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The next section talks about the 5 different classes of IP Address.&lt;/p&gt;
&lt;p align=&quot;right&quot;&gt;Next -&lt;a href=&quot;https://www.firewall.cx/networking/network-protocols/ip-protocol/protocols-ip-network-id.html&quot; title=&quot;IP Protocol - Part 3: Internet Protocol Classes - Network &amp;amp; Host ID&quot;&gt;IP Protocol - Part 3: IP Classes, Network &amp;amp; Host ID&lt;/a&gt;&lt;/p&gt;</summary>
		<content type="html">&lt;p&gt;This article examines the Internet Protocol (IP) and its position within the OSI Model. We take a look at the IP Header and all fields contained within an Ethernet frame. Further examination of the IP header is covered in the next pages that follow.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Just like every other protocol, the Internet Protocol has a place in the OSI Model. Because it's such an important protocol and other protocols depend upon it, it needs to be placed before them, which is why you will find it in Layer 3 of the OSI model:&lt;/p&gt;
&lt;p align=&quot;left&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-header-1.gif&quot; alt=&quot;ip-header-1&quot; width=&quot;382&quot; height=&quot;328&quot; style=&quot;margin: 5px; float: left;&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;When a computer receives a packet from the network, the computer will firstly check the destination MAC address of the packet at the Datalink layer (2) and if it passes, it's then passed on to the Network layer&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;At the Network layer it will check the packet to see if the destination IP Address matches with the computer's IP Address (if the packet is a broadcast, it will pass the network layer anyway).&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;From there, the packet is processed as required by the upper layers.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;On the other hand, if the computer is generating a packet to send to the network then, as the packet travels down the OSI model and reaches the Network layer, the destination and source IP Address of this packet are added in the IP Header.&lt;/p&gt;
&lt;h2 align=&quot;left&quot;&gt;The IP Header&lt;/h2&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Now we are going to analyse the Internet Protocol header, so you can see the fields it has and where they are placed. In here you will find the destination and source IP Address field which is essential to every packet using the protocol.&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-header-2.gif&quot; alt=&quot;ip-header-2&quot; width=&quot;532&quot; height=&quot;283&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-header-3.gif&quot; alt=&quot;ip-header-3&quot; width=&quot;276&quot; height=&quot;450&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;It's worth noting that the 9th field, which is the &quot;Protocol&quot; field, contains some important information that the computer uses to find out where it must pass the datagram once it strips off the IP header.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;If you remember, TCP and UDP exist on layer 4 of the OSI Model, which is the transport layer. When data arrives at a computer and the packet is processed by each layer, it needs to know whereabouts above to pass the data. This protocol field tells the computer to give the remaining data to either the TCP or UDP protocol, which is directly above it.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Also, the Destination IP Address is another important field which contains the IP Address of the destination machine.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The next section talks about the 5 different classes of IP Address.&lt;/p&gt;
&lt;p align=&quot;right&quot;&gt;Next -&lt;a href=&quot;https://www.firewall.cx/networking/network-protocols/ip-protocol/protocols-ip-network-id.html&quot; title=&quot;IP Protocol - Part 3: Internet Protocol Classes - Network &amp;amp; Host ID&quot;&gt;IP Protocol - Part 3: IP Classes, Network &amp;amp; Host ID&lt;/a&gt;&lt;/p&gt;</content>
		<category term="IP Protocol" />
	</entry>
	<entry>
		<title>IP Protocol - Part 1: Binary &amp; The Internet Protocol</title>
		<link rel="alternate" type="text/html" href="https://www.firewall.cx/networking/network-protocols/ip-protocol/protocols-ip-binary.html"/>
		<published>2011-05-18T03:53:19+10:00</published>
		<updated>2011-05-18T03:53:19+10:00</updated>
		<id>https://www.firewall.cx/networking/network-protocols/ip-protocol/protocols-ip-binary.html</id>
		<author>
			<name>Administrator</name>
		</author>
		<summary type="html">&lt;p&gt;To understand the &lt;strong&gt;Internet Protocol&lt;/strong&gt;, we need to learn and understand &lt;strong&gt;Binary&lt;/strong&gt;. It is very important to know and understand Binary because part of the &lt;strong&gt;IP protocol&lt;/strong&gt; is also the &quot;&lt;strong&gt;Subnetting&lt;/strong&gt;&quot; section which can only be explained and understood when an &lt;strong&gt;IP Address&lt;/strong&gt; is converted to Binary!&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;This article deals with the &lt;strong&gt;analysis of IP addresses&lt;/strong&gt; and covers the &lt;strong&gt;conversion of IP address to binary&lt;/strong&gt;. We explain the conversion process with much detail using our well known &lt;strong&gt;diagrams&lt;/strong&gt;. At the end of the article, readers will be able to understand and explain &lt;strong&gt;how IP address to binary conversion&lt;/strong&gt; is performed and also &lt;strong&gt;calculate&lt;/strong&gt; quickly the &lt;strong&gt;32bit addressing scheme&lt;/strong&gt;.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Those who are experienced in Binary can skim this section quickly, but do have a look through.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;A lot of people are not aware that computers do not understand words, pictures and sounds, when we interact with them by playing a game, reading or drawing something on the screen. The truth is that all computers can understand is zeros (0) and ones (1) !&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;What we see on the screen is just an interpretation of what the computer understands, so the information displayed is useful and meaningful to us.&lt;span style=&quot;color: #ffff00;&quot;&gt;&lt;strong&gt;&amp;nbsp; &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Binary: Bits and Bytes&lt;/h2&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Everyone who uses the Internet would have, at one stage or another, come across the &quot;Byte&quot; or &quot;Bit&quot; term, usually when you're downloading, you get the speed indication in bytes or KBytes per second. We are going to see exactly what a Bit, Byte and KByte is, so you understand the terms.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;To put it as simply as possible, a Bit is the smallest unit/value of Binary notation. The same way we say 1 cent is the smallest amount of money you can have , a Bit is the same thing but not in cents or dollars, but in Binary.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;A Bit can have only one value, either a one (1) or a zero (0). So If I gave you a value of zero: 0, then you would say that is one Bit. If I gave you two of them: 00, you would say that's two Bits.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Now, if you had 8 zeros or ones together: 0110 1010 (I put a space in between to make it easier for the eyes) you would say that's 8 Bits or, one Byte ! Yes that is correct, 8 Bits are equal to one Byte.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The picture below gives you some examples:&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-binary-1.gif&quot; alt=&quot;ip-binary-1&quot; width=&quot;393&quot; height=&quot;244&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;It's like saying, if you have 100 cents, that is equal to one Dollar. In the same way, 8 Bits (doesn't matter if they are all 1s or 0s or a mixture of the two) would equal one Byte.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;And to sum this all up, 1024 Bytes equal 1 KByte (Kilobyte). Why 1024 and not 1000 ? Well it's because of the way Binary works. If you did the maths, you would find the above correct.&lt;/p&gt;
&lt;h2 style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;So what's Binary got to do with IP?&lt;/h2&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;As explained during the introduction, computers display the zeros and ones in a way that makes the information useful to us. The Internet Protocol works a bit like this as well, where 98% of the time we see it in a decimal notation, but the computer understands it in binary. The picture below gives you an example of how a computer understands an IP Address:&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-binary-2.gif&quot; alt=&quot;ip-binary-2&quot; width=&quot;434&quot; height=&quot;128&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The above example shows an IP address in decimal notation, which we understand more easily, this IP Address - 192.168.0.1 is then converted to Binary, which is what the computer understands and you can see how big the number gets ! It's easier for us to remember 4 different numbers than 32 zeros or ones !&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Now, keeping in mind what we said earlier about Bits and Bytes, have you ever heard or read people saying that an IP Address is a 32 Bit address ? It is, and you can now see why:&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-binary-3.gif&quot; alt=&quot;ip-binary-3&quot; width=&quot;411&quot; height=&quot;184&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;So to sum up all the above, we now know what Binary notation is, what a Bit, Byte and KByte is and how Binary relates to an IP Address which is usally represented in its Decimal notation.&lt;/p&gt;
&lt;h2 style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Understanding the conversion between Decimal and Binary&lt;/h2&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;Now we're going to look at how the conversion works between Decimal and Binary. This is an important step, because you'll probably find yourself in need of such a conversion when dealing with complex subnets.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;The conversion is not that hard once you grasp the concept. The picture below shows an IP Address that we are going to convert to Binary. Keep in mind that the method I'm going to show you is the same for all conversions.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;We are now going to convert the first octet in the IP Address 192.168.0.1 (Decimal) to Binary, in other words, we take the &quot;192&quot; and convert it to Binary and we are not going to have to do any difficult calculations, just simple additions:&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-binary-4.gif&quot; alt=&quot;ip-binary-4&quot; width=&quot;411&quot; height=&quot;184&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;If you have read and understood the first section of this page, you should know that we need 8 bits to create one octet or, if you like, the 192 number. Each bit takes a certain value which never changes, this value is shown in purple, right above the bit, we then select the bits we need in such a way that the sum of all selected bits gives us the decimal number we need.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;If you wanted to explain the conversion in mathematical terms, you would say that each bit is a power of 2 (2^), for example, bit 8 is actually '2^7' = 128 in decimal, bit 7 is '2^6 = 64 in decimal, bit 6 is '2^5' = 32 in decimal, bit 5 is '2^4' = 16 in decimal, bit 4 is '2^3' = 8 in decimal, bit 3 is '2^2' = 4 in decimal, bit 2 is '2^1' = 2 in decimal, bit 1 is '2^0' = 1 in decimal.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;Note: When calculating the decimal value of an octet (192 in the example above), the Bit numbers do NOT represent the power of two value we must use in order to get the decimal value. This means that Bit 1 does NOT translate to 2^1=1 in decimal.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;In our example, we used the 192. As you saw, we needed bits 8 and 7 and this gave us the Binary number of 11000000 which is 192 in Decimal. You must remember that the values of each bit never change! For example, bit 8 always has a decimal value of 128, whereas bit 1 always takes the value of 1. Using this method, you will find it easy to convert Decimal to Binary without the need for complex mathematical calculations.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;So let's have a look at the next octet, which is the decimal number 168:&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-binary-5.gif&quot; alt=&quot;ip-binary-5&quot; width=&quot;411&quot; height=&quot;184&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Here again you can see that we needed to choose bits 8, 6 and 4 (in other words put a &quot;1&quot; in the bit's position) in order to get a decimal value of 168. So the Binary value of 10101000 is equal to the decimal value of 168.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Let's now look at all 4 octets of our IP Address, in Binary:&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-binary-6.gif&quot; alt=&quot;ip-binary-6&quot; width=&quot;397&quot; height=&quot;340&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;No matter which way you convert, from Decimal to Binary or Binary to Decimal, the same method is used so you if you understood the above you should be able to convert either way any Binary or Decimal number.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;That just about does it for this section, you're now ready for the next section that focuses on the Internet Protocol header.&lt;/p&gt;
&lt;p style=&quot;text-align: right;&quot; align=&quot;right&quot;&gt;Next -&lt;a href=&quot;https://www.firewall.cx/networking/network-protocols/ip-protocol/protocols-ip-header.html&quot; title=&quot;IP Protocol - Part 2: The Internet Protocol Header&quot;&gt;IP Protocol - Part 2: The Internet Protocol Header&lt;/a&gt;&lt;/p&gt;</summary>
		<content type="html">&lt;p&gt;To understand the &lt;strong&gt;Internet Protocol&lt;/strong&gt;, we need to learn and understand &lt;strong&gt;Binary&lt;/strong&gt;. It is very important to know and understand Binary because part of the &lt;strong&gt;IP protocol&lt;/strong&gt; is also the &quot;&lt;strong&gt;Subnetting&lt;/strong&gt;&quot; section which can only be explained and understood when an &lt;strong&gt;IP Address&lt;/strong&gt; is converted to Binary!&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;This article deals with the &lt;strong&gt;analysis of IP addresses&lt;/strong&gt; and covers the &lt;strong&gt;conversion of IP address to binary&lt;/strong&gt;. We explain the conversion process with much detail using our well known &lt;strong&gt;diagrams&lt;/strong&gt;. At the end of the article, readers will be able to understand and explain &lt;strong&gt;how IP address to binary conversion&lt;/strong&gt; is performed and also &lt;strong&gt;calculate&lt;/strong&gt; quickly the &lt;strong&gt;32bit addressing scheme&lt;/strong&gt;.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Those who are experienced in Binary can skim this section quickly, but do have a look through.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;A lot of people are not aware that computers do not understand words, pictures and sounds, when we interact with them by playing a game, reading or drawing something on the screen. The truth is that all computers can understand is zeros (0) and ones (1) !&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;What we see on the screen is just an interpretation of what the computer understands, so the information displayed is useful and meaningful to us.&lt;span style=&quot;color: #ffff00;&quot;&gt;&lt;strong&gt;&amp;nbsp; &lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;h2 style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Binary: Bits and Bytes&lt;/h2&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Everyone who uses the Internet would have, at one stage or another, come across the &quot;Byte&quot; or &quot;Bit&quot; term, usually when you're downloading, you get the speed indication in bytes or KBytes per second. We are going to see exactly what a Bit, Byte and KByte is, so you understand the terms.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;To put it as simply as possible, a Bit is the smallest unit/value of Binary notation. The same way we say 1 cent is the smallest amount of money you can have , a Bit is the same thing but not in cents or dollars, but in Binary.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;A Bit can have only one value, either a one (1) or a zero (0). So If I gave you a value of zero: 0, then you would say that is one Bit. If I gave you two of them: 00, you would say that's two Bits.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Now, if you had 8 zeros or ones together: 0110 1010 (I put a space in between to make it easier for the eyes) you would say that's 8 Bits or, one Byte ! Yes that is correct, 8 Bits are equal to one Byte.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The picture below gives you some examples:&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-binary-1.gif&quot; alt=&quot;ip-binary-1&quot; width=&quot;393&quot; height=&quot;244&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;It's like saying, if you have 100 cents, that is equal to one Dollar. In the same way, 8 Bits (doesn't matter if they are all 1s or 0s or a mixture of the two) would equal one Byte.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;And to sum this all up, 1024 Bytes equal 1 KByte (Kilobyte). Why 1024 and not 1000 ? Well it's because of the way Binary works. If you did the maths, you would find the above correct.&lt;/p&gt;
&lt;h2 style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;So what's Binary got to do with IP?&lt;/h2&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;As explained during the introduction, computers display the zeros and ones in a way that makes the information useful to us. The Internet Protocol works a bit like this as well, where 98% of the time we see it in a decimal notation, but the computer understands it in binary. The picture below gives you an example of how a computer understands an IP Address:&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-binary-2.gif&quot; alt=&quot;ip-binary-2&quot; width=&quot;434&quot; height=&quot;128&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;The above example shows an IP address in decimal notation, which we understand more easily, this IP Address - 192.168.0.1 is then converted to Binary, which is what the computer understands and you can see how big the number gets ! It's easier for us to remember 4 different numbers than 32 zeros or ones !&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Now, keeping in mind what we said earlier about Bits and Bytes, have you ever heard or read people saying that an IP Address is a 32 Bit address ? It is, and you can now see why:&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-binary-3.gif&quot; alt=&quot;ip-binary-3&quot; width=&quot;411&quot; height=&quot;184&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;So to sum up all the above, we now know what Binary notation is, what a Bit, Byte and KByte is and how Binary relates to an IP Address which is usally represented in its Decimal notation.&lt;/p&gt;
&lt;h2 style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Understanding the conversion between Decimal and Binary&lt;/h2&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;Now we're going to look at how the conversion works between Decimal and Binary. This is an important step, because you'll probably find yourself in need of such a conversion when dealing with complex subnets.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;The conversion is not that hard once you grasp the concept. The picture below shows an IP Address that we are going to convert to Binary. Keep in mind that the method I'm going to show you is the same for all conversions.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;We are now going to convert the first octet in the IP Address 192.168.0.1 (Decimal) to Binary, in other words, we take the &quot;192&quot; and convert it to Binary and we are not going to have to do any difficult calculations, just simple additions:&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-binary-4.gif&quot; alt=&quot;ip-binary-4&quot; width=&quot;411&quot; height=&quot;184&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;If you have read and understood the first section of this page, you should know that we need 8 bits to create one octet or, if you like, the 192 number. Each bit takes a certain value which never changes, this value is shown in purple, right above the bit, we then select the bits we need in such a way that the sum of all selected bits gives us the decimal number we need.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;If you wanted to explain the conversion in mathematical terms, you would say that each bit is a power of 2 (2^), for example, bit 8 is actually '2^7' = 128 in decimal, bit 7 is '2^6 = 64 in decimal, bit 6 is '2^5' = 32 in decimal, bit 5 is '2^4' = 16 in decimal, bit 4 is '2^3' = 8 in decimal, bit 3 is '2^2' = 4 in decimal, bit 2 is '2^1' = 2 in decimal, bit 1 is '2^0' = 1 in decimal.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;Note: When calculating the decimal value of an octet (192 in the example above), the Bit numbers do NOT represent the power of two value we must use in order to get the decimal value. This means that Bit 1 does NOT translate to 2^1=1 in decimal.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;In our example, we used the 192. As you saw, we needed bits 8 and 7 and this gave us the Binary number of 11000000 which is 192 in Decimal. You must remember that the values of each bit never change! For example, bit 8 always has a decimal value of 128, whereas bit 1 always takes the value of 1. Using this method, you will find it easy to convert Decimal to Binary without the need for complex mathematical calculations.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;So let's have a look at the next octet, which is the decimal number 168:&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-binary-5.gif&quot; alt=&quot;ip-binary-5&quot; width=&quot;411&quot; height=&quot;184&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Here again you can see that we needed to choose bits 8, 6 and 4 (in other words put a &quot;1&quot; in the bit's position) in order to get a decimal value of 168. So the Binary value of 10101000 is equal to the decimal value of 168.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;Let's now look at all 4 octets of our IP Address, in Binary:&lt;/p&gt;
&lt;p align=&quot;center&quot;&gt;&lt;img src=&quot;https://www.firewall.cx/images/stories/ip-binary-6.gif&quot; alt=&quot;ip-binary-6&quot; width=&quot;397&quot; height=&quot;340&quot; style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; /&gt;&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;No matter which way you convert, from Decimal to Binary or Binary to Decimal, the same method is used so you if you understood the above you should be able to convert either way any Binary or Decimal number.&lt;/p&gt;
&lt;p style=&quot;text-align: justify;&quot; align=&quot;left&quot;&gt;That just about does it for this section, you're now ready for the next section that focuses on the Internet Protocol header.&lt;/p&gt;
&lt;p style=&quot;text-align: right;&quot; align=&quot;right&quot;&gt;Next -&lt;a href=&quot;https://www.firewall.cx/networking/network-protocols/ip-protocol/protocols-ip-header.html&quot; title=&quot;IP Protocol - Part 2: The Internet Protocol Header&quot;&gt;IP Protocol - Part 2: The Internet Protocol Header&lt;/a&gt;&lt;/p&gt;</content>
		<category term="IP Protocol" />
	</entry>
</feed>
