# Hard time grasping concept

louzam2115
Posts:

**18**Member ■□□□□□□□□□
Class

Bit Pattern

First Octet Range of Addresses

Number of Network Addresses

Number of Hosts Per Network

Default Mask

A

0xxxxxxx

1–126

126

16,777,214

255.0.0.0

B

10xxxxxx

128–191

16,384

65,534

255.255.0.0

C

110xxxxx

192–223

2,097,152

254

255.255.255. 0

D

1110xxxx

224–239

N/A

N/A

N/A

E

1111xxxx

240–254

N/A

N/A

N/A

Sorry about the format, I did a copy and paste, I am having a hard time trying to graps this topic, the book I am reading does not explain it very well. Can someone help me out here. I am trying to figure out why there are only that amount of network addresses and hosts available per class and how is it set.

Thanks

Bit Pattern

First Octet Range of Addresses

Number of Network Addresses

Number of Hosts Per Network

Default Mask

A

0xxxxxxx

1–126

126

16,777,214

255.0.0.0

B

10xxxxxx

128–191

16,384

65,534

255.255.0.0

C

110xxxxx

192–223

2,097,152

254

255.255.255. 0

D

1110xxxx

224–239

N/A

N/A

N/A

E

1111xxxx

240–254

N/A

N/A

N/A

Sorry about the format, I did a copy and paste, I am having a hard time trying to graps this topic, the book I am reading does not explain it very well. Can someone help me out here. I am trying to figure out why there are only that amount of network addresses and hosts available per class and how is it set.

Thanks

#### Welcome

We're proud to offer IT and security pros like you access to one of the largest IT and security certification forums on the web.

## Quick Links

#### Categories

- 110K All Categories
- 127 Welcome Center
- 22 Announcements
- 3 Forum Rules of Engagement
- 65 Introduce Yourself
- 36 TechExams Support
- 87.6K Certification Preparation
- 131 Check Point: CCSA & CCSE
- 32.8K Cisco
- 21.5K CCNA & CCENT
- 368 CCDA & CCDP
- 8.9K CCNP
- 1.7K CCIE
- 420 Cloud Certifications
- 155 Amazon Web Services (AWS)
- 10 Azure
- 104 CCSP
- 73 Cloud+ & Cloud Essentials
- 15.4K CompTIA
- 5K A+
- 224 CASP+
- 93 CySA+
- 970 Linux+
- 4.4K Network+
- 23 PenTest+
- 259 Project+
- 3.8K Security+
- 330 Server+
- 249 Other CompTIA Certifications
- 1.2K EC-Council
- 583 CHFI
- 599 CEH
- 1.3K GIAC
- 29 IAPP
- 965 ISACA
- 13 CRISC
- 266 CISA
- 672 CISM
- 4.2K (ISC)²
- 605 CISSP
- 32 CSSLP
- 3.6K SSCP
- 922 Juniper
- 724 LPI, Red Hat & Linux Foundation
- 18.5K Microsoft
- 138 MCSA 2016 / MCSE 2016
- 159 Windows 10 exams
- 139 Windows 8 exams
- 1.4K Windows 7 exams
- 1.6K MCSA / MCSE on Windows 2012 General
- 2.3K MCTS / MCITP on Windows 2008 General
- 828 Exchange Server & Office Communications Server Exams
- 528 Other Microsoft Electives
- 350 MCSA/MCSE: Security
- 300 Microsoft Developers Certifications
- 483 SQL Server exams
- 143 Offensive Security: OSCP & OSCE
- 2K Other Security Certifications
- 335 Virtualization Certifications
- 231 Citrix Certifications
- 97 VMware
- 1.9K Other Certifications
- 6 Business Analyst Certifications
- 387 CWNP Certifications
- 861 ITIL Certifications
- 212 Project Management Certifications
- 84 Apple Mac OS X Certifications
- 62 Novell Certification
- 81 Oracle Certifications
- 52 Sun Microsystems Java Certification
- 112 Storage Certifications
- 6.6K General Certification
- 17.6K Education & Development
- 41 Colleges & Schools
- 32 Educational Resources
- 17.5K IT Jobs / Degrees
- 38 Professional Development
- 98 Cybersecurity
- 1 Forensics
- 5 Pentesting
- 4 Cloud Security & IoT
- 9 OWASP
- 29 Security Awareness & Training
- 35 Security News & Breaches
- 19.9K General
- 13 Conferences & Events
- 13 Computer Gaming
- 5 Data Center
- 46 Classifieds
- 26 For Sale
- 6 Wanted (ISO)
- 10 Help Wanted
- 12 Just for Fun
- 17.4K Off-Topic
- 9 Scripting
- 2 Show Us Your Tech!
- 7 Troubleshooting
- 2.4K Virtualization

## Comments

3,359Member303Member192.168.1.X

X can be numbers 1 - 254.

0 and 255 are reserved.

192.168.1.0 = network ID

192.168.1.255 = broadcast

Now let's look at class B.

191.168.X.X

Two numbers are used to address instead of one.

191.168.1.1-254

191.168.2.1-254

191.168.3.1-254

191.168.4.1-254

191.168.5.1-254

.

.

.

191.168.254.1-254

191.168.255.1-254

If you do the math, you would end up with a number like 65,000 for possible address'

Now let's take a look at class A

