
CS4251 Spring 2000
Computer Networking II
Lab 1 LAN Simulation - Basic System
Due February 8th
Purpose:
The purpose of this series of labs is to familiarize you with the operation and performance of Medium
Access Control (MAC) protocols by simulating a few variations of a basic LAN configuration, the dual
bus, with different types of traffic and under different conditions. At the end of the simulations you should
have a practical understanding of:
1. Factors that affect LAN performance
2. How to generate basic types of traffic
3. How to characterize the performance of a LAN
4. Techniques for gaining confidence in the accuracy of your simulation
The Basic LAN Protocol:
The physical configuration consists of a number of stations connected to two buses. One bus carries
information downstream while the other carries information upstream. A station will write on the upstream
bus if the station to which it wishes to send data is upstream of it. Conversely a station will write on the
downstream bus when writing to stations downstream of it. Obviously the most downstream station has no
need to write on the downstream station and vice versa for the most upstream station. The system is slotted
and stations can read the slots as they pass by and decide how they will process the slot on the basis of
what they read. We will assume that a station can only add signals to the signals already written in a slot
(logically an OR-ing operation. For those of you familiar with DQDB the physical configuration is
virtually the same. Note that one can read a field in a slot and write in the same slot. Obviously one needs
delay in the station to achieve this! This is necessary for the “busy bit”. If the busy bit is a “0” the slot is
empty and the station can write in that slot, setting the busy bit to “1” to indicate that it cannot be written
by another station.
The basic protocol is fairly simple. It will get a little more complex as we try to improve it. A station that
wants to transmit a frame (one frame fits in exactly one slot) examines the busy bit of each slot passing by
and writes in the first slot that is empty. The station also examines the destination address of each frame
passing by. If it detects its own address it passes the frame up to a higher protocol layer. That’s it. Simple!
You have a skeleton of the code to simulate this protocol available to you. You can copy it from the
directory ~limb/pub/8113. The file is lab1.c The simulation, in effect, starts at station 1 with each slot and
follows that slot as it propagates down the cable from one end to the other. All that is missing from the
code is a few lines that you will write after studying the program to see how it is organized. You need to
see if the station queue is non-empty and if so “write” in the slot. We don’t actually have to write in the
slot. We just need to record the fact that we have “written” the data out and break out of the loop, as we
know that no other station can write in the slot after it has already been written in (because that’s how the
protocol is defined to work).