Create a client and a server that communicate message queues

Assignment Help Computer Networking
Reference no: EM131108678

Lab 2 will require you to create a client and a server that communicate over either message queues, sockets, or a well known fifo. The data passed will be a simple request/response in string format.

Each of the 3 methods will need to answer the problem of rendezvous in their own way.

Suggested algorithms:

Message Queues -

Server will listen specifically to a single key and respond to clients based on a key that was passed in the message to the server.

Well Known FIFOs -

Since Well Known FIFOs are "file" based and will require a name (hence the "well known" part), you should create a common header that defines the server read/ client write FIFO as a const string for both. The server will respond to the client based on data passed through the Well Known FIFO to the server.

Sockets -Every socket requires a tuple on both sides. Tuple being the IP address / Port

/ Protocol. Since sockets require "root" access for ports less than 1024, choose a port greater than 1024 for the server. Just like the well known fifo, you should create a common header file with a const integer for the server port number. Unlike the other IPC methods, the client and server in a socket dynamically exchange the path back to the client, so there is no need to "pass" that data to the server.Once you have chosen your method of communication, then define a simple dataset that can be used in a request / response loop. Examples could be that you have an array of phone numbers, and when the phone number is sent to the server it will respond with the person's name associated with that phone number. Any simple dataset with at least a name=value pair will work as long as you can look up the value based on the name. Simple structures with a simple searching algorithm up tousing hash maps or search tree libraries are all ok. This assignment is more about the IPC and the semaphore than the dataset. So even something as simple as the process environment is fine (doesn’t get any easier than that…)

Your server will listen to incoming requests and then respond according to the client connection algorithm. You will also be required to add 3 server threads that will all block and wait to receive the client request based on a semaphore. Although the 3 methods of IPC all are based on queues, we will be adding a semaphore to only allow 1 thread to pull/pop a request from the queue, and once the request is taken by one of the 3 server threads, then it will release the semaphore allowing the other threads to take the next request from the queue.

Here is an example of how the semaphore will work…

You see 3 server threads T1, T2, and T3. Only one can be receiving from the Server FIFO Queue at a time, so the semaphore will lock out the other 2. When the T2 thread takes the request off the Server queue, it will immediately unlock the semaphore so the other threads can block for the next request on the queue. Right after the T2 thread unlocks the semaphore it will then process the request and send the response back to the client via the Client FIFO queue and then go back to request the semaphore and block until it gets the unlock from the semaphore and then blocks for the next request from the Server FIFO QUEUE.

Reference no: EM131108678

Questions Cloud

High unemployment and excess industrial capactiy : By using clearly labeled AS and AS curves to illustrate your points, discuss the impacts of the following events on the equilibrium price level and equilibrium level of output in the short run. An expansionary fiscal policy with the economy operating..
Which school of philosophy survived unscathed : During the Qin dynasty, books were burned. These books particularly included philosophical treatises and other related literature. Which school of philosophy survived unscathed
Who was this 4th century qin prime minister : Of all the men who built up the state of Qin during the period one man's fame was rivaled only by that of the First Emperor himself. Who was this 4th Century Qin prime minister
Growth of the labor force helping to prevent inflation : How is the growth of the labor force helping to prevent inflation? support the answer with a graph. What would happen if aggregate demand continued to expand but the growth of the labor force slowed? how would this situation be depicted graphically?
Create a client and a server that communicate message queues : Lab 2 will require you to create a client and a server that communicate over either message queues, sockets, or a well known fifo. The data passed will be a simple request/response in string format.
Prepare the journal entry to record income tax expense : Assuming there were no temporary differences prior to 2010, indicate how deferred taxes will be reported on the 2012 balance sheet. Gordon's product warranty is for 12 months.
Find the scattering parameters for the four-port bagley : Find the scattering parameters for the four-port Bagley polygon power divider shown below.
Promising for keeping up with the advances : What handheld forensic software is the most promising for keeping up with the advances in technology?
Practice of project risk and procurement management : This is an individual assignment worth 50% of the module mark. Word length 3000 words (do notexceed word limit). Do not include the abstract, table of contents, or References in the word count.

Reviews

Write a Review

Computer Networking Questions & Answers

  Find the required bit rate if sampling rate is given

Find out the required bit rate. Suppose that the sampling rate is 8000 samples per second and that one framing bit is added to each frame.

  Configuring vlans and deciphering stp output

Write a paragraph (minimum five college-level sentences) below that summarizes what was accomplished in this lab, what you learned by performing it, how it relates to this week's TCOs and other course material, and just as important, how you feel ..

  Designing an application server to host web sites

You have been tasked with researching and designing an application server to host Web sites, FTP sites, and streaming media. This server will be used for both internal and external access. In order to complete this task, you must answer the follow..

  Riverina auto parks assembles components that are needed

riverina auto parks assembles components that are needed for a new model produced by an international car manufacturer.

  Questiona give an example of a cross site scripting xss

questiona give an example of a cross site scripting xss attack. include an explanation of the differences between

  What is mimo and what''s the history

Describe how MIMO is currently being used within the telecommunications and networking industries, i.e., cellular, WMAN, WWAN , etc.

  Explain three 3 ways in which businesses use internet

assume that you were recently hired by a manufacturing company as a systems administrator trainee. your first

  Examine UBR-CBR and ABR technologies

Choose one of these as the preferred method for transmitting data when bit-rate and minimum quality of service are top priorities and defend why this technology is the best of the three.

  Research the web and choose and describe 3 tools which can

research the web and select and discuss 3 tools that can be used to test network reliability. assignment guidelinesbull

  Types of cable connection of bank network

Even though the loading dock is nowhere near the shop floor, the dock is 1100 feet from the front office. What types of cable will work to make this connection? Choose the best medium for this project.

  Why is it significant to secure windows and unix servers

CIO has asked you to describe why you suggest it is so significant to secure your Windows and Unix/Linux servers from known shortcomings/vulnerabilities.

  Factors for moving wireless nics into more dominant role

Explain whether this is still true today, and write down factors are moving wireless NICs into more dominant role, if any.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd