如何使用编程语言模拟aloha协议?

时间:2011-11-28 19:22:04

标签: protocols

我是网络新手,我读到了这个名为Aloha的协议,我想为它的Pure版本制作一个简单的模拟器。

虽然我理解这些概念,但我觉得很难开始。

基本上我们网络中有N个发件人。每个发件人都想发送一个数据包。现在,每个发件人都不关心网络是忙还是被其他发件人占用。如果它想发送数据,它只是发送它。

问题是,如果2个发送者同时发送一些数据,那么它们都会发生冲突,因此两个数据包都将被破坏。

由于它们被销毁,两个发件人将需要再次发送相同的数据包。

我理解这个简单的概念,困难在于,如何使用概率来调整它。

现在,我需要找出吞吐量,即帧的(成功)传输速率。

在继续之前,我们必须做出一些假设:

All frames have the same length.
Stations cannot generate a frame while transmitting or trying to transmit. (That is, if a station keeps trying to send a frame, it cannot be allowed to generate more frames to send.)
The population of stations attempts to transmit (both new frames and old frames that collided) according to a Poisson distribution.

我无法真正理解第三个假设,我将如何在aloha中应用这个概率? 我无法在网上找到一个代码,以便了解如何做到这一点......

以下是有关该协议的更多信息:

  http://en.wikipedia.org/wiki/ALOHAnet#Pure_ALOHA

1 个答案:

答案 0 :(得分:0)

我认为你必须把时间分成几个间隔;在每个间隔中,一定数量的站尝试发送。此数字是根据http://en.wikipedia.org/wiki/Poisson_distribution在固定时间间隔或时间内发生的事件数。

你必须根据泊松分布对其进行建模。

我的2美分,希望这有帮助