FAQ and clarifications

Frequently asked questions and clarifications regarding the mandatory assignment

FAQ

Q: Do I need to specifically use the recvmsg/sendmsg system calls?

A: No, it does not matter which variant of the receive/send system calls you use in your code. The reference to recvmsg and sendmsg in the assignment text was meant to be an example. We apologize for the somewhat awkward wording in the relevant part of the assignment.

Q: How should I handle multiple applications attached to the same MIP daemon?

A: In this assignment, you can't properly handle multiple applications attached to the same MIP daemon. There is no way to tell applications apart given the MIP network header alone. Effectively, this limits us to one application per host for now.

Q: Can I use qemu to locally run the VM instead?

A: No, this is not a valid option. You must run the VM in the UH-IaaS cloud. Please make sure you always refer to information we have given this year, not old and outdated information from the earlier INF3190 course.

Q: May I use fork to handle multiple sockets simultaneously?

A: Yes, that is one possible solution. We do however suggest using select, poll or epoll instead, because this will be easier to work with once we extend the functions of our network stack in the next assignments.

Q: How should the TRA bits be set when transmitting user messages?

A: The assignment text is unfortunately missing a clear specification of how the TRA bits should be set when sending user messages (data payloads). Our intention was that the T (Transport) bit should be on and the other two off in these messages. Due to the lack of clarity in the assignment text, we will also accept other combinations; however, if you read this, do please follow the intended way of doing it: TRA combination 100.

Q: How do I run my programs to test them?

A: You will use mininet to instantiate an emulated network to test your MIP daemon on. See the file obligtopology.py in the home folder of the debian user in the VM. This file contains a configuration corresponding to the example scenario in the assignment, as well as instructions on how to actually start mininet.

If you follow these instructions, you will get one xterm window per virtual host in the network, which you can use to run programs on those hosts. On the mininet console you can also issue commands such as xterm A which will open another xterm running "inside" virtual host A.

For further documentation on using mininet, you can visit their website.

Tips

Alternative to using VNC for Linux and OS X users

If you are running some kind of Linux (or BSD) operating system, using SSH X forwarding is an alternative to using the VNC setup for getting the per-host xterms.

Simply invoke SSH with the -Y option:

$ ssh -Y debian@yourvm

debian@yourvm:~$ sudo mn --custom obligtopology.py --topo oblig --link tc -x

This also works on OS X, but you will need to install an X server (XQuartz) manually, from for instance MacPorts or Homebrew.

Note that it may take a short while before the xterms appear, and if your network latency is high the xterms might appear a bit "laggy".

Thanks to Francis Augusto Medeiros-Logeay for pointing this out.


MIP Header format

Following the discussion during the group session for the MIP header format, here is one possible way how you can declare a 3-bit variable as the TRA datatype.

struct mip_packet

{
   ...
   unsigned int TRA: 3;
   ...

} __attribute__((packed));

Then, you can set the bits as follows: 

struct mip_packet *mip = (struct mip_packet *)malloc(sizeof(struct mip_packet);

mip->TRA = 3  /* It sets TRA bits to 011 ( binary form of 3 using 3 bits) */

...

free(mip);

 

Publisert 12. sep. 2019 10:48 - Sist endret 17. sep. 2019 11:38