Homework: 22C:178 & 055:134
[due 3 September]
Computer Communications Fall 1998
For projects in this course, you will need to write
programs that use (1) system calls, and (2) various
forms of timers to monitor the efficiency of
certain network operations. This assignment is
to refresh your C skills and start to
learn a few system calls.
One simple system call available using Linux and
most unix systems is the gettimeofday function.
Another less simple system service is the
getitimer & setitimer pair of functions.
There are yet other time-related system calls, and the
command man -k time will display quite a number
Two elementary programs illustrate some uses of
gettimeofday and getitimer calls.
uses the gettimeofday call to report elapsed
time in a program loop; the program
also does this, but in a different way. To test
these programs, follow these steps.
Turning in your answers:
Prepare an email answering the above questions. Mail
the homework to firstname.lastname@example.org and specify
in the subject line, the course number, the assignment number
and the last four digits of your student ID number (we are
hoping that four digits will be unique). So, for example
if your student number is 123456789, then the
subject line of your email should be:
- Download this
and give it the name reptest.
- Then download
- Execute the command sh reptest, which
should compile and execute the two C programs.
If you have problems compiling and running these programs,
please email the teaching assistant,
who will help diagnose the problem.
- Using man gettimeofday and man getitimer
learn about the two system calls.
- Answer these questions:
- Can you explain what the script sh reptest is doing?
- What is the difference between the timings of the two programs?
- Which technique for measuring time is more accurate ?
(This is not a simple question!)
178 homework 1, student 6789
If you do not have such a subject line, I will bounce
your letter back to you and ask for a resubmission of