LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-16-2012, 10:34 AM   #1
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 986

Rep: Reputation: 53
Question 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.


Thanks in advance!
 
Old 01-16-2012, 11:38 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
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
 
Old 01-16-2012, 01:52 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by acid_kewpie View Post
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
s/reversed/reserved/
 
Old 01-16-2012, 02:06 PM   #4
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 986

Original Poster
Rep: Reputation: 53
Thanks for the Reply!

I'll try to build a framework for this mess. Here's a webpage to help follow along http://oss.sgi.com/LDP/HOWTO/IP-Subnetworking-3.html

"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.
 
Old 01-16-2012, 02:07 PM   #5
baldy3105
Member
 
Registered: Jan 2003
Location: Cambridgeshire, UK
Distribution: Mint (Desktop), Debian (Server)
Posts: 891

Rep: Reputation: 184Reputation: 184
Dude,

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 -

Code:
10.1.2.3 255.255.255.0 (or /24) =

00001010.00000001.00000010.00000011
11111111.11111111.11111111.00000000
<------network-----------> <-host->

= network 10.1.2.0 node 3.

10.1.2.3 255.255.0.0 (or /16) =

00001010.00000001.00000010.00000011
11111111.11111111.00000000.00000000
<----network----> <-----host----->

= network 10.1.0.0 node 2.3

10.1.2.3 255.255.240.0 (or /20) =

00001010.00000001.00000010.00000011
11111111.11111111.11110000.00000000
<------network-------><---host---->

= network 10.1.0.0 node 2.3
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.

Last edited by baldy3105; 01-16-2012 at 02:13 PM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
BIND (local DNS), network unreachable resolving, IPv4 davidlt Debian 2 02-17-2011 02:42 PM
Disabling IPv4 packet forwarding: net.ipv4.ip_forward = 0 (CentOS 5.5) troiwulful Red Hat 3 11-22-2010 11:04 AM
[SOLVED] Multiple IPV4 addresses not working after boot, works after network restart samuellay Linux - Networking 3 10-18-2010 01:26 PM
No IPv4 + No Network Connection + z25 File + newbie = weirdness PaulyWally Linux - Networking 1 08-09-2008 02:43 PM
no network IPv4 in hardy wabbalee Linux - Networking 0 04-26-2008 08:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration