Lab 08 - Networking (Client / Server) (revision 130823-r02)

  1. You will need to cooperate with your classmate(s) to do this tutorial and you are need to connected with your friend in the same network using LAN cable. Therefore, it will be better to use computer in Lab than use your own laptop.
  2. Before doing Lab 8 tutorial, let's change your network.
  3. Open Terminal in Tiny Core.
  4. Did you still remember your username before? Log in with your username.
    $ sudo su
    $ su ramot.stephanus
    

    If you don't bring your old Core Plus, add your username and login.
    $ sudo su
    $ adduser ramot.stephanus
    $ su ramot.stephanus
  5. If you haven't, create your CLASS folder, checkout the content of your NPM. Create Lab08 directory in your /CLASS/NPM folder. Change CLASS with your class and NPM with your student ID. All of today's work will be put in Lab08 folder.
    $ mkdir KI140/
    $ cd KI140/
    $ svn checkout https://projects.ui.ac.id/svn/os/KI140/NPM/
    $ cd NPM/
    $ mkdir Lab08/
    $ svn add Lab08
    $ svn commit -m "submit lab 08" 
    $ cd Lab08/
    
  6. Get today's token from apps OS.
  7. Download Lab08.tar.bz2
    $ wget --no-check-certificate https://projects.ui.ac.id/attachments/7372/Lab08.tar.bz2
    
  8. See the file list in Lab08.tar.bz2, extract the files, then delete Lab08.tar.bz2.
  9. Change [NPM] and [TOKEN] in all of the .c files with your student ID and token. Change also [KELAS] with your class in Makefile.
  10. Create a file named "catat-Lab08.txt" with this content:
    ZCZC [KELAS] TGS Lab08 [TODAY]
    ZCZC [TOKEN] LOG [NOTES]
    

    Change [KELAS], [TODAY], [TOKEN], and [NOTES] with your class, today's date with format dd-mm-yyyy, and simple Notes such as "Today's lab is so cool!"
  11. Record your output to file "catat-Lab08.txt"
    $ script -a catat-Lab08.txt
    
  12. Compile client.c and server.c
    $ cc -o client client.c
    $ cc -o server server.c
    
  13. Run the server program:
    $ ./server 9000
    
  14. Open new Terminal window, login again to your new username and get into Lab08 directory. So now you've opened two Terminal window, one still running the server program above. Do the following using the second Terminal window.
  15. Record the output to "catat-Lab08.txt"
    $ script -a catat-Lab08.txt
    
  16. Run the client program:
    $ ./client [your_IP] 9000
    

    Change [your_IP] with the ip address that you got in the previous excel list, for example 192.168.1.101.
  17. Type your message, end it with Enter. See what happens in the first Terminal window that run server program.
  18. In the first Terminal window, compile clientserver.c.
    $ cc -o clientserver clientserver.c
    
  19. Now make a group with your classmates, minimum 3 people. The more member you have, the more score you will get. The highest score will be given if the whole class work as a group to do the following problem.
  20. Do the message sending with your friends:
    student 1:  ./clientserver 9000 null null
    student 2:  ./clientserver 9000 [IP_student_1] 9000
    student 3:  ./clientserver 9000 [IP_student_2] 9000
    .
    .
    .
    student N:  ./clientserver 9000 [IP_student_N-1] 9000
    

    Example:
    1. There is a group consists of 3 students.
    2. Student 1 is class REG140 0706166503 YOZA WIRATAMA, student 2 is 0806316303 ASAD FATCHUL ILMI, student 3 is 0906510035 ANANDRA A. RINALDO SOROINDA. Based on where they sit, the students have IP 192.168.1.10, 192.168.1.12, 192.168.1.13.
    3. YOZA WIRATAMA will run the program ./clientserver 9000 null null
    4. ASAD FATCHUL ILMI will run the program ./clientserver 9000 192.168.1.10 9000
    5. ANANDRA A. RINALDO SOROINDA will run the program ./clientserver 9000 192.168.1.12 9000
  21. After all the students run the program like above, the first student moves to the second Terminal window in his/her Tiny Core, and executes the following:
    student 1:  ./clientserver null [IP_student_N] 9000
    
    1. YOZA WIRATAMA will run the program ./clientserver null 192.168.1.13 9000
  22. See the result of your work.
  23. Stop all of the recording script in all of Terminal windows.
  24. Open the third terminal window, you should log with tc account again. Create Lab08 directory in /CLASS/NPM/. Copy your work back to tc account.
    $ cd KI140/NPM/Lab08/
    $ svn update
    $ cd Lab08/
    $ cp /home/YOUR_USERNAME/KI140/NPM/Lab08/* /home/tc/KI140/NPM/Lab08/
    
  25. Do MD5SUM.
  26. Please check and submit your work.
  27. Please do not forget to check repository.

Back to Wiki's Page