Hi,
You need to create 3 nodes or Four nodes as per your requirement as below
Ptr<Node>w1=CreateObject<Node>();
Ptr<Node>w2=CreateObject<Node>();
Ptr<Node>w3=CreateObject<Node>(); ...
After this you need to create Point-to-point links
NodeContainer w1w2=NodeContainer(w1,w2);
NodeContainer w2w3=NodeContainer(w2,w3);
NodeContainer c=NodeContainer(w1,w2,w3);
Ipv4StackHelper stack;
stack.Install(c);
You create Netdevices for these NodeConatiners.
then remaining is as it is like two node point-to-point network
Thanks,
Srinivas