11-04-2014, 02:35 PM
SIMULATION OF SIMPLE NETWORK MANAGEMENT PROTOCOLS
AIM:
To write a C program for simulation of Simple Network management Protocols.
ALGORITHM:
MANAGER:
Step 1: Start the program.
Step 2: Create an unnamed socket for client using socket ( ) system.
Step 3: Call with parameters AF_INET as domain and SOCK_STREAM as type.
Step 4: Name the socket using bind ( ) system call.
Step 5: Now connect the socket to agent using connect ( ) system call.
Step 6: Get the input for the type of information needed from the agent.
Step 7: If the input is equal to ‘TCP connection’ then goto next step else If it is equal to ‘system’ Goto step 9.
Step 8: Read the input for the object, send it and receive the details of the TCP
connection of that object from the agent. Go to step 10.
Step 9: Read the input for the object, send it and receive the details of the system from the agent. Go to step 10.
Step 10: Receive the message, print and terminate the process.
Step 11: Stop the process.
AGENTS
Step 1: Start the program.
Step 2: Create an unnamed socket for the server using the parameters AF_INET as domain and the SOCK_STREAM as type.
Step 3: Name the socket using bind( ) system call with the parameters server_sockfd
and the manager address(sin_addr and sin_sport).
Step 4: Create a connection queue and wait for manager using the listen ( ) system call with the number of manager request as parameters.
Step 5: Accept the connection using accept( ) system call when manager requests for connection.
Step 6: Receive the message from the manager. If the request is for ‘TCP connections’ then send the details of the requested object, else if the request is for ‘System’ then send the details of the requested system.
Step 7: Stop the program execution.
RESULT
Thus the C program for simple network management protocols has been executed successfully.