DOC PREVIEW
CMU CS 15441 - Project

This preview shows page 1-2-3-4-5 out of 16 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 16 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

15-441 Project 1 Overview1/25/06Mike Cui15-441 S06 January 062/16Your Assignment Is …To implement a TFTP server.Detailed handout on course website.What exactly does this involve ?15-441 S06 January 063/16What is TFTP ?• The Trivial File Transfer Protocol• Basic file transfer protocol• Supports only Get & Put operations• Major uses :• Netbooting workstations• Example of a simple but useful protocol• Defined by a standards body document• RFC 1350 (1992)• RFC 1123 (1989) (bug fix)• RFC 783 (1981) (obsolete)15-441 S06 January 064/16The Standard• Defines• Message types & formats• Sequence of messages• Connection set-up and termination• Written in very rigid style• Not necessarily easy to understand15-441 S06 January 065/16Packets• Sent over User Datagram Protocol (UDP)• Single message (datagram)• See chapter 5.1 for details• Only 5 types :1. RRQ (filename, mode)2. WRQ (filename, mode)3. DATA (block number, data bytes)4. ACK (block number)5. ERROR (error code, error message)• Largest packet is limited to 516 bytes• DATA packets, specified by the RFC• RRQ/WRQ packets, specified by us for this project15-441 S06 January 066/16Protocol• Stop and wait protocol - send a message,wait for reply• Send DATA(1,…) in response to RRQ• Send ACK(n) in response to DATA(n)• Send DATA(n+1,...) in response to ACK(n)• What happens when a message is lost?• Sender retransmits DATA or RRQ• How do you know when to stop?15-441 S06 January 067/16Get ExampleClient ServerRRQ(foo,...)DATA(1,…)ACK(1)DATA(2,…)ACK(2)15-441 S06 January 068/16Get Example (lost packet)Client ServerRRQ(foo,...)DATA(1,…)ACK(1)DATA(1,…)ACK(1)Timeout15-441 S06 January 069/16Hints• Protocol Issues• UDP• Network Byte Order• Debugging tools• Project Planning15-441 S06 January 0610/16General Protocol Issues• TFTP uses the well known UDP port 69• Usually only superuser can bind to ports < 1024• Use a different port instead• Responses to RRQ/WRQ must be sent outon a different port than the well known port.• Must to create another socket• bind to port 0 will pick any free port• Each side can consider the connectionterminated when it sends to or receives fromthe other side an ERROR packet.• What if the ERROR packet is lost ?15-441 S06 January 0611/16UDP• socket(AF_INET, SOCK_DGRAM, 0) creates a UDP socket• bind() assigns the socket an address and port• recv()/recvfrom() gets an entire packet addressed to theport assigned by bind()• Or (optionally) blocks until an entire packet arrives• No short-count, or EOF• Packet is truncated if buffer isn’t large enough• recvfrom() also fills in the source address• connect() sets the default destination• Just a shortcut, no “connection” is actually made!• send() sends a packet to the destination setby connect()• Packets might reach destination 0 or more times• sendto() can specify a destination• accept()/listen() not applicable15-441 S06 January 0612/16More on UDP• man udp• UDP server example in the referencesection of Project handout15-441 S06 January 0613/16Network Byte Order• Network functions deal in bytes• Multi-byte structures in a message are morecomplicated (eg: integers)• One host could be big-endian, the other little-endian• Choose one byte order for messages on the wire(pages 536-538), which is big-endian• Provide conversion functions for commontypes• Long : htonl, ntohl• Short : htons, ntohs15-441 S06 January 0614/16Debugging Tools• TFTP clients• tftp installed on Andrew Linux & Solaris% tftp quark.weh.andrew.cmu.edu 3000tftp> binarytftp> get foo.ctftp> put bar.sml• trace prints the packets sent & received• netstat• List open sockets• gdb15-441 S06 January 0615/16Project Planning• Start early !• Should already have read the RFC by now• Read it again• This project may be larger than your previousones.• Expect about 750-1000 lines of C-code• Most of the complexity will be in exceptionalhandling.• Think about the corner cases early• Use office hours15-441 S06 January 0616/16Questions


View Full Document

CMU CS 15441 - Project

Documents in this Course
lecture

lecture

34 pages

lecture

lecture

38 pages

lecture

lecture

18 pages

lecture

lecture

28 pages

lecture

lecture

11 pages

Lecture

Lecture

64 pages

lecture

lecture

10 pages

lecture

lecture

19 pages

Lecture 6

Lecture 6

43 pages

Exam

Exam

14 pages

lecture

lecture

38 pages

Debugging

Debugging

23 pages

lecture

lecture

60 pages

review

review

27 pages

lecture

lecture

12 pages

The Web

The Web

28 pages

Lecture

Lecture

40 pages

lecture

lecture

42 pages

lecture

lecture

9 pages

lecture

lecture

10 pages

lecture

lecture

49 pages

lecture

lecture

26 pages

Project

Project

5 pages

lecture

lecture

40 pages

lecture

lecture

9 pages

lecture

lecture

41 pages

lecture

lecture

32 pages

lecture

lecture

36 pages

lecture

lecture

34 pages

lecture

lecture

45 pages

lecture

lecture

26 pages

lecture

lecture

6 pages

lecture

lecture

51 pages

lecture

lecture

44 pages

lecture

lecture

13 pages

lecture

lecture

42 pages

lecture

lecture

36 pages

Project

Project

13 pages

Project

Project

33 pages

lecture

lecture

43 pages

lecture

lecture

49 pages

Load more
Download Project
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Project and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Project 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?