This series of lab experiments is designed to introduce you to computer networks. Using simple
equipment, one or more PCs with plug-in network cards connected to a Network Emulator Unit, and this
manual you will be able to study the design and behavior of many different types of networks. You will
also learn how to write software to implement, control and use these networks. The source code of our
implementations of all the exercises is available online for you to study.
The description of each experiment starts with a statement of the problem and the concepts that
you will learn. Next, the necessary data structures and program are developed. The complete pseudo-
code and parts of the C source listing are given in the manual. The section Trying It Out guides you
through demonstrations of the concepts and may include small modifications to the program. To get the
full benefit from this lab, you should work at least to the end of this section in every experiment.
Next, some notes including assumptions, limitations and applications are given. Finally, there are
supplementary exercises that involve major modifications to the developed program to further illustrate
the concepts and hone your skills.
You can do each experiment in two ways. First, using the code that we provide, you can setup
the experiment, run it and take measurements to study the behavior of the network. This illustrates the
concepts described in textbooks. Second, you can develop the code for the experiment yourself or modify
the sample programs to also get programming experience with networks.
The entire C code in this book conforms to certain standards with respect to commenting, layout
and naming of variables. This is to make the code self-documenting to enable the writer and others to be
able to easily understand it at some later point in time. It is strongly recommended that you consistently
adopt either this or an equivalent style in all your programs. While the temptation may be to postpone
writing comments in your code, it is always easier to write meaningful comments while you are writing the
code. Commenting that is put off often never gets done properly, if at all.
The Appendices include a description of the programmer's interface to the LAN Trainer, how to
develop your own LAN Trainer programs, an annotated bibliography of relevant reading material, and an
index.
These are outlined below. Complete details on how to test and use the LAN Trainer are given in
Appendix A.
NIU Card
Each PC that is part of the LAN Trainer setup must have an NIU Card plugged into it. This card
has two independent full-duplex serial channels each of which can operate at data rates between 8 Kb/s
and 1 Mb/s. The card supports DMA as well as programmed I/O data transfers. With one such card, a PC
acts as two independent network nodes.
Once it is properly installed, the Serial Card should not require further attention. The data rate is
set from the Network Emulator Unit, and all other parameters can be set by software.
NIU Library
Above the hardware is a library of C functions that provides a programming interface to the LAN
Trainer, similar to that provided by typical Ethernet and other network adapters. This emulated NIU is
register-based, with command, data and status registers. These can be accessed via a set of C functions:
NIU_Cmd(), NIU_Data() and NIU_Status(). The NIU library also provides a comprehensive set of
interrupts.
Application Software
The final component in any experiment is the application software. This uses the facilities of the
NIU library to accomplish some communication task, such as transferring a message from one node to
another. Each of the two nodes on each PC can have its independent application software. Your
programs will be at this level.