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:

Pseudo Code Marking Guide

1 of 768 articles shown, currently no other people reading this forum.
photo
From: ANONYMOUS
Date: Sun 7th Jun, 11:40pm
Actions: 
        Login-to-reply

 

Below is my answer for 2017 exam, question 1b) that I did under exam conditions

Class –Node
{
  SLOT_TIME = 52 // microseconds
  Messages_sent = 0
  Messages_received = 0

  Constructor - Node ()
  { 
    main_loop() 
  }
	
  Function - main_loop()
  {
    While (True)
      {
	// Ready to send returns a boolean
	If (Ready_To_Send())
	{
	  While (True)
            {
		Send_Message()
		Messages_sent++

		// Listen for a collision for 1 slot time
		// Returns true if collision, else false

		If (Listen_for_collision(SLOT_TIME))
		{
					
			// Determine random wait time
			Wait_time = random() * SLOT_TIME
			Sleep(wait_time)

                }
                Else 
                {
			Break
                }	
		
        }
        Else if (Messaged_Received())
        {
		Messages_received++
        }
      }
   }
}



To determine the maximum utilisation of the channel, the total number of messages 
received of all the nodes should be divided by the total number of sent messages of 
all the nodes

I was just wondering, what mark would an answer like this get and what improvements 
can be made?

Related articles

Pseudo Code Marking Guide (all 13) RSS
├─ THIS   Sun 7th Jun, 11:40pm, ANONYMOUS
├─ reply 1   Mon 8th Jun, 10:08am, ANONYMOUS
├─ reply 2   Mon 8th Jun, 10:39am, ANONYMOUS
├─ reply 3   Mon 8th Jun, 10:41am, ANONYMOUS
├─ reply 4   Mon 8th Jun, 10:46am, ANONYMOUS  O.P.
├─ reply 5   Mon 8th Jun, 10:49am, ANONYMOUS
├─ reply 6   Mon 8th Jun, 4:34pm, Christopher M.
├─ reply 7   Mon 8th Jun, 4:42pm, ANONYMOUS  O.P.
├─ reply 8   Mon 8th Jun, 5:25pm, ANONYMOUS
├─ reply 9   Mon 8th Jun, 6:16pm, Christopher M.
├─ reply 10   Mon 8th Jun, 6:32pm, ANONYMOUS
├─ reply 11   Mon 8th Jun, 6:36pm, Christopher M.
└─ reply 12   Mon 8th Jun, 6:39pm, ANONYMOUS
This Page


Program written by: [email protected]
Feedback welcome
Last modified:  5:31am Aug 04 2020