1825804 Members
2058 Online
109687 Solutions
New Discussion

Re: ip addressing

 
SOLVED
Go to solution
steven Burgess_2
Honored Contributor

ip addressing

Have been reading up on ip addressing recently. Started with the chapter in the HP Certified book then expanded with docs from the cisco web site

This is what I understand so far

32 Bit number, split into 4 octets to make up an address

A Class = 1 host 2^24 nodes (255.0.0.0)
B Class = 1 host 2^16 nodes (255.255.0.0)
C Class = 1 host 2^8 nodes (255.255.255.0)

Now, if I want to for eg , take a C Class address and split into 4 networks and 64 ip addresses it's quite simple with the fact 0-63,64-127, 128-191 and 192-255. The netmask being 255.255.255.192 .

I understand, how , when I'm given a B class address and the subnet how to get the network address using anding

0-0 = 0
0-1 = 0
1-1 = 1

ie

255.255.240.0
131.107.47.62

= b class address, so would just use

240.0 = 11110000.00000000
047.62 = 00101111.00111110
----------------------------------------------
00100000.00000000 = 32.0

Therefore network address = 131.107.32.0

The question I am asking is , how from the above can I work out how many hosts and nodes are on the above network?

I have attached the question paper I have been looking at , but not being to clever at maths having trouble working out the above answers if though the answers are there. I need to understand how it works

I would be very grateful for any assistance

Last night I worked out how to convert hex numbers from the forum, so would do pretty happy if I managed to understand the above tonight

Thanks in advance

Steve
take your time and think things through
18 REPLIES 18
Steven Sim Kok Leong
Honored Contributor

Re: ip addressing

1. Using the Subnet Mask 255.255.240.0, what subnet and node addresses are the following hosts:

IP address Subnet Host/Node
131.107.47.62 131.107.32 15.62
131.107.48.65 131.107.48 0.65
9.3.17.18 9.3.16 1.18
100.100.100.100 100.100.96 4.100
191.107.16.39 191.107.16 0.39

The subnet address can be easily calculated based on AND'ing the IP address and the netmask.

