Routing Algorithm代写-COMP3221代写-代写CS
Routing Algorithm代写

Routing Algorithm代写-COMP3221代写-代写CS

COMP3221

Due: 8 April 2022 (Friday Week 7) by 11:59 PM

Assignment 1: Routing Algorithm

Routing Algorithm代写 In this assignment, your task is to implement a routing protocol using Python for a specified network.

The goal of this assignment is to implement a routing protocol using Socket and Multi-threading Programming in Python.

Submission Details  Routing Algorithm代写

This is an individual project, and each student has to submit his/her own version.

1.1 Learning Objectives

In this assignment, your task is to implement a routing protocol using Python for a specified network. In particular, your program is run at all nodes in the network. At each node, the  input of your program is a set of its neighbors coming with the corresponding link costs. Each node will exchange information with its neighboring nodes, and then finding the least-cost path to all nodes in the network. Moreover,  your program has to deal with link cost changes.  It should have at least three separate threads to do the necessary tasks 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 routingprotocol
  • Socket and Multi-threading programming usingPython
  • Handling routingdynamics

1.2 Network architecture and simulation  Routing Algorithm代写

You are free to choose the net topology. The topology includes 10 nodes and the link between nodes are generated randomly. Each topology has at  least  15  connections,  for  example,  Figs. 1.

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: An example of a net topology with 10 nodes.

1.3 Program structure

The program should be named as COMP3221_DiVR.py and accept the following command line arguments:

1 python COMP3221_DiVR.py <Node-id> <Port-no> <Node-config-file>

For example:

1 python COMP3221_DiVR.py F 6005 Fconfig.txt

  • Node-id: the ID of a node in the net In this assignment, Node-id is indexed followingthe English alphabet, for example, A, B, C, etc..  Routing Algorithm代写
  • Port-no: the port number of a node listening to the information update packets. The port number is integer indexed 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 K. The port number of each node is 6000, 6001, 6002, 6003, 6004, 6005, 6006, 6007, 6008, and 6009,respectively.
  • Node-config-file: txt, for example, is the configuration file for Node F that has the followingdetails:

1 4

2 A 2.3 6000

3 C 3.2 6002

4 E 2.8 6004

5 K 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


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 the link costs will be consistent in both directions,  i.e.,  if the cost from F to A is similar to the cost from A to F.  Addionally,  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.  Routing Algorithm代写

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

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.

Routing Algorithm代写
Routing Algorithm代写

1.4 Dealing with changes in link cost and failure  Routing Algorithm代写

You must ensure that your program is robust to changes in link costs and failures. Once the cost of link changes the network must be able to reconverge to accommodate the costs.

You must provide an interface for each node to give the ability to modify the link-cost of its neighbors. A simple method would be to run a separate thread that will modify the configure files. Any modification on the interface 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

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: FKI, link cost: 8.9

1.5 Submission and Report

You are required to submit your source code and a short report to Canvas.

  • Code(zip file includes all implementation, readme, and config files for all nodes)

SSID_COMP3221_Code.zip.

  • Code (including all implementation in one file exported in a txt file for Plagiarism check- ing)

SSID_COMP3221_Code.txt.

  • Readme: Clearly state how to start the program, change link-cost, client failures, and running
  • Report(pdf)

SSID_COMP3221_Report.pdf.

Please note that you must upload your submission BEFORE the deadline. The CANVAS would continue accepting submissions after the due date. Late submissions would carry penalty per day with maximum of 5 days late submission allowed.

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.

1.6 Academic Honesty / Plagiarism  Routing Algorithm代写

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.

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.

 

更多代写:代写assignment  多邻国代考  economics代写  教育学论文代写  代写英文毕业论文   dissertation字数分配

合作平台:essay代写 论文代写 写手招聘 英国留学生代写 

Routing Algorithm代写
Routing Algorithm代写

发表回复