Skip to content

Instantly share code, notes, and snippets.

View hwchiu's full-sized avatar
🏠
Working from home

HungWei Chiu hwchiu

🏠
Working from home
View GitHub Profile
@hwchiu
hwchiu / topo.py
Last active August 29, 2015 14:02
  1. mininet: mn --controller=remote,ip=127.0.0.1 --topo topo --custom topo.py
  2. h1 ping h4
  3. open other terminal
  4. type "ovs-ofctl dump-flows s2" to make sure the flow is pass through s2.
  5. type "ifocnfig s1-eth1" to shutdown the link between s1 and s2
  6. The result in the mininet promt:
64 bytes from 10.0.0.4: icmp_req=71 ttl=64 time=0.028 ms
64 bytes from 10.0.0.4: icmp_req=72 ttl=64 time=195 ms
64 bytes from 10.0.0.4: icmp_req=73 ttl=64 time=0.157 ms

@左邊電腦

  1. root@controller:/ neturon-server @tty1
  2. root@controller:/home/amy/floodlight_ecmp/: floodlight ..... @tty2
  3. 等他跑一下,可以看floodlight console有沒有噴計算完畢相關的訊息

@右邊筆電

  1. root@controller:/ cd home/amy/code_test/$VAR1 screen-9
  2. sh simple_random_VM..sh Ubuntu-exp2 執行此指令去創造vm
@hwchiu
hwchiu / gist:8b7bab91b5ec56f43380
Created June 12, 2014 11:25
DeviceManagerImpl.java
protected Command processPacketInMessage(IOFSwitch sw, OFPacketIn pi,
FloodlightContext cntx) {
Ethernet eth =
IFloodlightProviderService.bcStore.
get(cntx,IFloodlightProviderService.CONTEXT_PI_PAYLOAD);
logger.error("ethernet:{}",eth.toString());
....
....
...

Create topology

sudo mn --topo single,3 --mac

Configuration

  • In the mininet prompt
    1. h3 ifconfig h3-eth0 30.0.0.3
    2. h1 route add default gw 10.0.0.254 h1-eth0
  1. h3 route add default gw 30.0.0.254 h3-eth0
@hwchiu
hwchiu / gist:ecb6c0bc7acfe6b0d41e
Last active August 29, 2015 14:02
畢業致詞
各位師長、家長以及在座所有的畢業生們大家好,
今天,是個特別的日子
為什麼特別?
是因為一群人穿者碩士袍聚在一起?
還是因為你父母從遠方而來參加這場畢業典禮?
亦或是你等等準備上台接受撥穗?
都不是
真正的特別的是,過了今天以後,你還是不能畢業
#include<iostream>
using namespace std;
int rightLine,leftLine,upperLine,downLine;
int t1,t2,t3,t4;
int main(){
int times;
int count;
cin >> times;
for(int i=0;i<times;i++){
cin >> count;
@hwchiu
hwchiu / gist:63d8469ffba148464c87
Last active August 29, 2015 14:01
OVS releated paper
@hwchiu
hwchiu / nat.py
Created May 6, 2014 10:47
Nat.py supports remote controller
#!/usr/bin/python
"""
Example to create a Mininet topology and connect it to the internet via NAT
through eth0 on the host.
Glen Gibb, February 2011
(slight modifications by BL, 5/13)
"""
@hwchiu
hwchiu / gist:11318638
Created April 26, 2014 12:15
for amy
#!/usr/bin/perl
select(STDOUT);
$| = 2;
while (<>) {
print "[".localtime()."] $_"
}

Flow path highlight

  • 定期透過 restful api 從controller那邊取得每個switch上面的flow entry資訊
  • 使用者輸入其想要觀察的封包特徵與進入點的switch
  • 根據flow entry去模擬match的結果,然後把封包的流向給顯示

Detail flow statistics

  • 使用者輸入想要觀察的流量特徵
  • 加入一筆完全符合該特徵的flow entry到switch的table 0,並且把actions設為 "goto table 1"
  • table 1裡面的flow entry就放本來routing相關的rule