Preface xi
teaching it. In the years since the first edition, we have learned a good deal about the topics
that students need lots of help on, and those where they do not need as much handholding.
We also found that our book was appreciated at least as much by practitioners who were
looking for a gentle introduction to the subject. Therefore, this book is aimed simultaneously
at two general audiences: students in introductory courses in computer networks (graduate or
undergraduate) with a programming component, and practitioners who want to write their own
programs that communicate over the Internet. For students, it is intended as a supplement, not
as a primary text about networks. Although this second edition is significantly bigger in size
and scope than the first, we hope the book will still be considered a good value in that role.
For practitioners who just want to write some useful code, it should serve as a standalone
introduction—but readers in that category should be warned that this book will not make
them experts. Our philosophy of learning by doing has not changed, nor has our approach of
providing a concise tutorial sufficient to get one started learning on one’s own, and leaving the
comprehensive details to other authors. For both audiences, our goal is to take you far enough
so that you can start experimenting and learning on your own.
Assumed Background
We assume basic programming skills and experience with C and UNIX. You are expected to be
conversant with C concepts such as pointers and type casting, and you should have a basic
understanding of the binary representation of data. Some of our examples are factored into
files that should be compiled separately; we assume that you can deal with that.
Here is a little test: If you can puzzle out what the following code fragment does, you
should have no problem with the code in this book:
typedef struct {
int a;
short s[2];
} MSG;
MSG *mp, m = {4, 1, 0};
char *fp, *tp;
mp = (MSG *) malloc(sizeof(MSG));
for (fp = (char *)m.s, tp = (char *)mp->s; tp < (char *)(mp+1);)
*tp++ = *fp++;
If you do not understand this fragment, do not despair (there is nothing quite so convo-
luted in our code), but you might want to refer to your favorite C programming book to find
out what is going on here.
You should also be familiar with the UNIX notions of process/address space, command-
line arguments, program termination, and regular file input and output. The material in
Chapters 4 and 6 assumes a somewhat more advanced grasp of UNIX. Some prior exposure to
networking concepts such as protocols, addresses, clients, and servers will be helpful.
评论0
最新资源