在Ubuntu 16.04的NS2.35中添加DYMO协议并查找相关tcl&&awk文件
Hey there! Let’s walk through how to add the DYMO protocol to NS2.35 on Ubuntu 16.04, plus track down related Tcl/Awk files and existing work that can save you time. Here’s what you need to know:
NS2.35 doesn’t include DYMO out of the box, so we’ll need to integrate a third-party implementation or patch.
Step 1: Set Up Prerequisites
First, install all the tools required to compile NS2 and the DYMO extension. Run this in your terminal:
sudo apt-get update && sudo apt-get install gcc g++ make libx11-dev libxt-dev libxmu-dev
If you don’t already have NS2.35, download the ns-allinone-2.35.tar.gz source package, extract it, and navigate to the extracted directory:
tar xvf ns-allinone-2.35.tar.gz cd ns-allinone-2.35
Step 2: Integrate the DYMO Implementation
Most folks use a pre-built patch for NS2.35 (targeted at RFC 4728-compliant DYMO). Here’s how to apply it:
- Download the DYMO patch file (common in academic repositories or community NS2 extensions).
- Navigate to the NS2 core directory:
cd ns-2.35 - Apply the patch:
patch -p1 < /path/to/your/dymo-patch-file.patch
If no patch is available, you’ll need to manually add DYMO’s source files:
- Create a
dymo/subdirectory inns-2.35/route/and add the.ccand.hfiles for the DYMO agent, routing table, and message handlers. - Modify
ns-2.35/Makefile.into include these files in the compilation: add entries likeroute/dymo/dymo_agent.oandroute/dymo/dymo_rtable.oto theOBJ_CClist.
Step 3: Compile NS2 with DYMO
Head back to the ns-allinone-2.35 directory and start the installation:
cd .. ./install
If you hit compilation errors (common with Ubuntu 16.04’s GCC 5.x), tweak the Makefile to use C++03 compatibility: add -std=c++03 to the CXXFLAGS line in ns-2.35/Makefile.
To verify the installation works, launch NS2 and test creating a DYMO agent:
cd ns-2.35 ./ns
In the NS2 shell, run:
set dymo_agent [new Agent/DYMO]
If no error pops up, DYMO is successfully integrated!
Once DYMO is set up, here’s where to find (or create) supporting scripts:
- Tcl Files:
- Core DYMO Tcl bindings live in
ns-2.35/tcl/lib/(look forns-dymo.tcl), which defines commands to configure DYMO parameters (hello intervals, max hop counts, etc.). - Example simulation scripts are often included with the DYMO patch—check for
dymo-test.tclor similar inns-2.35/tcl/ex/or a dedicatedexamples/directory from the patch.
- Core DYMO Tcl bindings live in
- Awk Files:
- Pre-built Awk scripts for analyzing DYMO trace data (packet delivery ratio, end-to-end delay, routing overhead) are usually bundled with the implementation. Look for files like
dymo-stat.awkalongside the Tcl examples. - You can also modify NS2’s default stats scripts (e.g.,
ns-2.35/bin/stat-awk) to parse DYMO-specific trace events (like route discovery requests or updates).
- Pre-built Awk scripts for analyzing DYMO trace data (packet delivery ratio, end-to-end delay, routing overhead) are usually bundled with the implementation. Look for files like
You don’t have to build everything from scratch—here’s what’s already out there:
- Academic Implementations: Many graduate theses and research papers include full DYMO implementations for NS2.35, complete with test scripts and performance analysis tools. These often target RFC 4728 (DYMOv1), but some newer ones support RFC 7278 (DYMOv2).
- Community Contributions: Open-source projects (like GitHub repos focused on NS2 extensions) have pre-packaged DYMO modules for NS2.35, with step-by-step installation guides and ready-to-run simulation scenarios.
- Standard Compliance: Be mindful of version differences—most legacy DYMO implementations for NS2 are v1, so if you need DYMOv2, you’ll need to seek out more recent community or academic work.
内容的提问来源于stack exchange,提问作者abdelmadjid amri

