亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? smac.h

?? 在ns2中仿真無(wú)線傳感器網(wǎng)絡(luò)mac層協(xié)議的代碼smac
?? H
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/* * smac.h * Copyright (C) 2000 by the University of Southern California * $Id: smac.h,v 1.11 2005/08/25 18:58:07 johnh Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * * * The copyright of this module includes the following * linking-with-specific-other-licenses addition: * * In addition, as a special exception, the copyright holders of * this module give you permission to combine (via static or * dynamic linking) this module with free software programs or * libraries that are released under the GNU LGPL and with code * included in the standard release of ns-2 under the Apache 2.0 * license or under otherwise-compatible licenses with advertising * requirements (or modified versions of such code, with unchanged * license).  You may copy and distribute such a system following the * terms of the GNU GPL for this module and the licenses of the * other code concerned, provided that you include the source code of * that other code when and as the GNU GPL requires distribution of * source code. * * Note that people who make modified versions of this module * are not obligated to grant this special exception for their * modified versions; it is their choice whether to do so.  The GNU * General Public License gives permission to release a modified * version without this exception; this exception also makes it * possible to release a modified version which carries forward this * exception. * */// smac is designed and developed by Wei Ye (SCADDS/ISI)// and is ported into ns by Padma Haldar, June'02.// Contributors: Yuan Li// This module implements Sensor-MAC//  See http://www.isi.edu/scadds/papers/smac_infocom.pdf for details//// It has the following functions.//  1) Both virtual and physical carrier sense//  2) RTS/CTS for hidden terminal problem//  3) Backoff and retry//  4) Broadcast packets are sent directly without using RTS/CTS/ACK.//  5) A long unicast message is divided into multiple TOS_MSG (by upper//     layer). The RTS/CTS reserves the medium for the entire message.//     ACK is used for each TOS_MSG for immediate error recovery.//  6) Node goes to sleep when its neighbor is communicating with another//     node.//  7) Each node follows a periodic listen/sleep schedule//  8.1) At bootup time each node listens for a fixed SYNCPERIOD and then//     tries to send out a sync packet. It suppresses sending out of sync pkt //     if it happens to receive a sync pkt from a neighbor and follows the //     neighbor's schedule. //  8.2) Or a node can choose its own schecule instead of following others, the//       schedule start time is user configurable//  9) Neighbor Discovery: in order to prevent that two neighbors can not//     find each other due to following complete different schedules, each//     node periodically listen for a whole period of the SYNCPERIOD//  10) Duty cycle is user configurable//  New features including adaptive listen//   See http://www.isi.edu/~weiye/pub/smac_ton.pdf #ifndef NS_SMAC#define NS_SMAC//test features described in Journal paper, adaptive listen, etc//#ifndef JOURNAL_PAPER//#define JOURNAL_PAPER//#endif#include "mac.h"#include "mac-802_11.h"#include "cmu-trace.h"#include "random.h"#include "timer-handler.h"/* User-adjustable MAC parameters *-------------------------------- * The default values can be overriden in Each application's Makefile * SMAC_MAX_NUM_NEIGHB: maximum number of neighbors. * SMAC_MAX_NUM_SCHED: maximum number of different schedules. * SMAC_DUTY_CYCLE: duty cycle in percentage. It controls the length of sleep  *   interval. * SMAC_RETRY_LIMIT: maximum number of RTS retries for sending a single message. * SMAC_EXTEND_LIMIT: maximum number of times to extend Tx time when ACK timeout     happens. */#ifndef SMAC_MAX_NUM_NEIGHBORS#define SMAC_MAX_NUM_NEIGHBORS 20#endif#ifndef SMAC_MAX_NUM_SCHEDULES#define SMAC_MAX_NUM_SCHEDULES 4#endif#ifndef SMAC_DUTY_CYCLE#define SMAC_DUTY_CYCLE 10#endif#ifndef SMAC_RETRY_LIMIT#define SMAC_RETRY_LIMIT 5#endif#ifndef SMAC_EXTEND_LIMIT#define SMAC_EXTEND_LIMIT 5#endif#ifdef JOURNAL_PAPER#ifndef SMAC_UPDATE_NEIGHB_PERIOD#define SMAC_UPDATE_NEIGHB_PERIOD 50#endif                                                                                                                                                      #ifndef GUARDTIME#define GUARDTIME 0.001#endif#endif                                                                                                                                                           /* Internal MAC parameters *-------------------------- * Do NOT change them unless for tuning S-MAC * SYNC_CW: number of slots in the sync contention window, must be 2^n - 1  * DATA_CW: number of slots in the data contention window, must be 2^n - 1 * SYNC_PERIOD: period to send a sync pkt, in cycles. * SRCH_CYCLES_LONG: # of SYNC periods during which a node performs a neighbor discovery * SRCH_CYCLES_SHORT: if there is no known neighbor, a node need to seach neighbor more aggressively */#define SYNC_CW 31#define DATA_CW 63#define SYNCPERIOD 10#define SYNCPKTTIME 3         // an adhoc value used for now later shld converge with durSyncPkt_#define SRCH_CYCLES_SHORT 3#define SRCH_CYCLES_LONG 22/* Physical layer parameters *--------------------------- * Based on the parameters from PHY_RADIO and RADIO_CONTROL * CLOCK_RES: clock resolution in ms.  * BANDWIDTH: bandwidth (bit rate) in kbps. Not directly used. * PRE_PKT_BYTES: number of extra bytes transmitted before each pkt. It equals *   preamble + start symbol + sync bytes. * ENCODE_RATIO: output/input ratio of the number of bytes of the encoding *  scheme. In Manchester encoding, 1-byte input generates 2-byte output. * PROC_DELAY: processing delay of each packet in physical and MAC layer, in ms */#define CLOCKRES 1       // clock resolution is 1ms#define BANDWIDTH 20      // kbps =>CHANGE BYTE_TX_TIME WHENEVER BANDWIDTH CHANGES//#define BYTE_TX_TIME 4/10 // 0.4 ms to tx one byte => changes when bandwidth does#define PRE_PKT_BYTES 5#define ENCODE_RATIO 2   /* Manchester encoding has 2x overhead */#define PROC_DELAY 1// Note everything is in clockticks (CLOCKRES in ms) for tinyOS// so we need to convert that to sec for ns#define CLKTICK2SEC(x)  ((x) * (CLOCKRES / 1.0e3))#define SEC2CLKTICK(x)  ((x) / (CLOCKRES / 1.0e3))// MAC states#define SLEEP 0         // radio is turned off, can't Tx or Rx#define IDLE 1          // radio in Rx mode, and can start Tx//#define CHOOSE_SCHED 2  // node in boot-up phase, needs to choose a schedule#define CR_SENSE 2      // medium is free, do it before initiate a Tx//#define BACKOFF 3       // medium is busy, and cannot Tx#define WAIT_CTS 3      // sent RTS, waiting for CTS#define WAIT_DATA 4     // sent CTS, waiting for DATA#define WAIT_ACK 5      // sent DATA, waiting for ACK#ifdef JOURNAL_PAPER#define TX_NEXT_FRAG 6 // send one fragment, waiting for next from upper layer#else#define WAIT_NEXTFRAG 6 // send one fragment, waiting for next from upper layer#endif#ifdef JOURNAL_PAPER#define DATA_SENSE1 7 // received a RTS destined to another node, keep listening until confirm sender gets a CTS or starts tx data#define DATA_SENSE2 8 // received a RTS destined to another node,and did not receive a RTS, keep listening until timeout or receive data#define TX_PKT 9 // before sending CTS/DATA/ACK, need to wait for a sifs_ time#endif// how to send the pkt: broadcast or unicast#define BCASTSYNC 0#define BCASTDATA 1#define UNICAST 2#ifdef JOURNAL_PAPER#define UNICAST_ADDR 0#endif// Types of pkt#define DATA_PKT 0#define RTS_PKT 1#define CTS_PKT 2#define ACK_PKT 3#define SYNC_PKT 4// radio states for performance measurement#define RADIO_SLP 0  // radio off#define RADIO_IDLE 1 // radio idle#define RADIO_RX 2   // recv'ing mode#define RADIO_TX 3   // transmitting mode/*  sizeof smac datapkt hdr and smac control and sync packets  *//*  have been hardcoded here to mirror the values in TINY_OS implementation *//*  The following is the pkt format definitions for tiny_os implementation *//*  of smac : *//*  typedef struct MAC_CTRLPKT_VALS{ *//*  unsigned char length; *//*  char type; *//*  short addr; *//*  unsigned char group; *//*  short srcAddr; *//*  unsigned char duration; *//*  short crc; *//*  }; *//*  typedef struct MAC_SYNCPKT_VALS{ *//*  unsigned char length; *//*  char type; *//*  short srcAddr; *//*  short syncNode; *//*  unsigned char sleepTime;  // my next sleep time from now *//*  short crc; *//*  };  *//*  struct MSG_VALS{ *//*  unsigned char length; *//*  char type; *//*  short addr; *//*  unsigned char group; *//*  short srcAddr; *//*  unsigned char duration; *//*  char data[DATA_LENGTH]; *//*  short crc; *//*  }; */// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#define SIZEOF_SMAC_DATAPKT 50  // hdr(10) + payload - fixed size pkts#define SIZEOF_SMAC_CTRLPKT 10#define SIZEOF_SMAC_SYNCPKT 9  // Following are the ns definitions of the smac frames//SYNC PKT struct smac_sync_frame {   int type;   int length;   int srcAddr;  //int dstAddr;  int syncNode;   double sleepTime;  // my next sleep time from now */#ifdef JOURNAL_PAPER  int state;  // if node has changed schedule#endif  int crc; }; // RTS, CTS, ACKstruct smac_control_frame {  int type;  int length;  int dstAddr;  int srcAddr;  double duration;  int crc;};// DATA struct hdr_smac {  int type;  int length;  int dstAddr;  int srcAddr;  double duration;  //char data[DATA_LENGTH];  int crc;};// Used by smac when in sync modestruct SchedTable {   int txSync;  // flag indicating need to send sync   int txData;  // flag indicating need to send data   int numPeriods; // count for number of periods #ifdef JOURNAL_PAPER  int numNodes;  // number of nodes on this schedule  int syncNode;  // the node who initialized this schedule  int chkSched; // flag indicating need to check numNodes#endif}; struct NeighbList {   int nodeId;   int schedId;#ifdef JOURNAL_PAPER  int active; //flag indicating the node is active recently  int state; // flag indicating the node has changed schedule#endif }; class SMAC;// Timers used in smacclass SmacTimer : public TimerHandler { public:  SmacTimer(SMAC *a) : TimerHandler() {a_ = a; }  virtual void expire(Event *e) = 0 ;  int busy() ; protected:  SMAC *a_;};#ifdef JOURNAL_PAPER// timer for updating neighbors periodicallyclass SmacUpdateNeighbTimer : public SmacTimer { public:  SmacUpdateNeighbTimer(SMAC *a) : SmacTimer(a) {}  void expire(Event *e);};                                                                                                                                                            // timer for putting nodes back to sleep after Adaptive Listenclass SmacAdaptiveListenTimer : public SmacTimer {

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲精品久| 亚洲图片有声小说| 国产精品久久看| 婷婷开心久久网| 国产视频视频一区| 91精品国产综合久久精品图片| 国产毛片精品视频| 五月综合激情网| 一区二区欧美在线观看| 国产嫩草影院久久久久| 日韩欧美亚洲另类制服综合在线 | 国产在线视频精品一区| 亚洲一区视频在线观看视频| 欧美高清在线一区二区| 精品免费日韩av| 777欧美精品| 亚洲综合图片区| 在线精品视频免费观看| 狠狠狠色丁香婷婷综合激情| 亚洲mv在线观看| 亚洲最新视频在线播放| 中文在线一区二区| 国产三级精品三级| 精品av久久707| 日韩欧美一二三区| 日韩欧美中文字幕一区| 欧美日本在线看| 欧美性猛片aaaaaaa做受| 在线欧美日韩精品| 色婷婷综合久久久中文一区二区| 成人综合日日夜夜| 成人午夜视频在线| 丰满放荡岳乱妇91ww| 国产成人h网站| 国产精品99久久久久久久女警| 国产真实精品久久二三区| 日本欧洲一区二区| 久久国产麻豆精品| 久久国产夜色精品鲁鲁99| 精品一二三四区| 国内精品视频666| 国产高清久久久| 国产91精品精华液一区二区三区| 激情综合色丁香一区二区| 精品一区二区三区在线播放视频| 美女视频黄久久| 国产一区二区三区久久久| 国产精品一区免费在线观看| 国产成人免费视频一区| 粉嫩av一区二区三区在线播放| 成a人片国产精品| 色婷婷综合在线| 国产午夜三级一区二区三| 国产精品视频一区二区三区不卡| 亚洲国产成人私人影院tom| 中文字幕日韩精品一区| 亚洲免费资源在线播放| 亚洲国产视频一区| 青青国产91久久久久久| 国产一区二区精品在线观看| av资源站一区| 欧美日韩一区二区三区四区五区| 8v天堂国产在线一区二区| 精品国产露脸精彩对白| 综合色天天鬼久久鬼色| 亚洲曰韩产成在线| 青青草国产精品亚洲专区无| 国产丶欧美丶日本不卡视频| 91免费看片在线观看| 色偷偷一区二区三区| 欧美一区二区三区男人的天堂| www国产成人免费观看视频 深夜成人网| 久久精品视频免费| 亚洲一级片在线观看| 久久精品国产色蜜蜜麻豆| 99久久久久久| 日韩一二三区不卡| 国产精品不卡在线| 蓝色福利精品导航| 99re8在线精品视频免费播放| 538在线一区二区精品国产| 国产偷国产偷亚洲高清人白洁| 一区二区三区中文字幕电影| 精品中文av资源站在线观看| 92精品国产成人观看免费 | 欧美性色黄大片| 久久久久国产免费免费| 亚洲成人av一区| 成人短视频下载| 日韩欧美在线综合网| 亚洲欧美日韩国产另类专区| 久久99精品久久久久婷婷| 日本高清免费不卡视频| 久久久久亚洲综合| 日韩国产高清在线| 色综合网色综合| 久久色在线观看| 日本亚洲电影天堂| 欧美无乱码久久久免费午夜一区 | 中文字幕在线观看不卡视频| 免费视频一区二区| 91福利在线导航| 国产精品视频一二三区 | 99久久久精品| 26uuuu精品一区二区| 日韩精品成人一区二区三区| 91视视频在线观看入口直接观看www | 99久久久国产精品| 久久精品视频在线免费观看| 蜜臀av一级做a爰片久久| 欧美午夜精品久久久| 亚洲日本成人在线观看| 国产盗摄视频一区二区三区| 日韩欧美二区三区| 亚洲国产精品视频| 欧美午夜一区二区三区| 尤物视频一区二区| 91久久久免费一区二区| 国产精品美女久久久久aⅴ国产馆| 国产精品资源网| 精品99999| 国产一二精品视频| 精品久久久久99| 国产在线精品一区二区不卡了| 日韩一区二区三区视频在线观看| 亚洲国产成人精品视频| 欧美视频自拍偷拍| 亚洲国产精品嫩草影院| 欧美日韩国产经典色站一区二区三区| 一区二区三区影院| 欧洲精品一区二区| 亚洲第一福利一区| 91精品国产综合久久小美女| 日韩精品欧美精品| 日韩欧美国产综合一区 | 国产精品伦理一区二区| 大尺度一区二区| 中文字幕日韩精品一区| 色94色欧美sute亚洲线路一ni | 欧美性受极品xxxx喷水| 亚洲欧美日韩国产成人精品影院 | 色婷婷av一区二区三区gif | 国产91精品在线观看| 国产亚洲欧美中文| www.av精品| 亚洲精品福利视频网站| 欧美在线免费观看视频| 日韩成人一级片| 久久久精品欧美丰满| aaa欧美色吧激情视频| 亚洲香肠在线观看| 日韩一区二区三区四区五区六区| 国产一区二区三区在线观看免费视频| 国产欧美中文在线| 色综合一区二区| 天堂久久久久va久久久久| 欧美成人精品福利| 成人黄色片在线观看| 亚洲曰韩产成在线| 精品噜噜噜噜久久久久久久久试看| 国精产品一区一区三区mba桃花| 日本一区二区免费在线观看视频| 91在线国产福利| 日韩精品成人一区二区在线| 国产午夜一区二区三区| 欧美主播一区二区三区| 久久不见久久见免费视频1| 久久久777精品电影网影网| 91久久精品午夜一区二区| 琪琪一区二区三区| 18欧美亚洲精品| 日韩一区二区在线看片| 不卡电影一区二区三区| 日本不卡的三区四区五区| 国产精品人成在线观看免费| 欧美三级午夜理伦三级中视频| 久久爱www久久做| 一区二区三区91| 国产日韩精品一区二区浪潮av| 色狠狠色噜噜噜综合网| 韩国在线一区二区| 夜夜爽夜夜爽精品视频| 久久久久久久国产精品影院| 日本韩国一区二区三区视频| 激情综合色丁香一区二区| 一区二区三区久久久| 国产日韩欧美一区二区三区乱码 | 欧美一区日本一区韩国一区| 顶级嫩模精品视频在线看| 天天操天天综合网| 自拍av一区二区三区| 久久夜色精品国产噜噜av| 欧美日韩一区二区在线观看视频| 丁香天五香天堂综合| 六月丁香婷婷久久| 亚洲超碰97人人做人人爱| 成人欧美一区二区三区黑人麻豆| 精品国产一区二区三区不卡| 欧美日韩综合在线| 95精品视频在线|