LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Need Urgent Attention regarding my Perl Program (https://www.linuxquestions.org/questions/programming-9/need-urgent-attention-regarding-my-perl-program-4175511732/)

tahirfattani 07-21-2014 06:34 AM

Need Urgent Attention regarding my Perl Program
 
I am sending a packets from client machine to server machine.
I have 4 dynamic fields i.e. source IP address ,Source Port , Destination IP address and Destination Port

All four fields are calling from file.

It means every times generating new IP packets which have different IP addresses and Ports.

Question is that,

For example If I want to send the 100,000 packets per second for the duration of 10 seconds.So my total send packets is 1 Million. But they are sending not more than 26 thousands.

I am using one variable DIM...for suppose I change this field like that $dim=1; instead of $dim= scalar(@lines); then it is perfectly work and send 1 Million Packets(but everytime same packets which is not my requirement).

Itz means my program can generate 1 Million packets.

I want to generate the different packets .Please help me where I am lacking???

TB0ne 07-21-2014 09:07 AM

Quote:

Originally Posted by tahirfattani (Post 5207176)
I am sending a packets from client machine to server machine.
I have 4 dynamic fields i.e. source IP address ,Source Port , Destination IP address and Destination Port

All four fields are calling from file. It means every times generating new IP packets which have different IP addresses and Ports.

Question is that,

For example If I want to send the 100,000 packets per second for the duration of 10 seconds.So my total send packets is 1 Million. But they are sending not more than 26 thousands.

I am using one variable DIM...for suppose I change this field like that $dim=1; instead of $dim= scalar(@lines); then it is perfectly work and send 1 Million Packets(but everytime same packets which is not my requirement). Itz means my program can generate 1 Million packets.

I want to generate the different packets .Please help me where I am lacking???

First, this is a VOLUNTEER FORUM; NOTHING you post is 'urgent' for anyone here, and asking for/expecting an 'urgent' reply is fairly rude. Just because you are in a hurry, doesn't mean we have to hurry up....if you want that, then you need to PAY FOR a supported distro of Linux/consultant, and feel free to call on them with your 'urgent' issues.

Second, you have given us no details AT ALL to work with. You haven't posted your code, told us anything about what version/distro of Linux you're using, what kind of hardware it's on, etc. If this is 'urgent', then provide details and we can try to help.

szboardstretcher 07-21-2014 09:10 AM

Also,. why are you using Perl as a traffic generator? Will python or scapy work for you?

tahirfattani 07-21-2014 10:43 AM

@szboardstretcher Yes it work for me...but I already spend alot of time on Perl code....therefore it is easier for me...if you need code I will send you the code

TB0ne 07-21-2014 11:06 AM

Quote:

Originally Posted by tahirfattani (Post 5207284)
@szboardstretcher Yes it work for me...but I already spend alot of time on Perl code....therefore it is easier for me...if you need code I will send you the code

As stated, if you need help with your code, you will have to post the code here, and provide details.

szboardstretcher 07-21-2014 11:11 AM

If you have quite a bit of code to share, you can post it on a pastebin site, or throw it into a github account.

http://fpaste.org/

https://github.com/

tahirfattani 07-21-2014 11:17 AM

@TB0ne and szboardstretcher .....This code is working fine,only problem is that I cannot generate different packets more than 26000 if I am sending 1 Million packets for the duration of 10 seconds.

I am using one variable DIM...for suppose I change this field like that $dim=1; instead of $dim= scalar(@lines); then it is perfectly work and send 1 Million Packets(but everytime same packets which is not my requirement). Itz means my program can generate 1 Million packets.

I want to generate the different packets .Please help me where I am lacking???

oneandoneis2 07-21-2014 11:50 AM

Erk. That's a very long way from modern Perl.

Firstly: "use warnings" is a good thing to turn on when a script isn't doing what you expect.

Secondly: How are you expecting $n and $secs to get set? I see nothing that'll do it, which makes them my first suspect for the script not doing what you want.

Thirdly: You're using modules that aren't on CPAN. If those are your own modules, (a) why are you reinventing the wheel? but more importantly (b) how do you expect us to debug the script?


All times are GMT -5. The time now is 07:15 PM.