--- tags: 程式語言, Python Lan, --- ###### tags: `Python Lan` ###### 撰寫日期:2023/07/19 ###### 作者:陳彥夫 # 利用mininet模擬multicast網路功能 {%hackmd BJrTq20hE %} ### 參考資料 [mininet-multicast](https://github.com/jimpick/mininet-multicast-routing) [troglobit/smcroute](https://github.com/troglobit/smcroute) [mininet/examples/linuxrouter.py](https://github.com/mininet/mininet/blob/master/examples/linuxrouter.py) [mininet安裝](https://joechang0113.github.io/2020/02/18/mininet-ryu-install.html) ## 使用目的 使用mininet網路模擬工具模擬multicast網路功能 ## 步驟 1. 先更新Ubuntu環境 ``` bash sudo apt-get update sudo apt-get upgrade reboot ``` 安裝 git 工具 ``` bash sudo apt-get install git ``` 利用 `git clone` 下載 `mininet` 安裝檔 ``` bash git clone git://github.com/mininet/mininet ``` 到目錄下執行 mininet 安裝檔進行安裝,請依序執行下面兩個命令 ``` bash cd mininet/util/ ./install.sh -a ``` 若是安裝成功就會顯示 Enjoy Mininet! 2. 使用SMCroute(static multicast router),是個在linux系統中控制群播路由表的工具。 下載[mininet-multicast](https://github.com/jimpick/mininet-multicast-routing)範例,進入到下載目錄並執行python腳本 ``` bash sudo su pyhton3 muliticastdemo.py ```  3. 進入h1、h2、h3和h4的terminal下指令 ``` bash xterm h1 h2 h3 h4 ``` 拓撲圖如下  smcroute這個工具可以透過指令給kernel,kernel再以發送IGMP的訊框給host去做加入或離開群組。一共分為239.0.0.1,2,3三組,h1和h4加入到同一個群組。 原本h4在239.0.0.1的group中時ping h4會回傳,代表還在裡面。  在239.0.0.1這個組內有h1和h4,我把h4利用smcroute中的leave指令離開群組,所以我這時候去ping 239.0.0.1這個組播地址就不會回傳h4的地址 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up