ScreenEthernetNode_CountMin_MsgMax_MsgFraction_Short_MsgsIntermessage_Time10025660726001.0300512242883000.5DoTheRunGlobal_Delays(QT$Global_Delays/1000)PROCEDURE DoTheRun(Run_Number) BEGIN DoCommand("CLEAR OFF"); /* Must use OFF to preserve results. */ /* EXPAND THIS RMULT IF YOU HAVE MORE RNGs. */ /* All Random Number Streams must have new seeds. */ TEMPORARY CommandString; /* Evaluate before passing to DoCommand. */ CommandString = Catenate("RMULT ",Run_Number#111); /* DoCommand compiles the string in Global Context. */ DoCommand(CommandString); /* SET UP YOUR OWN RUN CONDITIONS. */ DoCommand("START 10,NP"); /* Get past the Startup Period. */ DoCommand("RESET"); /* Begin the Measurement Period. */ DoCommand("START 60,NP"); /* Run the Simulation. */ END; >>'  2' '75ư> %,2HELPNA\NhNN:lT CONTINUE n((px EXIT&%p=lHALTމPlT  dSTEP 1 4߉lg STOP߉X^F%EFSTOP ,,OFFg^w@߉U T߉W OHAgp߉.OdHA@g|߉HA@|ŻOdgCONDUCT ScreenEthernet() LFeCFCONDUCT ScreenEthernet() GhE(((((((((({\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fmodern Courier New;}{\f3\fswiss\fprq2 System;}} {\colortbl\red0\green0\blue0;} \deflang1033\pard\tx1200\tx2400\tx4440\tx5280\tx6000\plain\f2\fs20 ; GPSS World Sample File - ETHERNET.GPS \par *********************************************************************** \par * \par * 10 Mbps Ethernet Model \par * \par * (c) Copyright 1993, Minuteman Software. \par * All Rights Reserved. \par * \par * \par * \par * Messages arrive exponentially, as one of two types: short \par * or long. A Node is selected and held for the duration of \par * message transmission and any collision backoffs. \par * \par * Each Node on the Ethernet is busy with a single message \par * until it is sent, or after some number of collisions (with \par * transmission attempts from other nodes) a permanent error \par * is declared and the node is released. \par * \par * Time is in units of milliseconds. Nodes are presumed \par * to be 2.5 m. apart. The node ID numbers are used to \par * determine the separation distance when calculating \par * the collision window. The propagation delay to an adjacent \par * node is 0.01 microsecond. Each bit is transmitted in 0.1 \par * microsecond. The interframe gap is modelled by having the \par * sender hold the Ethernet for an additional delay after it \par * has sent its message. \par * \par * Messages are represented by GPSS Transactions. Nodes \par * and the Ethernet are represented by GPSS Facilities. An \par * additional Facility is used during jamming to prevent the \par * startup of any new messages. \par * \par * A collision results from multiple transmission attempts \par * at two or more nodes. The signal propagation delay \par * prevents nodes from having simultaneous knowledge of \par * each other, thereby leading to this possibility. The time \par * interval until the signal from the other node can be \par * detected is called the node's "Collision Window". \par * \par * Collisions are represented by removing the transmitting \par * Transaction from ownership of the Ethernet and sending it \par * to a backoff routine. The new owner jams the Ethernet \par * briefly and then goes through the backoff, itself. When a \par * Transaction's message is being sent, the transaction has \par * ownership of the Ethernet Facility at priority 0, and can \par * be PREEMPTed by Transactions which are at priority 1. \par * When a Transaction is jamming, it has ownership of the \par * Ethernet Facility at priority 1, and is never itself \par * PREEMPTed. \par * \par * \par * Arguments: \par * 1. Node_Count Number of Nodes 2.5 m. apart \par * 2. Min_Msg Bits \par * 3. Max_Msg Bits \par * 4. Fraction_Short_Msgs Parts per thousand \par * 5. Intermessage_Time Global Interarrivals \par * \par * \par *********************************************************************** \par * Factors - Default Treatment Levels \par *********************************************************************** \par Node_Count EQU 100 ;Total Ethernet Nodes \par Intermessage_Time EQU 1.0 ;Avg. Global Arrival every msec. \par Min_Msg EQU 512 ;The Shortest Message in bits \par Max_Msg EQU 12144 ;The Longest Message in bits \par Fraction_Short_Msgs EQU 600 ;Short Msgs in parts per thousand \par *********************************************************************** \par \par Slot_Time EQU 0.0512 ;512 bit times \par Jam_Time EQU 0.0032 ;32 bit times \par Backoff_Limit EQU 10 ;No more than 10 backoffs \par Interframe_Time EQU 0.0096 ;96 bit times \par *********************************************************************** \par * \par * Definitions of GPSS Functions and Variables. \par * \par *********************************************************************** \par Backoff_Delay VARIABLE Slot_Time#V$Backrandom ;Calc the Backoff Delay \par Backrandom VARIABLE 1+(RN4@((2^V$Backmin)-1)) \par Backmin VARIABLE (10#(10'L'P$Retries))+(P$Retries#(10'GE'P$Retries)) \par Node_Select VARIABLE 1+(RN3@Node_Count) \par Collide VARIABLE ABS((X$Xmit_Node-P$Node_ID)/100000)'GE'(AC1-X$Xmit_Begin) \par Msgtime VARIABLE (0.0001)#V$Msgrand \par Msgrand VARIABLE Min_Msg+(RN1'G'Fraction_Short_Msgs)#(Max_Msg-Min_Msg) \par *********************************************************************** \par * \par * The Message Delay Histogram \par * \par *********************************************************************** \par Msg_Delays QTABLE Global_Delays,1,1,20 \par \par *********************************************************************** \par * \par * Main Body of Model \par * \par *********************************************************************** \par * \par *********************************************************************** \par * Message Generation \par *********************************************************************** \par GENERATE (Exponential(1,0,Intermessage_Time)) ;Single msg \par ; generator \par ASSIGN Node_ID,V$Node_Select ;Acquire a Node ID. \par ASSIGN Message_Time,V$Msgtime ;Calc and Save XMIT Time. \par ASSIGN Retries,0 ;No Collisions at start. \par *********************************************************************** \par * Wait for the Node to finish any previous work. \par *********************************************************************** \par QUEUE Global_Delays ;Start timing \par SEIZE P$Node_ID ;Wait for, occupy, the Node. \par Try_To_Send PRIORITY 1 ;Don't Lose Control \par SEIZE Jam ;Wait for any \par RELEASE Jam ;Jam to end. \par TEST E F$Ethernet,1,Start_Xmit ;If Ethernet Free, jump. \par *********************************************************************** \par * \par * The Ethernet is busy. We check to see if we are in the \par * Sender's "Collision Window". If so, this node would \par * start transmitting anyway, since the carrier would not \par * yet be sensed. In that case, we must initiate a Collision. \par * \par * If Prop Delay to Sender is >= Xmit Time up till now, \par * collide. \par * \par *********************************************************************** \par TEST E V$Collide,1,Start_Xmit ;No Collision. Go Wait for it. \par ************************** Collision ********************************** \par Collision PREEMPT Ethernet,PR,Backoff,,RE ;Remove the old owner. \par SEIZE Jam ;Jam the Ethernet. \par ADVANCE Jam_Time ;Wait the Jam Time. \par RELEASE Jam ;End the Jam. \par RELEASE Ethernet ;Give up the Ethernet. \par PRIORITY 0 ;Back to Normal priority. \par Backoff ASSIGN Retries+,1 ;Increment the Backoff Ct. \par TEST LE P$Retries,Backoff_Limit,Xmit_Error ;Limit retries. \par ADVANCE V$Backoff_Delay ;Wait to initiate retry. \par TRANSFER ,Try_To_Send ;Go try again. \par *********************************************************************** \par * Get the Ethernet, and start sending. \par *********************************************************************** \par Start_Xmit SEIZE Ethernet ;Get Ethernet, wait if nec. \par SAVEVALUE Xmit_Node,P$Node_ID ;Identify the sender. \par SAVEVALUE Xmit_Begin,AC1 ;Mark the start xmit time. \par PRIORITY 0 ;Ensure we can be PREEMPTed. \par ADVANCE P$Message_Time ;Wait until Msg. is sent. \par ADVANCE Interframe_Time ;Hold the Ethernet for gap. \par RELEASE Ethernet ;Give up the Ethernet. \par Free_Node RELEASE P$Node_ID ;Give up the node \par DEPART Global_Delays ; to the next msg. \par TERMINATE ;Destroy the Message. \par *********************************************************************** \par Xmit_Error SAVEVALUE Error_Count+,1 ;Count the Error. \par TRANSFER ,Free_Node ; and get out of the way. \par *********************************************************************** \par * \par * Timer Segment \par * \par *********************************************************************** \par GENERATE 1000 ;Each Start Unit is 1 Second. \par TERMINATE 1 \par * \par *********************************************************************** \par \par \par }