You are on page 1of 7

Protocol Design for Shanks Ponys System

Message Format

Messages may vary in length. Each message starts with a 1 identifying character
field to identify the message type (the characters are cases sensitive), followed by 0
or more relevant data. Each part or field of the message is separated from one
another by a tab character.

Identifying data data ............. data


character

Message from client

There are ten valid message types. Their format and use is described below:
Identifying Data
Character

Register R Account Email Password Customer Contact


New ID Name Number
Customer
6 8 40 10 18 8 80 9 12
digits characters characters characters digits

This message indicates the transmission of Account ID, Password, Customer Name,
Email, and Contact Number to the server for new customer registration.

Login L Email Password

8 40 characters 10 18 characters

This message is used to transfer Email and password in order to authenticate login
credential to the server.
View W
Walks
List
Request

This message is to query the list of all the available walks.

View WD Walk ID
Walk
Date 5 characters
Request

This message is to query the list of date of walks using Walk ID.

View WT Walk ID
Walk
Time 5 characters
Request

This message is to query the list of time of walks using Walk ID.

View WP Walk ID
Walk
Price 5 characters
Request

This message is to query the list of price of walks using Walk ID.
View WG Walk ID
Walk
Guide 5 characters
Request

This message is to query the list of guide of walks using Walk ID.

View WL Walk ID
Walk
Location 5 characters
Request

This message is to query the list of location of walks using Walk ID.

Place B Walk ID Date


Booking
Request 5 characters Date/Time

This message is to place a booking on walks with the specific Walk ID and Date.

Logout O

This message is implemented for log out.


Messages from server
There are six valid message types. Their format and use is described below:

Identifying Data
Character

Positive +
ACK

This message is used to acknowledge successful commands.

Login
Logout
Place Booking Request

Negative - Error code


ACK
2 3 characters

This message is used to acknowledge unsuccessful commands.

Error code:

REL Invalid email length (between 8 40 characters) in Register


(R).
REF invalid email format in Register (R).

RPL Invalid password length (between 10 18 characters) in


Register (R).
RCL Invalid customer name length (between 8 80 characters) in
Register (R).
RCI Incorrect type of customer name (A-Z) in Register (R).

RNL Invalid customer name length (between 9 12 digits) in


Register (R).
RNI Incorrect type of customer number (0-9) in Register (R).
LE Invalid email in Login (L).

LP Invalid password in Login (L).

WDI Invalid Walk ID in View Walk Date Request (WD).

WTI Invalid Walk ID in View Walk Time Request (WT).

WPI Invalid Walk ID in View Walk Price Request (WP).

WGI Invalid Walk ID in View Walk Guide Request (WG).

WLI Invalid Walk ID in View Walk Location Request (WL).

BI Invalid Walk ID in Place Booking Request (B).

Walk WR Walk id1 \t location1 \t date1 \t time1 \t price1 \t guide1 \n


List
Walk id2 \t location2 \t date2 \t time2 \t price2 \t guide2 \n
Reply
Walk id3 \t location3 \t date3 \t time3 \t price3 \t guide3 \n
Walk id4 \t location4 \t date4 \t time4 \t price4 \t guide4 \n
Walk id5 \t location5 \t date5 \t time5 \t price5 \t guide5 \n
Walk id6 \t location6 \t date6 \t time6 \t price6 \t guide6 \n
Walk id7 \t location7 \t date7 \t time7 \t price7 \t guide7 \n
Walk id8 \t location8 \t date8 \t time8 \t price8 \t guide8 \n

Walk id \t location \t date \t time \t price \t guide \n

5 chars 15 100 Date/time 1-4 100 1000


chars digits chars

A set of variable list of walks including walk ID, location, date, time, price, and guide per
walk ending with \n as next line for the View Walk List Request (W).
View WDR Walk id \t date \n
Walk
Date
Reply Walk id \t date \n

5 chars Date/time

A set of variable list of walk (walk ID and date) for the View Walk Date Request (WD).

View WTR Walk id \t time \n


Walk
Time
Reply Walk id \t time \n

5 chars Date/time

A set of variable list of walk (walk ID and time) for the View Walk Time Request (WT).

View WPR Walk id \t price \n


Walk
Price
Reply Walk id \t price \n

5 chars 1 4 digits

A set of variable list of walk (walk ID and price) for the View Walk Price Request (WP).
View WGR Walk id \t guide \n
Walk
Guide
Reply Walk id \t guide \n

5 chars 100 1000 chars

A set of variable list of walk (walk ID and guide) for the View Walk Guide Request (WG).

View WLR Walk id \t location \n


Walk
Location
Reply Walk id \t location \n

5 chars 15 100 chars

A set of variable list of walk (walk ID and location) for the View Walk Location Request
(WL).

You might also like