2

Can traceroute detect a load balancer sitting between an application server and a database? After running a traceroute from application server to database I only received one hop. The hop was the destination database

ASalas
  • 21
  • 2

3 Answers3

1

First lets get out of the way the trivial case: I assume that the IP you traceroute'd does not actually belong to the load balancer. Which would be the most typical case.

Leaving that out, it means you try to detect a load balancer that sits on your routing (forwarding) path. These things are called network load balancers (NLBs). The traceroute only recognizes a specific kind of devices - these that decrease the TTL field in a packet. Typical router does that, but an NLB often doesn't.

As a result, you cannot reliably say whether there was an NLB on the way by looking only on traceroute.

kubanczyk
  • 13,502
  • 5
  • 40
  • 55
1

Short answer: No.

Long answer:
traceroute is meant to detect router. Those are used to transfer traffic from one IP subnet (IP + MASK specifies a subnet) to another.
Loadbalancers are meant to be a transparent to clients. This means they take traffic and forward it to one destination or another. So for the client it looks like they reach for the same server every time but in the background the request is distributed to two or more servers for several reasons (load balancing, high availability, ...).

For your specific constellation it looks like this:
user-client <-> application server <-> database
Your user-client requests resources from the application server, but the application server is the client to the database not the user-client itself. So basically you can't see the database behind the application server from the perspective of the user-client.
If you didn't build this constellation yourself you can't be sure.
You could try to use Wireshark/tcpdump and try to analysis the MAC addresses to see where your traffic comes from.

unNamed
  • 523
  • 2
  • 10
0

So the load balancer is for the database connections? Can you ping the load balancer IP and also ping the database directly? Are there multiple DB's?

And are we talking about a LAN connection or ar the app server and DB at least on the same subnet public or private? Just want to make sure you are not expecting a hop other than the DB or load balancer.

It is hard to answer specifically without more info, but if you are running a traceroute to the load balancer IP then that's where it should terminate. If you traceroute directly to the database IP.... well that's where the traceroute should go.

I believe most database load balancers are actually proxies, so your traceroute "to the database" may be hitting the load balancer... if that is the IP you are putting in.

CA_Tallguy
  • 101
  • 3