CS3357b Computer Networks I http://www.csd.uwo.ca/courses/cs3357b Ph.D. student Office: WSC 127 Mike Burrell W 3:30 4:30, Th 1:30 3:30 mburrel@uwo.ca TA hours to be decided Come to lectures (M 4:30 5:30, W 4:30 6:30) Check the website often http://www.csd.uwo.ca/ courses/cs3357b Come my office hours (WSC 127) W 3:30 4:30, Th 1:30 3:30 Doing well Go to the TAs office hours (to be announced) Email myself or the TAs often Start assignments early Be awesome at coding :D started too late undescriptive subject line doesn t describe problem doesn t include code doesn t include error messages not from UWO email account creative grammar/ spelling
CS3357 in subject line rest of subject is descriptive Textbook attached code from UWO account says what s been tried already Peterson and Davie. Computer Networks: A Systems Approach. Edition 4 At least 1 copy at Taylor library It s required just like most computer science textbooks are required (i.e., not at all) Kurose and Ross is also very good Extra material I say again: check the website often! Links to extra material, websites, etc., will pop up to supplement the textbook Reading the textbook will not give you everything you need to know for this course! Evaluation 4 assignments (worth 5%, 10%, 10% and 10%) Midterm: 25% Final exam: 40% To get 50%: 50% on exams, 40% on assignments To get 60%: 50% on exams, 60% on assignments
Assignments Must run on department machines (GAUL) You can work on your home machine if you have Unix (e.g., Linux, BSD, OS X, or even Windows with cygwin) Must be done in C Must use Makefiles (for use with gmake) Assignments All assignments are given out on the webpage, so check it often! Assignment 1 is already up! Assignments are to be done individually! Do not let others see your assignment! Do not look at others assignments! Coding standards Use multiple.c files Usually I won t tell you how to break it up, but you will be graded on it ;) This requires you use.h files! Running gmake should compile all executables Running gmake test should compile and execute a simple test suite Assignment submission Both paper and electronic submissions are required Electronic submissions are due one minute past 11:59pm on the given due date Paper submissions are due 5pm the following day
Late assignments 5% per day (Saturday+Sunday are 1 day) Assignments will not be accepted after 4 days late 4 late coupons (removes late penalty for 1 day) Late coupons do not let you hand something in more than 4 days late! Ethical Conduct Summary: don t be unethical, jackass You MUST adhere to Rules of Ethical Conduct http://www.csd.uwo.ca/ethical_conduct.htm You MUST not commit any Scholastic Offences: http://www.csd.uwo.ca/undergrad/ #include <unistd.h> ssize_t read(int fildes, void *buf, size_t nbyte); ssize_t write(int fildes, const void *buf, size_t nbyte); Socket Programming Textbook chapter: 1.4 How do I find out more information? man -s 2 read Write to standard out write(1, Hello world!\n, 13); Echo from standard in char buf[50]; int num_chars = read(0, buf, sizeof buf); write(1, buf, num_chars);
#include <unistd.h> ssize_t read(int fildes, void *buf, size_t nbyte); ssize_t write(int fildes, const void *buf, size_t nbyte); Note! The textbook uses the system calls recv and send instead of read and write Either way works for our purposes! Consider read synonymous with recv (when flags=0) and write synonymous with send (when flags=0) #include <unistd.h> ssize_t read(int fildes, void *buf, size_t nbyte); ssize_t write(int fildes, const void *buf, size_t nbyte); What are read and write good for? Dealing with stdin (fildes = 0), stdout (fildes = 1), stderr (fildes = 2) Read from and write to files! What is a file descriptor? open gave you an integer (file descriptor) which allows you to read from or write to a specific file on the filesystem Process A Hello World! File Foo connect lets us do the same thing, but reading/writing over the network! Hello World! Process A on machine Z Process B on machine Y
What are sockets? They re just file descriptors! Let you read and write just like with a file Obviously there is magic happening behind this simple interface