3

I understand how a client can trace a route to a server (using traceroute, or tracert). But is there a way for a server to trace a route to a client?

The problem is that I have a group of internet users who live in a remote area and they are complaining that their internet access is slow. I am planning to build some software that allows them to run a download test easily, then store the results. Once we have collected a reasonable amount of data we will hopefully be able to find a pattern.

In conjunction with the download data it would be great to have traceroute data. I can't see how I could initiate this from the client without writing some client software, which is something I don't want to do. Thus I am trying to find a mechanism which collects route information but is initiated by the server.

My preference would be to work with a linux server.

DatsunBing
  • 459
  • 4
  • 7
  • 17
  • 3
    You can run traceroute from the server as well, the same as from the client, once you have the client's ip-address... – HBruijn Dec 30 '16 at 06:22
  • There are several commercial products dedicated to looking at WAN and Internet performance. The most basic is a packet capture on your server or switch, which takes some skill to interpret. – John Mahowald Dec 30 '16 at 06:43

1 Answers1

1

You don't want to do this. A traceroute run from the server to the client is not guaranteed to return the same result as one run from the client to the server.

The route a packet takes from Node A to Node B can easily be different from the route traveled in the opposite direction.* The exact route taken by any given IP packet is determined by the intervening routers along the packet's path. A router may have multiple routes to the destination network (e.g. for redundancy) and is at liberty to decide which route to use based on things such as network congestion, failed links, etc.

Therefore it's not possible to initiate a meaningful trace of the route from A to B from Node B (i.e. the "server") since there's no guarantee the reported route is the one actually used for packets sent from Node A to B.

If the server is indeed to "initiate" the traceroute from the client to the server the server must simply command the client to run a traceroute to the server. This of course is no different than there being a scheduled or triggered command configured on the client to do the exact same thing.

*It's even possible for some packets sent from Node A to B to take different routes from their counterparts, though in practice this doesn't usually happen across otherwise stable networks.

I say Reinstate Monica
  • 3,100
  • 7
  • 23
  • 51
  • It will give almost the same results if you use the same port when running the traceroute, as the original connection (works the best using UDP, but if you manage to alter the TTL of the TCP packets, it also works) and using the same port you can in most cases even traceroute to the internal network (best seen when using IPv6 as most routers drop TTL expired to the outside) – Ferrybig Jan 01 '17 at 11:31
  • @Ferrybig I'm not sure I follow how this would work. The IP protocol puts the routers along a packet's path in charge of the exact route it will take (unless [Source routing](https://en.wikipedia.org/wiki/Source_routing) is used, but even that may not work if the intermediate routers refuse to honor the request). At any given moment an intermediate router may send a connection's packets via an alternate route in response to network congestion, a down link, etc., completely changing the route in use. – I say Reinstate Monica Jan 03 '17 at 16:46