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 [2012/08/20 13:04]
julaakko [Sending an assignment]
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~~
  
Line 14: Line 14:
 **Exercises:​** **Exercises:​**
   * **1st period** (Weeks 35,​37,​39,​41) - **Fridays 1215 - 1400**   * **1st period** (Weeks 35,​37,​39,​41) - **Fridays 1215 - 1400**
-  * **2nd period** (Weeks 43,44,46,47) - **Fridays 1215 - 1400**+  * **2nd period** (Weeks 43,44,46) - **Fridays 1215 - 1400**
  
 Additionally:​ two days (4.12.2011 & 5.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: Xday xx00 xx00 (Room: 2517)+Reception hour: Wednesday 1500 1600 (Room: 2517)
  
 ===== Arrangements ===== ===== Arrangements =====
Line 62: Line 62:
 ===== Sending an assignment ===== ===== Sending an assignment =====
  
-  * Put your code into SVN repository+  * Put your code into SVN repository ​at https://​www2.it.lut.fi/​svn/​courses/​CT30A5001/​ 
 +  * Your login name is mapped to folder with your student number (read/​write)
   * Code will be checked out at deadline   * Code will be checked out at deadline
     * only then, not before, not after     * only then, not before, not after
   * Put into following directories:​   * Put into following directories:​
-    * E<n>, where ''<​n>''​ is the exercise ​number +    * A<n>, where ''<​n>''​ is the assignment ​number 
-    * E.g. Exercise ​1 into ''​E1'', ​exercise ​2 into ''​E2'',​ etc.+    * E.g. Assignment ​1 into ''​A1'', ​assignment ​2 into ''​A2'',​ etc.
     * Except Home Examination,​ it goes into ''​HE''​ directory     * 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**