Lecture Notes and Further Information

  1. Introduction ( handout and overhead presentation).

  2. The client-server model ( handout and overhead presentation). We learn about the client-server model at the base of all the network applications. This matter is also covered in Chapter 2 of the textbook.

  3. Concurrency ( handout and overhead presentation). Concurrency is a must for network application, and here is a first look at how it can be accomplished. This first look is according to Chapter 3 of the textbook. We will revise and expand the discussion later.

  4. Application program interfaces ( handout and overhead presentation). This section is concerned with the principles and examples of application programming interfaces. In the textbook APIs are covered by Chapter 4, Chapter 5, and part of Chapter 6.

    Sample code: You may find the following various helper functions for both servers and clients useful (take a look at the header for details). You are welcome to use them in your assignments, but first make sure you understand what happens in there. In other words, keep it someplace and refer to it once you are presented with new TCP-related concepts; the archive may contain examples of use for these concepts. You are not expected to understand all the code at once, concepts shall be introduced as the course progresses.

  5. Client design ( handout and overhead presentation). Clients may be complex pieces of software (think modern Web browser), but the communication part is fairly straightforward. This section is covered in the textbook in Chapter 6. Note that at this time we re only concerned with TCP clients; the UDP part will be discussed later.

    Sample code: Here is a simple client. The archive contains the various functions for TCP clients you have seen already (tcp-utils.h and tcp-utils.cc), and code for a simple client that does roughly the same thing as the parameterized telnet client (client.cc).

  6. Server design ( handout and overhead presentation). Here is how a server looks like. Most of this discussion is also covered in Chapters 8 and 13 of the textbook, though critical regions are extra.

    Sample code: You have seen a client, so we now have a server for a change. Besides the known tcp-utils module (tcp-utils.h and tcp-utils.cc), the archive contains a simple server, which receives lines of text from clients and send them back prefixed by a string. There are in fact three implementations of this server, produced by the following targets in the associated makefile (the default target makes them all):

  7. Multithreaded servers ( handout and overhead presentation). Concurrent programs (including obviously servers) can also be implemented in a single process using multiple threads of execution. This matter is also covered in Chapter 12 of the textbook.

    Sample code: Here are two more servers: a multithreaded one (tserv.cc) and another which features a monitor thread (mtserv.cc). The implementation of the monitor is for all practical purposes identical to the one presented in Section 12.8 of the textbook. Note in passing that this archive also contains a makefile that through judicious macro definitions does not need any rule actions (except of course for the “clean” target).

  8. Managing concurrency ( handout and overhead presentation). Concurrency is managed in most real-life servers, and for a good reason. This is also covered in Chapter 16.

    Sample code: Here you have yet another addition to our family of servers. Specifically, you have now a multithreaded server with a control socket opened to local machine only (mctserv which is also a multiservice server if you think about it, see the next section), a multithreaded server that uses preallocation (mtpserv), and a multiprocess server that also uses preallocation (cpserv).

  9. Multiservice servers ( handout and overhead presentation). There is nothing preventing servers from handling clients of different types using different application protocols. Also see Chapter 15.

    Sample code: Here you have the whole collection of servers. In addition to what you have seen already, a sample super server has been added (see the included README for details).

  10. Practical issues ( handout and overhead presentation). Servers are daemons that is, programs that sit quietly in background and only wake up to respond to specific requests. This section explains how to create Unix daemons in general (and well-behaved servers in particular). This is also covered in the textbook Sections 30.1 to 30.23.

Lecture recording

Lectures are recorded as follows: