ernie22
Posts: 6
Joined: Sat Sep 08, 2012 4:39 pm

Network packet loss with static IP

Sat Sep 08, 2012 5:21 pm

Hello everybody,

I received my Pi just yesterday.

Right from the start I've been experiencing packet loss on eth0, rx only, when assigning a static IP address. With DHCP everything is fine. Unfortunately I need the Pi to have a static IP for my purposes.

My router (and DHCP server) is a Buffalo WHR-HP-G54 on Tomato 1.28 firmware which has been running without a glitch for years. I have several other pieces of hardware, both Windows and Linux on the same network and none of them are suffering packet loss.

Of course I exchanged the cable and switch port. Problem persists.
I tried several images (squeeze and wheezy from here and the minimal one from darkbasic) and two different SD cards. It doesn't make a difference if the keyboard (MS wired) is plugged in or not.

Static:
/etc/network/interfaces

Code: Select all

auto lo
iface lo inet loopback

iface eth0 inet static
address 192.168.178.202
netmawsk 255.255.255.0
gateway 192.168.178.200
Output of ifconfig:

Code: Select all

pi@raspberrypi ~ $ ifconfig
eth0      Link encap:Ethernet  Hardware Adresse b8:27:eb:ab:70:2c
          inet Adresse:192.168.178.202  Bcast:192.168.178.255  Maske:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metrik:1
          RX packets:184 errors:0 dropped:61 overruns:0 frame:0
          TX packets:81 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:1000
          RX bytes:13553 (13.2 KiB)  TX bytes:10871 (10.6 KiB)
DHCP
/etc/network/interfaces

Code: Select all

auto lo

iface lo inet loopback
iface eth0 inet dhcp
Output of ifconfig:

Code: Select all

pi@raspberrypi ~ $ ifconfig
eth0      Link encap:Ethernet  Hardware Adresse b8:27:eb:ab:70:2c
          inet Adresse:192.168.178.202  Bcast:192.168.178.255  Maske:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metrik:1
          RX packets:281 errors:0 dropped:1 overruns:0 frame:0
          TX packets:108 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:1000
          RX bytes:18970 (18.5 KiB)  TX bytes:14673 (14.3 KiB)
Can anyone help?

broo0ose
Posts: 314
Joined: Wed Dec 14, 2011 3:59 pm
Location: Wirral, UK

Re: Network packet loss with static IP

Sat Sep 08, 2012 9:10 pm

I can't think why that would happen.

as a workaround you could set your router to assign the same address each time it sees the Pi's MAC address.

HTH

broo0ose
Posts: 314
Joined: Wed Dec 14, 2011 3:59 pm
Location: Wirral, UK

Re: Network packet loss with static IP

Sat Sep 08, 2012 9:41 pm

not sure if this is the problem, but there is no W in netmask

ernie22
Posts: 6
Joined: Sat Sep 08, 2012 4:39 pm

Re: Network packet loss with static IP

Sat Sep 08, 2012 10:07 pm

not sure if this is the problem, but there is no W in netmask
typo. does not help, but did not make a difference, either :)
as a workaround you could set your router to assign the same address each time it sees the Pi's MAC address
that's what i am working with right now.
thanks anyway.

I am still clueless how this can happen...

broo0ose
Posts: 314
Joined: Wed Dec 14, 2011 3:59 pm
Location: Wirral, UK

Re: Network packet loss with static IP

Sat Sep 08, 2012 10:12 pm

what is in /etc/resolv.conf ?

ernie22
Posts: 6
Joined: Sat Sep 08, 2012 4:39 pm

Re: Network packet loss with static IP

Sat Sep 08, 2012 10:15 pm

Code: Select all

nameserver 192.168.178.200
which is my router and dhcp server

broo0ose
Posts: 314
Joined: Wed Dec 14, 2011 3:59 pm
Location: Wirral, UK

Re: Network packet loss with static IP

Sun Sep 09, 2012 3:39 pm

The only thing I can think that would cause this would be a duplicate IP address on your network, if something else is trying to claim your static address then it will cause packet loss as the arp tables are constantly being changed.

You can test this by looking at your arp table on your Windows PC with the command "arp -a" when you see packet loss.

First kick off a continuous ping to the static address
ping -t <static IP>

Then in another window
arp -a

try this a few times and see if you see different MAC addresses against the Static IP address.

You can check the manufacturer of the MAC address on this page ...
http://aruljohn.com/mac.pl

ernie22
Posts: 6
Joined: Sat Sep 08, 2012 4:39 pm

Re: Network packet loss with static IP

Sun Sep 09, 2012 6:23 pm

First, I want to thank you for taking the time and trying to help.

I did what you suggested. The only MAC address showing against the IP in question is the one for the Pi.

The count for the dropped RX packets on the Pi is steadily increasing about one per second, as if something on my LAN is sending some sort of invalid requests or something.
I made a couple of file transfers with WinSCP to the Pi while monitoring the dropped packets count. It did not increase faster with more traffic thrown at the Pi but stayed at the 'non-traffic' rate of 1 per sec.
However, it's there and I cannot reproduce this on any of the other systems on my LAN (2 Linux-XBMCs, 1 openelec, 1 Synology DiskStation, and a couple of Linux based satellite receivers, not mentioning the Windows boxes).

