SlideShare a Scribd company logo
1 of 2
Download to read offline
Please describe the following parts, out of an Python code for a Stop-and-Wait protocol with
retransmission, being used on a Jupyter Notebook and being aided by the ipywidgets libraries, in
here the code will be available:
https://colab.research.google.com/drive/1MXy8PXf3tN7Dgxebtjt8RCAkL9i0UvbR?usp=sharing
Describe:
a. The layer model (Use a figure to illustrate entities on all layers)
b. All states
c. All events
d. The state transition (Use a figure to illustrate the state transition diagram)
e. Design of the constructor (constructor:
import time
import ipywidgets as widgets
class MLE_TR:
def __init__(self, lower_layer):
self.lower_layer = lower_layer
self.button = widgets.Button(description='Send 100 messages')
self.button.on_click(self.callback)
def callback(self, button):
print('Sending 100 messages...')
for i in range(100):
message = f'Experiment ID: {random.randint(1, 10)}, Message ID: {i}, Current Time:
{time.time_ns()}'
self.lower_layer.send(message)
)
f. Design of the loop_Rx function (loop_Rx:
def loop_Rx(self):
num_messages = 0
total_delay = 0
num_loss = 0
num_duplication = 0
while True:
message = self.lower_layer.receive()
if message is None:
continue
num_messages += 1
experiment_id, message_id, timestamp = message.split(', ')
experiment_id = int(experiment_id.split(': ')[1])
message_id = int(message_id.split(': ')[1])
timestamp = float(timestamp.split(': ')[1])
delay = time.time() - timestamp
total_delay += delay
if random.random() < 0.1:
num_loss += 1
continue
if random.random() < 0.05:
num_duplication += 1
self.lower_layer.send(message)
print(f'Received message: {message}')
avg_delay = total_delay / num_messages
loss_rate = num_loss / num_messages
duplication_rate = num_duplication / num_messages
print(f'Average delay: {avg_delay}, Loss rate: {loss_rate}, Duplication rate:
{duplication_rate}')
)
g. Design a method to generate measurement output (The only part that is not a describe only,
need to implement as well, you will need to specify when the output shall be generated because
the lower layer can be unreliable)

More Related Content

Similar to Please describe the following parts, out of an Python code for a Sto.pdf

20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docxeugeniadean34240
 
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with XgxperfDeveloping and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with XgxperfPrabindh Sundareson
 
Virtual platform
Virtual platformVirtual platform
Virtual platformsean chen
 
21: Which method determines if a JRadioButton is selected?
21: Which method determines if a JRadioButton is selected?21: Which method determines if a JRadioButton is selected?
21: Which method determines if a JRadioButton is selected?sukeshsuresh189
 
Comp 328 final guide (devry)
Comp 328 final guide (devry)Comp 328 final guide (devry)
Comp 328 final guide (devry)sukeshsuresh189
 
6: Which of the following statements about creating arrays and initializing t...
6: Which of the following statements about creating arrays and initializing t...6: Which of the following statements about creating arrays and initializing t...
6: Which of the following statements about creating arrays and initializing t...sukeshsuresh189
 
202: When the user clicks a JCheckBox, a(n) occurs.
202: When the user clicks a JCheckBox, a(n) occurs.202: When the user clicks a JCheckBox, a(n) occurs.
202: When the user clicks a JCheckBox, a(n) occurs.sukeshsuresh189
 
3: A(n) ________ enables a program to read data from the user.
3: A(n) ________ enables a program to read data from the user.3: A(n) ________ enables a program to read data from the user.
3: A(n) ________ enables a program to read data from the user.sukeshsuresh189
 
22: The logical relationship between radio buttons is maintained by objects o...
22: The logical relationship between radio buttons is maintained by objects o...22: The logical relationship between radio buttons is maintained by objects o...
22: The logical relationship between radio buttons is maintained by objects o...sukeshsuresh189
 
19: When the user presses Enter in a JTextField, the GUI component generates ...
19: When the user presses Enter in a JTextField, the GUI component generates ...19: When the user presses Enter in a JTextField, the GUI component generates ...
19: When the user presses Enter in a JTextField, the GUI component generates ...sukeshsuresh189
 
5: Every Java application is required to have
5: Every Java application is required to have5: Every Java application is required to have
5: Every Java application is required to havesukeshsuresh189
 
15: Which method call converts the value in variable stringVariable to an int...
15: Which method call converts the value in variable stringVariable to an int...15: Which method call converts the value in variable stringVariable to an int...
15: Which method call converts the value in variable stringVariable to an int...sukeshsuresh189
 
16: Which of the following is the method used to display a dialog box to gath...
16: Which of the following is the method used to display a dialog box to gath...16: Which of the following is the method used to display a dialog box to gath...
16: Which of the following is the method used to display a dialog box to gath...sukeshsuresh189
 
13: What do the following statements do?
13: What do the following statements do?13: What do the following statements do?
13: What do the following statements do?sukeshsuresh189
 
Comp 328 final guide (devry)
Comp 328 final guide (devry)Comp 328 final guide (devry)
Comp 328 final guide (devry)sukeshsuresh189
 
7: Assume the following class declaration.
7: Assume the following class declaration.7: Assume the following class declaration.
7: Assume the following class declaration.sukeshsuresh189
 
8: Which statement below could be used to randomly select a state from an arr...
8: Which statement below could be used to randomly select a state from an arr...8: Which statement below could be used to randomly select a state from an arr...
8: Which statement below could be used to randomly select a state from an arr...sukeshsuresh189
 

Similar to Please describe the following parts, out of an Python code for a Sto.pdf (20)

Using matlab simulink
Using matlab simulinkUsing matlab simulink
Using matlab simulink
 
Using matlab simulink
Using matlab simulinkUsing matlab simulink
Using matlab simulink
 
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
20145-5SumII_CSC407_assign1.htmlCSC 407 Computer Systems II.docx
 
Csharp
CsharpCsharp
Csharp
 
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with XgxperfDeveloping and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
 
Virtual platform
Virtual platformVirtual platform
Virtual platform
 
21: Which method determines if a JRadioButton is selected?
21: Which method determines if a JRadioButton is selected?21: Which method determines if a JRadioButton is selected?
21: Which method determines if a JRadioButton is selected?
 
Comp 328 final guide (devry)
Comp 328 final guide (devry)Comp 328 final guide (devry)
Comp 328 final guide (devry)
 
6: Which of the following statements about creating arrays and initializing t...
6: Which of the following statements about creating arrays and initializing t...6: Which of the following statements about creating arrays and initializing t...
6: Which of the following statements about creating arrays and initializing t...
 
202: When the user clicks a JCheckBox, a(n) occurs.
202: When the user clicks a JCheckBox, a(n) occurs.202: When the user clicks a JCheckBox, a(n) occurs.
202: When the user clicks a JCheckBox, a(n) occurs.
 
3: A(n) ________ enables a program to read data from the user.
3: A(n) ________ enables a program to read data from the user.3: A(n) ________ enables a program to read data from the user.
3: A(n) ________ enables a program to read data from the user.
 
22: The logical relationship between radio buttons is maintained by objects o...
22: The logical relationship between radio buttons is maintained by objects o...22: The logical relationship between radio buttons is maintained by objects o...
22: The logical relationship between radio buttons is maintained by objects o...
 
19: When the user presses Enter in a JTextField, the GUI component generates ...
19: When the user presses Enter in a JTextField, the GUI component generates ...19: When the user presses Enter in a JTextField, the GUI component generates ...
19: When the user presses Enter in a JTextField, the GUI component generates ...
 
5: Every Java application is required to have
5: Every Java application is required to have5: Every Java application is required to have
5: Every Java application is required to have
 
15: Which method call converts the value in variable stringVariable to an int...
15: Which method call converts the value in variable stringVariable to an int...15: Which method call converts the value in variable stringVariable to an int...
15: Which method call converts the value in variable stringVariable to an int...
 
16: Which of the following is the method used to display a dialog box to gath...
16: Which of the following is the method used to display a dialog box to gath...16: Which of the following is the method used to display a dialog box to gath...
16: Which of the following is the method used to display a dialog box to gath...
 
13: What do the following statements do?
13: What do the following statements do?13: What do the following statements do?
13: What do the following statements do?
 
Comp 328 final guide (devry)
Comp 328 final guide (devry)Comp 328 final guide (devry)
Comp 328 final guide (devry)
 
7: Assume the following class declaration.
7: Assume the following class declaration.7: Assume the following class declaration.
7: Assume the following class declaration.
 
8: Which statement below could be used to randomly select a state from an arr...
8: Which statement below could be used to randomly select a state from an arr...8: Which statement below could be used to randomly select a state from an arr...
8: Which statement below could be used to randomly select a state from an arr...
 

More from amarnathmahajansport

Please ask experts to solve this in the correct way. 1. (20 point.pdf
Please ask experts to solve this in the correct way.  1. (20 point.pdfPlease ask experts to solve this in the correct way.  1. (20 point.pdf
Please ask experts to solve this in the correct way. 1. (20 point.pdfamarnathmahajansport
 
please answer this multiple choice question2.What major Department.pdf
please answer this multiple choice question2.What major Department.pdfplease answer this multiple choice question2.What major Department.pdf
please answer this multiple choice question2.What major Department.pdfamarnathmahajansport
 
please answer this multiple choice question4.This Technical Review.pdf
please answer this multiple choice question4.This Technical Review.pdfplease answer this multiple choice question4.This Technical Review.pdf
please answer this multiple choice question4.This Technical Review.pdfamarnathmahajansport
 
Please answer question in full 2.1 Security management function.pdf
Please answer question in full  2.1 Security management function.pdfPlease answer question in full  2.1 Security management function.pdf
Please answer question in full 2.1 Security management function.pdfamarnathmahajansport
 
Please answer these questions 150 words only 1) List four lines o.pdf
Please answer these questions 150 words only  1) List four lines o.pdfPlease answer these questions 150 words only  1) List four lines o.pdf
Please answer these questions 150 words only 1) List four lines o.pdfamarnathmahajansport
 
Please answer the 4 questions at the end please do all of them at th.pdf
Please answer the 4 questions at the end please do all of them at th.pdfPlease answer the 4 questions at the end please do all of them at th.pdf
Please answer the 4 questions at the end please do all of them at th.pdfamarnathmahajansport
 
Please answer the questions in orderExplain why a virus is co.pdf
Please answer the questions in orderExplain why a virus is co.pdfPlease answer the questions in orderExplain why a virus is co.pdf
Please answer the questions in orderExplain why a virus is co.pdfamarnathmahajansport
 
Please answer the questions in orderCompare and contrast Virus a.pdf
Please answer the questions in orderCompare and contrast Virus a.pdfPlease answer the questions in orderCompare and contrast Virus a.pdf
Please answer the questions in orderCompare and contrast Virus a.pdfamarnathmahajansport
 
Please answer the questions in ordarExplain the advantage for sur.pdf
Please answer the questions in ordarExplain the advantage for sur.pdfPlease answer the questions in ordarExplain the advantage for sur.pdf
Please answer the questions in ordarExplain the advantage for sur.pdfamarnathmahajansport
 
Please give a detailed summary of the article where I can write at l.pdf
Please give a detailed summary of the article where I can write at l.pdfPlease give a detailed summary of the article where I can write at l.pdf
Please give a detailed summary of the article where I can write at l.pdfamarnathmahajansport
 
Please answer the 4 questions at the end Causes and Outcomes of Co.pdf
Please answer the 4 questions at the end Causes and Outcomes of Co.pdfPlease answer the 4 questions at the end Causes and Outcomes of Co.pdf
Please answer the 4 questions at the end Causes and Outcomes of Co.pdfamarnathmahajansport
 
please help In multiple regression analysis, residuals (YY^) shou.pdf
please help  In multiple regression analysis, residuals (YY^) shou.pdfplease help  In multiple regression analysis, residuals (YY^) shou.pdf
please help In multiple regression analysis, residuals (YY^) shou.pdfamarnathmahajansport
 
please fill in the chart A company that uses job order c.pdf
please fill in the chart A company that uses job order c.pdfplease fill in the chart A company that uses job order c.pdf
please fill in the chart A company that uses job order c.pdfamarnathmahajansport
 
Please fill in the code to run the program based on the following in.pdf
Please fill in the code to run the program based on the following in.pdfPlease fill in the code to run the program based on the following in.pdf
Please fill in the code to run the program based on the following in.pdfamarnathmahajansport
 
Please explain fully each step and what inputs and the number of row.pdf
Please explain fully each step and what inputs and the number of row.pdfPlease explain fully each step and what inputs and the number of row.pdf
Please explain fully each step and what inputs and the number of row.pdfamarnathmahajansport
 
please explain how attaker crack 2DES and show your work. 3DES = Run.pdf
please explain how attaker crack 2DES and show your work. 3DES = Run.pdfplease explain how attaker crack 2DES and show your work. 3DES = Run.pdf
please explain how attaker crack 2DES and show your work. 3DES = Run.pdfamarnathmahajansport
 
Please explain answer choice 26. Small functionally disruptive hardw.pdf
Please explain answer choice 26. Small functionally disruptive hardw.pdfPlease explain answer choice 26. Small functionally disruptive hardw.pdf
Please explain answer choice 26. Small functionally disruptive hardw.pdfamarnathmahajansport
 
Please explain answer choice 15. Match each of the following counter.pdf
Please explain answer choice 15. Match each of the following counter.pdfPlease explain answer choice 15. Match each of the following counter.pdf
Please explain answer choice 15. Match each of the following counter.pdfamarnathmahajansport
 
Please draw an activity diagram using Enterprise. or draw using symb.pdf
Please draw an activity diagram using Enterprise. or draw using symb.pdfPlease draw an activity diagram using Enterprise. or draw using symb.pdf
Please draw an activity diagram using Enterprise. or draw using symb.pdfamarnathmahajansport
 

More from amarnathmahajansport (20)

Please ask experts to solve this in the correct way. 1. (20 point.pdf
Please ask experts to solve this in the correct way.  1. (20 point.pdfPlease ask experts to solve this in the correct way.  1. (20 point.pdf
Please ask experts to solve this in the correct way. 1. (20 point.pdf
 
please answer this multiple choice question2.What major Department.pdf
please answer this multiple choice question2.What major Department.pdfplease answer this multiple choice question2.What major Department.pdf
please answer this multiple choice question2.What major Department.pdf
 
please answer this multiple choice question4.This Technical Review.pdf
please answer this multiple choice question4.This Technical Review.pdfplease answer this multiple choice question4.This Technical Review.pdf
please answer this multiple choice question4.This Technical Review.pdf
 
Please answer question in full 2.1 Security management function.pdf
Please answer question in full  2.1 Security management function.pdfPlease answer question in full  2.1 Security management function.pdf
Please answer question in full 2.1 Security management function.pdf
 
Please answer these questions 150 words only 1) List four lines o.pdf
Please answer these questions 150 words only  1) List four lines o.pdfPlease answer these questions 150 words only  1) List four lines o.pdf
Please answer these questions 150 words only 1) List four lines o.pdf
 
Please answer the 4 questions at the end please do all of them at th.pdf
Please answer the 4 questions at the end please do all of them at th.pdfPlease answer the 4 questions at the end please do all of them at th.pdf
Please answer the 4 questions at the end please do all of them at th.pdf
 
Please answer the questions in orderExplain why a virus is co.pdf
Please answer the questions in orderExplain why a virus is co.pdfPlease answer the questions in orderExplain why a virus is co.pdf
Please answer the questions in orderExplain why a virus is co.pdf
 
Please answer the questions in orderCompare and contrast Virus a.pdf
Please answer the questions in orderCompare and contrast Virus a.pdfPlease answer the questions in orderCompare and contrast Virus a.pdf
Please answer the questions in orderCompare and contrast Virus a.pdf
 
Please answer the questions in ordarExplain the advantage for sur.pdf
Please answer the questions in ordarExplain the advantage for sur.pdfPlease answer the questions in ordarExplain the advantage for sur.pdf
Please answer the questions in ordarExplain the advantage for sur.pdf
 
Please give a detailed summary of the article where I can write at l.pdf
Please give a detailed summary of the article where I can write at l.pdfPlease give a detailed summary of the article where I can write at l.pdf
Please give a detailed summary of the article where I can write at l.pdf
 
Please answer the 4 questions at the end Causes and Outcomes of Co.pdf
Please answer the 4 questions at the end Causes and Outcomes of Co.pdfPlease answer the 4 questions at the end Causes and Outcomes of Co.pdf
Please answer the 4 questions at the end Causes and Outcomes of Co.pdf
 
please help In multiple regression analysis, residuals (YY^) shou.pdf
please help  In multiple regression analysis, residuals (YY^) shou.pdfplease help  In multiple regression analysis, residuals (YY^) shou.pdf
please help In multiple regression analysis, residuals (YY^) shou.pdf
 
please fill in the chart A company that uses job order c.pdf
please fill in the chart A company that uses job order c.pdfplease fill in the chart A company that uses job order c.pdf
please fill in the chart A company that uses job order c.pdf
 
Please fill in the code to run the program based on the following in.pdf
Please fill in the code to run the program based on the following in.pdfPlease fill in the code to run the program based on the following in.pdf
Please fill in the code to run the program based on the following in.pdf
 
Please explain fully each step and what inputs and the number of row.pdf
Please explain fully each step and what inputs and the number of row.pdfPlease explain fully each step and what inputs and the number of row.pdf
Please explain fully each step and what inputs and the number of row.pdf
 
please explain how attaker crack 2DES and show your work. 3DES = Run.pdf
please explain how attaker crack 2DES and show your work. 3DES = Run.pdfplease explain how attaker crack 2DES and show your work. 3DES = Run.pdf
please explain how attaker crack 2DES and show your work. 3DES = Run.pdf
 
Please explain answer choice 26. Small functionally disruptive hardw.pdf
Please explain answer choice 26. Small functionally disruptive hardw.pdfPlease explain answer choice 26. Small functionally disruptive hardw.pdf
Please explain answer choice 26. Small functionally disruptive hardw.pdf
 
Please explain answer choice 15. Match each of the following counter.pdf
Please explain answer choice 15. Match each of the following counter.pdfPlease explain answer choice 15. Match each of the following counter.pdf
Please explain answer choice 15. Match each of the following counter.pdf
 
Please draw an activity diagram using Enterprise. or draw using symb.pdf
Please draw an activity diagram using Enterprise. or draw using symb.pdfPlease draw an activity diagram using Enterprise. or draw using symb.pdf
Please draw an activity diagram using Enterprise. or draw using symb.pdf
 
please do the extr.pdf
please do the extr.pdfplease do the extr.pdf
please do the extr.pdf
 

Recently uploaded

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 

Recently uploaded (20)

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 

Please describe the following parts, out of an Python code for a Sto.pdf

  • 1. Please describe the following parts, out of an Python code for a Stop-and-Wait protocol with retransmission, being used on a Jupyter Notebook and being aided by the ipywidgets libraries, in here the code will be available: https://colab.research.google.com/drive/1MXy8PXf3tN7Dgxebtjt8RCAkL9i0UvbR?usp=sharing Describe: a. The layer model (Use a figure to illustrate entities on all layers) b. All states c. All events d. The state transition (Use a figure to illustrate the state transition diagram) e. Design of the constructor (constructor: import time import ipywidgets as widgets class MLE_TR: def __init__(self, lower_layer): self.lower_layer = lower_layer self.button = widgets.Button(description='Send 100 messages') self.button.on_click(self.callback) def callback(self, button): print('Sending 100 messages...') for i in range(100): message = f'Experiment ID: {random.randint(1, 10)}, Message ID: {i}, Current Time: {time.time_ns()}' self.lower_layer.send(message) ) f. Design of the loop_Rx function (loop_Rx: def loop_Rx(self): num_messages = 0 total_delay = 0 num_loss = 0 num_duplication = 0 while True: message = self.lower_layer.receive() if message is None:
  • 2. continue num_messages += 1 experiment_id, message_id, timestamp = message.split(', ') experiment_id = int(experiment_id.split(': ')[1]) message_id = int(message_id.split(': ')[1]) timestamp = float(timestamp.split(': ')[1]) delay = time.time() - timestamp total_delay += delay if random.random() < 0.1: num_loss += 1 continue if random.random() < 0.05: num_duplication += 1 self.lower_layer.send(message) print(f'Received message: {message}') avg_delay = total_delay / num_messages loss_rate = num_loss / num_messages duplication_rate = num_duplication / num_messages print(f'Average delay: {avg_delay}, Loss rate: {loss_rate}, Duplication rate: {duplication_rate}') ) g. Design a method to generate measurement output (The only part that is not a describe only, need to implement as well, you will need to specify when the output shall be generated because the lower layer can be unreliable)