You are on page 1of 4

THE PROBLEM:

You have to design an


three types of Data

Online Test System

which contains

Audio
Video
Text files

The test consists on 3 portions.

Written Test (Textual questions an Textual Answers).


Audio Test (Audio questions and Textual Answers).
Video Test (Video questions and Textual Answer)

Details:
Whenever a client connects to the server, it will display three kinds of tests
(Written, audio and video). The main server does not want to overburden
itself by listening to all incoming clients and handle the tests, so it only
stores the info about which sub-server contains what sort of test. When a
sub-server connects to the main server it sends the main server a file
containing the list of subjects of tests it has. When a client connects to a
server it has to the choose the type of test and subject of test. The main
server searches the records and sends back the appropriate test.
A pictorial demonstration is as follows:

Client A

Main Server
(Thread 1)

You have to:


1. Design a Main Server in C.

Sub Server 1 (Thread


2)
Sub Server 2
(Thread 3)

Sub Server 3
(Thread 4)

2. Design a Client with Graphical User Interface. You can do it in any


language you want.
3. Design a TCP Sub-server. When a sub-server connects to the main
server it sends it the list of the tests it has using UDP. The format of the
file sub-server has is:

subject of the test, type of test ,


size
The list a sub-server send to the main server will have the following format:
Test_name, file_size, test_type, sub-server IP, sub-serverport
There should be at least 3 instances of sub-server
4. Main server will make a database with all the data it gets from the subservers.
5. Client will send request to this server through this GUI using UDP.
e.g Client will send Mathematics & Written test
6. Main server will search the record in the database it has and will send
these search results to the client, along with the IP and port number of
the sub-server to which that respective search result belongs to. (You
can select the format of servers message as per your ease!)

The Client will show these results in GUI. It will not show the IP and Port
of the sub-server as it is for internal use.
8. The client will select a search result of its own choice and develop a
tcp connection with the sub server to which that search result
belongs to and start downloading the file or streaming the
audio/video(Dont forget that IP and Port number were sent by the server to the
7.

client earlier!).

Since the file can be too large it has to be broken down into chunks.
10. The client will receive those chunks and upon receiving. Adding a
seek bar at the clients end will earn you bonus marks. This
code should work for at least three clients accessing the server
simultaneously.
11. Client will play the audio/video or show written test and user will send
the answer to server. Server will store this answer along with subject
name and question number and client id.
9.

Remember!!Your understanding of the code will give you most of the credit.
Your understanding will be reflected only if you properly comment the
code.

Technical Details:

On client side you are welcome to use any language you want, but do
remember that you will have to stream the video/audio so chose
intelligently.
On the sub server side, while sending the file, first of all you will read
the file, then make the system calls related to networks, as per your
requirement, coding and then you will send that file in chunks.
To break the audio/video file in smaller chunks ffmpegcommand in
c is used:
With ffmpeg you can split file using the following command:
ffmpeg -acodec copy -vcodec copy -ss START -t LENGTH -i
ORIGINALFILE.mp4 OUTFILE.mp4
Where START is starting positing in seconds or in format hh:mm:ss and
LENGTH is the chunk length in seconds or in format hh:mm:ss.

You will run this command as per your requirement, depending on the
size of the video.
You might be required use semaphore and Mutex-lock at client side.

Thats it for now. Dont freak out! You have a lot of time to
accomplish this task! Find the submission details below.

NOTE:
1.
2.

Should be emailed at cnlabfall2016@gmail.com


Deadline: 7/NOV/2016.

3.

4.

Your name, roll number and section should be


mentioned in the subject of the email AS WELL
AS IN YOUR .CPP/C FILE.
Codes should be submitted in a zipped folder
which should also contain all the required
text/audio/video files.