Search code examples
network-programmingudptraceroute

Tracerouting in UDP protocal


I am using UDP network protocol to send message from various clients to a root server.

The message from client to server may not be sent directly and may be sent via other clients.

I want to know the clients via which the message is sent by looking at the message received at the root server. How to do this?


Solution

  • UDP does not include this information. You'll need to include something in your protocol if you want to keep track of servers through which the message has passed.

    The traceroute program uses a trick to get bounced packets by setting the TTL to an increasing number. It starts with a TTL of 1 so that the first bounce comes from the closest server to the source. It then tries a TTL of 2 to get a bounce from the second server on the path, and so on.