2014年1月4日 星期六

Patch NS2 to Support UMTS

Patch NS2 to Support UMTS(3G)
1. Download EURANE module file
    go to http://eurane.ti-wmc.nl/
    ex. ns-2.30_eurane-1.12.diff.gz
    if your ns2 version is 2.35, patch file in here(ns-2.35_eurane-1.12.diff).[1]
2. Decompress EURANE module file to ns2's home directory
3. run patch
  Change directory to ns2's home directory
  $  patch -p1 < ns-2.30_eurane-1.12.diff  <enter>
4. make or install
5. Download testscripts from http://eurane.ti-wmc.nl/
    ex.test_tcp.tcl (need idealtrace and SNRBLERMatrix.gz files)
6. run ns

ps1. If it have some problem,you modified some file by yourself.
[Makefile.in]
-CCOPT  = @V_CCOPT@
+CCOPT  = -Wall @V_CCOPT@

        apps/pbc.o \
+       umts/am.o umts/classifier-sport.o umts/demuxer.o \
+       umts/demuxerRtModule.o  umts/networkInterface.o \
+       umts/nif-classifier.o  umts/tcs.o umts/um.o \
+       umts/umtslink.o umts/umtstrace.o \
+       umts/hsdpalink.o umts/um-hs.o \
+       umts/umts-timers.o umts/virtual_umtsmac.o \
+       umts/am-hs.o \
+       umts/umts-queue.o umts/dummy_drop_tail.o \
+       umts/error_model.o tools/coot.o \

        tcl/lib/ns-qsnode.tcl \
+       tcl/lib/ns-umts.tcl \
        @V_NS_TCL_LIB_STL@

[common/packet.h]
-static packet_t       PT_NTYPE = 73; // This MUST be the LAST one
+
+// UMTS - used by hdr_cmn class for tracing purpose
+static const packet_t PT_UM = 73;
+static const packet_t PT_AMDA = 74;
+static const packet_t PT_AMPA= 75;
+static const packet_t PT_AMPBPA = 76;
+static const packet_t PT_AMBA= 77;
+static const packet_t PT_AMPBBA= 78;
+// Used for tracking HARQ transmissions (MAC-hs PDUs)
+static const packet_t PT_AMDA_H1= 79;
+static const packet_t PT_AMDA_H2= 80;
+static const packet_t PT_AMDA_H3= 81;
+       // End UMTS
+// COOT packet
+static const packet_t PT_COOT= 82;
+
+// insert new packet types here
+static packet_t       PT_NTYPE = 83; // This MUST be the LAST one

 #endif //STL
+               // UMTS
+               name_[PT_UM] = "UM";
+                name_[PT_AMDA] = "AM_Data";
+                name_[PT_AMPA] = "AM_Pos_Ack";
+                name_[PT_AMPBPA] = "AM_Piggyback_Ack";
+                name_[PT_AMBA] = "AM_Bitmap_ack";
+                name_[PT_AMPBBA] = "AM_Piggyback_Back";
+               // For HARQ transmission tracking
+               name_[PT_AMDA_H1] = "HARQ_1";
+               name_[PT_AMDA_H2] = "HARQ_2";
+               name_[PT_AMDA_H3] = "HARQ_3";
+               // End UMTS


+               // coot
+               name_[PT_COOT]="coot";
+
                // Bell Labs (PackMime OL)

2014年1月3日 星期五

NS2 traffic files generated using VANETMobiSim(on Windows)

What is VanetMobiSim?
VanetMobiSim is tool of mobility modeling.
site:http://vanet.eurecom.fr/

Install VANETMobiSim & Generate a NS2 traffic files

1. Download VanetMobiSim sources and VanetMobiSim binaries
go to http://vanet.eurecom.fr/
download VanetMobiSim sources file
  (ex. VanetMobiSim 1.1 sources file and VanetMobiSim 1.1 binaries)

2. Downlaod CanuMobiSim
go to  http://canu.informatik.uni-stuttgart.de/mobisim/downloads/
download CanuMobiSim(ex. CanuMobiSim v1.3.4)

