SNMP

nakedpanicnakedpanic
edited June 2012 in InfraSensing Sensors
I am having an issue where I am using socket programming in a programmable logic controller using a special web card. I am doing a SNMP get request write to a gateway's IP and port # (161). I receive and read the response from my port and parse the data. This works great.



When I add another gateway to the network and make the same request to one gateway, both gateways respond. This happens when I make a request to either gateway. This is a little troublesome because I will eventually have 10-15 gateways, and I have to read each response to clear the socket when I only wanted the 1.

Comments

  • AdministratorAdministrator
    Are you addressing your gateways by their IP address or host name? If by host name then make sure they are all different.
  • nakedpanicnakedpanic
    I use IP and port.
  • AdministratorAdministrator
    Do the sensors each have a different MAC address?
  • nakedpanicnakedpanic
    Yes. and Net Bios name.
  • nakedpanicnakedpanic
    I also tried a sample VB program I found that has a SNMP socket demo. Both respond from request to 1 IP.
  • AdministratorAdministrator
    Something must be wrong in your code then. From a technical point of view this is not possible from a SensorGateway perspective.



    The way SNMP works is through the UDP protocol. UDP means that a packet is sent to a specific device and that device responds to it. The big difference with TCP is that there is no handshake. If 2 systems respond, then this means that 2 systems have received the UDP packet - so this means that it was sent to 2 devices.
  • nakedpanicnakedpanic
    But it's from 2 different applications, and the vb app came from sample code on a vb website, completely unmodified. I'm thinking the UDP is multicast and the sensor isn't verifying the request ip and it's own ip, only the port # and responding.



    What can be wrong when only one is on the network, and it responds correctly. I've used wireshark to trace the network and the SNMP request is only going to one IP address.
  • nakedpanicnakedpanic
    i took a screenshot of the trace. Doesn't look like I can post it here though.



    Shows 1 get request with specific IP address, with 2 get responses from said IP address and other IP address. This using wireshark.
  • nakedpanicnakedpanic
    Screen shot of trace.



    image
  • AdministratorAdministrator
    Here is a simple way to test it. Download our free SNMP Mib browser from www.serverscheck.com/mib_browser/



    Connect to a sensor and do a SNMP Walk and then a SNMP Get request on the OID matching the system. If you get the correct response back, then it is your code. If you get incorrect responses back, then it is your setup (duplicate IP, hostname or MAC)
  • nakedpanicnakedpanic
    It appears there is IP filtering in the MIB browser, so I am watching the trace.



    I have 2 sensors, IP 201 and 203.

    When I request 201, 201 and 203 send a response

    When I request 203, only 203 responds





    image
  • nakedpanicnakedpanic
    I confirmed both of my applications get the 1 response from 203 but get both responses when get requesting 201, same as the MIB browser.
  • nakedpanicnakedpanic
    Here are both network setups:



    image



    image
  • nakedpanicnakedpanic
    I've changed the MAC address, IP address and Net Bios name on 203, now 202. But it still responds on a request to 201.
  • AdministratorAdministrator
    OK. Try defining a gateway. Could be that the lack of a gateway is causing the issue.
  • nakedpanicnakedpanic
    same. what do you think about reinstalling firmware. The one in question I've had for a number of months, but the firmware indicates they match between the one I just purchased. I will probably purchase a replacement for this one if it continues.
  • AdministratorAdministrator
    I have tested here in our test lab with many different sensors running on a Cisco PoE switch and none of them is having the behavior. No one ever reported the issue either as far as we could look it up in here or in the commercial support system.



    The issue must be somewhere in your network where the requests are sent to multiple sensors and not the sensor in question.



    That being said, you can easily filter it out by verifying if your SNMP UDP response matches the IP address you sent it to and that way there is no issue.
  • nakedpanicnakedpanic
    I've got the 2 sensors and PC just on a cheap switch, the sensors are powered via plug.



    Question: are these universal power, either power plug or PoE? My installation will be PoE, but I don't have a PoE for testing.
  • AdministratorAdministrator
    Either is supported: power plug or PoE
  • nakedpanicnakedpanic
    Do you know length of warranty, and if the suspect gateway may fit under this?
  • AdministratorAdministrator
    Warranty covers manufacturing defects. It is 1 year from date of purchase.
This discussion has been closed.