Skip to content
This repository has been archived by the owner on Mar 7, 2018. It is now read-only.

ping() does not deal with truncated responses #160

Closed
bewing opened this issue Apr 27, 2017 · 0 comments
Closed

ping() does not deal with truncated responses #160

bewing opened this issue Apr 27, 2017 · 0 comments
Assignees
Labels
Milestone

Comments

@bewing
Copy link
Member

bewing commented Apr 27, 2017

Some destinations truncate payload in echo messages

napalm-eos version

(Paste verbatim output from pip freeze | grep napalm-eos between quotes below)

napalm-base==0.23.2
napalm-eos==0.5.6

eOS version

(Paste verbatim output from show version | json between quotes below)

{u'architecture': u'i386',
  u'bootupTimestamp': 1488060828.73,
  u'hardwareRevision': u'01.03',
  u'internalBuildId': u'8f820a40-8597-41b7-8871-2ba47ffd0aad',
  u'internalVersion': u'4.16.9M-3799680.4169M',
  u'isIntlVersion': False,
  u'memFree': 188640,
  u'memTotal': 3978076,
  u'modelName': u'DCS-7150S-64-CL-R',
  u'version': u'4.16.9M'}

Steps to Reproduce the Issue

import napalm_eos
d = device('veos1', 'admin', 'admin')
d.open()
d.device.run_commands(["ping 8.8.8.8"])[0]
d.ping("8.8.8.8")

Error Traceback

(Paste the complete traceback of the exception between quotes below)

{u'messages': [u'PING 8.8.8.8 (8.8.8.8) 72(100) bytes of data.\n72 bytes from 8.8.8.8: icmp_req=1 ttl=41 (truncated)\n72 bytes from 8.8.8.8: icmp_req=2 ttl=41 (truncated)\n72 bytes from 8.8.8.8: icmp_req=3 ttl=41 (truncated)\n72 bytes from 8.8.8.8: icmp_req=4 ttl=41 (truncated)\n72 bytes from 8.8.8.8: icmp_req=5 ttl=41 (truncated)\n\n--- 8.8.8.8 ping statistics ---\n5 packets transmitted, 5 received, 0% packet loss, time 102ms\nrtt min/avg/max/mdev = 24.904/25.067/25.643/0.305 ms, ipg/ewma 25.507/25.345 ms\n']}
napalm-eos/napalm_eos/eos.pyc in ping(self, destination, source, ttl, timeout, size, count, vrf)
   1685                         m = fields[6][5:]
   1686                         results_array.append({'ip_address': py23_compat.text_type(fields[3]),
-> 1687                                               'rtt': float(m)})
   1688                 elif 'packets transmitted' in line:
   1689                     ping_dict['success']['probes_sent'] = int(fields[0])

ValueError: could not convert string to float: cated)

FYI, Google is appearing to truncate ICMP responses > 64 bytes:

ping -s 80 -c 4 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 80(108) bytes of data.
72 bytes from 8.8.8.8: icmp_seq=1 ttl=44 (truncated)
72 bytes from 8.8.8.8: icmp_seq=2 ttl=44 (truncated)
72 bytes from 8.8.8.8: icmp_seq=3 ttl=44 (truncated)
72 bytes from 8.8.8.8: icmp_seq=4 ttl=44 (truncated)

--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 10.462/10.508/10.530/0.027 ms

ping -s 64 -c 4 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 64(92) bytes of data.
72 bytes from 8.8.8.8: icmp_seq=1 ttl=44 time=10.5 ms
72 bytes from 8.8.8.8: icmp_seq=2 ttl=44 time=10.5 ms
72 bytes from 8.8.8.8: icmp_seq=3 ttl=44 time=10.5 ms
72 bytes from 8.8.8.8: icmp_seq=4 ttl=44 time=10.5 ms

--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 10.505/10.516/10.540/0.126 ms
@mirceaulinic mirceaulinic added this to the APPROVED milestone Apr 27, 2017
bewing added a commit to bewing/napalm-eos that referenced this issue Apr 27, 2017
@mirceaulinic mirceaulinic modified the milestones: 0.5.7, APPROVED Apr 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants