Bắt đầu từ việc sử dụng một script đã có

Đối với những users  trải nghiệm nhiều với NS3, họ sẽ xây dựng script mô phỏng mới từ khởi đầu. Hầu hết các user mới sử dụng copy/paste một existing script có sẵn các mô hình mô phỏng họ cần và sau đó hiệu chỉnh nó cho tới khi đạt yêu cầu mong muốn của họ.  Tham khảo thêm các  extensive example scripts đi cùng mỗi module.

Xây dựng một script C++

Once you have identified which simulation script you would like to start from, building a modified version of this script is a matter of dropping it in the scratch directory and running waf again:

cp examples/csma/csma-broadcast.cc scratch/csma-modified.cc
./waf

Running a new script which was dropped in the scratch directory is similar to running other examples.

Building many C++ files

If your simulation script becomes complex and if you split it in more than one C++ source file, you need to create a new sub-directory in the scratch directory:

mkdir scratch/modified
cp x.cc scratch/modified
cp y.cc scratch/modified
./waf 

This will build a new program named after the name of your sub-directory (modified here) and you can run it just like any other example:

./waf --run modified