资源简介
这是个实现数据链路层6大协议的程序 ,他是用c语言编写的
代码片段和文件信息
/* Protocol 1 (utopia) provides for data transmission in one direction only from
sender to receiver. The communication channel is assumed to be error free
and the receiver is assumed to be able to process all the input infinitely quickly.
Consequently the sender just sits in a loop pumping data out onto the line as
fast as it can. */
typedef enum {frame_arrival} event_type;
#include “protocol.h“
void sender1(void)
{
frame s; /* buffer for an outbound frame */
packet buffer; /* buffer for an outbound packet */
while (true) {
from_network_layer(&buffer); /* go get something to send */
s.info = buffer; /* copy it into s for transmission */
to_physical_layer(&s); /* send it on its way */
} /* Tomorrow and tomorrow and tomorrow
Creeps in this petty pace from day to day
To the last syllable of recorded time.
- Macbeth V v */
}
void receiver1(void)
{
frame r;
event_type event; /* filled in by wait but not used here */
while (true) {
wait_for_event(&event); /* only possibility is frame_arrival */
from_physical_layer(&r); /* go get the inbound frame */
to_network_layer(&r.info); /* pass the data to the network layer */
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1247 2002-07-29 16:31 Fig-3-10.c
文件 1408 2002-07-29 16:31 Fig-3-11.c
文件 2166 2002-07-29 18:03 Fig-3-12.c
文件 2091 2002-07-29 16:31 Fig-3-14.c
文件 4185 2002-07-29 16:30 Fig-3-17.c
文件 5569 2002-07-29 18:05 Fig-3-19.c
文件 1800 2002-07-29 16:17 Fig-3-9
文件 1730 2002-07-29 17:45 Fig-5-8.c
文件 8002 2002-07-29 18:12 Fig-6-20.c
文件 1698 2002-07-29 18:06 Fig-6-6-client.c
文件 1900 2002-07-29 18:11 Fig-6-6-server.c
文件 1037 2002-07-29 18:16 Fig-8-9.c
文件 147 2002-06-12 09:33 Makefile
文件 1790 2002-07-27 14:13 protocol.h
- 上一篇:纯C语言写的打字母游戏
- 下一篇:可变分区存储管理方式的内存分配与回收(C++)
相关资源
- K-means聚类算法c语言实现支持任意维数
- 计算方法实验5--埃特金加速迭代算法
- shor算法中的连分数计算
- C语言模拟滑动窗口协议
- openmp的矩阵相乘cannon算法实现
- 分水岭算法C语言实现
- DES算法加密解密C++源码及程序完整的
- 矩阵转置的并行算法mpi实现
- 树tree、动态数组dyArray、hashMap、拼图
- C语言实现PID控制直流电机调速含pro
- 蜂群算法C语言实现
- 利用TCP协议实现文件传输C语言
- TDMA算法 C语言编写
- 用MFC编写的数据包校验与常用校验算
- c++求图的最短路径算法
- DES加密解密算法C++程序设计
- C语言龙贝格求积算法
- 椭圆曲线加密算法实现
- 操作系统C语言实现银行家算法,键盘
- 多目标粒子群算法C代码
- 磁盘调度算法模拟软件,完整课程设
- GoBackN协议的C语言实现
- 内存分配伙伴算法FFFWFB模拟
- OS_页面置换算法实验c++程序代码
- MD4加密算法源码
- 前向纠错的多个算法C语言
- SM3算法C语言实现
- 关于 tarjan 算法
- 电梯模拟MFC
- 5个遗传算法C语言源码
评论
共有 条评论