Faculty of Engineering and Mathematical Sciences 
Not logged in (login)

help3002


This forum is provided to promote discussion amongst students enrolled in Computer Networks (CITS3002).
 
Before posting a question here, you may like to read the article How To Ask Questions The Smart Way.
 
Options:
RSS cloud
Jump to:

Slotted Aloha Lab4 Q1

1 of 768 articles shown, currently no other people reading this forum.
photo
From: ANONYMOUS
Date: Mon 6th Apr, 1:43pm
Actions: 
  Login-to-reply

 

Hi Chris,

I was wondering if you could give me feedback on my attempt in writing pseudocode for 
this question. What i'm trying to say is that nodes are selected randomly to transmit, 
and for this to be successful, nodes must transmit at their called signal. If a packet 
is not transmitted successfully, the arrays aren't updates, and the entire cycle would 
repeat until all packets have been sent. Are we assuming that an entire packet must be 
resent, or part of a packet if some of it is successfully transmitted?

Pseudocode attempt:

number_of nodes = n
nodes_to_send = []
confirm_sent_nodes=[]

determine_packets_to_send():
 for each node:
   Ask for amount of packets queued to send
   Update nodes_to_send array which holds this information

determine_transmission():
 if every item in nodes_to_send == 0:
  return 
 transmit = false
 while transmit == false:
   a = generate random  number between 0 and n
   if nodes_to_send[a] == 0:
     continue
   else:
    transmit = true
 send_frame(a)
 
send_frame(packet):
 timer = allocated_time_to_send_packet
 while TIMER!=timer:
  if packet_sent:
    determine_packets_to_send()
    determine_transmission()
    confirm_sent_nodes[packet] += 1
 if TIMER == timer:
   collision()

collision():
   determine_packets_to_send()
   determine_transmission()

main():
  determine_packets_to_send()
  determine_transmission()
This Page


Program written by: [email protected]
Feedback welcome
Last modified:  3:57pm Aug 06 2020