cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3724
Views
13
Helpful
11
Replies

Subnet mask problem

I have a simple network in my office. 192.168.10.0/24

In this network my server ip add is 192.168.10.10/24. and around 200 computer are connceted with it through switch.All client computer have 255.255.255.0 subnet mask.

Someone has changed the ip address of my server to 192.168.10.10/16 . That mean only subnetmask has been changed.

But All client computers are still able to connect to my server.

I have changed the subnetmask of some client computers to 255.255.0.0 . And some are still having 255.255.255.0 subnet. All computers are connecting to the server.

How does it possible?

pls help me

11 Replies 11

Thank you Steve. But still it is not clear to me,I think I could not explain my problem.

Why two different network connecting each other without having router or L3 switch?

After changing my servers subnetmask (from 24 bit to 16 bit) it is still accesable by all client computers.Now my server and clients have different sunetmusk.

Is it because of 192.168.0.0 ip range?

Pls tell me the reason.

Hi,

I think ur network address range is 192.168.10.0/24 and all the servers,users ets are connected in same switch.Right?

If so even if u make the subnet mask /16 ur network for that server is 192.168.0.0 an dthe destination which u want to reach is also matching the same network.So no need of L3 devices here.

Hope this makes u understand..

Pratap

There is an aspect of the explanation which has not yet been brought out clearly. The server and the clients are all in the same broadcast domain. This means that the server and the clients can ARP for each other, respond to ARP from each other, and communication takes place with no problem.

The other aspect to consider is that whether the mask is 192.168.10.0/24 or is 192.168.0.0/16 the clients still believe that the server address is still within their connected subnet. So all the devices (server and clients) will ARP for each other directly and continue to communicate.

If the mask had been changed in the other direction (perhaps to make it /28) then some of the clients would have believed that the server address was in a remote subnet and would have tried to use their default gateway to get to the server. But with mask of /16 or /24 all clients believe that the server is local and do not try to use their default gateway.

HTH

Rick

HTH

Rick

Jon Marshall
Hall of Fame
Hall of Fame

Hi

Assuming clients and servers are in the same vlan on the switch here is what is happening.

When a device wants to send a packet to another device the first thing it needs to do is decide whether or not the other device is in the same subnet or not. It does this by comparing the destination ip address with it's own subnet. If the device is on the same subnet then it arps out for the mac-address (assuming it hasn't got it in it's cache) and if it is on a different subnet it arps out for it's default-gateway mac-address. So an example

Server = 192.168.10.10 subnet mask 255.255.0.0

Client = 192.168.10.20 subnet mask 255.255.255.0

Client wants to send packet to server so it first finds out it's own network

192.168.10.20 255.255.255.0 -> network = 192.168.10.0

It then compares the server address with it's OWN subnet mask (because it only knows it's own subnet mask)

192.168.10.10 255.255.255.0 -> network = 192.168.10.0

So the client thinks the server is on the same network. It's arps out for mac-address of the server and because the server and client are in the same layer 2 vlan the server receives the broadcast and responds with it's ip address.

So the server needs to send a packet back to the client. Following the same procedure as the client

1) server finds it's own network. 192.168.10.10 255.255.0.0 -> network = 192.168.0.0

2) Server compares client address with its own subnet mask - 192.168.10.20 255.255.0.0 -> network 192.168.0.0

So as with the client the server thinks it is on the same subnet and so sends the packet and because the ports are in the same vlan communication is possible.

Hope this explains it.

** Edit - sorry Rick, my reply took a while to type out so yours arrived in the meantime **

Jon

Jon

It happens frequently - no problem. I am gratified that we both took the same approach in explaining the issue. I like the examples that you worked in the explanation. It is a nice illustration of the concept that we were both explaining. Rated as deserved.

HTH

Rick

HTH

Rick

Rick

Many thanks for rating and kind words.

Jon

Thank you Jon for your reply.

That means in this case, two different subnet masks have no function?

