I have two machines with IP1 and IP2 addresses. Is it possible to measure the round trip time for the packets to travel between these two machines from a machine with a different IP address?
no you can't
Round-trip time (RTT), also called round-trip delay, is the time required for a signal pulse or packet to travel from a specific source (IP1) to a specific destination (IP2) and back again. In this context, the source is the computer initiating the signal and the destination is a remote computer or system that receives the signal and re transmits it.
user can determine the RTT to and from an IP (Internet Protocol) address by pinging that address. The result depends on various factors including The nature of the transmission medium (copper, optical fiber ) so you can't ignore it