Uploaded image for project: 'snmp4sdn'
  1. snmp4sdn
  2. SNMP4SDN-25

Topology discovery failed due to not able to fetch port number in SNMP4SDN due to Short Datatype

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • unspecified
    • General
    • None
    • Operating System: All
      Platform: All

    • 9269

      We are not able to discover switches in SNMP4SDN for switches having interface number more than 5 digit.

      While debugging we have found that there is an issue in SNMPHandler.java class in SNMP4SDN project. In below method short data type is used for parsing interface number. Below method executes well for interface number less than 6 digits but throws NumberFormatException otherwise.

      private Short retrievePortNumFromPortOID(String oidstr)

      {//input is eg. :iso.0.8802.1.1.2.1.3.7.1.3.52, return is eg. 52 //e.g. oidstr as "iso.0.8802.1.1.2.1.4.1.1.5.0.49.1", then return "49" int index = oidstr.lastIndexOf(".") + 1; String ansStr= oidstr.substring(index); Short ans = Short.parseShort(ansStr); //CULPRIT //logger.debug("oidstr (" + oidstr +") to retrieve port number:" + ans); return ans; }

      Same is replicated in other methods where Short data type has been used.

            Unassigned Unassigned
            khedkar.suraj@gmail.com SURAJ KHEDKAR
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: