(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 80516, 1969]*) (*NotebookOutlinePosition[ 82356, 2032]*) (* CellTagsIndexPosition[ 82157, 2022]*) (*WindowFrame->Normal*) Notebook[{ Cell[TextData[{ StyleBox["\n", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox["Application of", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic, AspectRatioFixed->True], StyleBox["\nMathematica", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[ " Based Simulation Template to \nDemand Assigned MAC Described in IEEE \ P802.11-92/39\n(\"The IBM MAC Proposal\")", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic, AspectRatioFixed->True] }], "Title", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic, AspectRatioFixed->True], Cell[TextData[ "Submitted By:\n Larry Van Der Jagt\nKnowledge Implementations, Inc.\n32 \ Conklin Road\nWarwick, NY 10990\nVoice: 914-986-3492 FAX: 914-986-6441 \ EMail: KIILVDJ@attmail.com\n\nMain Issues Addressed: \n29.1 How Does IEEE \ 802.11 Do Simulation\n9.1 MAC throughput & throughput probability"], "Subtitle", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic, AspectRatioFixed->True], Cell[CellGroupData[{Cell[TextData["Commercial Introduction"], "Section", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic, AspectRatioFixed->True], Cell[TextData[ "This notebook contains code that has been developed by Knowledge \ Implementations, Inc.(KII) to support the IEEE 802.11 effort. The primary \ business of KII is providing contract engineering services. We have \ experience in many aspects of networking as well as significant experience in \ the area of process control. We have been involved with engineering work in \ the wireless networking field since 1987.\n\nIn order to help defer the cost \ of our involvement in generating this code we are requesting that individuals \ and organizations that obtain this code and use it pay a shareware fee of \ $200.00 to KII. As an incentive to do this we have encoded the source for \ the package Radio1.m that contains the main analysis routines that this \ notebook requires to execute. KII will provide unencoded source for this \ package to anyone that pays the shareware fee.\n\nCopyright \[Copyright] 1992 \ Knowledge Implementations, Inc. (KII)\n\nKII MAKES NO REPRESENTATIONS, \ EXPRESSED OR IMPLIED, WITH RESPECT TO ELECTRONIC MATERIALS, INCLUDING WITHOUT \ LIMITATIONS ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A \ PARTICULAR PURPOSE, ALL OF WHICH IS EXPRESSLY DISCLAIMED. KII DOES NOT \ WARRANT THAT THE FUNCTIONS CONTAINED IN THIS ELECTRONIC MATERIAL WILL MEET \ YOUR REQUIREMENTS OR THAT THE OPERATION OF THE PROGRAM WILL BE UNINTERRUPTED \ OR ERROR FREE.\n\nIn addition to the foregoing, you should recognize that all \ software systems and their documentation contain errors and omissions. KII \ shall not be responsible under any circumstances for providing information on \ or corrections to errors and omissions discovered at any time in this \ Electronic Material, whether or not it is aware of the errors or omissions. \ KII does not recommend the use of this Electronic Material for applications \ in which errors or omissions could threaten life, injury or significant loss.\ \n\nIN NO EVENT SHALL KII BE LIABLE FOR ANY LOST PROFITS, LOST BENEFITS, OR \ ANY CONSEQUENTIAL, INDIRECT, INCIDENTAL, SPECIAL OR PUNITIVE DAMAGES, WHETHER \ IN CONTRACT OR IN TORT, EVEN IF KII HAS BEEN ADVISED OF THE POSSIBILITY OF \ SUCH DAMAGES.\n\nThis Electronic Material is copyrighted by KII.\n\nIn return \ for payment of the shareware fee KII agrees to grant the user a non-exclusive \ license to use this Electronic Material for personal use only. The user may \ not use this Electronic Material, directly or indirectly, alone or as part of \ a larger system, in whole or in part, by transferring it, reselling it or \ licensing it to others for compensation except for the actual cost of making \ the physical copy and/or transfer. Any copy transferred by the user to \ others must be complete and unaltered."], "Text", Evaluatable->False, AspectRatioFixed->True]}, Open]], Cell[CellGroupData[{Cell[TextData[" Overview"], "Section", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "In IEEE P802.11-92/123 a detailed computational framework was established \ for the execution of performance simulations of Media Access Control State \ machines operated over Physical Layer Entities. This framework allowed the \ experimenter to locate stations geographically and to assign attributes to \ those stations. Some of the attributes that were defined were the station ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Location", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[", ", Evaluatable->False, AspectRatioFixed->True], StyleBox["TxPower", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[", ", Evaluatable->False, AspectRatioFixed->True], StyleBox["State", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" and ", Evaluatable->False, AspectRatioFixed->True], StyleBox["MessageProbability", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ ". A random sample from a statistical model was used to simulate the path \ loss between stations. The path loss matrix that results from this sampling \ was used to determine the signal level at each station resulting from \ transmissions from other stations. Each station maintained a ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationTxQueue", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" and a ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationRxQueue", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " that tracked messages that it desired to send and that it received. The \ filling and emptying of these queues was performed by traffic generating \ functions and by a state machine model of MAC operation. In document 92/123 \ the state machine model used was a very simple ALOHA type model. This \ document extends the work of 92/123 by implementing state machines for a \ demand assigned MAC similar to that described in Documents IEEE P802.11/92-39 \ and IEEE P802.11/91-74 submitted by K.S. Natarajan et al.. At this time the \ feature described in 92/39 that allows for direct communication between \ mobiles during the C period has not been implemented. Also, at this time the \ assumption is made that the station is registered with an access point at all \ times. The addition of registration and direct C period communications would \ be possible in future work. This document also makes some improvements to \ the basic framework of document 92/123 that make it easier to use for a wide \ variety of situations and state machines.\n\nThe state machines illustrated \ in this document continue the process of demonstrating the usefulness of this \ framework in testing MAC/PHY choices and evaluating performance. In their \ current state they implement many of the functions described in the previous \ submittal, they do not implement many of the functions, such as \ sychronization that will be necessary for the final MAC/PHY design. It \ should be clear, however, from the functions that are performed that further \ enhancements would allow these other functions to be implemented and tested. \ As is the case of any set of state machines that are in the process of being \ designed, we fully expect that these machines are not perfect and that \ testing and optimization will reveal bugs both structural and accidental. \ One area in which some detail not included in the original submittals that \ has been added is in the area of the scheduling algorithm and in the choice \ of when within the C period a station will elect to attempt to gain a \ bandwidth reservation. Also, as it stands the amount of overhead associated \ with the various headers is probably larger than it needs to be and some \ modifications might be done in this area. As was the case with 92/123 we \ have not made any attempts at improving the code for speed. Our opinion here \ is that once the scheme that needs to be thoroughly evaluated is implemented \ that optimization for speed will be in order. In other words, this represents \ a snapshot of work in progress rather than completed analysis. ", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True]}, Open]], Cell[CellGroupData[{Cell[TextData["Initialization"], "Section", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "The process of executing a simulation begins with the loading of the \ support functions that are contained in the package ", Evaluatable->False, AspectRatioFixed->True], StyleBox["RadioLAN`Radio1.", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " Each of these functions will be described in the sections of the notebook \ that follow. The next cell loads the support packages. This package also \ uses the standard ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Mathematica", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[ " packages Statistics`ContinuousDistributions and \ Statistics`DiscreteDistributions. These standard packages also need the \ standard packages \"Statistics`NormalDistribution`\", \ \"Statistics`DescriptiveStatistics`\", \ \"Statistics`Common`DistributionsCommon`\", and \ \"Statistics`InverseStatisticalFunctions`\". The loading of all of these \ packages is handled automaticaly by the package RadioSupport1. The next cell \ loads the support packages. ", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData["<Automatic, GroupPageBreakWithin->Automatic, InitializationCell->True, AspectRatioFixed->True], Cell[TextData["\nOff[General::spell1];\nOff[General::spell];"], "Input", InitializationCell->True, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "In order to utilize this notebook it is necessary to initialize the fading \ statistics. This is accomplished using the function ", Evaluatable->False, AspectRatioFixed->True], StyleBox["SetFadingParameters", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ ". This function takes three parameters that are used in calculating the \ path loss as a function of distance. The large scale fading is determined by \ using the first parameter and the second parameter as the mean and standard \ deviation of a normal distribution function and taking a random sample of \ this distribution to be the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["n", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" used to calculate the large scale attenuation 1/d^", Evaluatable->False, AspectRatioFixed->True], StyleBox["n ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ "where d is the distance at which the attenuation is desired. The value of \ 1/d^", Evaluatable->False, AspectRatioFixed->True], StyleBox["n", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " (expressed in dB) found as the large scale fading value is used as the \ mean of a second normal distribution with a standard deviation equal to the \ third parameter. This second distribution models the local fading \ characteristics. A random sample from this distribution is the value \ returned for the attenuation at a specific distance.\n\nThe cell that follows \ sets the fading parameters for this specific instance of the simulation. \ This cell must be executed prior to the start of the simulation. An example \ of the output of the fading model is provided in the following few cells. \ The function ", Evaluatable->False, AspectRatioFixed->True], StyleBox["GetAttenuation[d]", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " is the actual function that is used when a sample of the statistical \ model established with ", Evaluatable->False, AspectRatioFixed->True], StyleBox["SetFadingParameters ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox["is required for a given distance.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData["SetFadingParameters[3,.1,5];"], "Input", PageBreakWithin->Automatic, GroupPageBreakWithin->Automatic, InitializationCell->True, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "This simulation allows the experimenter the flexibility of setting up the \ station population that will be involved in the simulation. Each station \ must have ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Location ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox["(in a three dimensional space), ", Evaluatable->False, AspectRatioFixed->True], StyleBox["TxPower ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox["(in dBmw), ", Evaluatable->False, AspectRatioFixed->True], StyleBox["MessageProbability ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox["(the mean of a Poission Process) and ", Evaluatable->False, AspectRatioFixed->True], StyleBox["State ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ "(initial state of the station of the MAC state machine) specified. The \ cell that follows defines an initialization procedure that can be used to set \ initial attributes for a list of station or access point names. The names \ used are arbitrary, however, a list of those must be placed in a list \ assigned to the symbol ", Evaluatable->False, AspectRatioFixed->True], StyleBox["AccessPoints", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" and", Evaluatable->False, AspectRatioFixed->True], StyleBox[" Mobiles ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ "in order for the simulation to operate. Also, a station should not be \ named ", Evaluatable->False, AspectRatioFixed->True], StyleBox["empty ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ "since this is the indicator of an empty transmit or receive queue. The \ initial location of the station is selected from a uniform distribution. The \ range of this distribution is set by the parameters xmin,xmax,ymin,ymax and \ zmin,zmax.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "InitializeAPs[stations_]:=Map[(State[#]^=Hopping;\n\ SynthTimer[#]^=InitSynthTimer;\nTATimer[#]^=0;\nTAHTimer[#]^=0;\n\ TBTimer[#]^=0;\nTBHTimer[#]^=0;\nTCTimer[#]^=0;\nTCHTimer[#]^=0;\n\ InitBTimer[#]^=0;\nInitCTimer[#]^=0;\nNetworkID[#]^=InitNetworkID;\n\ BroadcastFlag[#]^=False;\nTxPower[#]^=InitTxPower;\n\ MessageProbability[#]^=InitMessageProb;\nStationTxQueue[#]^={empty};(*In this \ simulation the AP never originates so this is always empty*)\n\ StationRxQueue[#]^={empty};(*This is the list of stations received from \ during B period*)\nRegisteredMobiles[#]^={{empty}};\n\ ReservationQueue[#]^={{empty}};(*All mobile TXQueues that were successful in \ Cperiod*)\n\ Location[#]^={Random[Statistics`ContinuousDistributions`UniformDistribution[\ xmin,xmax]],\n\t\t\t \ Random[Statistics`ContinuousDistributions`UniformDistribution[ymin,ymax]],\n\t\ \t\t Random[Statistics`ContinuousDistributions`UniformDistribution[zmin,zmax]]\ }\n\t\t\t\t\t\t\t\t)&,stations];\n\n\ InitializeMobiles[stations_]:=Map[(State[#]^=WaitingForAH;\n\ SynthTimer[#]^=InitSynthTimer;\nTBTimer[#]^=0;\nTCTimer[#]^=0;\n\ TxPower[#]^=InitTxPower;\nRegisteredAP[#]^=Access1;\n\ MessageProbability[#]^=InitMessageProb;\nStationTxQueue[#]^={empty};\n\ StationRxQueue[#]^={empty};\nBHHeader[#]^={disable,none};\n\ IncomingFailure[#]^=0;\nIncomingSuccess[#]^=0;\nIncomingFlag[#]^=0;\n\ LostAP[#]^=0;\nImproperHop[#]^=0;\nFailure[#]^=0;\nSuccess[#]^=0;\n\ Location[#]^={Random[Statistics`ContinuousDistributions`UniformDistribution[\ xmin,xmax]],\n\t\t\t \ Random[Statistics`ContinuousDistributions`UniformDistribution[ymin,ymax]],\n\t\ \t\t Random[Statistics`ContinuousDistributions`UniformDistribution[zmin,zmax]]\ }\n\t\t\t\t\t\t\t\t)&,stations];"], "Input", PageBreakWithin->Automatic, GroupPageBreakWithin->Automatic, InitializationCell->True, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "The following cells initialize a number of parameters and executes the \ initialization function defined above and also builds the list of stations \ that is required by other processing steps. The list ", Evaluatable->False, AspectRatioFixed->True], StyleBox["TransmitOnStates", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " is a list of the states in which a device has its transmitter turned on \ and is used by the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["CheckForReceive ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ "routine in order to determine signal to interference ratio. Note, that \ the basic unit of time for the simulation is the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Octettime", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " that is taken to be eight bit times. The hop time in octets is calculated \ from the number of hops per second and the Octettime parameter. Messages \ within this simulation are considered to be of fixed length (in octets) with \ this length set by the symbol ", Evaluatable->False, AspectRatioFixed->True], StyleBox["messagelength. ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox["The parameter ", Evaluatable->False, AspectRatioFixed->True], StyleBox["MinimumCPeriod", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " is used to assure that some bandwidth is set aside for reservation \ requests. The parameter ", Evaluatable->False, AspectRatioFixed->True], StyleBox["reservationlength", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " is used to determine the number of octets needed to be transmitted \ successfully to obtain a reservation for bandwidth (during the C period). \ The Header overhead parameters are the fixed number of octets of overhead \ that are assumed to be in each header. Headers that contain station lists (A \ Header and B Header) grow in size based on the number of stations that are \ currently being serviced.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{Cell[TextData[ "Hopspersecond=500;\nOctettime=8 10^-6;\nHopTime=Floor[1/(Octettime \ Hopspersecond)]\nMinimumCPeriod=Floor[.20 HopTime]\nmessagelength=5;\n\ AHeaderOverhead=2;\nBHeaderOverhead=2;\nCHeaderOverhead=2;\nInitSynthTimer=2;\ \nreservationlength=2;"], "Input", InitializationCell->True, AspectRatioFixed->True, CellTags->"Initialization"], Cell[OutputFormData["\<\ 250\ \>", "\<\ 250\ \>"], "Output", Evaluatable->False, AspectRatioFixed->True], Cell[OutputFormData["\<\ 50\ \>", "\<\ 50\ \>"], "Output", Evaluatable->False, AspectRatioFixed->True]}, Open]], Cell[TextData[ "xmin=0;ymin=0;zmin=0;xmax=20;ymax=20;zmax=20;\nInitTxPower=10;\n\ InitNetworkID=0;\nInitMessageProb=2;\n\ SetAttributes[{SynthTimer,HTimer,TATimer,TAHTimer,TBTimer,TBHTimer,\n\t\t\t\t\ \t\t\t\t\t\t\t\t\t\tTCTimer,TCHTimer},Listable];\n\ SetAttributes[{State,TxPower,MessageProbability,StationTxQueue,\n\t\t\t\t\t\t\ \t\t\t\t\t\t\t\t\tStationRxQueue,Location},Listable];\n\ SetAttributes[{BHHeader,NetworkID,BroadcastFlag,ReservationQueue,\n\t\t\t\t\t\ \t\t\t\t\t\t\t\t\t\tRegisteredAP},Listable];\n\ SetAttributes[{Failure,IncomingSuccess,IncomingFailure,IncomingFlag,\n\t\t\t\t\ \t\t\t\t\t\t\t\t\t\t\tLostAP},Listable];\n\ SetAttributes[{ImproperHop,Success,InitBTimer,InitCTimer},Listable];\n\ AccessPoints={Access1,Access2,Access3};\n\ Mobiles={Station1,Station2,Station3,Station4,Station5};\n\ TransmitOnStates={TransmittingAH,TransmitAPeriod,TransmittingBH,\n\t\t\t\t\t\t\ \t\t\t\t\t\t\t\t\t\t\t\tTransmitBPeriod,TransmitCPeriod,TransmittingCH};\n\ Stations=Join[AccessPoints,Mobiles];\nInitializeAPs[AccessPoints];\n\ InitializeMobiles[Mobiles];"], "Input", PageWidth->PaperWidth, PageBreakWithin->Automatic, GroupPageBreakWithin->Automatic, InitializationCell->True, AspectRatioFixed->True], Cell[CellGroupData[{Cell[TextData["??Access1"], "Input", AspectRatioFixed->True], Cell[TextData[ "Global`Access1\n\nBroadcastFlag[Access1] ^= False\n \nInitBTimer[Access1] ^= \ 0\n \nInitCTimer[Access1] ^= 0\n \nLocation[Access1] ^= \ {13.71997976100826557, 10.87329007531652585, 9.842681340014111611}\n \n\ MessageProbability[Access1] ^= 2\n \nNetworkID[Access1] ^= 0\n \n\ RegisteredMobiles[Access1] ^= {{empty}}\n \nReservationQueue[Access1] ^= \ {{empty}}\n \nState[Access1] ^= Hopping\n \nStationRxQueue[Access1] ^= \ {empty}\n \nStationTxQueue[Access1] ^= {empty}\n \nSynthTimer[Access1] ^= 2\n \ \nTAHTimer[Access1] ^= 0\n \nTATimer[Access1] ^= 0\n \nTBHTimer[Access1] ^= 0\ \n \nTBTimer[Access1] ^= 0\n \nTCHTimer[Access1] ^= 0\n \nTCTimer[Access1] ^= \ 0\n \nTxPower[Access1] ^= 10"], "Info", Evaluatable->False, AspectRatioFixed->True]}, Open]], Cell[TextData[{ StyleBox[ "Once the station parameters and the fading parameters are set the function \ ", Evaluatable->False, AspectRatioFixed->True], StyleBox["BuildAttenuationTable ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ "can be called with a concatenated list of stations and access points as a \ parameter and a table of attenuations between entities will be calculated. \ In this calculation, an assumption is made that reciprocity applies with \ respect to attenuation of the channel. That is, the path loss between two \ entities is the same regardless of which station is transmitting and which is \ receiving. This assumption leads to a symmetric matrix representation for \ the attenuation between stations. The row and column numbers represent which \ stations the attenuation value applies to. For instance, the attenuation \ between the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Access1 ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox["and ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Access2", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " in this example appears in both (row one,column two) and (row two, column \ one). The cell that follows illustrates the process of generating an \ attenuation matrix. It should also be pointed out that the attenuation \ numbers that are generated do not take into account the reduction in antennae \ aperture as a function of wavelength and hence, tend to understate the \ probable attenuation at distance in real applications. The impact of this \ effect, however, will not be important until specific PHY implementations are \ added to this framework. The symbol ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Attenuation", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " is assigned to the calculated Attenuation Table for use by other \ routines, specifically, by ", Evaluatable->False, AspectRatioFixed->True], StyleBox["GenerateReceiveLevels", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ ", the routine that calculates the receive level at each station for \ transmissions originating at each other station and the overall level of \ receive power at a given station.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{Cell[TextData["BuildAttenuationTable[Stations]"], "Input", PageBreakWithin->Automatic, GroupPageBreakWithin->Automatic, InitializationCell->True, AspectRatioFixed->True], Cell[OutputFormData[ "\<\ {{0, -30.98515559222472689, -45.73940724533646093, -16.3717283527543742, \ -31.68674500367442889, -39.9275798229722734, -40.68496523350009889, \ -29.35152649730955623}\\ , {-30.98515559222472689, 0, -27.34616572313331928, -29.14855487072223413, \ -25.89937273716170652, -33.82682661183261199, -34.27904797652031386, -21.12724053593208441}, {-45.73940724533646093, -27.34616572313331928, 0, -30.24652061059053624, -16.03343039621046093, -13.697823010324115, \ -34.29073729607240614, -35.72784528655225783}, {-16.3717283527543742, -29.14855487072223413, -30.24652061059053624, 0, -35.2908136335229272, -35.98341125732683768, -27.59070873361476105, -38.14660298412045345}, {-31.68674500367442889, -25.89937273716170652, -16.03343039621046093, -35.2908136335229272, 0, -4.543507332601280347, -35.78924985816398466, -35.57509753431745977}, {-39.9275798229722734, -33.82682661183261199, -13.697823010324115, -35.98341125732683768, -4.543507332601280347, 0, -28.15311480734664096, -46.65624041580479595}, {-40.68496523350009889, -34.27904797652031386, -34.29073729607240614, -27.59070873361476105, -35.78924985816398466, -28.15311480734664096, 0, -37.82203110907632851}, {-29.35152649730955623, -21.12724053593208441, -35.72784528655225783, -38.14660298412045345, -35.57509753431745977, -46.65624041580479595, -37.82203110907632851, 0}}\ \>", "\<\ {{0, -30.9852, -45.7394, -16.3717, -31.6867, -39.9276, -40.685, \ -29.3515}, {-30.9852, 0, -27.3462, -29.1486, -25.8994, -33.8268, -34.279, -21.1272}, {-45.7394, -27.3462, 0, -30.2465, -16.0334, -13.6978, -34.2907, -35.7278}, {-16.3717, -29.1486, -30.2465, 0, -35.2908, -35.9834, -27.5907, -38.1466}, {-31.6867, -25.8994, -16.0334, -35.2908, 0, -4.54351, -35.7892, -35.5751}, {-39.9276, -33.8268, -13.6978, -35.9834, -4.54351, 0, -28.1531, -46.6562}, {-40.685, -34.279, -34.2907, -27.5907, -35.7892, -28.1531, 0, -37.822}, {-29.3515, -21.1272, -35.7278, -38.1466, -35.5751, -46.6562, -37.822, 0}}\ \ \>"], "Output", Evaluatable->False, PageBreakWithin->Automatic, GroupPageBreakWithin->Automatic, AspectRatioFixed->True]}, Open]], Cell[TextData[{ StyleBox[ "Having established the parameters associated with the station \ configuration the next task undertaken is to begin the process of simulating \ a transmission environment using these stations. The function ", Evaluatable->False, AspectRatioFixed->True], StyleBox["GenerateTraffic", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" uses the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["MessageProbability ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ "associated with each station list in the first parameter to determine how \ many messages a particular station will generate during this time interval. \ A station name is selected using a uniform discrete distribution from the \ possible destinations stations (the second parameter list) that a particular \ station has available to it (Note: all stations other than itself in this \ model) for each message that is generated. These stations' names are placed \ in a list and are appended to the end of the list currently in existance as \ the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationTxQueue", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " attribute of each station. This queue consists of a list of destination \ stations for which these messages are intended. The cells that follow \ illustrate the generation of the initial set of traffic. Each successive \ call will append traffic to the end of the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationTxQueue ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ "for each station. When operating in conjunction with state machines that \ take messages from the beginning of ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationTxQueue", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[", the function ", Evaluatable->False, AspectRatioFixed->True], StyleBox["GenerateTraffic ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox["implements a FIFO style queue for the desired transmissions.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{Cell[TextData[ "GenerateTraffic[Mobiles,Mobiles];\nStationTxQueue[Mobiles]"], "Input", PageBreakWithin->Automatic, GroupPageBreakWithin->Automatic, AspectRatioFixed->True], Cell[OutputFormData[ "\<\ {{Station3, empty}, {empty}, {empty}, {empty}, {Station2, empty}}\ \>", "\<\ {{Station3, empty}, {empty}, {empty}, {empty}, {Station2, empty}}\ \>"], "Output", Evaluatable->False, PageBreakWithin->Automatic, GroupPageBreakWithin->Automatic, AspectRatioFixed->True]}, Open]], Cell[TextData[{ StyleBox[ "The function that evaluates the instantaneous receive level at a given \ station is ", Evaluatable->False, AspectRatioFixed->True], StyleBox["GenerateReceiveLevels.", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " This function monitors the state of all stations each time it is \ executed and calculates the receive power of all stations that are in any \ state listed in the global list ", Evaluatable->False, AspectRatioFixed->True], StyleBox["TransmitOnStates", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " state at all other stations. The level of receive power at a particular \ station resulting from the transmission of another station is stored in the \ matrix ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ArrivingTxPowerTable ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox["by ", Evaluatable->False, AspectRatioFixed->True], StyleBox["GenerateReceiveLevels", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ ". In order to avoid negative infinity problems a minimum receive power \ level is established for all stations. This level is set by setting the \ symbol ", Evaluatable->False, AspectRatioFixed->True], StyleBox["MinPower", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ ". Also, in order to facilitate evaluation of how this set of stations \ will operate in the presence of external noise sources the table ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ExternalNoiseTable", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " of external noise values at individual stations is required. This table \ is an array with one entry for the external noise level at each station \ (note: noise in this array is expressed as power in Watts, not dBmw) . The \ following cell sets the required parameters. The parameters ", Evaluatable->False, AspectRatioFixed->True], StyleBox["CaptureMargin ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox["and ", Evaluatable->False, AspectRatioFixed->True], StyleBox["retrylimit ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ "are used later in the notebook and are only initialized here for \ convenience. They are not used by ", Evaluatable->False, AspectRatioFixed->True], StyleBox["GenerateReceiveLevels.", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "MinPower=-100;\nExternalNoiseTable=10^({-100,-100,-100,-100,-100}/10).001;\n\ CaptureMargin=12;\nretrylimit=3;"], "Input", PageBreakWithin->Automatic, GroupPageBreakWithin->Automatic, InitializationCell->True, AspectRatioFixed->True]}, Open]], Cell[TextData[{ StyleBox[ "\nThe support functions used in the execution of the state machines have \ been modified to allow for more flexible operation. In particular the \ function ", Evaluatable->False, AspectRatioFixed->True], StyleBox["CheckForReceive", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " has become a general purpose function for evaluating signal to \ interference ratio and the job of determining how to adjust transmit and \ receive queues for acceptable and unacceptable S/I ration has been relegated \ to being performed in the individual state machines. This change has allowed \ for the elimination of the routine ", Evaluatable->False, AspectRatioFixed->True], StyleBox["CheckForResponse", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[". The ", Evaluatable->False, AspectRatioFixed->True], StyleBox["CheckForReceive", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " function now accepts three parameters, source, destination and a complete \ list of entities. This function returns ", Evaluatable->False, AspectRatioFixed->True], StyleBox["OK", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " if current conditions would result in a signal to interference ratio in \ excess of the parameter ", Evaluatable->False, AspectRatioFixed->True], StyleBox["CaptureMargin", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " for signals arriving at the destination originating from the source. It \ begins by calling ", Evaluatable->False, AspectRatioFixed->True], StyleBox["GenerateReceiveLevels", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" to update the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ArrivingTxPowerTable", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ ". It then evaluates the sum of the arriving power from all interferers \ and determines if it is low enough for successful transmission to take place. \ If it is it returns ", Evaluatable->False, AspectRatioFixed->True], StyleBox["OK", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" if not it returns ", Evaluatable->False, AspectRatioFixed->True], StyleBox["NOK", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[". The following cell illustrates the use of this function.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData["State[Station1]^=TransmitCPeriod;"], "Input", AspectRatioFixed->True], Cell[CellGroupData[{Cell[TextData["\nCheckForReceive[Station1,Access1,Stations]"], "Input", PageBreakWithin->Automatic, GroupPageBreakWithin->Automatic, AspectRatioFixed->True], Cell[TextData[ "Evaluating TX Conditions between Station1 and Access1"], "Print", Evaluatable->False, PageBreakWithin->Automatic, GroupPageBreakWithin->Automatic, AspectRatioFixed->True], Cell[OutputFormData["\<\ OK\ \>", "\<\ OK\ \>"], "Output", Evaluatable->False, PageBreakWithin->Automatic, GroupPageBreakWithin->Automatic, AspectRatioFixed->True]}, Open]], Cell[CellGroupData[{Cell[TextData["N[MatrixForm[ArrivingTxPowerTable],2]"], "Input", PageBreakWithin->Automatic, GroupPageBreakWithin->Automatic, AspectRatioFixed->True], Cell[OutputFormData[ "\<\ MatrixForm[{{1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, \ 1.*10^-13, 1.*10^-13, 1.*10^-13}, {1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, \ 1.*10^-13, 1.*10^-13}, {1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, \ 1.*10^-13, 1.*10^-13}, {9.764364859744462716*10^-6, 0.00004075287662246145751, \ 4.286571517538639492*10^-6, 1.*10^-13, 3.721181898644007177*10^-7, 3.475634270362283391*10^-7, \ 8.884487555235141621*10^-7, 1.631625581245099666*10^-6}, {1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, \ 1.*10^-13, 1.*10^-13}, {1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, \ 1.*10^-13, 1.*10^-13}, {1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, \ 1.*10^-13, 1.*10^-13}, {1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, 1.*10^-13, \ 1.*10^-13, 1.*10^-13}}]\ \>", "\<\ -13 -13 -13 -13 -13 -13 \ -13 -13 1. 10 1. 10 1. 10 1. 10 1. 10 1. 10 1. 10 \ 1. 10 -13 -13 -13 -13 -13 -13 -13 \ -13 1. 10 1. 10 1. 10 1. 10 1. 10 1. 10 1. 10 \ 1. 10 -13 -13 -13 -13 -13 -13 -13 \ -13 1. 10 1. 10 1. 10 1. 10 1. 10 1. 10 1. 10 \ 1. 10 -6 -6 -13 -7 -7 -7 \ -6 9.8 10 0.000041 4.3 10 1. 10 3.7 10 3.5 10 8.9 10 \ 1.6 10 -13 -13 -13 -13 -13 -13 -13 \ -13 1. 10 1. 10 1. 10 1. 10 1. 10 1. 10 1. 10 \ 1. 10 -13 -13 -13 -13 -13 -13 -13 \ -13 1. 10 1. 10 1. 10 1. 10 1. 10 1. 10 1. 10 \ 1. 10 -13 -13 -13 -13 -13 -13 -13 \ -13 1. 10 1. 10 1. 10 1. 10 1. 10 1. 10 1. 10 \ 1. 10 -13 -13 -13 -13 -13 -13 -13 \ -13 1. 10 1. 10 1. 10 1. 10 1. 10 1. 10 1. 10 \ 1. 10\ \>"], "Output", Evaluatable->False, PageBreakWithin->Automatic, GroupPageBreakWithin->Automatic, AspectRatioFixed->True]}, Open]], Cell[CellGroupData[{Cell[TextData[ " The MAC/PHY State Machines Used For This Simulation"], "Section", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic, AspectRatioFixed->True], Cell[TextData[ "Having established the support functions required, the functions that \ actually process the station state machines can now be presented. For the \ purposes of this simulation the access point is modeled as a simple state \ machine in which progress from one state to another is based solely on \ elapsed time. In general, this machine is very simple with most of the \ transitions being purely timer based. The complexity of the operation has \ been offloaded to the scheduler function and to the mobiles since within this \ simulation the mobiles generate all traffic and are responsible for \ determining whether message transmission is successful or not."], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "The state machine for the access point in this simulation assumes that any \ message received during the preceding B period will be retransmitted during \ the current A period. Upon exit from the state ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Hopping", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ ", the length of the A period and the AH header is set based on the length \ of the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationRxQueue", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" resulting from the previous B period activity. The state ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Schedule", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" executes the scheduler and transfers the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationRxQueue", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" to the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationTxQueue.", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" It also resets the receive queue.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["The function ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ExecuteAccessPoint", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " that is defined in the next cell implements this state machine for the \ list of access points that is provided as a parameter.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "ExecuteAccessPoint[accesspoints_]:=Do[currentaccess=accesspoints[[n]];\n \ Switch[State[currentaccess],\n\t\n\tHopping,\n\t\tPrint[currentaccess,\" is \ Hopping\"];\n\t\t\t\n\t\tWhich[SynthTimer[currentaccess]==0,\n\t\t\t\n\t\t\t\ (State[currentaccess]^=Schedule;\n\t\t\tTAHTimer[currentaccess]^=Length[\n\t\t\ \tStationRxQueue[currentaccess]]-1+AHeaderOverhead;\n\t\t\t\ TATimer[currentaccess]^=(messagelength (Length[\n\t\t\t\t\t\t\ StationRxQueue[currentaccess]]-1))+1;),\n\t\t\t\t\t\t\n\t\t\tTrue,\n\t\t\t\ SynthTimer[currentaccess]^=SynthTimer[currentaccess]-1],\n\t\t\t\t \n\t\ Schedule,Print[currentaccess,\" is Scheduling\"];\n\t\t\t\ Print[\"TXQueues\",StationTxQueue[Stations]];\n\t\t\t\ Print[\"RXQueues\",StationRxQueue[Stations]];\n\t\t\t\ Print[\"ReservationQueues\",ReservationQueue[AccessPoints]];\n\t\t\t\ Scheduler[{currentaccess},Mobiles];\n\t\t\t\ State[currentaccess]^=TransmittingAH;\n\t\t\t\ StationTxQueue[currentaccess]^=StationRxQueue[currentaccess];\n\t\t\t\ StationRxQueue[currentaccess]^={empty};\n\t\t\t\ Print[\"Allocations\",BHHeader[Mobiles]];\n\t\t\t\ Print[\"TXQueues\",StationTxQueue[Stations]];\n\t\t\t\ Print[\"RXQueues\",StationRxQueue[Stations]];\n\t\t\t\ Print[\"ReservationQueues\",ReservationQueue[AccessPoints]],\n\t\t\t\t\n\t\ TransmittingAH,\n\t\t\tPrint[currentaccess,\" is TransmittingAH\"];\n\t\t\t\n\ \t\tWhich[TAHTimer[currentaccess]==0,\n\t\t\t \ State[currentaccess]^=TransmitAPeriod,\n\t\t\t \ True,TAHTimer[currentaccess]^=TAHTimer[currentaccess]-1],\n\t\t\t\t \n\t\ TransmitAPeriod,\n\t\tPrint[currentaccess,\" is TransmitAPeriod\"];\n\t\t\ Print[\"IncomingFlags\",IncomingFlag[Mobiles]];\n\t\t\t\n\t\t\ Which[TATimer[currentaccess]==0,\n\t\t\t \ (State[currentaccess]^=TransmittingBH;\n\t\t\t \ TBHTimer[currentaccess]^=Floor[\n\t\t\t \ (InitBTimer[currentaccess]/messagelength)]+BHeaderOverhead;),\n\t\t\t \ True,TATimer[currentaccess]^=TATimer[currentaccess]-1],\n\t\t\t\t \n\t\ TransmittingBH,\n\t\tPrint[currentaccess,\" is TransmittingBH\"];\n\t\t\ Which[TBHTimer[currentaccess]==0,\n\t\t\t \ (State[currentaccess]^=ReceiveBPeriod;\n\t\t\t \ TBTimer[currentaccess]^=InitBTimer[currentaccess];),\n\t\t\t \ True,TBHTimer[currentaccess]^=TBHTimer[currentaccess]-1],\n\t\t\t\n\t\ ReceiveBPeriod,\n\t\t\tPrint[currentaccess,\" is ReceiveBPeriod\"];\n\t\t\t\ Print[\"TXQueues\",StationTxQueue[Stations]];\n\t\t\t\ Print[\"RXQueues\",StationRxQueue[Stations]];\n\t\t\t\ Which[TBTimer[currentaccess]==0,\n\t\t\t\t \ (State[currentaccess]^=TransmittingCH;\n\t\t\t\t \ TCHTimer[currentaccess]^=CHeaderOverhead;),\n\t\t\t\t \ True,TBTimer[currentaccess]^=TBTimer[currentaccess]-1],\n\t\t\t\n\t\ TransmittingCH,\n\t\t\tPrint[currentaccess,\" is TransmittingCH\"];\n\t\t\t\ Print[\"TXQueues\",StationTxQueue[Stations]];\n\t\t\t\ Print[\"RXQueues\",StationRxQueue[Stations]];\n\t\t\t\ Which[TCHTimer[currentaccess]==0,\n\t\t\t\t \ (State[currentaccess]^=ReceiveCPeriod;\n\t\t\t\t \ TCTimer[currentaccess]^=InitCTimer[currentaccess];),\n\t\t\t\t \ True,TCHTimer[currentaccess]^=TCHTimer[currentaccess]-1],\n\t\t\t\n\t\ ReceiveCPeriod,\n\t\t\t(*Print[currentaccess,\" is ReceiveCPeriod\"];*)\n\t\t\ \tWhich[TCTimer[currentaccess]==0,\n\t\t\t\t (State[currentaccess]^=Hopping;\n\ \t\t\t\t SynthTimer[currentaccess]^=InitSynthTimer;),\n\t\t\t\t \ True,TCTimer[currentaccess]^=TCTimer[currentaccess]-1]],\n\t\t\t\n\t\ {n,1,Length[accesspoints]}]"], "Input", PageBreakWithin->Automatic, GroupPageBreakWithin->Automatic, AspectRatioFixed->True, CellTags->"AccessPoint"], Cell[TextData[{ StyleBox[ "The overall operation of the simulation is based on the concept that all \ traffic originates from the mobiles. A mobile's ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationTXQueue ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ "is a list of all the traffic that the mobile needs to transmit. The \ process of making a bandwidth reservation involves the mobile verifying that, \ during the portion of the C period in which it elects to transmit, the S/I \ ratio at the controlling Access Point is sufficient to allow the transfer to \ be successful. If the S/I ratio is sufficient the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationTxQueue", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " with the station's own name appended as the first element is appended to \ the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ReservationQueue", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" of the Access Point. The ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Scheduler ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox["function is executed by the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ExecuteAccessPoint", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " state machine at the start of the A period. The scheduler requires that \ some parameters be set prior to execution. These are the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["HopTime", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" and the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["MinimumCPeriod ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ "and the header overhead parameters. These parameters along with the \ length of the A period (indicated by the length of the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationRXQueue", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " at the start of the cycle) are used to determine how much bandwidth is \ available for the B period. The ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Scheduler ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox["generates the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["BHHeader", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" that is used to set the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["TBTimers", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " of the individual mobiles, the length of an individual message as \ detailed in the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["messagelength", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " parameter enters into this calculation. Each mobile has its own ", Evaluatable->False, AspectRatioFixed->True], StyleBox["BHHeader", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " that consists of a list of 2 items. These items are the time within the \ B period to start transmitting and the length of time to transmit. The ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Scheduler", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" also sets the value of the symbol ", Evaluatable->False, AspectRatioFixed->True], StyleBox["allocated", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" to the total length of the B period allocated. The ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Scheduler", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" function is defined in the following cell.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[ "Scheduler[accesspoints_,mobiles_]:=Do[(Print[\"Scheduler running\"];\n\t\t\ currentaccess=accesspoints[[n]];\n\t\t\ currentqueue=ReservationQueue[currentaccess];\n\t\t\ totalBPeriod=HopTime-(messagelength \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ (Length[StationRxQueue[currentaccess]]-1))-AHeaderOverhead-\n\t\t\t\t\t\t\t\t\ \t\t\t\t\t\t\tBHeaderOverhead-CHeaderOverhead-MinimumCPeriod;\n\t\t\ totalrequested=messagelength\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \ (Length[Flatten[currentqueue]]-Length[currentqueue]);\n\t\t\ numberrequested=Length[currentqueue]-1;\n \t\ Map[(BHHeader[#]^={disable,none})&,mobiles];\n\n\n\t\t\n\t\t(*If the total \ requested bandwidth is less than the total available\n\t\t B Period time \ allocate all of the requests*)\n\t\t\n\t\tWhich[totalrequested<=totalBPeriod,\ \n\t\t\n\t\t\t\t\t\t\t(allocated=0;\n\t\t\t \t\t\ Do[BHHeader[currentqueue[[k,1]]]^={allocated+1,messagelength\n\t\t\t \t\t\t\t\ \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t (Length[\ currentqueue[[k]]]-1)};\n\t\t\t \t \t\tallocated=allocated+messagelength\n\ \t\t\t \t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t (\ Length[currentqueue[[k]]]-1),\n\t\t\t \t {k,1,numberrequested}];\n\t\t\t \ \t \t\t\n\t\t\t \t \tReservationQueue[currentaccess]^={empty};\n\t\t\t \ \t \t\tInitBTimer[currentaccess]^=allocated+1),\n\t\t\t \t \t\t\n\t\t\ (*Allocate all available B period bandwidth among stations when there\n\t\t \ isn't enough*)\n\t\t\n\t\t\t \t\tTrue,\n\t\t\t \t\t\n\t\t\t \t\t\ (allocated=0;mostper=Floor[totalrequested/(messagelength\n\t\t\t \t\t\t\t\t\t\ \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \tn\ umberrequested)];\n\t\t\t\t\t\t\tDo[Which[(messagelength \ (Length[currentqueue[[k]]]-1))<=mostper,\n\t\t\t\t\t\n\t\t\t\t\t(*Current \ Station wants less than the most it can have, so allocate\n\t\t\t\t\tit all \ it wants, reduce the total requirement, and calculate a new\n\t\t\t\t\t\ mostper unless this is the last station in the queue*)\n\t\t\t\t\t\n\t\t\t\t\t\ \t(BHHeader[currentqueue[[k,1]]]^={allocated+1,messagelength\n\t\t\t\t\t\t\t\t\ \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t (Length[\ currentqueue[[k]]]-1)};\n\t\t\t \t\tallocated=allocated+messagelength \ (Length[currentqueue[[k]]]-1);\n\t\t\t \t ReservationQueue[currentaccess]^=\n\ \t\t\t \t \t\t\t\tReplacePart[ReservationQueue[currentaccess],{empty},k];\n\ \t\t\t \t If[kPaperWidth, InitializationCell->True, AspectRatioFixed->True, CellTags->"Scheduling"], Cell[TextData[ "The state machines for the mobile units are considerably more complex owing \ to the assumption that has been made that all traffic will emanate from the \ mobiles. This is fundamentally an assumption that we are dealing with \ interferring Basic Service Areas in this simulation and that there is no \ Distribution System. "], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "For the purposes of this simulation, it is assumed that a method for \ achieving synchronization of hopping patterns is available. The \ implementation of a method for achieving this synchronization within this \ framework is a subject for future work. In this case a mobile waits in the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["WaitingforAH", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " state upon becoming active before it starts its hop timing and other \ functions. When the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["controllingAP", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" goes into the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Transmitting AH", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " state the hop timer is initialized and the hop is begun.\n\nThe length of \ the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationRxQueue ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ "at the access point at the end of the B period is the length of the next A \ period. During the A period messages received during the previous B period \ are transmitted to the destination mobiles. This is accomplished by mobiles \ with names in the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationTxQueue", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " of the Access point evaluting the S/I conditions for every time period in \ the A period and if they are acceptable incrementing the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["IncomingSuccess", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" counter by the number of times its name appears in the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationTxQueue", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[". If the S/I conditions are inadequate the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["IncomingFailure ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ "counter is incremented. In this simulation, the service modeled is \ connectionless. \n\nA mobile requests enough bandwidth to transmit its \ entire ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationTxQueue", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ ", it drops items from this queue when it is allocated bandwidth in the B \ period. When the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationTxQueue", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " is empty at the start of the C period the traffic generator is run to get \ new traffic.\n \nDuring the B period when a station's ", Evaluatable->False, AspectRatioFixed->True], StyleBox["TBTimer", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " times out it evaluates whether the S/I ratio between the mobile and the \ access point is ", Evaluatable->False, AspectRatioFixed->True], StyleBox["OK", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " during the entire time that it is transmitting its allocated messages. \ If it is it puts its ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationTxQueue ", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox["the portion of its ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationTxQueue", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" that it has been authorized to transmit onto the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationRxQueue", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" of the access point and increments the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Success", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " counter by the number of messages it was authorized to transmit. If the \ S/I ratio is ", Evaluatable->False, AspectRatioFixed->True], StyleBox["NOK", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" at any time during the transmission nothing is place on the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["StationRxQueue", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " of the access point. In both the success and failure case the items are \ removed from the tranmsit queue once transmitted. The ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Failure", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " counter is incremented if the transmission is not successful. \n\nIf the \ station needs to request bandwidth during the C period it selects a slot in \ the C period at random (from a uniform distribution of the time remaining in \ the C period) and during that period it evaluates whether S/I conditions to \ the access point are acceptable. If they are it adds to the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ReservationQueue", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" as detailed in the ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Scheduler", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[" discussion.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ StyleBox["The function ", Evaluatable->False, AspectRatioFixed->True], StyleBox["ExecuteMobile", Evaluatable->False, AspectRatioFixed->True, FontWeight->"Bold"], StyleBox[ " that is defined in the next cell implements this state machine for the \ list of mobiles that is provided as a parameter. ", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True]}, Open]], Cell[TextData[ "ExecuteMobile[mobiles_]:=Do[currentmobile=mobiles[[n]];\n\t\t\t\t\t\t\t\ controllingAP=RegisteredAP[mobiles[[n]]];\n\t\t\t\t\t\t\t\ currentnumber=Position[Stations,currentmobile][[1,1]];\n\t\t\t\t\t\t\t\n\t\ Switch[State[currentmobile],\n\t\n\t\tHopping,\n\t\t\n\t\t\t\ (Print[currentmobile,\" is Hopping\"];\n\t\t\t\ Which[SynthTimer[currentmobile]==0,\n\t\t\t\t \ State[currentmobile]^=WaitingForAH,\n\t\t\t\t \ True,SynthTimer[currentmobile]^=SynthTimer[currentmobile]-1]),\n\t\t\n\t\t\ WaitingForAH,\n\t\t\n\t\t\t(Print[currentmobile,\" is WaitingForAH\"];\n\t\t\t\ HTimer[currentmobile]^=HopTime;\n\t\t\t\ Which[State[controllingAP]===TransmittingAH&&\n\t\t\t\t \t\t\ CheckForReceive[controllingAP,currentmobile,Stations]===OK,\n\t\t\t\t \t\t\ (State[currentmobile]^=ReceivingAH)]),\n\t\t\t\t\n\t\tReceivingAH,\n\t\t\n\t\t\ \t(Print[currentmobile,\" is ReceivingAH\"];\n\t\t\t\n\t\t\t(*Decrement Hop \ Timer*)\n\t\t\t\n\t\t\tHTimer[currentmobile]^=HTimer[currentmobile]-1;\n\t\t\t\ \n\t\t\t(*If Hop Timer is expired Hop no matter what*)\n\t\t\t\n\t\t\t\ Which[HTimer[currentmobile]==0,\n\t\t\t\t \t(State[currentmobile]^=Hopping;\n\ \t\t\t\t \tImproperHop[currentmobile]^=ImproperHop[currentmobile]+1;\n\t\t\t\t\ \t\tSynthTimer[currentmobile]^=InitSynthTimer;),\n\t\t\t\t\t\n\t\t\t(*If its \ not time to Hop check for AP transmitting AH*)\n\t\t\t\n\t\t\t\t \ State[controllingAP]===TransmittingAH,\n\t\t\t\t \n\t\t\t\t (*If AP is \ transmitting AH check S/I and if it is NOK jump to wait\n\t\t\t\t for hop \ and increment the lost access point counter*)\n\t\t\t\t \n\t\t\t\t \ Which[CheckForReceive[controllingAP,currentmobile,Stations]===NOK,\n\t\t\t\t \ \t\t (State[currentmobile]^=WaitingForHop;\n\t\t\t\t \t\t \ LostAP[currentmobile]^=LostAP[currentmobile]+1)],\n\t\t\t\t \t\t \n\t\t\t\t \ (*If everything is OK check to see if AP has completed AH period*)\n\t\t\t\t \ \n\t\t\t\t State[controllingAP]===TransmitAPeriod,\n\t\t\t\t \n\t\t\t\t \ (*If it is done jump to ReceiveAPeriod State*)\n\t\t\t\t \n\t\t\t\t\t\t\ (State[currentmobile]^=ReceiveAPeriod;\n\t\t\t\t\t\t\n\t\t\t\t (*If we are \ expecting a message increment IncomingAttempts and\n\t\t\t\t set incoming \ flag to true*)\n\t\t\t\t \n\t\t\t\t\t\tIncomingFlag[currentmobile]^=Count[\n\ \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFlatten[StationTxQueue[controllingAP]],\ currentmobile])]),\n\t\t\t\t \n\t\t\t\t \n\t\tReceiveAPeriod,\n\t\t\n\t\t\t\ (Print[currentmobile,\" is ReceiveAPeriod\"];\n\n\t\t\t(*Decrement Hop \ Timer*)\n\t\t\t\n\t\t\tHTimer[currentmobile]^=HTimer[currentmobile]-1;\n\t\t\t\ \n\t\t\t(*If Hop Timer is expired Hop no matter what*)\n\t\t\t\n\t\t\t\ Which[HTimer[currentmobile]==0,\n\t\t\t\t \t(State[currentmobile]^=Hopping;\n\ \t\t\t\t \tImproperHop[currentmobile]^=ImproperHop[currentmobile]+1;\n\t\t\t\t\ \tSynthTimer[currentmobile]^=InitSynthTimer;),\n\t\t\t\t\t\n\t\t\t(*If its \ not time to Hop check for AP transmitting A*)\n\t\t\t\n\t\t\t\t \ State[controllingAP]===TransmitAPeriod,\n\t\t\t\t \n\t\t\t\t (*If AP is \ transmitting AH check S/I and if it is NOK with an\n\t\t\t\t incoming \ message expected and jump to wait for hop, also increment\n\t\t\t\t the \ lost access point counter and incoming failure counter*)\n\t\t\t\t \n\t\t\t\t\ \tWhich[CheckForReceive[controllingAP,currentmobile,Stations]===NOK\n\t\t\t\ \t \t\t &&IncomingFlag[currentmobile]!=0,\n\t\t\t\t \t\t \ (State[currentmobile]^=WaitingForHop;\n\t\t\t\t \t\t \ IncomingFailure[currentmobile]^=IncomingFailure[currentmobile]\n\t\t\t\t \t\t\ \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+\ IncomingFlag[currentmobile];\n\t\t\t\t \t\t IncomingFlag[currentmobile]^=0;\ \n\t\t\t\t \t\t LostAP[currentmobile]^=LostAP[currentmobile]+1)],\n\t\t\t\t \ \t\t \n\t\t\t\t (*If everything is OK check to see if AP has completed A \ period*)\n\t\t\t\t \n\t\t\t\t State[controllingAP]===TransmittingBH,\n\t\t\t\ \t \n\t\t\t\t (*If it is done jump to ReceiveAPeriod State*)\n\t\t\t\t \n\t\ \t\t\t\t\t(State[currentmobile]^=ReceivingBH;\n\t\t\t\t\t\t\n\t\t\t\t (*If \ we are expecting a message increment IncomingSuccess and\n\t\t\t\t set \ incoming flag to false*)\n\t\t\t\t \n\t\t\t\t\t\ Which[IncomingFlag[currentmobile]!=0,\n\t\t\t\t\t\t\t\ (IncomingSuccess[currentmobile]^=IncomingSuccess[currentmobile]+\n\t\t\t\t\t\t\ \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tIncomingFl\ ag[currentmobile];\n\t\t\t\t\t\t IncomingFlag[currentmobile]^=0)])]),\n\t\t\t\ \n\t\t\t\t \nReceivingBH,\n\t\t\n\t\t\t(Print[currentmobile,\" is \ ReceivingBH\"];\n\t\t\t\n\t\t\t(*Decrement Hop Timer*)\n\t\t\t\n\t\t\t\ HTimer[currentmobile]^=HTimer[currentmobile]-1;\n\t\t\t\n\t\t\t(*If Hop Timer \ is expired Hop no matter what*)\n\t\t\t\n\t\t\t\ Which[HTimer[currentmobile]==0,\n\t\t\t\t \t(State[currentmobile]^=Hopping;\n\ \t\t\t\t \tImproperHop[currentmobile]^=ImproperHop[currentmobile]+1;\n\t\t\t\t\ \tSynthTimer[currentmobile]^=InitSynthTimer;),\n\t\t\t\t\t\n\t\t\t(*If its \ not time to Hop check for AP transmitting BH*)\n\t\t\t\n\t\t\t\t \ State[controllingAP]===TransmittingBH,\n\t\t\t\t \n\t\t\t\t (*If AP is \ transmitting BH check S/I and if it is NOK jump to wait\n\t\t\t\t for hop \ and incremnt the lost access point counter*)\n\t\t\t\t \n\t\t\t\t \t\ Which[CheckForReceive[controllingAP,currentmobile,Stations]===NOK,\n\t\t\t\t \ \t\t (State[currentmobile]^=WaitingForHop;\n\t\t\t\t \t\t \ LostAP[currentmobile]^=LostAP[currentmobile]+1)],\n\t\t\t\t \t\t \n\t\t\t\t \ (*If everything is OK check to see if AP has completed BH period*)\n\t\t\t\t \ \n\t\t\t\t State[controllingAP]===ReceiveBPeriod,\n\t\t\t\t \n\t\t\t\t \ (*If it is done jump to ReceiveBPeriod State*)\n\t\t\t\t \n\t\t\t\t\t\t\ If[NumberQ[BHHeader[currentmobile][[1]]],\n\t\t\t\t\t\t \ State[currentmobile]^=WaitBPeriod;\n\t\t\t\t\t\t \ TBTimer[currentmobile]^=BHHeader[currentmobile][[1]],\n\t\t\t\t\t\t \ State[currentmobile]^=WaitingForCH]]),\n\t\t\t\t\t\t \n\t\tWaitBPeriod,\n\t\t\ \n\t\t\t(Print[currentmobile,\" is InactiveBPeriod\"];\n\n\t\t\t(*Decrement \ Hop Timer and waiting to transmit timer*)\n\t\t\t\n\t\t\t\ HTimer[currentmobile]^=HTimer[currentmobile]-1;\n\t\t\t\ TBTimer[currentmobile]^=TBTimer[currentmobile]-1;\n\t\t\t\n\t\t\t(*If Hop \ Timer is expired Hop no matter what*)\n\t\t\t\n\t\t\t\ Which[HTimer[currentmobile]==0,\n\t\t\t\t \t(State[currentmobile]^=Hopping;\n\ \t\t\t\t \tImproperHop[currentmobile]^=ImproperHop[currentmobile]+1;\n\t\t\t\t\ \t SynthTimer[currentmobile]^=InitSynthTimer;),\n\t\t\t\t\t\n\t\t\t(*If its \ not time to Hop check for time to transmit*)\n\t\t\t\n\t\t\t\t \ TBTimer[currentmobile]==0,\n\t\t\t\t \t\t\t \n\t\t\t\t (*If it is done jump \ to TransmitBPeriod State*)\n\t\t\t\t \n\t\t\t\t\t\t\ (State[currentmobile]^=TransmitBPeriod;\n\t\t\t\t\t\t\ TBTimer[currentmobile]^=BHHeader[currentmobile][[2]])]),\n\t\t\t\t\t\t\n\t\t\t\ \t \t\t\t\n\t\tTransmitBPeriod,\n\t\t\n\t\t\t(Print[currentmobile,\" is \ TransmitBPeriod\"];\n\t\t\t\n\t\t\t(*Decrement Hop Timer*)\n\t\t\t\n\t\t\t\ HTimer[currentmobile]^=HTimer[currentmobile]-1;\n\t\t\t\ TBTimer[currentmobile]^=TBTimer[currentmobile]-1;\n\t\t\t\n\t\t\t(*If Hop \ Timer is expired Hop no matter what*)\n\t\t\t\n\t\t\t\ Which[HTimer[currentmobile]==0,\n\t\t\t\t \t(State[currentmobile]^=Hopping;\n\ \t\t\t\t \tImproperHop[currentmobile]^=ImproperHop[currentmobile]+1;\n\t\t\t\t\ \t SynthTimer[currentmobile]^=InitSynthTimer;),\n\t\t\t\t\t\n\t\t\t(*If its \ not time to Hop check for expiration of transmit timer and\n\t\t\t everything \ NOK*)\n\t\t\t\n\t\t\t\t TBTimer[currentmobile]!=0&&\n\t\t\t\t \ CheckForReceive[currentmobile,controllingAP,Stations]===NOK,\n\t\t\t\t \t\t\ Failure[currentmobile]^=Failure[currentmobile]+\n\t\t\t\t \t\t\t\t\t\t\t\t\ Floor[BHHeader[currentmobile][[2]]/messagelength];\n\t\t\t\t \t\t\ StationTxQueue[currentmobile]^=Drop[StationTxQueue[currentmobile],\n\t\t\t\t \ \t\t\t\t\t\t\t\tFloor[BHHeader[currentmobile][[2]]/messagelength]];\n\t\t\t\t \ \t\tState[currentmobile]^=WaitForCH,\n\t\t\t\t \n\t\t\t(*If it is expired \ and everything is ok increment success and\n\t\t\t continue*)\n\t\t\t\t \n\t\ \t\t\t TBTimer[currentmobile]==0,\n\t\t\t\t \t\t\ Success[currentmobile]^=Success[currentmobile]+\n\t\t\t\t \t\t\ Floor[BHHeader[currentmobile][[2]]/messagelength];\n\t\t\t\t \t\t\ StationRxQueue[controllingAP]^=AppendTo[\n\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\ \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tStationRxQueue[controllingAP],\n\t\t\t\ \t \t\t\t\t\t\t\t\tTake[StationTxQueue[currentmobile],\n\t\t\t\t \t\t\t\t\t\ \t\t\tFloor[BHHeader[currentmobile][[2]]/messagelength]]];\n\t\t\t\t \t\t\ StationTxQueue[currentmobile]^=Drop[StationTxQueue[currentmobile],\n\t\t\t\t \ \t\t\t\t\t\t\t\tFloor[BHHeader[currentmobile][[2]]/messagelength]];\n\t\t\t\t \ \t\tState[currentmobile]^=WaitingForCH]),\n\t\t\nWaitingForCH,\n\t\t\n\t\t\t\ (Print[currentmobile,\" is WaitingForCH\"];\n\n\t\t\t(*Decrement Hop Timer \ and waiting to transmit timer*)\n\t\t\t\n\t\t\t\ HTimer[currentmobile]^=HTimer[currentmobile]-1;\n\t\t\t\n\t\t\t(*If Hop Timer \ is expired Hop no matter what*)\n\t\t\t\n\t\t\t\ Which[HTimer[currentmobile]==0,\n\t\t\t\t \t(State[currentmobile]^=Hopping;\n\ \t\t\t\t \tImproperHop[currentmobile]^=ImproperHop[currentmobile]+1;\n\t\t\t\t\ \tSynthTimer[currentmobile]^=InitSynthTimer;),\n\t\t\t\t\t\n\t\t\t(*If its \ not time to Hop check for AP tranmsitting CH & OK*)\n\t\t\t\n\t\t\t\t \ State[controllingAP]===TransmittingCH,\n\t\t\t\t \n\t\t\t\t (*If AP is \ transmitting AH check S/I and if it is NOK jump to wait\n\t\t\t\t for hop \ and increment the lost access point counter*)\n\t\t\t\t \n\t\t\t\t \t\ Which[CheckForReceive[controllingAP,currentmobile,Stations]===NOK,\n\t\t\t\t \ \t\t (State[currentmobile]^=WaitingForHop;\n\t\t\t\t \t\t \ LostAP[currentmobile]^=LostAP[currentmobile]+1)],\n\t\t\t\t \t\t \n\t\t\t\t \ (*If everything is OK check to see if AP has completed CH period*)\n\t\t\t\t \ \n\t\t\t\t State[controllingAP]===ReceiveCPeriod,\n\t\t\t\t \t\t\ State[currentmobile]^=SetupCPeriod]),\n\t\t\t\nSetupCPeriod,\n\t\t\t\n\t\t\t\ (Print[currentmobile,\" is SetupCPeriod\"];\n\t\t\t\n\t\t\t(*Decrement Hop \ Timer and waiting to transmit timer*)\n\t\t\t\n\t\t\t\ HTimer[currentmobile]^=HTimer[currentmobile]-1;\n\t\t\t\n\t\t\t(*If Hop Timer \ is expired Hop no matter what*)\n\t\t\t\n\t\t\t\ Which[HTimer[currentmobile]==0,\n\t\t\t\t \t(State[currentmobile]^=Hopping;\n\ \t\t\t\t \tImproperHop[currentmobile]^=ImproperHop[currentmobile]+1;\n\t\t\t\t\ \tSynthTimer[currentmobile]^=InitSynthTimer;),\n\t\t\t\n\t\t\t(*If the \ TXQueue goes empty generate traffic and request bandwidth*)\n\t\t\t\n\t\t\t\t \ StationTxQueue[currentmobile]==={empty},\n\t\t\t\t \ (GenerateTraffic[{currentmobile},mobiles];\n\t\t\t\t Print[\"Traffic \ Generator Executed\"];\n\t\t\t\t \ Which[StationTxQueue[currentmobile]==={empty},\n\t\t\t\t \t\t\ State[currentmobile]^=WaitingForHop,\n\t\t\t\t \n\t\t\t\t (*There is new \ traffic a reservation is required, pick a slot*)\t\n\t\t\t\t \t\t\n\t\t\t\t \ True,\n\t\t\t\t TCTimer[currentmobile]^=Random[\n\t\t\t\t \ Statistics`DiscreteDistributions`DiscreteUniformDistribution[\n\t\t\t\t \ (Floor[HTimer[currentmobile]/messagelength]-1) messagelength]];\n\t\t\t\t \t\t\ Print[TCTimer[mobiles]];\n\t\t\t\t \t\tState[currentmobile]^=WaitCPeriod]),\n\ \t\t\t\t True,\n\t\t\t\t State[currentmobile]^=WaitingForHop]),\n\t\t\t\t \ \nWaitCPeriod,\n\t\t\n\t\t\t( (*Print[currentmobile,\" is \ InactiveCPeriod\"];*)\n\n\t\t\t(*Decrement Hop Timer and waiting to transmit \ timer*)\n\t\t\t\n\t\t\tHTimer[currentmobile]^=HTimer[currentmobile]-1;\n\t\t\t\ TCTimer[currentmobile]^=TCTimer[currentmobile]-1;\n\t\t\t\n\t\t\t(*If Hop \ Timer is expired Hop no matter what*)\n\t\t\t\n\t\t\t\ Which[HTimer[currentmobile]==0,\n\t\t\t\t \t(State[currentmobile]^=Hopping;\n\ \t\t\t\t \tImproperHop[currentmobile]^=ImproperHop[currentmobile]+1;\n\t\t\t\t\ \tSynthTimer[currentmobile]^=InitSynthTimer;),\n\t\t\t\t\t\n\t\t\t(*If its \ not time to Hop check for time to transmit*)\n\t\t\t\n\t\t\t\t \ TCTimer[currentmobile]==0,\n\t\t\t\t \t\t\t \n\t\t\t\t (*If it is done jump \ to TransmitCPeriod State*)\n\t\t\t\t \n\t\t\t\t\t\t\ (State[currentmobile]^=TransmitCPeriod;\n\t\t\t\t\t\t\ TCTimer[currentmobile]^=reservationlength)]),\n\n\t\t\t\t \nTransmitCPeriod,\ \n\t\t\t\n\t\t\t((*Print[currentmobile,\" is TransmitCPeriod\"];*)\n\t\t\t\n\t\ \t\t(*Decrement Hop Timer and waiting to transmit timer*)\n\t\t\t\n\t\t\t\ HTimer[currentmobile]^=HTimer[currentmobile]-1;\n\t\t\t\ TCTimer[currentmobile]^=TCTimer[currentmobile]-1;\n\t\t\t\n\t\t\t(*If Hop \ Timer is expired Hop no matter what*)\n\t\t\t\n\t\t\t\ Which[HTimer[currentmobile]==0,\n\t\t\t\t \t(State[currentmobile]^=Hopping;\n\ \t\t\t\t \tImproperHop[currentmobile]^=ImproperHop[currentmobile]+1;\n\t\t\t\t\ \tSynthTimer[currentmobile]^=InitSynthTimer;),\n\t\t\t\t\t\n\t\t\t\t (*If TC \ Timer expires try to make reservation*)\n\t\t\t\t \n\t\t\t\t \ TCTimer[currentmobile]!=0,Which[\n\t\t\t\t\t\n\t\t\t\t \ CheckForReceive[currentmobile,controllingAP,Stations]===NOK,\n\t\t\t\t \t\t\ (Failure[currentmobile]^=Failure[currentmobile]+\n\t\t\t\t \t\t\t\t\t\t\t\t\t\ \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLength[StationTxQueue[currentmobile]];\n\t\ \t\t\t \t\tStationTxQueue[currentmobile]^={empty};\n\t\t\t\t \t\t\ State[currentmobile]^=WaitingForHop)],\n\t\t\t\t \n\t\t\t\t\t(*If everything \ is ok increment success and continue*)\n\t\t\t\t\t\n\t\t\t\t \ TCTimer[currentmobile]==0,\n\t\t\t\t \t\t(ReservationQueue[controllingAP]^=\n\ \t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tPrependTo[\ ReservationQueue[controllingAP],\n\t\t\t\t\t\t\ Prepend[Drop[StationTxQueue[currentmobile],-1],currentmobile]];\n\t\t\t\t\t\t\ State[currentmobile]^=WaitingForHop)]),\n\t\t\t\t \nWaitingForHop,\n\t\t\n\t\ \t\t((*Print[currentmobile,\" is WaitingForHop\"];*)\n\t\t\t\ Which[HTimer[currentmobile]==0,\n\t\t\t\t\t\t(State[currentmobile]^=Hopping;\n\ \t\t\t\t\t\tSynthTimer[currentmobile]^=InitSynthTimer;),\n\t\t\t\t \ True,HTimer[currentmobile]^=HTimer[currentmobile]-1])],\n\t\t\t\n\ {n,1,Length[mobiles]}]"], "Input", PageWidth->PaperWidth, PageBreakWithin->Automatic, GroupPageBreakWithin->Automatic, AspectRatioFixed->True, CellTags->"Mobile"], Cell[CellGroupData[{Cell[TextData[" Simulation Execution and Results"], "Section", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic, AspectRatioFixed->True], Cell[TextData[ "Finally, the stage is set for performing an actual simulation. The \ following cell executes 1000 cycles of the defined simulation and provides \ diagnostic information as it is executing as well as summary statistics upon \ completion."], "Text", Evaluatable->False, AspectRatioFixed->True]}, Open]], Cell[TextData["maxtime=1000;"], "Input", AspectRatioFixed->True], Cell[TextData[ "Do[ExecuteAccessPoint[{Access1}];ExecuteMobile[Mobiles],{tt,1,maxtime}] "], "Input", AspectRatioFixed->True, CellTags->"Execute"], Cell[TextData["Output of this command detailed in Appendix"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{Cell[TextData[ "Success[Mobiles]\nFailure[Mobiles]\nIncomingSuccess[Mobiles]\n\ IncomingFailure[Mobiles]\nLostAP[Mobiles]"], "Input", AspectRatioFixed->True], Cell[OutputFormData["\<\ {7, 5, 7, 10, 8}\ \>", "\<\ {7, 5, 7, 10, 8}\ \>"], "Output", Evaluatable->False, AspectRatioFixed->True], Cell[OutputFormData["\<\ {0, 2, 0, 2, 0}\ \>", "\<\ {0, 2, 0, 2, 0}\ \>"], "Output", Evaluatable->False, AspectRatioFixed->True], Cell[OutputFormData["\<\ {3, 12, 5, 2, 4}\ \>", "\<\ {3, 12, 5, 2, 4}\ \>"], "Output", Evaluatable->False, AspectRatioFixed->True], Cell[OutputFormData["\<\ {0, 0, 0, 0, 0}\ \>", "\<\ {0, 0, 0, 0, 0}\ \>"], "Output", Evaluatable->False, AspectRatioFixed->True], Cell[OutputFormData["\<\ {0, 0, 0, 0, 0}\ \>", "\<\ {0, 0, 0, 0, 0}\ \>"], "Output", Evaluatable->False, AspectRatioFixed->True]}, Open]], Cell[CellGroupData[{Cell[TextData[" Conclusion"], "Section", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic, AspectRatioFixed->True], Cell[TextData[{ StyleBox[ "This document has expanded upon the framework for evaluating MAC/PHY \ performance presented in 92/123. This expansion has taken the form of a \ preliminary implementation of one of the MACs that has been presented to the \ MAC group. The requested action from this submittal is to close issue 29.1 \ and to direct the parties working on channel models, MACs and MAC/PHY \ throughput presentations to begin working with a common set of tools \ developed in ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Mathematica", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[".\n", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True]}, Open]] }, FrontEndVersion->"Macintosh 3.0", ScreenRectangle->{{0, 832}, {0, 604}}, AutoGeneratedPackage->None, WindowToolbars->{}, CellGrouping->Manual, WindowSize->{520, 509}, WindowMargins->{{84, Automatic}, {Automatic, 16}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, MacintoshSystemPageSetup->"\<\ 00<0001804P000000]P2:?oQon82n@960dL5:0?l0080001804P000000]P2:001 0000I00000400`<300000BL?00400@00000000000000060001T1T00000000000 00000000000000000000000000000000\>" ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{ "Initialization"->{ Cell[21627, 539, 354, 7, 70, "Input", InitializationCell->True, CellTags->"Initialization"]}, "AccessPoint"->{ Cell[44262, 1179, 3539, 59, 70, "Input", PageBreakWithin->Automatic, CellTags->"AccessPoint"]}, "Scheduling"->{ Cell[52178, 1380, 4255, 62, 70, "Input", InitializationCell->True, CellTags->"Scheduling"]}, "Mobile"->{ Cell[63425, 1660, 14392, 203, 70, "Input", PageBreakWithin->Automatic, CellTags->"Mobile"]}, "Execute"->{ Cell[78405, 1882, 152, 4, 70, "Input", CellTags->"Execute"]} } *) (*CellTagsIndex CellTagsIndex->{ {"Initialization", 81554, 1999}, {"AccessPoint", 81683, 2003}, {"Scheduling", 81813, 2007}, {"Mobile", 81936, 2011}, {"Execute", 82060, 2015} } *) (*NotebookFileOutline Notebook[{ Cell[1711, 51, 853, 29, 70, "Title", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic], Cell[2567, 82, 434, 9, 70, "Subtitle", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic], Cell[CellGroupData[{ Cell[3024, 93, 159, 4, 70, "Section", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic], Cell[3186, 99, 2812, 38, 70, "Text", Evaluatable->False] }, Open ]], Cell[CellGroupData[{ Cell[6030, 139, 145, 4, 70, "Section", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic], Cell[6178, 145, 4473, 91, 70, "Text", Evaluatable->False] }, Open ]], Cell[CellGroupData[{ Cell[10683, 238, 150, 4, 70, "Section", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic], Cell[10836, 244, 1251, 33, 70, "Text", Evaluatable->False], Cell[12090, 279, 164, 4, 70, "Input", PageBreakWithin->Automatic, InitializationCell->True], Cell[12257, 285, 126, 2, 70, "Input", InitializationCell->True], Cell[12386, 289, 2522, 68, 70, "Text", Evaluatable->False], Cell[14911, 359, 174, 4, 70, "Input", PageBreakWithin->Automatic, InitializationCell->True], Cell[15088, 365, 2234, 69, 70, "Text", Evaluatable->False], Cell[17325, 436, 1872, 32, 70, "Input", PageBreakWithin->Automatic, InitializationCell->True], Cell[19200, 470, 2404, 67, 70, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[21627, 539, 354, 7, 70, "Input", InitializationCell->True, CellTags->"Initialization"], Cell[21984, 548, 108, 6, 70, "Output", Evaluatable->False], Cell[22095, 556, 106, 6, 70, "Output", Evaluatable->False] }, Open ]], Cell[22213, 564, 1223, 22, 70, "Input", PageBreakWithin->Automatic, InitializationCell->True], Cell[CellGroupData[{ Cell[23459, 588, 62, 1, 70, "Input"], Cell[23524, 591, 767, 12, 70, "Info", Evaluatable->False] }, Open ]], Cell[24303, 605, 2581, 65, 70, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[26907, 672, 177, 4, 70, "Input", PageBreakWithin->Automatic, InitializationCell->True], Cell[27087, 678, 2200, 48, 70, "Output", Evaluatable->False, PageBreakWithin->Automatic] }, Open ]], Cell[29299, 728, 2424, 65, 70, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[31746, 795, 177, 4, 70, "Input", PageBreakWithin->Automatic], Cell[31926, 801, 302, 11, 70, "Output", Evaluatable->False, PageBreakWithin->Automatic] }, Open ]], Cell[32240, 814, 2801, 85, 70, "Text", Evaluatable->False], Cell[35044, 901, 257, 6, 70, "Input", PageBreakWithin->Automatic, InitializationCell->True] }, Open ]], Cell[35313, 909, 2784, 86, 70, "Text", Evaluatable->False], Cell[38100, 997, 86, 1, 70, "Input"], Cell[CellGroupData[{ Cell[38209, 1000, 162, 3, 70, "Input", PageBreakWithin->Automatic], Cell[38374, 1005, 194, 5, 70, "Print", Evaluatable->False, PageBreakWithin->Automatic], Cell[38571, 1012, 171, 8, 70, "Output", Evaluatable->False, PageBreakWithin->Automatic] }, Open ]], Cell[CellGroupData[{ Cell[38774, 1022, 155, 3, 70, "Input", PageBreakWithin->Automatic], Cell[38932, 1027, 2461, 65, 70, "Output", Evaluatable->False, PageBreakWithin->Automatic] }, Open ]], Cell[CellGroupData[{ Cell[41425, 1094, 189, 5, 70, "Section", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic], Cell[41617, 1101, 735, 11, 70, "Text", Evaluatable->False], Cell[42355, 1114, 1437, 46, 70, "Text", Evaluatable->False], Cell[43795, 1162, 464, 15, 70, "Text", Evaluatable->False], Cell[44262, 1179, 3539, 59, 70, "Input", PageBreakWithin->Automatic, CellTags->"AccessPoint"], Cell[47804, 1240, 4371, 138, 70, "Text", Evaluatable->False], Cell[52178, 1380, 4255, 62, 70, "Input", InitializationCell->True, CellTags->"Scheduling"], Cell[56436, 1444, 401, 7, 70, "Text", Evaluatable->False], Cell[56840, 1453, 6116, 188, 70, "Text", Evaluatable->False], Cell[62959, 1643, 454, 15, 70, "Text", Evaluatable->False] }, Open ]], Cell[63425, 1660, 14392, 203, 70, "Input", PageBreakWithin->Automatic, CellTags->"Mobile"], Cell[CellGroupData[{ Cell[77840, 1865, 169, 4, 70, "Section", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic], Cell[78012, 1871, 312, 6, 70, "Text", Evaluatable->False] }, Open ]], Cell[78336, 1879, 66, 1, 70, "Input"], Cell[78405, 1882, 152, 4, 70, "Input", CellTags->"Execute"], Cell[78560, 1888, 117, 2, 70, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[78700, 1892, 159, 3, 70, "Input"], Cell[78862, 1897, 135, 7, 70, "Output", Evaluatable->False], Cell[79000, 1906, 133, 7, 70, "Output", Evaluatable->False], Cell[79136, 1915, 135, 7, 70, "Output", Evaluatable->False], Cell[79274, 1924, 133, 7, 70, "Output", Evaluatable->False], Cell[79410, 1933, 133, 7, 70, "Output", Evaluatable->False] }, Open ]], Cell[CellGroupData[{ Cell[79575, 1942, 147, 4, 70, "Section", Evaluatable->False, PageBreakWithin->Automatic, PageBreakBelow->Automatic], Cell[79725, 1948, 779, 20, 70, "Text", Evaluatable->False] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)