User avatar
Licaon_Kter
Posts: 240
Joined: Wed Sep 05, 2012 10:12 am
Location: Between the keyboard and the chair.

Re: Network packet loss with static IP

Mon Sep 10, 2012 7:19 am

Adding smsc95xx.turbo_mode=N to /boot/cmdline.txt alleviate the issue?
BFQ+BFS or RT on a RPi? 4'real: https://github.com/licaon-kter/ (source and compiled!)

obcd
Posts: 917
Joined: Sun Jul 29, 2012 9:06 pm

Re: Network packet loss with static IP

Mon Sep 10, 2012 9:37 am

You are not telling us what kernel revision you are using and what the contents are of your /boot/cmdline.txt file.
The Pi ethernet adapter is an usb device, and there are known issues with usb.
Those improved a lot with the latest kernel revisions and with some settings in /boot/cmdline.txt.
Most people probably don't notice if packets get lost. With a wireless connection, it can even be due to the connection.
It's strange you only have it with a fixed ip and not with dhcp.
If it would be caused by usb packet loss, you would see it with both.

ernie22
Posts: 6
Joined: Sat Sep 08, 2012 4:39 pm

Re: Network packet loss with static IP

Mon Sep 10, 2012 3:49 pm

I am talking about a wired connection, not WiFi.
Just tried adding the turbo mode thing to the command line file. Did not help.
I still get the dropped RX packets, about 1 per second.

Kernelversion

Code: Select all

Linux raspberrypi 3.2.27+ #102 PREEMPT Sat Sep 1 01:00:50 BST 2012 armv6l GNU/Linux
cmdline.txt

Code: Select all

smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
Last edited by ernie22 on Mon Sep 10, 2012 4:07 pm, edited 1 time in total.

ernie22
Posts: 6
Joined: Sat Sep 08, 2012 4:39 pm

Re: Network packet loss with static IP

Mon Sep 10, 2012 4:02 pm

Just updated the kernel

Code: Select all

Linux raspberrypi 3.2.27+ #138 PREEMPT Mon Sep 10 01:04:03 BST 2012 armv6l GNU/Linux
Did not change anything

Code: Select all

pi@raspberrypi ~ $ ifconfig
eth0      Link encap:Ethernet  Hardware Adresse b8:27:eb:ab:70:2c
          inet Adresse:192.168.178.202  Bcast:192.168.178.255  Maske:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metrik:1
          RX packets:356 errors:0 dropped:84 overruns:0 frame:0
          TX packets:361 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:1000
          RX bytes:22355 (21.8 KiB)  TX bytes:54895 (53.6 KiB)

obcd
Posts: 917
Joined: Sun Jul 29, 2012 9:06 pm

Re: Network packet loss with static IP

Mon Sep 10, 2012 9:58 pm

There are some settings missing in the /boot/cmdline.txt that could improve things. I have no idea which of them are enabled by default in the latest kernel.
pi@raspberrypi ~ $ cat /boot/cmdline.txt
dwc_otg.fiq_fix_enable=1 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait sdhci-bcm2708.missing_status=1 dwc_otg.microframe_schedule=1 sdhci-bcm2708.sync_after_dma=0
I am unsure about the sdhci-bcm2708.missing_status=1. I believe it's the default setting like that. If you see errors accessing the sd card remove that one from the cmdline.txt

User avatar
Licaon_Kter
Posts: 240
Joined: Wed Sep 05, 2012 10:12 am
Location: Between the keyboard and the chair.

Re: Network packet loss with static IP

Tue Sep 11, 2012 9:49 am

add dwc_otg.fiq_fix_enable=1 too as it helps USB stuff, and the Pi ethernet is USB based
BFQ+BFS or RT on a RPi? 4'real: https://github.com/licaon-kter/ (source and compiled!)

djr357
Posts: 4
Joined: Fri Mar 01, 2013 2:46 pm

Re: Network packet loss with static IP

Fri Mar 01, 2013 2:49 pm

Ernie,

Did you find a fix to this? I am seeing the EXACT same thing when giving a Static IP over the DHCP IP.

I can provide screenshots and sys info if needed.

D.J.

alper
Posts: 1
Joined: Thu Apr 04, 2013 8:42 am

Re: Network packet loss with static IP

Thu Apr 04, 2013 8:44 am

I am having the same trouble.
using static ip configured over /etc/network/interface or over the router with mac binding causes
packet loss is with the Pi,

any solutions?

User avatar
pluggy
Posts: 3636
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Network packet loss with static IP

Thu Apr 04, 2013 10:53 am

The pi I have with a wired ethernet and a static IP drops packets, I never noticed, but when you've played with wireless on the Pi the dropped packets is much, much worse. My four wireless Pi's with static IPs drop around 60% of the packets. You stop worrying about it after a while. Its a flaw in the USB/Ethernet implementation of the Pi. Its a work in progress.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

pjc123
Posts: 911
Joined: Thu Mar 29, 2012 3:37 pm

Re: Network packet loss with static IP

Thu Apr 04, 2013 1:51 pm

What program or command are you using to monitor real time packet loss, so I can look and see if my pi is doing the same thing under the same conditions? What are you using to test the interfaces (flood ping?). I am running Shibby Tomato on a WRT54G, and I am issuing DHCP MAC based static addresses to both the wired LAN and wifi connections on multiple pis, as well as my smartphone.
My Raspberry Pi Project Page:
http://www.flaminghellmet.com/launch/

M33P
Posts: 199
Joined: Sun Sep 02, 2012 1:14 pm

Re: Network packet loss with static IP

Thu Apr 04, 2013 2:21 pm

ernie22 wrote:Just updated the kernel

Code: Select all

Linux raspberrypi 3.2.27+ #138 PREEMPT Mon Sep 10 01:04:03 BST 2012 armv6l GNU/Linux
That kernel is months out of date - even more so than the latest that Wheezy has - what image are you using?

If 2013-02-09 Wheezy doesn't fix the packet loss then you can try using rpi-update to get the latest development kernel (3.6.11 plus patches).

User avatar
pluggy
Posts: 3636
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Network packet loss with static IP

Thu Apr 04, 2013 2:42 pm

M33P wrote:
ernie22 wrote:Just updated the kernel

Code: Select all

Linux raspberrypi 3.2.27+ #138 PREEMPT Mon Sep 10 01:04:03 BST 2012 armv6l GNU/Linux
That kernel is months out of date - even more so than the latest that Wheezy has - what image are you using?

If 2013-02-09 Wheezy doesn't fix the packet loss then you can try using rpi-update to get the latest development kernel (3.6.11 plus patches).
It wasn't months out of date when he posted it.

Its an old thread dragged up from the depths...
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

pjc123
Posts: 911
Joined: Thu Mar 29, 2012 3:37 pm

Re: Network packet loss with static IP

Thu Apr 04, 2013 7:04 pm

pjc123 wrote:What program or command are you using to monitor real time packet loss, so I can look and see if my pi is doing the same thing under the same conditions? What are you using to test the interfaces (flood ping?). I am running Shibby Tomato on a WRT54G, and I am issuing DHCP MAC based static addresses to both the wired LAN and wifi connections on multiple pis, as well as my smartphone.
I thought I would give the iperf tests a try after reading the following thread:

http://www.raspberrypi.org/phpBB3/viewt ... 28&t=27881

I am testing between two Model B Rev 2 pis, with the LAN and TL-WN722N dongles connected via a router in the same room.

1) I only tried testing the LAN to LAN connection at a couple of bandwidth levels, but both were very good:
At 50 Mbits/s bandwidth = 0% packet loss
At 90 Mbits/s bandwidth = .012% packet loss

2) Wifi to Wifi connection:
At 5 Mbits/s bandwidth = 0.79% packet loss
At 10 Mbits/s bandwidth = 0.96% packet loss
At 11 Mbits/s bandwidth = 0.66% packet loss
At 12 Mbits/s bandwidth = 0.74% packet loss

Then things go downhill rapidly

At 13 Mbits/s bandwidth = 14% packet loss
At 14 Mbits/s bandwidth = 27% packet loss
At 15 Mbits/s bandwidth = 38% packet loss
At 20 Mbits/s bandwidth = 60% packet loss and an occasional segmentation fault.

Setting the router to "802.11g ONLY" instead of "AUTO" did not help.
My Raspberry Pi Project Page:
http://www.flaminghellmet.com/launch/

alanpuccinelli
Posts: 1
Joined: Thu Dec 19, 2013 10:59 pm

Re: Network packet loss with static IP

Thu Dec 19, 2013 11:04 pm

I don't think this is specific to the Pi. I've got the exact same problem on my Ubuntu box. When Static networking is turned on I get dropped packets. When it's DHCP, none. To make matters weirder, if you do a TCPdump the drop packet indexing stops. When you stop the dump they pick up again. I'm not sure what that means exactly but I'm told that they're not actual drops but perhaps a counting of some other invalid packet. The network speed is actually quite good despite the RX dropped packet tabulating at 1 per sec or so. Mystery continues.

knoxy
Posts: 1
Joined: Thu Apr 23, 2015 1:55 pm

Re: Network packet loss with static IP

Thu Apr 23, 2015 2:02 pm

alanpuccinelli wrote:I don't think this is specific to the Pi. I've got the exact same problem on my Ubuntu box. When Static networking is turned on I get dropped packets. When it's DHCP, none. To make matters weirder, if you do a TCPdump the drop packet indexing stops. When you stop the dump they pick up again. I'm not sure what that means exactly but I'm told that they're not actual drops but perhaps a counting of some other invalid packet. The network speed is actually quite good despite the RX dropped packet tabulating at 1 per sec or so. Mystery continues.

Sorry to bring this thread back to life but I'm experiencing the exact same issue with Ubuntu 12.04 & 14.04 on several machines.

Was this ever resolved?

Thanks!

Return to “Troubleshooting”

Who is online

Users browsing this forum: No registered users and 43 guests