Sie sind auf Seite 1von 56

EX.

NO: 1 STUDY OF NETWORKING DEVICES

Aim: To study the functions of various networking devices used in local area networks.

Theory:

(i) Repeater:

A repeater receives a signal, regenerates it, and passes it on. It can regenerate and retime network signals at the bit level to allow them to travel a longer distance on the media.

The repeater does not have the intelligence to keep the frame from passing to the right side when it is meant for a station on the left.

Types of repeaters:

1. Single port: It operates actually with two segments. 2. Multiport: It has one input port and multiple output port. 3. Smart: It is the hybrid device. It is similar to bridge, in functionality. Packet filtering is done. 4. Optical:

It repeats the optic signals. It is implemented in all types of cables.

ii) Hub:

Hubs are actually multiport repeaters. Using a hub changes the network topology from a linear bus, where each device plugs directly into the wire, to a star. Hubs are also called concentrators.

Three Different types of hubs:

1. Passive: A passive hub serves as a physical connection point only. It does not manipulate or view the traffic that crosses it. It does not boost or clean the signal. A passive hub is used only to share the physical media. As such, the passive hub does not need electrical power. 2. Active: An active hub must be plugged into an electrical outlet because it needs power to amplify the incoming signal before passing it out to the other ports. 3. Intelligent: Intelligent hubs are sometimes called smart hubs. These devices basically function as active hubs, but also include a microprocessor chip and diagnostic capabilities. Intelligent hubs are more expensive than active hubs, but are useful in troubleshooting situations.

iii) Bridges:

It operates in both: physical and data link layer. Bridges are more intelligent than repeaters and hub. It makes forwarding decisions based on Media Access Control (MAC) addresses contained within the headers of transmitted data frames.

A bridge is used to divide, or segment, a network. Bridges collect and selectively pass data frames between two network segments. In order to do this, bridges learn the MAC address of devices on each connected segment. With this information, the bridge builds a bridging table and forwards or blocks traffic based on that table. This results in smaller collision domains and greater network efficiency. If the destination device is on the same segment as the frame, the bridge blocks the frame from going on to other segments. This process is known as filtering. If the destination address is unknown to the bridge, the bridge forwards the frame to all segments except the one on which it was received. This process is known as flooding.

Types of bridges:

1. Simple: Most primitive and least expensive. Links 2 segments. The addresses of each station should be entered or deleted manually. 2. Multiport: Link more than 2 LANs. 3. Transparent: Build its table of station addresses on its own. When the bridge is first installed, its table is empty. As it encounters each packet, it saves the source and destination addresses in its table.

iv) Switches: It may act as a multiport bridge. Layer 2, Layer 3 and Layer 4 uses Switch.

The switch normally has a buffer for each link.

Layer 2 Switches: It operates using physical network addresses, identify individual devices. They act very fast. Layer 3 Switches: It uses network or IP addresses to identify the location on the network, as well as the physical device. Smarter than Layer 2 device, but not faster. It incorporates routing functions to calculate the best way to send a packet to its destination. Layer 4 Switches: It identifies the application protocols (HTTP, FTP) in each packet. It makes packet forwarding decision based on the MAC address, IP address and the application of the packet.

Switches are made based on two different strategies:

1. Store and Forward: Stores the frame in the input buffer until the whole packet has arrived. 2. Cut through: Forwards the packet to the output buffer, as soon as the destination address is received.

v) Routers:

A router is a three layer device (physical layer, data link layer, network layer).

It routes the packets based on their logical addresses. It connects two or more networks. It may be similar or dissimilar networks. It consists of combination of the hardware and software. A router normally connects LANs and WANs in the Internet. It has a routing table to make decisions about the route. It determines the shortest path to the destination by using the routing algorithms to find the best path.

vi) Gateway:

It is generally software installed within a router. It connects two independent networks. It is a protocol converter. A gateway can accept a packet formatted for one protocol (e.g. TCP/IP) and convert it to a packet formatted for another protocol (e.g. Apple Talk) before forwarding it. It operates on all the 7 layers of the OSI model. It must adjust data rate, size and data format.

Result:

Thus the Networking devices with its types were studied.

EX.NO:2 CABLES AND THEIR PIN FUNCTIONS

Aim: To study about the cables used and their pin functions.

Theory:

There are different types of configuration: 1. Straight Through 2. Cross Over 3. Roll Over

1. Straight through Cable: A cable that maintains the pin connection all the way through the communication path is straight through cable. The wire connected to pin 1 is the transmit connection on either end of the communication cable.

Use straight-through cables for the following cabling: ? Switch to router ? Switch to PC or server ? Hub to PC or server 2. Cross Over Cable: In cross over cable, some of the wires on one side of the cable are crossed to different pin on the other side of the cable. Pin 1 on one end is connected to the pin 3 on the other end. Pin 2 on one end is connected to pin 6 on other end.

Use crossover cables for the following cabling: ? Switch to switch ? Switch to hub ? Hub to hub ? Router to router ? PC to PC

? Router to PC 3. Roll Over Cable:

? The cable used between a terminal and a console port is a rollover cable ? The rollover cable, also known as a console cable, has a different pin out than the straight-through or crossover RJ-45 cables. ? This cable is typically flat to distinguish it from the others. ? As the name specifies the pinouts on one end are literally rolled over on the other end.

Result:

Thus the networking cables and their pins were studied.

EX.NO:3 SERIAL /PARALLEL COMMUNICATION USING PC TO PC

Aim: To transfer the file between the two computers serially using Serial/Parallel adapter connection.

Theory:

In serial communication, one bit follows another and so we need only one communication channel rather than transmit data having two communication channels. The main advantage of serial communication is that it reduces the cost of transmission over parallel communication by a factor h.

Requirements:

Serial/Parallel communication kit Serial cable - 2 Computers with ViRtSim software 2 Patch cords 2 LAN cable - 1

Connections: Procedure:

1. Select Start ?All programs ?Vi-Rt simulator

i) Transmitter: 2. Open Serial and Parallel comm ? RS232 File transfer and select Transmitter 3. In the Settings tab, click connect. 4. Once connected, go to Communication tab, select a file to be transmitted and click send file.

