Introduction to Unix Network Programming

Instructor: Hung Q.
Ngo

Course homepage: http://www.cse.buffalo.edu/~hungngo/classes/TMA-Training/UNP/

Course Description: this short course introduces basic elements of
network programming in C under a typical Unix operating system. A tentative
list of topics includes, but not limited to, the following:

  • Day 1:

    • Brief overview of TCP/IP protocol stack

    • TCP and some network watching tools (ifconfig, netstat, tcpdump, etc)
    • Elementary UDP sockets
    • Elementary TCP sockets
    • Signal handling (for network programming)
    • A walk-through of some introductory examples
  • Day 2:
    • I/O multiplexing with select() system call
    • Name and address conversion
    • The simpella protocol
    • Non-blocking I/O
    • Overview of advanced network programming:
      • IPv4 vs IPv6
      • Daemon processes
      • Broadcasting & multicasting
      • Raw sockets
      • Accessing the datalink layer

Prerequisites: students are expected to have some rudimentary knowledge
of computer networking in general, and a working knowledge of system programming
in C/C++ under Unix/Linux (file I/O, processes, signal handling, make files,
etc.)

At the end of the course, students are expected to know how to do network
programming in C under Unix: TCP/UDP sockets, network I/O multiplexing, design
a fairly complex network program following a specified protocol.

Work load: the only way to actually learn (network) programming is to
actually program a non-toy application. There will be two programming assignments
for this course. The first one is a simple assignment which can be completed
within 2 days (of hard-work). This assignment is meant for students to get acquainted
to basic socket API. The second assignment is to be done in two weeks: students
are going to implement a simplified version of the Gnutella protocol called
Simpella. Simpella is mostly the same as Gnutella. A correct implementation
of Simpella should integrate easily into existing P2P networks that run Gnutella
(such as Morpheus, Bearshare, or Limewire).

References:

  • W. Richard Stevens, “UNIX Network Programming : Networking APIs : Sockets
    and XTI : Volume 1, Second Edition”, Prentice Hall, Oct 1997, ISBN: 013490012X.
  • James F. F. Kurose and Keith W. Ross, “Computer Networking: A Top-Down
    Approach Featuring the Internet”, 3nd edition, Addison Wesley, May 2004,
    ISBN: 0321227352. 848pp.
  • W. Richard Stevens Gary R. Wright, “The TCP/IP Illustrated, Volume
    1: The Protocols”, Addison Wesley Longman, Dec 1993, ISBN: 0201633469
  • W. Richard Stevens Gary R. Wright, “The TCP/IP Illustrated, Volume
    2: The Implementation”, Addison Wesley Longman, Jan 1995, ISBN: 020163354
  • W. Richard Stevens, Advanced Programming in the UNIX Environment, Addison-Wesley,
    1992.
  • William Stallings, Data and Computer Communications, 6/E, ISBN: 0-13-084370-9,
    Prentice Hall PTR, Nov 1999.
  • Andrew Tannenbaum, Computer Networks, 4/E, ISBN: 0-13-038488-7, Prentice
    Hall PTR, Aug 2002
  • Plus other online materials.