EN0370 Sockets for Internet Programming
Layer 7 of the ISO/OSI 7 layer network model represents the level at which
user applications perform peer to peer communications through an
underlying protocol stack. The socket application programmer interface
is a core technology that allows user applications to access this
underlying protocol stack.
This module introduces the POSIX socket API defined by IEEE Std 1003.1
2004 edition. This will be in the context of producing network
applications, primarily in the C programming language. There will be
opportunities to develop a variety of network applications, including
client/server and peer-to-peer applications. Techniques required for the
development of robust, efficient and secure applications will be
introduced.
News
Assignment Specification 1st March 2011
The assignment specification is now available.Please address any queries about the specification to David Kendall.
Welcome to EN0370 for 2011. Teaching starts on Mon 17-01-2011.
Module Team
- Module Tutor
- David Kendall david.kendall@northumbria.ac.uk
- Lecturer
- Neil Eliot neil.eliot@northumbria.ac.uk
Teaching Arrangements
Lecture Mon 11.00 - 12.00 NB 316
Lab/Seminar Fri 14.00 - 16.00 EB D003 North
Synopsis
The aim of this module is to provide a grounding in the theoretical principles and practical application of the POSIX socket API.
On completion of this module, students will be able to:
- Develop an appropriate client/server model for an internet aware application.
- Critically analyse the sockets interface requirements of a given application.
- Design, write and test, programs that use the POSIX socket API.
Teaching Plan
The following is a provisional guide to the organisation of the module for this year. These arrangements are subject to change during the course of the module.
| Week | W/c | Lecture | Lab/seminar |
|---|---|---|---|
| 1 | 17-Jan | Introduction. [Slides] Simple Example [Slides] | Admin. Lab familiarisation. Hello World. |
| 2 | 24-Jan | Socket Preliminaries [Slides] | Network Programming Practical [Lab] [Code] |
| 3 | 31-Jan | Elementary TCP Sockets [Slides] | Network Programming Practical [Lab] [Code] |
| 4 | 07-Feb | Elementary UDP Sockets [Slides] | Network Programming Practical [Lab] |
| 5 | 14-Feb | Concurrent Servers [Slides] | Network Programming Practical [Lab] [Code] |
| 6 | 21-Feb | Broadcasting/Multicasting and Socket Options [Slides] | Network Programming Practical [Lab] [Code] |
| 7 | 28-Feb | Signals and Non-blocking I/O [Slides] | Assignment Introduction, Planning and Preparation [Specification] [Code] |
| 8 | 07-Mar | I/O Multiplexing [Slides] | Network Programming Practical |
| 9 | 14-Mar | P2P programming with DHT's | Assignment Reviews |
| 10 | 21-Mar | Assignment Surgery | Assignment Surgery |
| 11 | 28-Mar | Assignment Surgery | Assignment surgery |
| 12 | 04-Apr | Assignment Surgery | Assignment Demonstrations |
Assessment
Summative assessment is undertaken via:
- a group programming project + individual report, assessing all learning outcomes. [Assignment Specification]
Formative assessment is provided in the form of a variety of small development or analytical exercises with opportunities for discussion and review.
Recommended Reading
You are strongly advised to obtain a copy of one of the texts below for your personal use. Try the Northumbria University campus bookshop.
- [DON01] Donahoo,M., TCP/IP Sockets in C: Practical Guide for Programmers, Morgan Kaufmann, 2001 [Amazon]
- [GAY00] Gay,W., Linux Socket Programming By Example, Que, 2000 [Amazon]
- [SFR04] Stevens,W.R., Fenner,B., Rudoff,A.M., Unix Network Programming: Sockets Networking API v. 1, Addison Wesley, 2004 [Amazon]
Useful C programming reference books are:
- [HS02] Harbison,S., Steele,G., C: A Reference Manual, Prentice Hall, 2002 [Amazon]
- [KR88] Kernighan,B., Ritchie,D., The C Programming Language, Prentice Hall, 1988 [Amazon]
- [PC06] Prinz,P., Crawford,T., C in a Nutshell, O'Reilly, 2006 [Amazon]
If you are new to C programming, try the following introduction:
- [KOC04] Kochan,S. Programming in C, Sams, 2004 [Amazon]
The latest edition of a classic text about C programming in a Unix environment is:
- [SR05] Stevens,W.R., Rago,S., Advanced Programming in a Unix Environment, Addison Wesley, 2005 [Amazon]
Other resources
Standards and references
- IEEE Std 1003.1-2004 -- The POSIX standard
- C Programming Language standard -- Actually, this is a WG14 working paper for ISO/IEC 9899:TC2, but it reflects the consolidated standard at the time of issue (and it's free!).
- Standard C -- a handy, online reference to the Standard C language and its library. Now superseded by the references above but still an extremely useful resource.
- GNU C Library Manual [Local copy]
C Programming Tutorials
- C programming tutorial (Cardiff)
- C programming tutorial (Strathclyde)
- C programming tutorial (Washington)
- A C programming tutorial (Stanford)
C Programming Style
- Rob Pike's Notes on Programming in C
- AT&T/SUN C Programming Style Guide
- NASA C Programming Style Guide -- This is 100 pages of good advice for writing solid code. [Original link]
Other links