ii) Receiver: 5. Choose start ?all programs ?ViRtSim 6. Choose Serial and Parallel comm ? RS232File Transfer and select Receiver. In the Settings tab, click connect. 7. In the communication tab you can the see the file receiving message. Save the file once received from its transmitter

Output:

Transmitter Windows:

1. Connect Transmitter: 2. Select file to be sent: Receiver Window:

1. Connect receiver: 2. Save received File: 3. Check saved file in specified destination:

Result:

Thus the file was transmitted from one PC to another PC using Serial/Parallel communication.

EX.NO:4 EHTHERNET LAN PROTOCOL (CSMA/CD)

Aim: To study about CSMA/CD (IEEE 802.3), which is the Ethernet LAN protocol.

Theory:

Whenever multiple users have unregulated access to a single line, there is a danger of signals overlapping and destroying each other. Such overlaps turn the signals into unusable noise, called collisions.

As traffic increases on the multiple access links, the collision also increases. A LAN therefore needs a mechanism to co-ordinate traffic, minimize the number of collisions that occur, and maximize the number of frames that are delivered successfully.

The access method used in the Ethernet is called Carrier Sense Multiple Access with Collision Detection (CSMA/CD).

CSMA/CD is the result of an evolution from Multiple Access (MA) to Carrier Sense Multiple Access (CSMA), and finally Carrier Sense Multiple Access with Collision Detection (CSMA/CD).

If the station can determine whether a collision is taking place, then the amount of wasted bandwidth can be reduced by aborting the transmission when a collision is detected. The CSMA/CD uses this approach.

CSMA/CD is the most commonly used protocol for LANs. It was developed by Digital Equipment Corporation (DEC), Intel and Xerox. This network is called Ethernet. The IEEE 802.3 CSMA/CD standard for LAN is based on Ethernet specification.

A station with a message to send must monitor the channel to see if any other station is sending. If another station is sending, the second station must wait until the sending station has finished. Then it may send its message. If no station was sending at the time that it first listened, the station may send its message immediately. The term carrier sense indicates this listening before transmitting behavior.

All stations are attached to one path and monitor the signal on the channel through transceiver attached to the cable. CSMA/CD has totally decentralized control and is based on contention access.

CSMA/CD supports both baseband and broadband system. CSMA/CD offers four options in terms of bit rate, signaling method and maximum electrical cable segment length. These are: 10 BASE 5 10 BASE 2 1 BASE 5 10 BROAD 36 ? The number at the beginning indicates the bit rate in Mbps. ? The middle term indicates the type of signaling. ? The number at the end indicates the cable length in multiples of 100 meters.

Base band (Digital signal): Manchester encoding. Broad band (Analog signal): Differential Phase Shift Keying encoding.

The format of MAC frames in CSMA/CD:

Preamble: 56 bits of altering 1s and 0s. SFD: Start Frame Delimiter. This signals the beginning of the frame. Destination address: Contains the physical address of the packets destination address. Source address: Contains the physical address of the packets senders address. Length PDU: Indicates the number of bytes in the coming Protocol Data Unit (PDU).

The data unit in the upper layer of Data Link Layer (Logical Link Control) is the PDU. Data and Padding: It contains the information and padding is done if necessary. CRC: Cyclic Redundancy Check. It contains the error detection information. DSAP: Destination Service Access Point. SSAP: Source Service Access Point. Control:It is used for flow management. The frames are of 3 types as in HDLC: If the first bit in the control field is 0, it is I-frame. If the two bits in the control field are 10, it is S-frame. If the two bits in the control field are 11, it is U-frame.

The PDU from the LLC has no CRC, and no station address. These fields are added in the MAC layer (lower layer in the Data Link Layer).

Result:

Thus the Ethernet LAN protocol with its frame format was studied.

EX.NO:5 SIMULATION OF CSMA/CD

Aim: To simulate the CSMA/CD protocol using ViRtSim software.

Procedure:

1. Select program ?ViRtSim? Simulation ?CSMA ?CSMA/CD 2. Enter the program in the Algorithm column (right side), save and run it.

Algorithm:

Step 1: Declare two frame variables and assign them the data frames to be transmitted. Step 2: Initialize the CSMA/CD function. Step 3: Send data from node B to node A and sense multiple access. Step 4: Send data from node A to node C and sense multiple access. Step 5: Check if collision occurs. Step 6: If collision occurs wait for 1000ms and then retransmit the two data from the nodes one after the other. Step 7: Stop the execution.

Program:

include void main() { Frame X,Y; X="A.R.Engg"; Y="III-ECE";

CSMACD_INIT(); CSMACD_START(); CSMA_SEND(B,A,X);

CSMA_SEND(A,C,Y);

R=COLLISION_OCCUR(); if(R) { WAIT(1000);

RETRANSMIT(B,A); RETRANSMIT(A,C);

} }

Output:

1. Two Stations Transmit data X and Y simultaneously: 2. Occurrence of Collision: 3. Retransmit the data X from Station B to Station A: 4. Retransmit the data Y from Station A to Station C:

Result:

Thus the CSMA/CD protocol was simulated using ViRtSim software was studied. EX.NO:6 TOKEN RING AND TOKEN BUS PROTOCOLS

Aim: To study the Token Bus (IEEE 802.4) and Token Ring (IEEE 802.5) Protocols

Theory:

Token passing:

Whenever the network is unoccupied, a three byte token is circulated. This token is passed from NIC to NIC in sequence until it encounters a station with data to send. That station waits for the token to enter its network board. If the token is free, the station may send a data frame. It keeps the token and sets a bit inside its NIC as a remainder that it has done so, and then sends its one data frame.

1. Token Bus (802.4):

Token bus is a physical bus that operates as a logical ring using tokens. Token bus combines the features of Ethernet and the token ring. It combines the physical configuration of Ethernet and the collision free feature of token ring. Stations are logically organized into a ring.

A token is passed among stations. If a station wants to send the data, it must wait and capture the token. Only the token holder is permitted to transmit the frames. Only one station holds the token at a time, thus collision will not occur.

Figure: Token Passing in the Token Bus

Figure: Transmitting Data

Token bus uses the following medium:

