| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1444 人关注过本帖
标题:如何编rudp服务器,请指教!
只看楼主 加入收藏
mike0392
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-3-18
收藏
 问题点数:0 回复次数:1 
如何编rudp服务器,请指教!

Description

In this project, you are required to develop a reliable file transfer protocol named RFTP. This protocol is an application layer protocol, and it runs on top of the User Datagram Protocol (UDP). Since UDP is an unreliable, connectionless transport layer protocol, you will need to make use of a scheme similar to the Stop-And-Wait ARQ protocol to provide reliable service.

RFTP consists of two components, a client component and a server component. The basic operation of this protocol is described below:

1) The client sends a request to the server. This request serves two purposes:

a. Request for a connection setup

b. Request to read a file

If the request is lost, the client would need to resend the request after a timeout period. However, if the request was not lost but simply delayed, then if the client timeouts and resends the request, the server will get two requests from the client. To avoid the problem of the server sending two copies of the file, the client would need to attach a Request_ID in the request so that if the server receives two requests with the same Request_ID, it will only respond to the first one.

2) If the server agrees to the request, the connection is opened and the file is sent to the client. Each data packet sent by the server contains one block of the file data, with a fixed size of 1024 bytes.

3) To provide reliable service, each received data packet must be acknowledged by the client through the use of an acknowledgment packet. Similarly, the receipt of an acknowledgment packet by the server will cause it to send the next data packet.

4) Each data packet must have a sequence number to facilitate the client’s acknowledgment of the received packets.

5) The end of the data transfer is marked by a data packet of less than 1024 bytes.

6) In terms of error control, if a packet (data or acknowledgment packet) gets lost in the network, the server will timeout and retransmit his last data packet.

7) You can hardcode the expiry time to 1000ms = 1s.

Requirements

1) You are required to implement the basic features as mentioned in the previous section.

2) This project is to be written in the C programming language, and must be executable in a Linux/Unix platform.

3) In both the client and server programs, for each data packet or acknowledgment packet sent, a statement will be printed out to the console. For example,

Server program Client program

Send data packet #1 Send acknowledgment for data packet #1

Send data packet #2 Send acknowledgment for data packet #2

Send data packet #3 Send acknowledgment for data packet #3

… …

4) Both the client and server programs take in two (2) input parameters that specify

a. number of packets to drop, N

b. dropping probability, p

Each packet sent by the client and server programs has a probability p of being dropped. The programs will also keep track of the total number of packets dropped so far. Once N packets have been dropped, then every subsequent packet after that will no longer be dropped, i.e. subsequent packets will always be successfully transmitted.

This feature will aid the TAs in assessing the reliability feature of your implementation of RFTP. The client and server programs will also need to print out the necessary statements to the console when this happens. For example,

Server program Client program

Send data packet #1 Drop acknowledgment for data packet #1

Retransmit data packet #1 Send acknowledgment for data packet #1

Send data packet #2 Send acknowledgment for data packet #2

Drop data packet #3

Retransmit data packet #3 Send acknowledgment for data packet #3

… …

5) The client program will also need to take in another input parameter that specifies the name of the file that it wants the server to send to it. This input parameter will be used in the initial request message from the client to the server.

6) The client program will also need to take in another input parameter that specifies either the IP address or the name of the server.

7) The mode of data transfer is ascii.

8) You will be required to demonstrate your programs to the TAs sometime in the second half of March 2006. The exact dates will be announced later. The demonstration will be held in the IE Computing Lab, using the IESUN machines. Therefore, make sure that your programs are able to run on these machines.

我某个课程的project,,,,,,该死的professor......不知道我们还没学socket programming......望真NB人指教......

P.S.this program is demo on linux....not windows

1.how to set requestID

2.how to open and segment a file and write it into a buffer through using C(not c++)

3.how to write the timeout function

如果有哪位有空看一眼的话。。。。不胜感激阿。。。。

搜索更多相关主题的帖子: 服务器 rudp protocol layer 
2006-03-18 14:16
haishanglang
Rank: 1
等 级:新手上路
帖 子:378
专家分:0
注 册:2006-3-2
收藏
得分:0 
好难啊,头都晕了

2006-03-18 14:19
快速回复:如何编rudp服务器,请指教!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.021985 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved