III YearNetworks

download III YearNetworks

of 10

Transcript of III YearNetworks

  • 8/22/2019 III YearNetworks

    1/10

    BCSCCS506R03- COMPUTER NETWORKS

    LAB

    School of Computing

    Shanmugha Arts, Science, Technology and Research

    Academy SASTRA University

    Tirumalaisamudram, Thanjavur

  • 8/22/2019 III YearNetworks

    2/10

    OBJECTIVE

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

  • 8/22/2019 III YearNetworks

    3/10

    List of Experiments

    1. Simple network programs

    a)Finding IP address of a computerb)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.

  • 8/22/2019 III YearNetworks

    4/10

    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

  • 8/22/2019 III YearNetworks

    5/10

    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.

  • 8/22/2019 III YearNetworks

    6/10

    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.

  • 8/22/2019 III YearNetworks

    7/10

    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 decryptthe 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

    .

  • 8/22/2019 III YearNetworks

    8/10

    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

  • 8/22/2019 III YearNetworks

    9/10

    6B. Error Correction using Hamming Code

    Aim:

    Develop a java program for implement a single bit error correction method hammingcode.

    Procedure:

    Sender site:

    1. Get message and convert it to binary string2. Create H matrix3. Compute redundant Hamming bits4. Concatenate message and Hamming bits5. Send frame

    Receiver site:

    1. Receive frame2. Divide frame to message and code bits3. Generate H matrix4. Compute Hamming bits from message5. Perform XOR operation between received and computed Hamming bits6. If XOR result is all zero binary

    o Message have no errors

    7. Else1. Generate H matrix with identity2. Perform on matrix columns XOR operation with previous XOR result3. If some result is all zero bit

    1. The column number is faulty bit position2. Change frame bit on founded position to opposite3. Compute Hamming bits for frame message part4. 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

    Result:

    The program has implements Hamming Codes for detecting and correcting a single bit error.

    Pre-Lab:

    Knowledge of Hamming Code, data transfer protocols

  • 8/22/2019 III YearNetworks

    10/10

    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.