IP subnet mask lesson ?

Jeff23spl

Member
Join Date
Jan 2010
Location
Canada
Posts
860
I started programming at time of serial connection and made my way to ip with try and error until it works. At first you had a backup serial connection for emergency but new low cost plc are only relying on ip port...When you lose it, sometimes it is very difficult to get it back online...

I learned that the first 3 parts of the ip adress should be equal between device connected toghether on a standard switch but is it because of the mask that a different adress level doesn't see the other one ?
What is the real use of mask and how doest it filter the ip adress values?
I often see 255.255.0.0 or 255.255.255.0, which one is better to use ?

Thanks
 
If a device is set up with an IP address of 192.168.187.1 for example with a subnet mask of 255.255.255.0 it would be able to communicate with any compatible device with an IP address of 192.168.187.2-255. If the subnet mask was set at 255.255.0.0 it would be able to communicate to devices with an address range of 192.168.xxx.xxx. If the subnet mask was set at 255.0.0.0 then any device with an IP address in the range of 192.xxx.xxx.xxx should be reachable.
 
In an IP address you have 4 octets that have 8 bits each whcih is why the highest number you can go to is 255. highest count in binary with 8 bits is 255.

The mask simply tells network equipment which part of the address is the subnet (network) and which part is the nodes.

What you likely encounter most is /24 CIDR which means 24 bits of the mask determine the subnet and the other 8 are for nodes

So 192.168.1.1 networl with a mask of 255.255.255.0 gives you 254 nodes and 1 broadcast address which would be 192.168.1.255

By using the same address with a mask of 255.255.0.0 you have 16 bits for the subnet and 16 bits for nodes thus you would have 65534 numbers of nodes and your broadcast address would be 192.168.255.255 this is all used depending on many factors of your network design.

There are many other combinates other than my example I just used a very common example.
 
i was believing also that a 255.255.0.0 was just limiting less adress to work but in a specific install, it wasn't working until i changed the mask for 255.255.255.0 and i'm really wondering why...My local adress where just different on the last part
This mask config was into my hmi settings and this plc was connected to a vpn switch directly connected to incoming phone line for ethernet. This was for a remote connection option. It was working localy but not thru the vpn switch remotely. When i changed the mask, it worked like a charm??? Is it just because the vpn switch was seeing a problem with that mask being too large for ip possibility ?
 
Your subnet has to match, otherwise the devices can't see each other, at least not without the help of a router. When you changed the mask, it changed the subnet the device is on.

When you change from a mask of 255.255.255.0 to 255.255.0.0 you changed the broadcast address from x.x.x.255 to x.x.255.255 as well as the subnet ID.
 
Your subnet has to match, otherwise the devices can't see each other, at least not without the help of a router. When you changed the mask, it changed the subnet the device is on.

When you change from a mask of 255.255.255.0 to 255.255.0.0 you changed the broadcast address from x.x.x.255 to x.x.255.255 as well as the subnet ID.

So long as you steer clear of xxx.xxx.xxx.0 and xxx.xxx.xxx.255 then it is not necessary for subnet masks to match.

All that is needed is for the 2 IP addresses to have the same NetID (portion of the IP address where the subnet mask = 1)
 
So long as you steer clear of xxx.xxx.xxx.0 and xxx.xxx.xxx.255 then it is not necessary for subnet masks to match.

All that is needed is for the 2 IP addresses to have the same NetID (portion of the IP address where the subnet mask = 1)

If your equipment is using the broadcast address then this is not true.

Device 1
IP - 192.168.1.100
Mask - 255.255.0.0
Broadcast 192.168.255.255

Device 2
IP - 192.168.1.101
Mask - 255.255.255.0
Broadcast - 192.168.1.255

Broadcasts between Device 1 and Device 2 cannot be seen by one another.
 

Similar Topics

Hi. Rockwell learning curve 132-1b. I was having trouble to change IP address on a EN2TR. Finally found out that I need to change the IP...
Replies
1
Views
743
I am working with a 1768-ENBT and I was able to connect to it through my laptop. My laptop IP is 192.168.1.10 subnet 255.255.255.0 and the PLC...
Replies
12
Views
1,548
I could not connect to or PLC over or network so I checked and the IP address is correct, but the subnet and gateway are incorrect. It has a...
Replies
2
Views
1,982
Hello guys, How can I change subnet mask on ET200. It is grayed out. I am using TIA 14
Replies
9
Views
2,312
Hi all, We have to change the subnet mask on ~400 E/IP devices to make the network bigger. Is there a quick way to do that? I can do them one at...
Replies
9
Views
2,785
Back
Top Bottom