[ee122] IMPORTANT - Read - Change in Project 2 (Re: accept() concept)

vern at cs.berkeley.edu vern at cs.berkeley.edu
Tue Nov 20 21:47:11 PST 2007

> I was wondering if the socket returned by accept() has the same port number
> on the server side of the pipe as the listener.


> Also, a lot of these send() recv() calls seem to happen under the surface of
> our application (where the client seems to be continuously ACK'ing packets
> even though they're not technically in the recv() call). Does this pose a
> problem, namely with RTT and timeouts? How does the normal TCP do it when we
> use send()/recv()? It seems like the OS handles everything for us (ACK
> wise).

You've homed in on a key, tricky issue.

Essentially, to do this correctly, you need to have multiple threads of
execution running concurrently, rather than a single one.  With TCP under
Unix, one thread is in the kernel and the other is the application at

We have in fact decided that this is too much complexity to ask of the
students by the end of the semester.  Thus, we're right now revising the
Project #2 writeup to reflect that for full credit, you just need to
implement a sending program that transfers a file to a receiving program,
and for which you can structure the program as presenting your protocol
with a single (large) buffer to send, after which your protocol has the
thread of execution which it can use to send timers and process incoming
acks - or, on the other side, process data packets that arrive asynchronously,
send acks back as needed, and collect together the entire transfer into
one large buffer that it then passes back to the receiving program.

You can in addition port your Project 1 Web client & server for extra
credit, but it is no longer a mandatory part of the project.

The revised writeup will go out either tonight or tomorrow morning.


More information about the ee122 mailing list