Hi Ubaid,
I haven't heard before a L3 switch. If it is a L3 then it is a router.
What is wrong with your scenario is that you assume that in the star topology all leaves are in the same subnet.
When you use p2p links, you should create new subnet otherwise the routing would not work properly.
In your scenario after you have assigned a pair just create a new subnet.
Ipv4InterfaceContainer link = address.Assign(devices);
address.NewNetwork();
Regards,
K.