forked from oslo2015/NS2Tcl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ns2_cpp_info.txt
89 lines (61 loc) · 1.86 KB
/
ns2_cpp_info.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
classifier-wrrs 说明
定义
#define SWITCH_HOST 1
#define SWITCH_CORE 2
#define SWITCH_AGG 3
#define SWITCH_EDGE 4
#define SWITCH_NC -1
#define WRRS_OK 1
#define WRRS_ERROR 0
#define PODRR 1
#define HOSTRR 2
#define ONERR 3
class WRRSClassifier : public Classifier {
public :
WRRSClassifier();
~WRRSClassifier();
void recv(Packet* p, Handler*h);
virtual int classify(Packet *);
/// packet tag
void insertTag(int tag) {
packetTag.insertTable(tag);
}
void removeTag(int tag) {
packetTag.removeTable(tag);
}
void setNodeInfo(int podid, int inpodid, int type, int agg);
void setTagSection(int sec);
void setNodeType(int type) {NodeType = type;}
void printNodeInfo();
void initLast();
//void setRRSTD(int lastType);
protected:
virtual int command( int argc, const char*const* argv);
virtual int addrToPodId( int addr);
virtual int addrToSubnetId( int addr);
int fatTreeK( int k);
int schedule(int podid, int fid, int addr);
int nextWRR(int rrNum, int MOL);
/// packet tag
SearchTable packetTag;
private:
int NodeId;
int PodId;
int InPodId;
int NodeType;
int aggShift; /// edge使用该变量,记录该pod第一个agg switch的id。
int hostShift; /// host addr的偏移量,用于计算podId。(k决定)
int hostNumInPod; /// (k决定)
int eachSide; /// (k决定)
int *wrrLast; ///(k决定)
int fatK; ///(k决定)
int numForNotTag;
//bool podRR;
//bool hostRR;
//bool oneRR;
int RRNum;
};
判断node类型,
host, core, agg, edge, default。
agg和edge是会有多路径,其他都是采用默认的单路径传输。
所以,要设置单路径就将节点设置成default的就可以了。