Community discussions

MikroTik App
 
millenium7
Long time Member
Long time Member
Topic Author
Posts: 538
Joined: Wed Mar 16, 2016 6:12 am

TCP vs UDP routing handled differently?

Mon Feb 04, 2019 6:41 am

I don't know if this is a bug, a feature, or simply the way UDP traffic works and i've never heard about it

I've been troubleshooting an issue with SNMP being unreachable to a particular destination (Router E in the below example), yet pings and all other ICMP or TCP based traffic work fine
I've done a traceroute and found there is asymmetrical routing. The traffic paths are as follows

Device1->A->B->C->D->E (E being the destination, a MikroTik Router)
E->B->A->Device1

This works fine no problems at all, except for UDP traffic. For some reason when using UDP, E returns traffic back out the interface it received it on, creating a routing loop

Device1->A->B->C->D->E
E->D->E->D->E->D->E->D etc until packet dies

Router D has no firewall rules at all, no NAT, no mangle, nothing
Router E has rules but nothing in mangle other than QoS marks (nothing influences routing)

The 'best route' on RouterE is its default route which points to B, so traffic should go there. Instead it goes out the same interface it received the packet on. So why is it this the case for UDP packets but not TCP/ICMP?
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1782
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

Re: TCP vs UDP routing handled differently?

Mon Feb 04, 2019 12:24 pm

What is the config on E: /export hide-sensitive compact?
 
millenium7
Long time Member
Long time Member
Topic Author
Posts: 538
Joined: Wed Mar 16, 2016 6:12 am

Re: TCP vs UDP routing handled differently?

Tue Feb 05, 2019 6:16 am

It's a rather large config that I don't want to post, even with hide sensitive
But the only parts should affect routing are in the ip routes and ip firewall section. There's no route so it should use the default one, and there's no firewall rules affecting this
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1782
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

Re: TCP vs UDP routing handled differently?

Tue Feb 05, 2019 10:35 am

"Only default route" + "no firewall" <-?-> "asymmetric routing" and "selective forwarding"

Something doesn't add up...
 
millenium7
Long time Member
Long time Member
Topic Author
Posts: 538
Joined: Wed Mar 16, 2016 6:12 am

Re: TCP vs UDP routing handled differently?

Wed Feb 06, 2019 2:27 am

I didn't say that. There is OSPF in the network, and BGP at Router B to other routers (including E)

All routers do have a specific route to E
E does not have a specific route to the original source, so it uses it's default gateway which is B
D also doesn't have a specific route, so again it uses it's default gateway which is E

Because E is always present in the routing table it's going to go via that route. The original source isn't so it'll use the default gateway. This is all laid out in the original post
The thing is routing tables don't care about what protocol it is. I should be seeing the same behavior with TCP, UDP, ICMP, GRE, take your pick. They should all follow the exact same route.
The only area's that could affect this are NAT or Mangle. There are no rules in either that affect traffic flow to/from any of these devices, and there's nothing specific to UDP
 
karfax
just joined
Posts: 5
Joined: Thu Feb 06, 2020 1:40 pm

Re: TCP vs UDP routing handled differently?

Thu Mar 02, 2023 3:27 pm

Hello!

Have you found a solution? I have the same situation right now.
 
User avatar
clambert
Member Candidate
Member Candidate
Posts: 120
Joined: Wed Jun 12, 2019 5:04 am

Re: TCP vs UDP routing handled differently?

Thu Mar 02, 2023 9:23 pm

Maybe the problem you are experiencing with SNMP can be solved by defining the src-address parameter in the SNMP agent in router E. You should configure the IP address you are querying (probably a loopback).

Who is online

Users browsing this forum: uxertxo and 83 guests