CSS 432
FAQ on Program 3: TCP Analysis


Q1: In how details should I draw a timing chart for hw3?

A: As much as possible.

The css430tcpdump shows all ip packets exchanged between the local host and a given remote host. For each packet, indicate all the information including timestamps, message sequence numbers, ip addresses, port numbers and some notations such as S, ., P, and F.

Q2: Can I reuse the code from HW1?

A: Yes

Q3: I don't know how to use shutdown( ).

A: Type "man 2 shutdown".

Actuall all you need is shutdown( serverSd, SHUT_WR ); where serverSd is a socket descriptor obtained from the server's accept( ) call.

Q4: Do I have to use TCP_NODELAY in hw3.cpp like in hw1?

A: No, you should not use TCP_NODELAY.

Q5: When does an IP packet have a P notation. When does an IP packet have a "." notation.

A: An IP packet that carries the last data of a given write( ) call has a P(Push) option.

If you try to send data whose size is more than MSS, it is segmented into several packets. All those packets except the very last one has a "." notation, but the last one has a "p" notation indicating that this is the last data of a given write( ) call.

Q6: Parameters passed to ttcp

I have a question about ttcp. You stated that the format for the arguments for ttcp is as follows:
       -l#     length of bufs read from or written to network (default 8192)
       -b#     set the socket buffer size if supported (default is 16384)
       -p#     specify another service port (default is 5001)
Should we have a space between the argument character and the number?

A: No, the number should follow the option without a space.

Q7: For Analysis 1 and 3, we are to make a graph or table in terms of Mbps. Should we look at the client or server Mbps? I know the two do not greatly differ.

A: Focus on the client Mbps.

Q8: Does the nagle-off option slow donw?

I've got an issue with strace and I'm not sure if it's suppose to be like this or not. When I'm running strace -c -e trace=write ./ttcp -l 64 -n 1048576, and tcpdump at the same time(test#4), the finish times are really slow. I'm getting mbps from 6.78407(nagle off) to 10.3316(nagle on). It takes 18 microseconds per write for nagle on and 51 mircoseconds per write for nagle off. Should it be that slow(almost 1 minute to finish with nagle off)? If I don't run strace, it's faster(~90 mbps for nagle on, ~15 mbps for nagle off). So are the results truly accurate when I'm running strace?

A: With the nagle off, the performance should be degraded as you saw in your correct results.

This is because OS need a certain time to transmit data to NIC, and the nagle-off situation requires more frequent writes which cumulates such OS overhead.

Q9: With using strace, the times are considerably slower if I don't use strace

A: Since strance traces every single OS system call and prints it out to the display, it causes more frequent interrputs and thus slows down.