Home > Protocols, Lesson 4: Internet Protocol classes - Network and host ID
Tutorial:
EMAIL THIS LICENSING & REPRINTS

Protocols, Lesson 4: Internet Protocol classes - Network and host ID

15 Oct 2004

Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   

Introduction

Every protocol suite defines some type of addressing that identifies computers and networks. IP addresses are no exception to this rule. There are certain values that an IP address can take; these have been defined by the IEEE committee.

A simple IP address is a lot more than just a number. It tells us the network of which the workstation is part and the node ID.

IP address classes and structure

When the IEEE committee sat down to sort out the range of numbers that were going to be used by all computers, they came up with five different ranges or, as we call them, "classes" of IP addresses. When someone applies for IP addresses they are given a certain range within a specific class depending on the size of their network. To keep things as simple as possible, let's first have a look at the five different classes:


In the above table, you can see the five classes. Our first class is A and our last is E. The first three classes (A, B and C) are used to identify workstations, routers, switches and other devices, whereas the last two classes (D and E) are reserved for special use.

An IP address consists of 32 Bits, which means it's four Bytes long. The first octet (first eight 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.

For example, if I told you that the first octet of an IP address is "168," then, using the above table, you would notice that it falls within the 128-191 range, which makes it a class B IP address.

Understanding the classes

We are now going to take a closer look at the five classes. 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.

The class A IP addresses were designed for large networks, class B for medium size networks and class C for smaller networks.

Introducing network ID and node ID concepts

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 two pieces of valuable information:

1) It tells us which network the device is part of (network ID).

2) It identifies that unique device within the network (node ID).

Think of the network ID as the suburb you live in and the node ID as 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 to which network a particular computer belongs and the node ID identifies that computer from all the rest that reside in the same network.

The picture below gives you a small example to help you understand the concept: Explanation:


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.

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?

That's what we are going to answer next.

The network and node ID of each class

The network class helps us determine how the four byte, or 32 bit, IP address is divided between network and node portions.

The table below shows you (in binary) how the Network ID and Node ID changes depending on the class:


Explanation:
The table above might seem confusing at first but it's actually very simple. We will take class A as an example and analyze it so you can understand exactly what is happening here:

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 seven bits is:

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 two 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). This is why when we calculate the "valid" hosts in a network we always subtract "2". So if I asked you how many "valid" hosts can you have a on class A network, you should answer 16,777,214 and NOT 16,777,216.

Below you can see all this in one picture:


The same story 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.

Class B networks 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 two 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 "valid" hosts can you have on class B network, you should answer 65,534 and NOT 65,536.


Class C networks have 21 bits for the network ID (Bits 22, 23, 24 are set and can't be changed) and eight 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 two 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 "valid" hosts you can have on class C network, you should answer 254 and NOT 256.

Now, even though we have three 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 to avoid using these IP addresses.

The following table shows the IP addresses that you should avoid using:

IP address

Function

Network 0.0.0.0

Refers to the default route. This route is to simplify routing tables used by IP.

Network 127.0.0.0

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.

 

 

IP Address with all host bits set to "0" (Network Address) e.g. 192.168.0.0

Refers to the actual network itself. For example, network 192.168.0.0 can be used to identify network 192.168. This type of notation is often used within routing tables.

IP Address with all node bits set to "1" (Subnet / Network Broadcast) e.g. 192.168.255.255

IP Addresses with all node bits set to "1" are local network broadcast addresses and must NOT be used.

Some examples: 125.255.255.255 (Class A), 190.30.255.255 (Class B), 203.31.218.255 (Class C). See "Multicasts" & "Broadcasts" for more info.

IP Address with all bits set to "1" (Network Broadcast) e.g. 255.255.255.255

The IP Address with all bits set to "1" is a broadcast address and must NOT be used. These are destined for all nodes on a network, no matter what IP address they might have.


Now make sure you keep to the above guidelines because you're going to bump into a lot of problems if you don't!



IMPORTANT NOTE: 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 cannot be used.

So when calculating available IP addresses in a network, always remember to subtract 2 from the number of IP addresses within that network.



That all pretty much covers this section.

Next, is the subnetting section, 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.

Return to the introduction or continue to Lesson 5.



Click over to Firewall.cx for more articles like this one. You don't have to register or jump through any hoops. All you do is get the networking information you want. Copyright 2004 Firewall.cx.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
IP Addressing
Do multiple router interfaces affect the amount of IP addresses?
How to locate the lost IP address of an Access Point (AP)
IPv4 or IPv6 -- Myths and Realities
What is a logical network? How do you improve one?
Why are IPv6's IP addresses in hexadecimal formatting?
Understanding VLAN implementation and IP address assignment
Prevent IP address conflicts on your wireless network by managing DHCP scopes
Get IPv6 skills now rather than later
How can I check connectivity and ping between sites?
Can I connect to my wireless network and wired LAN simultaneously?

TCP/IP
Is time-to-live (TTL) thrown out in IPv6?
What is the difference between a GRE tunnel and IPsec tunnel?
How are TCP/IP and HTTP related?
How do you check if TCP/IP is installed on the system?
Assessing WAN connectivity, identifying latency for centralized application access
What protocol works on all layers of OSI?
TCP/IP troubleshooting: A structured approach -- Using Netdiag.exe
Which routers won't assign IP addresses to other subnets?
How can I define the layered approach to protocols?
What are the routing differences between IPv4 and IPv6?

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
32-bit IP addressing  (SearchNetworking.com)
fixed-length subnet mask  (SearchNetworking.com)
GARP (Generic Attribute Registration Protocol)  (SearchNetworking.com)
route aggregation  (SearchNetworking.com)
route summarization  (SearchNetworking.com)
routing table  (SearchNetworking.com)
subnet  (SearchNetworking.com)
subnet mask  (SearchNetworking.com)
variable-length subnet mask  (SearchNetworking.com)
wildcard mask  (SearchNetworking.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary




Network Management features current networking news and in-depth network white papers.
Enterprise IT Solutions explained by experts, make your business decisions with research.
HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersNetworking Product Trials
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2000 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts