In a set of connected Nodes(routers), how can i measure the distance between them in which i can predict how much time a Packet take to reach next node?
In order to measure the distance between two nodes communicating with each other in full duplex mode then as Manfridi said you can send a sequence of bits and receive them again promptly from the the other node without and processing them.
Then the transmit and receive time will be delay time between the front of the transmit signal and the front of the received signal. This time = 2L/v whwere L is the length and v is the velocity of the transmission. If the signal is propagating in space its speed will be = speed of light in the space c. In other medium the v= c/sq.root of epsilon r where epsilonr is the dielectric consatnt.
Very often, "distance" between two points is only measured as the number of hops required, through the network, and that's an adequate measure. But if you want actual distances, and you don't have the distances between nodes pre-measured, perhaps the best technique is to compute the round trip time (RTT) between nodes. To do this, the source node places a timestamp on a query packet, the packet is reflected by adjacent nodes, with that timestamp unchanged, and the source node checks the time elapsed from transmission to reception of the response.
This approach is good enough, if the time required to process these queries, by each node, is known. If not, then you use something like NTP or IEEE 1588. These protocols require each node to add a timestamp when they receive the query, and add another timestamp when they transmit the response. The source node can then subtract, from the total delay from query to response, the amount of time spent waiting for the queried node to reply, after it had received the query. (Note that the two timestamps of the queried node do not need to be synchronized in any way, with the timestamps of the querier. The only function of the two timestamps added by the queried node is to compute the lag before it responds.)
Yet another way, if you know the transmit power of each node, might be to measure the propagation loss, when the source node receives the response. But this would also be a function of the number of connections in the path.
See this, if you want to know more about NTP and IEEE 1588 computations.