使用python如何使节点同为服务端和客户端

用python写5个节点,节点的代码相同。
5个节点间不需要服务端,节点自身同为服务端和客户端,每个节点都能与其余4个节点通信。
请问如何做到

就是点对点通讯
https://laike9m.com/blog/pythonshi-xian-stunturnp2pliao-tian,29/
http://blog.csdn.net/Lockey23/article/details/77940518