implemented prototype of handshaking(pub-sub)