COMP3221代写、Python编程设计代写

Due: March 31st, 2023 (Friday, Week 6) by 11:59 PM
COMP3221
Assignment 1: Routing Algorithm
The goal of this assignment is to implement routing protocols for a network topology using
Socket and Multi-threading Programming in Python. Important: This is an individual project;
therefore, each student has to submit his/her own assignment.
1 Learning Objectives
In this assignment, you are required to implement routing protocols for a specified network
using Python. In particular, your task is to complete a program that helps each node exchange
routing information with its neighboring nodes, and then finding the least-cost path to all
nodes in the network. Furthermore, your program has to deal with link cost changes and
failures in the network. It should have at least three separate threads to do the necessary
tasks for each node such as listening (for receiving information from its neighbors), sending
(for sending information updates after every 10 seconds), and routing calculations (when
link-cost changes).
On completing this assignment you will gain sufficient expertise in the following skills:
Designing a routing protocol
Socket and Multithreaded programming using Python
Handling routing dynamics
2 Network Architecture and Simulation
You are required to generate a network topology including 10 nodes and at least 15 connec-
tions between nodes. Those connections and their link costs are generated randomly. Figure 1
is a sample network topology with 10 nodes and 15 connections (you are not allowed to reuse
this sample topology).
Since we do not have access to a real network, we will simulate the network on a single
machine and use it for implementation and testing. You can use different terminals (one
for each node in the net topology) to run different instances of your program on the same
machine (use "localhost").
Figure 1: A sample network topology with 10 nodes and 15 connections.
3 Program structure
The program should be named as COMP3221_A1_Routing.py and accept the following
command line arguments:
1 python COMP3221_A1_Routing.py
For example:
1 python COMP3221_A1_Routing.py F 6005 Fconfig.txt
Node-ID: the ID of a node in the net topology. In this assignment, Node-ID is indexed
following the English alphabet, for example, A, B, C, D, etc.
Port-NO: the port number of a node listening to the information update packets. The
port number is indexed using integers starting from 6000 and is increased by one for
each node. For example, the net topology in Figs. 1 has 10 nodes including: A, B, C, D,
E, F, G, H, I, and J. The port number of each node is 6000, 6001, 6002, 6003, 6004,
6005, 6006, 6007, 6008, and 6009, respectively.
Node-Config-File: Fconfig.txt, for example, is the configuration file for Node F that
has the following details:
1 4
2 A 2.3 6000
3 C 3.2 6002
4 E 2.8 6004
5 J 5.4 6009
The first line of this file indicates the number of neighbors for Node F (it is not the total
number of nodes in the network). The next four lines are to determine the connection
of Node F to its neighbors. Those lines start with the neighbor ID, followed by the cost
Distributed Systems Page 2
COMP3221 Routing Algorithm
to reach this neighbor from Node F, and finally the port number that this neighbor is
using for listening.
For example, the second line in the Fconfig.txt above indicates that the cost to neighbor
A is 2.3 (floating-point numbers) and Node A is using port number 6000 for receiving
information update packets. It is noted that all link costs are symmetric (the same in
both directions, e.g., the cost from F to A is the same as that from A to F). Moreover,
Node F must not have global knowledge (i.e. information about the entire network
topology).
Initially, each node creates an information update packet (containing the appropriate infor-
mation: its neighboring nodes and cost links between it and its neighbors) and sends this
packet to all direct neighbors. You are free to define the exact format of the information up-
date packets. Upon receiving these information update packets, each neighboring node will
incorporate the provided information for routing algorithms. Each node should periodically
broadcast the information update packet to its neighbors every 10 seconds.
On receiving information update packets from all other nodes, a node can build up a reach-
ability matrix. Given a view of the neighboring nodes and their reachability, a node should
run a routing algorithm (Bellman-Ford, Dijkstra, etc..) to compute the shortest paths to all
other nodes within the network. Each node should wait for 60 seconds since starting-up and
then execute the routing algorithm.
Once a node finishes running the routing algorithm, it will print out to the terminal the least
cost path to each destination node in the topology (excluding itself) along with the cost of
this path. The following is an example output for node F in some arbitrary network:
1 I am Node F
2 Least cost path from F to A: FA, link cost: 2.3
3 Least cost path from F to B: FAGB, link cost: 4.7
4 Least cost path from F to C: FC, link cost: 3.2
5 Least cost path from F to D: FCD, link cost: 4.3
6 Least cost path from F to E: FE, link cost:4.5
7 Least cost path from F to G: FAG, link cost: 4.5
8 Least cost path from F to H: FEH, link cost: 5
9 Least cost path from F to I: FCDI, link cost: 5.8
10 Least cost path from F to J: FJ, link cost: 5.4
Your program should execute forever (as a loop). In other words, each node should keep
broadcasting information value packets every 10 seconds and the routing algorithm should
be executed every time the link cost change occurs.
Please note that all routing algorithms must be implemented by yourself from scratch,
using libraries is not allowed.
4 Dealing with changes in link cost and failure
You must ensure that your program has the ability to deal with the changes in link costs
and failures. Whenever the link cost changes the network must be able to reconverge to
accommodate the costs.
Distributed Systems Page 3
COMP3221 Routing Algorithm
To simulate the changes in link cost and failures, you must provide a command-line interface
(CLI) for each node to give the ability to modify the link-cost to its neighbors. A simple
method would be using a separate thread to modify the configure files. Any modification on
the CLI will affect the configured files.
Once the cost of a link changes, the connected nodes must recalculate the cost of reaching
other nodes and must also provide an update to its neighbors, who will then notify their
neighbors and so on until the network converges.
Here is an example of the correct output for Node F before and after the failure of Node C is
given. You should check your implementation for correctness at all nodes with multiple node
failures.
Output with all nodes working:
1 I am Node F
2 Least cost path from F to A: FA, link cost: 2.3
3 Least cost path from F to B: FAGB, link cost: 4.7
4 Least cost path from F to C: FC, link cost: 3.2
5 Least cost path from F to D: FCD, link cost: 4.3
6 Least cost path from F to E: FE, link cost:4.5
7 Least cost path from F to G: FAG, link cost: 4.5
8 Least cost path from F to H: FEH, link cost: 5
9 Least cost path from F to I: FCDI, link cost: 5.8
10 Least cost path from F to J: FJ, link cost: 5.4
Output after Node C fails:
1 I am Node F
2 Least cost path from F to A: FA, link cost: 2.3
3 Least cost path from F to B: FAGB, link cost: 4.7
4 Least cost path from F to D: FAGBD, link cost: 5.4
5 Least cost path from F to E: FE, link cost: 4.5
6 Least cost path from F to G: FAG, link cost: 4.5
7 Least cost path from F to H: FEH, link cost: 5
8 Least cost path from F to I: FAGBDI, link cost: 6.9
9 Least cost path from F to J: FJ, link cost: 5.4
5 Submission and Report
You are required to submit the following files to Canvas separately.
? Code (zip file includes all implementation, and config files for all nodes)
SSID_COMP3221_Code.zip.
? Code Text (including all implementation in one file exported in a txt file for Plagiarism
checking)
SSID_COMP3221_Code.txt.
? Readme (Clearly state how to start the program, change link-cost, client failures, and
Distributed Systems Page 4
COMP3221 Routing Algorithm
running environment)
SSID_COMP3221_Readme.txt.
Report (pdf)
SSID_COMP3221_Report.pdf.
The size of your report MUST be under 2 pages. Your report should briefly document your net
topology, routing algorithm, techniques and methodology used for implementation and the
simulation results of each requirement. It should act a reference for your markers to quickly
figure out what you have and haven’t completed, how you did it, and it should mention
anything you think that is special about your system.
Please note that you must upload your submission BEFORE the deadline. The CANVAS would
continue accepting submissions after the due date; however, late submissions would carry
penalty per day with maximum of 5 days late submission allowed.
6 Academic Honesty / Plagiarism
By uploading your submission to CANVAS you implicitly agree to abide by the University
policies regarding academic honesty, and in particular that all the work is original and not
plagiarised from the work of others. If you believe that part of your submission is not your
work you must bring this to the attention of your tutor or lecturer immediately. See the policy
slides released in Week 1 for fusrther details.
In assessing a piece of submitted work, the School of Computer Science may reproduce it
entirely, may provide a copy to another member of faculty, and/or communicate a copy of
this assignment to a plagiarism checking service or in-house computer program. A copy of
the assignment may be maintained by the service or the School of Computer Science for the
purpose of future plagiarism checking.
7 Marking
This assignment is worth 15% of your final grade for this unit of study. The ratio of assign-
ment parts is divided as follows.
Code: 80%.
Report: 20%.
Please refer to the rubric in Canvas (Canvas -> Assignment 1 -> Rubric) for detailed marking
scheme. The report and the code are to be submitted in Canvas by the due date.
After Assignment 1 marks come out, please submit your inquiries about marking within
the 1st week. All inquiries after that will NOT be responded.
Distributed Systems Page 5

热门主题

课程名

int2067/int5051 bsb151 babs2202 mis2002s phya21 18-213 cege0012 mgt253 fc021 mdia1002 math39512 math38032 mech5125 cisc102 07 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 efim20036 mn-3503 comp9414 math21112 fins5568 comp4337 bcpm000028 info6030 inft6800 bcpm0054 comp(2041|9044) 110.807 bma0092 cs365 math20212 ce335 math2010 ec3450 comm1170 cenv6141 ftec5580 ecmt1010 csci-ua.0480-003 econ12-200 ectb60h3f cs247—assignment ib3960 tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 econ7230 msinm014/msing014/msing014b math2014 math350-real eec180 stat141b econ2101 fit2004 comp643 bu1002 cm2030 mn7182sr ectb60h3s ib2d30 ohss7000 fit3175 econ20120/econ30320 acct7104 compsci 369 math226 127.241 info1110 37007 math137a mgt4701 comm1180 fc300 ectb60h3 llp120 bio99 econ7030 csse2310/csse7231 comm1190 125.330 110.309 csc3100 bu1007 comp 636 qbus3600 compx222 stat437 kit317 hw1 ag942 fit3139 115.213 ipa61006 econ214 envm7512 6010acc fit4005 fins5542 slsp5360m 119729 cs148 hld-4267-r comp4002/gam cava1001 or4023 cosc2758/cosc2938 cse140 fu010055 csci410 finc3017 comp9417 fsc60504 24309 bsys702 mgec61 cive9831m pubh5010 5bus1037 info90004 p6769 bsan3209 plana4310 caes1000 econ0060 ap/adms4540 ast101h5f plan6392 625.609.81 csmai21 fnce6012 misy262 ifb106tc csci910 502it comp603/ense600 4035 csca08 8iar101 bsd131 msci242l csci 4261 elec51020 blaw1002 ec3044 acct40115 csi2108–cryptographic 158225 7014mhr econ60822 ecn302 philo225-24a acst2001 fit9132 comp1117b ad654 comp3221 st332 cs170 econ0033 engr228-digital law-10027u fit5057 ve311 sle210 n1608 msim3101 badp2003 mth002 6012acc 072243a 3809ict amath 483 ifn556 cven4051 2024 comp9024 158.739-2024 comp 3023 ecs122a com63004 bms5021 comp1028 genc3004 phil2617
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图