tcp - CS168 Programming Assignment 3 TCP over IP over UDP...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS168 Programming Assignment 3: TCP over IP over UDP Assignment Out: March 14, 2010 Milestone: March 27, 2010 Assignment Due: April 17, 2010, 10pm 1 Introduction In this project, you will implement a simple, but RFC-compliant form of TCP on top of IP from your last assignment. You will build the transport layer and export a sockets API similar to what you used in Snowcast. Chapter 6 of the book should be especially helpful. Each year, students report this assignment is an order of magnitude harder than its predecessor (seriously). But when you are done here, you will really understand TCP. We’ve given you a lot of time for this assignment–use it wisely! 2 The Pieces In this assignment you will use the library you wrote for IP as the underlying network (TCP uses a value of 6 for the protocol field of the IP header). Your TCP implementation will have four major pieces — the state machine that implements connection setup and teardown, the sliding window protocol that determines what data you are allowed to send and receive at any point, the API to your sockets layer, and a driver program that will allow all of us to test your code. 2.1 State Machine You have to implement a state machine that allows state transitions in your TCP. You can use this diagram 1 to help orient yourself. The state machine is not as complicated as it may seem, but you should be sure that your TCP follows all state transitions properly, and doesn’t do anything otherwise. For example, you need to send SYNs for connect, and FINs to close. You will be expected to follow RFC793 2 precisely. You don’t have to handle the parts of the RFC that refer to urgent data, precedence, and security. You can start coding by just using the diagram and getting connections to set up and close under ideal conditions. However, there are tons of less obvious cases that the diagram doesn’t cover 1 2 1 CS168 TCP- for example, what happens when, after a call to connect , you’ve sent a SYN, but you receive a packet that has an incorrect ACK in it? Once your basic state diagram is working, we recommend that you look at the RFC for answers to questions such as these. In particular, pages 54 and on contain info on exactly what you should do in such scenarios. 2.2 Sliding Window Protocol You need to implement the sliding window protocol that is the heart of TCP. Make sure you understand the algorithm before you start coding. Also keep in mind how sliding windows will interact with the rest of TCP (e.g. shutdown for write, etc). Be sure that you can accept out-of-order packets. That is, a packet’s sequence number doesn’t have to be exactly the sequence number of the start of the window. It can be fully contained within the window, somewhere in the middle. The easiest way to handle such packets is to place them on a queue of potentially valid packets, and then deal with them once the window has caught...
View Full Document

This note was uploaded on 12/03/2010 for the course CS 168 taught by Professor Jj during the Spring '10 term at Brown.

Page1 / 8

tcp - CS168 Programming Assignment 3 TCP over IP over UDP...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online