DOC PREVIEW
UB CSE 421 - Chat Application Using Nachos Networking Module

This preview shows page 1-2 out of 6 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1Project 3 CSE421/521: Introduction to Operating System Spring 2005 Due Date: 4/30/2005 Chat Application Using Nachos Networking Module 1. 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. 2. 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. 3. 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. 4. 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!)25. 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. Figure 1: Chat Application Overview 5.1 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: (i) The server id is specified at command line (nachos –rs 1234 –m selfid –o serverid ) while executing the nachos process representing the client. (ii) 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. 5.2 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. Chat Clients Chat Server Messages Status Control3 Figure 2: Chat Application Architecture The Chat client receives the user messages and user configuration set up commands and passes them to the server. Sometimes it is also possible to process some of the commands (Ex: Number of messages displayed) locally. MsgProcessor in Figure 2 Chat Client is responsible for interpreting messages from the user. Sender and receiver are for communicating with the server. Messages are constructed as described in the protocol below. A chat server receives the commands and messages from the chat clients and processes them. MsgInterpreter is for unpacking, parsing and delegating the commands to the appropriate units on the server side. MsgMaker constructs the messages to be sent back according to the protocol described below. We will use nachos sockets for communication between the server and the client. Chat Protocol: Protocols such as TCP and HTTP provide rules for communication. They specify details of message formats; they describe how an application responds when a message arrives, and how to handle abnormal and error conditions. We describe the protocol we will use for the chat service in Section 8. 6. Implementation Details Phase 1: Study all the code associated with the nachos networking. Phase 2: Perquisites: Lock and Condition: (15%) Implement the lock and condition the skeleton for which are in threads directory. Test it. Run the nettest application in network directory by opening up two xterms/terminals and running two nachos processes (network id 0, 1) communicating with each other. 1. Implement lock and condition. 2. Go into network directory, gmake 3. Run nachos on two xterm/terminals using these commands: nachos –rs 1234 –m 0 –o 1 User Interface MsgProcessor Sender Receiver Chat Client Receiver MsgInterpreter ClientMgr MsgMaker Sender Chat Server4nachos –rs 1234 –m 1 –o 0 4. You will observe the two processes sending messages and acknowledging. Phase 3: Ring Network: (5%) Update the nettest.cc so that a set of nachos process with network ids (0, 1,2,3..) can communicate. To test this form a ring of at least three nachos processes representing three network nodes, node 0 sends message to node 1, node 1 receives and transmits the same message to node 2 and node 2 receives and transmits the message back to node 0 thus successfully completing a trip around the ring. Phase 4: (45%) Chat Server: Implement the chat server that behaves according to the protocol described in Section 8. Test it with dummy data/hard coded data. Assume that nicknames are predefined. Phase 5: (25%) Chat Client and Integration with Server: Implement the chat client and a simple text interface and integrate it with the server. Phase 6: (10%) Documentation: This includes internal documentation (comments) and a


View Full Document

UB CSE 421 - Chat Application Using Nachos Networking Module

Documents in this Course
Security

Security

28 pages

Threads

Threads

24 pages

Security

Security

20 pages

Security

Security

52 pages

Security

Security

20 pages

Load more
Download Chat Application Using Nachos Networking Module
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Chat Application Using Nachos Networking Module and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Chat Application Using Nachos Networking Module 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?