Then what is the meaning of giving different subnet mask? . We usually give different subnet mask to different device to create different network. But still client with 255.255.255.0 subnet mask and clients with 255.255.0.0 subnet mask are being considered on the same network.

That mean, here 192.168.10.0 /16 is acting as class B address? Please reply

Pratap

In your situation the different masks used have not caused problems (at least not yet). But that does not mean that the subnet masks have no function. They definitely have a function and that function is to help the device to figure what range of addresses are in the local subnet (for which we should ARP to communicate directly) and what range of addresses are remote (for which we should forward through our default gateway).

To understand the relationship I believe that it is helpful to consider both the layer 2 network (the VLAN) and the layer 3 network (the subnet). The layer 2 network (the VLAN) defines the broadcast domain. Any 2 devices within the VLAN can ARP for each other and can communicate directly. If there are 2 devices but each is in a different VLAN then they can not ARP for each other and must go through a gateway (default gateway) to communicate with each other.

The boundaries of the layer 2 network and the boundaries of the layer 3 network should be the same. We assume that there is an equivalence between subnet and VLAN (all the devices within the subnet are in the same VLAN and that all devices within the VLAN are within the same subnet). When the implementation of the network follows this assumption then everything works. When the implementation does not follow this then problems may happen. In your case there is not a problem - at least not yet. But if you continue to configure some devices with 192.168.0.0/16 and some devices with 192.168.10.0/24 it is likely that problems will happen at some point. Consider for example what will happen if the server is 192.168.10.10/16 and some client is 192.168.51.10/24 and the client is in a different VLAN. The server will believe that the client is local and will ARP for it. The client will not receive the ARP because it is in a different VLAN and will not respond. Because the server does not receive a response to its ARP then the server can not communicate with the client.

It is certainly best practice that all devices within a VLAN use the same subnet mask and that the subnet mask accurately describe the range of IP addresses assigned to devices within that VLAN.

HTH

Rick

HTH

Rick

There is a difference in behavior between the two cases. I'm going to explain using 172.16.0.0 as an example because it is evident we are talking about subnets of a Class-B. But in fact, the class is irrelevant for this argument, only the masks matter.

Consider the first case: the router has an address (172.16.1.1, 255.255.255.0) and the host has (172.16.1.2, 255.255.255.0.

- If the host want to talk to 172.16.1.3, it knows the destination is on its own subnet, so it ARPs for 172.16.1.3. The router does not participate.

- If the host wants to talk to 172.16.2.3, then it ARPs for 172.16.1.1 (the router), and sends the packet there. The packet goes through the router.

Now consider the case where the router is (172.16.1.1, 255.255.255.0), but the host is (172.16.1.2, 255.255.0.0).

- If the host wants to talk to 172.16.1.3, it ARPs for 172.16.1.3, and the router does not participate. Just like before.

- If the host want to talk to 172.16.2.3, it thinks the destination is on its own subnet, so it ARPs for 172.16.2.3. Now, provided the router has a route to 172.16.2.3, it will offer its own ARP response as a proxy, which means the host will send the packet to the router, who will forward it.

Now consider the case where the router is (172.16.1.1, 255.255.0.0), but the host is (172.16.1.2, 255.255.255.0).

- If the host wants to talk to 172.16.1.3, it ARPs for 172.16.1.3, and the router does not participate. Just like before.

- If the host want to talk to 172.16.2.3, it thinks the destination is off its subnet, so it ARPs for 172.16.1.1. The router replies, which means the host will send the packet to the router. The router will then send the packet back to the LAN to its destination. That is, the packet gets bounced off the router.

Kevin Dorrell

Luxembourg

Kevin

In your second case where the router is 172.16.1.1/24 and the host is 172.16.1.2/16 and the host ARPs for 172.16.2.3 which it believes is local. You correctly identify the dependency that the router must have a route to the subnet of 172.162.0 to be able to respond. It is also a dependency that the router must have enabled proxy arp. In my experience it is becoming more common that people have turned off proxy arp because of security concerns. If proxy arp is not enabled the hosts will not communicate.

HTH

Rick

HTH

Rick
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: