{"action":"created","issue":{"url":"https://api.github.com/repos/esnet/iperf/issues/364","repository_url":"https://api.github.com/repos/esnet/iperf","labels_url":"https://api.github.com/repos/esnet/iperf/issues/364/labels{/name}","comments_url":"https://api.github.com/repos/esnet/iperf/issues/364/comments","events_url":"https://api.github.com/repos/esnet/iperf/issues/364/events","html_url":"https://github.com/esnet/iperf/issues/364","id":136038683,"number":364,"title":"UDP Test error \"malformed number\" in JSON format (Perl), RFC Specification not met","user":{"login":"Mangnoppa","id":11314222,"avatar_url":"https://avatars.githubusercontent.com/u/11314222?v=3","gravatar_id":"","url":"https://api.github.com/users/Mangnoppa","html_url":"https://github.com/Mangnoppa","followers_url":"https://api.github.com/users/Mangnoppa/followers","following_url":"https://api.github.com/users/Mangnoppa/following{/other_user}","gists_url":"https://api.github.com/users/Mangnoppa/gists{/gist_id}","starred_url":"https://api.github.com/users/Mangnoppa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mangnoppa/subscriptions","organizations_url":"https://api.github.com/users/Mangnoppa/orgs","repos_url":"https://api.github.com/users/Mangnoppa/repos","events_url":"https://api.github.com/users/Mangnoppa/events{/privacy}","received_events_url":"https://api.github.com/users/Mangnoppa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-24T11:48:04Z","updated_at":"2016-02-24T13:05:21Z","closed_at":null,"body":"Hello,\r\n\r\nI am running iperf3 Version 3.0.11 on an Ubuntu PC. When I run an UDP-Test with the -J flag **and** there are no transmitted packets **and** no lost packets, the lost_percent string shows \"-nan\". \r\n\r\nAccording to the [RFC4627-Specification](https://tools.ietf.org/html/rfc4627) of JSON, \"NaN\" and \"Infinite\" is not allowed.\r\n\r\nI am executing iperf3 with a perl script. This is the code printed with Data::Dumper:\r\n```\r\n\"streams\":\t[{\r\n\t\"socket\":\t4,\r\n\t\"start\":\t8.00011,\r\n\t\"end\":\t9.00102,\r\n\t\"seconds\":\t1.00092,\r\n\t\"bytes\":\t0,\r\n\t\"bits_per_second\":\t0,\r\n\t\"jitter_ms\":\t0.452296,\r\n\t\"lost_packets\":\t0,\r\n\t\"packets\":\t0,\r\n\t\"lost_percent\":\t-nan,\r\n\t\"omitted\":\tfalse\r\n\t}],\r\n\"sum\":\t{\r\n\t\"start\":\t8.00011,\r\n\t\"end\":\t9.00102,\r\n\t\"seconds\":\t1.00092,\r\n\t\"bytes\":\t0,\r\n\t\"bits_per_second\":\t0,\r\n\t\"jitter_ms\":\t0.452296,\r\n\t\"lost_packets\":\t0,\r\n\t\"packets\":\t0,\r\n\t\"lost_percent\":\t-nan,\r\n\t\"omitted\":\tfalse\r\n}\r\n```\r\n\r\nI then try to parse it with the JSON module in perl, which does not work, because \"-nan\" is not allowed.  I would recommend the value \"null\" or \"0\" for that.\r\n\r\nParsing the string myself is working, but it would be great if you could fix this definition error some time.\r\n\r\nEDIT: I think this behaviour comes from the division by zero."},"comment":{"url":"https://api.github.com/repos/esnet/iperf/issues/comments/188248451","html_url":"https://github.com/esnet/iperf/issues/364#issuecomment-188248451","issue_url":"https://api.github.com/repos/esnet/iperf/issues/364","id":188248451,"user":{"login":"Mangnoppa","id":11314222,"avatar_url":"https://avatars.githubusercontent.com/u/11314222?v=3","gravatar_id":"","url":"https://api.github.com/users/Mangnoppa","html_url":"https://github.com/Mangnoppa","followers_url":"https://api.github.com/users/Mangnoppa/followers","following_url":"https://api.github.com/users/Mangnoppa/following{/other_user}","gists_url":"https://api.github.com/users/Mangnoppa/gists{/gist_id}","starred_url":"https://api.github.com/users/Mangnoppa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mangnoppa/subscriptions","organizations_url":"https://api.github.com/users/Mangnoppa/orgs","repos_url":"https://api.github.com/users/Mangnoppa/repos","events_url":"https://api.github.com/users/Mangnoppa/events{/privacy}","received_events_url":"https://api.github.com/users/Mangnoppa/received_events","type":"User","site_admin":false},"created_at":"2016-02-24T13:05:21Z","updated_at":"2016-02-24T13:05:21Z","body":"I can reproduce this error with the following:\r\nOn the server-side\r\n`/usr/bin/iperf3 -s -p 5111 -J`\r\n\r\nOn the client-side\r\n`iperf3 -c SERVER_ADDR -u -p 5111 -b 0 -l 8000 -J -R`\r\n\r\nThe same output as posted above is shown, maybe in another interval.\r\n\r\nBoth PCs are connected with a 1Gbit uplink. The switch is fragmenting the packages and the client is not able to rebuild them, so they are lost (verified with wireshark).\r\n\r\n I looked at the source code of iperf3 and in my version I would expect a packet_lost-value of \"100.0\" and with the version from the master branch a value of \"0.0\"."}}