I would like to hack into a 網樂通 to run an awesome daemon.
There are lots of problem when installed stlinux2.3. Even though this is a tough work, I finally installed it. The main problem I encounter is that the rpmkeys does not support --force-debian option. The solution is to edit the install file.
1. Open the install file with an edit you favorite.
2. search force-debian.
3. you will find rpm_extra_opts="--force-debian".
4. just comment it !
2012年11月28日 星期三
2012年10月17日 星期三
UDP hold punching in a nutshell(UDP打洞)
當你使用TCP or UDP連線,假設要從PeerA已知道PeerB的IP,並且嘗試著連到PeerB,若是你沒手動設定port fordwarding,這次連線一定會失敗。但 PeerA 的 NAT 會把這個連線的IP與Port給記錄下來,這筆紀錄就可當作自動的 Port forwarding。PeerB若能夠知道這筆紀錄的Port,就能夠利用這個洞連到PeerA,因此雙方就能夠P2P傳輸了。
使用 UDP 的原因就是 UDP 是不可靠連線,因此 NAT上面會保留這個紀錄一段時間,可能幾秒到幾小時都有可能。這是我目前的認知,在此做個紀錄,但如有錯誤還請不吝指教。
但要如何讓 PeerB 知道 PeerA 連過來但失敗的 IP 與 Port,最一般的做法就是有一個會面伺服器 (Rendezvous Server),可能的流程如下:
1. PeerA 在伺服器上主動地找到 PeerB 的 IP 與 Port ,並嘗試連一次,但一定失敗。不過這次
PeerA的NAT上已經有個洞了。
2. 伺服器通知 PeerB:PeerA 要跟PeerB 連線,並且把 PeerA 連出的 IP 與 Port 帶給 PeerB。
3. PeerB 知道 PeerA 上NAT的洞之後,就能連到PeerA了。
1. PeerA 在伺服器上主動地找到 PeerB 的 IP 與 Port ,並嘗試連一次,但一定失敗。不過這次
PeerA的NAT上已經有個洞了。
2. 伺服器通知 PeerB:PeerA 要跟PeerB 連線,並且把 PeerA 連出的 IP 與 Port 帶給 PeerB。
3. PeerB 知道 PeerA 上NAT的洞之後,就能連到PeerA了。
使用 UDP 的原因就是 UDP 是不可靠連線,因此 NAT上面會保留這個紀錄一段時間,可能幾秒到幾小時都有可能。這是我目前的認知,在此做個紀錄,但如有錯誤還請不吝指教。
訂閱:
意見 (Atom)