You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old April 19th, 2017, 03:31 PM   #1
Nebul0us
Supporting Member
United States

Nebul0us is offline
 
Join Date: Dec 2015
Location: Spokane, WA
Posts: 62
Subnet mask problem

So for the last few weeks I have been communicating with my PLC's just fine. We use 10.10.10.10 mask 255.255.255.0 on our PLC's. For my laptop I set an IP of 10.10.10.250 mask 255.255.255.0. It has worked fine until today. I was not able to ping my PLC. Finally got IT involved and after a while he was able to get them talking, and what he did was set the mask on my laptop to 255.0.0.0

Can anyone explain to me why this would fix the problem? I also don't understand what could have caused this problem because I haven't changed ANYTHING on my laptops network settings since the last time I went online with a PLC. Can anyone shed some light on this for me? I am having a really hard time wrapping my brain around subnet masking...
__________________
Flippin' Bits...
  Reply With Quote
Old April 19th, 2017, 03:36 PM   #2
dmargineau
Lifetime Supporting Member
United States

dmargineau is offline
 
dmargineau's Avatar
 
Join Date: Dec 2011
Location: Midwest
Posts: 2,147
Do you know the routing setup between your PC and the PLC?
I wonder how many IT switches are in-between? They might use VLANs which have just been 'updated'...
  Reply With Quote
Old April 19th, 2017, 03:55 PM   #3
Jeff23spl
Member
Canada

Jeff23spl is offline
 
Join Date: Jan 2010
Location: Canada
Posts: 784
if someone dare to explain how the mask work, i will be in to learn about it too...
__________________
Siemens Addict
  Reply With Quote
Old April 19th, 2017, 04:00 PM   #4
Nebul0us
Supporting Member
United States

Nebul0us is offline
 
Join Date: Dec 2015
Location: Spokane, WA
Posts: 62
Quote:
Originally Posted by dmargineau View Post
Do you know the routing setup between your PC and the PLC?
I wonder how many IT switches are in-between? They might use VLANs which have just been 'updated'...
No devices between. I am hardwired straight from laptop to PLC. I do have a route added however. Because Windows 10 wants to prioritize WiFi adapter over ethernet, I did a command "route -p add 10.10.10.0 mask 255.255.255.0 metric 5 IF 21" as this allowed me to go online with my PLC while being on WiFi at the same time. Before I had to turn my WiFi off first. I don't believe this should affect my subnet issue though. I've never had a problem before using 10.10.10.250 on my laptop with 10.10.10.10 on my PLC both using 255.255.255.0 subnet mask.
__________________
Flippin' Bits...

Last edited by Nebul0us; April 19th, 2017 at 04:07 PM.
  Reply With Quote
Old April 19th, 2017, 04:21 PM   #5
dmargineau
Lifetime Supporting Member
United States

dmargineau is offline
 
dmargineau's Avatar
 
Join Date: Dec 2011
Location: Midwest
Posts: 2,147
Quote:
Originally Posted by Jeff23spl View Post
if someone dare to explain how the mask work, i will be in to learn about it too...
Subnet masking is a Ethernet network Host local/remote identifier when presented to the TCP/IP protocol; it establishes the Host's Local and Network address.

A Subnet mask is a 32-bit number that masks an IP address, and divides the IP address into network address and host address. Subnet Mask is made by setting network bits to all "1"s and setting host bits to all "0"s. It is used mainly for restricting the number of Hosts on any given network segment (subnet).

The most commonly used mask is 255.255.255.0 (11111111 11111111 11111111 00000000) which limits the number of Hosts on the respective subnet to 254.

The OP mask, 255,0,0,0 (11111111 00000000 00000000 00000000) expands the Host limit count to 16,777,216.
  Reply With Quote
Old April 19th, 2017, 04:27 PM   #6
Nebul0us
Supporting Member
United States

Nebul0us is offline
 
Join Date: Dec 2015
Location: Spokane, WA
Posts: 62
Quote:
Originally Posted by dmargineau View Post
Subnet masking is a Ethernet network Host local/remote identifier when presented to the TCP/IP protocol; it establishes the Host's Local and Network address.

A Subnet mask is a 32-bit number that masks an IP address, and divides the IP address into network address and host address. Subnet Mask is made by setting network bits to all "1"s and setting host bits to all "0"s. It is used mainly for restricting the number of Hosts on any given network segment (subnet).

The most commonly used mask is 255.255.255.0 (11111111 11111111 11111111 00000000) which limits the number of Hosts on the respective subnet to 254.

The OP mask, 255,0,0,0 (11111111 00000000 00000000 00000000) expands the Host limit count to 16,777,216.
I get that. But none of that explains why changing my laptop subnet mask to 255.0.0.0 would fix my issue. I see no reason why 10.10.10.250 mask 255.255.255.0 can't talk to 10.10.10.10 mask 255.255.255.0
__________________
Flippin' Bits...
  Reply With Quote
Old April 19th, 2017, 04:31 PM   #7
dmargineau
Lifetime Supporting Member
United States

dmargineau is offline
 
