Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspberry PI not working properly on gigabit switch #217

Closed
alchemyx opened this issue Oct 17, 2013 · 26 comments
Closed

Raspberry PI not working properly on gigabit switch #217

alchemyx opened this issue Oct 17, 2013 · 26 comments

Comments

@alchemyx
Copy link

Hello,

With latest firmware I have a strange issues when RPI is connected to gigabit switch. It reports via mii-tool that it has 1000 half duplex link and gives some packet loss. On switch I see that it is 100 full duplex.:

root@sonda00:~# mii-tool
eth0: negotiated 1000baseT-HD flow-control, link ok
GigabitEthernet0/8 is up, line protocol is up (connected)
  Hardware is Gigabit Ethernet, address is 0015.63dc.4208 (bia
0015.63dc.4208)
  Description: IPTV Sonda00
  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
     reliability 255/255, txload 1/255, rxload 0/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Full-duplex, 100Mb/s, media type is 10/100/1000BaseTX

If I force 100 full duplex on switch side, RPI starts to report properly 100 full duplex:

root@sonda00:~# mii-tool 
eth0: negotiated 100baseTx-FD, link ok

So for me it is a definitely a bug, because ethernet on RPI is 100 Mbps.

@P33M
Copy link

P33M commented Oct 17, 2013

Does "latest firmware" imply that at some time in the past this worked correctly?

@cleverca22
Copy link

pi ~ # mii-tool
eth0: negotiated 1000baseT-HD flow-control, link ok
pi ~ # /opt/vc/bin/vcgencmd version
Sep 23 2013 21:38:58
Copyright (c) 2012 Broadcom
version cb10351d8eb5ab63122f62df8a9875e7588fc3c7 (clean) (release)
pi ~ #

i'm also seeing the same problem on my rpi when plugged directly into a gigabit switch

the LED's on the switch say that its only running at 100mbit, and its unmanaged so i cant force things

but i'm not seeing any noticeable packet loss, how did you test it?

@alchemyx
Copy link
Author

Yes, it did work correctly with firmware that was RPI shipped with (sorry I don't know version).

About packet loss I use iperf to fetch multicast stream and watch for loss. Funny thing if I connect RPI to "dumb" 100 meg switch it works just fine. No loss, link ok.

@P33M
Copy link

P33M commented Oct 17, 2013

I can confirm that mii-tool reports 1GbE when plugged into a gigabit switch but link is at 100mbit. Bug in the kernel's smsc95xx driver, probably.

I've never seen packet loss though. Can you post the iperf commands you used?

@cleverca22
Copy link

i'm not able to get any packet loss in the RX direction, but i am getting a single lost packet in the TX direction

pi ~ # iperf -su

Server listening on UDP port 5001
Receiving 1470 byte datagrams

UDP buffer size: 160 KByte (default)

[ 6] local 192.168.2.19 port 5001 connected with 192.168.2.61 port 58288
[ ID] Interval Transfer Bandwidth Jitter Lost/Total Datagrams
[ 6] 0.0-10.0 sec 1.25 MBytes 1.05 Mbits/sec 0.018 ms 1/ 894 (0.11%)

if i run it in the other direction, its 0 lost every time, but from the pi->normal desktop, it always looses 1 packet, not sure how to make it do a longer test

@alchemyx
Copy link
Author

I am using:

/usr/bin/iperf -s -u -B 239.239.2.149 -i 10 -y c

To fetch multicasts. To make longer test use -t with how many seconds it should run. But if you want test it with multicast you need to have multicast source.

And about firmware version:

root@sonda00:~# /opt/vc/bin/vcgencmd version
Oct 12 2013 22:24:23
Copyright (c) 2012 Broadcom
version 7886c07c77a1caafd1f08448c8fcd9c3895ab5ca (clean) (release)

@cleverca22
Copy link

hmmm, when in plain udp mode, i cant get it to drop more then 1 packet, and it doesnt seem to play nicely with the multicast stream my ISP is feeding TV over, how do i make my own multicast source?

@alchemyx
Copy link
Author

To be honest I have no idea. Never tried creating multicast source. I am using one from my IPTV provider. Here are snippets of my log. When connected to gigabit switch:

Oct 17 10:21:38 sonda00 iperf: 20131017102138,239.239.2.149,5001,10.200.200.207,53068,3,1150.0-1160.0,25017160,20013728,0.146,1,19011,0.005,0
Oct 17 10:21:48 sonda00 iperf: 20131017102148,239.239.2.149,5001,10.200.200.207,53068,3,1160.0-1170.0,25019792,20015833,0.066,0,19012,0.000,0
Oct 17 10:21:58 sonda00 iperf: 20131017102158,239.239.2.149,5001,10.200.200.207,53068,3,1170.0-1180.0,25018476,20014780,0.051,0,19011,0.000,0
Oct 17 10:22:08 sonda00 iperf: 20131017102208,239.239.2.149,5001,10.200.200.207,53068,3,1180.0-1190.0,25009264,20007411,0.041,9,19013,0.047,0
Oct 17 10:22:18 sonda00 iperf: 20131017102218,239.239.2.149,5001,10.200.200.207,53068,3,1190.0-1200.0,25013212,20010569,0.037,6,19013,0.032,0
Oct 17 10:22:28 sonda00 iperf: 20131017102228,239.239.2.149,5001,10.200.200.207,53068,3,1200.0-1210.0,25009264,20007411,0.050,10,19014,0.053,0
Oct 17 10:22:38 sonda00 iperf: 20131017102238,239.239.2.149,5001,10.200.200.207,53068,3,1210.0-1220.0,25021108,20016886,0.043,0,19013,0.000,0
Oct 17 10:22:48 sonda00 iperf: 20131017102248,239.239.2.149,5001,10.200.200.207,53068,3,1220.0-1230.0,25011896,20009516,0.044,7,19013,0.037,0
Oct 17 10:22:58 sonda00 iperf: 20131017102258,239.239.2.149,5001,10.200.200.207,53068,3,1230.0-1240.0,25009264,20007411,0.045,9,19013,0.047,0
Oct 17 10:23:08 sonda00 iperf: 20131017102308,239.239.2.149,5001,10.200.200.207,53068,3,1240.0-1250.0,25022424,20017939,0.039,0,19014,0.000,0
Oct 17 10:23:18 sonda00 iperf: 20131017102318,239.239.2.149,5001,10.200.200.207,53068,3,1250.0-1260.0,25021108,20016886,0.058,0,19013,0.000,0
Oct 17 10:23:28 sonda00 iperf: 20131017102328,239.239.2.149,5001,10.200.200.207,53068,3,1260.0-1270.0,25019792,20015833,0.051,1,19013,0.005,0
Oct 17 10:23:38 sonda00 iperf: 20131017102338,239.239.2.149,5001,10.200.200.207,53068,3,1270.0-1280.0,25021108,20016886,0.043,0,19013,0.000,0

And snippet when connected via "dumb" 100 megabit switch:

Oct 17 11:40:34 sonda00 iperf: 20131017114034,239.239.2.149,5001,10.200.200.207,53068,3,4020.0-4030.0,25018476,20014780,0.037,0,19011,0.000,0
Oct 17 11:40:44 sonda00 iperf: 20131017114044,239.239.2.149,5001,10.200.200.207,53068,3,4030.0-4040.0,25019792,20015833,0.038,0,19012,0.000,0
Oct 17 11:40:54 sonda00 iperf: 20131017114054,239.239.2.149,5001,10.200.200.207,53068,3,4040.0-4050.0,25018476,20014780,0.051,0,19011,0.000,0
Oct 17 11:41:04 sonda00 iperf: 20131017114104,239.239.2.149,5001,10.200.200.207,53068,3,4050.0-4060.0,25019792,20015833,0.042,0,19012,0.000,0
Oct 17 11:41:14 sonda00 iperf: 20131017114114,239.239.2.149,5001,10.200.200.207,53068,3,4060.0-4070.0,25018476,20014780,0.040,0,19011,0.000,0
Oct 17 11:41:24 sonda00 iperf: 20131017114124,239.239.2.149,5001,10.200.200.207,53068,3,4070.0-4080.0,25019792,20015833,0.044,0,19012,0.000,0
Oct 17 11:41:34 sonda00 iperf: 20131017114134,239.239.2.149,5001,10.200.200.207,53068,3,4080.0-4090.0,25018476,20014780,0.053,0,19011,0.000,0
Oct 17 11:41:44 sonda00 iperf: 20131017114144,239.239.2.149,5001,10.200.200.207,53068,3,4090.0-4100.0,25019792,20015833,0.045,0,19012,0.000,0
Oct 17 11:41:54 sonda00 iperf: 20131017114154,239.239.2.149,5001,10.200.200.207,53068,3,4100.0-4110.0,25018476,20014780,0.046,0,19011,0.000,0
Oct 17 11:42:04 sonda00 iperf: 20131017114204,239.239.2.149,5001,10.200.200.207,53068,3,4110.0-4120.0,25018476,20014780,0.052,0,19011,0.000,0

Look at second column from right, it should be always 0.

@alchemyx
Copy link
Author

And about generating own multicast:

http://taosecurity.blogspot.com/2006/09/generating-multicast-traffic.html

@cleverca22
Copy link

how does it know when its lost a packet in the IPTV stream, udp doesnt have sequence numbers, and iperf shouldnt understand rtp

@cleverca22
Copy link

when i try the commands from that page, it just goes nuts, printing the same line forever, at infinite speed

[ 3] -1380984776.7--1380984766.7 sec 0.00 Bytes 0.00 bits/sec 0.000 ms 0/ 0 (-nan%)

@alchemyx
Copy link
Author

Sorry but I have no idea how it knows. It always worked flawlessy that way and it still does on other RPIs and one Beagle Bone. Only one having trouble is that one with updated firmware. And one thing, this is firmware version on working fine RPI:

root@sonda02:~# /opt/vc/bin/vcgencmd version
May 24 2013 16:54:51 
Copyright (c) 2012 Broadcom
version 6676ab07e56aeec897f23d09b8fb87b55cbec981 (clean) (release)

Also I contacted more knowledlable technician and it seems that multicast we are receiving for testing purposes is not IPTV stream but a stream from iperf with 20 Mbps UDP.

@alchemyx
Copy link
Author

BTW maybe you have some kind of multicast routing issues. So you could try in plain UDP mode 20 megabits (-b 20M), because by default iperf is generating only 1 Mbps.

@cleverca22
Copy link

hmmm, when i try to push 1000mbit from pi->desktop, it only goes thru at 95mbit, and only a single packet is lost
if i push it from the desktop->pi, it runs at ~94.9mbit and looses 7 packets (0.0014%)

not seeing any major packet loss, even when forcing it to go 10x faster then the link can handle
looks like the kernel is just giving bad info to mii-tool ?

@alchemyx
Copy link
Author

Sorry for making a mess but I did tests with plain UDP mode and can't reproduce trouble that I get with multicast. So in fact it may be problem with mii-tool reporting only and multicast trouble is some kind of "side effect".

@cleverca22
Copy link

i have had other multicast problems over wifi, the source simply expects more bandwidth, so it winds up DoS'ing the wifi completely, nothing works until i leave the multicast group

@alchemyx
Copy link
Author

Hello,

I know I can't reproduce it properly, but we have installed another few RPIs and used firmware that was
shipped with current raspbian. So I can confirm that on this firmware everything works fine:

Sep  1 2013 23:31:02
Copyright (c) 2012 Broadcom
version 4f9d19896166f46a3255801bc1834561bf092732 (clean) (release)

And on following gives loss:

Oct 12 2013 22:24:23
Copyright (c) 2012 Broadcom
version 7886c07c77a1caafd1f08448c8fcd9c3895ab5ca (clean) (release)

@P33M
Copy link

P33M commented Nov 13, 2013

Is your reported issue simply that the ethernet connection speed is reported as 100mbit on the 1st september 2013 release and 1gbit on the 12th oct release?

@alchemyx
Copy link
Author

It is about two things:

  1. speed reporting
  2. packet loss

Altough I can't prepare a test case for a second issue for you to reproduce. So lets say it is inly about 1).

@GeorgBisseling
Copy link

I faintly remeber to have read that mii-Tools is no longer properly supported by the Linux kernel, but one should use ethtool instead. Wait a Minute... http://ubuntuforums.org/showthread.php?t=1680837

@Ruffio
Copy link

Ruffio commented Jun 17, 2015

@alchemyx is this still an issue?

@alchemyx
Copy link
Author

Sorry I don't have access to spare RPI anymore to check it.

Michał Margula, alchemyx@uznam.net.pl, http://alchemyx.uznam.net.pl/
"W życiu piękne są tylko chwile" [Ryszard Riedel]

Dnia 17 cze 2015 o godz. 19:56 Rasmus Christiansen notifications@github.com napisał(a):

@alchemyx is this still an issue?


Reply to this email directly or view it on GitHub.

@Ruffio
Copy link

Ruffio commented Jun 17, 2015

@cleverca22 do you still have an issue?

@Ruffio
Copy link

Ruffio commented Dec 7, 2015

@popcornmix this issue seems to be stalled

@TheEggAka
Copy link

Hi, i want only ask, if is this issue have some solution, becouse i have still this issue. When i plug in to 1000gb ether, havnt link, only when i change operation speed-duplex to 100Full than have link and working without packet lost.

@JamesH65
Copy link
Contributor

This issue was on very early devices (last post 2015), so its likely your issue is different. Please start a new issue, with a lot more details on exactly what is happens. Which Pi, which switch, which OS, how you are testing, what symptoms are etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants