UDP based TFTP server

I urgently (in a couple of days) need to write a UDP based trivial FTP server in VC++ that implements most of RFC 1350 (http://www.faqs.org/rfcs/rfc1350.html) using Windows Sockets.

The server must support a port number specified as the first comand line parameter (> tftp 5000).

It should support the binary file transfer mode and be capable of handling both RRQs(read requests) and WRQs (write requests) but need not be capable of handling multiple simultaneous clients.

It must support the TFTP protocol including timeout and certain number of retransmissions.

The server should emulate the "trace" functionality of TFTP clients i.e. print one line to stdout every time a TFTP message is received or sent by the server.

I would be very grteful if someone could help me write the code for the server.

Thanks

naufalAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

bcladdCommented:
What is it you are asking for? If you post some code we would be happy to comment on or help with it. This is surely homework and experts are not permitted to write homework.

If you have no idea where to start: Look at your class notes and any sample code you have been given. Make the samples compile (to prove your compiler works). Then figure out what your server is going to have to do (this is already spelled out in the RFC but try drawing your own state diagram if possible. Figure out what messages will move you from state to state and figure all other messages will take you to the error state).  If you need design help, ask specific questions about what you don't understand.

Since I assume this is a learning experience, you probably want to try to get the sockets set up on your own, only looking at the inetutils for inspiration. Trust that they do fast, tricky things in that code. Trust also that if you turn in that code your professor will know it (academic dishonesty is typically easy to spot).

-bcl
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
naufalAuthor Commented:
Thanks for the advice but do be rest assured that I am not set on any academic dishonesty.

I have the socket connection already set up. However, being new to C++, I am finding it rather difficult to actualy code the server in such a short time. Even the inetutils' tftp server code is not of much help as I don't understand what's going on in it.

On my own, I have been succesful in sending the read request to the server from a client program and return the file to it in the blocks of the right size.  My main problem is the acknowledgement mechanism: the timeout and retransmission. The logic of it is simple enough: start a timer as soon as a data block is sent. If the ack is not received in due time, then retransmit the data block and keep doing so till the ack for that data block is received. In case more than 1 ack is received for a packet, all the duplicates are simply discarded.

This is the particular area that i m finding difficult to code.

I would be grateful if someone could help me out now.

Thanks a lot.


0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

rstaveleyCommented:
This is quite a daunting undertaking if you are new to C++. If you are looking for a project to learn C++ with, it's probably not the best way to get started. If you simply need to have a Win32 TFTP server, there are freeware ones available (e.g. http://solarwinds.net/Tools/Free_tools/TFTP_Server/index.htm comes up on Google pretty fast).

Is it the protocol you are having problems with or the C++ implementation?
0
RJSoftCommented:
Take a look at this CSerialCom class.  

http://www.codeproject.com/system/cserialcom.asp

RJSoft
0
rstaveleyCommented:
> CSerialCom

Eh?
0
tinchosCommented:
No comment has been added lately, so it's time to clean up this question.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: bcladd {http:#9660894} & rstaveley {http:#9666511} & RJSoft {http:#9676024}

Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Tinchos
EE Cleanup Volunteer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.