Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save egaviriarestrepo/21bdd02bcee0f4681217ea2d28785d3b to your computer and use it in GitHub Desktop.
Save egaviriarestrepo/21bdd02bcee0f4681217ea2d28785d3b to your computer and use it in GitHub Desktop.

Revisions

  1. Mohammad Shokri revised this gist Oct 28, 2017. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions ns2-olsr-ubuntu-xenial.md
    Original file line number Diff line number Diff line change
    @@ -15,22 +15,20 @@ Extract NS2 & put it in Home:
    ```bash
    cd ~
    tar xzvf ~/Downloads/ns-allinone-2.35.tar.gz
    mv ~/Downloads/ns-allinone-2.35 ~/
    ```

    Extract UM-OLSR & put it in NS2:
    ```bash
    tar xzvf ~/Downloads/um-olsr-1.0.tgz
    # Move UM-OLSR into NS2 & Reanme it to "olsr"
    mv ~/Downloads/um-olsr-1.0 ~/ns-allinone-2.35/ns2/olsr
    mv ~/um-olsr ~/ns-allinone-2.35/ns-2.35/olsr
    ```

    * * *

    # APT
    Install Required Packages:
    ```bash
    sudo apt install -Vy emacs unrar
    sudo apt install -Vy build-essential autoconf automake gcc
    sudo apt install -Vy xorg-dev tcl-dev tk-dev perl xgraph libxt-dev libx11-dev libxmu-dev
    ```
    @@ -45,7 +43,7 @@ cd ~/ns-allinone-2.35/
    # File LinkStat
    # Line 137
    gedit ns-2.35/linkstate/ls.h +137
    # Change "erase" to "this->erase"
    # Change "erase" to "this->erase", Save and Exist GEdit
    ```

    * * *
  2. Mohammad Shokri revised this gist Jul 12, 2017. 1 changed file with 15 additions and 8 deletions.
    23 changes: 15 additions & 8 deletions ns2-olsr-ubuntu-xenial.md
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    #### Upgrade Ubuntu ####################################
    # Upgrade Ubuntu
    ```bash
    sudo apt update
    sudo apt upgrade -Vy
    ```

    * * *

    #### Prepare NS2 #######################################
    # Download NS2
    Download NS2 & OLSR:
    - [NS2-AllInOne 2.35](https://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.35/)
    - [UM-OLSR](https://sourceforge.net/projects/um-olsr/files/um-olsr/1.0/)
    @@ -27,7 +27,7 @@ mv ~/Downloads/um-olsr-1.0 ~/ns-allinone-2.35/ns2/olsr

    * * *

    #### APT ###############################################
    # APT
    Install Required Packages:
    ```bash
    sudo apt install -Vy emacs unrar
    @@ -37,7 +37,7 @@ sudo apt install -Vy xorg-dev tcl-dev tk-dev perl xgraph libxt-dev libx11-dev li

    * * *

    #### Prepare Source Code ###############################
    # Prepare NS2 Source Code

    ```bash
    cd ~/ns-allinone-2.35/
    @@ -50,18 +50,25 @@ gedit ns-2.35/linkstate/ls.h +137

    * * *

    #### Apply OLSR Patch #################################

    # Prepare OLSR Source Code
    Apply OLSR Patch:
    ```bash
    cd ns-2.35/
    patch -p1 < olsr/um-olsr_ns-2.35_v1.0.patch
    cd ..
    ```

    * * *

    # Install
    Install NS2 & OLSR:
    ```bash
    ./install
    ```

    * * *

    ##### Configure Bash Path #############################
    # Configure Bash Path
    Put these lines at the end of `~/.bashrc` file:
    ```bash
    gedit ~/.bashrc
    @@ -90,7 +97,7 @@ export PATH="$XGRAPH:$NS:$NAM:$PATH"

    * * *

    ##### Done! ###########################################
    # Done!
    Run NS2:
    ```bash
    ns ~/path/to/file.tk
  3. Mohammad Shokri revised this gist Jul 12, 2017. 1 changed file with 15 additions and 2 deletions.
    17 changes: 15 additions & 2 deletions ns2-olsr-ubuntu-xenial.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,11 @@
    #### Update Ubuntu ####################################
    #### Upgrade Ubuntu ####################################
    ```bash
    sudo apt update
    sudo apt upgrade -Vy
    ```

    * * *

    #### Prepare NS2 #######################################
    Download NS2 & OLSR:
    - [NS2-AllInOne 2.35](https://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.35/)
    @@ -23,6 +25,8 @@ tar xzvf ~/Downloads/um-olsr-1.0.tgz
    mv ~/Downloads/um-olsr-1.0 ~/ns-allinone-2.35/ns2/olsr
    ```

    * * *

    #### APT ###############################################
    Install Required Packages:
    ```bash
    @@ -31,6 +35,8 @@ sudo apt install -Vy build-essential autoconf automake gcc
    sudo apt install -Vy xorg-dev tcl-dev tk-dev perl xgraph libxt-dev libx11-dev libxmu-dev
    ```

    * * *

    #### Prepare Source Code ###############################

    ```bash
    @@ -42,6 +48,8 @@ gedit ns-2.35/linkstate/ls.h +137
    # Change "erase" to "this->erase"
    ```

    * * *

    #### Apply OLSR Patch #################################

    ```bash
    @@ -51,12 +59,15 @@ cd ..
    ./install
    ```

    * * *

    ##### Configure Bash Path #############################
    Put these lines in `~/.bashrc` file:
    Put these lines at the end of `~/.bashrc` file:
    ```bash
    gedit ~/.bashrc
    ```

    Replace `madooga` with your username(`whoami`):
    ```bash
    ##### NS2 ####
    # LD_LIBRARY_PATH
    @@ -77,6 +88,8 @@ NAM="/home/madooga/ns-allinone-2.35/nam-1.15"
    export PATH="$XGRAPH:$NS:$NAM:$PATH"
    ```

    * * *

    ##### Done! ###########################################
    Run NS2:
    ```bash
  4. Mohammad Shokri revised this gist Jul 12, 2017. 1 changed file with 45 additions and 20 deletions.
    65 changes: 45 additions & 20 deletions ns2-olsr-ubuntu-xenial.md
    Original file line number Diff line number Diff line change
    @@ -1,44 +1,63 @@
    #### Links #############################################
    #### Update Ubuntu ####################################
    ```bash
    sudo apt update
    sudo apt upgrade -Vy
    ```

    #### Prepare NS2 #######################################
    Download NS2 & OLSR:
    - [NS2-AllInOne 2.35](https://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.35/)
    - [UM-OLSR](https://sourceforge.net/projects/um-olsr/files/um-olsr/1.0/)

    #### APT ###############################################
    Extract NS2 & put it in Home:
    ```bash
    cd ~
    tar xzvf ~/Downloads/ns-allinone-2.35.tar.gz
    mv ~/Downloads/ns-allinone-2.35 ~/
    ```

    Extract UM-OLSR & put it in NS2:
    ```bash
    sudo apt install -V emacs unrar
    sudo apt install -V build-essential autoconf automake gcc
    sudo apt install -V xorg-dev tcl-dev tk-dev perl xgraph libxt-dev libx11-dev libxmu-dev
    tar xzvf ~/Downloads/um-olsr-1.0.tgz
    # Move UM-OLSR into NS2 & Reanme it to "olsr"
    mv ~/Downloads/um-olsr-1.0 ~/ns-allinone-2.35/ns2/olsr
    ```

    #### SRC ###############################################
    #### APT ###############################################
    Install Required Packages:
    ```bash
    sudo apt install -Vy emacs unrar
    sudo apt install -Vy build-essential autoconf automake gcc
    sudo apt install -Vy xorg-dev tcl-dev tk-dev perl xgraph libxt-dev libx11-dev libxmu-dev
    ```

    #### Prepare Source Code ###############################

    ```bash
    # LinkStat
    gedit ~/ns-allinone-2.35/ns-2.35/linkstate/ls.h +137
    change "erase" to "this->erase"
    cd ~/ns-allinone-2.35/

    # GCC
    #gedit ~/ns-allinone-2.35/otcl-1.14/Makefile.in +7
    #change "CC= @CC@" to "CC=gcc-4.4"
    # File LinkStat
    # Line 137
    gedit ns-2.35/linkstate/ls.h +137
    # Change "erase" to "this->erase"
    ```

    #### OLSR ###############################################
    #### Apply OLSR Patch #################################

    ```bash
    cd ~/ns-allinone-2.35/ns-2.35/
    cd ns-2.35/
    patch -p1 < olsr/um-olsr_ns-2.35_v1.0.patch
    cd ..
    ./install
    #cd ns-2.35/
    #./configure
    #make
    #cp ns ns-olsr
    ```

    ######## Bash #########################################

    ##### Configure Bash Path #############################
    Put these lines in `~/.bashrc` file:
    ```bash
    gedit ~/.bashrc
    ```

    ```bash
    ##### NS2 ####
    # LD_LIBRARY_PATH
    OTCL_LIB="/home/madooga/ns-allinone-2.35/otcl-1.14"
    @@ -57,3 +76,9 @@ NS="/home/madooga/ns-allinone-2.35/ns-2.35"
    NAM="/home/madooga/ns-allinone-2.35/nam-1.15"
    export PATH="$XGRAPH:$NS:$NAM:$PATH"
    ```

    ##### Done! ###########################################
    Run NS2:
    ```bash
    ns ~/path/to/file.tk
    ```
  5. Mohammad Shokri revised this gist Jun 23, 2017. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions ns2-olsr-ubuntu-xenial.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    #### Links #############################################
    - [NS2-AllInOne 2.35](https://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.35/)
    - [UM-OLSR](https://sourceforge.net/projects/um-olsr/files/um-olsr/1.0/)

    #### APT ###############################################

    ```bash
  6. Mohammad Shokri revised this gist Jun 23, 2017. 1 changed file with 26 additions and 26 deletions.
    52 changes: 26 additions & 26 deletions ns2-olsr-ubuntu-xenial.md
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,36 @@
    #### APT ###############################################

    ```bash
    sudo apt install -V vim emacs unrar
    sudo apt install -V emacs unrar
    sudo apt install -V build-essential autoconf automake gcc
    sudo apt install -V xorg-dev tcl-dev tk-dev perl xgraph libxt-dev libx11-dev libxmu-dev
    ```

    #### SRC ###############################################

    ```bash
    # LinkStat
    gedit ~/ns-allinone-2.35/ns-2.35/linkstate/ls.h +137
    change "erase" to "this->erase"

    # GCC
    #gedit ~/ns-allinone-2.35/otcl-1.14/Makefile.in +7
    #change "CC= @CC@" to "CC=gcc-4.4"
    ```

    #### OLSR ###############################################

    ```bash
    cd ~/ns-allinone-2.35/ns-2.35/
    patch -p1 < olsr/um-olsr_ns-2.35_v1.0.patch
    cd ..
    ./install
    #cd ns-2.35/
    #./configure
    #make
    #cp ns ns-olsr
    ```

    ######## Bash #########################################

    ```bash
    @@ -28,28 +53,3 @@ NS="/home/madooga/ns-allinone-2.35/ns-2.35"
    NAM="/home/madooga/ns-allinone-2.35/nam-1.15"
    export PATH="$XGRAPH:$NS:$NAM:$PATH"
    ```

    #### SRC ###############################################

    ```bash
    # LinkStat
    gedit ~/ns-allinone-2.35/ns-2.35/linkstate/ls.h +137
    change "erase" to "this->erase"

    # GCC
    gedit ~/ns-allinone-2.35/otcl-1.14/Makefile.in +7
    change "CC= @CC@" to "CC=gcc-4.4"
    ```

    #### OLSR ###############################################

    ```bash
    cd ~/ns-allinone-2.35/ns-2.35/
    patch -p1 < olsr/um-olsr_ns-2.35_v1.0.patch
    cd ..
    ./install
    cd ns-2.35/
    ./configure
    make
    cp ns ns-olsr
    ```
  7. Mohammad Shokri revised this gist Jun 23, 2017. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions ns2-olsr-ubuntu-xenial.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,8 @@
    #### APT ###############################################

    ```bash
    sudo apt install -V vim emacs unrar meld
    sudo apt install -V build-essential autoconf automake
    sudo apt install -V gcc
    sudo apt install -V vim emacs unrar
    sudo apt install -V build-essential autoconf automake gcc
    sudo apt install -V xorg-dev tcl-dev tk-dev perl xgraph libxt-dev libx11-dev libxmu-dev
    ```

  8. Mohammad Shokri revised this gist Jun 23, 2017. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion ns2-olsr-ubuntu-xenial.md
    Original file line number Diff line number Diff line change
    @@ -8,9 +8,9 @@ sudo apt install -V xorg-dev tcl-dev tk-dev perl xgraph libxt-dev libx11-dev lib
    ```

    ######## Bash #########################################
    gedit ~/.bashrc

    ```bash
    gedit ~/.bashrc
    ##### NS2 ####
    # LD_LIBRARY_PATH
    OTCL_LIB="/home/madooga/ns-allinone-2.35/otcl-1.14"
    @@ -32,13 +32,15 @@ export PATH="$XGRAPH:$NS:$NAM:$PATH"

    #### SRC ###############################################

    ```bash
    # LinkStat
    gedit ~/ns-allinone-2.35/ns-2.35/linkstate/ls.h +137
    change "erase" to "this->erase"

    # GCC
    gedit ~/ns-allinone-2.35/otcl-1.14/Makefile.in +7
    change "CC= @CC@" to "CC=gcc-4.4"
    ```

    #### OLSR ###############################################

  9. Mohammad Shokri created this gist Jun 23, 2017.
    54 changes: 54 additions & 0 deletions ns2-olsr-ubuntu-xenial.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,54 @@
    #### APT ###############################################

    ```bash
    sudo apt install -V vim emacs unrar meld
    sudo apt install -V build-essential autoconf automake
    sudo apt install -V gcc
    sudo apt install -V xorg-dev tcl-dev tk-dev perl xgraph libxt-dev libx11-dev libxmu-dev
    ```

    ######## Bash #########################################
    gedit ~/.bashrc

    ```bash
    ##### NS2 ####
    # LD_LIBRARY_PATH
    OTCL_LIB="/home/madooga/ns-allinone-2.35/otcl-1.14"
    NS2_LIB="/home/madooga/ns-allinone-2.35/lib"
    USR_LOCAL_LIB="/usr/local/lib"
    export LD_LIBRARY_PATH="$OTCL_LIB:$NS2_LIB:$USR_LOCAL_LIB:$LD_LIBRARY_PATH"

    # TCL_LIBRARY
    TCL_LIB="/home/madooga/ns-allinone-2.35/tcl8.5.10/library"
    USR_LIB="/usr/lib"
    export TCL_LIBRARY="$TCL_LIB:$USR_LIB:$TCL_LIBRARY"

    # PATH
    XGRAPH="/home/madooga/ns-allinone-2.35/bin:/home/madooga/ns-allinone-2.35/tcl8.5.10/unix:/home/madooga/ns-allinone-2.35/tk8.5.10/unix"
    NS="/home/madooga/ns-allinone-2.35/ns-2.35"
    NAM="/home/madooga/ns-allinone-2.35/nam-1.15"
    export PATH="$XGRAPH:$NS:$NAM:$PATH"
    ```

    #### SRC ###############################################

    # LinkStat
    gedit ~/ns-allinone-2.35/ns-2.35/linkstate/ls.h +137
    change "erase" to "this->erase"

    # GCC
    gedit ~/ns-allinone-2.35/otcl-1.14/Makefile.in +7
    change "CC= @CC@" to "CC=gcc-4.4"

    #### OLSR ###############################################

    ```bash
    cd ~/ns-allinone-2.35/ns-2.35/
    patch -p1 < olsr/um-olsr_ns-2.35_v1.0.patch
    cd ..
    ./install
    cd ns-2.35/
    ./configure
    make
    cp ns ns-olsr
    ```