LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   How to capture & reorder the packets between two PC's (https://www.linuxquestions.org/questions/linux-networking-3/how-to-capture-and-reorder-the-packets-between-two-pcs-359987/)

Janarthanan 09-03-2005 11:19 PM

How to capture & reorder the packets between two PC's
 
Hi Everybody,
For a testing purpose in my company,I have to introduce reordering,burstiness & error packets between two PC's in the network.i.e My Linux PC should activate as a switch.The packets should be captured and reorderd before forwarding to destination.How can I program to this situation with respect to OSI layers.
Please help me !

Thanks & Regards,
Janarthanan.S

PenguinPwrdBox 09-04-2005 01:22 AM

I would use the net modules in Perl to receive them, and then based on the sequence number of the packet, reorder them, and send.
I'm curious, why would you want to do this? Depending on the number of packets being sent, you are talking about a huge lag here. Not to mention, you would also have to code the ability to negotiate with the server machine as though you were the client. This would basically be a man in the middle spoof, to reorder packets?

Functioning as a switch, a Linux machine will forward the packets as any other switch would.
It should be up to the receiving machine to reorder/request retransmission of packets.

Janarthanan 09-04-2005 02:25 AM

Hi Penguin...!
Thanks for replying me. What my actual need is,I have a testing tool( software in Linux ) in my Linux PC which acts as router between two PC's. Actually it can drop,duplicate,can delay the incoming packets since it act in IP layer.Now the need is to add some options like reordering of packets, changing the fields of packets,introducing packets in bursty nature to destination. What my question is how can i capture all the incoming packets regardless of TCP,UDP,ICMP or any more with respect to Linux programming. Some told to use raw sockets,where i came to know that only a copy of packets is sent to raw sockets & we can't avoid sending packets to kernel. If i reorder the copy of packets how can i send my reorderd packets instead of kernel forwarding packets.I have to finish within this week.

Please reply me with linux programming concepts !

Thanks in advance,
Janarthanan.S


All times are GMT -5. The time now is 04:59 PM.