LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-03-2005, 11:19 PM   #1
Janarthanan
LQ Newbie
 
Registered: Sep 2005
Location: India
Posts: 2

Rep: Reputation: 0
Question 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
 
Old 09-04-2005, 01:22 AM   #2
PenguinPwrdBox
Member
 
Registered: Oct 2003
Posts: 568

Rep: Reputation: 31
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.
 
Old 09-04-2005, 02:25 AM   #3
Janarthanan
LQ Newbie
 
Registered: Sep 2005
Location: India
Posts: 2

Original Poster
Rep: Reputation: 0
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Capture Raw Packets (no Decode) with PCAP kidskc Programming 1 11-02-2005 04:54 PM
reorder partition lables Rojahon Linux - Hardware 2 07-09-2005 06:29 PM
How can I use ethereal to capture packets from other computer on the same switch/hub? abefroman Linux - Security 8 05-12-2005 10:58 AM
how can i use libpcap to capture packets for the local loopback interface (lo) ? gajaykrishnan Programming 0 02-22-2005 04:03 AM
Simple sh script: rand reorder Sinope Programming 2 09-11-2004 05:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration