Smitty5k has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks of Perl!

I am considering writing a Perl app to aid me in testing network functionality of a project I am working on. I would like some expert feedback on the feasibility of the project. Thanks in advance.

Problem:
I want to know how many UDP packets can be dropped betweeen two PC applications before they will drop communication with the other each other.

Proposed Solution:
I'm trying to create a software pass-through application that takes TCP and UDP packets from PC1 and passes them through to PC2 and vice versa. I would do this through a third PC(PC3) that would have two NIC cards and be running the proposed application. So PC's 1 and 2 would be networked together via PC3. I want to specify how many packets to drop from either side and see how my applications on PC1 and PC2 respond.

Question:
Is perl fast enough to pass-through time-intensive UDP data from one side to the other? The data is on the order of 60 UDP packets per second. The packets have about 16ms to get from PC1 to PC2 when directly connected. I also wonder once the defined number of packets to drop has been reached would the application begin resending packets without dropping any extra? I think a fairly small Perl script would do the job pretty well, I'm just not sure if it is quick enough.

Thanks Again.

  • Comment on Feasibility of Dropping a Specified Quantity of Time-Intensive UDP Traffic Between Two Devices with Perl

Replies are listed 'Best First'.
Re: Feasibility of Dropping a Specified Quantity of Time-Intensive UDP Traffic Between Two Devices with Perl
by sgifford (Prior) on Jun 02, 2006 at 20:58 UTC
    Perl is very fast once it starts up. You'll have to test it to know for sure, but I wouldn't expect a problem.

    You could probably simulate this without setting up any new hardware by passing data between two loopback interfaces on your system, for example 127.0.0.1 and 127.0.0.2, or by just reading the data and echoing it back out the same interface. If it's fast enough for that, your real application shouldn't be a problem.

      Thanks, that is a very good suggestion for testing the possibility.
Re: Feasibility of Dropping a Specified Quantity of Time-Intensive UDP Traffic Between Two Devices with Perl
by NetWallah (Canon) on Jun 03, 2006 at 01:11 UTC
    I wrote some code to relay UDP packets a few years ago. This may help be a basis for code you write, so I'll add it to this node. The code does a little more than just relay - it can also be at either end of the connection - i.e.- it has 3 modes : client, server, and relay. It was designed to relay multiple conversations. Tested only on Win32, but I have not used any Windows-specific features, so it "should" work on all platforms. Feel free to /msg me if you have questions.

         "For every complex problem, there is a simple answer ... and it is wrong." --H.L. Mencken

      Thank you very much for the code. This is a great starting point for what I want to do.