System processing time scriptshell


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting System processing time scriptshell
# 1  
Old 03-26-2017
Wrench System processing time scriptshell

I am new to scripting in Linux. I have captured traffic generated between a client and FW (server). I would like to measure the time each packet remains in the server (processing time). I have the key idea, but I am not sure how to implement this and write a script does what I need. Each arriving packet has a timestamp as well as the packets leaving the system. The processing time should be done by subtracting both values. However, I find it difficult to implement this using packet Id in tcpdump. Do you have any suggestion for me so I can collect arrival packet timestamp and as well as leaving packet timestamp?

Thank you.
# 2  
Old 03-27-2017
Hi eronad,
Welcome to the UNIX & Linux Forums.

With questions like this, it always helps if you tell us what operating system you're using, tell us what shell you're using, show us representative sample input that you want to process, and show us the output that you hope to produce from that sample input.

If you show us what you have tried to solve this problem on your own, it gives us a better feel for help you need so you can learn from your experiences and help you figure out what still needs to be done.
# 3  
Old 03-27-2017
Quote:
Originally Posted by eronad
Each arriving packet has a timestamp as well as the packets leaving the system. The processing time should be done by subtracting both values. However, I find it difficult to implement this using packet Id in tcpdump. Do you have any suggestion for me so I can collect arrival packet timestamp and as well as leaving packet timestamp?
I suppose the real problem is to find out which arriving package corresponds to which leaving package, no? If, say, five requests are processed by a server, this will result in 5 incoming packets and (later) 5 outgoing packets. But it might be that arriving packet 1 is answered by outgoing packet 4 and arriving packet 2 by outgoing packet 1, etc.. How will you know which of these packets correspond?

I hope this helps.

bakunin
# 4  
Old 03-27-2017
Quote:
Originally Posted by eronad
Do you have any suggestion for me
I think you should first decide, what programming language you will use. tcpdump essentially produces data in tabular format, so awk is an obvious choice. However, tabular data can be analyzed equally well with other languages - Perl, Ruby, Python, just to name a few - and I personally tend to use one of those, because they provide more flexibility, which might be handy in case the problem increases in complexity. For example, I tend to use Ruby for those tasks, but this is just personal taste.

Since you said that you are new to scripting, you need to learn a new language anyway, so you can start using one of them. I would recommend in your case to do it either in Perl or in Ruby:

- Perl has the advantage, that it is already installed on virtually every system.

- Ruby has the advantage, that it is very easy to learn, so it might be better suitable for beginners
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Processing 1 match string from grep at a time

hi all, i have a few log files with dates that are incorrrect (please don't ask me why). i need to add 2852 days, 16 hours, and 21 minutes (246471660 seconds) to each of these dates to correct them. i need to write to new "test2.txt" file that corrects the dates found by grep and yet have it... (4 Replies)
Discussion started by: cilantrocado
4 Replies

2. Solaris

System time and Cron time stamp not matching

On Solaris 10 server the system date won't match with the timestamp on files created by a cron jobs, Please help here is what i get when i check for system date infodba-ie10ux014:/tcpdv1_ie10/tcadmin/bin\n\r-> date Tue Apr 24 15:27:43 GMT 2012at same time i executed a cron job, and checked... (4 Replies)
Discussion started by: karghum
4 Replies

3. UNIX for Dummies Questions & Answers

Real time processing

Hi Not sure if this can be achieved by unix , but still would like to know if there is any way by which I can do the below given logic cat sam1 > out1 cat sam2 > out2 when either one of this finished the the next file shd be written in that file, meaning cat sam3 >> out1/out2... (2 Replies)
Discussion started by: Sri3001
2 Replies

4. IP Networking

Processing time

I want to know the processing time taken by a node.example suppose a node ges a rreq...then it searched through it's table to see if it has a fresh route or not.I want to know this search time...is their any function available for doing this in ns2 or in glomosim.Any help is highly appreciated ... (1 Reply)
Discussion started by: prashantgolu
1 Replies

5. UNIX for Dummies Questions & Answers

What command to time processing of code

What command do I run to see how long it takes the CPU to process a line of code? (1 Reply)
Discussion started by: glev2005
1 Replies

6. Shell Programming and Scripting

Calculate processing time

I have a log file which has a lot of output but I am interested in the following Processed records: 34749; Processed files: 67445 Job run run at Thu May 6 03:00:01 PDT 2010 Job finished at Thu May 6 12:22:14 PDT 2010 So I would like to have the output as Total time Records Files... (2 Replies)
Discussion started by: gubbu
2 Replies

7. UNIX and Linux Applications

Processing batches of files at a time

Hi I would like to run my script to process as many as 50 files at a time. Currently my script is being called like so: ./import.sh -f filename so I want to call my script in this way and it must execute every file in the directory /var/local/dsx/import (1 Reply)
Discussion started by: ladyAnne
1 Replies

8. Shell Programming and Scripting

Sorted list by time of spu processing

Hi, i have to make a command in unix system which make a sorted list by cpu time (not %cpu ). If the application exists more than a time I would like to keep only one copy. Could you help me please ??? P.s : I am trying --> ps aux --sort -%cpu | uniq but I understand that is wrong (5 Replies)
Discussion started by: petros55
5 Replies

9. Shell Programming and Scripting

System time comparison to fixed defined time

I have a requirement of checking the current system time and performing certain actions in a shell script. example: if the current system time is greater than 1400 hrs, then perform step 1,2,3 if the current system time is greater than 1000 hrs, then perform step 1,2 if the current system time... (2 Replies)
Discussion started by: zainravi
2 Replies

10. Shell Programming and Scripting

Time based Processing of the Scripts

Any one can tell me how can i execute the processes for every 10 min.Actually iam having 3 Processes for every 10 min i want to run these 3 Process,one process at every 10 min. If any of the process is busy i just want to execute the free one. first 10 min execute P1 next 10 min execute P2... (3 Replies)
Discussion started by: krk_555
3 Replies
Login or Register to Ask a Question