| NetProg Spring 2004 HW3 |
|   Course Syllabus   |   NetProg Home   |   HW3 Assignment |
| Question: | When I transfer the file "large" from the TFTP server on monte using netascii transfer mode, the client tells me that it transferred 1056768 bytes. When I use my server with the same file, the client only sees 1052672 bytes. Both work fine, the stored file is identical. This doesn't happen with octet mode. |
||
| Answer: | When using netascii transfer mode the server on monte seems to treat each byte as only a 7-bit character for the purposes of handling line termination. This can result in it sending more bytes than you might expect (basically it replaces '\n' with '\r' '\n', but also does the same for '\n'+0x80. TFTP clients seem to deal with this as well, so there must be something somewhere that explains what is happening (but I can't find it!). Please ignore this, I'm not sure why the server is doing this and your server does not need to send the same number of bytes as the server on monte does, as long as the file stored by the client is the right file. |
||
|   |   | ||
| Question: | I can't get a Sun (Solaris) tftp client to connect to my server, the client says "bad port number". Is there something I'm doing wrong? |
||
| Answer: | There is a bug in the Solaris tftp client - it won't connect to any port number larger than 32767. (The client treats the number as a signed 16 bit int instead of unsigned, and thinks it's been told to connect to a negative port number). Start your server on a low numbered port, something like 4444. Now the Solaris client will work fine. |
||
|   |   | ||
| Question: | How do I put a 16 bit network byte order int into an array of char? How do I get a 16 bit network byte order int from an array of char and into a short int? |
||
| Answer: | There are a couple of possible approaches:
|
||
|   |   |