This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CSCI 415 Data Communication Networks Homework 5 Solution Saad Mneimneh Visiting Professor Hunter College of CUNY Problem 1: File Transfer Consider a simple UDP-based protocol for requesting files (based somewhat loosely on the Trivial File Transfer Protocol, TFTP). The client sends an initial request, and the server answers (if the file can be sent) with the first data packet. Client and server continue with a stop and wait transmission mechanism. (a) Describe a scenario by which a client might request one file but get another; you may allow the client application to exit abruptly and be restarted with the same port. ANSWER : 1. The client sends a request for file foo 2. The request arrives at the server 3. The client abort locally, but restarts with the same port 4. The client sends a new request for file goo 5. The second request is lost 6. The server responds with the first data packet of foo, answering the only request is has actually received 7. The client start receiving foo thinking its goo (b) Propose a change in the protocol that will make this situation much less likely. ANSWER : Requiring the client to use a new port number for each separate request would solve the problem. To do this, however, the client would have to trust the underlying operating system to assign a new port number each time a new socket was opened. Having the client attach a timestamp or random num- ber to the file request, to be echoed back in each data packet from the server, would be another approach fully under the applications control (something like in TCP, but see last problem). Problem 2: Internet checksum In ones complement arithmetic, a negative integer- x is represented as the com- plement of x , that is each bit of x is inverted (thats 1111111111111111- x , hence the name). Therefore, 5 is 0000000000000101, and -5 is 1111111111111010. Sim- ilarly, 3 is 0000000000000011 and -3 is 1111111111111100. When adding num- bers in ones complement, a carryout from the most significant bit must be added to the result (unlike in twos complement that is used in most machines). There-to the result (unlike in twos complement that is used in most machines)....
View Full Document
This note was uploaded on 03/27/2010 for the course CSCI 415 taught by Professor Saadmneimneh during the Spring '08 term at CUNY Hunter.
- Spring '08
- Computer Networks