Professional Documents
Culture Documents
You need to show a demo at the last lab session, each student will be allowed at most 10 minutes. Make
sure you submit the following before your demo:
1) Electronic Submission
-
Place all the above files in a directory with the following naming convention: lastname_assign2
Submit a compressed archive with the same name of your directory files through Pilot by the due date
(will be provided on Pilot). Late submission will not be accepted.
Additional Instructions
-
In your code, write your name at the beginning of each source file.
/**
* Assignment 2
* Student Name
**/
Include comments in your code (points will be given for PROPER comments)
Please, make sure you follow the above instructions and test your code before submitting, you will risk
losing many points if your code does not compile/function correctly.
2) Hardcopy Submission
Hand in the following at the beginning of the last lab session.
prog2.c (70% of total points)
1) Please submit a sample annotated (using pens/pencils of your desirable colors) output for the
following input parameters:
o Loss probability: 0.1
o Corruption probability: 0.3
o Lambda = 1000
o Trace level: 2
Make sure you clearly show how your output is recovering from at least one lost packet and
one corrupt packet. Remember ACK packets can also be corrupt or lost. Choose Number of
messages to simulate (the first input parameter) to result in the latter cases. I will highly depend
on this annotated output to evaluate the correctness of your protocol. See below for additional
example debug messages.
2) Draw a flow graph of the annotated output showing the transmitted packets/ACKs/NACKs
between A and B. You have to show at least how you recovered from the first Corrupt packet
and the first lost packet.
3) Code listing of the following functions ONLY:
o A_output()
o A_input()
o A_timerinterrupt()
o B_input()
Remember to printout the data packet/ACK content (seq#/ack#, checksum, payload) everytime you
send/receive a packet/ACK. E.g.:
A B (Seq#: , chksum: ,Payload: )
B A (Seq#: , chksum: ,Payload: )
B A (Ack#: , chksum: ,Payload: )
A B (Ack#: , chksum: ,Payload: )
ACK#(0/1) Received !!!
prog2_gbn.c (30% of total points)
1) Please submit a sample annotated (using pens/pencils of your desirable colors) output for the
following input parameters:
o Loss probability: 0.2
o Corruption probability: 0.2
o Lambda = 10
Trace level: 2
Make sure you clearly show how your output is recovering from at least one lost packet and
one corrupt packet. Remember ACK packets can also be corrupt or lost. Choose Number of
messages to simulate (the first input parameter) to result in the latter cases. I will highly depend
on this annotated output to evaluate the correctness of your protocol. See below for additional
example debug messages.
2) Draw a flow graph of the annotated output showing the transmitted packets/ACKs/NACKs
between A and B. You have to show at least how you recovered from the first corrupt packet
and the first lost packet.
3) Code listing of the following functions ONLY:
a. A_output()
b. A_input()
c. A_timerinterrupt()
d. B_input()
Example debug messages (Alternating Bit - GBN):
A B (Seq#: , chksum: ,Payload: )
A B (Ack#: , chksum: ,Payload: )
Packet#... acknowledged correctly !!!