2007年5月18日 星期五

NIST Scan 流程

1. SSscheduler::pause_scanning ()
2. Mac::send_scan_result (void *res, int size)
3. MIHAgent::process_scan_response (Mac *mac, void *rsp, int size)
3.1 MIHScan::process_scan_response (int macAddr, void *rsp, int size)
4. Handover1::process_scan_conf (struct mih_scan_rsp *rsp)

2007年5月17日 星期四

NIST Handover 重要function

Define old link(ss & old BS) and new link(ss & new BS)
void Mac::send_link_handover_imminent (int macTerminal, int oldPoA, int macPoA){ if (mih_ && ((subscribedEventList_ >> MIH_LINK_HANDOVER_IMMINENT)& 0x1) ) {
link_handover_imminent_t *e = (link_handover_imminent_t*) malloc (sizeof (link_handover_imminent_t)); e->linkIdentifier.type = linkType_; e->linkIdentifier.macMobileTerminal = macTerminal; e->linkIdentifier.macPoA = oldPoA; e->newLinkIdentifier.type = linkType_; e->newLinkIdentifier.macMobileTerminal = macTerminal; e->newLinkIdentifier.macPoA = macPoA; e->macOldAccessRouter = oldPoA; e->macNewAccessRouter = macPoA; mih_->recv_event (MIH_LINK_HANDOVER_IMMINENT, e); } //else we don't need to do anything}

2007年5月14日 星期一

NIST TCL 設定

設定 SS 跟BS連接
$init_node($i) base-station [AddrParams addr2id [$bstationWIMAX($i) node-addr]] ;

2007年5月13日 星期日

NIST NS2 module

發生Handoff 之前的 函數執行順序
process_link_going_down
process_link_down

2007年4月11日 星期三

BS 發送 鄰近BS相關資訊

At 0.504001 in BS 0 send_nbr_adv (nb_neighbor=1)

BS0 送出鄰近BS資訊, nb_neighbor=1 代表有一個鄰近BS

NIST connection 資訊

每各connection 都會紀錄 是要跟那一各node連接

2007年4月10日 星期二

NIST 建立packet 的一些動作

mac_->getPacket ();
struct hdr_cmn *ch = HDR_CMN(rep);
rep->allocdata (sizeof (struct mac802_16_rng_rsp_frame));
mac802_16_rng_rsp_frame *frame = (mac802_16_rng_rsp_frame*) rep->accessdata();
frame->type = MAC_RNG_RSP;
frame->uc_id = ulsubframe->getChannelID();
frame->rng_status = RNG_SUCCESS;
frame->ss_mac_address = req->ss_mac_address;
frame->basic_cid = basic->get_cid();
frame->primary_cid = primary->get_cid();
ch->size() = RNG_RSP_SIZE;
Burst *b = map_->getDlSubframe()->getPdu ()->getBurst (0);
double txtime = mac_->getPhy()->getTrxTime (ch->size(),map_->getDlSubframe()->getProfile (b->getIUC())->getEncoding());
ch->txtime() = txtime;
mac_->getCManager()->get_connection (BROADCAST_CID, false)->enqueue (rep);

WiMAX module of NIST

因為發現一各去年就已經釋出的模組
雖然他有 handoff 機制
但是他的service flow未開發完成
現在要轉向開發這各NIST模組
唉 人生

2007年4月9日 星期一

NS2 trace format

For example
s -t 5.144001358 -Hs 1 -Hd -2 -Ni 1 -Nx 50.00 -Ny 50.00 -Nz 0.00 -Ne -1.000000 -Nl MAC -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0

在 5.144001358, node 1 傳送給 node 2
node 1 的 x座標50 ,y座標50,z座標 0 ,
Node Energy Level = -1
Network trace Level = MAC
Drop Reason = null

NodeID認定方式

ns2內部認定 nodeid方式 是依照產生的順序
由 zero開始開始 每次加一遞增

2007年4月8日 星期日

封包在模組之間的流程

mac-802.16.cc -> phy.cc -> wirlessphy.cc->channel.cc-> channel.cc (WirelessChannel::sendUp(Packet* p, Phy *tifp)) ->

2007年4月6日 星期五

模擬參數

Phy/WirelessPhy set RXThresh_ 2.37e-11
Phy/WirelessPhy set CSThresh_ 1.5e-11
Phy/WirelessPhy set Pt_ 3.08

2007年3月22日 星期四

SearchDlMapIeNum_link(int NodeID)

DlMapIeNum_link* Mac802_16::SearchDlMapIeNum_link(int NodeID)
{
DlMapIeNum_link* tmp = DlMapIeNum_link_head;
while(tmp) {
if(tmp->NodeID == NodeID)
return tmp;
tmp = tmp->next;
}
return NULL;
}

SearchUlMapIeNum_link(int NodeID)

UlMapIeNum_link* Mac802_16::SearchUlMapIeNum_link(int NodeID)
{
UlMapIeNum_link* tmp = UlMapIeNum_link_head;
while(tmp){
if(tmp->NodeID == NodeID)
return tmp;
tmp = tmp->next;
}
return NULL;
}

CreateDlMapIeNum_link(int NodeID)

DlMapIeNum_link* Mac802_16::CreateDlMapIeNum_link(int NodeID)
{
DlMapIeNum_link* tmp = new DlMapIeNum_link;
tmp->NodeID = NodeID;
tmp->DlMapIeNum = 0;

if(!DlMapIeNum_link_head) {
DlMapIeNum_link_head = DlMapIeNum_link_tail = tmp;
tmp->next = NULL;
}
else {
DlMapIeNum_link_tail->next = tmp;
DlMapIeNum_link_tail = tmp;
tmp->next = NULL;
}
return tmp;
}

CreateUlMapIeNum_link(int NodeID)

UlMapIeNum_link* Mac802_16::CreateUlMapIeNum_link(int NodeID)
{
UlMapIeNum_link* tmp = new UlMapIeNum_link;
tmp->NodeID = NodeID;
tmp->UlMapIeNum = 0;

if(!UlMapIeNum_link_head) {
UlMapIeNum_link_head = UlMapIeNum_link_tail = tmp;
tmp->next = NULL;
}
else {
UlMapIeNum_link_tail->next = tmp;
UlMapIeNum_link_tail = tmp;
tmp->next = NULL;
}
return tmp;
}

SearchUlAvailSymbol_link(int NodeID)

UlAvailSymbol_link* Mac802_16::SearchUlAvailSymbol_link(int NodeID)
{
UlAvailSymbol_link* tmp = UlAvailSymbol_link_head;
while(tmp) {
if(tmp->NodeID == NodeID)
return tmp;
tmp = tmp->next;
}
return NULL;
}

SearchDlAvailSymbol_link(int NodeID)

DlAvailSymbol_link* Mac802_16::SearchDlAvailSymbol_link(int NodeID)
{
DlAvailSymbol_link* tmp = DlAvailSymbol_link_head;
while(tmp){
if(tmp->NodeID == NodeID)
return tmp;
tmp = tmp->next;
}

return NULL;
}

CreateUlAvailSymbol_link(int NodeID)

UlAvailSymbol_link* Mac802_16::CreateUlAvailSymbol_link(int NodeID)
{
UlAvailSymbol_link *tmp = new UlAvailSymbol_link;
if(!UlAvailSymbol_link_head) {
tmp->NodeID = NodeID;
tmp->UlAvailSymbol = 0;
UlAvailSymbol_link_head = UlAvailSymbol_link_tail = tmp;
tmp->next = NULL;
return tmp;
}
else {
UlAvailSymbol_link *pt = UlAvailSymbol_link_head;
while(pt) {
if(pt->NodeID == NodeID) {
return pt;
}
pt = pt->next;
}
tmp->NodeID = NodeID;
tmp->UlAvailSymbol = 0;
UlAvailSymbol_link_tail->next = tmp;
UlAvailSymbol_link_tail = tmp;
tmp->next = NULL;
return tmp;
}

}

CreateDlAvailSymbol_link(int NodeID)

DlAvailSymbol_link* Mac802_16::CreateDlAvailSymbol_link(int NodeID)
{
DlAvailSymbol_link *tmp = new DlAvailSymbol_link;
if(!DlAvailSymbol_link_head) {
tmp->NodeID = NodeID;
tmp->DlAvailSymbol = 0;
DlAvailSymbol_link_head = DlAvailSymbol_link_tail = tmp;
tmp->next = NULL;
return tmp;
}
else {
DlAvailSymbol_link *pt = DlAvailSymbol_link_head;
while(pt) {
if(pt->NodeID == NodeID) {
return pt;
}
pt = pt->next;
}
tmp->NodeID = NodeID;
tmp->DlAvailSymbol = 0;
DlAvailSymbol_link_tail->next = tmp;
DlAvailSymbol_link_tail = tmp;
tmp->next = NULL;
return tmp;
}
}

UlMapIeNum_link

struct UlMapIeNum_link {
UlMapIeNum_link() {next = NULL;}
int NodeID;
int UlMapIeNum;
UlMapIeNum_link *next;
};

DlMapIeNum_link

struct DlMapIeNum_link {
DlMapIeNum_link() {next = NULL;}
int NodeID;
int DlMapIeNum;
DlMapIeNum_link *next;
};

UlAvailSymbol_link

struct UlAvailSymbol_link {
UlAvailSymbol_link() {next = NULL;}
int NodeID;
int UlAvailSymbol;
UlAvailSymbol_link *next;
};

DlAvailSymbol_link

struct DlAvailSymbol_link {
DlAvailSymbol_link() {next = NULL;}
int NodeID;
int DlAvailSymbol;
DlAvailSymbol_link *next;
};

2007年3月21日 星期三

SearchAllocationStartTime(int NodeID)

AllocationStartTime_link* Mac802_16::SearchAllocationStartTime(int NodeID)
{
AllocationStartTime_link *tmp = AllocationStartTime_link_head;

while(tmp) {
if(tmp->NodeID == NodeID) {
return tmp;
}
tmp = tmp->next;
}
return NULL;
}

CreateAllocationStartTime(int NodeID)

AllocationStartTime_link* Mac802_16::CreateAllocationStartTime(int NodeID)
{
AllocationStartTime_link *tmp = new AllocationStartTime_link;

tmp->NodeID = NodeID;
tmp->AllocationStartTime = 0;

if(!AllocationStartTime_link_head) {
AllocationStartTime_link_head = AllocationStartTime_link_tail = tmp;
tmp->next = NULL;
}
else {
AllocationStartTime_link_tail->next = tmp;
AllocationStartTime_link_tail = tmp;
tmp->next = NULL;
}
return tmp;


}

2007年3月20日 星期二

c++基本語法

構造函數,bits_,data_,ref_count_,next_是函數的成員,bits_(0),data_(0),ref_count_(0),next_(0)是初始化列表。 相当于 Packet(){bits_ = 0;data_ = 0;ref_count_ =0;next_ = 0;}相當於Packet(){bits_=0;data_=0;ref_count_=0;next_=0;}

2007年3月17日 星期六

ns2 得知 signal power

The propagation model in mobilenode computes the signal power. see
~ns/mobile/propagation.*

DeleteUlMapIe(int NodeID)

void Mac802_16::DeleteUlMapIe(int NodeID)
{
UlMapIe_link *pt = UlMapIe_link_head;
UlMapIe_link *backup,*tmp;

backup = tmp = NULL;
while(pt) {
if(pt->NodeID == NodeID) {
backup = pt->next;
delete pt;
if(!tmp)
UlMapIe_link_head = backup;
else
tmp->next = backup;
return;
}
tmp = pt;
pt = pt->next;
}
return;
}

DeleteDlMapIe(int NodeID)

void Mac802_16::DeleteDlMapIe(int NodeID)
{
DlMapIe_link *pt = DlMapIe_link_head;
DlMapIe_link *backup,*tmp;

backup = tmp = NULL;
while(pt) {
if(pt->NodeID == NodeID) {
backup = pt->next;
delete pt;
if(!tmp)
DlMapIe_link_head = backup;
else
tmp->next = backup;
return;
}
tmp = pt;
pt = pt->next;
}
return;
}

2007年3月16日 星期五

CreateDlBurstProfile_link(int NodeID)

DownlinkBurstProfile* Mac802_16::CreateDlBurstProfile_link(int NodeID)
{
DownlinkBurstProfile_link *tmp = new DownlinkBurstProfile_link;
DownlinkBurstProfile *tmp2 = new DownlinkBurstProfile;

tmp->NodeID = NodeID;


if(!DownlinkBurstProfile_link_head) {
tmp->DlBurstProfile_head = tmp->DlBurstProfile_tail = tmp2;
tmp2->next = NULL;
DownlinkBurstProfile_link_head = DownlinkBurstProfile_link_tail = tmp;
tmp->next = NULL;
return tmp2;
}
else {
DownlinkBurstProfile_link *pt = DownlinkBurstProfile_link_head;
while(pt) {
if(pt->NodeID == NodeID) {
pt->DlBurstProfile_tail->next = tmp2;
pt->DlBurstProfile_tail = tmp2;
tmp2->next = NULL;
return tmp2;
}
pt = pt->next;
}
tmp->DlBurstProfile_head = tmp->DlBurstProfile_tail = tmp2;
tmp2->next = NULL;
DownlinkBurstProfile_link_tail->next = tmp;
DownlinkBurstProfile_link_tail = tmp;
tmp->next = NULL;
return tmp2;
}


}

CreateUlBurstProfile_link(int NodeID)

UplinkBurstProfile* Mac802_16::CreateUlBurstProfile_link(int NodeID)
{
UplinkBurstProfile_link *tmp = new UplinkBurstProfile_link;
UplinkBurstProfile *tmp2 = new UplinkBurstProfile;

tmp->NodeID = NodeID;

if(!UplinkBurstProfile_link_head) {
tmp->UlBurstProfile_head = tmp->UlBurstProfile_tail = tmp2;
tmp2->next = NULL;
UplinkBurstProfile_link_head = UplinkBurstProfile_link_tail = tmp;
tmp->next = NULL;
return tmp2;
}
else {
UplinkBurstProfile_link *pt = UplinkBurstProfile_link_head;
while(pt) {
if(pt->NodeID == NodeID) {
pt->UlBurstProfile_tail->next = tmp2;
pt->UlBurstProfile_tail = tmp2;
tmp2->next = NULL;
return tmp2;
}
pt = pt->next;
}

tmp->UlBurstProfile_head = tmp->UlBurstProfile_tail = tmp2;
tmp2->next = NULL;
UplinkBurstProfile_link_tail->next = tmp;
UplinkBurstProfile_link_tail = tmp;
tmp->next = NULL;
return tmp2;
}

}

SearchDlBurstProfile(int NodeID)

DownlinkBurstProfile_link* Mac802_16::SearchDlBurstProfile(int NodeID)
{
DownlinkBurstProfile_link *tmp = DownlinkBurstProfile_link_head;

while(tmp) {
if(tmp->NodeID == NodeID) {
return tmp;
}
tmp = tmp->next;
}
return NULL;

}

SearchUlBurstProfile(int NodeID)

UplinkBurstProfile_link* Mac802_16::SearchUlBurstProfile(int NodeID)
{
UplinkBurstProfile_link *tmp = UplinkBurstProfile_link_head;

while(tmp) {
if(tmp->NodeID == NodeID)
return tmp;
tmp = tmp->next;
}
return NULL;
}

CreateBsServiceFlow_link(int NodeID)

BsServiceFlow* Mac802_16::CreateBsServiceFlow_link(int NodeID)
{
BsServiceFlow_link *tmp = new BsServiceFlow_link;
BsServiceFlow *tmp2 = new BsServiceFlow;

tmp->NodeID = NodeID;

if(!BsSF_link_head) {
tmp->BsSF_head = tmp->BsSF_tail = tmp2;
tmp2->next = NULL;
BsSF_link_head = BsSF_link_tail = tmp;
tmp->next = NULL;
return tmp2;
}
else {
BsServiceFlow_link *pt = BsSF_link_head;
while(pt) {
if(pt->NodeID == NodeID) {
pt->BsSF_tail->next = tmp2;
pt->BsSF_tail = tmp2;
tmp2->next = NULL;
return tmp2;
}
pt = pt->next;
}
tmp->BsSF_head = tmp->BsSF_tail = tmp2;
tmp2->next = NULL;
BsSF_link_tail->next = tmp;
BsSF_link_tail = tmp;
tmp->next = NULL;
return tmp2;
}
}

SearchBsServiceFlow_link(int NodeID)

BsServiceFlow_link* Mac802_16::SearchBsServiceFlow_link(int NodeID)
{
BsServiceFlow_link *tmp = BsSF_link_head;

while(tmp) {
if(tmp->NodeID == NodeID)
return tmp;
tmp = tmp->next;
}
return NULL;

}

CreateBsSsInfo_link(int NodeID)

BsSsInfo* Mac802_16::CreateBsSsInfo_link(int NodeID)
{
BsSsInfo_link *tmp = new BsSsInfo_link;
BsSsInfo *tmp2 = new BsSsInfo;

tmp->NodeID = NodeID;

if(!BsSsInfo_link_head) {
tmp->BsSsInfo_head = tmp->BsSsInfo_tail = tmp2;
tmp2->next = NULL;
BsSsInfo_link_head = BsSsInfo_link_tail = tmp;
tmp->next = NULL;
return tmp2;
}
else {
BsSsInfo_link *pt = BsSsInfo_link_head;
while(pt) {
if(pt->NodeID == NodeID) {
pt->BsSsInfo_tail->next = tmp2;
pt->BsSsInfo_tail = tmp2;
tmp2->next = NULL;
return tmp2;
}
pt = pt->next;
}

tmp->BsSsInfo_head = tmp->BsSsInfo_tail = tmp2;
tmp2->next = NULL;
BsSsInfo_link_tail->next = tmp;
BsSsInfo_link_tail = tmp;
tmp->next = NULL;
return tmp2;
}
}

SearchBsSsInfo(int NodeID)

BsSsInfo_link* Mac802_16::SearchBsSsInfo(int NodeID)
{
BsSsInfo_link *tmp = BsSsInfo_link_head;
while(tmp) {
if(tmp->NodeID == NodeID) {
return tmp;
}
tmp = tmp->next;
}
return NULL;
}

DeleteUlBurstProfile(int NodeID)

void Mac802_16::DeleteUlBurstProfile(int NodeID)
{
UplinkBurstProfile_link *tmp,*backup;
UplinkBurstProfile_link *pt = UplinkBurstProfile_link_head;
tmp = backup = NULL;

if(UplinkBurstProfile_link_head) {

while(pt) {
if(pt->NodeID == NodeID) {
backup = pt->next;
delete pt;
if(!tmp)
UplinkBurstProfile_link_head = backup;
else
tmp->next = backup;
return ;
}
tmp = pt;
pt = pt->next;
}
return;
}
else
return;
}

DeleteDlBurstProfile(int NodeID)

void Mac802_16::DeleteDlBurstProfile(int NodeID)
{
DownlinkBurstProfile_link *tmp,*backup;
DownlinkBurstProfile_link *pt = DownlinkBurstProfile_link_head;
tmp = backup = NULL;

if(DownlinkBurstProfile_link_head) {
while(pt) {
if(pt->NodeID == NodeID) {
backup = pt->next;
delete pt;
if(!tmp)
DownlinkBurstProfile_link_head = backup;
else
tmp->next = backup;
return;
}
tmp = pt;
pt = pt->next;
}
return;
}
else
return;
}

CreateSsServiceFlow(int NodeID)

SsServiceFlow* Mac802_16::CreateSsServiceFlow(int NodeID)
{
SsServiceFlow_link *tmp = new SsServiceFlow_link;
SsServiceFlow *tmp2 = new SsServiceFlow;

if(!SsSF_link_head) {
tmp->NodeID = NodeID;
tmp->SsSF_head = tmp->SsSF_tail = tmp2;
tmp2->next = NULL;
SsSF_link_head = SsSF_link_tail = tmp;
tmp->next = NULL;
}
else {
SsServiceFlow_link *pt = SsSF_link_head;
while(pt) {
if(pt->NodeID == NodeID){
pt->SsSF_tail->next = tmp2;
pt->SsSF_tail = tmp2;
tmp2->next = NULL;
return tmp2;
}
pt = pt->next;
}
tmp->NodeID = NodeID;
tmp->SsSF_head = tmp->SsSF_tail = tmp2;
tmp2->next = NULL;
SsSF_link_tail->next = tmp;
SsSF_link_tail = tmp;
tmp->next = NULL;
return tmp2;
}
}

SsServiceFlow_link

struct SsServiceFlow_link {
SsServiceFlow_link() {next = NULL;}
int NodeID;
SsServiceFlow *SsSF_head;
SsServiceFlow *SsSF_tail;
SsServiceFlow_link *next;
};

BsSsInfo_link

struct BsSsInfo_link {
BsSsInfo_link() {next = NULL;}
int NodeID;
BsSsInfo *BsSsInfo_head;
BsSsInfo *BsSsInfo_tail;
BsSsInfo_link *next;
};

BsServiceFlow_link

struct BsServiceFlow_link {
BsServiceFlow_link() {next = NULL;}
int NodeID;
BsServiceFlow *BsSF_head;
BsServiceFlow *BsSF_tail;
BsServiceFlow_link *next;
};

UplinkBurstProfile_link {

struct UplinkBurstProfile_link {
UplinkBurstProfile_link() {next = NULL;}
int NodeID;
UplinkBurstProfile *UlBurstProfile_head;
UplinkBurstProfile *UlBurstProfile_tail;
UplinkBurstProfile_link *next;
};

DownlinkBurstProfile_link

struct DownlinkBurstProfile_link {
DownlinkBurstProfile_link () {next = NULL;}
int NodeID;
DownlinkBurstProfile *DlBurstProfile_head;
DownlinkBurstProfile *DlBurstProfile_tail;
DownlinkBurstProfile_link *next;
};

2007年3月12日 星期一

CreateUlMapIe_link(int NodeID)

UlMapIe* Mac802_16::CreateUlMapIe_link(int NodeID)
{
UlMapIe_link *tmp = new UlMapIe_link;
UlMapIe *tmp2 = new UlMapIe;

if (!UlMapIe_link_head) {
tmp->NodeID = NodeID;
//Each Bs UlMapIe data
tmp->UlMapIe_head = tmp->UlMapIe_tail = tmp2;
tmp2->next = NULL;
UlMapIe_link_head = UlMapIe_link_tail = tmp;
tmp->next = NULL;
return tmp2;
}
else {//已經有資料在link裡面 尋找是否有該node資料

UlMapIe_link *pt = UlMapIe_link_head;
//
while(pt) {
if(pt->NodeID == NodeID) {
pt->UlMapIe_tail->next = tmp2;
pt->UlMapIe_tail = tmp2;
tmp2->next = NULL;
return tmp2;
}
pt = pt->next;
}
////沒找到該NodeID的資料 因此建立新的link data
tmp->NodeID = NodeID;
tmp->UlMapIe_head = tmp->UlMapIe_tail = tmp2;
tmp2->next = NULL;
UlMapIe_link_tail->next = tmp;
UlMapIe_link_tail = tmp;
tmp->next = NULL;
return tmp2;
}

}

CreateDlMapIe_link(int NodeID)

DlMapIe* Mac802_16::CreateDlMapIe_link(int NodeID)
{

DlMapIe_link *tmp = new DlMapIe_link;
DlMapIe *tmp2 = new DlMapIe;

if (!DlMapIe_link_head) {
tmp->NodeID = NodeID;
//Each Bs DlMapIe data
tmp->DlMapIe_head = tmp->DlMapIe_tail = tmp2;
tmp2->next = NULL;
DlMapIe_link_head = DlMapIe_link_tail = tmp;
tmp->next = NULL;
return tmp2;
}else {
DlMapIe_link *pt = DlMapIe_link_head;
while(pt) {
if(pt->NodeID == NodeID) {
pt->DlMapIe_tail->next = tmp2;
pt->DlMapIe_tail = tmp2;
tmp2->next = NULL;
return tmp2;
}
pt = pt->next;
}
tmp->NodeID = NodeID;
tmp->DlMapIe_head = tmp->DlMapIe_tail = tmp2;
tmp2->next = NULL;
DlMapIe_link_tail->next = tmp;
DlMapIe_link_tail = tmp;
tmp->next = NULL;
return tmp2;
}
}

SearchUlMapIe(int NodeID)

UlMapIe_link* Mac802_16::SearchUlMapIe(int NodeID)
{//printf("start search ul %d\n",NodeID);
if(UlMapIe_link_head) {

UlMapIe_link *tmp = UlMapIe_link_head;
//printf("test %d\n",tmp->NodeID);

while (tmp) {
if(tmp->NodeID == NodeID) {

// printf("test2 %d\n",tmp->NodeID);

return tmp;
}
else
tmp = tmp->next;
}
}
//printf("test2 \n");
return NULL;
}

SearchDlMapIe(int NodeID)

DlMapIe_link* Mac802_16::SearchDlMapIe(int NodeID)
{
DlMapIe_link *tmp = DlMapIe_link_head;

while (tmp) {
if(tmp->NodeID == NodeID) {
return tmp;
}
else
tmp = tmp->next;
}
return NULL;
}

DlMapIe_link and UlMapIe_link

紀錄每個BS的DlMapIe
struct DlMapIe_link {
DlMapIe_link () {next = NULL;}
int NodeID;
DlMapIe *DlMapIe_head;
DlMapIe *DlMapIe_tail;
DlMapIe_link *next;
};

struct UlMapIe_link {
UlMapIe_link () {next = NULL;}
int NodeID;
UlMapIe *UlMapIe_head;
UlMapIe *UlMapIe_tail;
UlMapIe_link *next;
};

2007年3月11日 星期日

struct BsSsInfo_link

用來存每個BS自己的 BsSsInfo

struct BsSsInfo_link {
BsSsInfo_link() {next = NULL;}
BsSsInfo *BsSsInfo_head;
BsSsInfo *BsSsInfo_tail;
BsSsInfo_link *next;
};

frameTimer.start()

每個BS之間的FrameTimer start 不要在同一時間
會造成 接下來的行程大亂
差個0.1秒也好 還沒測試 每個BS之前的start 可以到多小差距

BsCreateFrameNumber(int NodeID)

創造 每個BS的 framenumber counter link list
void Mac802_16::BsCreateFrameNumber(int NodeID)
{
FrameNumber_Counters* tmp = new FrameNumber_Counters;

tmp->NodeID = NodeID;
tmp->Counter = 0;
if (!FrameNumber_Counter_head) {
FrameNumber_Counter_head = FrameNumber_Counter_tail = tmp;
}
else {
FrameNumber_Counter_tail->next = tmp;
FrameNumber_Counter_tail = tmp;
tmp->next = NULL;
}

}

BsSearchFrameNumber(int NodeID)

用來找尋 每個node的framenumber

FrameNumber_Counters* Mac802_16::BsSearchFrameNumber(int NodeID)
{
FrameNumber_Counters* tmp = FrameNumber_Counter_head;

while (tmp) {
if (tmp->NodeID == NodeID)
return tmp;
else tmp = tmp->next; }
return NULL;
}

struct FrameNumber_Counter

為了讓每個BS擁有自己的FrameNumber_Counter
所以用 link list 來紀錄每個BS的FrameNumber_Counter

struct FrameNumber_Counter {
FrameNumber_Counter(){next = NULL;}
int Counter
int NodeID;
FrameNumber_Counter *next;
};

2007年3月10日 星期六

IsBs(int NodeID)

用來檢查該Node是否為Bs

bool Mac802_16::IsBs(int NodeID)
{
if (NodeID %2 ==0)
return true;
return false;

}

修改標記

收到DCD 要作 signal判斷,決定是否要啟動handoff 或是 從無bs 服務 換到有bs服務
if(BsMac != -1 && mac->macSA() == BsMac && hdr->signal < T_signal)
{ if(SearchScanning_link(NodeID))
SearchScanning_link(NodeID)->scan = true;
else
CreateScanning_link(NodeID)->scan = true;
}
if(mac->macSA() == BsMac)
BsSignal = hdr->signal;
else if((mac->macSA() != BsMac && hdr->signal > BsSignal) || BsMac == -1) {
printf("Change BS to bs%d with signal %e,%e\n",mac->macSA(),hdr->signal,BsSignal);
BsMac = mac->macSA();
BsSignal = hdr->signal;
}


要作handoff之前,ss 需要去掃描目前可用的bs訊號
為了簡化這過程, 可以設計一個 global link,去紀錄每個ss現在是否在找尋新的bs訊號
這樣bs每次要傳送資料給ss之前,可以先查這個link ,看看該ss是否在找新的訊號
而ss部份,當進入找新訊號的階段時,每次接到ULMAP就丟掉,這樣就可以不用傳資料了
或許有queuing time問題,這個要等測試後才能確定

BS_Arr[]
BS 可以不用固定是某些數的倍數
可以使用上面這個array,先輸入哪些node 要成為BS

搜尋DlBurstProfile_head;的時候 目前要先固定搜尋BS 0,因為還沒有加入讓ss可以判斷使用那一個bs的功能

各種新建的head,tail
SsServiceFlow_link *SsSF_link_head;
SsServiceFlow_link *SsSF_link_tail;
BsSsInfo_link *BsSsInfo_link_head;
BsSsInfo_link *BsSsInfo_link_tail;
BsServiceFlow_link *BsSF_link_head;
BsServiceFlow_link *BsSF_link_tail;
DownlinkBurstProfile_link *DownlinkBurstProfile_link_head;
DownlinkBurstProfile_link *DownlinkBurstProfile_link_tail;
UplinkBurstProfile_link *UplinkBurstProfile_link_head;
UplinkBurstProfile_link *UplinkBurstProfile_link_tail;
UlMapIe_link *UlMapIe_link_head;
UlMapIe_link *UlMapIe_link_tail;
DlMapIe_link *DlMapIe_link_head;
DlMapIe_link *DlMapIe_link_tail;
AllocationStartTime_link *AllocationStartTime_link_head;
AllocationStartTime_link *AllocationStartTime_link_tail;
DlAvailSymbol_link *DlAvailSymbol_link_head;
DlAvailSymbol_link *DlAvailSymbol_link_tail;
UlAvailSymbol_link *UlAvailSymbol_link_head;
UlAvailSymbol_link *UlAvailSymbol_link_tail;
UlMapIeNum_link *UlMapIeNum_link_head;
UlMapIeNum_link *UlMapIeNum_link_tail;
DlMapIeNum_link *DlMapIeNum_link_head;
DlMapIeNum_link *DlMapIeNum_link_tail;


sendDSA-REQ :
不能讓BS 送給BS
目前先讓BS不能送出任何DSA-REQ

ULMAP 和DLMAP都需要每個BS建立一份
所以使用link list來存
SS在找尋ULMAP OR DLMAP時 需要確認現在要跟那一個BS通訊(未開發)

Mac802_16() : 裡面有一個 frameTimer.start(Bs_Counter*0.1); 這個原本是zero,但因為每個BS如果用同一個時間 ,將會造成行程大亂,所以要丟不同的值

FrameNumber_Counter 在2.02版裡面 因為只有一個BS 所以他只有一個FrameNumber_Counter
但是因為現在有多個BS,所以FrameNumber_Counter變成一個BS擁有自己一個
FrameNumber_Counter改為structure ,用link list串起來

BsID 改為 mac addr為2倍數都是Bs (0,2,4......)

長庚WiMAX NS2模組 運作流程

  1. BS broadcast DCD ,UCD
  2. SS收到DCD之後會去算出他對這個BS要使用哪一種編碼
  3. SS會對BS送出RNG-REQ
  4. BS收到RNG-REQ之後,會比對Ssinfo class是否有這個SS的資訊 ,如果沒有的話就建立該SS資訊
  5. BS回傳給SS RNG-RSP
  6. SS收到RNG-RSP之後,可以知道他可以使用的BasicCID 和PrimaryCID
  7. SS在我們設定的的traffic起始時間,會使用SsCreateServiceFlow建立sf
  8. SS建立sf之後,會送DSA-REQ給BS
  9. BS收到DSA-REQ之後,會先回送DSX-RVD通知SS,說明BS已經收到DSA-REQ
  10. BS會使用BsCreateServiceFlow來建立sf,此時會使用CallAdmissionControl來判斷是否可以建立這個sf,如果成功建立sf,會傳給SS一個DSA-RSP
  11. SS收到DSA-RSP之後,會回傳BS一個DSX-ACK
  12. SS開始傳送資料

CallAdmissionControl

這個函數 是用在建立service flow之前要檢查的項目
所以可以在 BsCreateServiceFlow這個函數中看到他的使用
長庚2.02版本中
把CallAdmissionControl這個函數內容移除了
可能是要留給使用者自己去設計
或是他們還在開發新的函數

Traffic 起始時間

traffic起始時間最好不要設在 0秒開始
因為要留時間給BS 和SS去作溝通
最好是設定在1 秒以後在開始

DSA-ACK

用來回應收到 DSA-RSP

SsServiceFlow

紀錄SS 要求的service flow資訊 有以下資訊
int MacAddr; 要求 sf的 ss macaddr
int DstMacAddr;sf 的終點macaddr
int SrcMacAddr; //sf起點macaddr
int TransactionID;
int TransportCID;
int BwReqSize;
int SFID; //Service Flow ID
int ScheduleType; //Service_Flow_Scheduling_Type
int MaxTrafficRate; //Maximum_Sustained_Traffic_Rate
int MinTrafficRate; //Minimum_Reserved_Traffic_Rate
int ToleratedJitter; //Tolerated_Jitter
int MaxLatency; //Maximum_Latency
int TrafficPriority; //Traffic_Priority
int ReqTxPolicy; //Request_Transmission_Policy
SfStatus Status; //QoS_Parameter_Set_Type
double QueueTime;
PacketQueue SduQueue;
PacketQueue PduQueue;
PacketQueue FragQueue;
SfDirection Direction;

DSX-RVD

BS用來回覆SS的 DSX-REQ告訴 SS已經收到DSX-REQ訊息
等BS建立好service flow之後(透過BsCreateServiceFlow)
BS會接著傳送DSX-RSP 來真正通知SS 相關參數

DSA-REQ

SS or BS都有可能送出此訊息
此訊息 用來建立 new service flow

RNG-REQ

當BS 收到RNG-REQ時
會使用BsSearchSsInfo 找尋 是否有這個SS的資訊
如果沒有 就使用 BsCreateSsInfo(p) 來建立這個SS的資訊
並且回傳RNG-RSP給SS

2007年3月8日 星期四

BsSearchSsInfo(rngreq->SS_MAC_Address, CID)

找尋 該address的相關資訊
如果後面參數是 -1 ,代表要確認是否有該address的資訊
如果前面參數是 -1,代表是要找尋該CID的資訊

改成802.16e 需要修改的程式部份

mac-801_16.cc :

sendRNGREQ(): mac->macDA() = BsID;
原始碼部份 只有一個BS 所以只需這樣設定
但是16e環境裡面有許多BS ,又RNGREQ是針對BS來發送的
所以必須想辦法 判斷 要傳送給哪一個特定BS

ULMAP_IE

ULMAP_IE 在 mac-802_16.cc : BandwidthManagement()被塞值

ulmapie->CID = 0xFFFF;
ulmapie->UIUC = 0xC;
這是代表 Ranging IE

BW Request IE 也是使用 ulmapie->UIUC = 0xC;

2007年3月6日 星期二

geographic

TOMAC class 使用Mod class來紀錄每個node的 x,y軸

Mod class用來紀錄每個node的 x,y軸
他裡面有一個函數叫ToMod(x,y) ,只要傳入一組x,y軸 就會計算出該組x,y距離該node的距離
並且回傳這組x,y跟該node可以使用那一種編碼

計算 BS 和SS 之間距離
並且判斷 在什麼距離內 要用哪一種編碼

NsObject

這個class 放在 common/object.h
WiMAX 有利用它的 recv()

WiMAX 2.02 - UCD DCD 傳送時間

每送完一百個frame 就送一次 UCD and DCD

WiMAX 2.02 新參數

FrameNumber_Counter : BS已經送出去的frame counter
NodeID : Node ID
DownlinkBurstProfile: 放在 packet-802_16.h

2007年3月4日 星期日

WiMAX 模組在TCL上面的使用方式

Real-time traffic 的呼叫方式 如下
[new Application/Traffic/UGS]
Nonreal-time traffic 的呼叫方式如下
[new Application/BE]

2007年3月2日 星期五

mac-802_16.cc

recv()
這個函數 裡面分成兩大部份運作: 從下層收到的封包,從上層收到的封包

ModulCoding = CalMod->search(NodeID)->ToMod(CalMod->search(0)->x,CalMod->search(0)->y);
這是用來呼叫function 去計算 SS 跟BS之間的距離 進而得知 要使用哪一種編碼

index_
: 是 ns2 裡面原本的mac.h 的變數 是代表MAC address

node id = 0 的Node 就是 BS ,需要作修改
可以用簡單的方式 就是 寫死 固定 二的倍數 或是三的倍數都是BS
複雜方式 就是要MAC 去認得誰是 BS 和 SS 這個方式比較花時間

BCID 是依照 BS 收到RNGREQ 的順序來分配
從 1 開始分配 一次增加一

SS編號是依據 在TCL上面建立node順序來分配
從 1 開始分配 一次增加一

if(creatid == 0) BS編號固定為zero ,為了要改成802.16e 需要讓mac認得多個BS
目前最簡單的方式就是讓BS編號 都為 2的倍數
{
if(channelSize_ == 10)
{
DL_subchannelNum_ = 30;
UL_subchannelNum_ = 35;
}
else if(channelSize_ == 20)
{
DL_subchannelNum_ = 60;
UL_subchannelNum_ = 92;
}

BS_UL_BW = UL_subchannelNum_;
BS_DL_BW = DL_symbolNum_;
Tmp_UL_BW = CAC_UL = BS_UL_BW;
FrameTimer.start(0);
}

if(creatid!=BSID) 因為設定成2倍數的node id 都是 BS 所以這邊要改成 creatid 不是2倍數
{
if(check_list->check(creatid)==0)
{
check_list->enque(creatid);
check_list->unlock(creatid);
ss_buf->enque(creatid);
Queue_list->enque(creatid);
sendRNGREQ(creatid);
}
}

2007年2月24日 星期六

一些常見的WiMAX所使用的縮寫

type/length/value (TLV): A formatting scheme that adds a tag to each transmitted parameter containing the parameter type (and implicitly its encoding rules) and the length of the encoded parameter.(引用原文)

UCD UIUC UL-MAP

BS 會固定週期 broadcast UCD

UCD 裡面會記載 每個UIUC相對的內容
以下這句是引用原文
"A Burst Descriptor shall be specified in the UCD for each UIUC to be used in the UL-MAP"

每個UL-MAP 裡面會有 多個UL-MAP-IE
UL-MAP-IE裡面會記載特定CID 相對的UIUC
這樣SS 就可以依照先前收到的UCD裡面記載UIUC所相對應的硬體資訊來作使用

2007年2月8日 星期四

源由

為何要弄這個 blog呢?
其實只是突發奇想......
因為現在正要弄畢業論文的模擬環境
正在研究 長庚大學資工系一位老師 所釋放出來的NS2模組
但是由於他目前所釋放出來的模組 是 802.16
沒有mobility 的功能
所以我必須去修改他...
所以想說把修改的地方貼上來
這樣可以讓自己知道 哪一天 改了哪些東西
大概就是這樣....