Changes between Version 79 and Version 80 of WANMAC


Ignore:
Timestamp:
Jul 24, 2006, 5:46:43 PM (18 years ago)
Author:
varunnayyar
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WANMAC

    v79 v80  
    138138'''Common'''
    139139
    140 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.h@305#L46 pduStruct]
     140[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.h@360#L46 pduStruct]
    141141The pduStruct type is the internal representation of what information is included in the frame sent to the PHY. There is a one to one conversion between this struct and array of bytes interpreted by the PHY. This allows us to abstract away from this array structure, making our MAC's behavior independent of the header format. Each
    142142packet contains a CID, which indicates the subscriber ID. The CID sof zero is for broadcasting purposes.
    143143
    144144
    145 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.h@91#L58 pduQueueStruct]
     145[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.h@360#L58 pduQueueStruct]
    146146The pduQueueStruct is a structure containing an array of frameStructs and a few control bytes to keep track of indices, flags and the length of the queue. This queue can serve two purposes. The first use is during the receive phase of the MAC. When the MAC receives a packet from another node, it needs to put the payload somewhere. Because the specification of the connection between our MAC and higher networking layers is still in the process of being defined, we need a method of abstracting our layer away from this future glue layer. An acceptable solution is to simply copy packets from the PHY's memory space into a queue. It is assumed that another in the xilkernel will be taking these packets and giving them to higher layers. The other use of this queue is on the transmit side of the MAC. Again, the connection to the higher layer is still being defined, so we need a way of getting packets to send in the meantime. You can think of the transmit queue as analogous to the receive queue, in that some process somewhere gives us packets to send. This could be the [wiki:"Video Board" Video Board], or eventually the ethernet controller.
    147147
    148148
    149 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.h@91#L74 MAPEntryStruct]
     149[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.h@360#L74 MAPEntryStruct]
    150150The MAPEntryStruct is a single entry/slot of an uplink or a downlink MAP data structure. It contains the start time and the end time for that entry,
    151151which denote the number of bursts allocated in a given slot.
     
    153153[[Image(Maps.JPG, align=centre, 700)]]
    154154
    155 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.h@91#L79 MAPStruct]
     155[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.h@360#L79 MAPStruct]
    156156This is the data structure depicting the MAP. It contains the number of entries of the MAP along with the start time for that MAP. Also it has
    157157the pointer to the actual entries array.
    158158
    159159
    160 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.h@91#L83 IDEntryStruct]
     160[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.h@360#L85 IDEntryStruct]
    161161This depicts an single ID, namely the Connection ID and the MAC information of the node being described. So far we are not using this,
    162162as this is used for Network Entry Protocol.
    163163
    164164
    165 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.h@91#L90 IDStruct]
     165[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.h@360#L90 IDStruct]
    166166This contains the list and the number of ids which correspond to the changes to be made in the new map. This is used both for deletion as well
    167167as for newly added subscriber ids. So far we are not using this, as this is used for Network Entry Protocol.
     
    179179
    180180
    181 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.h@91#L68 BSQueueStruct]
     181[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.h@360#L68 BSQueueStruct]
    182182This is the Base Station data structure, for keeping record of the number of subscribers and for their Receive and Transmit Queues.
    183183
     
    214214==  ==
    215215
    216 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.h@91#L68 SSQueueStruct]
     216[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.h@361#L52 SSQueueStruct]
    217217This is the Subscriber Station data structure, for keeping record of its Receive and Transmit Queues.
    218218
     
    249249== Base Station Functions ==
    250250
    251 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@305#L51 rxPhyGood]
     251[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@360#L75 rxPhyGood]
    252252This function is called when a packet with the correct CRC is received. It copies the packet into the memory. It then checks the state of the
    253253BS machine and the Connection ID of the packet received with the expected Connection ID. Else it simply frees the buffer and in the end
    254254resets the receiver. Note, the resetting of the receiver is a must and it must be the last step after packet processing.
    255255
    256 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@305#L51 BSRxInsertQueuebyMAC]
     256[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@360#L157 BSRxInsertQueuebyMAC]
    257257The function is called when a packet needs to be inserted into a specific queue of the Base Station. This abstracts the behaviour of the
    258258PHY-MAC interaction. The queues are circular and this maintains a notion of a flag, to ensure it does not overwrite on any queue location.
    259259
    260 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@305#L51 CopyMAPs]
     260[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@360#L239 CopyMAPs]
    261261Another utility function for Copying one Map into another.
    262262
    263 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@305#L51 ackmac_main]
     263[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@360#L325 ackmac_main]
    264264The first funtion to be called when the program begins the execution. It extracts the last byte of the MAC Address. This
    265265allocates the Memmory Buffer for the program . It then calls the function for Hardware Initialisation, followed by the
    266266Software Initialization and finally triggering off the State Machine.
    267267
    268 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@305#L51 InitialiseBS]
     268[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@360#L372 InitialiseBS]
    269269This is the main software Initialization funtion. It allocates memory for all the receive and transmit queues for the
    270270specified number of queues. Note the data in the queues is allocated as and when required. For the transmit queues it is done by the Dummy Application
     
    272272read and the write indexes are initialised to zero.
    273273
    274 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@305#L51 CreateMaps]
     274[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@360#L CreateMaps]
    275275This function takes in old maps and the number of new users added to the system along with their ids. It also inputs
    276276the nos of users that would deleted from the system. It then process all the information to create the most
    277277update map verion. It does that both for the uplink and the downlink.
    278278
    279 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@305#L51 InitialiseMAP]
     279[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@360#L429 InitialiseMAP]
    280280This is a utility function for initialising the first uplink and downlink maps. It allocates memory to the
    281281entries. For the time being we only had three entries, one for contention and one each for two subscribers.
    282282Note by defaut: The zeroth entry of the Downlink Map specifies the Contention Period Timings.
    283283
    284 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@305#L51 TxMapsNewIds]
     284[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@360#L558 TxMapsNewIds]
    285285This function takes in the Uplink and the Downlink Map and puts them into a pdu packet. It first puts
    286286in the Downlink Map followed by the Uplink Map. It allocates memory for the data part of the packet
    287287thus created.
    288288
    289 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@305#L51 TxBSPDUs]
     289[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@360#L693 TxBSPDUs]
    290290The function is resposnsible for reading the Downlink Map and according to that,
    291291setting the timers for each of the downlink slots corresponding to each subscriber
    292292
    293 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@305#L51 TransmitfrmQ]
     293[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@360#L727 TransmitfrmQ]
    294294This function makes the call to pull out packets from the queue specified and hands them over to the PHY layer. It simply waits in the while
    295295loop as long the timer goes on.
    296296
    297 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@305#L51 BSTxRemoveQueuebyMAC]
     297[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@360#L747 BSTxRemoveQueuebyMAC]
    298298This function is responsible for taking out the pdu from one of the circular queue specified. This is responsible for updating the queue
    299299data structure so that we dont over write on any queue location. This is done by incrementing the read index of the circular transmit queue.
     
    301301
    302302
    303 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@305#L51 ReceivefrmPhy]
     303[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@360#L859 ReceivefrmPhy]
    304304All this function does it to set a timer and wait for a packet to be received. It also changes the global variable queueidRx to the specified
    305305queueid, so that packets corresponding to the correct subscriber can be used.
    306306
    307 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@305#L51 RxBSPDUs]
     307[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@360#L886 RxBSPDUs]
    308308It receives the Uplink Map and processes it in order to receive from each one of the subscribers.
    309309
    310 [source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@305#L51 StateMachineBS]
     310[source:/ResearchApps/MAC/WANMAC/Basestation/basestation.c@360#L906 StateMachineBS]
    311311This is the main State Machine for the Basetation. It coordinates the way the execution takes place. It runs the dummy application to fill
    312312up the transmit queues. It then enters a never ending while loop, and starts to process Maps, transmit them, transmit and receive the payloads
     
    320320== Subscriber Station Functions ==
    321321
    322 [source:/ResearchApps/MAC/WANMAC/Subscriber/substation.c@301#L76 InitialiseSS]
     322[source:/ResearchApps/MAC/WANMAC/Subscriber/substation.c@361#L79 InitialiseSS]
    323323This is the main software initialization funtion for the subscriber station. It allocates memory for all the receive and transmit queues for a
    324324given subscriber. Note the data in the queues is allocated as and when required. For the transmit queues it is done by the Dummy Application
     
    326326read and the write indexes are initialised to zero.
    327327
    328 [source:/ResearchApps/MAC/WANMAC/Subscriber/substation.c@301#L76 RxMap]
     328[source:/ResearchApps/MAC/WANMAC/Subscriber/substation.c@361#L387 RxMap]
    329329This function begins with an infinite loop simply waiting for a correct MAP to be received. The print statement in this function
    330330is important, otherwise the code just stops executing as it senses an infinite while loop. After having the received the Map
     
    332332
    333333
    334 [source:/ResearchApps/MAC/WANMAC/Subscriber/substation.c@301#L76 StateMachineSS]
     334[source:/ResearchApps/MAC/WANMAC/Subscriber/substation.c@361#L466 StateMachineSS]
    335335This is the state machine for the Subscriber Station. It begins with the dummy application generator filling up the transmit queue
    336336for the subscriber station. Note that the interrupts for the good and the bad have been enabled here rather than in the hardware. This
     
    339339After each loop the de-allocation of the Map entries is done.
    340340
    341 [source:/ResearchApps/MAC/WANMAC/Subscriber/substation.c@301#L76 SSFreeQueues]
     341[source:/ResearchApps/MAC/WANMAC/Subscriber/substation.c@361#L576 SSFreeQueues]
    342342This function does the de-allocation of the queues allocated for the transmit and the receive of the Subscriber Station
    343343
    344344
    345 [source:/ResearchApps/MAC/WANMAC/Subscriber/substation.c@301#L76 ackmac_main]
     345[source:/ResearchApps/MAC/WANMAC/Subscriber/substation.c@361#L595 ackmac_main]
    346346The first funtion to be called when the program begins the execution. It extracts the last byte of the MAC Address. This
    347347allocates the Memmory Buffer for the program . It then calls the function for Hardware Initialisation, followed by the
     
    349349
    350350
    351 [source:/ResearchApps/MAC/WANMAC/Subscriber/substation.c@301#L76 RxSSPDUs]
     351[source:/ResearchApps/MAC/WANMAC/Subscriber/substation.c@361#L647 RxSSPDUs]
    352352This function waits in a while loop till the timer goes off on the global variable notEndRxPDU. It expects to receive packets from
    353353the Base Station during this time interval. Note the setting of the timer is not done in this function unlike the Base Station, instead
     
    355355
    356356
    357 [source:/ResearchApps/MAC/WANMAC/Subscriber/substation.c@301#L76 TxSSPDUs]
     357[source:/ResearchApps/MAC/WANMAC/Subscriber/substation.c@361#L664 TxSSPDUs]
    358358This function keeps on calling the function to remove packets from the transmit queue and sending them to the physcial layer. It
    359359waits on the global variable notEndTxPDU, which again is set in the state machine and not inside this function.
    360360
    361 [source:/ResearchApps/MAC/WANMAC/Subscriber/substation.c@301#L76 SSTxRemoveQueuebyMAC]
     361[source:/ResearchApps/MAC/WANMAC/Subscriber/substation.c@361#L683 SSTxRemoveQueuebyMAC]
    362362This function is responsible for taking out the pdu from one of the circular queue specified. This is responsible for updating the queue
    363363data structure so that we dont over write on any queue location. This is done by incrementing the read index of the circular transmit queue.
    364364The packet is copied into passed argument and memory is allocated for the data.
    365365
    366 [source:/ResearchApps/MAC/WANMAC/Subscriber/substation.c@301#L76 SSRxInsertQueuebyMAC]
     366[source:/ResearchApps/MAC/WANMAC/Subscriber/substation.c@361#L748 SSRxInsertQueuebyMAC]
    367367This function is responsible for inserting the pdu into one of the circular queue specified. This is responsible for updating the queue
    368368data structure so that we dont over write on any queue location. This is done by incrementing the write index of the circular receive queue.