3 Download Apache Ant
go to http://ant.apache.org/bindownload.cgi
downloasd Apache Ant (ex. apache-ant-1.9.3-bin.zip )

4. Decompress apache-ant-x.zip to a folder
  ex. E:\VanetMobSim\ant

5. Set system variable
 (1) Add a variable "ant_home"




 (2) Add "%ant_home%\bin" to "PATH" variable



6. Decompress VanetMobiSim sources to a folder
    ex. E:\VanetMobSim\VanetMobiSim-1.1

7. Decompress CanuMobiSim, then copy "src" folder in CanuMobiSim_1_3_4_src to VanetMobiSim sources  folder
    ex. E:\VanetMobSim\CanuMobiSim_1_3_4_src
    copy E:\VanetMobSim\CanuMobiSim_1_3_4_src\src to E:\VanetMobSim\VanetMobiSim-1.1


8. open "Command Prompt" window(cmd.exe)
    (1) cd E:\VanetMobSim\VanetMobiSim-1.1
    (2) "ant patch" <enter>
9. copy VanetMobiSim binaries to sample folder in VanetMobiSim sources  folder
  copy VanetMobiSim-1.1.jar ex. E:\VanetMobSim\VanetMobiSim-1.1\samples

10. run java -jar VanetMobiSim-1.1.jar xmlfile.xml
  ex. java -jar VanetMobiSim-1.1.jar IDM_LC.xml

11. Generate NS2 traffic
  (1) modify configuration in "IDM_LC.xml"
    <!-- <extension class="de.uni_stuttgart.informatik.canu.mobisim.extensions.NSOutput" output="ns_trace.txt"/>-->
    remove <!-- ... --> ,as above
   

 (2) re-run java -jar VanetMobiSim-1.1.jar IDM_LC.xml
 (3) the ns_trace.txt is generated in the folder which is a NS2 NS2 traffic



2013年12月1日 星期日

NS2 installed on Cygwin 2013 + Windows


OS: Win7 64bit
Cygwin: 2.831(32bit)
ns2: ns2.29

[cygwin/X]

1. download cygwin setup file 
2. setup cygwin
 next->(checked) Install from Internet->Root Directory(Next)->Select Local Package Directory(Next)
->(checked)Direct connection->Choose A Download site(choose a best site, and Next)->

3.Select Packages
 a) gcc,gcc-g++,gnuplot,autoconf,make,patch,perl,tar,
 b) libxt-devel,libXmu-devel,zlib-devel,libintl,w32api(mingw-win32api/mingw-w32api)
 c)[X-Window] http://x.cygwin.com/docs/ug/setup-cygwin-x-installing.html
    xorg-server,xinit,X-start-menu-icons,twm(or WindowMaker)




[ns2]

2. modified configure or sources 
3. install

2013年8月11日 星期日

尋找老同學

尋找一位久未聯絡的國中同學
因為久未聯絡而失聯,沒有其他聯絡方法
想和他敍敍舊,若您認識他或能聯絡到他
請email給我,
或請您告訴他,"有一位阿奇同學找他"
或請他與我email聯絡,
謝謝你的協助
email:yotrew@gmail.com

姓名:蕭智榮
就讀過學校:屏東萬丹國中->屏東高中->屏東科大森林系
年紀:目前約33歲(2013年)
喜歡:打籃球,運動,看霹靂布袋戲
最後一次聯絡:約10年前



我在網路看到他與朋友爬山照片
http://tw.myblog.yahoo.com/antony-chen/article?mid=584&prev=659&next=-1






若本網頁有侵犯到您的著作或個資,email告知,我將會移除它

2013年7月8日 星期一

iPhone與iPad使用AirPrint 列印資料

iPhone與iPad使用AirPrint 列印資料

IOS:6.1
PC:Windows 7

