Hi Sindhu,
As usual it depends which end you consider to be the client an which the server - for no particular reason we chose the sender to be a client and the receiver to be a server - but these can be changed in the node options.
Set the TCP in node to "Listen on"... the port can be whatever you want - typically above 1024. (and below 65536) - as long as it is not in use by anything else... most common services are below 1024 so a random choice should be OK - (apart from 1880 - which Node-RED uses of course !!!)
Then at the sending end - you would use a TCP out node set to "connect to" - set the same port as you used above and set the Host to be the ip address of the other machine - and if you are just sending strings - set it to output Strings.
Here is a simple example running on one machine - you would need to run half on each machine and change the 127.0.0.1 to the IP of the other machine.... good lluck
[{"id":"646d684.f9b9298","type":"tcp in","z":"9e538f88.61ac7","name":"","server":"server","host":"","port":"5555","datamode":"stream","datatype":"utf8","newline":"","topic":"","base64":false,"x":283,"y":986,"wires":[["7e59ee9f.81a61"]]},{"id":"f3b49215.0c4b7","type":"tcp out","z":"9e538f88.61ac7","host":"127.0.0.1","port":"5555","beserver":"client","base64":false,"end":false,"name":"","x":212,"y":941,"wires":[]},{"id":"f111339f.0eeed","type":"inject","z":"9e538f88.61ac7","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":111,"y":890,"wires":[["f3b49215.0c4b7"]]},{"id":"7e59ee9f.81a61","type":"debug","z":"9e538f88.61ac7","name":"","active":true,"console":"false","complete":"false","x":483,"y":953,"wires":[]}]