dmargineau's Avatar
 
Join Date: Dec 2011
Location: Midwest
Posts: 2,147
Quote:
Originally Posted by Nebul0us View Post
No devices between. I am hardwired straight from laptop to PLC. I do have a route added however. Because Windows 10 wants to prioritize WiFi adapter over ethernet, I did a command "route -p add 10.10.10.0 mask 255.255.255.0 metric 5 IF 21" as this allowed me to go online with my PLC while being on WiFi at the same time. Before I had to turn my WiFi off first. I don't believe this should affect my subnet issue though. I've never had a problem before using 10.10.10.250 on my laptop with 10.10.10.10 on my PLC both using 255.255.255.0 subnet mask.


You shouldn't need a router for a direct connection.
When configuring the EtherNet/IP RSLinx driver what choices of Network Adapters you have?
Are you an Administrator on your PC?
  Reply With Quote
Old April 19th, 2017, 04:35 PM   #8
Timbert
Member
United States

Timbert is offline
 
Timbert's Avatar
 
Join Date: May 2011
Location: The middle of the Pacific Ocean
Posts: 325
I want to say that there is no reason that changing the netmask should have fixed the problem.

What was the gateway set to?

Background: What does a netmask do? It determines what is considered a 'local' connection.

The netmask is just like a bitmask in many PLC languages. 255.255.255.0 is the same as 11111111.111111111.11111111.00000000 in binary. So only the last octet is unmasked.

In this case, if anything is sent to an IP address of 10.10.10.xxx is sent from the source to destination. So the computer at 10.10.10.250 should attempt to communicate directly with PLC 10.10.10.10. If you try to connect to another computer lets say, 8.8.8.8, the netmask is used to detect this is on a 'remote' so it forwards the connection to the gateway and the gateway is supposed to route it on to its final destination.

Changing the netmask to 255.0.0.0 means that everything that matches just the first octet is considered local. So, 10.xxx.xxx.xxx should connect directly.

In either case, the netmask should mean the connection is handled locally.

Back to the problem at hand:

The only thing I can think of is that updating the netmask forced an update of the route table. Are you sure that IF 21 is indeed the correct interface? Swapping out external ethernet dongle can cause the interface number to change because windows thinks you are using a different interface (new dongle or different USB port).
__________________
An expert is a man who has made all the mistakes which can be made in a very narrow field. --Niels Bohr as quoted by Edward Teller
  Reply With Quote
Old April 19th, 2017, 06:03 PM   #9
robertkjonesjr
Member
United States

robertkjonesjr is online now
 
Join Date: Jan 2009
Location: NH
Posts: 487
Quote:
Originally Posted by Nebul0us View Post
I did a command "route -p add 10.10.10.0 mask 255.255.255.0 metric 5 IF 21"
I don't think you would have to do this as Windows and most other OSs will add a route for the local subnet of all adapters configured. Where this would be required is if the subnets collided somehow - but I did not see where you listed the WiFi subnet. Is that a 10 network as well? If they are completely separate, something else is going on.

Posting your route table could be helpful - that will determine the interface that will forward the packets, so the answer should lie there. Also that shows if there are multiple default gateways (usually a bad idea) and other such anomalies.

Command: netstat -rn
  Reply With Quote
Old April 19th, 2017, 07:04 PM   #10
Dravik
Member
United States

Dravik is offline
 
Join Date: Jun 2008
Location: New York
Posts: 1,095
Quote:
Originally Posted by robertkjonesjr View Post
I don't think you would have to do this as Windows and most other OSs will add a route for the local subnet of all adapters configured. Where this would be required is if the subnets collided somehow - but I did not see where you listed the WiFi subnet. Is that a 10 network as well? If they are completely separate, something else is going on.

Posting your route table could be helpful - that will determine the interface that will forward the packets, so the answer should lie there. Also that shows if there are multiple default gateways (usually a bad idea) and other such anomalies.

Command: netstat -rn
Yeah, There is a 10.10.10.x network on the wifi side as well. There should be another thread somewhere where we figured that all out.
  Reply With Quote
Old April 19th, 2017, 07:41 PM   #11
Timbert
Member
United States

Timbert is offline
 
Timbert's Avatar
 
Join Date: May 2011
Location: The middle of the Pacific Ocean
Posts: 325
Quote:
Originally Posted by robertkjonesjr View Post
I don't think you would have to do this as Windows and most other OSs will add a route for the local subnet of all adapters configured.
I can attest that Windows does not always configure this properly. It will often create a route but will assign a metric that is below the default routing.
__________________
An expert is a man who has made all the mistakes which can be made in a very narrow field. --Niels Bohr as quoted by Edward Teller
  Reply With Quote
Old April 19th, 2017, 08:06 PM   #12
mk42
Member
United States

mk42 is offline
 
Join Date: Jun 2013
Location: MI
Posts: 1,347
Quote:
Originally Posted by Nebul0us View Post
I get that. But none of that explains why changing my laptop subnet mask to 255.0.0.0 would fix my issue. I see no reason why 10.10.10.250 mask 255.255.255.0 can't talk to 10.10.10.10 mask 255.255.255.0
Subnet masks are easy. It's getting windows to do what you want when there are multiple overlapping interfaces that's hard

