Recently, I wanted to do some simulation with IPv4 switches.
And, there is a function that I do not know how to implement in the NS3.
When a switch receives a packet, it can send the packet out to multiple ports(replicate the packet).
It's sort of like multicast, but I don't want the complexity of the multicast. And I need some more freedom to choose the multiple out ports at runtime.
RouteInput (Ptr<Packet> p, Ipv4Header &header, Ptr<const NetDevice> idev,
UnicastForwardCallback ucb, MulticastForwardCallback mcb,
LocalDeliverCallback lcb, ErrorCallback ecb)
I have tried to call "UnicastForwardCallback ucb" multiple times. But it has some errors in the middle of the simulation.
56 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
Is there a way that I can achieve the things I want without using the multicast? Or multicast is the only way?