Kang's profile乱七八糟PhotosBlogLists Tools Help

乱七八糟

一堆乱七八糟的游记,食谱,电影,生活,等等等等
April 11

How to run NS-2 on Windows

NS-2 cannot directly run on Windows. However, what we can do is:

1. Download Sun VirtualBox which is a virtual pc supports many OSs.

link: http://www.virtualbox.org/wiki/Downloads, choose VirtualBox 2.x.x for Windows hosts.

After downloaded, install it.  The OS in your computer is called HOST OS, and the OS in VirtualBox is a GUEST OS.

image

Run VirtualBox,, click new to create a new virtual PC (VPC). Type a name you like. Choose Operating System to Linux, and Version is Ubuntu.

image

Now, set the memory size of your VPC. You can use default memory size or set your own. Remember to leave enough memory to your host OS.

image

Next, create a virtual hard disk, click new to create a new one, choose “fixed-size storage” to get better performance. Make sure you have enough disk space. The virtual hard disk actually is a file in your real hard disk. You can reuse it in the future.

image 

2. Download Ubuntu

Open you browser and go to : http://www.ubuntu.com/getubuntu/download to download Ubuntu. It is an ISO file.

3. Install Ubuntu into VirtualBox

In VirtualBox, select the VPC you just created, then click “setting”. In CD/DVD-ROM setting, mount the Ubuntu ISO file .

image

Save your setting and “Start” your VPC.  Press F12 to select your boot device and choose boot from cd-rom. It will load Ubuntu installation program for the VPC.  It takes some time to install Ubuntu. After the installation is finished, you have a Linux OS in your computer.

From here, we need to do all tasks in the VPC Ubuntu environment.

4. Install NS-2

Start the Ubuntu VPC. In the VPC, open firefox and go to http://sourceforge.net/project/showfiles.php?group_id=149743&package_id=169689&release_id=588643 to download NS-2 all-in-one. It includes Tcl, Otcl, NS, Nam, Xgraph and many other programs. The downloaded filename is  ns-allinone-2.33.tar.gz.

Copy the gz file into your home directory /home/XXXXXXXXX, XXXXXXXXX is your linux username.

Open a terminal window and run :

tar svfz ./ns-allinone-2.33.tar.gz

cd ns-allinone-2.33.tar.gz

sudo apt-get install build-essential autoconf automake libxmu-dev

then start to install NS-2 using:

./install

It takes some time to install it.

then set environment by editing ~/.bashrc file.

Add following sentences into bashrc file.

# LD_LIBRARY_PATH
OTCL_LIB=/home/xxxxx/ns-allinone-2.33/otcl-1.13
NS2_LIB=/home/xxxxx/ns-allinone-2.33/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB

# TCL_LIBRARY
TCL_LIB=/home/xxxxx/ns-allinone-2.33/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/home/xxxxx/ns-allinone-2.33/bin:/home/xxxxx/ns-allinone-2.33/tcl8.4.18/unix:/home/xxxxx/ns-allinone-2.33/tk8.4.18/unix
NS=/home/xxxxx/ns-allinone-2.33/ns-2.33/
NAM=/home/xxxxx/ns-allinone-2.33/nam-1.13/
PATH=$PATH:$XGRAPH:$NS:$NAM

 

image

It is almost finished but remember:  Reboot your VPC

After rebooting, open a terminal window, go to ns-2 directory and run “ns”. If you get a “%”prompt, congratulation! NS-2 is working.

image

If you get something like:

Usage: host [-v] [-a] [-t querytype] [options] name [server]
Listing: host [-v] [-a] [-t querytype] [options] -l zone [server]
Hostcount: host [-v] [options] -H [-D] [-E] [-G] zone

goto ~usr/bin to delete the ns command.


If you get

The program 'ns' is currently not installed. You can install it by typing:
sudo apt-get install host  (don't do this)
Make sure you have the 'universe' component enabled
bash: ns: command not found
Do not do “sudo apt-get install host”. 
Go back to check your environment setting in ~/bashrc file and reboot your VPC.

April 10

洪水,洪水

半年的寒冬已过,寒冷的Winnipeg有了些许暖意。 温度上升到了零度左右,覆盖Winnipeg的积雪开始融化。

随之而来的恶果就是。。。洪水。据报道,今年Winnipeg的洪水是罕见的,已经接近了百年难遇的程度。

乘Bus去学校的路上,会经过河边,看见河水几乎就和路面平齐。于是,心中默念,再涨一点,再涨一点就不用考试了。。。

今日路过河边,顺便拍了几张照片。

BDI旁边的桥,平时的水位至少比现在低2米。

 IMG_0299

夕阳西下,好宽的河面。

IMG_0301

水流很急,还夹杂着浮冰。

IMG_0305

IMG_0310

最后来一张。。。Winnipeg的名店之一BDI,夏日的傍晚,这里可是人山人海。即使是依旧寒冷的现在,大家也排队购买。

IMG_0311

March 22

忙啊忙,真是忙

怎么就这么忙呢?

Deadline无穷无尽

3月13,3月18,3月22,3月24, 3月25,4月2,4月20

还有3,4个未知

。。。。。。。

继续忙去了

January 26

最近想看的几部电影

1,赤壁(下),看过了上,不看下毕竟有点说不过去。
2,疯狂的赛车,评价很高,石头风格。
3,家有喜事2009,前两部都是非常搞笑的经典。
4,游龙戏凤。。。
呃,忘了一个,编辑一下
 
5,喜羊羊和灰太郎 之 牛气冲天
December 05

换个模板,准备继续。

 
 
好久没有更新Space,最近准备继续更新,换个模板,也许会好看一点。
 

Kang Shi

Custom HTML

Photo 1 of 55