2. Networking on Nachos
Practical part
We found that nachOS already provides
message delivery with this characteristics:
● Unreliable
● Has fixed-size
● Messages can be dropped
3. PostOffice Class
This class is defined in the files post.h and post.cc in the
network directory
This class is like its name a postoffice or a collection of
mailboxes.
Here its defined two main operations:
● Send -> send a message to a remote machine
● Receive-> waits for a message in the mailbox
In this class are used threads for sending messages and for
receiving messages in the mailbox.
4. Mail Class
This class defines the format of the
messages that will be sent and received
The constructor of this class initialize only
one message, by using:
● PacketHeader
● MailHeader
5. MailHeader Class
Is a part of the message that is put at the
begining of the message by the PostOffice
before the message is sent.
This header contains:
● Destination mailbox address
● Number of bytes in the message
6. MailBox
Defines a single mailbox for receiving
messages.
Incoming messages are placed by the
PostOffice into the mailbox.
So the messages can be taken by a thread
of the machine that is receiving the message
A mailbox is implemented as a list of
messages using SynchList object
7. Network
The emulation of a physical network
connection is implemented in the files
network.h and network.cc in the machine
directory.
In this file (network.cc) is defined the class
PacketHeader, which defines that, a packet
header.