Subnet question

D

danieltan

If i have a subnet mask of 255.255.255.192, how many ip can i assign to
this subnet ? Thanks

Rgds
Daniel
 
D

David Carlsson

If i have a subnet mask of 255.255.255.192, how many ip can i assign to
this subnet ? Thanks

Rgds
Daniel
255=11111111
254=11111110
252=11111100
248=11111000
240=11110000
224=11100000
192=11000000
128=10000000
0=00000000

so with 255.255.255.192192, 6 bits are available for hosts => 2^(6+1)=64
Your subnet is 64 addresses
You can use all but the first(netaddress) and last(directed broadcast)
 
D

danieltan

David, how to see the first and the last address ? if 64 add, then it
should be 2^6=64, correct ? Pls correct me, if i'm wrong, thanks

Rgds
Daniel

David said:
255=11111111
254=11111110
252=11111100
248=11111000
240=11110000
224=11100000
192=11000000
128=10000000
0=00000000

so with 255.255.255.192192, 6 bits are available for hosts => 2^(6+1)=64
Your subnet is 64 addresses
You can use all but the first(netaddress) and last(directed
broadcast)
 
D

danieltan

David, how to see the first and the last address ? if 64 add, then it
should be 2^6=64, correct ? can it also be written like this
255.255.255.192/64 ? , so i have 64 IP ? Pls correct me, if i'm wrong,
thanks

Rgds
Daniel

David said:
255=11111111
254=11111110
252=11111100
248=11111000
240=11110000
224=11100000
192=11000000
128=10000000
0=00000000

so with 255.255.255.192192, 6 bits are available for hosts => 2^(6+1)=64
Your subnet is 64 addresses
You can use all but the first(netaddress) and last(directed
broadcast)
 
D

danieltan

David, how to know which one is netaddress and broadcast add ? can it
be written like 255.255.255.192/64 ? 64 bit net mask ?

Rgds
Daniel

David said:
255=11111111
254=11111110
252=11111100
248=11111000
240=11110000
224=11100000
192=11000000
128=10000000
0=00000000

so with 255.255.255.192192, 6 bits are available for hosts => 2^(6+1)=64
Your subnet is 64 addresses
You can use all but the first(netaddress) and last(directed
broadcast)
 
D

David Carlsson

David, how to see the first and the last address ? if 64 add, then it
should be 2^6=64, correct ? can it also be written like this
255.255.255.192/64 ? , so i have 64 IP ? Pls correct me, if i'm wrong,
thanks

Rgds
Daniel

Oops! 2^6 is of cause 64.
The notation of IP/size you write I havn't seen for Subnetmasks but for
IP-addresses like this:
 
D

David Carlsson

I give an example:
If you hav an IP 192.168.5.80 and a subnetmask of 255.255.255.192
then you take IP LogicalAND Mask (IP && Mask in C-notation) to get the
Netaddress.
In this example 192.168.5.64.
If you instead take IP LogicalOR (LogicalNOT Mask), (IP || !Mask) you
get the broadcast.
Here 192.168.5.127.

Here is an ip-calculator i found "Googleing"
http://jodies.de/ipcalc
 
P

Phillip Windell

If i have a subnet mask of 255.255.255.192, how many ip can i assign to
this subnet ? Thanks

Let's make this simple: 256 - 192 = 64
So you get 64 hosts.

Substract 1 for Net ID and 1 for Broadcast: 64 - 2 = 62

So you get 62 actual usuable hosts.
 
D

David Carlsson

Phillip said:
Let's make this simple: 256 - 192 = 64
So you get 64 hosts.

Substract 1 for Net ID and 1 for Broadcast: 64 - 2 = 62

So you get 62 actual usuable hosts.
This is an elegant and easy calculation
KISS (Keep It Simply Stupid)
;-)
 
G

Guest

David Carlsson said:
This is an elegant and easy calculation
KISS (Keep It Simply Stupid)
;-)

David,
Quite like the way you solved.However I think it is abit confusing.Works in
your case but suppose the subnet mask was 255.192.0.0?. That would not really
work would it?.Unless we say ((256-192)-2)+255+255,Is it?
 
P

Phillip Windell

chanco2k said:
Quite like the way you solved.However I think it is abit confusing.Works in
your case but suppose the subnet mask was 255.192.0.0?. That would not really
work would it?.Unless we say ((256-192)-2)+255+255,Is it?