a) Broad band: It supports data channel at 1,5,10 Mbps with Bandwidths of 1,5,6 and 12 MHz respectively.

b) Carrier band: It is also known as Single-channel broadband, because the carrier band is dedicated to a single data channel.

c) Optical band: It supports data rates of 5, 10 and 20 Mbps. Active or Passive Star topology is used.

Frame format: The total length of the frame is 8191 bytes.

Preamble: for bit synchronization SD: frame Start Delimiter FC: Frame Control it distinguish data frame from control frame DA: Destination Address SA: Source Address

Data: data field FCS: Frame Check Sequence contains CRC. Used to detect transmission errors on DA, SA, FC and data fields ED: End Delimiter marks the end of the frame

2. Token Ring (802.5):

In a token ring a special bit pattern called token circulates around the ring whenever all stations are idle. When a station transmits, it breaks the ring and inserts its own frame with source and destination address.

Whenever the network is free it transmits a 3 byte token which is a simple placeholder frame that passes from NIC to NIC in sequence until it encounters a station with data to send. The station holds the token and sends the data which is checked by each station on the ring. Each station checks the destination address, regenerates the frame if a match is not found. The intended receiver receives the data and sends an acknowledgement frame to the sender. The sender releases the token to the ring after receiving the acknowledgement frame.

There is only one token, only one station can transmit at a given time, thus solves the channel access problem.Each station is connected to the ring through a Ring Interface Unit (RIU).

Figure: Passing Token in the Token Ring

Figure: Transmitting Data

Token ring uses the following cables:

1. Shielded Twisted Pair (STP): Data rate 4 or 16 Mbps. Uses Differential Manchester encoding. Maximum number of repeaters: 250.

2. Unshielded Twisted Pair (UTP): Data rate 4 Mbps. Uses Differential Manchester encoding. Maximum number of repeaters: 250.

Frame format:

Data/Command frame:

Figure: Data/Command

SD: frame Start Delimiter AC: Access Control it has 4 fields

Figure: AcessControl

? Priority ? Token indicate that the frame is data/command ? Monitor ? Reservation set by stations wishing to reserve access to the ring

FC: Frame Control it distinguish data frame from control frame

DA: Destination Address SA: Source Address Data: data field ED: End Delimiter marks the end of the frame FS:Frame Status

Figure: Frame Status

Token Frame:

Figure: Token

SD: indicates the frame is coming AC: indicates that the frame is a token

ED: indicates the end of the frame

Abort frame:

Figure: Abort

It just carries the starting and ending delimiters. It can be generated either by the sender to stop its own transmission or by the monitor to purge (clean or eliminate) an old transmission from the line.

Result:

Thus the Token bus and Token ring protocols were studied.

EX.NO:7 SIMULATION OF TOKEN RING

Aim: To simulate the token ring protocol using ViRtSim software.

Procedure:

1. Select program?ViRtSim?Simulation ?Token Ring 2. Enter the program in the Algorithm column (right side), save and run it

Algorithm:

Step 1: Declare a frame variable and assign it the data frame to be transmitted. Step 2: Declare a token variable. Step 3: Initialize the ring topology based network. Step 4: Call the construct logical ring function to create a network with four devices. Step 5: Start to pass the token in the ring. Step 6: If node B wants to transmit data the token is captured by B. Step 7: Once token is captured, node A transmits data. The intended receiver receives data and sends an acknowledge. Once acknowledge reaches node B, it releases the token on to the ring. Step 8: Stop passing token.

Program:

include void main() { Frame X; Token t; X = data1;

RING_TOPOLOGY(); CONSTRUCT_LOGICAL RING(); START TOKEN_PASSING(t); WANT TO_TRANSMIT(B); repeat r = TOKEN_CAPTURE(B); until(r); TRANSMIT_DATA(B,C,X); STOP TOKEN_PASSING(); }

Output:

1. Enter the Program in the Algorithm column, Save, Run:

2. Station B receives Token and sends data to C:

3. Station C receives Data and Sends Acknowledge: Result:

Thus the token ring protocol was simulated using ViRtSim software.

EX.NO:8 SIMULATION OF TOKEN BUS

Aim: To simulate the token bus protocol using ViRtSim software

Procedure:

1. Select program ?ViRtSim?Simulation ?Token Bus 2. Enter the program in the Algorithm column (right side), save and run it

Algorithm:

Step 1: Declare a frame variable and assign it the data frame to be transmitted. Step 2: Declare a token variable. Step 3: Initialize the bus topology based network. Step 4: Call the construct logical ring function to create a network with four devices. Step 5: Start to pass the token. Step 6: If node B wants to transmit data the token is captured by B. Step 7: Once token is captured node B transmits data. The intended receiver receives data and sends an acknowledge. Once acknowledge reaches node B, it releases the token. Step 8: Stop passing token.

Program:

include void main() { Frame X; Token t; X = III-ECE; BUS_TOPOLOGY(); CONSTRUCT_LOGICALRING(); START TOKEN_PASSING(t); WANT TO_TRANSMIT(B); repeat r = TOKEN_CAPTURE(B); until(r); TRANSMIT_DATA(B,C,X); STOP TOKEN_PASSING(); }

Output:

1. Enter the Program in the Algorithm column, Save, Run: 2. Station B gets Token and sends data to C: 3. Station C receives Data and Sends Acknowledge:

Result:

Thus the token bus protocol was simulated using ViRtSim software.

EX.NO:9 TOKEN BUS USING LAN TRAINER KIT

Aim: To simulate the token bus protocol using LAN trainer kit

Requirements:

System installed with ViRtSim software and Xilinx for IMPACT application. ViLAN 03 Trainer kit Power cable 1 Parallel cable 1 Serial cable 1 LAN cable 1 (long), 4 (short)

Connections: Note:

1. In the system, change the IP address third part as 1. (Eg: 192.168.1.10). This should be done because the Trainer kits address is 1. 2. The connection is made with the NIC 1 so that, the parallel cable and serial cable should be connected to the ports available for NIC 1 in the kit, which is just behind it. If you are using NIC 2 or 3 connect the cables to that corresponding NIC ports. Dont give connections in the kit with one NIC and cables between the system and kit with another NIC. Procedure:

