Académique Documents
Professionnel Documents
Culture Documents
Date:
SIMULATION OF CSMA/CD
Aim:
To simulate the CSMA/CD protocol using ViRtSim software and study its characteristics.
Theory:
Carrier sense multiple access is a network access method used on shared network topologies
such as Ethernet to control access to the network. Devices attached to the network cable
listen(carrier sense) before transmitting. If the channel is in use, devices wait before transmitting.
All devices have equal access to use the network when it is clear.
Collusion detection defines what happens when two devices sense a clear channel, then
attempt to transmit at the same time. A collision occurs and both devices stop transmission, wait
for a random amount of time and then retransmit. This is the technique used to access the 802.3
Ethernet network channel. This method handles collision as they occur, but if the bus is
constantly busy, collision can occur so often that the performance drops drastically.
data to B
collision
data to
OUTPUT:
Collision in a network
A
B
Data to B
C
After specified interval
data to C
C
Algorithm:
Declare two frame variables and assign them the data frames to be transmitted.
Initialize the CSMA/CD function.
Send data from node a to node b and sense multiple access.
Send data from node b to node c and sense multiple access.
Check if collision occurs.
If collision occurs wait for 1000ms and then retransmit the two data from the nodes one
Procedure:
Result:
Thus the CSMA/CD protocol was simulated using ViRtsim software and its
characteristics was studied
Exp No: 2
Date:
SIMUATION OF CSMA/CA
Aim:
To simulate the CSMA/CA protocol using ViRtSim software .
Theory:
Carrier sense multiple access is a network access method used on shared network
topologies such as Ethernet to control access to the network .devices attached to the network
cable listen(carrier sense) before transmitting. If the channel is in use, device wait before
transmitting. Multiple access indicates that many device can connect to and share the same
network. All devices have equal access to use the network when it is clear.
Collision avoidance defines what happens when two devices sense a clear channel, then
attempt to transmit the same time .a collision occurs and both devices stop transmission, wait for
a random amount of time and retransmit. This is technique used to access the 802.3 Ethernet
network channel .This method handles collision as they occur, but if the bus is constantly busy,
collision can occur so often that the performance drops drastically.
A
RT
C
Request to send (RTS) sent to A
Output :
CT
data
C
Data transmitted to B
A
ACK
Algorithm:
Declare a frame variable and assign them the data frame to be transmitted.
Initialize the CSMA/CA function.
Nodes keep listening to the channel.
Send request to send frame from node a to node b.
Send clear to send frame from node b to node a.
Send data from node a to node b and sense multiple access.
Send acknowledge frame from node b to node a.
Stop the execution.
Procedure:
Result
Thus the CSMA/CA protocol was simulated using ViRtSim software.
Output:
Exp No: 3
Date:
Result:
Thus the distance vector routing algorithm was implemented and simulated using
ViRtSim software.
Output:
Exp No:4
Date:
Result:
Thus the link state routing algorithm was implemented and simulated using ViRtSim
software.
Ex No:5
Date:
Aim:
To encrypt and decrypt file using pc to pc communication.
Theory:
It is unlikely that system can completely present unauthorized access to transmission media. The
media used today is called encryption, means that the sender transform the original information
to another form and send resulting unintelligence message over the network. Decryption reverses
back the original message. The sender uses an encryption algorithm and a key to transform plain
text into cipher text.
Procedure:
Step 1: Open Vi-Rt sim and choose PC TO PC -> File Encryption.
Step 2: Choose another pc for decryption.
Step 3: Connect both PCs using LAN network kit and process on the encryption side and send
file.
Step 4: Enter password for the file.
Step 5: Receive the file at decryption side by entering password.
Result:
Thus a scenario was created and encryption and decryption was performed.
Ex No:6
Date:
Aim:
To simulate the ring topology using LAN trainer kit and study its characteristics.
Theory:
In ring topology, each device has a dedicated point to point line configuration with the
two devices on either side of it. A signal is passed along the ring in one direction from device to
device until it reaches its destination. Each device in the ring incorporates a repeater. When a
device receives a signal intended for another device its repeater regenerates the bit and passes
them along unidirectional traffic.
Procedure:
Step 1: Switch on the LAN trainer kit and give connections as shown in the block diagram. The
NIC 1 is placed in programming mode.
Step 2: select ViRtSim in the PC and then the utilities.
Step 3: select ARM downloader and click read device ID.
Step 4: reset the NIC 1 and then the device ID will be read successfully.
Step 5: to load the ARM processor, select the respective hex bit file and click load flash.
Step 6: to load the FPGA processor, go to Start all programs Xilinx Accessories and
click on IMPACT
Step 7: Create a new project on Boundary scan configuration, select the respective hex bit file
and load the FPGA chip
Step 8: when program is successfully loaded switch the kit to execution made and
reset.
Step 9: Select on the ViRtSim window PC to PC Ping. Enter the host information
and test the connectivity.
Step 10: OSI LAN TRAINER Topology Ring
Step 1l: Connect the PC with the kit and send the data
Step 12: once data reaches the destination stop the execution.
Result:
Thus ring topology was implemented and simulated using VI-LAN trainer kit and ViRtSim
software.
Ex No: 7
Date:
Procedure:
Step 1: Switch on the LAN trainer kit and give connections as shown in the block diagram. The
NIC 1 is placed in programming mode.
Result:
Thus bus topology was implemented and simulated using VI-LAN trainer kit and ViRtSim
software.
Ex No:8
Date:
SIMULATION OF STAR TOPOLOGY USING LAN TRAINER KIT
Aim:
To simulate the star topology using LAN trainer kit and study its characteristics.
Theory:
In a star topology each device has a dedicated point to point link only to a central
controller, usually called hub. The devices are not directly linked to each other. Unlike a mesh
topology a star topology does not allow direct traffic between devices. The controller act as an
exchange, it sends the data to the controller which then relays the data to the other connected
device. Its advantage includes robustness. If one link fails only that link is affected and all other
link remains active.
NIC1
NIC2
NIC3
Node A
Node
B
Node C
Node
C
Procedure:
Step 1: Switch on the LAN trainer kit and give connections as shown in block diagram. The NCI
1 is placed in programming mode.
Step 2: Select ViRtSim in the PC and then the utilities.
Step 3: Select ARM downloader and click read device ID.
Step 4: Reset the NIC 1 and then the device ID will be read successfully.
Step 5: To load the ARM processor, select the respective hex bit file and click load flash.
all programmes
Xilinx
Step 7: Create a new project on Boundary scan configuration, select the respective hex bit file
and load the FPGA chip.
Step 8: When program is successfully loaded switch the kit to execution mode and reset.
Step 9 : Select on the ViRtSim window PC to PC
the connectivity.
Step 10: OSI LAN TRAINER
Topology
Star
Step 11: Connect the PC with the kit and send the data
Step 12: Once the data reaches the destination stop the execution.
Result:
Thus star topology was implemented and stimulated using VI LAN trainer kit and ViRtSim software.
Ex No:9
Date:
Node B
1
Node
Node
Node
AC
Node
2
Node
Node
Node
Node
NAC
2
Node
Node
AC
Node
Node
Node
3
AC
Node
Node
Node
Procedure:
Step 1: connect the master/server to the computer NIC port.
Step 2: Select ViRtSim in the PC and then the utilities.
Step 3: Select ARM downloader and click read device ID.
Step 4: Reset the NIC 1 then the device ID will be read successfully.
Step 5: To load the ARM processor, select the respective hex bit file and click load flash.
Step 6: To load the FPGA processor, go to start
click on IMPACT.
all programs
Step 7: Create a new project on Boundary scan configuration, select the respective hex bit
File and load the FPGA chip.
Step 8: When is successfully loaded switch the kit to execution mode and reset.
Step 9: Select on the ViRtSim window to PC
the connectivity.
Step 10: OSI LAN TRAINER
Protocol
Step 11: connect the PC with the kit and send the data.
Step 12: While transmitting, enter the error by deleting the error bit -.
Step 13: A NAK frame will be transmitted to the sender and transmission will be stopped.
Step 14: error is then removed by resending the error bit -, the transmission is resumed.
Step 15: once data reaches the destination stop the execution.
Result:
Thus the stop and wait protocol was implemented and simulated using VI-LAN trainer kit and
ViRtSim software.
Ex No:10
Date:
IMPLEMENTATION OF GO BACK N PROTOCOL
Aim:
To implement and test the Go back N protocol using LAN trainer kit and ViRtSim.
Theory:
In Go back N protocol if one frame is damaged or lost, all frames send since the lost
frame acknowledged is retransmitted. The receiver sends an acknowledge frame for a group of
data frames. Only one acknowledgement is enough for a group of transmitted data. In case of lost
data frames the transmitter sends a negative acknowledgement with data frame that is damaged
or lost. Once the sender receives a NAQ, it retransmits the data. If there is a repetition the
receiver discards one of the data.
Procedure:
Step 1: Connect the master/server to the computer NIC port.
Step 2: Select ViRtSim in the PC and then the utilities.
Step 3: Select ARM downloader and click read device ID.
Step 4: Reset the NIC 1 and then the device ID will read successfully.
Step 5: To load the ARM processor, select the respective hex bit file and click load flash.
Step 6: To load the FPGA processor, go to start
and click on IMPACT.
all programs
Xilinx
Accessories
Step 7: Create a new project on Boundary scan configuration, select the respective hex bit
File and load the FPGA chip.
Step 8: When is successfully loaded switch the kit to execution mode and reset.
Step 9: Select on the ViRtSim window to PC
the connectivity.
Step 10: OSI LAN TRAINER Protocol
Go back - N.
Step 11: connect the PC with the kit and send the data.
Step 12: While transmitting, enter the error by pressing the error button on the LAN kit as
many times as the number of frames in data.
Step 13: A NAK frame will be transmitted to the sender and transmission will be stopped.
Step 14: The transmission is resumed when the data is again send.
Step 15: Once data reaches the destination stop the execution.
Result:
Thus the Go back - N protocol was implemented and simulated using VI-LAN trainer kit
and ViRtSim software.
Exp No: 11
Date:
Theory:
NET WORK SIMULATOR (NS2)
Ns overview
Ns programming: A Quick start
Case study I: A simple Wireless network
Case study II: Create a new agent in Ns
Ns overview
Ns Status
Periodical release (ns-2.26, Feb 2003)
Platform support
FreeBSD, Linux, Solaris, Windows and Mac
Ns functionalities
Routing, Transportation, Traffic sources,Queuing disciplines, QoS
Wireless
Ad hoc routing, mobile IP, sensor-MAC
Tracing, visualization and various utilitie
NS(Network Simulators)
Most of the commercial simulators are GUI driven, while some network simulators
areCLI driven. The network model / configuration describes the state of the network
(nodes,routers, switches, links) and the events (data transmissions, packet error etc.). An
important output of simulations are the trace files. Trace files log every packet, every event that
occurred in the simulation and are used for analysis. Network simulators can also provide other
tools to facilitate visual analysis of trends and potential trouble spots.
Most network simulators use discrete event simulation, in which a list of pending "events"
is stored, and those events are processed in order, with some events triggering futureevents
such as the event of the arrival of a packet at one node triggering the event of the arrival of that
packet at a downstream node.
Simulation of networks is a very complex task. For example, if congestion is high, then
estimation of the average occupancy is challenging because of high variance. To estimate the
likelihood of a buffer overflow in a network, the time required for an accurate answer can be
extremely large. Specialized techniques such as "control variates" and "importance sampling"
have been developed to speed simulation.
Packet loss
Occurs when one or more packets of data travelling across a computer networkfail to reachtheir
destination. Packet loss is distinguished as one of the three main error types encountered in
digital communications; the other two being bit error and spurious packets caused due to noise.
Packets can be lost in a network because they may be dropped when a queue in the network node
overflows. The amount of packet loss during the steady state is another important property of a
congestion control scheme. The larger the value of packet loss, the more difficult it is for
transport layer protocols to maintain high bandwidths, the sensitivity to loss of individual
packets, as well as to frequency and patterns of loss among longer packet sequences is strongly
dependent on the application itself.
Throughput
This is the main performance measure characteristic, and most widely used. In communication
networks, such as Ethernet or packet radio, throughput or network. Throughput is the average
rate of successful message delivery over a communication channel. The throughput is usually
measured in bits per second (bit/s or bps), and sometimes in data packets per second or data
packets per time slot This measure how soon the receiver is able to get a certain amount of data
send by the sender. It is determined as the ratio of the total data received to the end to end delay.
Throughput is an important factor which directly impacts the network performance
Delay
Delay is the time elapsed while a packet travels from one point e.g., source premise or network
ingress to destination premise or network degrees. The larger the value of delay, the more
difficult it is for transport layer protocols to maintain highband widths. We will calculate end to
end delay
Queue Length
A queuing system in networks can be described as packets arriving for service, waiting for
service if it is not immediate, and if having waited for service, leaving the system after being
served. Thus queue length is very important characteristic to determine that how well the active
queue management of the congestion control algorithm has been working.
RESULT:
Exp No: 12
Date:
Study of Socket Programming & 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 servers date and time to the client.
4.Read clients 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 servers 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.
PROGRAM:
//TCP Date Server--tcpdateserver.java
import java.io.*;
import java.util.*;
class tcpdateserver
{
public static void main(String arg[])
{
ServerSocket ss = null; Socket cs; PrintStream ps; BufferedReader dis; String inet; try
{
ss = new ServerSocket(4444); System.out.println("Press Ctrl+C to quit"); while(true)
{
cs = ss.accept();
ps = new PrintStream(cs.getOutputStream());
RESULT:
Thus the program for implementing to display date and time from client to server using
TCP Sockets was executed successfully and output verified using various samples.
OUTPUT :
$ javac tcpdateserver.java $ java tcpdateserver
Press Ctrl+C to quit Client System/IP address is : localhost.localdomain/127.0.0.1
Client System/IP address is : localhost.localdomain/127.0.0.1
javac tcpdateclient.java $ java tcpdateclient The date/time on server is: Wed Jul 06
07:12:03 GMT 2011
Every time when a client connects to the server, servers date/time will be
returned to the client for synchronization.