• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 609
  • Last Modified:

Ip address

Hi,

Thank you for reading my question. Here goes...

In a class C address for example 192.168.1.1   255.255.255.252, the network portion i.e. 192.168.1 how is it derived.

I  assume the 192.168 comes from class C, what about the third octet 1 does it have any bearing on how many hosts or subnets there are, if the number is changed to 10 to read 192.168.10.1 what changes can be expected in the number of hosts or octets.


I need some clarification on the above, I know binary to decimal conversion and vice versa so you may skip that part of the explanation.

Await your reply.
0
snoozeit
Asked:
snoozeit
  • 3
  • 2
  • 2
  • +1
1 Solution
 
static-voidCommented:
ok the way subnetting works is that the subnet mask is a binary mask for the values of the address which are valid.
For example
255.255.255.0 == 11111111 11111111 11111111 00000000
this is a /24 and means that the first 24 bits of the specified address are within that subnet

255.255.255.252 = 11111111.11111111.11111111 11111100
that means that the last 2 bits (4 addresses) of the address are witin your subnet

for

192.168.1.1 gives 192.168.1.0-3 as .0 is reserved the valid addresses are 1-3 so a 192.168.10.1 subnet 255.255.255.252  just means 192.168.10.1-3
0
 
Cobra25Commented:
The subnet mask will determine the number of hosts. In your example, 192.168.1.1 255.255.255.252, since this is a class C address, we are ignoring the first 3 octets. So even if you have 192.168.10.1 255.255.255.252, you will still have the amount of hosts. Now say you had 192.168.11.1 and your mask was 255.255.0.0,we would be ignoring the first the 2 octets and we wold look at the 3rd and 4th in this case.
0
 
snoozeitAuthor Commented:
Thanks both explanations helped, that leads me to ask how can these two ip address (192.168.1.1-3 and 192.168.10.1-3 both on 255.255.255.252) work on one network, what can be used to connect them.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
static-voidCommented:
you really need a router to connect them, a macine connected to both networks and forwarding traffic between them
0
 
zimbulatCommented:
In a class C address for example 192.168.1.1   255.255.255.252, the network portion i.e. 192.168.1 how is it derived.

-> Since you're talking about class, let's start with classful ip addressing. Defined class C as below:-

Class: C
Leading Bits: 110 (leading bits must always 110, example: 11000000.00000000.00000000.00000000 or 192.0.0.0)
Size of Network Number Bit field: 24
Size of Rest Bit field: 8
Number of Networks: 2097152 (2^14 -2)
Hosts per Network: 254 (2^8 -2)


I  assume the 192.168 comes from class C, what about the third octet 1 does it have any bearing on how many hosts or subnets there are, if the number is changed to 10 to read 192.168.10.1 what changes can be expected in the number of hosts or octets.

-> In class C, first 24 bits always represent network address. Thus, first 3 octets are reserved for network addresses, leaving last octet for hosts (2^8 -2 = 254 maximum ).

If you use "either one", 192.168.1.0 or 192.168.10.0 or 192.168.x.0, the number of usable hosts always 254. Thus, in this scenario third octet does not have any bearing on number of hosts or subnets. Only the fourth octet.

To subnet, you borrow bit from host bits only, i.e. from the fourth octet. Assuming that you borrow 1 bit, your network bit or netmask now changed from 11111111.11111111.11111111.00000000 to 11111111.11111111.11111111.10000000 or from 255.255.255.0 to 255.255.255.128.

Here:-
Number of subnets are 2^1=2, where 1 is borrowed bit. (Rule is 2^borrowed bit)
Number of usable hosts for each subnet are 2^7 -2=126. (Rule is 2^remaining bit -2)
Increment of network address=128 (Rule is decimal value of last bit borrowed=128)

Subnet      Network Address            Host Range            Broadcast Address
0             192.168.x.0                   192.168.x.1-126      192.168.x.127
1             192.168.x.128                   192.168.x.129-254      192.168.x.255


If you borrow 2 bits, your netmask is 11111111.11111111.11111111.11000000 or 255.255.255.192

Here:-
Number of subnets are 2^2=4,
Number of usable hosts for each subnet are 2^6 -2=62.
Increment of network address=decimal value of last bit borrowed=64

Subnet    Network address      Host Range            Broadcast Address
0             192.168.x.0             192.168.x.1-62            192.168.x.63
1             192.168.x.64             192.168.x.65-126      192.168.x.127
2             192.168.x.128             192.168.x.129-190      192.168.x.191
3             192.168.x.192             192.168.x.193-254      192.168.x.255

Note:
Some old routers cannot use subnet 0 and the last subnet thus number of subnets=2^borrowed bit -2. You must borrow at least 2 bits for 2 usable subnets.
--------
We can use 192.168.1.0 with netmask 255.255.0.0 or 192.168.1.0/16 but it is no longer classful. First 2 octets (16 bits) are network addresses. To subnet you must borrow from host bits, i.e. in this example from 3rd and fourth octets. Subnetting method is pretty much the same.
0
 
snoozeitAuthor Commented:
We can use 192.168.1.0 with netmask 255.255.0.0 or 192.168.1.0/16 but it is no longer classful.
->If it is not classful will it still work will the host communicate with each other.
   What is normally done when you have more than 300 hosts, it looks like there can be  251 or lesser ip address in class c.
0
 
zimbulatCommented:
We can use 192.168.1.0 with netmask 255.255.0.0 or 192.168.1.0/16 but it is no longer classful.
->If it is not classful will it still work will the host communicate with each other.
  What is normally done when you have more than 300 hosts, it looks like there can be  251 or lesser ip address in class c.
----------------------------------
Of course the hosts will communicate with each other. Doesn't matter you use classless or classful, both ways work the same. Nowadays I wd say all internet service providers are using classless ip address for their subscribers due to shortage of IPv4. You may want to read about CIDR later.

So, what if you have 300 hosts? The norm that I would go is to use 2 x class C networks. For example, 192.168.1.0/255.255.255.0 and 192.168.2.0/255.255.255.0.

You need a routing mechanism here, use any Windows server with 2 NICs and enable routing. If you have budget get a router or layer-3 switch. We can go for virtual NIC if we have many networks.  

p/s: I read somewhere that keeping 254 ip hosts per network is a good practice.

----------------------------------

The following scenarios are just for ideas....

You can use 192.168.0.0/16 without the need of a router, i.e. all 300 hosts in one network. (Note that 192.186.1.0 is a subset of 192.168.0.0/16).

This network has 2^remaining bits -2=2^16 -2=65,534 usable hosts. Your network will work but 65,534-300=65,234 address space are wasted! It is OK to waste for private network like us but not to service provider.

Anyway, what if we really have 65,000 hosts. The broadcast domain is too large and our network will fail. Consider how are we going to stack/daisy-chaining 1,350 48-port switches together. Not practical or impossible. We must make it smaller by subnetting further and further...

Or,

We can use VLSM (Variable Length Subnet Mask is a means of allocating IP addressing resources to subnets according to their individual need rather than some general network-wide rule)

Always remember that 2^remaining bits -2=usable hosts, right!
2^8 -2=254
2^9 -2=510 >300, enough to cater for your network requirement. 32-9=23 bits for network

Thus you have 192.168.0.0/23 or 255.255.254.0 (11111111.11111111.11111110.00000000)

Network Address            Host Range                  Broadcast Address
192.168.0.0            192.168.0.1-192.168.1.254      192.168.1.255

----------------------------------

All 3 ip addressing methods work well in a small office consisting of 300 hosts. In larger offices I prefer the 254-host/network (or subnet they may refer it).

Btw, you can download free Solarwinds Advanced Subnet Calculator.
0
 
zimbulatCommented:
Sorry typo, (Note that 192.186.1.0 is a subset of 192.168.0.0/16) ---> (Note that 192.168.1.0 is a subset of 192.168.0.0/16)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now