Internet client control task, Computer Networking

Assignment Help:

Internet Client Control Task

A distributed system is to be implemented using networked PCs.

The role of the system in this task is to implement an environmental control system which is remotely supervised by a client utility that you will write the code for.

An environmental controller is attached to a PC which acts as an Internet server. The controller, when enabled, turns a heater on or off depending on the temperature and reports to the server. The client sends messages to the server, the server communicates with the controller and replies to the client if necessary. The message protocol used is defined in section 2.

1.1 Client commands to the server - you will have to design a GUI and write client code to implement this

  • reset controller
  • enable / disable the controller
  • set the temperature Set Point of the controller i.e. the desired temperature range = 0 to 250C
  • request the controller's status
  • request the controller's set point
  • request current temperature
                                                                                                        

 

553_Internet Client Control Task.png

 

1.2 Starting Point

A simple client program is available ClientV1 including source code.

The server code is available as ServerV1.exe (executable only).

Unzip the server code, compile and run ClientV1.sln and run ServerV1 on a single PC.

ServerV1 - Put Server in listening mode (Click Listen)

ClientV1 - Connect to server 'local host'

Send commands from the Client to the Server by typing the Protocol commands into the text box and pressing return. Observe the response. Example commands are in the protocol section below.

Simulated Slave Controller

The server code simulates the slave controller and no hardware needs to be attached. The server code provides a random simulated temperature and compares this with the Set Point and the Status before deciding to turn the heater on or off.

1.3 Suggested Development Areas

  • Implement the Reset message (this sets the controller to a known state)
  • Implement enable / disable controller
  • Implement the set Set Point message
  • Implement the request Status, Set Point and Temperature responses
  • Implement a Mimic (display) Panel on the Client GUI to give a user feedback about the condition of the real controller
  • Display the data from the controller graphically
  • Log the Actions of the Client and Slave
  • Add a database feature ( time, status, temperature etc)
  • Automate - use time of day info to enable and disable slave
  • Allow contact with additional slave controllers 2-31 via address field
  • Implement error messages and Protocol code.
  • Provide Hints, Help and Version ID information as appropriate
  • Develop unit based code

2.  PROTOCOL-88. Character Based Serial Protocol - N.b. You will NOT find this on the web.

  • Messages form a simple communication link between computers.
  • The protocol-88 message format is based on ASCII characters.
  • The message format is 14 characters in length including the framing characters
  • The message is framed by the characters '<' and '>'
  • The message consists of 6 internal fields defined as:

key: [t] = tens [u] = units

(a) slave address [t][u]

(d) data [t][u]

(b) command [t][u]

(e) spare e.g. additional data

(c) type [t][u]

(f) error correction e.g. checksum

thus any field may take on values of tens and units [t][u] i.e. 00 to 99

A typical message is thus:

<010203040599>

01 = slave address (1), 02 = command (2), 03 = command type (3), 04 = data (4), 05 = spare (5), 99 = error bits (99).

Links to the Client and the Server executables are at: www.det.mmu.ac.uk/staff/allwork/

They are Client1.zip and ServerV1.exe

A typical message:

<

Address

com-mand

type

data

spare

error

>

 

[t]

[u]

[t]

[u]

[t]

[u]

[t]

[u]

?

?

?

?

 

1

2

3

4

5

6

7

8

9

10

11

12

13

14

 Definition of message fields:-

command

type ( of command )

data

00 (reset)

none

none

01 (set client-to-server)

01 (enable - on / off)

[1]= on | [0]= off

 

02 (set_point)

[t][u]

 

03 (not applicable)

 

02 (request & response)

client-to-server  & server-to-client)

01 (local_status_enable)

[1]= √ | [0]= x

 

02 (set_point)

[t][u]

 

03 (temperature)

[t][u]

√=enabled   x =disabled

EXAMPLES:

  • Error detection is NOT incorporated into these examples (nor by my server code)
  • unused fields are indicated as X - by default these should be set to 0
  • address 00 is the master

 

a) a message from the client to slave_1 indicating a local reset would be:  < 0 1 0 0 0 0 0 0 0 0 0 0 >

(b) a message from the client to slave_2 issuing the command set controller status to enabled would be:

                < 0 2 0 1 0 1 0 1 0 0 0 0 >

(c) a message from the client to slave_1 issuing the command set the set_point to 24 would be:

                < 0 1 0 1 0 2 2 4 0 0 0 0 >

(d) a message from the client to slave_1 issuing the command request the temperature would be:

                < 0 1 0 2 0 3 0 0 0 0 0 0 >

if the slave temperature is currently 18 the reply from the server would be: < 0 1 0 2 0 3 1 8 0 0 0 0 >

You might like to try typing the following into the client:

<010101010000> - set enabled true - enable slave 1 (the server) - enabled 'LED' should turn red.

<010201000000> - request status: enabled - reply should be <010201010000>

<010102150000> - set the temperature set point to 15 degrees - heater should come on and off as temperature varies above and below 15 degrees.

<010203000000> - request temperature the reply should be <010203TU000> where TU is temperature.

 

 


Related Discussions:- Internet client control task

Define the microcells- routing and switching, Microcells As cells becom...

Microcells As cells become smaller, antennas move from the tops of tall buildings or hills, to the tops of small buildings or the sides of large buildings, and finally to lamp

Networking concepts, Networking Concepts Q1  What are the main feature...

Networking Concepts Q1  What are the main features of TCP connections? Why is it said that TCP provides full-duplex service? Q2  What are the differences between TCP conne

Layered concept of computer networks, Q1.  What  advantages  do  you  see  ...

Q1.  What  advantages  do  you  see  in  having  a  layered  concept  of  computer  networks?  Which layers or OSI structure deals with identification of a host? Explain the proces

Network comp. architecture, Write discussion on Associative mapping - compu...

Write discussion on Associative mapping - computer architecture

Explain about switching networks, Question 1: a. Differentiate between ...

Question 1: a. Differentiate between the several types of switching networks together with illustration. b. With the help of a diagram explain the two modes of operation un

Explain about virtual circuit switching, Q. Explain about Virtual Circuit S...

Q. Explain about Virtual Circuit Switching? Virtual Circuit Switching - All packets belong to a message (or) session is preserved. - Single route is selected between s

What is difference among rip and ripv2, RIP It is Broadcast There i...

RIP It is Broadcast There is no authentication It Support FLSM   RIPV2 It is Multicast There is Authentication It Support VLSM

Function of tcp - ip transport layer, Q. Function of TCP/IP Transport Layer...

Q. Function of TCP/IP Transport Layer ? TCP/IP Transport Layer - Defines two standard transport protocols UDP and TCP - TCP equipment a dependable data-stream protocol

Explain point-to-point connection type, Explain Point-to-Point connection t...

Explain Point-to-Point connection type. Many point-to-point connections are associated with modems and PSTN (Public Switched Telephone Network) communications.

Illustrate TCP – bytes and segments, Q. Illustrate TCP – bytes and segments...

Q. Illustrate TCP – bytes and segments? TCP - bytes & segments TCP at the sending site collects bytes into a packet called a segment TCP adds a header to each se

Write Your Message!

Captcha
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