Random Flooding of TCP Retransmissions
asked Dec 02 '17
Hi guys,
So I have a small WISP, and at random times I get a flood of TCP Retransmission packets that slows down the entire network:
http://i64.tinypic.com/t0lun9.jpg
With a delayed struggle I can access the core Mikrotik and drop all packets from the originating IP, and immediately this behaviour stops. I have rules to detect a DDoS attack but this random behaviour doesn't trigger any of those, and normally this doesn't last longer than about 5 to 10 minutes. It is however super annoying as immediately latency to the internet jumps through the roof and throughput dies to a complete standstill.
Does anyone have any advice in terms of what could be causing this and more importantly, how one can prevent it?
Thanks a million.
Best Regards,

The picture has added little information to what you wrote, except that low ports (282, 284, 285, 286, 287), IANA-assigned to quite old and thus rarely used application protocols, are used at the remote side, while a "high" port is used on the "local" side. What is even more unusual, the same "high" port is used for all those sessions.
To find out what's really going on, I'm afraid your only chance is to take a large disk and start capturing the complete traffic on the internet-facing interface into a circular buffer of files using dumpcap or tcpdump, because you need to see what has happened before this flood. I have seen tons of packets knocking on three ports of the public address of my internet gateway and it came out it was a consequence of some of the machines in the internal network to take part in some bittorrent network. In another words, you should first check whether the traffic starts coming from the 'net or whether one of your clients "orders" it and then stops responding.
As we talk about Mikrotik here, depending on your particular environment and device model you may be able to connect a disk directly to the device's USB port, use port mirroring, or use the capability of Mikrotik to stream the captured packets TZSP-encapsulated over the network.
Prevention is only possible if the flood traffic has been triggered by your client. If your network is just an innocent target, there is nothing you can do after the flood has already passed through the bottleneck which is your uplink connection. All measures have to be taken before that bottleneck. On a connection-tracking firewall, the common rule blocking "invalid" packets should be sufficient to block TCP packets which are not part of a properly established session. But a connection tracking firewall may easily make the RAM of your box explode so make sure you're not cutting the edge already.
If such a "drop invalid" rule is already in place between the capture point and the 'net, I'd assume that one of your clients is triggering the flood.
I agree you have to capture. Maybe you some kind of loop or so sometimes in your network???? Without a trace it is hard to tell. But I would also look at all switch logs.