Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write a Java program to process tcpprobe.dat in the following way It deletes the

ID: 3916076 • Letter: W

Question

write a Java program to process tcpprobe.dat in the following way

It deletes the last line containing incomplete data;

It replaces all white space delimiters on all lines with commas;


And it separates the three TCP flows based on their source port numbers (the source IP addresses are useless here because all three TCP flows were from the same IP) and spills them out into three separate files.

which must run in the following way: java Process_TCPProbe_yourinitial tcpprobe.dat tcpprobe_xxxxx_comma.dat tcpprobe_yyyy

The program takes four arguments: one raw data file as input and three output files. Of course, please replace the placeholder xxxxx , yyyyy , and zzzzz with the actual source port numbers in your data file.

The last line in your data file may be incomplete and needs to be truncated.
On each line, the default delimiters between the fields are white spaces, which must be replaced with commas ( , ) to facilitate further processing tasks.
And most importantly, all three flows (i.e. from sources 10.10.1.2:51205 , 10.10.1.2:51207 , and 10.10.1.2:51206 are mixed in one file. They must be separated.

The following is a sample of one of the output files for your reference:

The last line in your data file may be incomplete and needs to be truncated.
On each line, the default delimiters between the fields are white spaces, which must be replaced with commas ( , ) to facilitate further processing tasks.
And most importantly, all three flows (i.e. from sources 10.10.1.2:51205 , 10.10.1.2:51207 , and 10.10.1.2:51206 are mixed in one file. They must be separated.

Notice that your source port numbers might be different than 51205 , 51206 , and 51207

29312 ...

29312 ...

...

The TCP module probe records a line of output every time a packet is sent, if either the destination or the source port number in the TCP packet header is 5001 (since we loaded it with the port=5001 option in the last step of pre-lab5).

Each line of output will include the following 11 fields, in order:

lab5.pdf Field Time Sender Receiver Bytes Next Unacknowledged Send CWND Slow start threshold Explanation Time (in seconds) since beginning of probe output Source address and port of the packet, as IP:port Destination address and port of the packet, as IP:port Bytes in packet Next send sequence number, in hex format Smallest sequence number of packet send but unacknowledged, in hex format Size of send congestion window for this connection (in MSS) Size of send congestion window for this connection (in MSS) Send window size (in MSS). Set to the minimum of send CWND and receive window Send window size Smoothed RTT Smoothed estimated RTT for this connection (in ms) Receiver window size (in MSS), received in the lack ACK. This limit prevents the receiver buffer from overflowing, i.e. prevents the sender from sending at a rate that is faster than the receiver can process the data. Receive window 4 By looking at your TCP probe data, you can observe the behavior of the TCP congestion control algorithm

Explanation / Answer

modprobe tcp_probe port=5001 chmod 444 /proc/net/tcpprobe cat /proc/net/tcpprobe >/tmp/tcpprobe.out &TCP TCPCAP=$! iperf -i 10 -t 100 -c receiver kill $TCPCAP