Advertisement
Guest User

README

a guest
Apr 19th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.11 KB | None | 0 0
  1. PROJECT 3 PART 1
  2.  
  3. THIS PROJECT DONE BY:
  4. --James Eriksen
  5. --Alan Thompson
  6.  
  7. NOTE: we had another group member, Kevin Song, who never got in touch with us
  8. to do this project. This project was 100% done by us two.
  9.  
  10. OUR CODE:
  11. 1) initialization
  12. 2) parse the config file
  13. 3) find out your neighbors
  14. 4) initialize your cost and routing tables. They will start with how to get to your
  15. neighbors and the cost associated with that
  16. 5) make a thread that will write to the path specified in the config file.
  17. 6) start up the sockets that will listen for new information (new thread for each one)
  18. NOTE: There are 2 sockets for each neighboring link: One that listens, and when
  19. necessary one that connects to the neighbor.
  20. 7) sleep(30). We apologize, but this is necessary because the run tool in CORE was
  21. unreliable for us. This sleep(30) allows the user to manually start the program
  22. on each node, so that each node is listening for connections before any attempts
  23. at connecting are made.
  24. 8) send to each of your neighbors your initial cost table.
  25. 9) BEGINNING OF INFINITE LOOP
  26. 10) check to see if your neighbors have sent you any new information
  27. 10a) first, we check to see if that neighbor is telling you to dump (more on that later)
  28. if you are being instructed to dump, then you do step 4 again before going on to
  29. step 11.
  30. 10b) then, you check if that neighbor has sent you a new table. If they did, you check to
  31. see if you needed to update your table with the info they gave you
  32. 11) Find out if your neighbors need to be given your table
  33. 11a) first, we check if you dumped. If you did, your neighbors need to dump as well
  34. 11b) then, we check if you updated your table. If you did, your neighbors need to see
  35. your updated information to see if they can get somewhere faster through you
  36. 12) sleep(routing_update_interval). This makes it so tables are updated according to the time
  37. given in the config file.
  38. 13) Check to see if we need to dump.
  39. 13a) The dump condition is whether the links between your neighbors have been
  40. changed since you started making your tables. If they have, then your
  41. tables need to be destroyed (hence, dumped) and started from scratch, as
  42. no weight information is reliable anymore.
  43. 13b) If we did dump here, then we need to remake our tables by repeating step 4
  44. 14) END OF INFINITE LOOP: GO BACK TO STEP 9
  45.  
  46. A note on our 'server' sockets: They take a message and parse it to see if the data
  47. contained within is important. Right now, the only control messages we accept
  48. 'CIRCUIT' (for being given a table to help build the circuit) and 'DESTROY' (for when
  49. we need to dump what we have in the trash and start over). In the future, they will
  50. handle other control messages.
  51.  
  52. HOW TO RUN:
  53. The files necessary to run this project are as follows (and should be included in our
  54. .zip file):
  55. --node.rb
  56. --A config file with data formatted as detailed below
  57. --A nodes-to-addrs file
  58. --An addrs-to-links file
  59. --gen_weights.rb
  60.  
  61. We have been running our code by intializing the proper CORE configuration (utilizing the
  62. given 417-s1.imn), then running gen_weights in a terminal window behind the scenes,
  63. then running our code on each node as 'ruby <path to node.rb> <path to config_file>'
  64. (without the quotes of course). We have been running them manually instead of using
  65. the Run tool because of inconsistency with the tool. We apologize for the inconvenience,
  66. but hope you will bear with us.
  67.  
  68. We have provided a shell script, as per the prompt. However, all it does is run
  69. 'ruby /home/core/project3/node.rb /home/core/project3/config_file'. If this does
  70. not work for you, running it as we do in the previous step should be satisfactory.
  71.  
  72. The config file needs to be properly configured. It consists of these lines:
  73. max_packet_size
  74. nta_file_location
  75. atl_file_location
  76. weights_location
  77. routing_update_interval
  78. routing_table_dump_path
  79. dump_interval
  80.  
  81. Which are defined as below:
  82. max_packet_size: this is the max size of the message sockets can send to each other.
  83. We recommend a large size, as cost tables need to be sent in these messages.
  84. nta_file_location: the location of the nodes-to-addrs.txt file. Does not need to be called
  85. nodes-to-addrs.txt.
  86. atl_file_location: the location of the addrs-to-links.txt file. Does not need to be called
  87. addrs-to-links.txt.
  88. weights_location: the location of the weights file that gen_weights.rb is filling
  89. routing_update_interval: the amount of time between updates of the routing tables
  90. routing_table_dump_path: the directory that the program will make a file containing the
  91. routing table for this node at that time.
  92. NOTE: each node is going to have its own file, and that file's name will be the hostname
  93. i.e. node n1 will have a file named n1 that will hold the latest routing table.
  94. dump_interval: the amount of time between the writing of routing tables into a file
  95.  
  96. An example config file is provided, and can be modified to suit the user's needs.
  97.  
  98.  
  99. Any questions with the running of this program can be asked via email, to:
  100. --James Eriksen: jimbo_1993@msn.com
  101. --Alan Thompson: athomps2@terpmail.umd.edu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement