2007年9月28日 星期五

Carrier Grade Voice over IP notes

*Standard Track
Internet draft→RFC→proposed standard (if 有兩個成功實作 and interoperability)→draft standard→standard(with a standard number,STD==RFC number)
*advantage of VoIP :
  • lower equipment cost
  • lower operating expense
  • integration of voice and data
  • potentially lower bandwidth
  • the wide spread availability

TCP Port numbers
well-known port numbers:0~1023
telnet:23,SMTP:25
IP address + prot number = socket address
TCP header format
Sequence number: count data octets
ack number: the next segment number that the receiver is expecting

[Weekly Report]2007.9.22-2007.9.29

1. Reading Tasks:
1-1-1."Carrier Grade Voice over IP," p39-53
1-1-2."Unix Programming Environment," 2-3~3-5

2. Implementation Tasks:
2-1-1.Do some testing of the examples in "Unix Programming Environment": Most of them worked, but I still couldn't try some regular expression pattern out(using grep command), like the exercise:
They mixed me up. Maybe I make some examples not suitable for them. Still trying.

3.Lab's Equipment Database maintain

2007年9月27日 星期四

a little VoIP note

2007.9.20

NTP VoIP Platform
Gateway:作通訊協定轉換用的設備
Carrier Grade :電信等級
Carrier Grade and VoIP:
  • 兩者為互斥的名詞
  • a serious alternative for voice communications with enhanced features
Carrier grade
  • the last time when it fails
  • 99.999% reliability(high reliability)
    • fully redundant(不過硬體設備要花錢錢),self healing
best-effort:狂送(封包)!←less of QoS
Telcos: telecommunication campanies

2007.11.1
RTCP:for period-related feedback
sender report:傳送者對網路狀況做報告(可有0~31個reports)
Receiver report: e.g.網路廣播電台
Source Description(SDES)
CNAME(canonical name)官方正式名稱
影音不同source→通常SSRC不同,CNAME相同(在同一session皆同)
BYE:要走了…(但有了SIP後就不太需要BYE)
每個封包都有SR(RR)、SDES
RTP port一定是偶數,RTCP port一定是偶數加一

[Weekly Report]2007.9.15-2007.9.21

1.Read papers and documents:
1.1 RFC 3261(~p42)
1.2 SIP Tutorial by Jiri Kuthan and Dorgham Sisalem
The two documents introduce the basic concepts of SIP. I tried to clarify the header field structure. But still a lot of fields confuse me, like contact.
1.3 "Terminating Telephony Services on the Internet,"Vijay K. Gurbani and Xian-He Sun, Senior Member, IEEE(p1~p3)

2.Install FreeBSD and try to set it a SIP server:
Read the SER manual page.

[Weekly Report]2007.9.8-2007.9.14

1.Papers Reading:
* SIPCache:A Distributed SIP Location Service for Mobile Ad-Hoc Networks
* A Stateless Neighbour-Aware Cooperative Caching Protocol for Ad-Hoc Networks (Introduction of PCache)
*SIP: Understanding the Session Initiation Protocol:
reading on the NetLibrary website ch1~ch2
2.Establish SIP server accounts

Regular Expression(正規表示式) notes


/*
*為什麼會有這篇 因為有一天可愛的鐘逸學長在問帥氣的柏州學長(明顯在巴結人)一個有關正規表示式的問題時,被好像在專心念書,其實一直在觀察四週的我(偷?)聽到了,try to find a method but in vain的感覺很不好,所以複習一下正規表示式囉!

*/

[a-Z]: 表示a-z,A-Z其中"一個"字母
[^a-Z]:表示非a-z,A-Z其中之一
*:量詞,出現零次或一次以上
.: 表示任何一單一字元
^:列首
$:列尾
\< :單字開始處 \> : 單字結束處



[:album:] 任何字母與數字
[:alpha:] 任何字母
[:cntrl:] 任何控制字元
[:digit:] 任何數字
[:lower:]任何一小寫字母
[:upper:]任何一大寫字母
[:print:]任何一可印字元
[:space:]任何空格字元



=======
好用的:
:%s /pattern/&/g 可用來計算有幾個符合pattern的字串(&表示符合pattern的字串,故代換後不改變文章)
\([a-z]\{2}\)\{2,\}\3,5\}
:%s/\([^0-9]\{1,}\)
去除/*………*/c語言註解
:%s:\/\*\(.\{-}\)\s*\*\/:\1:g
去除//
:%s://::g
(喜歡想太多的人可以用:%s:\/\/\(.\{-\}\)\s\+:\1:g)
=======
Reference:
msdn:正規表示式介紹(中文)
Regexp Syntax Summary
Regular Expression Library
RegExLib

/**
後記:雖然問題已被解出來,但是我還是得承認我沒弄懂整個指令的來龍去脈....
其實問題很簡單:
--
A女:"不要嘛~"
"來啦~",B男低語著…(內容純屬虛構)
-------
Scenario:小說中的對話原本是用""雙引號標記的,但現在作者想改用[ ],像vi 這種支援正規表示式的editor可如何快速取代呢?

**/


2007年9月19日 星期三

IPv4及IPv6之轉換技術

前言:為什麼會有這篇呢?因為某個下沉的夜有人丟這個網址給我
http://www.twnic.net.tw/file/07801b.htm
(給我這個幹嘛 XD)
剛好翻到之前去旁聽的筆記,順手整理一下囉!
2007.4.9
IPv4及IPv6之轉換技術
NGtrans規劃(Net Generation)
1.Dual Stack
OS有提供即可,或,可由OS更新,故,此法可減少硬體成本←優點
FreeBSD 4 .Solaries8之後surpport
*兩者routing table不同(32 bits vs. 128 bits)
2.Tunnel(通道機制)

eg.用router作tunneling
(1)手動(manually)
  • If no router do, do it by yourself.
  • 自己config 雙方的IPv4及IPv6位址
  • encapulation,decapulation(封裝,拼法待查)
(2)半自動(Semi-automated)
  • Tunnel Broker (Broke v.仲介)
  • 向tunnel broker註冊(用script告知)
(3)全自動(automated)
  • IPv4 Compatible Tunnel
  • 6 to 4 automatic tunneling
  • 2002:8243:1::/48
  • 130.67.0.1

如何在freeBSD下安裝bash

真神奇…居然預設沒有安裝bash....

1. 安裝 bash

# cd /usr/ports/shells/bash
# make install clean


2. 將 shell 改成 bash

