I want to design a system which reduce travel time of packet what is happening in reality is I send a SYN bit from client side, this bit travel through router then to server and server reply SYN+ACK which also travel through the router to client.
So I just want something else like what if the client send SYN to router, router then send this to server and copy this packet modify SYN to SYN+ACK and send back to client before server can send after server send this SYN+ACK to router, router just accept it(see it as the reply is coming) and discard it
To achieve the above goal, I design a setup in which I have one laptop which send and receive packet from two ethernet interface and other one is desktop which act as router(packets are coming and it only forward it to its destination) I setup the routing table from both side and enable the ip forwarding on desktop(which act as router).
All are working fine, on a laptop I have server and client program which send the packet and receive it but the problem is that I want to send the packets to from where it was coming (to source itself) so I modify the packet on routing side using netfilter module, copy the entire skb(using skb_copy) and interchange its ip source and destination(I did this on NF_INET_PREROUTING) and also interchange the port number but the packet always goes to destination.
What other modification I need to be done to send the packet to its source itself?