1. Give the connections between System and Trainer kit as mentioned above. 2. First set the kit to Programming mode

i) Downloading FPGA:

1. Open Impact from Start menu directly or Start ? Xilinx ISE.92 ? accessories ? Impact. 2. Main window and Sub window will appear. Click Cancel on the sub window. 3. In the left side of the Main window, double click on the Boundary Scan. The right side of the window will become as white background with the line Right click to Add Device or Initialize JTAG chain. 4. Right click on that line and select Initialize Chain. Progress Dialog window will appear to execute the command. 5. After executing, the main window will get a Chip diagram (green color) and one Sub window Assign new configuration file will be displayed. 6. In that select E (drive) ? (ViLAN) ? Hexbit(3s400) ? Token Bus-170 ? FPGA ? tokenbus.bit and click Open. So that the Main windows chip diagram color changes to grey. 7. Right click on the chip and select Program. Programming Properties window will get opened. Click Apply and OK.

8. Then again Progress Dialog window will execute the command and display as Program Succeeded. 9. In the kit you get display as:

ii) Downloading ARM:

1. Open ViRtSim software either from desktop or from Start menu or from C ? Program Files ? Network Simulator ? ViRtSim. 2. Select Utilities ? ARM Downloader . 3. LPC 2000 Flash Utilities window will appear. Click Read Device ID. Then a window will appear with the message Please reset your LPC 2000 board now and then press OK. 4. So press A RST button in the Trainer kit of the corresponding NIC once and click OK in the system. In the left bottom corner you will get the display as Read part ID successfully. 5. Then select the required file by clicking browse button in the File name:. That is E ? (ViLAN) ? Hexbit(3s400) ? Token Bus-170 ? ARM ? LAN-token_bus170.hex and click Open. 6. After selecting the particular file press Upload to Flash. The Progress bar gets Blue color as the data is being sent to RAM. If sent, File upload successfully completed message will be displayed in the left bottom corner of that window. 7. Now minimize this window. In the Trainer kit change the mode to Execution of the corresponding NIC and press A RST once.

iii) Simulating Token Bus:

1. Open OSI Lan Trainer ? Token Bus. 2. Token Bus window will appear.

3. Set the remote IPs third part as 1. (Eg: 192.168.1.170 ? 192.168 used in the system, 1 Trainer kits address, 170 Token Bus number). 4. Click Ping, thus the Connection Status will be displayed as Connected. 5. Then click Connect so that the bulb picture in that window will glow (Yellow color). 6. Press Capture 1 or Capture 2 or Capture 3, which is considered as the Source. Here we press Capture 3 i.e, Client 3 display in the Trainer kit act as a Source. 7. A window will appear which needs the destination number. NIC 1 has 3 clients, in that we have chosen Client 3 as the source. So the destination number should be either 1 or 2. Here we entered as 2. So Client 2 in the Trainer kit acts as a Destination. Press OK. 8. Another window will be displayed. Enter the data to be sent in that box. Press OK. Thus the data gets transmitted from the Source (Client 3 in the kit of NIC1) to the Destination (Client 2 in the kit of NIC1). Display in the kit is as follows: 9. Acknowledgment is received in the system.

Output:

1. OSI Lan Trainer ? Token Bus. Click Ping and Connect. Press Capture 3 (Source) 2. Enter the destination number (Client 2) in the kit 3. Enter the data to be transmitted 4. Data is being transmitted. 5. Data is sent and the Acknowledgment is received

Result:

Thus the token bus protocol was executed using the LAN trainer kit and the ViRtSim software.

EX.NO:10 TOKEN RING USING LAN TRAINER KIT

Aim: To simulate the token ring protocol using LAN trainer kit

Requirements:

System installed with ViRtSim software and Xilinx for IMPACT application. ViLAN 03 Trainer kit Power cable 1 Parallel cable 1 Serial cable 1 LAN cable 1 (long), 4 (short) Patch cords 4 (to connect in the Ring topologys Tx and Rx)

Connection:

Note:

1. In the system, change the IP address third part as 1. (Eg: 192.168.1.10). This should be done because the Trainer kits address is 1. 2. The connection is made with the NIC 1 so that, the parallel cable and serial cable should be connected to the ports available for NIC 1 in the kit, which is just behind it. If you are using NIC 2 or 3 connect the cables to that

corresponding NIC ports. Dont give connections in the kit with one NIC and cables between the system and kit with another NIC. Procedure:

1. Give the connections between System and Trainer kit as mentioned above. 2. First set the kit to Programming mode

i) Downloading FPGA:

1. Open Impact from Start menu directly or Start ? Xilinx ISE.92 ? accessories ? Impact. 2. Main window and Sub window will appear. Click Cancel on the sub window. 3. In the left side of the Main window, double click on the Boundary Scan. The right side of the window will become as white background with the line Right click to Add Device or Initialize JTAG chain. 4. Right click on that line and select Initialize Chain. Progress Dialog window will appear to execute the command. 5. After executing, the main window will get a Chip diagram (green color) and one Sub window Assign new configuration file will be displayed. 6. In that select E (drive) ? (ViLAN) ? Hexbit(3s400) ? Token Ring-160 ? FPGA ? tokenring.bit and click Open. So that the Main windows chip diagram color changes to grey. 7. Right click on the chip and select Program. Programming Properties window will get opened. Click Apply and OK. 8. Then again Progress Dialog window will execute the command and display as Program Succeeded. 9. In the kit you get display as:

ii) Downloading ARM:

1. Open ViRtSim software either from desktop or from Start menu or from C ? Program Files ? Network Simulator ? ViRtSim. 2. Select Utilities ? ARM Downloader . 3. LPC 2000 Flash Utilities window will appear. Click Read Device ID. Then a window will appear with the message Please reset your LPC 2000 board now, and then press OK. 4. So press A RST button in the Trainer kit of the corresponding NIC once and click OK in the system. In the left bottom corner you will get the display as Read part ID successfully. 5. Then select the required file by clicking browse button in the File name:. That is E ? (ViLAN) ? Hexbit(3s400) ? Token Ring-160 ? ARM ? LAN-token_ring160.hex and click Open. 6. After selecting the particular file press Upload to Flash. The Progress bar gets Blue color as the data is being sent to RAM. If sent, File upload successfully completed message will be displayed in the left bottom corner of that window. 7. Now minimize this window.

In the Trainer kit change the mode to Execution of the corresponding NIC and press A RST once.

iii) Simulating Token Ring:

1. Open OSI Lan Trainer ? Token Ring. 2. Token Bus window will appear. 3. Set the remote IPs third part as 1. (Eg: 192.168.1.160 ? 192.168 used in the system, 1 Trainer kits address, 160 Token Rings number). 4. Click Ping, thus the Connection Status will be displayed as Connected.

5. Then click Connect so that the bulb picture in that window will glow (Yellow color). 6. Press Capture 1 or Capture 2 or Capture 3, which is considered as the Source. Here we press Capture 2 i.e, Client 2 display in the Trainer kit act as a Source. 7. A window will appear which needs the destination number. NIC 1 has 3 clients, in that we have chosen Client 2 as the source. So the destination number should be either 1 or 3. Here we entered as 1. So Client 1 in the Trainer kit acts as a Destination. Press OK. 8. Another window will be displayed. Enter the data to be sent in that box. Press OK. Thus the data gets transmitted from the Source (Client 2 in the kit of NIC1) to the Destination (Client 1 in the kit of NIC1). Display in the kit is as follows: 9. Acknowledgment is received in the system. Output:

1. OSI Lan Trainer ? Token Ring. Click Ping and Connect. Press Capture 2 (Source) 2. Enter the destination number 3. Enter the data to be transmitted 4. Acknowledgment is received

Result:

Thus the token bus protocol was executed using the LAN trainer kit and the ViRtSim software.

EX.NO:11 WIRELESS LAN PROTOCOLS (CSMA/CA)

Aim: To study about the wireless LAN protocol (CSMA/CA).

Theory:

Wireless networks cannot use CSMA/CD in the MAC sub-layer, since this requires the ability to receive and transmit at the same time hence the use of CSMA/CA. In a wireless network, much of the sent energy is lost in transmission. The received signal has a very little energy. Therefore, a collision may add only 5 to 10% additional energy. This is not useful for effective collision detection. We need to avoid collision on wireless networks because they cannot be detected. So CSMA/CA was invented for this network.

Collisions are avoided using 3 methods: 1. Inter-frame space: o When an idle channel is found, the station does not send immediately. It waits for a period of time called Inter-frame space. o In CSMA/CA, the IFS can also be used to define the priority of a station of a frame. A station that has shorter IFS has a higher priority. 2. Contention window: o Amount of time divided into slots. A station that is ready to send chooses a random number of slots as its wait time. o Station set one time slot for the first time and then double each time the station cannot detect an idle channel after the IFS time. o This method gives the priority to the station with the longest waiting time. 3. Acknowledgments: o The data may be corrupted during the transmission. The positive acknowledgment and the time out can help guarantee that the receiver has received the frame.

Exposed node problem:

o If C is transmitting a message to D and B wants to transmit to A, B will find the network to be busy as B hears C transmitting.

o Even if B would have transmitted to A, it would not have been a problem at A or D.

o CSMA/CA would not allow it to transmit message to A, while the two transmissions could have gone in parallel. Hidden node problem: o In case of wireless network it is possible that A is sending a message to B, but C is out of its range and hence while listening on the network it will find the network to be free and might try to send packets to B at the same time as A. So there will be collision at B.

o The problem can be looked upon as if A and C are hidden from each other. Hence it is called the hidden node problem.

Result:

Thus the wireless LAN protocol (CSMA/CA) was studied. EX.NO:12 SIMULATION OF CSMA/CA

Aim: To simulate the CSMA/CA protocol using ViRtSim software.

Procedure:

1. Select program ?ViRtSim?Simulation ?CSMA ?CSMA/CA

2. Enter the program in the Algorithm column, save and run it.

Algorithm:

Step 1: Declare a frame variable and assign them the data frame to be transmitted. Step 2: Initialize the CSMA/CA function Step3: Nodes keep listening to the channel Step 4: Send request to send frame from node A to node B Step 5: Send clear to send frame from node B to node A Step 6: Send data from node A to node B and sense multiple access. Step 7: Send acknowledge frame from node B to node A Step 8: Stop the execution.

Program:

include void main() { Frame X; X="A.R.Engg";

CSMACA_INIT();

CSMACA_START();

NODE_LISTEN();

REQUESTTO_SEND(A,B);

CLEARTO_SEND(B,A);

DATATO_SEND(A,B,X);

ACKNOWLEDGE(B,A);

Output:

1. Node A sends RTS frame to node B: 2. Node B sends CTS frame to node A: 3. Node A sends data frame to node B: 4. Node B sends ACK frame to node A:

Result:

Thus the wireless LAN (CSMA/CA) protocol was simulated using ViRtSim software.

EX.NO:13 IMPLEMENTATION AND STUDY OF STOP AND WAIT PROTOCOL

Aim: To implement and test the stop and wait protocol using LAN trainer kit and ViRtSim.

Theory:

Stop and wait protocol is an efficient way of dealing errors during transmission. The stop and wait protocol stops the transmission of packets when the loss of data or any other error causes a negative acknowledgement to reach the transmitting computer (ie) the transmitting computer waits for a kind of acknowledgement from the receiving computer. If the receiving computer acknowledges the sent data, the transmitting computer sends the next data. If the receiver sends a negative acknowledgement then the transmitter retransmits the data. This way the transmission is reliable.

Requirements: System installed with ViRtSim software and Xilinx for IMPACT application. ViLAN03 Trainer kit Power cable 1 Parallel cable 1 Serial cable 1 LAN cable 1 (long), 4 (short)

Connections:

Note:

1. In the system, change the IP address third part as 1. (Eg: 192.168.1.10). This should be done because the Trainer kits address is 1. 2. The connection is made with the NIC 1 so that, the parallel cable and serial cable should be connected to the ports available for NIC 1 in the kit, which is just behind it. If you are using NIC 2 or 3 connect the cables to that corresponding NIC ports. Dont give connections in the kit with one NIC and cables between the system and kit with another NIC.

Procedure:

1. Give the connections between System and Trainer kit as mentioned above. 2. First set the kit to Programming mode

i) Downloading FPGA:

