0% found this document useful (0 votes)
58 views

Assignment#3

This document provides instructions for a computer networks lab assignment involving the implementation of communication protocols. Students are asked to: 1. Modify an existing program to implement message exchange as a protocol with request and reply structures defined by byte values and data types. 2. Write a client-server application for simple file transfer with a protocol to allow the client to request a file from the server and the server to send it and ask the client for options. 3. Write a non-blocking chat client-server program using select() to allow users on different machines to send text to each other at any time without waiting for a reply.

Uploaded by

AnshulAnand
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Assignment#3

This document provides instructions for a computer networks lab assignment involving the implementation of communication protocols. Students are asked to: 1. Modify an existing program to implement message exchange as a protocol with request and reply structures defined by byte values and data types. 2. Write a client-server application for simple file transfer with a protocol to allow the client to request a file from the server and the server to send it and ask the client for options. 3. Write a non-blocking chat client-server program using select() to allow users on different machines to send text to each other at any time without waiting for a reply.

Uploaded by

AnshulAnand
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Indian Institute of Information Technology, Allahabad

Course: Computer Networks (ICNW532C)


Batch: Batch 2014 (IT, ECE and Integrated Programs)
Lab Assignment #3
Lab Sessions: 16.09.2016
Deadline: Lab sessions from 19 to 23 Sept. 2016
1. In this lab, you will convert your previous program. The only logical change
you need to make is to implement your exchange of messages as a protocol.
The protocol will be structured as follows (note, a string of digits followed by
a b means a binary number):
Requests:
byte
content
---------0
request code, 0000001(b) = name, 00001001(b) = number
1-n
request data
n+1
end-of-request, 00000011(b) (ETX)
Replies:
byte
---0-n
n+1

content
------reply data
end-of-reply, 00000011(b) (ETX)

Note that the requests allow for both name and number matching, so you need
to also be able to match a name. Also note that the character string can contain
any type of byte oriented data, including binary representations of numbers.
For example,
short val;
char *message;
message = &val;
send (sock, message, 2, 0);
2. (Simple File Transfer) Write a client server application in which client request
a file to server and server send requested file to client. Design a suitable
protocol for message exchange as above, so that client and server can
communicate efficiently and server can ask different option to the client.
3. Write a client-server program that provides chat facility. Your application
allows a user on one machine to type in and send text to a user on another
machine. Your application should provide non blocking chat facility to the

users. This means, user can send its message at any time without waiting for
replay from the other side. (Hint: Use select() system call)

You might also like