LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-21-2014, 06:34 AM   #1
tahirfattani
LQ Newbie
 
Registered: Jul 2014
Posts: 3

Rep: Reputation: Disabled
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???

Last edited by tahirfattani; 07-21-2014 at 07:20 AM.
 
Old 07-21-2014, 09:07 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by tahirfattani View Post
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.
 
Old 07-21-2014, 09:10 AM   #3
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Also,. why are you using Perl as a traffic generator? Will python or scapy work for you?
 
1 members found this post helpful.
Old 07-21-2014, 10:43 AM   #4
tahirfattani
LQ Newbie
 
Registered: Jul 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
@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
 
Old 07-21-2014, 11:06 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by tahirfattani View Post
@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.
 
Old 07-21-2014, 11:11 AM   #6
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
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/
 
Old 07-21-2014, 11:17 AM   #7
tahirfattani
LQ Newbie
 
Registered: Jul 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
@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???

Last edited by tahirfattani; 07-22-2014 at 05:49 AM.
 
Old 07-21-2014, 11:50 AM   #8
oneandoneis2
Senior Member
 
Registered: Nov 2003
Location: London, England
Distribution: Ubuntu
Posts: 1,460

Rep: Reputation: 48
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?
 
1 members found this post helpful.
  


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
Requires: perl(Carp) - URGENT nagikondaveti Linux - Desktop 9 11-08-2013 08:32 PM
[URGENT] Perl programming help summer Programming 16 12-05-2012 11:22 AM
LXer: Installing Eclipse, the Epic Perl plugin and my first Perl GUI program LXer Syndicated Linux News 0 05-08-2009 06:41 PM
Urgent : perl is not getting resolved in Solaris Spac 9 OS msgforsunil Solaris / OpenSolaris 9 06-27-2006 01:20 AM
Urgent attention Gins Linux - General 2 09-26-2005 12:16 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:23 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