In this assignment, your program needs to: a) Retrieve the specific value of N and the stations that have a frame to send from the input file; display the value of N and the stations that have a frame to send on the screen. b) Use ATWP to determine what stations would send a frame during the upcoming timeslots; display the names of the stations that would send a frame during upcoming timeslots on the screen.
1
CSCI 3171 Network Computing
Assignment 3: Adaptive Tree Walk Protocol
Due: 23:55, March 19, 2021
– Teaching Assistants:
o Yang Di ([email protected])
o Raouf Rokhjavan ([email protected])
o Hui Huang ([email protected])
o David Dempsey ([email protected])
o Rao Huang ([email protected])
– TA Help Hours via the Channel “Office Hour – TAs” on MS Teams:
o Monday: 11:35am-12:55pm, Yang Di (Languages: Java, C, Python)
o Tuesday: 4pm-5pm, Raouf Rokhjavan (Languages: Java, C, Python)
o Wednesday: 9am-10am, Hui Huang (Languages: C, Python)
o Thursday: 3pm-4pm, David Dempsey (Languages: Java, C, Python)
o Friday: 10am-11am, Rao Huang (Languages: Java, C, Python)
1. Assignment Overview
Adaptive Tree Walk Protocol (ATWP) is a limited-contention protocol, which combines the
best properties of the contention and collision-free protocols. In this assignment, you need
to design and implement a program that uses ATWP to determine the order in which a
number of stations send their frames in a network. Your program will be tested on the
undergraduate server “timberlea.cs.dal.ca”, which is a Linux machine.
2. Important Information
There is a zero-tolerance policy on academic offenses such as plagiarism or inappropriate
collaboration. By submitting your solution for this assignment, you acknowledge that the
code submitted is your own work. You also agree that your code may be submitted to a
plagiarism detection software (such as MOSS) that may have servers located outside Canada
unless you have notified me otherwise, in writing, before the submission deadline. Any
suspected act of plagiarism will be reported to the Faculty’s Academic Integrity Officer in
accordance with Dalhousie University’s regulations regarding Academic Integrity. Please
note that:
1) The assignments are individual assignments. You can discuss the problems with your
friends/classmates, but you need to write your program by yourself. There should not be
much similarity in terms of coding.
2
2) When you refer to some online resources to complete your program, you need to
understand the mechanism, then write your own code. In addition, you should cite the
sources via comments in your program.
3. Detailed Requirements
1) Overview: Adaptive Tree Walk Protocol (ATWP) is a limited-contention protocol, which
can be used to determine the order in which a number of stations send their frames in a
network. In this assignment, you need to write a program that implements ATWP.
In this assignment, we have the following assumptions:
a) Slotted Time: Time is divided into a series of timeslots (i.e. Timeslot 0, Timeslot 1,
Timeslot 2, etc.).
b) Network Model: There are N stations in the network under investigation. Note that,
in this assignment, N could be 2, 4, 8, or 16. After the network is initialized, some of
the stations in the network have a frame to send (note that each of these stations has
only one frame to send).
c) Station Name: The name of a station is simply an uppercase character. When there are
N stations in the network, the first N uppercase characters (starting from “A”) are
used to name these stations. For example, when there are 2 stations in the network,
their names are A and B; when there are 4 stations in the network, their names are A,
B, C, and D.
d) Single Channel: There is only one transmission channel in the network under
investigation.
e) Collision: When two or more stations attempt to send their frames in the same
timeslot, there will be a collision because there is only one shared channel in the
network. In this scenario, the frames will be damaged; consequently, these frames
need to be retransmitted.
In this assignment, your program needs to:
a) Retrieve the specific value of N and the stations that have a frame to send from the
input file; display the value of N and the stations that have a frame to send on the
screen.
b) Use ATWP to determine what stations would send a frame during the upcoming
timeslots; display the names of the stations that would send a frame during upcoming
timeslots on the screen.
2) Input File: In this assignment, there is one input file: “Input.txt”. This file includes two lines.
The specific value of N is specified in the first line. The stations that have a frame to send are
listed in the second line. Note that the station names are separated by commas. An example
“Input.txt” is provided in this assignment. The content of the example “Input.txt” is:
8
C,E,F,H
For this example input file, the following sentences should be displayed on the screen:
3
The number of stations in the network under investigation is: 8
The stations that have a frame to send are: C,E,F,H
For this example network, ATWP would organize the stations using the following tree:
3) Output: Once the value of N and the stations that have a frame to send are available, ATWP
could be used to determine what stations would send a frame during the upcoming timeslots.
The information on what stations would send a frame in the upcoming timeslots should be
displayed on the screen.
Specifically, there should be one line for each timeslot. Each line includes three parts:
timeslot number, a list of stations that would send a frame in the timeslot, and the outcome
of the timeslot. If a frame is successfully transmitted during the timeslot, the outcome of the
timeslot is “Success”; otherwise, the outcome of the timeslot is “Conflict”. Once the line
corresponding to the timeslot that is used to successfully send the last frame is displayed,
your program will be terminated.
For the example input file mentioned previously, the following output lines should be
displayed on the screen:
Timeslot 0: C, E, F, H => Conflict
Timeslot 1: C => Success
Timeslot 2: E, F, H => Conflict
Timeslot 3: E, F => Conflict
Timeslot 4: E => Success
Timeslot 5: F => Success
Timeslot 6: H => Success
4) Additional Information:
a) The first timeslot is Timeslot 0 (instead of Timeslot 1).
4
b) In this course, both the original version and the improved version of ATWP are
discussed. You only need to implement the original version of ATWP in this
assignment.
c) You should assume that “Input.txt” is in the same directory as your program.
d) You can use the example input file to test your program. To help you thoroughly test
your program, two additional test cases are included in Appendix 3. Note that the
marker will use different test cases to evaluate your program.
e) “timberlea.cs.dal.ca” is the computer used by the TA to evaluate your program.
Therefore, you need to make sure that your program works on timberlea.
a. You can use your CS ID to log on to “timberlea.cs.dal.ca” in order to write your
program. Alternatively, you can write your program on other machines, then
transfer your program to timeberlea and thereafter test it on timberlea.
b. If you do not know your CS ID, you can visit the following webpage to get your
CS ID. If your CS ID does not work or you have a question about your CS ID,
please send an email to “[email protected]”.
https://csid.cs.dal.ca/
f) Programming Languages: You can use any of the following programming languages
to write your program: Java, C, and Python. However, you need to make sure your
program can be correctly compiled and executed on “timberlea.cs.dal.ca”.
g) To compile and run your program on timberlea, you have to use the command-linebased
user interface. Note that timberlea only provides a command-line-based user
interface. The marker CANNOT use an IDE (such as IntelliJ IDEA) to run your program
on timberlea. Instead, the marker needs to enter compiling/running commands to
compile and run your program.
a. Here is a tutorial on compiling and running a Java program via the the
command-line-based user interface on Linux (note that Step 1 in the tutorial
can be ignored because Java software development kit has been installed on
timberlea):
https://www.techinfected.net/2018/04/compile-and-run-java-program-inlinux-
ubuntu.html
b. Here is a tutorial on compile a Java program involving multiple Java source
files:
https://www.codejava.net/java-core/tools/using-javac-command
h) To compile and run your program on timberlea, you might need to be able to upload
a file to or download a file from timberlea (of course, if you write your program
directly on timberlea, you do not need to transfer files to timberlea). The following
webpage includes a tutorial on timberlea downloading/uploading. Note that the
example computer used in the tutorial is bluenose.cs.dal.ca (which is the old
undergraduate server). You should replace bluenose.cs.dal.ca with timberlea.cs.dal.ca
when you go through the webpage.
https://web.cs.dal.ca/~society/#/
i) Compiling and running your program on timberlea.cs.dal.ca should not lead to errors
or warnings.
5
5) Readme File: You need to complete a readme file named “Readme.txt”, which includes the
instructions that the TA could use to compile and execute your program on timberlea via the
command-line-based user interface.
6) Submission: Please pay attention to the following submission requirements:
a) You should place “Readme.txt” in the directory where your program files are located.
b) Your program source files and “Readme.txt” should be placed in a folder named
“YourFirstName-YourLastName-ASN3”. Thereafter, you need to convert the folder
into a zip file named “YourFirstName-YourLastName-ASN3.zip”. For example, my zip
file should be called “Qiang-Ye-ASN3.zip”.
c) Finally, you need to submit your zip file for this assignment via brightspace
(specifically, via Assignment 3: Submission Link).
Note that there is an appendix at the end of this document, which includes the commands
that you can use to generate zip files on timberlea. In addition, there is another appendix,
which illustrates how to view and kill your processes on timberlea.
4. Grading Criteria
The TA will use your submitted zip file to evaluate your assignment. The full grade is 12
points. The details of the grading criteria are presented as follows.
• “Readme.txt” with the correct command-based compilation/execution instructions is
provided. [1 Point]
• Retrieve the specific value of N and the stations that have a frame to send from the input
file; display the value of N and the stations that have a frame to send on the screen. [1
Point]
• Use ATWP to determine what stations would send a frame during the upcoming
timeslots; display the names of the stations that would send a frame during the
upcoming timeslots on the screen. [9 Points]
• Proper programming format/style (e.g. proper indentation, proper variable names,
proper comments, release the memory that is dynamically allocated when it is not
needed any more, etc.). [1 Point]
Please note that when “Readme.txt” is not provided or “Readme.txt” does not include the
compilation/execution instructions, you will receive a zero grade if your program cannot be
successfully compiled/executed by the marker.
5. Academic Integrity
At Dalhousie University, we respect the values of academic integrity: honesty, trust, fairness,
responsibility and respect. As a student, adherence to the values of academic integrity and
related policies is a requirement of being part of the academic community at Dalhousie
University.
6
1) What does academic integrity mean?
Academic integrity means being honest in the fulfillment of your academic responsibilities
thus establishing mutual trust. Fairness is essential to the interactions of the academic
community and is achieved through respect for the opinions and ideas of others. Violations
of intellectual honesty are offensive to the entire academic community, not just to the
individual faculty member and students in whose class an offence occur (See Intellectual
Honesty section of University Calendar).
2) How can you achieve academic integrity?
– Make sure you understand Dalhousie’s policies on academic integrity.
– Give appropriate credit to the sources used in your assignment such as written or oral work,
computer codes/programs, artistic or architectural works, scientific projects, performances,
web page designs, graphical representations, diagrams, videos, and images. Use RefWorks to
keep track of your research and edit and format bibliographies in the citation style required
by the instructor. (See http://www.library.dal.ca/How/RefWorks)
– Do not download the work of another from the Internet and submit it as your own.
– Do not submit work that has been completed through collaboration or previously submitted
for another assignment without permission from your instructor.
– Do not write an examination or test for someone else.
– Do not falsify data or lab results.
These examples should be considered only as a guide and not an exhaustive list.
3) What will happen if an allegation of an academic offence is made against you?
I am required to report a suspected offence. The full process is outlined in the Discipline flow
chart, which can be found at:
http://academicintegrity.dal.ca/Files/AcademicDisciplineProcess.pdf and includes the
following:
a. Each Faculty has an Academic Integrity Officer (AIO) who receives allegations from
instructors.
b. The AIO decides whether to proceed with the allegation and you will be notified of the
process.
c. If the case proceeds, you will receive an INC (incomplete) grade until the matter is resolved.
d. If you are found guilty of an academic offence, a penalty will be assigned ranging from a
warning to a suspension or expulsion from the University and can include a notation on your
transcript, failure of the assignment or failure of the course. All penalties are academic in
nature.
4) Where can you turn for help?
– If you are ever unsure about ANYTHING, contact myself.
– The Academic Integrity website (http://academicintegrity.dal.ca) has links to policies,
definitions, online tutorials, tips on citing and paraphrasing.
7
– The Writing Center provides assistance with proofreading, writing styles, citations.
– Dalhousie Libraries have workshops, online tutorials, citation guides, Assignment
Calculator, RefWorks, etc.
– The Dalhousie Student Advocacy Service assists students with academic appeals and
student discipline procedures.
– The Senate Office provides links to a list of Academic Integrity Officers, discipline flow chart,
and Senate Discipline Committee.
Appendix 1: How to Use Zip and Unzip on Timberlea
1) To convert a folder named “Assignment-Folder” into a zip file named “Assignment.zip”, use
the following command:
zip -r Assignment.zip Assignment-Folder
2) To unzip zipfile, use the following command:
unzip Assignment.zip
Appendix 2: How to View/Kill Your Processes on Timberlea
Due to programming mistakes, you might leave a number of running processes on timberlea.
When you leave too many running processes timberlea, your timberlea account could be locked
temporarily (then you need to talk to CS Help to unlock your account). To view/kill your
processes on timberlea, you can use the following commands. Please keep an eye on your
processes on timberlea.
1) Command to display the processes belonging to a specific ID (i.e. UID): ps -u UID
2) Command to kill a process using process ID (i.e. PID): kill -9 PID
3) Command to kill all processed belonging to a specific user ID (i.e. UID): pkill -u UID
Appendix 3: Additional Test Cases
1) Testing Case #1:
a) Input:
2
B
b) Output:
Timeslot 0: B => Success
8
2) Testing Case #2:
a) Input:
4
A,D
b) Output:
Timeslot 0: A, D => Conflict
Timeslot 1: A => Success
Timeslot 2: D => Success
Order any type of Service We Provide
We are the best assignment service that can satisfy student’s demands in different scientific fields. We perform tasks of any kind. Our specialists provide diverse custom assignment writing services to students from all over the world every day. You can contact us for assistance with:
The list is far from complete!
Representatives of our student assignment service are connoisseurs of the peculiarities of presentation in regards to academics. Your college assignment will never turn out an untoward surprise! Whether you need research for high school, an undergraduate program, or a Master’s or Doctoral degree, you will get exactly what you are looking for to sound smart and well-informed.
If you are pressed for time, request our experts!
We are your academic saver. It is a perfect solution for people who need academic help but has no professionals nearby to provide it. Just redirect your home tasks to us and forget about any educational issues. With us, you will get 100% plagiarism-free content delivered on time by an experienced specialist in a particular field.
When you order professional assignments here, you will get:
Original custom papers. We value your academic reputation. Just as well, we value the years of thorough work on our reputation for reliability and never compromise the originality of delivered papers. We will never endanger both. Every custom assignment is written from zero – the only possible first stage of work on the order is research. We apply the latest plagiary checking tools on the final stage, so plagiarism has no chance to emerge in your college assignment writing.
Control over the order completion. To make the process of collaboration comfortable and efficient, we offer our clients to choose the writer themselves taking into account all the requirements and the budget. For you to save nerves, having entrusted your fateful task to some qualified “stranger”, we enable communication with the assigned writer in the process of order completion.
Affordable assistance. We are eager to contribute to the academic achievements of students in need of help with college assignments. We are eager to help you start investing in your career growth today. That is why our service is so affordable. We don’t charge to pay for the latest marketing tricks or advertisements – we choose the best experts in the labor market who write great custom papers in any area, level of complexity, and time frame. Our client’s grateful feedback is a top advertising trick.
On-time delivery. The quality of a paper is only valued when it is delivered within the determined time frame – you will get your custom assignment writing service in time and have a couple of days to revise it and ask for changes in case they are needed. And you will still have time to learn the material.
Protection. We value your trust and take all measures needed to keep your private and banking details safe. We offer only well-tested payment methods. Due to the system of encryption and protected servers, no third party can have access to your data.
Custom support 24/7. We do our best to make the process of collaboration comfortable for the customer. Our “write my assignment” help is always here for you to provide a solution to your problems, give you a prompt answer to any question, and offer clarification as to any issue related to the services. Feel free to contact us anytime!
If you feel that your dissatisfaction with student life is growing every day and you just feel exhausted, don’t hesitate to change the situation for the better today. Order your first assignment from reliable custom assignment services today to evaluate the advantages.
Having seen the difference once, you won’t want to go back to your previous lifestyle. You deserve to find fulfilment in other spheres of your life, have hobbies, spend time with close people but continue making progress. It is possible when you have a professional helper. Don’t put off your life for someday after graduation!
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more