00001 /********************************************/ 00002 /* NS2 Simulator for IEEE 802.15.4 */ 00003 /* (per P802.15.4/D18) */ 00004 /*------------------------------------------*/ 00005 /* by: Jianliang Zheng */ 00006 /* (zheng@ee.ccny.cuny.edu) */ 00007 /* Myung J. Lee */ 00008 /* (lee@ccny.cuny.edu) */ 00009 /* ~~~~~~~~~~~~~~~~~~~~~~~~~ */ 00010 /* SAIT-CUNY Joint Lab */ 00011 /********************************************/ 00012 00013 // File: p802_15_4const.h 00014 // Mode: C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t 00015 00016 // $Header: /cvsroot/nsnam/ns-2/wpan/p802_15_4const.h,v 1.2 2007/01/30 05:00:51 tom_henderson Exp $ 00017 00018 /* 00019 * Copyright (c) 2003-2004 Samsung Advanced Institute of Technology and 00020 * The City University of New York. All rights reserved. 00021 * 00022 * Redistribution and use in source and binary forms, with or without 00023 * modification, are permitted provided that the following conditions 00024 * are met: 00025 * 1. Redistributions of source code must retain the above copyright 00026 * notice, this list of conditions and the following disclaimer. 00027 * 2. Redistributions in binary form must reproduce the above copyright 00028 * notice, this list of conditions and the following disclaimer in the 00029 * documentation and/or other materials provided with the distribution. 00030 * 3. All advertising materials mentioning features or use of this software 00031 * must display the following acknowledgement: 00032 * This product includes software developed by the Joint Lab of Samsung 00033 * Advanced Institute of Technology and The City University of New York. 00034 * 4. Neither the name of Samsung Advanced Institute of Technology nor of 00035 * The City University of New York may be used to endorse or promote 00036 * products derived from this software without specific prior written 00037 * permission. 00038 * 00039 * THIS SOFTWARE IS PROVIDED BY THE JOINT LAB OF SAMSUNG ADVANCED INSTITUTE 00040 * OF TECHNOLOGY AND THE CITY UNIVERSITY OF NEW YORK ``AS IS'' AND ANY EXPRESS 00041 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00042 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 00043 * NO EVENT SHALL SAMSUNG ADVANCED INSTITUTE OR THE CITY UNIVERSITY OF NEW YORK 00044 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00045 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 00046 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00047 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00048 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00049 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00050 */ 00051 00052 00053 #ifndef p802_15_4const_h 00054 #define p802_15_4const_h 00055 00056 #include "p802_15_4def.h" 00057 00058 //---PHY layer constants (Table 18)--- 00059 const UINT_8 aMaxPHYPacketSize = 127; //max PSDU size (in bytes) the PHY shall be able to receive 00060 const UINT_8 aTurnaroundTime = 12; //Rx-to-Tx or Tx-to-Rx max turnaround time (in symbol period) 00061 const UINT_8 aCCATime = 8; //2.31 change: CCA duration (in symbol period) 00062 00063 //---PHY_PIB default values--- 00064 //All the default values are not given in the draft. 00065 //They are chosen for sake of a value 00066 #define def_phyCurrentChannel 11 00067 #define def_phyChannelsSupported 0x07ffffff 00068 #define def_phyTransmitPower 0 00069 #define def_phyCCAMode 1 00070 00071 //---MAC sublayer constants (Table 70)--- 00072 const UINT_8 aNumSuperframeSlots = 16; //# of slots contained in a superframe 00073 const UINT_8 aBaseSlotDuration = 60; //# of symbols comprising a superframe slot of order 0 00074 const UINT_16 aBaseSuperframeDuration 00075 = aBaseSlotDuration * aNumSuperframeSlots; //# of symbols comprising a superframe of order 0 00076 //aExtendedAddress = ; //64-bit (IEEE) address assigned to the device (device specific) 00077 const UINT_8 aMaxBE = 5; //max value of the backoff exponent in the CSMA-CA algorithm 00078 const UINT_8 aMaxBeaconOverhead = 75; //max # of octets added by the MAC sublayer to the payload of its beacon frame 00079 const UINT_8 aMaxBeaconPayloadLength 00080 = aMaxPHYPacketSize - aMaxBeaconOverhead; //max size, in octets, of a beacon payload 00081 const UINT_8 aGTSDescPersistenceTime = 4; //# of superframes that a GTS descriptor exists in the beacon frame of a PAN coordinator 00082 const UINT_8 aMaxFrameOverhead = 25; //max # of octets added by the MAC sublayer to its payload w/o security. 00083 const UINT_16 aMaxFrameResponseTime = 1220; //max # of symbols (or CAP symbols) to wait for a response frame 00084 const UINT_8 aMaxFrameRetries = 3; //max # of retries allowed after a transmission failures 00085 const UINT_8 aMaxLostBeacons = 4; //max # of consecutive beacons the MAC sublayer can miss w/o declaring a loss of synchronization 00086 const UINT_8 aMaxMACFrameSize 00087 = aMaxPHYPacketSize - aMaxFrameOverhead; //max # of octets that can be transmitted in the MAC frame payload field 00088 const UINT_8 aMaxSIFSFrameSize = 18; //max size of a frame, in octets, that can be followed by a SIFS period 00089 const UINT_16 aMinCAPLength = 440; //min # of symbols comprising the CAP 00090 const UINT_8 aMinLIFSPeriod = 40; //min # of symbols comprising a LIFS period 00091 const UINT_8 aMinSIFSPeriod = 12; //min # of symbols comprising a SIFS period 00092 const UINT_16 aResponseWaitTime 00093 = 32 * aBaseSuperframeDuration; //max # of symbols a device shall wait for a response command following a request command 00094 const UINT_8 aUnitBackoffPeriod = 20; //# of symbols comprising the basic time period used by the CSMA-CA algorithm 00095 00096 //---MAC_PIB default values (Tables 71,72)--- 00097 //attributes from Table 71 00098 #define def_macAckWaitDuration 54 //22(ack) + 20(backoff slot) + 12(turnaround); propagation delay ignored? 00099 #define def_macAssociationPermit false 00100 #define def_macAutoRequest true 00101 #define def_macBattLifeExt false 00102 #define def_macBattLifeExtPeriods 6 00103 #define def_macBeaconPayload "" 00104 #define def_macBeaconPayloadLength 0 00105 #define def_macBeaconOrder 15 00106 #define def_macBeaconTxTime 0x000000 00107 //#define def_macBSN Random::random() % 0x100 00108 //#define def_macCoordExtendedAddress 0xffffffffffffffffLL 00109 #define def_macCoordExtendedAddress 0xffff 00110 //not defined in draft 00111 #define def_macCoordShortAddress 0xffff 00112 //#define def_macDSN Random::random() % 0x100 00113 #define def_macGTSPermit true 00114 #define def_macMaxCSMABackoffs 4 00115 #define def_macMinBE 3 00116 #define def_macPANId 0xffff 00117 #define def_macPromiscuousMode false 00118 #define def_macRxOnWhenIdle false 00119 #define def_macShortAddress 0xffff 00120 #define def_macSuperframeOrder 15 00121 #define def_macTransactionPersistenceTime 0x01f4 00122 //attributes from Table 72 (security attributes) 00123 #define def_macACLEntryDescriptorSet NULL 00124 #define def_macACLEntryDescriptorSetSize 0x00 00125 #define def_macDefaultSecurity false 00126 #define def_macACLDefaultSecurityMaterialLength 0x15 00127 #define def_macDefaultSecurityMaterial NULL 00128 #define def_macDefaultSecuritySuite 0x00 00129 #define def_macSecurityMode 0x00 00130 00131 #endif 00132 00133 // End of file: p802_15_4const.h