# [SOLVED] Mysterious package loss

## gRuFtY

A few days ago I build my new SSD into my computer and did a fresh install of gentoo. I kept only my /home. While everything was working fine yesterday, today I started loosing many packets. If I run ping, it works well for some time, but then suddenly starts to not get any answers for a few minutes or until I reconnect to the network. The funny thing is, NetworkManager, ifconfig and ethtool all tell my I am still connected. This isn't a problem of the server I'm pinging, I can't connect to any (IPv4) server while this happens. Dmesg doesn't contain any errors when the loss happens.

I'm using a wired connection via Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 03) using the kernel-module r8169 right now, but I did try the r8198, which didn't help. Also, I booted from my old harddrive to verify weather it is a hardware or network problem. On the old system I did not encounter this problem, so it has to be a software problem.

I tried googling around, but non of the tips I read seem to help.

As said, yesterday everything worked fine and I don't know what I changed that caused these problems. I remember I did merge some packages here and there to get the software I need, but I don't think I merged network-related packages on purpose. Maybe as dependencies, I can't tell.

I know you probably need some logs to help me fix this problem, but I'm not sure which ones might be useful. If you tell me, which ones you need, I'll provide them.

Thanks in advance.Last edited by gRuFtY on Mon Jul 27, 2015 12:00 pm; edited 1 time in total

----------

## Keruskerfuerst

What SSD have you bought?

----------

## mv

Almost the same controller/board as in this thread (only another rev. number). I was not able to solve it, but it seems that one has to blame Realtek for it.

----------

## gRuFtY

 *Keruskerfuerst wrote:*   

> What SSD have you bought?

  Crucial BX100

 *mv wrote:*   

> Almost the same controller/board as in this thread (only another rev. number). I was not able to solve it, but it seems that one has to blame Realtek for it.

  It has to be solvable; as said, I booted my old system and it worked fine. Granted, I planed to buy the SDD for a few months and didn't update in that time, so things my have changed.

I forgot to mention, that I tested installing the same kernel-version I had running on the old system, using the same config. That did not help.

----------

## mv

 *gRuFtY wrote:*   

> booted my old system and it worked fine

 

As you can see in the mentioned thread, I also thought several times that it is solved, because suddenly it worked for a very long time. But then eventually it failed again.

----------

## gRuFtY

Yeah, I read that. But I have never experienced this behavior before and used the old system for 2 years. It might just have been pure luck that it worked yesterday on the old system, but then I would say it's a hardware defect or something in the network is blocking my computer. If it's just because the hardware or the driver/module/firmware was designed poorly, I'd expect that I would have had the problem in the past.

Another thing to note: I did install linux-firmware, which didn't change anything and has not been installed or needed on the old system.

----------

## NeddySeagoon

gRuFtY,

Some r8169 cards take firmware to address hardware issues.

Look in dmesg for firmware loading errors.  It will be early in the boot process and may even stall booting for 60 sec.

If r8169 in made as a module does removing it and reloading it help?

I have such a r8169 card in my diskless node.  Its a PITA.

linux-firmware alone may not help.  It would be required to 

a) provide the firmware you need

b) require that r8169 is made as a module.

----------

## gRuFtY

Dmesg showed some firmware loading errors, but they disappeared after merging linux-firmware. Reloading the module did not help yesterday.

As I said, I didn't need any firmware before and I'm not to sure what it's for, how to install it, etc. Could you explain a little more?

Funny thing thou: Yesterday I lost packets after 5 minutes or less. Today I haven't lost a single packet in one and a half hour. I'm not sure what's the matter and can't really believe the problem fixed itself, but for now it seems kinda solved. Hopefully.

----------

## mv

 *gRuFtY wrote:*   

> Yesterday I lost packets after 5 minutes or less. Today I haven't lost a single packet in one and a half hour. I'm not sure what's the matter and can't really believe the problem fixed itself, but for now it seems kinda solved. Hopefully.

 

That's what I had thought, too, after loading the firmware. But meanwhile there are some days where it occurs all 1-2 minutes. Then there are phases where it doesn't occur for some hours. Behaviour just is really random and unpredictable. It is hard to say whether firmware helped slightly or not...

----------

## NeddySeagoon

gRuFtY,

There are two ways.

If r8169 is a module <M> then the firwale must be in /lib/firmware/  maybe in a subdirectory.

The kernel module will load the firmware.

If r8169 is built into the kernel <*>, then so must the firmware be.  The kernel module will still load the firmware but root won't be mounted, so it cannot look in /lib/firmware.

How to build firmware into the kernel es well documented for wifi and graphics cards.  Its the same process.

----------

## mv

I found a "r8168" linux kernel module, provided by RealTek itself.

Maybe it avoids some problems of the r8169 driver, but it is too early to confirm anything. I have no idea why it isn't in the kernel if it should be really needed for proper functioning.

It can be installed from the mv overlay (available by layman).

----------

## gRuFtY

r8168 is available in portage without any overlay. I tested that version with no luck. Is the version you found a newer version?

Thanks for the hints, NeddySeagoon. I'll have a look at the firmware, if the problem returns.

I did not encounter the problem yesterday while I could consistently reproduce it within less then five minutes the day before. This makes further investigation harder, but I won't complain. Maybe it was a network problem after all, maybe linked to the mac adress and I had luck when booting the old system or either the old or the new system faked the mac adress or something like that.

At this moment, I think I can't do anything but wait.

----------

## mv

 *gRuFtY wrote:*   

> r8168 is available in portage without any overlay.

 

Somehow I overlooked this (probably making a typo when looking for it in the gentoo repository).

No, the version I found is the same (8.040). It is now again removed from the mv overlay...

----------

## gRuFtY

... I found the solution. *facepalm*

Somehow the DHCP-server screwed up and decided to assign the same IP for my PC and my Raspberry Pi. After leaving my PC alone over night, it got a different IP, which, of cause, fixed the problem.

Thanks for your help!

----------

