Bug 479610

Summary: [TAHI] ICMP Statistics icmpStatsInMsgs Counter Check error on RFC4293
Product: Red Hat Enterprise Linux 5 Reporter: wang jiabo <jiabwang>
Component: net-snmpAssignee: Jan Safranek <jsafrane>
Status: CLOSED NOTABUG QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: low    
Version: 5.3CC: llim
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-03-18 08:22:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description wang jiabo 2009-01-12 02:54:42 UTC
Description of problem:
icmpStatsInMsgs counter(2) UNMATCHED (recv: 7 exp: 8)

Version-Release number of selected component (if applicable):
net-snmp-5.3.2.2-5.el5.i386
net-snmp-perl-5.3.2.2-5.el5.i386
net-snmp-utils-5.3.2.2-5.el5.i386


How reproducible:
every time

Steps to Reproduce:
1.
2.
3.
  
Actual results:
icmpStatsInMsgs counter test failure

Expected results:
icmpStatsInMsgs counter test pass

Additional info:

log info:

Test Sequence Execution Log
17:21:02	Start

	Initialization
17:21:02	Start Capturing Packets (Link0)
17:21:02	vSend(Link0,echo_request_global)
Send Echo Request (Global address)
17:21:02 	vRecv(Link0,echo_reply_global ns_global ns_global_sll ns_global_from_local ns_global_sll_from_local ns_local ns_local_sll) timeout:5 cntLimit:0 seektime:0
Receive Echo Reply (Global address)

	TN can receive Echo Reply from NUT.
17:21:02	Stop Capturing Packets (Link0)
17:21:02	SNMP Connect
  SrcAddr:3ffe:501:ffff:100::20  SrcPort:2000
  DstAddr:3ffe:501:ffff:100:021d:0fff:fe0f:be4e  DstPort:161
done
  SocketID:3

	TN tries to get icmpStatsInMsgs.ipv6(2) counter
17:21:02	SNMP try to send...
  SrcAddr:3ffe:501:ffff:100::20  SrcPort:2000
  DstAddr:3ffe:501:ffff:100:021d:0fff:fe0f:be4e  DstPort:161
done
  send to SocketID:3
send 1st SNMP packet
17:21:02	SNMP try to receive...
  SrcAddr:3ffe:501:ffff:100:021d:0fff:fe0f:be4e  SrcPort:161
  DstAddr:3ffe:501:ffff:100::20  DstPort:2000
done
  received from SocketID:3
received 2nd SNMP packet

	Analysis (returned packet)
2. NUT returns the icmpStatsInMsgs.ipv6(2) value.
ASN.1 Judgement 	SNMP_Version
OK
SNMP_Community
OK
SNMP_PDU
PDU-type OK
Request-ID OK
Error-Status OK
Error-Index OK
SNMP_VarBinding_Lists
Sequence-Type OK
Varbinding-Lists OK

	OK, get icmpStatsInMsgs counter(1) = 7

	Sending Echo-request to NUT
17:21:02	Start Capturing Packets (Link0)
17:21:02	vSend(Link0,echo_request_global)
Send Echo Request (Global address)
17:21:02 	vRecv(Link0,echo_reply_global ns_global ns_global_sll ns_global_from_local ns_global_sll_from_local ns_local ns_local_sll) timeout:5 cntLimit:0 seektime:0
Receive Echo Reply (Global address)

	TN receive Echo Reply from NUT.
17:21:02	Stop Capturing Packets (Link0)

	Sending the GetRequest icmpStatsInMsgs.ipv6(2) to NUT
17:21:02	SNMP try to send...
  SrcAddr:3ffe:501:ffff:100::20  SrcPort:2000
  DstAddr:3ffe:501:ffff:100:021d:0fff:fe0f:be4e  DstPort:161
done
  send to SocketID:3
send 3rd SNMP packet
17:21:02	SNMP try to receive...
  SrcAddr:3ffe:501:ffff:100:021d:0fff:fe0f:be4e  SrcPort:161
  DstAddr:3ffe:501:ffff:100::20  DstPort:2000
done
  received from SocketID:3
received 4th SNMP packet

	Judgment (last returned packet)
