在floodlight這個openflow controller中,對於module之間的執行順序是如何決定的,這部分很重要
如圖為例,假設有四個component,分別是 LLDP、DEVICE、Forwarding、VirtualNetwork這四個module
如果今天switch送了一個封包到controller來,那這四個module誰要先處理這個封包? 順序交換是否會有影響?
在floodlight這個openflow controller中,對於module之間的執行順序是如何決定的,這部分很重要
如圖為例,假設有四個component,分別是 LLDP、DEVICE、Forwarding、VirtualNetwork這四個module
如果今天switch送了一個封包到controller來,那這四個module誰要先處理這個封包? 順序交換是否會有影響?
用來紀錄2013/06/12日 news系統發生的問題
Python中有個很強大的字串轉換工具 maketrans 跟 translate
str.translate(table[, deletechars]);
Parameters
table -- You can use the maketrans() helper function in the string module to create a translation table.
deletechars -- The list of characters to be removed from the source string.
字串中只要有符合deletechars中的字元都會被刪除,然後剩下的字元就會依照table裡面的mapping來做轉換。
這個mapping的就要利用string.maketrans()來幫忙產生囉,
str.maketrans(intab, outtab]);
Parameters
intab -- This is the string having actual characters.
outtab -- This is the string having corresponding mapping character.
intab跟outtab兩者的長度必須要一樣,會把intab中每一個字元與outtab中相同位置的字元做mapping。
舉例來說
Floodlight把module分成core跟application兩個方向為主
core的部分提供的都是比較核心的功能,譬如PacketIN,PacketOUt,或是拓樸的更動…等
而application則是用這些core的功能來達到一些進階的功能
如防火牆、最短路徑搜尋….等
這邊就簡單研究一下Core Module中的相關功能。
要撰寫IRC 機器人其實不難,網路上到處都有範例,其實就是簡單的NP,字串來回處理而以。
本文基於 Openflow 1.0 的規則書,跟大家分享一下在 Openflow 的規範裡到底什麼叫做 Port, 以及有多少種相關的 Port,在使用上要注意些什麼。
最近在弄irc機器人,希望這個機器人能夠靈活一些,因此把所有功能都弄成module
機器人在掛上這些module來完成各種能力,心中的設想架構如下
--------ircbot
|-------config.json
|
|
|-------server.py
|
|
|-------modules
|
|-----googleSearch
| |
| |---googleSearch.py
|
|-----wikiSearch
| |
| |---wikiSearch.py
|
|-----echoServer
|
|---echoServer.py
在python中也可以利用split的方式把字串按照特定的字元切開
str.split([sep[, maxsplit]])
sep代表用來切割的符號,而maxsplit代表最多切多少個字串。
值得注意的是,sep可以吃多個字元,但是必須是連續字元,如下舉例
1 | a = 'a,b,!c,!d e f :g' |