23.X.X.X

You can change up three numbers.

Which will make a lot more.

Makes any sense?

The first digit of the ip address will tell you what class it is.

X.0.0.0

If X is between 1 - 126 = Class A

If X is between 128 - 191 = Class B

If X is between 192 - 223 = Class C (Can't remember class C off the top of my head)

127 = reserved.

Someone correct me if I'm wrong.

EDIT: Fixed class C, I knew it was 192, just did a typo.

1,208Member ■■■■■■□□□□13Member ■□□□□□□□□□not have to know all of this for the Network+ exam but to understand the term

you use Bit Pattern you need to have a little bit of binary math background.

Also if you know how to calculate the ranges and where they come from you will not have to rely on your memory.

An octet is 8 bits. An IP address is made up of 4 octets giving you 4 x 8 bits

= 32 bits in all. For the classes all you have to look at is the first octet

to see where they get their ranges.

First the bits are numbered as followed from LEFT to right and numbered 7 to 0

not 8 to 1:

bit #: 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0

Value: 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1

It does not matter why it is like that jut remembered that it is like that.

The value is obtained by using 2 to the power of the bit number. For example

the first bit LEFT to RIGHT has a bit value of 7 so 2^7 or 2x2x2x2x2x2x2 = 128

and so on from LEFT to RIGHT same for bits 6 through 0 (zero).

I started doing binary math 22 years ago but have had to explain it a number of

times to different people. The way I do it is start with 1 and double the

value 7 times from right to left. Who cares about why, we really just need to

get the bit values Some find knowing the technical above is the key to

understanding it.

Now to understand the ranges you ask about.

Class A addresses must always have a 0 in the first bit of the octet. OK so

let's do it.

You have an octet, 8 bits, so the binary range would be from:

binary - decimal

0 xxxxxxx

0 0000001 - 1 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 = 1

0 1111110 - 126 0 + 64 + 32 + 16 + 8 + 4 + 2 + 0 = 126

A '1' in the bit number corresponding from the table above means to add that

value.

* NOTE * 127 01111111 is a special case octet value so it is not used in the

class A range thus the range 1 to 126 and not 1 to 127. Check the internet for

what the 127 is used for.

** NOTE ** a zero value, 00000000, is not valid thus the range starting with 1.

Class B addresses must always have a 10 in the first and second bits of the

octet. OK so let's do it.

You have an octet, 8 bits, so the binary range would be from:

binary - decimal

10 xxxxxx

10 000000 - 128 128 + 0 + 0 + 0 + 0 + 0 + 0 + 0 = 128

10 111111 - 191 128 + 0 + 32 + 16 + 8 + 4 + 2 + 1 = 191

A '1' in the bit number corresponding from the table above means to add that

value.

Class C addresses must always have a 110 in the first, second and third bits of

the octet. OK so let's do it.

You have an octet, 8 bits, so the binary range would be from:

binary - decimal

110 xxxxx

110 00000 - 192 128 + 64 + 0 + 0 + 0 + 0 + 0 + 0 = 192

110 11111 - 223 128 + 64 + 0 + 16 + 8 + 4 + 2 + 1 = 223

A '1' in the bit number corresponding from the table above means to add that

value.

RANGES

Now for the ranges:

The symbol ^ is used to specify "to the power of".

The number of networks is calculated using the mask and the formula is (2^

number of network bits). We are calculating networks here not subnets which

uses a different formula.

CLASS A RANGES:

Because the range for class A addresses is 0xxxxxxx have only 7 bits for the

network. So using the formula above you have.

2^7=128 but a host value of 0 and 127 are not valid in class A so subtracting 2

from this gives 126 network addresses.

The number of hosts is calculated using the mask and the formula is (2^ number

of host bits) - 2. If you go further than Network+ you will learn why there is

a minus 2 here. I am only trying to explain where the numbers came from for the

ranges.

Class A addresses uses the first octet always to specify the network and the

rest of the octets are hosts. So if the first octet is used and there are 3

left that gives us 3 x 8 = 24 bits.

2^24=16,777,216 - 2 = 16,777,214 host addresses.

CLASS B RANGES:

Class B addresses use the first 2 octects of an IP address which is 16 bits but

because the range is 10xxxxxx for class B you have only 14 bits for the

network. So using the formula above you have.

2^14= 16,384 network addresses.

Class B addresses uses the first 2 octets always to specify the network and the

rest of the octets are hosts. So if the first 2 octets are used and there are

2 left that gives us 2 x 8 = 16 bits.

Using the same formula above for calculating hosts (2^ number of host bits) - 2.

2^16=65,536 - 2 = 65,534 host addresses.

CLASS C RANGES:

Class C addresses use the first 3 octects of an IP address which is 24 bits but

because the range is 110xxxxx for class C you have only 21 bits for the

network. So using the formula above you have.

2^21= 2,097,152 network addresses.

Class C addresses uses the first 3 octets always to specify the network and the

rest of the octets are hosts. So if the first 3 octets are used and there are

1 left that gives us 1 x 8 = 8 bits.

Using the same formula above for calculating hosts (2^ number of host bits) - 2.

2^8=256 - 2 = 254 host addresses.

I will not go into Class D's and E's because you only need to know they exist

for the Network+ exam.

I hope this helps.

Kenneth