4. TN send SNMPv2C GetRequest icmpStatsInMsgs.ipv6(2) again to check its value.
ASN.1 Judgement 	SNMP_Version
OK
SNMP_Community
OK
SNMP_PDU
PDU-type OK
Request-ID OK
Error-Status OK
Error-Index OK
SNMP_VarBinding_Lists
Sequence-Type OK
Varbinding-Lists OK

	icmpStatsInMsgs counter(2) UNMATCHED (recv: 7 exp: 8)

	FAIL
17:21:02	End
Packet Reverse Log

      Send Echo Request (Global address) at 17:21:02

      Frame_Ether                     (length:68)
      | Hdr_Ether                       (length:14)
      | | DestinationAddress               = 00:1d:0f:0f:be:4e
      | | SourceAddress                    = 00:00:00:00:01:00
      | | Type                             = 34525
      | Packet_IPv6                     (length:54)
      | | Hdr_IPv6                        (length:40)
      | | | Version                          = 6
      | | | TrafficClass                     = 0
      | | | FlowLabel                        = 0
      | | | PayloadLength                    = 14
      | | | NextHeader                       = 58
      | | | HopLimit                         = 64
      | | | SourceAddress                    = 3ffe:501:ffff:100:200:ff:fe00:100
      | | | DestinationAddress               = 3ffe:501:ffff:100:21d:fff:fe0f:be4e
      | | ICMPv6_EchoRequest              (length:14)
      | | | Type                             = 128
      | | | Code                             = 0
      | | | Checksum                         = 9022 calc(9022)
      | | | Identifier                       = 0
      | | | SequenceNumber                   = 0
      | | | Payload                         (length:6)
      | | | | data                             = ffffffff ffff

      Recv at 17:21:02

      Frame_Ether                     (length:68)
      | Hdr_Ether                       (length:14)
      | | DestinationAddress               = 00:00:00:00:01:00
      | | SourceAddress                    = 00:1d:0f:0f:be:4e
      | | Type                             = 34525
      | Packet_IPv6                     (length:54)
      | | Hdr_IPv6                        (length:40)
      | | | Version                          = 6
      | | | TrafficClass                     = 0
      | | | FlowLabel                        = 0
      | | | PayloadLength                    = 14
      | | | NextHeader                       = 58
      | | | HopLimit                         = 254
      | | | SourceAddress                    = 3ffe:501:ffff:100:21d:fff:fe0f:be4e
      | | | DestinationAddress               = 3ffe:501:ffff:100:200:ff:fe00:100
      | | ICMPv6_EchoReply                (length:14)
      | | | Type                             = 129
      | | | Code                             = 0
      | | | Checksum                         = 8766 calc(8766)
      | | | Identifier                       = 0
      | | | SequenceNumber                   = 0
      | | | Payload                         (length:6)
      | | | | data                             = ffffffff ffff
      ===echo_reply_global=================================

      Send 1st SNMP packet at 17:21:02

      IP Packet
      | IP Header
      | | Version                    = 6
      | | Source Address             = 3ffe:501:ffff:100::20
      | | Destination Address        = 3ffe:501:ffff:100:21d:fff:fe0f:be4e
      | UDP Header
      | | Source Port                = 2000
      | | Destination Port           = 161
      | +SNMP ASN.1 Message     (42 bytes)
      | |  type                      = 48 (0x30)
      | |  length                    = 40 (0x28)
      | | +version                (3 bytes)
      | | |  type                    = 2 (0x02)
      | | |  length                  = 1 (0x01)
      | | |  value                   = 1 (0x01)
      | | +community              (8 bytes)
      | | |  type                    = 4 (0x04)
      | | |  length                  = 6 (0x06)
      | | |  value                   = public (0x7075626c6963)
      | | +PDU                    (29 bytes)
      | | |  type                    = 160 (0xa0)
      | | |  length                  = 27 (0x1b)
      | | | +request-id             (3 bytes)
      | | | |  type                  = 2 (0x02)
      | | | |  length                = 1 (0x01)
      | | | |  value                 = 12 (0x0c)
      | | | +error-status           (3 bytes)
      | | | |  type                  = 2 (0x02)
      | | | |  length                = 1 (0x01)
      | | | |  value                 = 0 (0x00)
      | | | +error-index            (3 bytes)
      | | | |  type                  = 2 (0x02)
      | | | |  length                = 1 (0x01)
      | | | |  value                 = 0 (0x00)
      | | | +VarBindList            (18 bytes)
      | | | |  type                  = 48 (0x30)
      | | | |  length                = 16 (0x10)
      | | | | +VarBind[1]             (16 bytes)
      | | | | |  type                = 48 (0x30)
      | | | | |  length              = 14 (0x0e)
      | | | | | +VarBind[1]{name}       (12 bytes)
      | | | | | |  type              = 6 (0x06)
      | | | | | |  length            = 10 (0x0a)
      | | | | | |  value             = 1.3.6.1.2.1.5.29.1.2.2 (0x2b06010201051d010202)
      | | | | | +VarBind[1]{value}      (2 bytes)
      | | | | | |  type              = 5 (0x05)
      | | | | | |  length            = 0 (0x00)

      Recv 2nd SNMP packet at 17:21:02

      IP Packet
      | IP Header
      | | Version                    = 6
      | | Source Address             = 3ffe:501:ffff:100:21d:fff:fe0f:be4e
      | | Destination Address        = 3ffe:501:ffff:100::20
      | UDP Header
      | | Source Port                = 161
      | | Destination Port           = 2000
      | +SNMP ASN.1 Message     (43 bytes)
      | |  type                      = 48 (0x30)
      | |  length                    = 41 (0x29)
      | | +version                (3 bytes)
      | | |  type                    = 2 (0x02)
      | | |  length                  = 1 (0x01)
      | | |  value                   = 1 (0x01)
      | | +community              (8 bytes)
      | | |  type                    = 4 (0x04)
      | | |  length                  = 6 (0x06)
      | | |  value                   = public (0x7075626c6963)
      | | +PDU                    (30 bytes)
      | | |  type                    = 162 (0xa2)
      | | |  length                  = 28 (0x1c)
      | | | +request-id             (3 bytes)
      | | | |  type                  = 2 (0x02)
      | | | |  length                = 1 (0x01)
      | | | |  value                 = 12 (0x0c)
      | | | +error-status           (3 bytes)
      | | | |  type                  = 2 (0x02)
      | | | |  length                = 1 (0x01)
      | | | |  value                 = 0 (0x00)
      | | | +error-index            (3 bytes)
      | | | |  type                  = 2 (0x02)
      | | | |  length                = 1 (0x01)
      | | | |  value                 = 0 (0x00)
      | | | +VarBindList            (19 bytes)
      | | | |  type                  = 48 (0x30)
      | | | |  length                = 17 (0x11)
      | | | | +VarBind[1]             (17 bytes)
      | | | | |  type                = 48 (0x30)
      | | | | |  length              = 15 (0x0f)
      | | | | | +VarBind[1]{name}       (12 bytes)
      | | | | | |  type              = 6 (0x06)
      | | | | | |  length            = 10 (0x0a)
      | | | | | |  value             = 1.3.6.1.2.1.5.29.1.2.2 (0x2b06010201051d010202)
      | | | | | +VarBind[1]{value}      (3 bytes)
      | | | | | |  type              = 65 (0x41)
      | | | | | |  length            = 1 (0x01)
      | | | | | |  value             = 7 (0x07)

      Send Echo Request (Global address) at 17:21:02

      Frame_Ether                     (length:68)
      | Hdr_Ether                       (length:14)
      | | DestinationAddress               = 00:1d:0f:0f:be:4e
      | | SourceAddress                    = 00:00:00:00:01:00
      | | Type                             = 34525
      | Packet_IPv6                     (length:54)
      | | Hdr_IPv6                        (length:40)
      | | | Version                          = 6
      | | | TrafficClass                     = 0
      | | | FlowLabel                        = 0
      | | | PayloadLength                    = 14
      | | | NextHeader                       = 58
      | | | HopLimit                         = 64
      | | | SourceAddress                    = 3ffe:501:ffff:100:200:ff:fe00:100
      | | | DestinationAddress               = 3ffe:501:ffff:100:21d:fff:fe0f:be4e
      | | ICMPv6_EchoRequest              (length:14)
      | | | Type                             = 128
      | | | Code                             = 0
      | | | Checksum                         = 9022 calc(9022)
      | | | Identifier                       = 0
      | | | SequenceNumber                   = 0
      | | | Payload                         (length:6)
      | | | | data                             = ffffffff ffff

      Recv at 17:21:02

      Frame_Ether                     (length:68)
      | Hdr_Ether                       (length:14)
      | | DestinationAddress               = 00:00:00:00:01:00
      | | SourceAddress                    = 00:1d:0f:0f:be:4e
      | | Type                             = 34525
      | Packet_IPv6                     (length:54)
      | | Hdr_IPv6                        (length:40)
      | | | Version                          = 6
      | | | TrafficClass                     = 0
      | | | FlowLabel                        = 0
      | | | PayloadLength                    = 14
      | | | NextHeader                       = 58
      | | | HopLimit                         = 254
      | | | SourceAddress                    = 3ffe:501:ffff:100:21d:fff:fe0f:be4e
      | | | DestinationAddress               = 3ffe:501:ffff:100:200:ff:fe00:100
      | | ICMPv6_EchoReply                (length:14)
      | | | Type                             = 129
      | | | Code                             = 0
      | | | Checksum                         = 8766 calc(8766)
      | | | Identifier                       = 0
      | | | SequenceNumber                   = 0
      | | | Payload                         (length:6)
      | | | | data                             = ffffffff ffff
      ===echo_reply_global=================================

      Send 3rd SNMP packet at 17:21:02

      IP Packet
      | IP Header
      | | Version                    = 6
      | | Source Address             = 3ffe:501:ffff:100::20
      | | Destination Address        = 3ffe:501:ffff:100:21d:fff:fe0f:be4e
      | UDP Header
      | | Source Port                = 2000
      | | Destination Port           = 161
      | +SNMP ASN.1 Message     (42 bytes)
      | |  type                      = 48 (0x30)
      | |  length                    = 40 (0x28)
      | | +version                (3 bytes)
      | | |  type                    = 2 (0x02)
      | | |  length                  = 1 (0x01)
      | | |  value                   = 1 (0x01)
      | | +community              (8 bytes)
      | | |  type                    = 4 (0x04)
      | | |  length                  = 6 (0x06)
      | | |  value                   = public (0x7075626c6963)
      | | +PDU                    (29 bytes)
      | | |  type                    = 160 (0xa0)
      | | |  length                  = 27 (0x1b)
      | | | +request-id             (3 bytes)
      | | | |  type                  = 2 (0x02)
      | | | |  length                = 1 (0x01)
      | | | |  value                 = 13 (0x0d)
      | | | +error-status           (3 bytes)
      | | | |  type                  = 2 (0x02)
      | | | |  length                = 1 (0x01)
      | | | |  value                 = 0 (0x00)
      | | | +error-index            (3 bytes)
      | | | |  type                  = 2 (0x02)
      | | | |  length                = 1 (0x01)
      | | | |  value                 = 0 (0x00)
      | | | +VarBindList            (18 bytes)
      | | | |  type                  = 48 (0x30)
      | | | |  length                = 16 (0x10)
      | | | | +VarBind[1]             (16 bytes)
      | | | | |  type                = 48 (0x30)
      | | | | |  length              = 14 (0x0e)
      | | | | | +VarBind[1]{name}       (12 bytes)
      | | | | | |  type              = 6 (0x06)
      | | | | | |  length            = 10 (0x0a)
      | | | | | |  value             = 1.3.6.1.2.1.5.29.1.2.2 (0x2b06010201051d010202)
      | | | | | +VarBind[1]{value}      (2 bytes)
      | | | | | |  type              = 5 (0x05)
      | | | | | |  length            = 0 (0x00)

      Recv 4th SNMP packet at 17:21:02

      IP Packet
      | IP Header
      | | Version                    = 6
      | | Source Address             = 3ffe:501:ffff:100:21d:fff:fe0f:be4e
      | | Destination Address        = 3ffe:501:ffff:100::20
      | UDP Header
      | | Source Port                = 161
      | | Destination Port           = 2000
      | +SNMP ASN.1 Message     (43 bytes)
      | |  type                      = 48 (0x30)
      | |  length                    = 41 (0x29)
      | | +version                (3 bytes)
      | | |  type                    = 2 (0x02)
      | | |  length                  = 1 (0x01)
      | | |  value                   = 1 (0x01)
      | | +community              (8 bytes)
      | | |  type                    = 4 (0x04)
      | | |  length                  = 6 (0x06)
      | | |  value                   = public (0x7075626c6963)
      | | +PDU                    (30 bytes)
      | | |  type                    = 162 (0xa2)
      | | |  length                  = 28 (0x1c)
      | | | +request-id             (3 bytes)
      | | | |  type                  = 2 (0x02)
      | | | |  length                = 1 (0x01)
      | | | |  value                 = 13 (0x0d)
      | | | +error-status           (3 bytes)
      | | | |  type                  = 2 (0x02)
      | | | |  length                = 1 (0x01)
      | | | |  value                 = 0 (0x00)
      | | | +error-index            (3 bytes)
      | | | |  type                  = 2 (0x02)
      | | | |  length                = 1 (0x01)
      | | | |  value                 = 0 (0x00)
      | | | +VarBindList            (19 bytes)
      | | | |  type                  = 48 (0x30)
      | | | |  length                = 17 (0x11)
      | | | | +VarBind[1]             (17 bytes)
      | | | | |  type                = 48 (0x30)
      | | | | |  length              = 15 (0x0f)
      | | | | | +VarBind[1]{name}       (12 bytes)
      | | | | | |  type              = 6 (0x06)
      | | | | | |  length            = 10 (0x0a)
      | | | | | |  value             = 1.3.6.1.2.1.5.29.1.2.2 (0x2b06010201051d010202)
      | | | | | +VarBind[1]{value}      (3 bytes)
      | | | | | |  type              = 65 (0x41)
      | | | | | |  length            = 1 (0x01)
      | | | | | |  value             = 7 (0x07)


