8CS5 UNIX NETWORK PROGRAMMING & SIMULATION LAB (Comp. Engg.)
Objectives:
At the end of course, the students should be able to
• Understand various distributions of Unix viz. BSD, POSIX etc.
• Write client/server applications involving unix sockets involving TCP or UDP
involving iterative or concurrent server.
• Understand IPV4 & IPV6 interoperability issues
• Use fork( ) system call.
• Understand the network simulator NS2 and Simulate routing algorithm on NS2
(Available on http://www.isi.edu/nsnam/ns/).
Suggested Platform: For Socket Programming- Linux, For NS2 Any of Microsoft Windows
or Linux (In case of Microsoft, Virtual environment cygwin will also be required).
Suggested Exercises
1. Write two programs in C: hello_client and hello_server
• The server listens for, and accepts, a single TCP connection; it reads all the data it
can from that connection, and prints it to the screen; then it closes the connection
• The client connects to the server, sends the string “Hello, world!”, then closes the
connection
2. Write an Echo_Client and Echo_server using TCP to estimate the round trip time
from client to the server. The server should be such that it can accept multiple
connections at any given time.
3. Repeat Exercises 1 & 2 for UDP.
4. Repeat Exercise 2 with multiplexed I/O operations
5. Simulate Bellman-Ford Routing algorithm in NS2