lunes, 28 de noviembre de 2011

Networking test in NachOS


In order to make a networking functionality test in nachos we must first open two separate terminals, then we enter to the network folder, after we enter we must write ./ nachos. When we finish writing ./nachos we write first -m 0 (from) -o 1(to) in one terminal and then -m 0 (from) -o 0 (to) in the other terminal simultaneously.

Now where we wrote -m 0 -o 1 we will receive this message:

Got "Hello there!" from 1, box 1
Got "Got it!" from 1, box 1
Machine halting!

Where we wrote -m 0 -o 0 we will receive this message:

Got "Hello there!" from 0, box 1
Got "Got it!" from 0, box 1
Machine halting!

Here we show you some of the code in nachos that does this
This is contained in nettest.cc


Here it sends a message to the machine with ID "farAddr", then it waits for this message to arrive. When it sends an acknowledgement for the other machine´s message it keeps waiting for the acknowledgment from the other machine to the original message.


Now we construct the packet and we specify the destination where we are going to send it, and also from where we are sending the packet.  

Finally we send the message and we wait for a confirmation message from the other machine.

The execution would be like this:









1 comentario: