I've done some preliminary testing and found something interesting.
The problem is
not that packets are getting lost. The problem is that there appears to be a long delay when my router delivers packets to
both my laptop and my local server. This delay is so long that it sometimes triggers re-transmission of packets creating the appearance of dropped packets. However, if you actually follow the trace, you find that every packet is eventually sent (more or less).
To figure this out, I did the following:
1. I opened an SSH session from my laptop to my server
2. I then ran
tcpdump in three places: my laptop, my router, and my local server
3. I typed the letter 'h' in the SSH session and waited for it to appear in the terminal
4. I stopped the tcpdump processes.
I then opened the captured activity in wireshark and set the time to display the offset from the first packet
sent by my laptop (I made sure the system clocks were all more or less synchronized so that this was possible). The resulting data makes it pretty clear what is happening:
Laptop tcp dump
Code:
Label Time Source Dest Protocol Info
A 0.0000 laptop server SSH/TCP Seq: 3506353825
B 1.8561 server laptop TCP Seq: 3823138271 / Ack: 3506353861
1.8565 server laptop SSH/TCP Seq: 3823138271
C 1.8565 laptop server TCP Seq: 3506353861 / Ack: 3823138307
Router tcp dump
Code:
Label Time Source Dest Protocol Info
A 0.0011 laptop server SSH/TCP Seq: 3506353825
B 0.8471 server laptop TCP Seq: 3823138271 / Ack: 3506353861
0.8478 server laptop SSH/TCP Seq: 3823138271
C 1.8639 laptop server TCP Seq: 3506353861 / Ack: 3823138307
Server tcp dump
Code:
Label Time Source Dest Protocol Info
A 0.7958 laptop server SSH/TCP Seq: 3506353825
B 0.7958 server laptop TCP Seq: 3823138271 / Ack: 3506353861
0.7963 server laptop SSH/TCP Seq: 3823138271
C 2.8109 laptop server TCP Seq: 3506353861 / Ack: 3823138307
- Packet A is passed from laptop to router normally
- There is a 0.8 sec delay before packet A is passed from router to server
- Packet B is passed from server to router normally
- There is a 0.9 sec delay before packet B is passed from router to laptop
- Packet C is passed from laptop to router normally
- There is a 0.9 sec delay before packet C is passed from router to server
So it looks like the router is delaying delivery of packets for some reason. The fact that the delivery delay happens both with laptop to server and server to laptop path is making me think that the problem lies with my router. No idea what could be causing this. Maybe my router de-prioritizes intra-network communication for some reason?
Some other things I still want to try:
1. Check what tcpdump looks like when I SSH into an external server (which has no delay)
2. Check if this delivery delay happens for TCP laptop-server communication on other ports