Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 986
Rep:
IPV4 Network Numbering
I can't decipher how Network Bits are used in IPV4.
Some guides state that the leading Bits that ID. the Class are used for numbering Networks and some don't. As in a leading 1 0 in a B Class just determines which class or how many bits are used for Networks but are not involved in the actually amount included in the class.
Lets say that in a Class A there are 127 numerical possibilities because only one octet is used and it is limited by a zero in the left most location.
With a Class B a whole other octet is allowed which enables Two octets minus the two bits at the far left with makes 14 bits available for numerical possibilities, OR it allows actually 16 bits but the possibilities are limited by the first two bits.
None of the guides I find agree on the numbers and If you do the math yourself it never works out.
I'm not sure what you don't understand about it, you've not really explained it much.
but in a class c, /24 subnet you have 256 - 2 hosts = 254. 1 used for the broadcast address (.254), one for the subnet address (.0). for a /16 (class b) it's exactly the same, just (256 * 256) - 2, but note that these days /16 subnets just about never ever exist. You aren't losing entire bits, just single numbers.
It's very confusing learning about a's b's and c's. I would suggest just ignoring them totally, and just look at the much more consistent CIDR notation (192.168.1.0/24 etc.) and remember that certain address ranges are reversed, as you already know, 10.0.0.0/8, 172.16.0.0/16 to 172.31.0.0/16 and 192.168.0.0/16
"A" Class Networks can only be 127 in number so only 127 of these types of Networks can exits.
When we move on to a Class "B" Network 16 place holders are added so apparently 127- 32768 = 32641 are skipped and made not available. 10 000000 00000000= 32768 This is besides the point but might be the oversight I'm using so I include it. So 10 000000 00000000 is the lowest range of a "B" Network so if we fill in the Zeros with ones we get 10 111111 11111111 which is either 32768 or 49151 in decimal= 16383 available Networks in Class "B". The webpage provided for reference states that
Quote:
Class B addresses always have the leftmost 2 bits of the leftmost byte set to 1 0. This leaves 14 bits left to specify the network address giving 32767 available B class networks. B Class networks thus have a range of 128 to 191 for the first of the dotted quads, with each network containing up to 32,766 possible interfaces.
So an IP address does not go from righ to left as or lowest on right and highest placeholders on the left but this part is conveniently left out of all the guides I can find.
What chris said "I would suggest just ignoring them totally".
Masks make more sense in binary since thats how they are evaluated -
You have 32 address bits and 32 mask bits -
The address is divided, like all network protocols into network part and host part. IP is odd in that the demarcation between node and network is variable and defined by the mask. Decode the mask into binary and you will see it is just like a slider -
The address classes A,B,C,D, adopted before classless routing became the norm, said that said any address with a first byte matching 0xxxxx is called class "A" and has a 255.0.0.0 mask. Any address with a first byte matching 10xxxxx is called class "B" and has a mask of 255.255.0.0, etc.
But these were just a convention, in reality there is nothing in the mechanics of bit masking shown above stopping you masking any address however you like.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.