Sunteți pe pagina 1din 10

BCSCCS506R03- COMPUTER NETWORKS LAB

School of Computing Shanmugha Arts, Science, Technology and Research Academy SASTRA University Tirumalaisamudram, Thanjavur

OBJECTIVE
To provide the students with the practical experience of the networking Concepts they learn in their theory course and to enrich their knowledge in course and to enrich their knowledge in network programming

List of Experiments
1. Simple network programs a)Finding IP address of a computer b)Using Ping command c). Sending messages to other users in a network. 2. Information exchange between client and server using TCP and UDP. 3. Secured communication through encryption and decryption of messages. 4. Remote procedure call under client server environment (RMI). 5. Implement data link layer framing method bit stuffing. 6. a) Error Detection using CRC b)Error Correction using Hamming Code. 7. Serial Communication between PCs - RS 232. 8. Sliding window protocols - Go back-N and Selective repeat. 9. Obtaining the routing table at each node using distance vector routing. 10.Usage of Linux commands 11.Simulation of wired and wireless networks. 12.Network performance evaluation using simulator. 13.Study of SASTRA network infrastructure.

1 A. Finding an IP Address of a Computer


Aim: To develop a program in java using appropriates classes and functions to find an IP Address of a computer. Procedure: i. Develop the java program implementing java.InetAddress class. ii.Use the functions getHostAddress() for getting IP address, getHostName() for getting name of a Computer

Result: The developed program is useful in determining the ipaddress and name of a machine.

Pre-lab: Knowledge of the java IneAddressclass

1 B. Using Ping Command


Aim: To ping a computer using Java API. Procedure: i. Develop the java program implementing java.InetAddress class and IsReachable method. ii.Use the program to check whether the specified machine is connected in the internet.

Result: The developed program is useful in determining whether a particular system is connected in the network presently or not.

Pre-lab: Knowledge of ping, its parameters and java class IneAddressclass

1 C. Sending Messages to users in the Network


Aim: To send a pop-up message to any logged in user on the network or list the user names on your network Procedure: i. Develop a sender program comprising of a GUI that displays the various systems presently connected to the network ii. Develop a program for receiving the message. iii. Let the user choose a system to send the message. iv. Type in the message to be sent and click send. v. Receiver program receives the message and notifies the user.

Result: The given objective of sending a pop-up message in a networked environment was successfully carried out. Pre-Lab: Skills to implement GUI in java, necessary functions and classes in java.

2A. Information exchange between client and server using TCP


Aim: To develop a program in java using appropriates classes and functions that simulate the functioning of TCP/IP protocol for sending and receiving a file using a connection.

Procedure: i. Develop a sender program for choosing and forwarding a file. ii.Develop a receiver program for receiving and storing the file. iii. Let the user choose the file to send. iv. Get the IP address of the destination machine. v. Invoke the two programs on different machines. vi. Verify whether the file is successfully received by showing the file content in a text area. Result: The program has successfully transmitted a file using TCP/IP protocol. Pre-Lab: Knowledge of TCP/IP protocol basics, Java.Net package, Java Sockets

2B. Information exchange between client and server using UDP.


Aim: To develop a program in java using appropriates classes and functions that simulate the functioning of UDP protocol for sending and receiving a file.

Procedure: I. Develop a sender program for choosing and forwarding a file. ii. Develop a receiver program for receiving and storing the file. iii. Let the user choose the file to send. iv. Get the IP address of the destination machine. v. Invoke the two programs on different machines. vi. Verify whether the file is successfully received by showing the file content in a text area

Result: The program has successfully transmitted a file using UDP protocol. Pre-Lab: Knowledge of UDP protocol basics, Java.Net package, Java DataGramSocket.

3. Secured Communication through the Encryption and Decryption of messages.


Aim: To encrypt a plain text using a key and transmit the cipher text and decrypt the cipher text at the receiver side to get back the original message.

Procedure i. Choose an algorithm for encryption and decryption. ii. Develop a program implementing the encryption logic for the sender. iii. Develop a program implementing the decryption logic for the receiver iii. Sender takes a message as input, encrypt it using a key and forward the cipher text. v. Receiver receives the message, decrypt the message using the same key and show that to the user.

Result: A message was securely transmitted using a cryptography method. Prelab: Knowledge of cryptographic algorithms.

4. Remote Procedure Call using RMI


Aim: To demonstrate usage of the remote method call using RMI

Procedure: i. Declare a Server Interface for the remote methods ii. Implement the interface in the server class iii. Create a client class and bind it to the remote server. iv. Write code, to call the remote method with appropriate parameters. v. Using the Server Implementation class create the skeleton and stub files using rmic. vi. Run the rmiregistry, server program and client program to call remote method. Result: The program has demonstrated how to invoke a remote method by using the RMI concept in java. Pre-Lab: Knowledge of remote methods,Java.RMI package .

5. Implementation of Bit stuffing


Aim: Develop a java program for Implement data link layer framing method bit stuffing. Procedure:
1.Read the number of frames. 2.Read the binary data for each frame. 3.Bit Stuffing:If there is five consecutive 1s after zero ,add one zero as sixth bit. 4.Transmit the data. 5.Destuffing:If there is zero after the five consecutive 1s ,remove that zero in the data. 6.Display the data.

Result: The program has implements the bit stuffing method. Pre-Lab: Knowledge of bit stuffing algorithm, data transfer protocols

6A. Error Detection using CRC


Aim: Develop a java program for implement the error detection method CRC ( Cycle Redundancy Check)

Procedure: 1. Choose n and k(number of msg bits) value, where (n-k) is the frame check sequence(FCS) size. 2. Choose pattern P where as it should be at least one bit greater than the FCS. 3. LSB and MSB in P should be 1. 4. Divide the msg bit by P. Add the remainder with the msg bit, transfer it. 5. At the receiver end the transmitted data is divided by the same pattern P. 6. If the remainder is zero, No Error in the code Otherwise Error is Detected.

Result: The program has implements Cycle redundancy check for detecting the errors.

Pre-Lab: Knowledge of CRC, data transfer protocols

6B. Error Correction using Hamming Code


Aim: Develop a java program for implement a single bit error correction method hamming code. Procedure: Sender site: 1. 2. 3. 4. 5. Get message and convert it to binary string Create H matrix Compute redundant Hamming bits Concatenate message and Hamming bits Send frame

Receiver site: Receive frame Divide frame to message and code bits Generate H matrix Compute Hamming bits from message Perform XOR operation between received and computed Hamming bits If XOR result is all zero binary o Message have no errors 7. Else 1. Generate H matrix with identity 2. Perform on matrix columns XOR operation with previous XOR result 3. If some result is all zero bit 1. The column number is faulty bit position 2. Change frame bit on founded position to opposite 3. Compute Hamming bits for frame message part 4. If corrected frame Hamming bits equals computed Hamming bits Message is corrected 5. Else There is more than one bit error cannot correct 4. Else There is more than one bit error cannot correct 1. 2. 3. 4. 5. 6.

Result: The program has implements Hamming Codes for detecting and correcting a single bit error. Pre-Lab: Knowledge of Hamming Code, data transfer protocols

7. Serial Communication between PCs - RS232


Aim: To demonstrate using JAVA code, the data transfer between two machines using RS232 serial interface Procedure: i. Design a window at the sender side that will have a text field to accept the message and a button to send. ii. Use the static method CommPortIdentifier, getPortIdentifier to get the list of available ports. iii. Create SerialPort object for each of the entries in CommPortIdentifier list and open the port with a specific port number iv. Set the SerialPort parameters like baud rate, data bits, stop bits and parity. v. Bind the SerialPortEventListener to the SerialPort object. vi. Set notifyonDataAvailable as True. vii. Implement the serialEvent method to read the data available on the port.

Result: Through this experiment, the character transmission between systems was successfully done using RS232. PreLab: Prior knowledge of RS232 interface , java class CommPortIdentifier.

S-ar putea să vă placă și