# chsh <== 這個指令就是 change shell 的意思
#Changing user database information for root.
Login: root
Password:
Uid [#]: 0
Gid [# or name]: 0
Change [month day year]:
Expire [month day year]: Class: Home directory: /root
Shell: /bin/tcsh <== 把 /bin/tcsh 改成 /usr/local/bin/bash
Full Name: Charlie &
Office Location: Office Phone: Home Phone: Other information:
3. 存檔離開
4. 編輯 bash 設定檔
# vi /etc/profile 加入 export LANG=zh_TW.Big5 #設定繁體中文 export LC_ALL=zh_TW.Big5 #設定繁體中文
alias ls='ls -fGa' # 讓 ls 能顯現出顏色
alias rm='rm -i' # 刪除確認 alias cp='cp -i' # 拷貝確認
alias mv='mv -i' # 搬移確認
5. 自訂命令提示字元 PS1="[\u@\h \W]\\$ " 說明: \u --> 顯示使用者帳號
\h --> 顯示系統的 hostname
\w --> 完整路徑
\$ --> 以 # 表示 root,以 $ 表示一般使用者

6. 存檔離開,重新登入即可生效...

我覺得很重要的單字(paper常出現)

A~E:
collaboration共同合作、共同研究
de facto 事實上的
de facto standard 現存標準 (未經標準機構通過, 但卻被產業廣泛採用的標準)

F~J:
hybrid 混合(字典居然只查得到雜種這種解釋XD)
jitter:delay variation,在VoIP的世界裡,你delay的程度一直變也是惱人的問題啊!XD

K~O:
ubiquitous 隨處可見、隨處可用(常用來形容現在網際網路的普及性)

P~
proprietary 業主、各公司(強調各個)
status quo 現況


待續…

找論文、技術文章

Prof. Wu in mailing list:

If you have enough knowledge about these protocols, you are encouraged
to read VoIP papers in these magazines:

1. IEEE Internet Computing <http://www.computer.org/internet/> Magazine
2. IEEE Network
<http://ieeexplore.ieee.org/xpl/RecentIssue.jsp?puNumber=65> Magazine
3. IEEE Communications Magazine
<http://ieeexplore.ieee.org/xpl/RecentIssue.jsp?puNumber=35>
4. IEEE Communications Surveys & Tutorials
<http://www.comsoc.org/livepubs/surveys/index.html>

==========
(引用自ptt Master_D看板,並加上一些補充資料)

找所謂的"SCI"與"SSCI"可以分為兩階段

1.上期刊資料庫網站下載全文,如SDOS或IEEE

2.把下載完的期刊論文其"出版社",或"ISSN"等資訊,透過JCR查詢

此出版社是否列入SCI(Web of Science);SSCI,及其在該領域的排名等資訊

1.的相關連結:

http://www.sciencedirect.com/

http://ieeexplore.ieee.org/


2.的相關連結:

http://isiknowledge.com/(選Journal Citation Reports)

:以上各連結均需使用學術網路IP(在家使用需額外設定PROXY)連線
eg. 暨南大學學生在校外需設proxy
並於連線時輸入圖書館系統的帳號、密碼。
(密碼預設為身分證字號後四碼)
ref. to NCNU Library proxy configuration

=====
再附上一個網站:國立編譯館-學術名詞資訊網
若真的一定要找中文的資料,可以到此查一些專有名詞的中文翻譯為何。\

10/14補充:
近來發現Linux Magazine上也有很多名符其實的技術文件可參考,只是有些文章要有登錄後才能閱讀全文,跟讀者文摘一樣,還好是免費加入的會員制。
(說"名符其實"是因為網路上真的超多名不符實的網站啊!)
-----
怎樣的論文算是好的論文?
In general, Journal > Conference
SCI....有一定水準
Impact Factor
citation(被引用次數,不過這點有時候不太準,
e.g.在related work中被引用來批說有如何如何的缺失。)
(2008/2/12)

2007年9月17日 星期一

Debian Birthday Party 參加心得(2007.8.5)

(我真是個乖寶寶,老師說要寫心得我就寫了~)

之前有一段時間曾使用過Debian/Linux這個distribution,也觀察了使用者社群的討論區;日前,陳侃如同學告知八月五日有Debian Birthday Party in Taiwan(http://wiki.debian.org.tw/index.php/DebianBirthdayParty2007),一來對平日有在閱讀其網誌的作者們感到好奇,二來也想去增廣見聞,就安排了這次台北行。
在去參加這個聚會前,看了一下活動網頁上的流程,列了好幾位要發表心得,所以我便抱著要去聽演講的心態,但是到了會場一看發現完全不是這麼 回事。大家分成好幾個小組在聊天,稱之為聊天,是因為氣氛真的很輕鬆,第一次參與這樣聚會的我,四下觀望,找了一個好像比較適合新手討論的小組加入;之後 又藉著侃如認識了幾個耳聞已久的高手(其實侃如也在這個社群赫赫有名的人物),像是jserv(http://jserv.sayya.org/)、Andrew()……等等;聚會的後半,又認識了積丹尼(http://jidanni.org/)這個愛台灣的美國人,也跟一位熱血地在學校推廣Linux的高中生交流,我發現這一群人是這麼熱心於將自己廢寢忘食所研究出來的程式或想法分享給每一個人,甚至願意終身奉獻給這個零與一構築起來的世界。
在此特別要提到jserv這號人物。一開始我並不覺得坐在我身旁的這位是我仰慕已久的jserv,因為他真的太搞笑了,一點都沒有大眾所認 知的電腦高手般不知如何與人社交的氣質,一直到我終於開始仔細看了他給的名片,才驚訝於原來也有「這樣的高手」啊!席間他和我分享了他們公司在研發的產 品,是一支CPU僅有200MHz、使用JVM及LINUX平台開發程式的手機,並且聊了一下Wifi手機在美國因為必須配合官方監聽系統所遇到的難題 (這應該也是開發上述手機產品的動機,只是我在聽的時候,沒有把思路釐清),也天南地北地聊到他已過的經歷,以及到各處演講的趣聞,覺得收獲很多,雖然技 術的交流很少(他在說project開發現況時,我有好幾個名詞聽不太懂,所以沒辦法跟上他的思緒),但是我好像也感染了一些他對資訊技術的熱情。

[轉載]學會對付十大時間竊賊

  對付“十大時間竊賊”最重要的措施之一是要減少你浪費掉的時間。時間管理學研究發現,人們的時間往往是被下述十大“時間竊賊”給偷走的:

  (1)找東西

  據對美國200家大公司職員做的調查顯示,公司職員每年都要把6周時間浪費在尋找亂放的東西上面,這意味著他們每年要損失10%的時間。對付這個“時間竊賊”,有一條好的原則:不用的東西扔掉,不扔掉的東西分門別類保管好。

  (2)懶惰

  對付這個“時間竊賊”的辦法是:

  使用日程安排簿;

  在家居之外的地方工作;

  及早開始。

  (3)時斷時續

  研究發現,造成公司職員浪費時間最多的是干活時斷時續的方式。因為重新工作時,這位職員需要花時間調整大腦活動及注意力,才能在停頓的地方接下去干。

  (4)一個人包打天下

  提高效率的最大潛力,莫過于其他人的協助。你可以把工作委托給其他人,授權他們去幹,這樣每個人都是贏家。授權給別人,同時也要給他們完成任務所需要的條件。

  (5)偶發延誤

  這是最浪費時間的情況,要避免這種情況出現,惟一的辦法是預先安排工作。事前有准備,利用好偶發的延誤,你能把本來會失去的時間化為有用的時間。

  (6)惋惜不已或白日做夢

  老是想著過去犯過的錯誤和失去的機會,唏噓不已,又或者空想未來,這兩種心境都是極浪費時間的。

  (7)拖拖拉拉

  這種人花許多時間思考要做的事,擔心這個擔心那個,找借口推遲行動,又為沒有完成任務而悔恨。在這段時間里,其實他們本來能完成任務而且應轉入下一個工作了。

  (8)對問題缺乏理解就匆忙行動

  這種人與拖拉作風正好相反,他們在未獲得對一個問題的充分資訊之前就匆忙行動,以致往往需要推倒重來。這種人就必須培養自己的自制力。

  (9)消極情緒

  消極情緒使人失去幹勁,工作效率下降。對人懷有戒心、明爭暗斗、憤怒及其他消極情緒使我們難以做到最好。這就必須進行自我心理調適,培養積極心態。

  (10)分不清輕重緩急

  即使是避免了上述大多數問題的人,如果不懂得分清輕重緩急,也達不到應有的效果。區分輕重緩急是時間管理中最關鍵的問題,所以,我接下來多花一點篇幅來說明這個問
題。

  時間管理學家認為區分輕重緩急是時間管理最關鍵的技巧。許多人在處理日常事務時,完全不考慮完成某個任務之後他們會得到什麼好處。這些人以為每個任務都是一樣的,只要時間被工作填得滿滿的,他們就會很高興。或者,他們願意做表面看來有趣的事情,而不理會不那麼有趣的事情。他們完全不知道怎樣把人生的任務和責任按重要性排隊,確定主次。

  在確定每一天具體做什麼之前,要問自己一個問題:做什麼事最重要?你應該遵循一個非常重要的原則:在精力最旺盛的時候做最重要的事。什麼是最重要的事?即能給你帶來最高回報的事,最能幫助你實現目標的事。假如你的目標是在下一個月的銷售額為10萬元,你就要時時刻刻提醒自己:在我精力最旺盛、頭腦最清醒的時候抓緊搞促銷,而不是搓麻將、玩電腦游戲、踢足球。

  除了上述十大“時間竊賊”之外,其他常見的“時間竊賊”還有:承諾太多,喜歡開會,侃侃其談;門戶大開,迎來送往;家務繁雜,應酬過多等等。下面是充分利用時間的一些技巧:

  ——做好協調,工作分流;

  ——在處理重要而耗時的事務中感到厭倦時,改而處理其他雜務,既可節省時間,又能轉換心情;

  ——不浪費零碎時間(利用零碎時間處理雜務,延遲用餐時間以免擁擠等);

  ——採取比較簡單的生活方式,處理好工作與生活的矛盾;

  ——盡量減少不必要的對外應酬,必須應酬時設法節省應酬時間;

  ——充分運用上下班的搭車時間(如車上想問題等)。

  3.每天列出目標清單。

  每天晚上睡覺之前,拿出一張紙,把你明天要達成的目標記下來,不能少於6個,按重要程度編上號碼。早上一起床,馬上著手達成第一個目標,等到第一個目標達成後,然後開始想辦法實現第二個目標。如果有一個目標要做一整天,也沒關系,只要它是最重要的工作,就堅持做下去。

  以上這個方法做起來很簡單,而且對提高工作效率非常有效。它是美國現代公關之父艾維·李賣給伯利恒鋼鐵公司總經理西韋伯的提高效率的一種思維方法,據說這個簡單有效的方法價值百萬。

  我在很早以前就從報紙上看到這個賣思維的案例,可是由於我對這種“雕虫小技”不屑一顧,因而一直沒有使用。最近我看到這個案例後,我決定試試,結果不做不知道,一做嚇一跳!它太棒了!

  首先,它可以讓你每天過得很充實,不會無所事事。你想想看,每天你要達成6個目標,如果不動腦子仔細想想,還真想不出來。等你花費一番心思想出來了,寫在紙上,你還得給這些目標排次序。你得考慮哪件事情重要,哪件事情不那麼重要;哪件事情要先做,哪件事情後做。等你把這項工作完成後,你心中就繃緊了一根弦,你時刻就得為完成目標而忙碌,你是不是過得很充實?

  其次,目標清單能夠給你一些明確的任務,不會讓你干一些無聊的事情而浪費時間;而且它還能夠讓你分清輕重緩急,做事情有計划,不會像無頭蒼蠅一樣到處亂撞,從而極大地提高你的工作效率。

  如果你能夠堅持這樣做一個月,我相信你一定能夠養成一個良好的習慣,你也會越來越有成就感。只要你堅持做下去,你一定會離成功越來越近!

看不懂的文章 about five nines

看完後完全不了解
http://www.networkworld.com/details/5642.html?def

--------

看完課本之後的理解:(Sep.16)誤!

five 表示一年僅有少於五分鐘的down time→reliability
nines表示availability高達99.9999%(後面有幾個9不太確定)

Sep.19 note
發現之前的理解完全錯誤。(弱死了!)
five nines代表99.999%的availability,
一年有3600*24*365=31536000秒
31536000*(1-99.999%)=315.36秒
一年中unavailable time 應少於315.36秒,約五分鐘,
是故,課本提到的五分鐘是這樣來的。
(謝謝老師的提點)

reference:
http://en.wikipedia.org/wiki/Myth_of_the_nines

2007年9月16日 星期日

Install Liu in Linux

簡單版(可以不使用大腦):

移除Scim(Debian/Linux預設安裝Scim)

apt-get remove scim

安裝Gcin (已經裝好可省略此步驟)

  1. apt-get install gcin im-switch
    (安裝gcin和im-switch←可簡單地切換輸入法)
  2. im-switch -s gcin
    (將gcin更改成預設輸入法)
  3. 重新登入

安裝 嘸蝦米 輸入法

  1. wget http://edt1023.sayya.org/misc/noseeing-6.tar.gz #下載嘸蝦米的 table
    或者我有解開的檔案,放在
    http://ms11.voip.edu.tw/~martensite/noseeing.gtab
  2. mkdir tmp; cd tmp
  3. tar zxvf noseeing-6.tar.gz
    (如果是解開的,就別再解了吧~不要來問我這問題,我會很冏XD)
  4. mv noseeing.gtab /usr/share/gcin/table/
    (將table移到gcin表格的資料夾)
  5. Gcin圖示按右鍵設定內定輸入法, 即可使用(也可以順便將不會用到輸入法刪除)
看起來很厲害版:
(前幾步驟與前同,只有table的處理不同)
  1. 如果有原版的嘸蝦米,請找出liu.cin
    (http://ms11.voip.edu.tw/~martensite/liu57b.zip)
  2. gcin2tab liu.cin
  3. mv liu.gtab /usr/share/gcin/table/noseeing.gtab
    #此步驟同時改檔名並移動檔案到gcin預設存放輸入法table的資料夾


2007年9月13日 星期四

Reading Queue

About Distribution
  • Q Focus Journal,Mar 2007,"SIP: Decentralizing SIP"
  • SIPCache:A Distributed SIP Location Service for Mobile Ad-Hoc Networks
  • A Stateless Neighbour-Aware Cooperative Caching Protocol for Ad-Hoc Networks (Introduction of PCache)
閒書Queue
孤獨六講
及戰力﹍大前研一

2007年9月11日 星期二

(轉錄)時間管理101招

時間管理101招

  無論是在家裡還是在工作中,每個人都要在某種程度上支配自己的時間。你做事的先後順序,對你能從生活中獲益多少,有著深遠的影響。大部分人都能安排好自己的時間,從而使工作格外有效,休閒時光更加充實。本書指導你如何有效地支配時間。書中包含了豐富而實用的建議,而散見於全書的101個簡明的小訣竅進一步提供了極有價值的指導。這本書從檢測你通常是如何支配時間開始,再把目光轉向你有待改進的地方,然後告訴你如何使用快捷而容易的方法來進行改進。改進的內容從怎樣處理文件到如何使用高時效的手段進行通訊。本書的最後一節會教你如何用學到的知識來幫助別人更有效地支配時間。

瞭解時間
  時間是我們最寶貴的資源,通過分析我們時間的使用情況,才有可能掌握適於工作場所內外,最為有效的時間使用方法。

1.每天要回顧,急事需優先。

2.對於很棘手的任務,先從一小部分入手,立即處理。

3.考慮一天的日程安排,採用相應的工作方法。

4.不值得去做的事,派下屬代勞。

5.工作日化整為零,每段30分鐘。
6.重溫日程安排,評價工作效率。
7.安排日程時,留點時間用於思考。
8.預測工作用時,看看是否準確。

訂計劃

  如果你不知道明天的行動方向,你就不能決定今天要幹甚麼。改進時間支配的任何方法都有賴於對目標的清楚瞭解。

要隨時做日程記錄,單憑記憶不大可靠。

    10.化長遠規劃為一周、一日的行動計劃。

    11.繪出工作履歷表,計劃下一步幹甚麼。

    12.幾項任務難分先後順序,另闢蹊徑尋找第二方案。

    13.協調你與上級在工作安排的先後順序上存在的差異。

    14.要及時發現與同事在工作安排先後上的矛盾。

    15.把日誌中的所有工作按重要性分類。

    16.如果你的工作表上全是A類任務,委託別人代辦或重新分類。

    17.根據情況的變化和新信息的出現,不斷變更工作的優先順序。

    18.討論應該簡短,避免沒有結論的提問。

    19.每天給自己有段安靜的時間。

    20.不要擔心電話機沒有擱好。

    21.記錄你的體力、腦力出現高峰的時間,瞭解它們能持續多久。

    22.留些精力給家庭生活和工作之後的消遣。

    23.建議公司以彈性工作時間運作,以提高工作效率。

    24.挑選一種看起來美觀,用起來稱心的日誌。

    25.你的日誌裡永遠放枝筆,隨時記錄信息和日期。

    26.用彩色筆標示出任務的不同重要性。

    27.確定的期限要合乎實際,訂期限為的是促進你完成任務而不是要製造緊張。

    28.委託該委託的工作,無論那是你喜歡的還是不喜歡的工作。

    29.工作按時完成後,應該自我獎勵。

    30.在日誌上制訂計劃,不要超前一年。

    31.要保證你每天至少辦了一件令你愉快的事。

    32.晚上的最後一件事,讀篇你最喜歡的作者的文章。

    34.使用電子記事簿列出自己的弱點,然後計劃逐一加以克服。

    35.寫字桌上沒用的東西清理走,只把現在的工作留在手邊。

    立即做出改變
      這裡有許多實際的工作可以去做——無論是清理寫字桌並使其保持整潔,還是使電腦內的文檔分類清晰,都可以在短期或長期內提高你的工作效率。

      36.留心「便利貼」式的便條,小心丟失。

      37.每天都要清理乾淨,不要把髒亂留到明天。

      38.文件裡的特別關鍵處要做標記以加快重讀時的速度。

      39.辦公室裡放一個時鐘,你和客人都能看見。

      40.每隔幾個月,重新檢查檔案系統。

      41.建立一種檔案系統,它將與你和你的生意一起發展興隆。

      42.定期查閱你的存檔,把不再需要的文件丟掉。

      43.將較難歸類的文件統一放入一檔案夾中,貼上“其他”標籤。

      44.只把將來要參考的重要文件存檔。

      45.打給你的電話首先由秘書或同事接聽。

      46.拿起電話聽筒暗示會議結束。

      47.如果有人跟著你走進辦公室,你不要坐下來。

      48.如果門開著,你的座位不要放在別人的視野之中。

      49.把你認為不需要的信息都扔掉。

      50.利用一切機會儘可能站著碰面──以便能隨時離開。

      51.只為那些需要知道的人員複印信息資料。

      52.停止訂閱你不再閱讀的雜誌。

      53.取走你希望保存的報刊,存檔留作參考。

      54.寫字桌上只留最重要的讀物。

      55.評價每條信息與正在進行的工作的相關性。

      56.在打斷別人之前要想到他們的時間與你的時間同樣寶貴。

      57.其他的選擇行不通時,才考慮召開會議。

      58.不要對同事隨意猜測。

      59.在你打電話之前,做一次放鬆的深呼吸。

      60.打電話時要避免精力分散,集中精力聽對方在說些甚麼。

      61.你在打電話時,把另一件工作放在手邊,以防你要久等。

      62.告訴別人甚麼時候可以給你打電話。

      63.為了避免被打斷工作,你可以換一條電話線路。

      64.千萬不要把要寫的材料向後拖--這樣會越積越多。

      65.在你必須閱讀的報告上劃出關鍵的句子。

      66.快速閱讀報紙的標題。

      67.把重要的參考材料與其他文件分開。

      68.每月一次清理你電腦裡的不需要文件。

      69.仔細考慮你的電腦配置。

      70.確保你的電子郵件簡短,地址準確。

      71.要鼓勵別人表達自己的意見,即使他們的觀點與你的相反。

      72.要多聽少說,使會議開得簡短。

      73.如果日常例會超過了一小時,請同事去“緊急”打斷它。

      74.對議程中的每個專題都要分配一定的時間。

      75.鼓勵人們只參加會議中與他們有關的部分。

      76.在會議的備忘錄上記下會議通過的事項。

      77.旅行之前評估這次旅行是否必要,錢花得是否值得。

      78.如果可能,把你需帶的每件東西全都塞進一個小手提箱裡。

      79.帶點工作在候機室裡做,以防飛機延遲。

      80.按目的地的當地時間撥好手錶。

      81.在打電話之前,核查酒店對電話的收費。

      82.核查你的電子裝備在國外使用時是否需要適配器。

      83.每年要安排二到三個短的假期,而不是一幹到底。

      84.定期留出一點時間來追求業餘愛好,和享受休閒放鬆的樂趣。

      85.志在每天嘗試新東西。

      支配別人的時間
        為了把你的時間安排得盡善盡美,同樣你必須要支配好職員、同事和下屬的時間。學會授權或委託他們去替你辦事、分擔任務,掌握好同上下級相處的藝術。

      86.要保持很高的期望值,人們會將努力付諸實踐。

      87.勸說別人的時候要用事實,而不是用感情。

      88.關心別人想得到甚麼。

      89.聽到和聆聽是不同的,要學會聆聽。

      90.當你把任務授權別人去辦的時候,確保你把目的說得相當清楚。

      91.留點時間來做你一個人可以做的事。

      92.要有一張核查表,幫助你監察已委托工作的進度。

      93.獎勵要慷慨,訓斥要適度。

      94.對授權別人的任務要設定明確的,切實可行的完成時間。

      95.不要讓同事用不重要的事來分散你的精力。

      96.在同事的辦公室裡召開會議,這樣在你需要的時候則可以離場。

      97. 專門留出時間,讓你的辦公室向全體人員開放。

      98.只有當你有不止一個疑難問題需要討論的時候,才去請教你的同事。

      99.揣摹老闆的工作模式,並試圖採納。

      100.詢問老闆的家庭生活——這將有助於你與他建立好關係。

      101.記住時間是最民主的,沒人比你的多,也沒人比你的少。

Appserv安裝note

安裝PHP開發環境
1.AppServ 2.5.7版(http://www.appservnetwork.com)
2.安裝Appserv前,記得先關閉skype(如果有裝的話)。
3.安裝到Apache請填入:[伺服器名稱]:localhost、[管理者的電子郵件]:您的Email、[埠號]:80。
4.安裝到MySQL請填入root(最高管理員)的密碼。
5.安裝過程中MySQL千萬勿選語系,保持為UTF8即可。
6.預設網頁目錄:C:\AppServ\www,裝好後用瀏覽器執行「http://localhost」或「127.0.0.1」有畫面即完成。

C:\WINDOWS\php.ini
  1. register_globals=off(關閉全域變數,加強安全性)
  2. max_execution_time=300(延長預設的程式執行時間)
  3. upload_max_fileszie=20M(放寬檔案上傳的大小)
  4. SMTP=外送主機(Windows下才需要)

VoIP Architecture

Sajax.php加註解

if (!isset($SAJAX_INCLUDED)) {

/*
* GLOBALS AND DEFAULTS
*定義全域變數及其初值
*/
$GLOBALS['sajax_version'] = '0.12';
$GLOBALS['sajax_debug_mode'] = 0;
$GLOBALS['sajax_export_list'] = array();
$GLOBALS['sajax_request_type'] = 'GET';
$GLOBALS['sajax_remote_uri'] = '';
$GLOBALS['sajax_failure_redirect'] = '';

/*
* CODE
*
*/

//
// Initialize the Sajax library.
//
function sajax_init() {
}

//
// Helper function to return the script's own URI.
//
function sajax_get_my_uri() {
return $_SERVER["REQUEST_URI"];
}
$sajax_remote_uri = sajax_get_my_uri();

//
// Helper function to return an eval()-usable representation
// of an object in JavaScript.
//
function sajax_get_js_repr($value) {
$type = gettype($value);

if ($type == "boolean") {
return ($value) ? "Boolean(true)" : "Boolean(false)";
}
elseif ($type == "integer") {
return "parseInt($value)";
}
elseif ($type == "double") {
return "parseFloat($value)";
}
elseif ($type == "array" || $type == "object" ) {
//
// XXX Arrays with non-numeric indices are not
// permitted according to ECMAScript, yet everyone
// uses them.. We'll use an object.
//
$s = "{ ";
if ($type == "object") {
$value = get_object_vars($value);
}
foreach ($value as $k=>$v) {
$esc_key = sajax_esc($k);
if (is_numeric($k))
$s .= "$k: " . sajax_get_js_repr($v) . ", ";
else
$s .= "\"$esc_key\": " . sajax_get_js_repr($v) . ", ";
}
if (count($value))
$s = substr($s, 0, -2);
return $s . " }";
}
else {
$esc_val = sajax_esc($value);
$s = "'$esc_val'";
return $s;
}
}

function sajax_handle_client_request() {
global $sajax_export_list;

$mode = "";

if (! empty($_GET["rs"]))
$mode = "get";

if (!empty($_POST["rs"]))
$mode = "post";

if (empty($mode))
return;

$target = "";

if ($mode == "get") {
// Bust cache in the head
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// always modified
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
$func_name = $_GET["rs"];
if (! empty($_GET["rsargs"]))
$args = $_GET["rsargs"];
else
$args = array();
}
else {
$func_name = $_POST["rs"];
if (! empty($_POST["rsargs"]))
$args = $_POST["rsargs"];
else
$args = array();
}

if (! in_array($func_name, $sajax_export_list))
echo "-:$func_name not callable";
else {
echo "+:";
$result = call_user_func_array($func_name, $args);
echo "var res = " . trim(sajax_get_js_repr($result)) . "; res;";
}
exit;
}

function sajax_get_common_js() {
global $sajax_debug_mode;
global $sajax_request_type;
global $sajax_remote_uri;
global $sajax_failure_redirect;

$t = strtoupper($sajax_request_type);
if ($t != "" && $t != "GET" && $t != "POST")
return "// Invalid type: $t.. \n\n";

ob_start();
?>

// remote scripting library
// (c) copyright 2005 modernmethod, inc
var sajax_debug_mode = ;
var sajax_request_type = "";
var sajax_target_id = "";
var sajax_failure_redirect = "";

function sajax_debug(text) {
if (sajax_debug_mode)
alert(text);
}

function sajax_init_object() {
sajax_debug("sajax_init_object() called..")

var A;

var msxmlhttp = new Array(
'Msxml2.XMLHTTP.5.0',
'Msxml2.XMLHTTP.4.0',
'Msxml2.XMLHTTP.3.0',
'Msxml2.XMLHTTP',
'Microsoft.XMLHTTP');
for (var i = 0; i < msxmlhttp.length; i++) {
try {
A = new ActiveXObject(msxmlhttp[i]);
} catch (e) {
A = null;
}
}

if(!A && typeof XMLHttpRequest != "undefined")
A = new XMLHttpRequest();
if (!A)
sajax_debug("Could not create connection object.");
return A;
}

var sajax_requests = new Array();

function sajax_cancel() {
for (var i = 0; i < sajax_requests.length; i++)
sajax_requests[i].abort();
}

function sajax_do_call(func_name, args) {
var i, x, n;
var uri;
var post_data;
var target_id;

sajax_debug("in sajax_do_call().." + sajax_request_type + "/" + sajax_target_id);
target_id = sajax_target_id;
if (typeof(sajax_request_type) == "undefined" || sajax_request_type == "")
sajax_request_type = "GET";

uri = "";
if (sajax_request_type == "GET") {

if (uri.indexOf("?") == -1)
uri += "?rs=" + escape(func_name);
else
uri += "&rs=" + escape(func_name);
uri += "&rst=" + escape(sajax_target_id);
uri += "&rsrnd=" + new Date().getTime();

for (i = 0; i < args.length-1; i++)
uri += "&rsargs[]=" + escape(args[i]);

post_data = null;
}
else if (sajax_request_type == "POST") {
post_data = "rs=" + escape(func_name);
post_data += "&rst=" + escape(sajax_target_id);
post_data += "&rsrnd=" + new Date().getTime();

for (i = 0; i < args.length-1; i++)
post_data = post_data + "&rsargs[]=" + escape(args[i]);
}
else {
alert("Illegal request type: " + sajax_request_type);
}

x = sajax_init_object();
if (x == null) {
if (sajax_failure_redirect != "") {
location.href = sajax_failure_redirect;
return false;
} else {
sajax_debug("NULL sajax object for user agent:\n" + navigator.userAgent);
return false;
}
} else {
x.open(sajax_request_type, uri, true);
// window.open(uri);

sajax_requests[sajax_requests.length] = x;

if (sajax_request_type == "POST") {
x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1");
x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
}

x.onreadystatechange = function() {
if (x.readyState != 4)
return;

sajax_debug("received " + x.responseText);

var status;
var data;
var txt = x.responseText.replace(/^\s*|\s*$/g,"");
status = txt.charAt(0);
data = txt.substring(2);

if (status == "") {
// let's just assume this is a pre-response bailout and let it slide for now
} else if (status == "-")
alert("Error: " + data);
else {
if (target_id != "")
document.getElementById(target_id).innerHTML = eval(data);
else {
try {
var callback;
var extra_data = false;
if (typeof args[args.length-1] == "object") {
callback = args[args.length-1].callback;
extra_data = args[args.length-1].extra_data;
} else {
callback = args[args.length-1];
}
callback(eval(data), extra_data);
} catch (e) {
sajax_debug("Caught error " + e + ": Could not eval " + data );
}
}
}
}
}

sajax_debug(func_name + " uri = " + uri + "/post = " + post_data);
x.send(post_data);
sajax_debug(func_name + " waiting..");
delete x;
return true;
}

$html = ob_get_contents();
ob_end_clean();
return $html;
}

function sajax_show_common_js() {
echo sajax_get_common_js();
}

// javascript escape a value
function sajax_esc($val)
{
$val = str_replace("\\", "\\\\", $val);
$val = str_replace("\r", "\\r", $val);
$val = str_replace("\n", "\\n", $val);
$val = str_replace("'", "\\'", $val);
return str_replace('"', '\\"', $val);
}

function sajax_get_one_stub($func_name) {
ob_start();
?>

// wrapper for

function x_() {
sajax_do_call("",
x_.arguments);
}

$html = ob_get_contents();
ob_end_clean();
return $html;
}

function sajax_show_one_stub($func_name) {
echo sajax_get_one_stub($func_name);
}

function sajax_export() {
global $sajax_export_list;

$n = func_num_args();
for ($i = 0; $i < $n; $i++) {
$sajax_export_list[] = func_get_arg($i);
}
}

$sajax_js_has_been_shown = 0;
function sajax_get_javascript()
{
global $sajax_js_has_been_shown;
global $sajax_export_list;

$html = "";
if (! $sajax_js_has_been_shown) {
$html .= sajax_get_common_js();
$sajax_js_has_been_shown = 1;
}
foreach ($sajax_export_list as $func) {
$html .= sajax_get_one_stub($func);
}
return $html;
}

function sajax_show_javascript()
{
echo sajax_get_javascript();
}


$SAJAX_INCLUDED = 1;
}
?>

簡報技巧

簡報應強調之重點
  • Motivation
  • Problem Definition
  • Related Work
(另一版本)
  • Motivation最重要
  • 例子要簡單易懂
    ps.可多利用Wireshark查封包、解釋各種現象
  • 不要過分強調技術細節
  • A picture speaks louder than words.
注意事項
  • 避免一頁有大量的文字
  • 少用formula
  • 多用examples.figures
*重點不在你講了多少,而在於台下的人聽進了多少。
*簡報,要讓聽者的頭腦能動起來。(請考慮聽者的背景)
(2008/2/12)

有關meeting 簡報
*meeting的意義:讓實驗室的同仁能多方了解與自己研究領域相關的新知或工具,重點在「了解」。
同樣地,簡報的重點不在技術細節,而是讓台下的人能夠跟得上、能夠跟著你的簡報思考。如果能夠給人新的發想,這場簡報對聽者就是值回票價了。
(當然不是說技術細節不重要,但是要用一個一個的範例呈現演說主題的所需的技術範壔。)
所以,為了不要讓自己和台下的人浪費這一個半小時的時間,要認真準備,裨能增進自己邏輯思考能力、簡報能力,和同伴們的知識範圍。

啟動SIP Fluoroscope

前言:
啟動SIP Fluoroscope 有自動(使用shell script)及手動兩種方法,建議先使用手動啟動,若未能啟動成功,比較容易了解問題出在哪個環節。

用sipfluoroscope.sh命令稿啟動:命令稿如下。

#!/usr/local/bin/bash #使用bash執行
# Author : Sepp Wang ( pennywang.tw @ yahoo.com.tw )
# Date : 2007/03/27
# Purpose : Start the SIP Fluoroscope at system startup

SIPFLUOROSCOPE='/home/martensite/www/sipmagnifier/captor.exe | /home/martensite/www/sipmagnifier/dissector_lite.php'
#pipeline 執行captor.exe及dissector_lite.php
SIPFLUOROSCOPE_PID_FILE='/var/run/sipfluoroscope.pid'
SIPFLUOROSCOPE_PID=$(cat $SIPFLUOROSCOPE_PID_FILE)

function USAGE() #定義function USAGE
{
echo -e " Usage : $0 [start|stop|restart]" #顯示Usage:sipfluoroscope 開始、停止、重啟($0為SIPFLUOROSCOPE ←檔案名稱)
}
# ---- Main ------
if [ X$# == X0 ] #若命令列參數為0(?)
then
$SIPFLUOROSCOPE & #背景執行
echo $! > /var/run/sipfluoroscope.pid #顯示process id
elif [ X$# == X1 ] #若命令列參數為1(?)
then
case $1 in #比對字串樣式
start) echo "Starting SIP Fluoroscope ..." #若case $1=start,則顯示開始的訊息
$SIPFLUOROSCOPE & #背景執行
echo $! > /var/run/sipfluoroscope.pid #顯示process id
echo "Done." #結束
;; #跳至esac

stop) echo "Stoping SIP Fluoroscope ..." #若case $1=stop,則顯示停止系統的訊息
kill $DISSECTOR_PID #刪除DISSECTOR的process id
echo "Done." #結束
;;
restart) echo "Restarting SIP Fluoroscope ..." #若case $1為restart,則顯示重啟系統的訊息
kill $SIPFLUOROSCOPE_PID #刪除process id
$SIPFLUOROSCOPE & #背景執行
echo $! > /var/run/sipfluoroscope.pid #顯示process id
echo "Done." #結束
;;
*) USAGE
;;
esac #case 迴圈終止
else
USAGE
fi #命令稿結束

#update by tintin on Sep.27

=====================

手動啟動:Step by step
/**Manually**/
1.$cd /home/martensite/www/sipmagnifier
2$sudo ./captor.exe | ./dissector_lite.php &
找不到device r10,應該是因為沒有root權限→所以,至少要有sudoer權限才可啟動

3.ps -aux | grep captor %顯示自己和其它人的 process
ps -aux | grep dissector %check these two PIDs,and they should contiguous


Web Technology note(1)

9/11
http→mime:can transport video.voice...multimedia
java/applet (client)
\servlet (server) cf:cgi

/Java-applet
\plug-in


*IEEE Internet computing magazine

Who invented web?
w3c executive.

/HTTP
\TCP security.reliable base to transmot cf:RTP.UDP(unreiable)

(protocol of different layers)

*HW deadline:12:00 pm. Mon

DNS server and 查號台

XSL.SMIL?

RTSP:jump to a desired point of movie downloading(random access)

proxy:代理, make a copy of data

要記起來的首字縮寫字

3GPP:Third Generation Partnership Project(ETSI)

ARP:Address Resolution Protocol位址查解協定
IMS:IP Multimedia (Sub)system
WiMAX:Worldwide interoperability Microwave Access(Where is X??)
IEEE:Institute of Electrical and Electronic Engeerers
RFC:Request For Comments
SMTP:Simple Mail Transport Protocol
ENUM:

VoIP:Voice over IP( see also :DTMF)
DTMF:Dual Tone Multi-Frequency encoding of numbers(??)
ADSL:Asymmetric Digital Subscriber Line
B2BUA:Back to Back User Agent
UAS:User Agent Server
UAC:User Agent Client
OAM:Operation,Administration and Maintenance
PSTN:Public Switched Telephone Network
PBX:Packet Branch Exchange
ISP:Internet Service Provider
ISDN:Intergrated Services Digital Network
NAT:Network Address Translator (cf:NAPT)
NAPT:Network Address and Port Translation
ALG:Application Layer Gateway
STUN:Simple Traversal Underneath NATs)
TANet:
IETF:Internet Engineering Task Force, the Internet standard body
MIME:Multipurpose Internet Mail Extension Protocol
SIP:Session Initiation Protocol
SDP:Session Description Protocol(simple plain text document,usually in the body of SIP message that describes the capability of an internet end point)(RFC ?)
CSeq:Sequential number of SIP requests within a SIP dialog(the number is used to detect out of order requests and retransmissions)
AP:Access Point
RTP:Real Time Streaming Protocol(Realtime Transport Protocol)
DNS:Domain Name Service
NAPTR:Naming Authority Pointer
SER:SIP Express Router
GNU:?
GPL:General ? License
LDAP:Lightweight Directory Access Protocol
SMS:Simple Message ?
FAQ:Frequently Asked Questions
BELLcore:communication Research
TTL:Time to Live(hop to live)
SIPit:SIP Interoperability Test)
Reference:
http://www.iptel.org/glossary

2007年9月10日 星期一

GDS(Global Dialing Scheme)

GDS(Global Dialing Scheme)
format:
  • the Internet Access Code(IAC):the world gatekeeper prefix, defined as 00
  • a Country Code(CC)
  • an Organization Prefix(OP)
  • an Endpoint Number(EN)

[Weekly Report]2007.9.1-2007.9.7

1.Continue RFC3261 and Bash manual page:
1.1 Forward 7 pages of RFC 3261 and take notes of it(to page 27 on Sep5).
1.2 the History section of Bash manual page

2.Prepare for the Entrance Exam Practice writing the research report.

VoIP Foro -- SIP Architecture:Session Initiation Protocol

main objective of SIP:
  1. the communication between multimedia devices.
  2. SIP makes the communication possible thanks to:
  • RTP/RTCP(used to transport voice data in real time)
  • SDP(used to negotiate the participant capbilities)

3. an application-layer control protocol

4. a signaling protocol for Internet Telephony

5. establish sessions for features such as audio/video conferencing, interactive gamimg and call forwarding to be deployed over IP networks

About WiMAX Proposal

About WiMAX Proposal
Milestones
  • Aug.27-Sep.3:Internal testing inside NCNU campus
  • Sep.5-Sep.15:Install,configure, and test application system in ITRI
  • Oct.1:Showcase the application to ITRI
  • Oct.22:Demonstrate the application at the Taiwan WiMAX Forum F2F Meeting

Demo key point:

  • Lecture Streaming
  • English Listening
  • Real-time Collaboration

Script(by beautidays)

It is 8:00 in the morning.John who is an expert of GDB is sitting on the bench in the park.He eats breakfast and practices his english listening ability.He connects to the NCNU English Classroom, the English listening website provided by NCNU.

NCNU English Classroom, http://english.csie.ncnu.edu.tw, is provided to improve English ability of NCNU students.The main function is the listening part with VOA news and ICRT for English listening practicing. It provides synchronous subtitles and interactive audio-On-Demand function. Through WiMAX, we can extend this service anywhere.


Mary studies in National Chi-Nan University. She goes to school by shuttle bus every weekday.She spends 30 minutes to take the bus one day, 15 to go to school, 15 to go downtown. She also spends extra at most 30 minutes to wait for the bus each weekday, because there are two runs in an hour. Therefore, she wastes at most one hour to idle or do nothing but chatting on the bus. However, she has more options now due to WiMAX. Her first class is GDB(這裡是否要用同位語說明一下GDB是什麼,eg, an open source debug tool), and she is doing preparation for lessons before class. She reviews the presentation about the introduction of GDB uploaded at the server, http://XMS.voip.edu.tw/xms/. This website supports Powercam that can record and share the presentations including the slide show, voice of speakers, the cursor on the screen, and the strokes marked by the mouse. Through WiMAX, we can use this service everywhere. When Mary is doing the review, she is a little bit confused.
She makes a phone call to the Help Desk Personnel to ask help solve her problem.(文法怪~)


Operator:NCNU Call Center. May I help you?
Mary:Hello, I have a question about GDB. I compile a source code with the command "gcc -g" and the file name following. The execution file, a.out, will be produced. How could I change the execution file name?
Operator:hmm...,Sorry, I can't solve the question for you. Please wait for a while. I will transfer your call to our expert of GDB.

The assistant searches an expert who is good at GDB and transfers the call to him. Although the expert isn't seated in the office or library, he also can get the call.

John:This is John. May I help you?
Mary:Hello, This is Mary. I have a question about GDB.


Mary repeats the question to the expert.


John:OK, It's easy. You just have to add the option -o and the file name as you want. For example, if the source code is "test.c" and the new name is test, the command is "gcc -g test.c -o test". After that, the execution file, test, will be created.
Mary:I see. Thank you very much.
John:You're welcome.


It is a good extension of WiMAX because we can learn anywhere and anytime.We don't have to waste time due to the limitation of space.

------

行前準備事宜:

必備物品:

兩台筆電

完整的台詞講稿

rundown

相機


Libpcap note

在Unix/Linux從kernel獲得封包的工具。獨立API接口,為底層網路監控提供一個可移植的框架,可用於網路統計收集、安全監控、網路調試…等工作。
cf.Winpcap:同libpcap,支援Win32平台
  • NPF(Netgroup Packet Filter)
  • packet.dll
  • wpcap.dll

基本function

pcap_lookupdev(); //設定網路設備,回傳一個可使用的device,refer to "lookupdev.c";char *pcpa_lookupdev(char *errbuf)

pcap_lookupnet(); //設定網域;const char *device,bpf_u_int32 *netp,bpf_u_int32 *maskp,char *errbuf)

//找network number and mask

開始一個session:

pcpa_open_live(); //開始網路介面卡以準備進行封包交換

擷取packet:

pcap_next(); //refer to "pcap_next.c" and "timestamp.c"

只抓想要的packet(filter)

pcap_compile(); //編譯正規過濾語

pcap_setfilter(); //設定過濾器

Application built on libpcap

  • ntop(network top)
  • snort( 區分正常及惡意的封包)
  • wireshark

Install libpcap

./config

make

sudo make install


Reference:

http://en.wikipedia.org/wiki/Libpcap

http://www.tcpdump.org/pcap.htm

RFC3261 notes

SIP(Session Initiation Protocol)

Structure of SIP:

  • syntax and encoding
  • transport layer
  • transaction layer(note:stateful proxy及UA才有transaction layer)
8.General User Agent Behavior
UAC and UAS procedurres depend on:
  1. inside or outside of a dialog
  2. method of request
Header of MUST contain:To,From,CSeq,Call-ID,Max-Forwards,Via
Request URI:
To: ex: To: Carol
From
tag

the types of response
  • 1xx:Provisional
  • 2xx:Successful
  • 3xx:Redirectional
  • 4xx:Client Failure
  • 5xx:Server Failure
  • 6xx:Global Failure
  • to be continued...

以下是充場面用的目錄:(自己用來複習、理思路)

1 Introduction ........................................ 8
2 Overview of SIP Functionality ....................... 9
3 Terminology ......................................... 10
4 Overview of Operation ............................... 10
5 Structure of the Protocol ........................... 18
6 Definitions ......................................... 20
7 SIP Messages ........................................ 26
7.1 Requests ............................................ 27
7.2 Responses ........................................... 28
7.3 Header Fields ....................................... 29
7.3.1 Header Field Format ................................. 30
7.3.2 Header Field Classification ......................... 32
7.3.3 Compact Form ........................................ 32
7.4 Bodies .............................................. 33
7.4.1 Message Body Type ................................... 33
7.4.2 Message Body Length ................................. 33
7.5 Framing SIP Messages ................................ 34
8 General User Agent Behavior ......................... 34
8.1 UAC Behavior ........................................ 35
8.1.1 Generating the Request .............................. 35
8.1.1.1 Request-URI ......................................... 35
8.1.1.2 To .................................................. 36
8.1.1.3 From ................................................ 37
8.1.1.4 Call-ID ............................................. 37
8.1.1.5 CSeq ................................................ 38
8.1.1.6 Max-Forwards ........................................ 38
8.1.1.7 Via ................................................. 39
8.1.1.8 Contact ............................................. 40
8.1.1.9 Supported and Require ............................... 40
8.1.1.10 Additional Message Components ....................... 41
8.1.2 Sending the Request ................................. 41
8.1.3 Processing Responses ................................ 42
8.1.3.1 Transaction Layer Errors ............................ 42
8.1.3.2 Unrecognized Responses .............................. 42
8.1.3.3 Vias ................................................ 43
8.1.3.4 Processing 3xx Responses ............................ 43
8.1.3.5 Processing 4xx Responses ............................ 45
8.2 UAS Behavior ........................................ 46
8.2.1 Method Inspection ................................... 46
8.2.2 Header Inspection ................................... 46
8.2.2.1 To and Request-URI .................................. 46
8.2.2.2 Merged Requests ..................................... 47
8.2.2.3 Require ............................................. 47
8.2.3 Content Processing .................................. 48
8.2.4 Applying Extensions ................................. 49
8.2.5 Processing the Request .............................. 49


8.2.6 Generating the Response ............................. 49
8.2.6.1 Sending a Provisional Response ...................... 49
8.2.6.2 Headers and Tags .................................... 50
8.2.7 Stateless UAS Behavior .............................. 50
8.3 Redirect Servers .................................... 51
9 Canceling a Request ................................. 53
9.1 Client Behavior ..................................... 53
9.2 Server Behavior ..................................... 55
10 Registrations ....................................... 56
10.1 Overview ............................................ 56
10.2 Constructing the REGISTER Request ................... 57
10.2.1 Adding Bindings ..................................... 59
10.2.1.1 Setting the Expiration Interval of Contact Addresses 60
10.2.1.2 Preferences among Contact Addresses ................. 61
10.2.2 Removing Bindings ................................... 61
10.2.3 Fetching Bindings ................................... 61
10.2.4 Refreshing Bindings ................................. 61
10.2.5 Setting the Internal Clock .......................... 62
10.2.6 Discovering a Registrar ............................. 62
10.2.7 Transmitting a Request .............................. 62
10.2.8 Error Responses ..................................... 63
10.3 Processing REGISTER Requests ........................ 63
11 Querying for Capabilities ........................... 66
11.1 Construction of OPTIONS Request ..................... 67
11.2 Processing of OPTIONS Request ....................... 68
12 Dialogs ............................................. 69
12.1 Creation of a Dialog ................................ 70
12.1.1 UAS behavior ........................................ 70
12.1.2 UAC Behavior ........................................ 71
12.2 Requests within a Dialog ............................ 72
12.2.1 UAC Behavior ........................................ 73
12.2.1.1 Generating the Request .............................. 73
12.2.1.2 Processing the Responses ............................ 75
12.2.2 UAS Behavior ........................................ 76
12.3 Termination of a Dialog ............................. 77
13 Initiating a Session ................................ 77
13.1 Overview ............................................ 77
13.2 UAC Processing ...................................... 78
13.2.1 Creating the Initial INVITE ......................... 78
13.2.2 Processing INVITE Responses ......................... 81
13.2.2.1 1xx Responses ....................................... 81
13.2.2.2 3xx Responses ....................................... 81
13.2.2.3 4xx, 5xx and 6xx Responses .......................... 81
13.2.2.4 2xx Responses ....................................... 82
13.3 UAS Processing ...................................... 83
13.3.1 Processing of the INVITE ............................ 83
13.3.1.1 Progress ............................................ 84
13.3.1.2 The INVITE is Redirected ............................ 84

13.3.1.3 The INVITE is Rejected .............................. 85
13.3.1.4 The INVITE is Accepted .............................. 85
14 Modifying an Existing Session ....................... 86
14.1 UAC Behavior ........................................ 86
14.2 UAS Behavior ........................................ 88
15 Terminating a Session ............................... 89
15.1 Terminating a Session with a BYE Request ............ 90
15.1.1 UAC Behavior ........................................ 90
15.1.2 UAS Behavior ........................................ 91
16 Proxy Behavior ...................................... 91
16.1 Overview ............................................ 91
16.2 Stateful Proxy ...................................... 92
16.3 Request Validation .................................. 94
16.4 Route Information Preprocessing ..................... 96
16.5 Determining Request Targets ......................... 97
16.6 Request Forwarding .................................. 99
16.7 Response Processing ................................. 107
16.8 Processing Timer C .................................. 114
16.9 Handling Transport Errors ........................... 115
16.10 CANCEL Processing ................................... 115
16.11 Stateless Proxy ..................................... 116
16.12 Summary of Proxy Route Processing ................... 118
16.12.1 Examples ............................................ 118
16.12.1.1 Basic SIP Trapezoid ................................. 118
16.12.1.2 Traversing a Strict-Routing Proxy ................... 120
16.12.1.3 Rewriting Record-Route Header Field Values .......... 121
17 Transactions ........................................ 122
17.1 Client Transaction .................................. 124
17.1.1 INVITE Client Transaction ........................... 125
17.1.1.1 Overview of INVITE Transaction ...................... 125
17.1.1.2 Formal Description .................................. 125
17.1.1.3 Construction of the ACK Request ..................... 129
17.1.2 Non-INVITE Client Transaction ....................... 130
17.1.2.1 Overview of the non-INVITE Transaction .............. 130
17.1.2.2 Formal Description .................................. 131
17.1.3 Matching Responses to Client Transactions ........... 132
17.1.4 Handling Transport Errors ........................... 133
17.2 Server Transaction .................................. 134
17.2.1 INVITE Server Transaction ........................... 134
17.2.2 Non-INVITE Server Transaction ....................... 137
17.2.3 Matching Requests to Server Transactions ............ 138
17.2.4 Handling Transport Errors ........................... 141
18 Transport ........................................... 141
18.1 Clients ............................................. 142
18.1.1 Sending Requests .................................... 142
18.1.2 Receiving Responses ................................. 144
18.2 Servers ............................................. 145
18.2.1 Receiving Requests .................................. 145

18.2.2 Sending Responses ................................... 146
18.3 Framing ............................................. 147
18.4 Error Handling ...................................... 147
19 Common Message Components ........................... 147
19.1 SIP and SIPS Uniform Resource Indicators ............ 148
19.1.1 SIP and SIPS URI Components ......................... 148
19.1.2 Character Escaping Requirements ..................... 152
19.1.3 Example SIP and SIPS URIs ........................... 153
19.1.4 URI Comparison ...................................... 153
19.1.5 Forming Requests from a URI ......................... 156
19.1.6 Relating SIP URIs and tel URLs ...................... 157
19.2 Option Tags ......................................... 158
19.3 Tags ................................................ 159
20 Header Fields ....................................... 159
20.1 Accept .............................................. 161
20.2 Accept-Encoding ..................................... 163
20.3 Accept-Language ..................................... 164
20.4 Alert-Info .......................................... 164
20.5 Allow ............................................... 165
20.6 Authentication-Info ................................. 165
20.7 Authorization ....................................... 165
20.8 Call-ID ............................................. 166
20.9 Call-Info ........................................... 166
20.10 Contact ............................................. 167
20.11 Content-Disposition ................................. 168
20.12 Content-Encoding .................................... 169
20.13 Content-Language .................................... 169
20.14 Content-Length ...................................... 169
20.15 Content-Type ........................................ 170
20.16 CSeq ................................................ 170
20.17 Date ................................................ 170
20.18 Error-Info .......................................... 171
20.19 Expires ............................................. 171
20.20 From ................................................ 172
20.21 In-Reply-To ......................................... 172
20.22 Max-Forwards ........................................ 173
20.23 Min-Expires ......................................... 173
20.24 MIME-Version ........................................ 173
20.25 Organization ........................................ 174
20.26 Priority ............................................ 174
20.27 Proxy-Authenticate .................................. 174
20.28 Proxy-Authorization ................................. 175
20.29 Proxy-Require ....................................... 175
20.30 Record-Route ........................................ 175
20.31 Reply-To ............................................ 176
20.32 Require ............................................. 176
20.33 Retry-After ......................................... 176
20.34 Route ............................................... 177


20.35 Server .............................................. 177
20.36 Subject ............................................. 177
20.37 Supported ........................................... 178
20.38 Timestamp ........................................... 178
20.39 To .................................................. 178
20.40 Unsupported ......................................... 179
20.41 User-Agent .......................................... 179
20.42 Via ................................................. 179
20.43 Warning ............................................. 180
20.44 WWW-Authenticate .................................... 182
21 Response Codes ...................................... 182
21.1 Provisional 1xx ..................................... 182
21.1.1 100 Trying .......................................... 183
21.1.2 180 Ringing ......................................... 183
21.1.3 181 Call Is Being Forwarded ......................... 183
21.1.4 182 Queued .......................................... 183
21.1.5 183 Session Progress ................................ 183
21.2 Successful 2xx ...................................... 183
21.2.1 200 OK .............................................. 183
21.3 Redirection 3xx ..................................... 184
21.3.1 300 Multiple Choices ................................ 184
21.3.2 301 Moved Permanently ............................... 184
21.3.3 302 Moved Temporarily ............................... 184
21.3.4 305 Use Proxy ....................................... 185
21.3.5 380 Alternative Service ............................. 185
21.4 Request Failure 4xx ................................. 185
21.4.1 400 Bad Request ..................................... 185
21.4.2 401 Unauthorized .................................... 185
21.4.3 402 Payment Required ................................ 186
21.4.4 403 Forbidden ....................................... 186
21.4.5 404 Not Found ....................................... 186
21.4.6 405 Method Not Allowed .............................. 186
21.4.7 406 Not Acceptable .................................. 186
21.4.8 407 Proxy Authentication Required ................... 186
21.4.9 408 Request Timeout ................................. 186
21.4.10 410 Gone ............................................ 187
21.4.11 413 Request Entity Too Large ........................ 187
21.4.12 414 Request-URI Too Long ............................ 187
21.4.13 415 Unsupported Media Type .......................... 187
21.4.14 416 Unsupported URI Scheme .......................... 187
21.4.15 420 Bad Extension ................................... 187
21.4.16 421 Extension Required .............................. 188
21.4.17 423 Interval Too Brief .............................. 188
21.4.18 480 Temporarily Unavailable ......................... 188
21.4.19 481 Call/Transaction Does Not Exist ................. 188
21.4.20 482 Loop Detected ................................... 188
21.4.21 483 Too Many Hops ................................... 189
21.4.22 484 Address Incomplete .............................. 189

21.4.23 485 Ambiguous ....................................... 189
21.4.24 486 Busy Here ....................................... 189
21.4.25 487 Request Terminated .............................. 190
21.4.26 488 Not Acceptable Here ............................. 190
21.4.27 491 Request Pending ................................. 190
21.4.28 493 Undecipherable .................................. 190
21.5 Server Failure 5xx .................................. 190
21.5.1 500 Server Internal Error ........................... 190
21.5.2 501 Not Implemented ................................. 191
21.5.3 502 Bad Gateway ..................................... 191
21.5.4 503 Service Unavailable ............................. 191
21.5.5 504 Server Time-out ................................. 191
21.5.6 505 Version Not Supported ........................... 192
21.5.7 513 Message Too Large ............................... 192
21.6 Global Failures 6xx ................................. 192
21.6.1 600 Busy Everywhere ................................. 192
21.6.2 603 Decline ......................................... 192
21.6.3 604 Does Not Exist Anywhere ......................... 192
21.6.4 606 Not Acceptable .................................. 192
22 Usage of HTTP Authentication ........................ 193
22.1 Framework ........................................... 193
22.2 User-to-User Authentication ......................... 195
22.3 Proxy-to-User Authentication ........................ 197
22.4 The Digest Authentication Scheme .................... 199
23 S/MIME .............................................. 201
23.1 S/MIME Certificates ................................. 201
23.2 S/MIME Key Exchange ................................. 202
23.3 Securing MIME bodies ................................ 205
23.4 SIP Header Privacy and Integrity using S/MIME:
Tunneling SIP ....................................... 207
23.4.1 Integrity and Confidentiality Properties of SIP
Headers ............................................. 207
23.4.1.1 Integrity ........................................... 207
23.4.1.2 Confidentiality ..................................... 208
23.4.2 Tunneling Integrity and Authentication .............. 209
23.4.3 Tunneling Encryption ................................ 211
24 Examples ............................................ 213
24.1 Registration ........................................ 213
24.2 Session Setup ....................................... 214
25 Augmented BNF for the SIP Protocol .................. 219
25.1 Basic Rules ......................................... 219
26 Security Considerations: Threat Model and Security
Usage Recommendations ............................... 232
26.1 Attacks and Threat Models ........................... 233
26.1.1 Registration Hijacking .............................. 233
26.1.2 Impersonating a Server .............................. 234
26.1.3 Tampering with Message Bodies ....................... 235
26.1.4 Tearing Down Sessions ............................... 23

26.1.5 Denial of Service and Amplification ................. 236
26.2 Security Mechanisms ................................. 237
26.2.1 Transport and Network Layer Security ................ 238
26.2.2 SIPS URI Scheme ..................................... 239
26.2.3 HTTP Authentication ................................. 240
26.2.4 S/MIME .............................................. 240
26.3 Implementing Security Mechanisms .................... 241
26.3.1 Requirements for Implementers of SIP ................ 241
26.3.2 Security Solutions .................................. 242
26.3.2.1 Registration ........................................ 242
26.3.2.2 Interdomain Requests ................................ 243
26.3.2.3 Peer-to-Peer Requests ............................... 245
26.3.2.4 DoS Protection ...................................... 246
26.4 Limitations ......................................... 247
26.4.1 HTTP Digest ......................................... 247
26.4.2 S/MIME .............................................. 248
26.4.3 TLS ................................................. 249
26.4.4 SIPS URIs ........................................... 249
26.5 Privacy ............................................. 251
27 IANA Considerations ................................. 252
27.1 Option Tags ......................................... 252
27.2 Warn-Codes .......................................... 252
27.3 Header Field Names .................................. 253
27.4 Method and Response Codes ........................... 253
27.5 The "message/sip" MIME type. ....................... 254
27.6 New Content-Disposition Parameter Registrations ..... 255
28 Changes From RFC 2543 ............................... 255
28.1 Major Functional Changes ............................ 255
28.2 Minor Functional Changes ............................ 260


研究需用的PHP function整理

mail($to,$subject,$message)

//mail function
mail("收件人","信件主題", 信件內容[, 標頭]);
?>

eg.


mail("jacch@pchome.com.tw","hi!您好","這封信件是用mail()函式發送的信件!");
?>

Linux 下安裝無線網卡

  • $ lopci grep controller
  • 找wireless or network的keywords
  • eg.在ASUS M2N找到Intel corporation PRO/Wireless LAN 21003B Mini PCI Adapter
  • 要裝上kernel module和firmware

Ad-Hoc and SIP

(我承認我看不太懂這篇,就連什麼是Ad-Hoc都搞不清楚
)
ubiquitous communication
decentralized
Mobile Ad-Hoc Networks(MANET)

SIP location service
SIP Cache
/a framework:doesn't support centralized servers;dSIP(decentralized SIP)
\a algorithm:PCache
  • embed a subset of SIP server proxy and registar server function in each end node.
SIP PCache
Message Type REGISTER Dissemination
MESSAGE Query
200OK Query reply

Header name Max-Forwards TTL
Form Source
Call-ID Serial Number
CSeq Time from Storage
Via Route Stack
Content-Length #items
Body Items

ISO精神

1.Write down SOP(Standard Operation Procedure).
2.Follow what you have written down.

申請五年一貫修讀研所研究計劃

申請五年一貫修讀研所時所撰寫的研究計劃書。
連結

[Weekly Report]2007.8.25-2007.8.31

1.Read some journal articles and make progress of the documents I must read through:
1.1 Q Focus Journal,Mar 2007,"SIP: Basics and Beyond"
I got some more understanding about SIP concepts(e.g. the transversal of NATs) through this article.
1.2 Q Focus Journal,Mar 2007,"SIP: Decentralizing SIP":
I read this article as a result of the thesis of Sepp Wang. The advisor told me that I might succeed to the sepp's thesis as my research subject. I figure the P2PSIP might be helpful for me. So I collected it in my thesis reading queue.

1.3 魏學文教授,"Introduction of WiMAX",published by 暨大電子雜誌
I also surveyed some documents about WiMAX in the Internet. There are many data about frequency and range of WiMAX. It confuses me.

1.4 Still Stuggle with the manual page of BASH and RFC3261.

2.Learn how to configure the call server:

2.1 The call server,, is supported by Vicotel. I surveyed some documents of GDS (Global Dialing Scheme),and found the routing rules of the call server is based on GDS. From the process of study, I learned more than the tips of configuration. Maybe the research is a kind of logical thinking and self-pursuit. (Just thinking.I'm just a newbie in the research "world".)

2.2 I add two accounts for myself to test. It works in the X-lite,Windows XP environment. When I used the Ekiga,a Linux OS softphone, the account cannot be registered. Strangely, I can register on our lab's server in NCTU<163.22.20.154>. Still continue trying.

3.About the WiMAX Demonstration:
Although I don't have any special skill to help the demonstration, I still want to participate in the work. Try to be a helper in the team and transfer some points I got from the advisor(Maybe I can be a translator and transferor).

[Weekly Report]2007.8.18-2007.8.24

1.Read the assigned reading(as the lab announcement):
1.1 SIP Overview (http://www.cs.columbia.edu/sip/overview.html)
1.2 SIP Tutorial by Jiri Kuthan and Dorgham Sisalem(pp1-pp53)
1.3 RFC3261(continuing taking notes and wandering).

2.Try to install the SIP Fluoroscope system:
2.1 Because I am not familiar with the Linux,I encounter many obstacles in set-up and basic operation of Linux. The manual page of Bash is recommended to get used to the shell. I have read about 10 pages,and today I found the info documents of Bash is easier to read(The book "Unix Power Tools" recommended). It is really more readable for me. But as the info documents say, "The Bash manual page should be used as the definitive reference
on shell behavior", I might read the manual page of bash later.
2.2 I tried the Sajax toolkit to write a program to display the server time.Actually,I just type the code and change some arguments. Just give a try to test the convenience of Sajax.

[Weekly Report]2007.8.11-2007.8.17

1.Read RFC 2116:
I still think the technical documents like RCF series are too difficult for me. I tried to read the document from the beginning again.This time I take a note and make it organized. It really helps! I might can get the feeling of the headcore.

2. Review the basic concepts of Networks:
Because I don't have any textbooks about Networks nearby, I survey some websites to study(but they are in Chinese language). Maybe I should read some English documents.

------
老師:我家網路又斷了,加上在家太懶惰,所以這星期沒什麼進度.(對不起啦! >_<)

昨天我碰到蔡姐,她提醒我應該要和老師和同學保持聯繫; 今天(週一)下午終於有個沒下雨的空檔,就趕緊上了山,可惜沒有先跟老師約好,還好實驗室的學長在, 我.....擅自跟他要了坐位和鑰匙,就在電腦前急就章地寫了這封信(我想這封信的文法和單字應該書錯誤百出吧!還有,搞不懂Fedora的新酷音為什麼 會讓Firefox死當,也讓我同樣的信打了三次才完成). 其它的事週三group meeting時再和您報告. :D

[Weekly Report]2007.8.3-2007.8.10

1.Install Linux OS:
As the former letter, I install Debian/Linux in the computer, but I still have no time configuring the using environment to fit my personal habits(like input methods,fonts... )

2.Scan the seniority's paper:
After thoroughly reading the paper,I find the bottleneck of installing the SIP Fluoroscope system may be using AJAX engine and some captor(such as libpcap). Although we have had some API or framework to handle the puzzle mechanism, but I still can't definitely know how to let them work.

3.Read RFC 3261 and 3665:
RFC 3665 represents a SIP basic call flow example. I have no idea about mechanism how SIP manages signaling. So first I read RFC 3665 to briefly know what SIP can do. I still don't finish the reading of RFC 3261.(Honestly,it is difficult to swallow for me now. Try to chew it!)

4.Write a AJAX version "Hollow World!" program:
Just give it a try!But I found it is very fun that users don't need reload the page to get the reaction. It seems magical.

--------------------------------------------------
霓雅暑假都在家,應該要九月分才回來;還有,老師你之前說這週要針對學長的論文給你一個簡報,或許報告完可以討論之後幾個月我的學習計劃。
除了週一既訂計劃,其它時間都是可自由安排的時段,所以請老師安排時間吧! :)

mySQL常用指令

資料庫相關:
show databases; //顯示有哪些資料庫
CREATE DATABASE 名稱;
DROP DATABASE 名稱;
use 資料庫名稱;

資料表相關:
SHOW TABLES; //顯示有哪些資料表
CREATE TABLE data (
 name char(30),
 email char(70)
);
UPDATE

常用Bash Shell快速鍵

(適用於使用預設的emacs mode,雖然我有時候會改設成vi mode來玩XD)
Ctrl系列:
ctrl+l:清除螢幕(同clear指令)
ctrl+w:清除一個argument
ctrl+u:清除此列
ctrl+a:到此列最前面(如果在同時啟用screen時會confused.....還在找另解。XD)
ctrl+e:到此列最後面

meta系列:(meta鍵指的是alt或esc,但通常alt會被指定為視窗用快速鍵,故我使用esc鍵)
esc+. :重複上一個指令最後的argument(超好用!)

other:
shift+Ins:貼上

英文文法修習心得


1.that and which 要用得好不容易

{family,surname,last} name: 姓
{given,first}name:名



Reference:
觀光局:教育甄試