Presentation is loading. Please wait.

Presentation is loading. Please wait.

EMOS Group 3 組員:郭柏宏 郭建漢 蕭鼎亞 黃雍文 黃博奕.

Similar presentations


Presentation on theme: "EMOS Group 3 組員:郭柏宏 郭建漢 蕭鼎亞 黃雍文 黃博奕."— Presentation transcript:

1 EMOS Group 3 組員:郭柏宏 郭建漢 蕭鼎亞 黃雍文 黃博奕

2 Current Status Networking
User Router User Router User User Router User User

3 Current Status of Crowded Networking
User Router User Router User Router User User

4 Motivation 通訊Bandwidth浪費在重覆註冊連線上 階層化(Hierarchy) 的網路連線與頻寬分配
Web-Browser 的網路UI 頻寬分配之監控

5 Concept User (S) User User (M) (S) Router User User User User Router …
調整 Router User User User User User

6 System Blocks Raspberry Pi App. & Driver (含Bandwidth monitoring)

7 HOW ?

8 用Raspberry Pi接通網路 (Man X2)
技術與人力分工圖 資本主義之共產網路Router 用Raspberry Pi接通網路 (Man X2) UI & 頻寬監控 (Man x1) 頻寬分享Driver & 程式 (Man X2)

9 Boot Materials 加入中文參考資料

10 Boot Materials 加入中文參考資料

11 存取硬體資源Driver- by Python

12 Python

13 Python

14 頻寬分配

15 UI

16 UI

17 UI

18 To monitor the network usage
1. A web server - apache 2. A program language build in Pi - Python

19 web server GPIO Common Gateway interface
To access the hardware resources, we should use GPIO on Pi to get the information. Then we can monitor the usage of wifi and manage the bandwidth which is shared with users.

20 Reference http://pingbin.com/2012/12/setup-wifi-raspberry-pi/

21 Source Code: Configure the wireless adapter
sudo nano /etc/network/interfaces auto lo iface lo inet loopback iface eth0 inet dhcp allow-hotplug wlan0 iface wlan0 inet manual address netmask gateway wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

22 Source Code: Install and configure a DHCP server
sudo apt-get install isc-dhcp-server sudo nano /etc/dhcp/dhcpd.conf subnet netmask { range ; option broadcast-address ; option routers ; default-lease-time 600; max-lease-time 7200; option domain-name "local"; option domain-name-servers , ; } sudo nano /etc/default/isc-dhcp-server Change “INTERFACES=""” to “INTERFACES="wlan0"” sudo service isc-dhcp-server restart

23 Source Code: Install and configure the access point daemon
sudo apt-get install hostapd sudo nano /etc/hostapd/hostapd.conf interface=wlan0 driver=nl80211 #driver=rtl871xdrv ssid=MyPi hw_mode=g channel=6 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 wpa_passphrase=raspberry wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP sudo nano /etc/default/hostapd Remove the “#” in front of “DAEMON_CONF” and alter the line to read: DAEMON_CONF="/etc/hostapd/hostapd.conf"

24 Source Code: Configure IP routing between the wireless and Ethernet (or 2 Wireless Adapters)
sudo nano /etc/sysctl.conf Find the line which reads “Uncomment the next line to enable packet forwarding for IPv4” and uncomment the next line like this: # Uncomment the next line to enable packet forwarding for IPv4 net.ipv4.ip_forward=1 Run the following command to activate forwarding now: sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward" Now turn the Pi into a router with the follow commands: sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT (如果要用兩張網卡一收一發, 就把eth0 & wlan0 改成wlan0 & wlan1) And save the routing tables into the file “/etc/iptables.ipv4.nat” sudo sh -c "iptables-save > /etc/iptables.ipv4.nat” Edit “/etc/network/interfaces“: sudo nano /etc/network/interfaces And add the following line to the end of the file. This line will restore the routing table whenever the Pi is booted: pre-up iptables-restore < /etc/iptables.ipv4.nat


Download ppt "EMOS Group 3 組員:郭柏宏 郭建漢 蕭鼎亞 黃雍文 黃博奕."

Similar presentations


Ads by Google