EX - NO:1 Date: Implementation of Stop and Wait Protocol and Sliding Window Protocol Aim
EX - NO:1 Date: Implementation of Stop and Wait Protocol and Sliding Window Protocol Aim
EX - NO:1 Date: Implementation of Stop and Wait Protocol and Sliding Window Protocol Aim
NO:1
DATE:
Implementation of Stop and Wait Protocol and Sliding Window Protocol
AIM:
To write a java program to perform data transfer operation using Stop and Wait Protocol and
Sliding Window Protocol.
ALGORITHM:
Result:
Thus the implementation of stop and wait protocol and sliding window protocol was executed
successfully.
EX.NO:2 Study of Socket Programming and Client – Server model
AIM:
To implement socket programming date and time display from client to server using TCP Sockets
ALGORITHM:
Server
1. Create a server socket and bind it to port.
2. Listen for new connection and when a connection arrives, accept it.
3. Send server’s date and time to the client.
4. Read client’s IP address sent by the client.
5. Display the client details.
6. Repeat steps 2-5 until the server is terminated.
7. Close all streams.
8. Close the server socket.
9. Stop.
Client
1. Create a client socket and connect it to the server‟s port number.
2. Retrieve its own IP address using built-in function.
3. Send its address to the server.
4. Display the date & time sent by the server.
5. Close the input and output streams.
6. Close the client socket.
7. Stop.
Result:
Thus the implementation of socket programming date and time display from client to server using
TCP Sockets was executed successfully.
EX.NO:3 Write a code simulating ARP/RARP protocols.
Aim:
To write a java program for simulating ARP protocols using TCP and RARP protocols using UDP
ALGORITHM:
Client
Server
3. Server maintains the table in which IP and corresponding MAC addresses are stored.
5. Map the IP address with its MAC address and return the MAC address to client.
ALGORITHM:
Client
Server
2. Server maintains the table in which IP and corresponding MAC addresses are stored.
4. Map the IP address with its MAC address and return the IP address to client.
Result:
Thus the implementation of simulating ARP protocols using TCP and RARP protocols using UDP was
executed successfully.
EX-NO. 4
Aim:
To Write the java program for simulating ping command and Trace route command.
Algorithm
Step 3: To create a process object p to implement the ping command and Trace route command.
Step 6: Get the details of the server using Trace route command.
Result:
Thus the implementation of simulating ping command and Trace route command was executed
successfully.
EX.NO 5. Create a socket for HTTP for web page upload and download.
Aim:
To write a java program for socket for HTTP for web page upload and download .
Algorithm
1.Start the program.
2.Get the file from preferred domain.
3.To create HTTP webpage upload to particular domain name.
4.Run the program the downloaded HTTP web page would appear on file location side.
5.That downloaded HTTP page contain new location moved request of a document.
6.Stop the program
Result:
Thus the Creation of socket an HTTP for web page upload and download was executed successfully.
EX-NO 6. Write a program to implement RPC(Remote Procedure Call)
Aim:
To write a java program to implement RPC (remote procedure call)
Algorithm :
Step 1: start the program.
Step 2: include the necessary packages in java.
Step 3: create an interface as ucet and extends the predefined interface remote into it.
Step 4: declare the remote methods inside the interface used.
Step 5: declare the class rpc and extends the predefined class.
Step 6: unicast remote object an implement the interface ucet into it.
Step 7: declare the class server &create an object ob for the class rpc.
Step 8: declare the class client
Step 9: call the remote methods using the object ob which is the object of the
interfaceucet.
Step 10: the remote method contains the methods such as
Functions of calculator.
Step 11:Stop the program.
Result:
2.Enter the IP address and Split the string that displayed in binary form
3.Enter the number of addresses and calculation of mask that number of bits required for address.
4.Find the subnet masks and Calculate first and last addresses.
Result:
EX.NO:8b
EX.NO:8c
Result
Thus domain name requests by the client are resolved into their respective logical
address using lookup method.
EX.NO:9b
Aim
To implement SNMP server in java using UDP sockets.
Algorithm
Server
1. Create a datagram socket
2. Receive client's message in a datagram packet.
3. Read Client's message and display it
4. Convert text from client to upper case and send it back to client
5. Repeat steps 2-4 until the client has something to send
6. Close the server socket
7. Stop
Client
1. Create a datagram socket
2. Get a message from user
3. Construct a datagram packet and send it to server
4. Create a datagram packet to receive echoed message
5. Read server's response and display it
6. Repeat steps 2-5 until there is some text to send
7. Close the client socket
8. Stop
Result
Thus data from client to server is check reliability of the channel information was executed.
EX.NO:9c
Aim
To implement a file server and client in java using UDP sockets.
Algorithm
Server
1. Create a server socket
2. Wait for client to be connected.
3. Read filename from client
4. Open the file using java File methods
5. Write file contents onto stream until EOF
6. Close all streams
7. Close the server and client socket
8. Stop
Client
1. Create a client socket and establish connection with the server
2. Get filename from user and send it to server
3. Read file contents from server stream and display it
4. Close all input/output streams
5. Close the client socket
6. Stop
Result
Thus file contents was sent from server to client using UDP socket programming.