Starting from:

$34.99

CNE532 Lab Assignment #1 Solution

1. Install LINUX in your computer. Please refer Beej's Guide to Network Programming Using Internet Sockets for implementing your programs. The copy of the document is attached herewith for your reference.
2. Go through the man pages of following system routines and explore different parameters used. Submit a brief summary too.
1. man
2. socket
3. bind
4. connect
5. listen
6. accept
7. send
8. recv
9. sendto
10.recvfrom
11.close
12.shutdown
13.fork
Hint: In the command prompt you have to type man socket to see man page of socket system call. For example
$man socket
3. Implement linked list and all its operation and demonstrate with suitable input/output operations.
4. Write a simple client­server program using STREAM socket that provides chat facility. Your application allows a user on one machine to type in and send text to a user on another machine. (Hint: Computer Networks by Davie and Peterson; page no. 45).
5. Introduction to Sockets and Tasks shall be performed using DGRAM socket:
a. Create three programs, two of which are clients to a single server. Client1 will send a character to the server process. The server will decrement the letter to the next letter in the alphabet and send the result to client2. Client2 prints the letter it receives and then all the processes terminate. Compile and run this exercise in both the UNIX and the Internet domains.
b. Follow the same procedure as in part a except that the data type of the message should be integer and the server should decrement the integer before transmitting it to client2.
c. Next write a socket program to enable client1 to send a float value to the server. The server process should increase the value of the number it receives by a power of 1.5. The server should print both the value it receives and the value that it sends. Client2 should print the value it receives from the server.
d. Send a C structure that includes data of type character, integer and float from client1 to the server. The server should change the values so that client2 receives a structure with entirely different data. It is not permitted that the data should be converted to any other data type before transmission. Do this exercise in both the UNIX and the Internet domains.

More products