My interpretation for the Host/Node portion is that its (CISCO's) definition is IP address minus the subnet portion (based on octet positioning)to get the host portion, in decimal eg.

191.107.16.39 - 191.107.16 = 0.39
IP address - subnet portion host portion

191.107.16 + 0.39 = 191.107.16.39
subnet portion + host portion = IP address

The host portion comprises 2 octets because the network address takes only a portion of the 3rd octet, thus the 3rd octet as well as the 4th octet is used for the host portion as well. Whatever is not in the subnet portion must be the host portion.

If the netmask is 255.255.255.0, then you only need to indicate the last octet (4th octet) in the host portion.

Just my interpretation.

Hope this helps. Regards.

Steven Sim Kok Leong
Eric Ladner
Trusted Contributor

Re: ip addressing

Generally, the number of computers you can have on a subnet could be computed like this:

2^(32 -
For example, if you have a 24 bit subnet mask, that would be 2^(32-24)-2 or 254 uesable . A 26 bit mask would give 62 useable addresses.

Remember, each subnet has 2 addresses that can't be used to address a host, one where the lower portion is all zeros (the subnet address) and one where it is all ones (the broadcast address)

So, if you have a
Steven Sim Kok Leong
Honored Contributor

Re: ip addressing

Hi,

Take:

131.107.47.62 131.107.32 15.62

IP address:
10000011.01101011.00101111.00111110
Netmask:
11111111.1111111.11110000.00000000
Subnet portion (where the 1's are in the subnetmask):
10000011.01101011.00100000
ie. 131.107.32
Host portion (where the 0's are in the subnetmask ie. OR the IP address and netmask):
00001111.0011110
ie. 15.52

>> The question I am asking is , how from the above can I work out how many hosts and nodes are on the above network?

I think you might have misinterpreted the question because The question is asking for the host portion not the number of hosts and nodes.

Hope this helps. Regards.

Steven Sim Kok Leong
Steven Sim Kok Leong
Honored Contributor

Re: ip addressing

Hi,

In short, binary "AND" the IP with the subnetmask to compute the subnet portion and binary "OR" (equivalent to decimal +) the IP with the subnetmask to compute the host/node portion.

Hope this helps. Regards.

Steven Sim Kok Leong
Steven Sim Kok Leong
Honored Contributor
Solution

Re: ip addressing

Hi,

Sorry about the two typos in the example:

Take:

IP address: 131.107.47.62 Subnetmask: 255.255.240.0


IP address: 10000011.01101011.00101111.00111110
Subnetmask: 11111111.1111l111.11110000.00000000

Subnet portion (where the 1's are in the subnetmask):
10000011.01101011.00100000 ie. 131.107.32

Host portion (where the 0's are in the subnetmask ie. OR the IP address and netmask): 00001111.0011110 ie. 15.62

Btw, adding the decimals (subnet address portion + host address portion) have the similar "OR" effect (ie. binary addition).

Hope this helps. Regards.

Steven Sim Kok Leong
Paula J Frazer-Campbell
Honored Contributor

Re: ip addressing

Hi

Arn't subnets used to catch underwater fighting vessels?

It late ---- SORREEEE


Paula
If you can spell SysAdmin then you is one - anon
Steven Sim Kok Leong
Honored Contributor

Re: ip addressing

Hi,

>> The question I am asking is , how from the above can I work out how many hosts and nodes are on the above network?

If you want to find out the total number of hosts/nodes (not the host portion), then the netmask is sufficient:

Subnet mask: 255.255.255.240

11111111.11111111.11110000.00000000

The number of hosts (minus the network address and broadcast address) is:

ie. 14 x 254 = 3556
(all 0's is reserved for network address and all 1's is reserved for broadcast)

You can have 3556 hosts when the netmask is 255.255.255.240.

Hope this helps. Regards.

Steven Sim Kok Leong
Steven Sim Kok Leong
Honored Contributor

Re: ip addressing

Hi,

Sheeezz.. I made another typo. Not again *bang head against wall*

The netmask in the question should be 255.255.240.0 and not 255.255.255.240.

Corrected posting:

Subnet mask: 255.255.240.0

11111111.11111111.11110000.00000000

The number of hosts (minus the network address and broadcast address) is:

ie. 14 x 254 = 3556
(all 0's is reserved for network address and all 1's is reserved for broadcast)

You can have 3556 hosts when the netmask is 255.255.240.0.

Regards.

Steven Sim Kok Leong
steven Burgess_2
Honored Contributor

Re: ip addressing

Paula

Ha Ha very funny. I was about to say it's 3:00am here in the UK, but you are also a resident. Steve, this is great, thanks. I'm just working on a problem at the moment, whilst trying to read your replies

Thanks, i'll respond shortly telling you how i'm getting on
take your time and think things through
steven Burgess_2
Honored Contributor

Re: ip addressing

Steve

Sorry if i'm being a little slow here

>> Subnet mask: 255.255.240.0

11111111.11111111.11110000.00000000

The number of hosts (minus the network address and broadcast address) is:

ie. 14 x 254 = 3556

Where does the 14 come from?

Could you expand on binary OR

I am almost there

Thanks



take your time and think things through
Ron Kinner
Honored Contributor

Re: ip addressing

You can use

http://www.telusplanet.net/public/sparkman/netcalc.htm

if you get lazy.

Another trick is to take the last non zero number in the mask e.g. 255.255.255.192 and subtract it from 256. 256-192=64
Divide 256 / the difference
256/64 = 4 subnets 0-63, 64-127, 128-192, 192-255.

64-2 possible hosts in each subnet.

If the last number is not in the last position then you just multiple the difference by 256 before subtracting the 2.

Ron

steven Burgess_2
Honored Contributor

Re: ip addressing

Thanks everyone

Fully understood, Steve just checked out your homepage.

Your qualifications are very impressive

Regards

Steve
take your time and think things through
steven Burgess_2
Honored Contributor

Re: ip addressing

Ron

Thanks for the calculator, it actually gives the explanation of how it works out your query

Cheers
take your time and think things through
Steven Sim Kok Leong
Honored Contributor

Re: ip addressing

Hi Steve,

>> Subnet mask: 255.255.240.0

Sorry, I got confused.

Because of the netmask of 240 in the 3rd octet, 16 combinations for 3rd octet:

00000000
00010000
00100000
........
11110000

For the 15 possible subnets, 1st and 15th (last) subnet are special cases. For the 13 subnets in between:

16 x 256 - 1 (network address) - 1 (broadcast) = 4094

1) 1st subnet IP numeric range: 131.107.0.0 - 131.107.15.255

If there are restrictions on having 0 as part of the subnet, then 131.107.0.1 - 131.107.0.255 is unusable (if host/node allows subnet zero). If this is the case, then the usable nodes/hosts

16 x 256 - 1 (131.107.0.0) - 1 (131.107.0.255) - 255 (131.107.0.1 - 131.107.0.255) = 3839

2) 15th subnet (last subnet) IP numeric range:
131.107.240.0 - 131.107.255.255

There cannot be a 255 in any of the octets, thus,

131.107.255.0 - 131.107.255.254 is unusable, so the usable for host/node is:

16 x 256 - 1 (131.107.240.0) - 1 (131.107.255.255) - 255 (131.107.255.0 - 131.107.255.254) = 3839

The last host/node IP for this subnet should be: 131.107.254.254.

I hope I am right. Regards.

Steven Sim Kok Leong
Steven Sim Kok Leong
Honored Contributor

Re: ip addressing

Hi Steve,

*sweat* Typo but does not affect the calculation.

1) 1st subnet IP numeric range: 131.107.0.0 - 131.107.15.255

If there are restrictions on having 0 as part of the subnet, then 131.107.0.1 - 131.107.0.255 is unusable (if host/node does not allow subnet zero). If this is the case, then the usable nodes/hosts

16 x 256 - 1 (network address: 131.107.0.0) - 1 (broadcast: 131.107.15.255) - 255 (unusable IPs if subnet zero disallowed: 131.107.0.1 - 131.107.0.255) = 3839

2) 15th subnet (last subnet) IP numeric range:
131.107.240.0 - 131.107.255.255

There cannot be a 255 in any of the octets, thus,

131.107.255.0 - 131.107.255.254 is unusable, so the usable for host/node is:

16 x 256 - 1 (131.107.240.0 network address) - 1 (131.107.255.255 (broadcast address) - 255 (unusable IPs: 131.107.255.0 - 131.107.255.254) = 3839

I hope I am right. Regards.

Steven Sim Kok Leong
Steven Sim Kok Leong
Honored Contributor

Re: ip addressing

Hi,

*sweat again*

>> 255.255.240.0

>> For the 15 possible subnets, 1st and 15th (last) subnet are special cases. For the 13 subnets in between:

I meant:

For the 16 possible subnets, 1st and 16th (last) subnet are special cases. For the 14 subnets in between:

I hope I am right. Please feel free to correct me. Regards.

Steven Sim Kok Leong
Animesh Chakraborty
Honored Contributor

Re: ip addressing

hi,
FYI,
http://safepipe.eicon.com/courses/ip/
Did you take a backup?
George_Dodds
Honored Contributor

Re: ip addressing

Hi Steve, check out the following link

http://www.learntosubnet.com/

It's great for nightshifts as most of it is video presentations, so you dont have to struggle reading a book.

I used it for the ccna, i'll dig out some stuff and mail it 2 u.

Here's the network info site i was working on while on nights, it's a over a year since it was last touched and needs rebuilt from scratch, but still has some usefull links.

http://www.geocities.com/SiliconValley/Board/4317/index.html

I'll get round to doing it one day

Have fun

George