I have no idea why your usual method didn't work (terminal command), except that maybe some background service was doing something stupid. Did the problem remain after a reboot? Could you get it to work after you disabled your wireless?

It's possible changing the subnet size changed the priority. Or maybe windows liked it because it was the most recent subnet?
  Reply With Quote
Old April 20th, 2017, 04:48 AM   #13
robertkjonesjr
Member
United States

robertkjonesjr is online now
 
Join Date: Jan 2009
Location: NH
Posts: 487
Quote:
Originally Posted by Dravik View Post
Yeah, There is a 10.10.10.x network on the wifi side as well.
Having the same subnet on multiple interfaces is difficult to deal with, as you see. I would propose a redesign of the network address space - make them separate subnets and it becomes much easier.

Quote:
Originally Posted by Timbert View Post
I can attest that Windows does not always configure this properly. It will often create a route but will assign a metric that is below the default routing.
This is not necessarily a misconfiguration; use of the metric for route entry selection is a secondary factor, the primary factor being the most specific route entry will be selected (i.e. most number of 1 bits in the network mask). Only if there are multiple entries will metric be consulted.

For Microsoft:

https://technet.microsoft.com/en-us/...(v=ws.10).aspx

Since the subnet mask of a default GW entry is /0 or 0.0.0.0, it would always lose to a more specific local subnet route so metric is not relevant when we have a local interface on that specific subnet.

Now if there are multiple default GWs, or if there are overlapping subnets, etc., all manner of mess can occur. If this has to remain poorly designed, I might try a host specific route for the OP, as in set the route destination to the host IP and use a subnet of /32 or 255.255.255.255 and include the IF parameter to point to the interface directly connected. Metric would not matter, because, the 32 bits in the subnet mask will take priority over the other entries.

Another unlikely to work option in the control space is IPv6. That has the concept of link local IP addresses that are auto-assigned/derived, so directly connected devices in the same broadcast domain are usually found easily through neighbor discovery. But the devices all have to support IPv6, as does the software in use.
  Reply With Quote
Old April 21st, 2017, 01:03 AM   #14
Nebul0us
Supporting Member
United States

Nebul0us is offline
 
Join Date: Dec 2015
Location: Spokane, WA
Posts: 62
Quote:
Originally Posted by Dravik View Post
Yeah, There is a 10.10.10.x network on the wifi side as well. There should be another thread somewhere where we figured that all out.
I don't believe that is the case. Some of us have HP Zbooks and some guys have the tried and true m6800 dell. It's only the newer HP laptops on windows 10 that have the issue of not being able to connect to 10.10.10.x when WiFi is enabled. The windows 7 laptops don't have the issue.
__________________
Flippin' Bits...
  Reply With Quote
Old April 21st, 2017, 07:36 AM   #15
dmargineau
Lifetime Supporting Member
United States

dmargineau is offline
 
dmargineau's Avatar
 
Join Date: Dec 2011
Location: Midwest
Posts: 2,147
Quote:
Originally Posted by Nebul0us View Post
I don't believe that is the case. Some of us have HP Zbooks and some guys have the tried and true m6800 dell. It's only the newer HP laptops on windows 10 that have the issue of not being able to connect to 10.10.10.x when WiFi is enabled. The windows 7 laptops don't have the issue.
It probably is Win10 after all; at least it's the last Windows; forever...

I have personally acquired a preference when it comes to my laptop's Ethernet connectivity and it served me well for the past fifteen years or so.

Since the on-board NIC was always bound to each site's connectivity settings all the way up to WAN and Domain levels, I have been using a USB-to-Ethernet adapter to connect to automation networks.

The adapter's Network Connection exists only when plugged in and the settings could be quickly matched to the subnet I am trying to connect to; my RSLinx EtherNet/IP drivers carry the "names" of the sites/customers and are all pointing to said adapter.

I could use it from inside VMs as a peripheral disconnected from the Host and it never let me down; it could even connect to DHCP servers in SCADA environments.

My laptop's typical network topology consists of three live and functionally independent connections:
-USB-to-Ethernet patched to an automation subnet;
-on-board NIC patched to the local LAN;
-WiFi connected to a WAN wireless access point.

Every now and then I even Bluetooth my cell phone in; ya know , for 'personal communications'...
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
FactoryTalk View Studio ME longterm problem buzz339 LIVE PLC Questions And Answers 13 September 19th, 2016 07:04 PM
HMI communication problem. Elcan LIVE PLC Questions And Answers 10 April 22nd, 2016 08:09 AM
How to choose IP address and Subnet Mask fasacrifice LIVE PLC Questions And Answers 18 January 20th, 2016 04:03 PM
TI-565 Weird comms and/or config problem RoTaTech LIVE PLC Questions And Answers 7 May 4th, 2009 05:59 PM
Ab Plc5 Rio Problem. fernandes LIVE PLC Questions And Answers 5 March 7th, 2004 01:25 PM


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


.