I am trying to simulate a network consist of a server, n clients and m proxy servers in ns3
. my clients can only see proxies and connect them(proxies are my clients sink application). I want my proxies to forward the exact traffic to server( server is sink for my proxies) and return back the servers response to clients.
How can I achieve this? can anybody help me with that?
One possible solution is to create a 'Proxy' application which would receive on one interface/port and forward to another. Your client would connect to the proxies and send their data. The proxy would receive and forward them to the server.
You can use the UdpEchoServer
application as base of your Proxy application. The UdpEcho receives a packet and replies to the sender with a new one. Modify this by replying to another node (your server) and instead of creating a new packet, use the same (or copy of the received).