meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
courses:ct30a5000:introexercises [2011/09/02 17:16]
julaakko [Remote usage - howto]
courses:ct30a5000:introexercises [2012/08/30 16:24] (current)
julaakko
Line 1: Line 1:
-Network programming [[https://​noppa.lut.fi/​noppa/​opintojakso/​ct30a5000/etusivu|@ Noppa]] | [[courses:​ct30a5000:​start|@ wiki]] -  +Network programming [[https://​noppa.lut.fi/​noppa/​opintojakso/​ct30a5001/etusivu|@ Noppa]] | [[courses:​ct30a5000:​start|@ wiki]] -  
-Updated: ​  ​--- //​[[jussi.laakkonen@lut.fi|Jussi Laakkonen]] ​2011/09/02 11:47//+Updated: ​ --- //​[[jussi.laakkonen@lut.fi|Jussi Laakkonen]] ​2012/08/20 17:40//
 ~~SLIDESHOW~~ ~~SLIDESHOW~~
  
-====== ​CT30A5000 ​- Network Programming ====== +====== ​CT30A5001 ​- Network Programming ====== 
-**Introduction exercises on 2.9.2011**+**Introduction exercises on 31.8.2012**
  
-**2011 - 2012**+**2012 ​- 2013**
  
 M.Sc Jussi Laakkonen (Room: 2517) M.Sc Jussi Laakkonen (Room: 2517)
Line 13: Line 13:
  
 **Exercises:​** **Exercises:​**
-  * **1st period** (Weeks 35,37,39,40) - **Fridays ​1415 1600** +  * **1st period** (Weeks 35,37,39,41) - **Fridays ​1215 1400** 
-  * **2nd period** (Weeks 43,45,47) - **Fridays ​1415 1600**+  * **2nd period** (Weeks 43,44,46) - **Fridays ​1215 1400**
  
-Additionally:​ two days (8.12.2011 & 9.12.2011) are reserved for Home examination demonstration.+Additionally:​ two days (4.12.2011 & 5.12.2011) are reserved for Home examination demonstration.
  
 Reception hour: Wednesday 1500 - 1600 (Room: 2517) Reception hour: Wednesday 1500 - 1600 (Room: 2517)
Line 39: Line 39:
   * Comment your code (add name, student number and email to **every** file)   * Comment your code (add name, student number and email to **every** file)
   * Document your work (README: how to run, what has been done, own ideas)   * Document your work (README: how to run, what has been done, own ideas)
-  * Use makefile+  * Use makefile ​(mandatory)
   * Use good structure for your code (divide code to functions and files)   * Use good structure for your code (divide code to functions and files)
  
Line 62: Line 62:
 ===== Sending an assignment ===== ===== Sending an assignment =====
  
-  * Send the assignment **before** deadline! Late return is __always 0 points__.  +  * Put your code into SVN repository at https://​www2.it.lut.fi/​svn/​courses/​CT30A5001/​ 
-    Each assignment must be returned in order to pass the course. +  Your login name is mapped ​to folder with your student number ​(read/write
-    * Last minute changes ​(e.g. fixing bugs): +  Code will be checked out at deadline 
-      The "​buggy"​ version must be **returned by deadline**. +    ​only then, not before, not after 
-      Must be returned **within 6 hours** from the deadline. Only **one** bugfix version can be returned! +  ​Put into following directories:​ 
-      * **WITH documentation of changes**. +    A<n>, where ''<​n>''​ is the assignment number 
-  Send to assistant as an email attachment: __gzipped tar-ball__ (file.tar.gz) (see ''​man tar''​)+    E.g. Assignment 1 into ''​A1'',​ assignment 2 into ''​A2'',​ etc
 +    Except Home Examination,​ it goes into ''​HE'' ​directory
    
 +===== The directory content ====
  
-===== The assignment file ==== +  ​* The directory should contain: 
- +    * **Code** ​(documented in __english__ or in __finnish__) 
-  * Gzipped tar-ball +    * **Headers** 
-  * Naming of the file: **studentnumber_firstname_lastname.tar.gz** +    * **Readme** ​(in __english__ or in __finnish__) 
-    * The top level of your archive should be just one directory, __which is named as archive itself__. +    * **Makefile**  
-    ​* The directory should contain: +    * __**NO** BINARY FILES__
-      * **Code** +
-      * **Headers** +
-      * **Readme** +
-      * **Makefile** +
-      * __**NO** BINARY FILES__+
  
 ===== Getting started ===== ===== Getting started =====
Line 102: Line 99:
   * Use e.g. {{:​courses:​ct30a5000:​helloworld.tar.gz|}} for testing   * Use e.g. {{:​courses:​ct30a5000:​helloworld.tar.gz|}} for testing
  
-===== 1.1 Vim =====+===== 1.1 Vi / Vim =====
  
   * Terminal editor, starts in normal mode (editing not enabled)   * Terminal editor, starts in normal mode (editing not enabled)
   * There is also Vim with GUI: **gvim**   * There is also Vim with GUI: **gvim**
-  * Usage: **vim sourcecode.c**+  * Usage: **vim sourcecode.c** or **vi sourcecode.c**
   * Some basic commands: <​code>​a ​     - append (start editing)   * Some basic commands: <​code>​a ​     - append (start editing)
 i      - insert (start editing) i      - insert (start editing)
Line 225: Line 222:
 Connecting with ssh outside university: Connecting with ssh outside university:
   - Connect with **ssh** to **ssh.lut.fi** with your university account (connections from Lnet are allowed).   - Connect with **ssh** to **ssh.lut.fi** with your university account (connections from Lnet are allowed).
-    * E.g. **ssh 0123456@ssh.lut.fi**+    * E.g. **ssh lutlogin@ssh.lut.fi**
   - After login connect with **ssh** to selected [[admin:​pentinkulma|class 6218 computer]]   - After login connect with **ssh** to selected [[admin:​pentinkulma|class 6218 computer]]
  
Line 238: Line 235:
 ===== Helpful sources, books.. ===== ===== Helpful sources, books.. =====
  
-  * Beej's Guide to Network Programming (do not use ''​getaddrinfo()''​ for getting local IP addresses, use ''​getifaddrs()'' ​instead+  * Beej's Guide to Network Programming (read the usage of ''​getaddrinfo()'' ​carefully, ​for getting local IP addresses ​see also ''​getifaddrs()''​) 
-  * TCP/IP illustrated +  * IPv6 Network Programming,​ //​Jun-Ichiro Itojun Hagino// 
-  * TCP/IP Sockets in C: Practical Guide for Programmers +    * Chapters: 1.4, 2.1, 2.2, 2.3, 4.1, 4.2, 4.3, 4.4, 4.5, 4.7 
-  * Linux Socket Programming by Example +  * TCP/IP illustrated, //W. Richard Stevens // 
-  * UNIX Network Programming:​ The Sockets Networking API Volume 1+  * TCP/IP Sockets in C: Practical Guide for Programmers, //Michael J. Donahoo, Kenneth L. Calvert// 
 +  * UNIX Network Programming:​ The Sockets Networking API Volume 1, //W. Richard Stevens,​Bill Fenner,​Andrew M. Rudoff//
   * But be aware and beware: "GNU is not UNIX and Linux is not UNIX" && "Unix is a Linux-like operating system",​ //Jon "​Maddog"​ Hall//   * But be aware and beware: "GNU is not UNIX and Linux is not UNIX" && "Unix is a Linux-like operating system",​ //Jon "​Maddog"​ Hall//
  
 ---- ----
- 
 ====== Example codes ====== ====== Example codes ======
  
Line 253: Line 250:
 Simple Hello World example including makefile. Simple Hello World example including makefile.
  
-{{:​courses:​ct30a5000:​helloworld.tar.gz|}}+NEW: {{:​courses:​ct30a5000:​udpexample2012.tar.gz|}} 
 + 
 +OLD: {{:​courses:​ct30a5000:​helloworld.tar.gz|}}
   * Extract: <​code>​tar xzf helloworld.tar.gz</​code>​   * Extract: <​code>​tar xzf helloworld.tar.gz</​code>​
     * creates a directory "​helloworld"​     * creates a directory "​helloworld"​
Line 264: Line 263:
   * Client sends a character to given address and quits.   * Client sends a character to given address and quits.
  
-Unpack: {{:​courses:​ct30a5000:​udpexample.tar.gz|}}+Unpack: {{:​courses:​ct30a5000:​udpexample2012.tar.gz|}}
   * creates a folder "​udpexample"​   * creates a folder "​udpexample"​
 +  * build with **make**
 +
 +===== TCP client and server =====
 +
 +Simple TCP client and server example.
 +  * Server listens for incoming connections and disconnects them right after accept().
 +  * Server prints address information of the connected client.
 +  * Client just connects and quits right after disconnection.
 +
 +Unpack: {{:​courses:​ct30a5000:​tcpexample2012.tar.gz|}}
 +  * Creates a folder "​tcpexample"​
   * build with **make**   * build with **make**