因为要搞水下网络,OMNET++不太合适,就转Aqua-sim。这是基于NS-2上的模型,NS-2需要额外学一门tcl脚本语言。
正好查到它的一个升级版Aqua-sim-NG,在github上,https://github.com/rmartin5/aqua-sim-ng是基于NS-3的,只需要基本的C++,不用学tcl语言。美滋滋。
装好ubuntu之后,安装NS-3和Aqua-sim。
注意:NS-3安装前有一下依赖包,需要安装。
NS-3安装教程:https://blog.csdn.net/rical730/article/details/71504169
https://blog.csdn.net/xiao_sheng_jun/article/details/83628692
http://134.74.112.6/mediawiki/index.php/Install_and_run_Aqua-Sim-NG_code
建议bake查看NS-3的依赖,(也可以使用他安装)
开始提示我没有 Cmake 安装教程 :https://www.cnblogs.com/photo520/p/9486144.html
最后一步出错,提示intall fail 教程:https://blog.csdn.net/u010668907/article/details/50000527/
ubuntu解压+安装+卸载
sudo dpkg -i [deb文件名] sudo apt-get install -f 依赖关系错误,修复安装 sudo dpkg -l 查看已经安装的软件 sudo dpkg -r [软件名] 卸载
NS-3入门:https://www.nsnam.org/docs/release/3.29/tutorial/html/getting-started.html
Aqua-sim-ng的入门程序----【broadcastMAC_example】
文件在 aquasim-ng/examples文件夹下的 broadcastMAC_example
源代码:
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ /* * Copyright (c) 2016 University of Connecticut * * 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 * * Author: Robert Martin <robert.martin@engr.uconn.edu> */ #include "ns3/core-module.h" #include