tcpdump info:
 reading from file 18.html.Link0.dump, link-type EN10MB (Ethernet)
17:21:02.621491 IP6 3ffe:501:ffff:100:200:ff:fe00:100 > 3ffe:501:ffff:100:21d:fff:fe0f:be4e: ICMP6, echo request, seq 0, length 14
17:21:02.621545 IP6 3ffe:501:ffff:100:21d:fff:fe0f:be4e > 3ffe:501:ffff:100:200:ff:fe00:100: ICMP6, echo reply, seq 0, length 14
17:21:02.664666 IP6 3ffe:501:ffff:100::20.sieve > 3ffe:501:ffff:100:21d:fff:fe0f:be4e.snmp:  GetRequest(27)  icmp.29.1.2.2
17:21:02.664880 IP6 3ffe:501:ffff:100:21d:fff:fe0f:be4e.snmp > 3ffe:501:ffff:100::20.sieve:  GetResponse(28)  icmp.29.1.2.2=7
17:21:02.707282 IP6 3ffe:501:ffff:100:200:ff:fe00:100 > 3ffe:501:ffff:100:21d:fff:fe0f:be4e: ICMP6, echo request, seq 0, length 14
17:21:02.707334 IP6 3ffe:501:ffff:100:21d:fff:fe0f:be4e > 3ffe:501:ffff:100:200:ff:fe00:100: ICMP6, echo reply, seq 0, length 14
17:21:02.749066 IP6 3ffe:501:ffff:100::20.sieve > 3ffe:501:ffff:100:21d:fff:fe0f:be4e.snmp:  GetRequest(27)  icmp.29.1.2.2
17:21:02.749260 IP6 3ffe:501:ffff:100:21d:fff:fe0f:be4e.snmp > 3ffe:501:ffff:100::20.sieve:  GetResponse(28)  icmp.29.1.2.2=7

Comment 1 Jan Safranek 2009-01-12 14:19:32 UTC
The icmpStatsTable refreshes every 5 seconds, so the table might not be refreshed after you ping the NUT and before you query for icmpStatsInMsgs. 

You must wait 5 seconds after the ping to get correct value of the icmpStatsInMsgs. 

Alternatively, you can turn off the caching. Run following command after snmpd startup (modify the authentication details, if needed). It sets cache timeout of icmpStatsTable to 0, i.e. disables caching.

snmpset -v2c -c public localhost nsCacheTimeout.1.3.6.1.2.1.5.29 i 0

Comment 3 wang jiabo 2009-03-18 08:01:05 UTC
Thanks, Jan
the case pass, when setup 
snmpset -v2c -c public localhost nsCacheTimeout.1.3.6.1.2.1.5.29 i 0

Comment 4 Jan Safranek 2009-03-18 08:22:43 UTC
5 seconds cache timeout is recognized as sufficient for generic usage and setting lower cache timeout could have performance impacts. Since this behavior can be disabled if someone really needs it (using the magic snmpset), I think there is nothing to fix.