1. Open Impact from Start menu directly or Start ? Xilinx ISE.92 ? accessories ? Impact. 2. Main window and Sub window will appear. Click Cancel on the sub window. 3. In the left side of the Main window, double click on the Boundary Scan. The right side of the window will become as white background with the line Right click to Add Device or Initialize JTAG chain. 4. Right click on that line and select Initialize Chain. Progress Dialog window will appear to execute the command. 5. After executing, the main window will get a Chip diagram (green color) and one Sub window Assign new configuration file will be displayed.

6. In that select E (drive) ? (ViLAN) ? Hexbit(3s400) ? Stop-and-Wait-120 ? FPGA ? stopandwait.bit and click Open. So that the Main windows chip diagram color changes to grey. 7. Right click on the chip and select Program. Programming Properties window will get opened. Click Apply and OK. 8. Then again Progress Dialog window will execute the command and display as Program Succeeded. 9. In the kit you get display as:

ii) Downloading ARM:

1. Open ViRtSim software either from desktop or from Start menu or from C ? Program Files ? Network Simulator ? ViRtSim. 2. Select Utilities ? ARM Downloader . 3. LPC 2000 Flash Utilities window will appear. Click Read Device ID. Then a window will appear with the message Please reset your LPC 2000 board now and then press OK. 4. So press A RST button in the Trainer kit of the corresponding NIC once and click OK in the system. In the left bottom corner you will get the display as Read part ID successfully. 5. Then select the required file by clicking browse button in the File name:. That is E ? (ViLAN) ? Hexbit(3s400) ? Stop-and-Wait 120 ? ARM ? LANstop_wait-120.hex and click Open. 6. After selecting the particular file press Upload to Flash. The Progress bar gets Blue color as the data is being sent to RAM. If sent, File upload successfully completed message will be displayed in the left bottom corner of that window. 7. Now minimize this window.

In the Trainer kit change the mode to Execution of the corresponding NIC and press A RST once.

iii) Simulating Stop-and-Wait:

1. Open OSI Lan Trainer ? Protocols ? Stop and Wait. 2. Stop and Wait window will appear. 3. Set the remote IPs third part as 1. (Eg: 192.168.1.120 ? 192.168 used in the system, 1 Trainer kits address, 120 Stop and Wait protocols number). Change the Packet size as you wish. 4. Enter the data in the Data to be sent box. 5. Click Ping, thus the Connection Status will be displayed as Connected. 6. Then click Connect so that the bulb picture in that window will glow (Yellow color). 7. Then click Send button in the system. 8. Thus you get the details of Transmit and Receive columns in the system window.

Output:

1. Packet size is set as 3, so the first 3 letters are sent in Packet 1. 2. Receiving ACK for Packet 1 3. Sending Packet 2 data (ECE) 4. Receiving ACK for Packet 2

Result:

Thus stop and wait protocol was implemented and simulated using VI-LAN trainer kit and ViRtSim software.

EX.NO:14 IMPLEMENTATION AND STUDY 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 sent since the lost frame acknowledged are retransmitted. The receiver sends an acknowledgement 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 sender receives a NAQ, it retransmits data. If there is a repetition the receiver discards one of the data.

Requirements:

System installed with ViRtSim software and Xilinx for IMPACT application. ViLAN 03 Trainer kit Power cable 1 Parallel cable 1 Serial cable 1 LAN cable - 1 (long), 4 (short)

Connections:

Note:

1. In the system, change the IP address third part as 1. (Eg: 192.168.1.10). This should be done because the Trainer kits address is 1. 2. The connection is made with the NIC 1 so that, the parallel cable and serial cable should be connected to the ports available for NIC 1 in the kit, which is just behind it. If you are using NIC 2 or 3 connect the cables to that corresponding NIC ports. Dont give connections in the kit with one NIC and cables between the system and kit with another NIC.

Procedure:

1. Give the connections between System and Trainer kit as mentioned above. 2. First set the kit to Programming mode

i) Downloading FPGA:

1. Open Impact from Start menu directly or Start ? Xilinx ISE.92 ? accessories ? Impact. 2. Main window and Sub window will appear. Click Cancel on the sub window. 3. In the left side of the Main window, double click on the Boundary Scan. The right side of the window will become as white background with the line Right click to Add Device or Initialize JTAG chain. 4. Right click on that line and select Initialize Chain. Progress Dialog window will appear to execute the command. 5. After executing, the main window will get a Chip diagram (green color) and one Sub window Assign new configuration file will be displayed. 6. In that select E (drive) ? (ViLAN) ? Hexbit(3s400) ? Go-back-N-130 ? FPGA ? gobackn.bit and click Open. So that the Main windows chip diagram color changes to grey.

7. Right click on the chip and select Program. Programming Properties window will get opened. Click Apply and OK. 8. Then again Progress Dialog window will execute the command and display as Program Succeeded. 9. In the kit you get display as:

ii) Downloading ARM:

1. Open ViRtSim software either from desktop or from Start menu or from C ? Program Files ? Network Simulator ? ViRtSim. 2. Select Utilities ? ARM Downloader . 3. LPC 2000 Flash Utilities window will appear. Click Read Device ID. Then a window will appear with the message Please reset your LPC 2000 board now and then press OK. 4. So press A RST button in the Trainer kit of the corresponding NIC once and click OK in the system. In the left bottom corner you will get the display as Read part ID successfully. 5. Then select the required file by clicking browse button in the File name:. That is E ? (ViLAN) ? Hexbit(3s400) ? Go-back-N-130 ? ARM ? LAN-GBN130.hex and click Open. 6. After selecting the particular file press Upload to Flash. The Progress bar gets Blue color as the data is being sent to RAM. If sent, File upload successfully completed message will be displayed in the left bottom corner of that window. 7. Now minimize this window.

In the Trainer kit change the mode to Execution of the corresponding NIC and press A RST once.

iii) Simulating Go-Back-N:

1. Open OSI Lan Trainer ? Protocols ? Go-back-N. 2. Go-back-n window will appear. 3. Set the remote IPs third part as 1. (Eg: 192.168.1.130 ? 192.168 used in the system, 1 Trainer kits address, 130 Go-back-N protocols number). Change the Packet size as you wish. 4. Enter the data in the Data to be sent box. 5. Click Ping, thus the Connection Status will be displayed as Connected. 6. Then click Connect so that the bulb picture in that window will glow (Yellow color). 7. Press Error button in the window. In the Trainer kit you get the display as: 8. Press Frame button in the kit once of the corresponding client display. Then the display changes as: 9. Again press Frame button once so that Frame Err changes to 01 then press Enter in the kit. Then click Send button in the system. (here you can also press the Frame button twice or as many times you wish to set the Frame Err as 02, 03, ) 10. Network Simulator window will appear with NAK (Negative) Acknowledgment. Press OK, so that the NAK packet will be resend and gets the Status: in the kit as ACK (Positive) acknowledgment. 11. Then the message Retransmission completed successfully will appear. Click OK. 12. Thus you get the details of Transmit and Receive columns in the system window.

OUTPut:

1. The Remote IP is 192.168.1.130 for Go-back-N. select packet size. Enter data 2. Since the packet size is set as 3, the hai message is sent as one packet. 3. NAK is received.

4. Data is retransmitted 5. ACK is received Result:

Thus Go-Back-N protocol was implemented and simulated using VI-LAN trainer kit and ViRtSim software.

EX.NO:15 IMPLEMENTATION AND STUDY OF SELECTIVE REPEAT PROTOCOL

Aim: To implement and test the Selective Repeat protocol using LAN trainer kit and ViRtSim.

Theory:

It retransmits only the damaged frame or the lost frame instead of sending multiple frames. It increases the efficiency of transmission and is more suitable for noisy channel. The circuit complexities at the receiver side increases. The receiver window size is of the same size as that of the sender. Negative acknowledgment (NAK) is used for lost or damages frame.

Requirements:

System installed with ViRtSim software and Xilinx for IMPACT application. ViLAN 03 Trainer kit Power cable 1 Parallel cable 1 Serial cable 1 LAN cable 1 (long), 4 (short)

Connections:

Note:

1. In the system, change the IP address third part as 1. (Eg: 192.168.1.10). This should be done because the Trainer kits address is 1. 2. The connection is made with the NIC 1 so that, the parallel cable and serial cable should be connected to the ports available for NIC 1 in the kit, which is just behind it. If you are using NIC 2 or 3 connect the cables to that corresponding NIC ports. Dont give connections in the kit with one NIC and cables between the system and kit with another NIC.

Procedure:

1. Give the connections between System and Trainer kit as mentioned above. 2. First set the kit to Programming mode

i) Downloading FPGA:

1. Open Impact from Start menu directly or Start ? Xilinx ISE.92 ? accessories ? Impact. 2. Main window and Sub window will appear. Click Cancel on the sub window. 3. In the left side of the Main window, double click on the Boundary Scan. The right side of the window will become as white background with the line Right click to Add Device or Initialize JTAG chain.

4. Right click on that line and select Initialize Chain. Progress Dialog window will appear to execute the command. 5. After executing, the main window will get a Chip diagram (green color) and one Sub window Assign new configuration file will be displayed. 6. In that select E (drive) ? (ViLAN) ? Hexbit(3s400) ? Sel-and-Rep-140 ? FPGA ? sel_rep.bit and click Open. So that the Main windows chip diagram color changes to grey. 7. Right click on the chip and select Program. Programming Properties window will get opened. Click Apply and OK. 8. Then again Progress Dialog window will execute the command and display as Program Succeeded. 9. In the kit you get display as:

ii) Downloading ARM:

1. Open ViRtSim software either from desktop or from Start menu or from C ? Program Files ? Network Simulator ? ViRtSim. 2. Select Utilities ? ARM Downloader . 3. LPC 2000 Flash Utilities window will appear. Click Read Device ID. Then a window will appear with the message Please reset your LPC 2000 board now and then press OK. 4. So press A RST button in the Trainer kit of the corresponding NIC once and click OK in the system. In the left bottom corner you will get the display as Read part ID successfully. 5. Then select the required file by clicking browse button in the File name:. That is E ? (ViLAN) ? Hexbit(3s400) ? Sel-and-Rep-140 ? ARM ? LAN-SELREP140.hex and click Open. 6. After selecting the particular file press Upload to Flash. The Progress bar gets Blue color as the data is being sent to RAM. If sent, File upload successfully completed message will be displayed in the left bottom corner of that window. 7. Now minimize this window.

In the Trainer kit change the mode to Execution of the corresponding NIC and press A RST once.

iii) Simulating Selective-Repeat:

1. Open OSI Lan Trainer ? Protocols ? Selective Repeat. 2. Selective Repeat window will appear. 3. Set the Remote IPs third part as 1. (Eg: 192.168.1.140 ? 192.168 used in the system, 1 Trainer kits address, 140 Selective Repeat protocols number). Change the Packet size as you wish. 4. Enter the data in the Data to be sent box. 5. Click Ping, thus the Connection Status will be displayed as Connected. 6. Then click Connect so that the bulb picture in that window will glow (Yellow color). 7. Press Error button in the window. In the Trainer kit you get the display as:

8. Press Frame button in the kit once of the corresponding client display. Then the display changes as:

9. Again press Frame button once so that Frame Err changes to 01 then press Enter in the kit. Then click Send button in the system. (here you can also press the Frame button twice or as many times you wish to set the Frame Err as 02, 03, )

10. Network Simulator window will appear with NAK (Negative) Acknowledgment. Press OK, so that the NAK packet will be resend and gets the Status: in the kit as ACK (Positive) acknowledgment. 11. Then the message Retransmission completed successfully will appear. Click OK. 12. Thus you get the details of Transmit and Receive columns in the system window.

Output:

1. The packet size is set to 3. So 3 letters can be sent at a time. 2. Thus the first 3 letters ECE is transmitted as Packet 1 3. NAK is received for the packet 1 4. Second 3 letters are sent in packet 2 (LAB) 5. ACK is obtained for Packet 2. 6. It shows that the data in the Packet 1 has negative acknowledgment 7. Thus the Packet 1 is retransmitted again 8. Thus the data is Retransmitted Successfully Result: Thus Selective Repeat protocol was implemented and simulated using VI-LAN trainer kit and ViRtSim software.

EX.NO:16 IMPLEMENTATION OF DISTANCE VECTOR ROUTING ALGORITHM

Aim: To implement and test the distance vector routing using ViRtSim.

Theory:

In distance vector routing each router shares its knowledge about the entire network with information from its neighbors in a step by step procedure. Once this is complete it will have a complete idea about the network. The table consists of network ID, cost and next hop. The cost refers to the number of hop count(least) to reach a particular destination.

Routers using distance-vector algorithms send all or part of their routing table entries to adjacent routers on a periodic basis. This happens even if there are no changes in the network. By receiving a routing update, a router can verify all the known routes and make changes to its routing table. This process is also known as routing by rumor. The understanding that a router has of the network is based upon the perspective of the adjacent router of the network topology

Procedure:

1. Open ViRtSim and select simulation ?Distance Vector Routing 2. Design the required network by including the routers, links and corresponding weights on The links. 3. Select the sender and destination node and click the Find Path. 4. Click the Calculate button which displays all the route details and shows the shortest Route.

Output:

1. Design the Required Network: 2. The Shortest Path: Result:

Thus the distance vector routing algorithm was implemented and simulated using ViRtSimsoftware.

EX.NO:17 IMPLEMENTATION OF LINK STATE ROUTING ALGORITHM

Aim: To implement and test the link state routing using ViRtSim.

Theory: In link state routing every router shows its knowledge about its neighbor to the entire network and ultimately all routers will have a routing table within the link state database. Link-state routing protocols respond quickly to network changes sending trigger updates only when a network change has occurred. Link-state routing protocols send periodic updates, known as link-state refreshes, at longer time intervals, such as every 30 minutes.

When a route or link changes, the device that detected the change creates a link-state advertisement (LSA) concerning that link. The LSA is then transmitted to all neighboring devices. Each routing device takes a copy of the LSA, updates its link-state database, and forwards the LSA to all neighboring devices. This flooding of LSAs is required to ensure that all routing devices create databases that accurately reflect the network topology before updating their routing tables.

Procedure:

1. Open ViRtSim and select simulation ?Link State Routing 2. Design the required network by including the routers and links. 3. Select the sender and destination node and click the Find Path.

4. Click the Calculate button which displays all the route details and shows the shortest route.

Output:

1. Design the Required Network: 2. Available Paths: 3. Shortest Path:

Result: Thus the link state routing algorithm was implemented and simulated using ViRtSim software.

EX.NO:18 IMPLEMENTATION OF DATA ENCRYPTION AND DECRYPTION BETWEEN TWO SYSTEMS

Aim: To send the data from the source to destination securely using encryption and decryption.

Theory:

Network security involves four aspects: privacy, message authentication, message integrity and non-repudiation. Privacy means that the sender and the receiver expect confidentiality. The transmitted message should make sense only to the intended receiver. Authentication means that the receiver is sure of the senders identity and that an imposter has not sent the message. Integrity means that the data must arrive at the receiver exactly as it was sent. Nonrepudiation means that a receiver must be able to prove that a received message came from a specific sender. Privacy is achieved by encrypting the message at the sender and decrypting the received message at the receiver.

The data to be encrypted at the sender site is called plaintext/clear text. The encrypted data is called cipher text.

Requirements: 2 Systems installed with ViRtSim software. Serial-Parallel communication kit Patch cords - 2 Serial cable 2 LAN cable 1

Connection:

Procedure:

1. Transmitter: 1. Choose start ?all programs ?ViRtSim 2. Choose serial and parallel communication ?RS232 data security ?data encryption 3. Connect the transmitter by pressing connectin the Settings tab and enter the data to be sent by pressing the communication tab. 4. If send button is pressed, another window will open to enter the password. Enter the Password, so that the ASCII values and the Cipher text will be created.Press send button again.

2. Receiver: 1. Choose start ?all programs ?ViRtSim 2. Choose serial and parallel communication ?RS232 data security ?data decryption 3. Connect the receiver by pressing connectin the Settings tab and enter the data to be sent by pressing the communication tab. 4. Press the Decrypt button. It asks to enter the password. If correct password is entered, the data sent by the sender can be viewed correctly. If not, the plain text will not be clear. 5. Check the original message.

Output:

Transmitter side:

1. Select Settingstab, click connect button. If connected (see left corner of the PC to PC Communication window), go to step 2.

2. Enter data to be encrypted and click send button. A separate window will open for the password. Enter the password, click OK.

3. The ASCII values and the cipher text will be displayed and press send.

Receiver side:

1. Connect the receiver: 2. Received Data: 3. Decrypt the data: 4. Original data received: 5. Wrong password entered: 6. Wrong clear text decrypted

Result:

Thus the encrypted data was transmitted from the sender side and decrypted at the receiver side.

EX.NO:19 TRANSFER OF FILE FROM PC TO PC USING WINDOWS/UNIX SOCKET PROGRAMMING

Aim: To communicate between two systems using PC to PC menu from ViRtSim software.

Procedure:

Transmitter side: 1. Open ViRtSim ? PC to PC ? File Transfer ? Transmitter 2. Give the receivers IP address and click Connect 3. After it is connected, select a file to transmit and click Send File

Receiver side: 1. Open ViRtSim ? PC to PC ? File Transfer ? Receiver 2. Connection is established with the receiver after the transmitter clicks Connect. 3. When the transmitter sends a file, the receiver gets the file. The received file can be saved in the receiver side.

Output:

Transmitter Side:

1. Select PC to PC ? File transfer ? transmitter 2. Enter the Remote IP address 3. Click Connect. It shows as Im Connected 4. Select the file and send Receiver Side

1. Select PC to PC ? File transfer ? receiver 2. Transmitter is listening to get connected to the client 3. Receiver is connected 4. File is received and it can be saved

Result:

Thus the file is transferred from one PC to another.

Das könnte Ihnen auch gefallen