One way is to annotate messages with the sender and receiver, so that when 2 receives the message, he knows to deliver it to 3. When 3 receives the message, he checks the recipient attribute to know that he is from device 1. This extra layer allows you to send and receive messages through other devices and still know who it is from.
-, , . , 1-2-3-4, , , , , 2 ? ? , ? peer-to-peer , , , .
, !