next up previous
Next: Other issues Up: No Title Previous: No Title

TCP implementation

You need to implement the connection establishment and termination. The best way is to implement it using the standard TCP states. (At the minimum, and for less credit, implement only the ``common'' case.)

Once the connection is established (we reached the establish state) we will use a very non-standard approach to implement TCP.

You implementation will include two components. One component will be responsible for deciding when to send a segment. The other component will decide which segment to send. The when component will decide when a segment can be sent, and forward a signal to the which component, that will decide which segment to send over the connection.

For the when component you can use any reasonable approach. Here are two basic alternatives, with a similar flavor. They both have a counter that keeps how many credits we have to send segments, and each time we send a segment we reduce the counter by one (or the number of bytes sent). A segment can be sent only if there is sufficient credits for it.

  1. Every time unit add y credits (y can be a real number).
  2. For each new acknowledgment add z credits and each time unit add y credits.

The parameters should be adjusted to reflect the load, and this should be done dynamically. (However, at the first stage, start with fix parameters, and only once you got it to work, implement the dynamic modification of the parameters.)

For the which component you are also free to chose your design. The two things to keep in mind is that you should resend old segments, since they might get lost, and you should send ``new'' segments, to keep the throughput high. Here are some alternatives.

  1. Keep three queues. One of segments that where not sent yet. A second for segments that where sent, but we are still waiting for an ACK. A third for segments that where sent, but need to be resent. In a fraction of the time send from the first queue and in a fraction of the time send from the third queue.
  2. Keep track of the number of segments that where send and not ACK yet (say this number is k). With some probability (say tex2html_wrap_inline165 ) resend a segment that was already sent, and the other times send a new segment.

next up previous
Next: Other issues Up: No Title Previous: No Title

Yishay Mansour
Sun Dec 14 16:00:47 "IST 1997