How to capture & reorder the packets between two PC's
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 !
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.
Last edited by PenguinPwrdBox; 09-04-2005 at 01:24 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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.