Colorful SeaSon 的个人资料NS2 & SeaSon日志列表 工具 帮助
8月26日

层次地址的设定

在无线和有线网络的混合仿真中为了使数据包能在有线和无线网之间找到路由需要用

hierarchical 地址,hierarchical 地址分三层结构:

ABC

A:所处的网络地址

B:所处的子网地址

C:节点地址

2、设定网络的数量,即不同的A的数量

AddrParams set domain_num_ 5

设定网络数量为5,即上面图中从0~4

3、设定每个网络中子网的数量。要同下图的网络对应,即对应0的子网数量,1的子网数量...

lappend cluster_num 2 1 1 2 2

即设定:

网络号(A)

0

1

2

3

4

子网数量(B)

2

1

1

2

2

AddrParams set cluster_num_ $cluster_num

 

4、设定每个子网中节点的数量,也严格按照顺序

lappend eilastlevel 1 1 2 1 1 1 1 1

AddrParams set nodes_num_ $eilastlevel

顺序为对于不同的网络按照网络号由小到大,而相同的网络地址,按照子网号从小到大排序,然后按照排序结果顺序写出每个子网中节点的数量。如对应下图(单击看大图)的设定结果为

网络号(A)

          0

      1

   2

        3

       4

子网数量(B)

        2

     1

  1

        2

       2

子网节点数量

1

(0.0.0)

1

(0.1.0)

2

 (1.0.0  \1.0.1)

1

(2.0.0)

1

(3.0.0)

1

(3.1.0)

1

(4.0.0)

1

4.1.0)