Welcome![Sign In][Sign Up]
Location:
Search - programming for CSMA

Search list

[Internet-Networkcsma_cd

Description: csma/cd 模拟 其余的自己看吧-csma/cd simulate the rest of their own and see
Platform: | Size: 4096 | Author: leaf | Hits:

[Internet-NetworkEthernet

Description: 模拟Ethernet帧的发送过程 编写程序模拟Ethernet结点的数据发送流程。 1) 用两个线程a和b来模拟Ethernet上的两台主机。 2) 用一个双字类型变量Bus来模拟总线(将其初始化为“\0”,并且总线等于“\0”时表示总线空闲)。 3) 两个子线程向总线发送自己的数据。数据用该线程的线程号进行模拟,发送数据用线程号和Bus的“或”操作进行模拟(即Bus=Bus|ID,ID为该线程的线程号)。 4) 每台主机须向总线上成功发送10次数据,如果其中某次数据发送失败,则该线程结束。 5) 发送流程须遵循CSMA\CD。随机延迟算法中的冲突窗口取0.005。在数据发送成功(即Bus==ID)后,报告“ID send success”,产生冲突(即Bus!=ID)后报告“ID send conllision”,发送失败(即冲突计数器值为0)后报告“ID send failure”。随着主机成功次数增加,报告其已发送成功的次数,如“主机A发送成功数=3”。 Ethernet的核心技术是随机争用型介质访问方法,即带有冲突检测的载波侦听多路访问(CSMA/CD)方法。-Ethernet frames sent during simulation Analog programming to send Ethernet data flow node. 1) a and b with two threads to simulate the two hosts on the Ethernet. 2) a double word type variable Bus to simulate the bus (to be initialized to "\ 0", and the bus is equal to "\ 0" that the bus is idle). 3) two sub-threads to send their data to the bus. Data with the number of threads to simulate the thread, send data with the thread number and the Bus "or" operations simulation (ie, Bus = Bus | ID, ID number of threads for the thread). 4) each host on the bus are required to successfully transmit data 10 times, if one of a particular data transmission fails, the thread ends. 5) to send the process to be followed by CSMA \ CD. Random delay algorithm to take 0.005 in the conflict window. The data is sent successfully (ie, Bus == ID), the report "ID send success", conflict (ie Bus! = ID) after the report "ID send conllision", sending fails (ie, conflict counter value is 0) after the
Platform: | Size: 2768896 | Author: liqian | Hits:

CodeBus www.codebus.net