[Number of hosts per network]
256 - 192 = 64
64 x (256 x 256) = ?
64 x 655536 = 4,194,304 (Maximunm IP# per network)
4194304 - 2 = 4,194,302 (After discounting ID and
Broadcast)

[Networks]

256 (for 1st octet
256 / 64 = 4 (for 2nd octet)

(1st octect) (2nd octet)
256 x 4 = 1024

(Subtract 1 since the 1st octet can't be 0)
1024 - 1 = 1023 (Total networks if including 1st and last)

In reality the only people who would even do this in the second or third
octect would be ISP's so they could give out certain "blocks" to customers.
In private networks with Private RFC IP Ranges there is no real need to make
things this complex when it is so extremely easy to keep it much simpler
than that (like 255.255.255.0, or 255.255.0.0, or 255.0.0.0).

Ethernet begins to be inefficient when you start getting over 250 or 300
hosts on a segment so it is not practical to start splitting in anything
other than the third octet for an average LAN. Just a plain 255.255.255.0
already gives you 254 hosts. Taking just one more bit from the next octect
(255.255.254.0) gives 510 usable host which is not all that practical
because the effiency would suffer from excessive broadcasts if you really
had that many hosts on the segment. Splitting in the 2nd and 3rd octets are
for situations where the "range" you create will probably then be split yet
again later on (like with ISPs).

You can also split in the earlier octets using the "supernetting" technique
when designing complicated Routing Schemes with multiple routers on a LAN to
aid in the way the routing tables are optimized. But this doesn't effect the
hosts, and the hosts would not reflect this in their "masks". This would
only be seen in the effected Routers.
For example, if you used the same physical "path" to reach the first 4
networks:
192.168.0.0
192.168.1.0
192.168.2.0
192.168.3.0
192.168.4.0 and above use a different "path"

Instead of using four individual routes using the same "interface",...
192.168.0.0 mask 192.168.0.0 Interface eth2
192.168.1.0 mask 192.168.0.0 Interface eth2
192.168.2.0 mask 192.168.0.0 Interface eth2
192.168.3.0 mask 192.168.0.0 Interface eth2
192.168.4.0 mask 192.168.0.0 Interface eth1 (different path)

.... you could use just one single route like this to keep the Route Table
small:
192.168.0.0 mask 192.168.252.0 Interface eth2
192.168.4.0 mask 192.168.0.0 Interface eth1 (different path)
 
D

David Carlsson

David, how to get the 26 => 192.168.1.64/26 ? is it 26 bits or what ?
Rgds
Daniel
To get the net-address you take the ip of a host and make a bit-and
withe the net mask.
 
D

danieltan

David, u mean take the host ip and change it to bit ? also with the
netmask change it to bit ? example ?

Regards
Daniel
 
D

David Carlsson

David, u mean take the host ip and change it to bit ? also with the
netmask change it to bit ? example ?

Regards
Daniel
Ex:

192.168.1.78 = 11000000.10101000.00000001.01001110
255.255.255.192 = 11111111.11111111.11111111.11000000 (26 ones)
bit-and ---------------------------------------
11000000.10101000.00000001.01000000 = 192.168.1.64
 
D

danieltan

David, so total is 64 IPs to be used starting from 192.168.1.65 to 127
? correct ? btw what is netaddress used for ? Thanks

Rgds
Daniel
 
D

David Carlsson

David, so total is 64 IPs to be used starting from 192.168.1.65 to 127
? correct ? btw what is netaddress used for ? Thanks

Rgds
Daniel
I'm not quite soure but searching the net i found this:
(http://www.bergen.org/AAST/Course/InfoTech/lesson4/snb.html)

0 and 255 have special meanings. 0 is reserved for machines that don't
know their address. In certain circumstances it is possible for a
machine not to know the number of the network it is on, or even its own
host address. For example, 0.0.0.23 would be a machine that knew it was
host number 23, but didn't know on what network.
......
In addition, certain older implementations may use 0 instead of 255 to
form the broadcast address. Such implementations would use 128.6.4.0
instead of 128.6.4.255 as the broadcast address on network 128.6.4.
Finally, certain older implementations may not understand about subnets.
Thus they consider the network number to be 128.6. In that case, they
will assume a broadcast address of 128.6.255.255 or 128.6.0.0. Until
support for broadcasts is implemented properly, it can be a somewhat
dangerous feature to use.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top