FAQ for IP Lab #2



If you are still in trouble even after going through the FAQs, look at the bulletine board in WebCT.
If there is nothing like your question, post it on the board.


Q. When my congestion window starts to equal my reciever window, the program kinda just craps out and halts at Get_pdu_from_send_queue(tcp_layer, pkt, offset) within output_pkt().

A. Such a problem (segmentation facult) could occur if your offset is too large and actually points outside the range of the array/data structure which holds the packet. You should be pay attention in the following cases:



Q. Where do we get the segment length? How to calculate the length of the data that can be sent?

A. segment length segLen=tcp_layer->tcp_mss. The lengh of the data=max_seq-tcp_layer->tcp_snd_nxt



Q.In tcp_output(), we are asked to update the value tcp_layer->tcp_rtseq. Could you please tell me what value should be?

A. it would be the seq # of a segment which is timed by the timer as the comment says. all you need for this is: tcp_layer->tcp_rtseq = tcp_layer->tcp_snd_nxt;



Q.How do I find the max_buffer_offset?

A. You need to call function calculate_max_send_queue_offset(), and the parameter is tcp_layer.



Q.I am trying to find the max_to_send_offset. Is it equal to min(tcp_layer->tcp_snd_wnd,
tcp_layer->tcp_snd_cwnd)?

A. No. Use: tcp_layer->tcp_snd_una + Minm(tcp_layer->tcp_snd_cwnd, tcp_layer->tcp_snd_wnd)-1.



Q.I am trying to find the max_to_send_offset. Is it equal to min(tcp_layer->tcp_snd_wnd,
tcp_layer->tcp_snd_cwnd)?

A. No. Use: tcp_layer->tcp_snd_una + Minm(tcp_layer->tcp_snd_cwnd, tcp_layer->tcp_snd_wnd)-1.



Q. Is the 2nd argument of update_cwnd() supposed to be in units of segments or in bytes?

A. Bytes. the same unit as 'tcp_snd_wnd'....



Q. Are we supposed to initialize/change tcp_mss anywere? Or is it a given constant for our purposes?

Nope.



Q. What is tcp_layer->tcp_snd_max? What part of the program keeps track of it? How different is it from tcp_snd_nxt-1 ?

tcp_snd_max is used by some other functions you don't need to modify. But, you should set this value when you update tcp_snd_nxt. If max is less than nxt, set max = nxt right after nxt is updated
.



Q. In tcp_out(): If send_nxt always points to the next seq. number to be sent, aren't we supposed to send that segment and only then update send_next with a new number? The comment instructs us to do it in the opposite sequence.

Send first and then update nxt. You're right. You can ignore the last comment which says "check to see..."



Q. The comment inside tcp_out() says: "..calculate thesequence number of the maximum byte that can be sent. If tcp_snd_nxt is less than the above calculated value, then data is available". Isn't the data is also available if max. seq.Number to send is equal to tcp_snd_nxt?

yes the data is available if max_buf_offset is equal to tcp_snd_nxt.


Q. Which functions are fast retransmission function and I don't need to modify them?

process_outofsequence_pkt(), reset_dupacks() and fast_rexmit_code().