J. Blustein

Network Computing

[Crs | Ann | Mats | Res]

Kurose & Ross's Network Simulation Code

[Assignment | Documentation | Source Code ]

Assignment: [instructions | Alternating Bit Protocol | Go-Back-N | submission | FAQ ]

General Instructions

You are to implement and measure routines coded in C to perform transport layer functions (much like socket code in a real operating system would). The functions you write will be called by (and will call) procedures that are provided for you which emulate a network environment.

Implementation

The functions you will write are for the sending entity (Client also known as A) and the receiving entity (Server also known as B). Transfer of data (from client to server) and acknowledgements from server to client are required.

Your routines will fill in the payload field from the message data passed down from the application layer (#5). The other packet fields will be used by your protocols to ensure reliable delivery, as we've seen in class. Stubs for all of the routines you are to complete are in the files, client.c and server.c. The purpose of those routines are described in the stucode documentation.

Copy all of the files into a directory of your own. You will need to finish writing the functions in the client.c and server.c files. You will need the other files to make the simulation run. The Makefile will help you to keep your executable current.

For Summer 2003: Do only the alternating-bit-protocol part of the assignment. Write the code for ABP (including the measurements) but do not attempt the GBN protocol part of the assignment.

All of the data passed between the layers is encoded in one of two opaque data types: a message_t or a packet_t. You cannot access these types directly. You access parts of these types by using the routines declared in the message.h file and the packet.h file.

Variables of these types are created dynamically. You must call their new_ functions to create instances of them before you can use them.

Documentation about the routines that you must use to access those data types are in the packet_t documentation and the message_t documentation.

You might want to use the function in checksum.c instead of writing your own. But if you don't write your own code you must give proper credit to the real author (me).

All of the emulator routines you will need to access are declared in the file KRnet.h. Those function are described in the KRNet documentation.

Measurements

Run your ABP program with 120 messages, a loss probability of 0.1, a corruption probability of 0.3, and a trace level of 2.

Compute and print the following

  1. the total time that was required for all of the messages to be sent and acknowledged,
  2. the number of acknowledgments that were sent by the server,
  3. the number of acknowledgments that were received by the client, and
  4. the number of bytes that were sent by the client (120 messages times 20 bytes per message) divided by the total number of bytes that were transmitted (data plus acknowledgements).

Advice

Makefile

An easy way to compile and link the code is to use the make (1) Unix utility. We've given you a Makefile to help with this. To compile and link your code just run make simABP (to make the alternating bit protocol version) or simGBN (to make the go-back-N version) from the Unix shell.

See Also

Answers to frequently asked questions about this assignment are in a another webpage.


http://web.cs.dal.ca/~jamie/course/CS/3171/Materials/KR_1e/Code/Chapter3/assig/README.shtml
Version:
Sunday, 27-Jul-2003 13:38:38 ADT
CS 3171 Prof.:
J. Blustein <jamie@cs.dal.ca>

This webpage uses valid XHTML 1.0

Assignment based on
document at <URL:about:http://occawlonline.pearsoned.com/bookbind/pubbooks/kurose-ross1/chapter4/custom12/deluxe-content.html> (copied on 05 July 2002). That document is © 2000-2001 by Addison Wesley Longman A division of Pearson Education