[Techtalk] Networking tangent: subnets and netmasks
Hamster
hamster at hamsternet.org
Thu Apr 17 00:26:41 EST 2003
Pearlbear,
In order to convert from 255 notation to /x notation do this:
Write the 255 notation out in binary.
Count the number of 1's.
Thats the /x notation.
EG
255.255.255.0 =
11111111.11111111.11111111.00000000
No of 1's = 24, so its written /24
When youre given a rang of IPs, the first address is called the network
address. This number is used to express the idea of "the whole network". Its
not used that commonly, mostly in iptables rules or router table tables.
The last address is always the broadcast address (also called directed
broadcast to distinguish it from the global broadcast of 255.255.255.255).
The broadcast address is used to address a packet in such a way that *every*
computer on the network receives it and reads it.
A packet addressed to say 10.0.0.1 will only be read by that individual
machine. But if you want *every* machine to read it, it needs to be sent to
10.255.255.255 (or whatever the appropriate mask is)
HTH
Hamster
PS See also http://linux.invisiblepixels.org/guide/subnetting.html for some
very old notes I made.
More information about the Techtalk
mailing list