Just For Fun: Networking (revision 151123-r01)

Return to Lab 10

  1. Download Lab10.tar.bz2
    $ wget --no-check-certificate https://projects.ui.ac.id/attachments/download/8326/Lab10.tar.bz2
  2. See the file list in Lab10.tar.bz2, extract the files, then delete Lab10.tar.bz2.
  3. Change [NPM] in all of the .c files with your student ID. Change also [KELAS] with your class in Makefile.
  4. Compile all the c files using the make script
    $ make
  5. Run the server program:
    $ ./server 9001
    
  6. Open new Terminal window and get into Lab10 directory. So now you've opened two Terminal window, one still running the server program above. Do the following using the second Terminal window.
  7. Record the output to "catat-Lab10.txt"
    $ script -a catat-Lab10.txt
    
  8. Find out your IP:
    $ /sbin/ifconfig

    Look at eth0 (sometimes becoming eth1 / ethn)-> inet addr.
  9. Run the client program:
    $ ./client [your_IP] 9001
    

    Change [your_IP] with the ip address that you got in the previous command, for example 152.118.24.164.
  10. Type your message, end it with Enter. See what happens in the first Terminal window that run server program.
  11. Now make a group with your classmates, minimum 3 people. The more member you have, the more score you will get.
  12. Do the message sending with your friends:
    student 1:  ./clientserver 9002 null null
    student 2:  ./clientserver 9002 [IP_student_1] 9002
    student 3:  ./clientserver 9002 [IP_student_2] 9002
    .
    .
    .
    student N:  ./clientserver 9002 [IP_student_N-1] 9002
    

    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 152.118.31.101, 152.118.31.102, 152.118.31.103.
    3. YOZA WIRATAMA will run the program ./clientserver 9002 null null
    4. ASAD FATCHUL ILMI will run the program ./clientserver 9002 152.118.31.101 9002
    5. ANANDRA A. RINALDO SOROINDA will run the program ./clientserver 9002 152.118.31.102 9002
  13. 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] 9002
    
    1. YOZA WIRATAMA will run the program ./clientserver null 152.118.31.103 9002
  14. See the result of your work.
  15. Gather as many friends as you can so that your group chain becomes longer. Please remember that the best grade is given to the group that has the longest chain, and if the whole students of each class (REG, INT, MTX) participating as one group, you will be given bonus score of 15 for REG, bonus score of 10 for INT and 5 points for MTX. INT and MTX can get the 15 score bonus if you join REG.
  16. This is the end of Just For Fun: Networking tutorial.

Return to Lab 10
Return to Wiki

Lab10.tar.bz2 (2.97 KB) Ramot Stephanus Sihombing rast20, 25/11/2015 14:05

ifconfig.png (19 KB) Ramot Stephanus Sihombing rast20, 25/11/2015 14:05