binary and IP addresses

Have a question or want to start a discussion? Post it! No Registration Necessary.  Now with pictures!

Threaded View
Hi

I was wondering if someone could clear something up for me:

when converting decimal to binary then 255 = 11111111 or 8 places:  128 64
32 16 8 2 4 1

When dealing with subnet masks and hosts, to get 512 hosts you have to use 9
places ie

256 128 64 32 16 8 2 4 1 but all ones add up to 511?   what am I doing wrong
here?




Re: binary and IP addresses

Quoted text here. Click to load it

    You are forgetiing to add the .0 address on the next subnet.

    It's easier to use the whole octet (ie 255 not 256) and add 2 (1 per
octet). 255 128 64 32 16 8 4 2 1 + 2  = 512

    That does NOT give you 512 hosts anyways, it gives you 510 hosts, 1
network and 1 broadcast.

    You do know about 2^N formula correct?

    2^N = number of addresses including network and broadcast.
    2^N-2= number of hosts

    2^9-2=510

    I found writing out the table a couple dozen times commits it to memory
quite easily.




Re: binary and IP addresses
Hi

255 is the last number from 0 ( zero )

form INCLUDING zero  to 255 is 256

00000000    =    0
11111111    =    255
-----------------------------

dont make the mistake with hosts
A subnet can handle x hoste -2 ( network and host address !!

192.168.0.0 / 24 also 255.255.255.0

192.168.0.0    Network address
192.168.0.1    Fist host
192.168.0.254    Last host
192.168.0.255    Broadcast address

a subnet of 8 free bits can be seen as 256 -2  == 254 host !

Rijk van Harn
Ex CCNA ( planning exam next month )

Quoted text here. Click to load it




Re: binary and IP addresses
Thank you all!  guess I need to revisit subnetting :)

Regards

Mark


Quoted text here. Click to load it




Site Timeline