0. 下載Windows_ AirPrint Installer   http://0rz.tw/Rzocb  http://ppt.cc/0OpV
1. 設定分享你的印表機
2. 安裝Windows_ AirPrint Installer
   a. 執行AirPrint_Installer.exe
      點選Install Airprint service後關掉AirPrint_Installer

   b. 依照你的作業系統版本執行
      AirPrint iOS 5 FIX - 64Bit
      或AirPrint iOS 5 FIX - 32Bit

   c.再執行AirPrint_Installer
     按start

3.使用iPhone或iPad來列印




Q&A
Q1:若使用Windows 7時,執行上述步驟,在iPhone或iPad上還不能找到印表機.
A1:使用網路芳鄰看是否能連到Windows 7的PC上,若不行在檢查
   控制台->網路和網際網路->網路和共用中心->變更進階共用設定->"以密碼保護共用"
   看是否是"關閉以密碼保的共用" ->"儲存變更"
Q2: AirPrint on windows不能同時使用2個iOS設備?
  1. iPhone連得上時,iPad就連不上
  2. iPad連得上時,iPhone就連不上
      Why?是Guest account只能一個人,還是AirPrint的問題?
---------------------------
參考資訊:
1. http://jaxov.com/2010/11/download-airprint-installer-for-windows-7-xp-vista/
2. http://iphone4.tw/forums/showthread.php?t=108688
3. How to Print to ANY Printer from iPhone, iPod, iPad via Windows(youtube)

2013年6月3日 星期一

日本上網 旅遊 b-mobile

到日本旅遊越來越方面,國人也喜歡到日本旅遊
因目前行動設備流行,幾乎人手一機且使用智慧型手機
想要旅遊時順便分享照片或打卡,就必須上網
到日本上網有幾種方式,
1. 向國內的電信業者申請漫遊上網
2. 到日本租用日本電信業者的行動上網
3. 到機場租用日本的行動上網分享器
4. 免開通的b-mobile

這次到日本使用行動上網是上網購買b-mobile 1GB行動上網卡,使用華為E583C無線分享器
再請日本朋友開通(使用手機開通)

將micro sim卡裝上轉接卡,轉成大sim卡,裝入華為E583C
再來是設定APN(如下及下圖)[基本上應該大部份的手機也是如此設定]

使用者:bmobile@fr      (不同卡有不同的設定)
密碼:bmobile
驗證:PAP或CHAP       (2者選一個,或是選"PAP或CHAP",反正一定要選)
APN:bmobile.ne.jp

設定完後,到日本直接開機即可使用



2012年11月13日 星期二

[OpenGL/C#] 在C#中使用OpenGL簡單的顯示文字

在C#開發OpenGL有使用CSGL等library方式來建立
在C++中要在OpenGL上顯示文字可以在網路上找到許多資料,
而C#雖然也有很多資料但是一直無法試成功,甚至會造成狂吃記憶體.
只是為了顯示簡單的文字,因此就使用C++的來改寫.

Step1.先將opengl32.dll複製到C#專案目錄或確定在\Windows\System32中有opengl32.dll
Step2.由opengl32.dll引入 wglUseFontBitmaps()與wglGetCurrentDC() 兩個函數
   [DllImport("opengl32.dll")]
        static extern System.Boolean wglUseFontBitmaps(System.IntPtr hdc, System.UInt32 first, System.UInt32 count, System.UInt32 listdbase);
        [DllImport("opengl32.dll")]
        static extern System.IntPtr wglGetCurrentDC();
Step3.撰寫以下函數,修改自(modified from:) http://blog.sina.com.cn/s/blog_9aa5c2d4010150sp.html
        void GLdrawString(string str)
        { //在OpenGL畫布上顯示文字
            int isFirstCall = 1;
            uint lists = 0;
            uint MAX_CHAR = 127;

            if (isFirstCall == 1)
            {
                isFirstCall = 0;
                lists = GL.glGenLists((int)MAX_CHAR);

                wglUseFontBitmaps(wglGetCurrentDC(), 0, MAX_CHAR, lists);
            }
            char[] str_char = str.ToCharArray();
            for (int n = 0; n < str.Length; n++)
                GL.glCallList(lists + (uint)str_char[n]);
        }


code: http://goo.gl/PhjXI