Introduction to Network Communication (lab) -Danzig
Introduction to Network Communication: This lab gives hands on
experience on the working of PC serial ports. You will program the RS-232 ( rs232 )
interface and use it to communicate between computers. This is a physical
layer (level 1 in OSI) protocol. This lab will thus
give an idea of how communication protocols work.
Recommended Reading
Look at the following web sites for more info about serial
ports and RS-232:
Grading Policy
The lab grade will be composed of:
-
Attendence - 10%
- Quiz - 20 %
-
Ex2 - 20%
-
Ex3 - 20%
-
Ex4 - 30%
Lecture Slides
These slides are in two formats: HTML and Power Point. For the PowerPoint version, download the PowerPoint
version to your computer and print it through the PowerPoint application.
It is possible to print 1,2,3 or 6 slides to a single page.
Click here for lecture one which discusses RS-232C
and UART 8250 (HTML version) or here for the
Power
Point version.
Click here for lecture two which discusses the
Control Lines (HTML version) or here for the PowerPoint
Version.
Programming
As you will be programming in C /C++ observe the C programming conventions.
See my list of programming pinciples.
Here are some of the more basic rules:
-
Indentation of loops and if/else statements
-
Functions of a reasonable size so that they can be understood at a glance
-
Meaningful variable and function names
-
Use #define or const for constants and write them in
upper-case
And of course observe other good programming practices such as
-
Don't use cool tricks just to save a
variable or line of code
-
On the other hand don't go allocating MBs of memory if buffers can
be reused
-
Free unused memory allocations
Documentation
Documentation is part of the assignment. Follow these rules:
-
Give a general description of the classes or data structures you use, their
purpose and where they should be used.
-
Document every function (class member or not), it's inputs, outputs and
general description. The function should be written in a way that no documentation
in the body of the function is needed.
-
Document untrivial (i.e. not i,j,k,sum ...) variables when defined
-
Document "tricky" lines of code ( if (x = (y >> 2)) && z?1:0)
)
Submission
You are to submit one hard copy of the code per pair. Do this only after the
assignment has been tested by the lecturer.
Assignment Grading
The grade for each assignment is composed of :
-
Programming: 15% - Observation of "correct" programming techniques.
-
Communications: 20% - Correct use of the material given in
the theoretical course.
-
Execution: 50% - Correct performance of the program's goal.
-
Documentation: 15% - Clear documentation of your program.
For late submissions the penalty is a reduction of 10 points
per week.
Exercises
Sample COM port program