ns2

construction of two different packet for a protocol / a simulation in NS2

让人想犯罪 __ 提交于 2020-01-25 12:21:21
问题 I am implementing a new protocol in NS2. I stucked at a point. kindly help me. Is it possible to make two different type of packets(containing different headers) in the same simulation In my protocol there are two types of struct header { } . At few instances i want to use one and at other instances want to use another.One of the structure has very less fields compared to other so this would reduce the size of packet i'm sending. Is it possible ? and if yes then how to implement that? 回答1:

how to set a node to sleep in ns2

不羁的心 提交于 2020-01-17 12:38:31
问题 I just want to set a node to sleep in ns-2 and i have searched in protocols and i found a lot of objects and functions about sleep but i couldn't use them in other protocols to set a node to sleep. when i use them i get Segmentation fault or Floating point and i know what these errors mean but i can't find a way to solve them. Like when i use sleep() function from SMAC. I have searched in google and after a week i still didn't find any solution...! could you guys please help me here...? 回答1:

how to set a node to sleep in ns2

谁说胖子不能爱 提交于 2020-01-17 12:38:18
问题 I just want to set a node to sleep in ns-2 and i have searched in protocols and i found a lot of objects and functions about sleep but i couldn't use them in other protocols to set a node to sleep. when i use them i get Segmentation fault or Floating point and i know what these errors mean but i can't find a way to solve them. Like when i use sleep() function from SMAC. I have searched in google and after a week i still didn't find any solution...! could you guys please help me here...? 回答1:

How to add timer in aodv using ns2

旧城冷巷雨未停 提交于 2020-01-17 02:58:05
问题 At aodv When the node receive route request it will check if it has valid route to the destination, if it has no valid route it will rebroadcast the route request. I want to add timer before the node rebroadcast the route request.During the timer time if the node receive RREQ with the same ID (that means the node receive the RREQ twice ) then discard the RREQ otherwise rebroadcast the RREQ. I don’t know how to write the code of this part. The code of timer 1. The timer was defined in aodv.h

Segmentation fault after running vectore based forwarding protocol in aqua-sim

微笑、不失礼 提交于 2020-01-06 04:45:20
问题 can someone please help me trace this error, i'm using vector based forwarding protocol tcl example on 400 nodes and i got this error UWSink (id:0): I get the packet data no.0 from 378 SK 0: Num_Recv 412, InterArrival 0.298128 UWSink (id:0): I get the packet data no.11 from 262 SK 0: Num_Recv 413, InterArrival 0.057902 UWSink (id:0): I get the packet data no.4 from 79 SK 0: Num_Recv 414, InterArrival 0.368108 UWSink (id:0): I get the packet data no.10 from 79 SK 0: Num_Recv 415, InterArrival

Spring Boot SOAP Webservice例子

岁酱吖の 提交于 2019-12-28 00:47:26
前言 本文将学习如何利用Spring boot快速创建SOAP webservice服务; 虽然目前REST和微服务越来越流行,但是SOAP在某些情况下,仍然有它的用武之地; 在本篇 spring boot SOAP教程中,我们会专注于和Spring boot相关的配置,感受下在Spring Boot中,创建SOAP webservice是如何的简便、快速; 本文将以一个"学生搜索"这个小功能作为示例,演示Spring Boot中SOAP webservice的创建过程; 技术栈 JDK 1.8, Eclipse, Maven – 开发环境 Spring-boot – 基础开发框架 wsdl4j – 发布WSDL SOAP-UI – 测试服务 JAXB maven plugin - 代码生成 工程结构 本工程的代码及文件目录结构如下 创建Spring Boot工程 访问 SPRING INITIALIZR 网站,添加 Web Services 依赖,输入 maven 的GAV 坐标,点击下载工程,下载完成后解压导入IDE即可; 修改 pom.xml 文件,添加Wsdl4j依赖: <dependency> <groupId>wsdl4j</groupId> <artifactId>wsdl4j</artifactId> </dependency> 创建SOAP

Tcl can't read variable: no such variable

戏子无情 提交于 2019-12-24 13:48:07
问题 The following piece of code produces the error: can't read "n": no such variable while executing "$ns duplex-link $n$i $n([expr ($i+1)%120]) 1Mb 10ms DropTail" ("for" body line 2) invoked from within "for {set i 7} {$i < 120} {incr i} { $ns duplex-link $n$i $n([expr ($i+1)%120]) 1Mb 10ms DropTail }" (file "multicast.tcl" line 44) it seems $n$i is not evaluated to the required format of $n7 etc. Any help in the solution is much appreciated. for {set i 0} {$i < 120} {incr i} { set n$i "[$ns

ns2 cannot connect to existing nam instance

旧城冷巷雨未停 提交于 2019-12-24 07:37:13
问题 I'm trying to run the below code using nam. set ns [new Simulator] set nf [open lab1.nam w] $ns namtrace-all $nf set f [open lab1.tr w] proc record {} { global sink f set ns [Simulator instance] set time 0.12 set bw [$sink set bytes_] set now [$ns now] puts $f "$now [expr (($bw/$time)*8/1000000)]" $sink set bytes_ 0 $ns at [expr $now+$time] "record" } proc finish {} { global ns nf f $ns flush-trace close $nf close $f exit 0 } set n0 [$ns node] set n1 [$ns node] $ns duplex-link $n0 $n1 4Mb

make command not working in NS 2.35

最后都变了- 提交于 2019-12-23 02:32:22
问题 I am trying to modify AODV routing protocol using NS 2.35. I have made some changes to the files aodv.cc and aodv.h. Now, to apply these changes I have run a make command inside ns-allinone-2.35/ns-2.35 folder and getting the following error message: In file included from aodv/aodv_logs.cc:31:0: ./aodv/aodv.h:53:18: fatal error: list.h: No such file or directory #include <list.h> ^ compilation terminated. make: *** [aodv/aodv_logs.o] Error 1 How will I solve this? 回答1: #include <list.h> is

Creating random wired topology for given arbitrary number of nodes on NS2

安稳与你 提交于 2019-12-23 02:05:12
问题 I want to create and simulate a wired topology using NS2. Trying to write a tcl and positioning the nodes and links using rand() . My solution was: ### Create a simulator object set ns [new Simulator] set num_node 10 set num_flow 5 set x_dim 150 set y_dim 150 ### Define different colors for data flows (for NAM) $ns color 1 Blue $ns color 2 Red ### Open the NAM trace file set nf [open out.nam w] $ns namtrace-all $nf set tracefd [open out.tr w] $ns trace-all $tracefd ### set up topography