<< Chapter < Page Chapter >> Page >
Operating Systems One-month project

Objectives:

  • Learn to work with Nachos networking for communication among processes.
  • Define and implement a “chat” protocol for interaction between a chat server and a chat client.

Problem statement:

Chat rooms have become a popular way to support a forum for n-way conversation or discussion among a set of people with interest in a common topic. Chat applications range from simple, text-based ones to entire virtual worlds with exotic graphics. In this project you are required to implement a simple text-based chat client/server application.

Problem description:

Email, newsgroup and messaging applications provide means for communication among people but these are one-way mechanisms and they do not provide an easy way to carry on a real-time conversation or discussion with people involved. Chat room extends the one-way messaging concept to accommodate multi-way communication among a set of people.

Nachos networking infrastructure

Nachos networking packages implements a very simple Unix domain (not internet domain), datagram socket. The files of importance to this project and their purpose are described below.

threads directory:

lockcond.h, lockcond.cc: for defining and implementing lock and condition synchronization primitives; needed for network applications to work.

machine directory:

network.h, network.cc: Data structures to emulate a physical network connection. The network provides the abstraction of ordered, unreliable, fixed-size packet delivery to other machines on the network.You may note that the interface to the network is similar to the console device -- both are full duplex channels.

sysdep.h, sysdep.cc : Interprocess communication operations, for simulating the network; Unix sockets creation, binding, closing etc. are called here to provide nachos socket functionality.

network directory:

post.h, post.cc: postoffice and mailbox, mail message definition and implementation.

nettest.cc: application to test communication between host id 0 and host id 1 (these are hardcoded!)

Chat architecture:

A chat application consists of a Chat Client (CC) one per person, a Chat Server (CS) and a two-way communication pipeline between the client and the server to send and receive conversational, control and status messages.

  • Chat Client:

Typical features of a CC include: (i) select chat server (server id), (ii) select a nickname for interaction and (iii) ability to set and change user preferences such as number of messages displayed, change nickname, etc. You may design your own chat user interface.

Implementation notes:

The server id is specified at command line (nachos –rs 1234 –m selfid –o serverid ) while executing the nachos process representing the client.

Once the client process is running it could interactively ask the user for the nickname of the chat user and update this information locally and if needed by your design on the server.

  • Chat Server:

A chat server supports the set of clients for a room, by maintaining client handle (clientid in nachos –rs –m clientId –o serverid), and client name. Server also has a message interpreter that parses the message received from a client and delegates the command to the appropriate module. Sample architecture for the chat application is shown in Figure 2. You may change the architecture to suit your design.

Questions & Answers

the diagram of the digestive system
Assiatu Reply
How does twins formed
William Reply
They formed in two ways first when one sperm and one egg are splited by mitosis or two sperm and two eggs join together
Oluwatobi
what is genetics
Josephine Reply
Genetics is the study of heredity
Misack
how does twins formed?
Misack
What is manual
Hassan Reply
discuss biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles
Joseph Reply
what is biology
Yousuf Reply
the study of living organisms and their interactions with one another and their environments
AI-Robot
the study of living organisms and their interactions with one another and their environment.
Wine
discuss the biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles in an essay form
Joseph Reply
what is the blood cells
Shaker Reply
list any five characteristics of the blood cells
Shaker
lack electricity and its more savely than electronic microscope because its naturally by using of light
Abdullahi Reply
advantage of electronic microscope is easily and clearly while disadvantage is dangerous because its electronic. advantage of light microscope is savely and naturally by sun while disadvantage is not easily,means its not sharp and not clear
Abdullahi
cell theory state that every organisms composed of one or more cell,cell is the basic unit of life
Abdullahi
is like gone fail us
DENG
cells is the basic structure and functions of all living things
Ramadan
What is classification
ISCONT Reply
is organisms that are similar into groups called tara
Yamosa
in what situation (s) would be the use of a scanning electron microscope be ideal and why?
Kenna Reply
A scanning electron microscope (SEM) is ideal for situations requiring high-resolution imaging of surfaces. It is commonly used in materials science, biology, and geology to examine the topography and composition of samples at a nanoscale level. SEM is particularly useful for studying fine details,
Hilary
cell is the building block of life.
Condoleezza Reply
what is cell divisoin?
Aron Reply
Diversity of living thing
ISCONT
what is cell division
Aron Reply
Cell division is the process by which a single cell divides into two or more daughter cells. It is a fundamental process in all living organisms and is essential for growth, development, and reproduction. Cell division can occur through either mitosis or meiosis.
AI-Robot
What is life?
Allison Reply
life is defined as any system capable of performing functions such as eating, metabolizing,excreting,breathing,moving,Growing,reproducing,and responding to external stimuli.
Mohamed
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Operating systems. OpenStax CNX. Aug 13, 2009 Download for free at http://cnx.org/content/col10785/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Operating systems' conversation and receive update notifications?

Ask