Hi,
I beg your help again.
Recently, I run your script in Ubuntu, and its TCPDUMP seems like have some problem. I paste part of your code below.
String[] tcpdumpCmd = {"/usr/sbin/tcpdump","-l", "-nntt" ,"-i", "eth0"};
try {
Process p = new ProcessBuilder(tcpdumpCmd).start();
BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
String tcpdumpOut = null;
while ((tcpdumpOut = in.readLine()) != null ) {
System.out.println(tcpdumpOut);
The script can not print or any info from tcpdump, which means the buffer is null. As a result, the reponseTime is always 0. Are your script depending on specific OS? And if so, could you give me some pointer to achieve reponseTime?
Another question is about computeReponseTime algorithm. Does the flag.contains("P") equals true means that packet is TCP or UDP? As long as two packet match in IP level, no matter what transport layer protocol is and what transport layer port is, they're considered as a same connection, and the response time count from that? So if a TCP packet send from h1 to h2, and h2 send a UDP packet right after that by chance, this two packet will therefore be considered as a same connection?
Hi, I beg your help again. Recently, I run your script in Ubuntu, and its TCPDUMP seems like have some problem. I paste part of your code below.
String[] tcpdumpCmd = {"/usr/sbin/tcpdump","-l", "-nntt" ,"-i", "eth0"}; try { Process p = new ProcessBuilder(tcpdumpCmd).start(); BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); String tcpdumpOut = null; while ((tcpdumpOut = in.readLine()) != null ) {
System.out.println(tcpdumpOut);
The script can not print or any info from tcpdump, which means the buffer is null. As a result, the reponseTime is always 0. Are your script depending on specific OS? And if so, could you give me some pointer to achieve reponseTime? Another question is about computeReponseTime algorithm. Does the flag.contains("P") equals true means that packet is TCP or UDP? As long as two packet match in IP level, no matter what transport layer protocol is and what transport layer port is, they're considered as a same connection, and the response time count from that? So if a TCP packet send from h1 to h2, and h2 send a UDP packet right after that by chance, this two packet will therefore be considered as a same connection?
Thanks. TINCEHUANG