在城市中,車輛與基地台之間的資料交換容易受到障礙物的妨礙而丟失封包,為了解決這個問題,我們可以利用城市中高密度的無線基地台,使用機率性轉傳(opportunistic relay)的技術提升車用Wi-Fi網路(vehicular Wi-Fi network)的效能。先前的研究雖然顯示機率性轉傳可以增加網路的吞吐量(network throughput),但是卻沒有能將偽負率(false negative rate)最小化,也忽略了網路中封包碰撞的情況。我們先前的研究分析了如何在機率性轉傳的技術上最小化偽負率,同時也考慮了網路中碰撞的情形,但是卻沒有模擬的結果來驗證我們的分析。在本論文中,我們討論如何在網路模擬器(network simulator-2)中建立機率性轉傳的機制,並且在不同的場景來模擬ViFi與OViFi的效能,並以模擬的結果來驗證我們先前的研究分析是否正確。 In vehicular Wi-Fi networks, opportunistic relay can be used to improve the quality of network services. By utilizing the additional Wi-Fi base stations around vehicles in urban area as helpers for opportunistic relay, the previous study has shown that the network throughput can be improved significantly. However, the study failed to optimize the packet relay probability for helpers to minimize the false positive rate nor did it consider the packet collision probability. While our previous work provided the theoretical analysis results for the optimized relay probability under the consideration of packet collisions, the simulation results to validate the analysis were still missing. In this thesis, we discuss how the relay mechanism can be built on top of the network simulator. In addition, we demonstrate the simulation results of the optimized opportunistic Wi-Fi relay protocol under different scenarios, which help to validate our previous analysis.