COMPUTER NETWORK LAB MANUAL - Chendu College of ... · PDF fileThe structure of a network and...

87
1 IMENTAL MANUAL Chendu College of Engineering & Technology (Approved by AICTE, New Delhi and Affiliated to Anna University) Zamin Endathur, Madurantakam, Kancheepuram District – 603311 +91-44-27540091/92 www.ccet.org.in COMPUTER NETWORK LAB MANUAL VI SEMESTER ECE

Transcript of COMPUTER NETWORK LAB MANUAL - Chendu College of ... · PDF fileThe structure of a network and...

1

IMENTAL MANUAL

Chendu College of Engineering & Technology (Approved by AICTE, New Delhi and Affiliated to Anna University)

Zamin Endathur, Madurantakam, Kancheepuram District – 603311

+91-44-27540091/92 www.ccet.org.in

COMPUTER NETWORK LAB MANUAL

VI SEMESTER ECE

2

Table of Contents 1. INTRODUCTION

2. THEORY

3. EXPERIMENT 1

STUDY OF NETWORK TOPOLOGIES

4. EXPERIMENT 2

IMPLEMENTATION AND STUDY OF STOP & WAIT PROTOCOL 5. EXPERIMENT 3

IMPLEMENTATION AND STUDY OF GO BACK N PROTOCOL

6. EXPERIMENT 4

IMPLEMENTATION AND STUDY OF SELECTIVE REPEAT

PROTOCOL

7. EXPERIMENT 5

IMPLEMENTATION AND STUDY OF CSMA-CA PROTOCOL

8. EXPERIMENT 6

IMPLEMENTATION AND STUDY OF CSMA-CD PROTOCOL

9. EXPERIMENT 7

IMPLEMENTATION AND STUDY OF TOKEN BUS PROTOCOL 10. EXPERIMENT 8.

IMPLEMENTATION AND STUDY OF TOKEN RING PROTOCOL

11. EXPERIMENT 9.

STYDY OF DATA ENCRYPTION AND DECRYPTION 12. EXPERIMENT 10.

PLOT THROUGHPUT V/S PACKET SIZE

13. EXPERIMENT 11.

STUDY OF SOCKET PROCESSING

3

-

INTRODUCTION

LTS-01 Local area network / wireless local area network trainer system is designed to help students understand the basic concepts, modes of operation and protocols involved in networking. The trainer has integrated hardware flow control on panel board for better understanding of different types of LAN topologies involved in networking. The trainer system is provided with windows-based userfriendly software with analysis of protocols, different layers, network and measurement of error rate and throughput. Students can easily do connections in different topologies and can learn actual data transfer either through hardware or through simulated network concept. Facility is provided into system software to introduce errors into packets being sent and analyze the effect of error on different protocols and hence find the effect on through put graph as well. Trainer is supported with help into software window for better understanding of system and various types of experimentation using this system.

This system works into server-client base. For any topology user has to select one server and select the network type whether it is LAN or WLAN (Wireless LAN). To understand the topology concept user can connect two or more clients to hardware. Depending on the topology-selected user will have option to select protocols for the selected topology. Upon selection of protocol user can then create network of connected computers. In any network which is created by user server can send or can communicate with any of the clients however clients can communicate only with server, no client to client communication is possible.

In star topology user can connect maximum 6 computers, for working of Stop & Wait, Go Back N & Selective Repeat protocols two computers are sufficient, for working of CSMA-CA & CSMA-CD three computers are required. In bus topology user can connect maximum 5 computers, for understanding working of token bus protocol four computers are required. In ring topology user should connect 4 computers for understanding working of token ring protocol four computers are required.

Transmitter port protocol & network analysis can be done after communication is over between server and clients. Throughput v/s Packet size graph can be plotted for which at least two file transfers should be carried out. This plot can be printed to attach in the lab exercise sheet.

For the LAN network, LAN cards must be installed prior to start work on this trainer. For wire less LAN, USB ports should be available on the computers which are to be used for experimentation. In WLAN wireless access cards gets connected to computer USB ports and access point gets connected to hardware device.

4

TECHNICAL SPECIFICATIONS

HARDWARE: Topology

i) Star ii) Bus iii) Ring

Nodes : 5 Nodes for Bus, 6 nodes for Star & 4 Nodes for Ring topology

Data Rate : 10/100 Mbps Interconnection : RJ45 connection cable to connect hardware to computer

LAN card.

ACCESSORIES :

• LTS-01 Local Area Network Trainer • Wireless LAN cards

• Access Point

• LAN connecting cables • e-Manual Interactive Animated Manual

• Sufficient and necessary accessories including neat operating instruction manual.

SYSTEM REQUIREMENTS: PC: Pentium or higher

One LAN card onboard or on PCI slot with 10/100Mbps speed. 128MB RAM Operating System: Windows 2000 or higher Minimum 4 computers are required.

5

THEORY

Topology: The structure of a network and which is usually described in the form of a diagram which shows the nodes and links between them. The term network topology refers to the shape of how the computers and other network components are connected to each other. • Node: A node is a device that is connected to the network. For our purposes here, a node is the same as a computer. Network topology deals with how the nodes of a network are connected to each other. • Packet: A packet is a message that is sent over the network from one node to another node. The packet includes the address of the node that sent the packet, the address of the node the packet is being sent to, and data.

Network topology:

Network topology is the geometric arrangement of nodes and cable links in a LAN. Two general configurations are used, bus and star. These two topologies define how nodes are connected to one another in a communication network. A node is an active device connected to the network, such as a computer or a printer. A node can also be a piece of networking equipment such as a hub, switch or a router.

A bus topology consists of nodes linked together in a series with each node connected to a long cable or bus. Many nodes can tap into the bus and begin communication with all other nodes on that cable segment. A break anywhere in the cable will usually cause the entire segment to be inoperable until the break is repaired. Examples of bus topology include 10BASE2 and 10BASE5.

LAN topology:

Local area networks are often categorized in terms of the topology which they employ. The following topologies are commonly encountered; star, ring, tree, and bus (the latter is a tree which has only one trunk and no branches).

In star topology, a central switching element is used to connect all of the needs within the network. A node wishing to transmit data to another node must initiate a request to the central switching element which will then provide a dedicated path between them, once the circuit has been established; the two nodes may communicate as if they were connected by a dedicated point-to-point path.

6

Ring topology is characterized by a closed loop to which each node is attached by means of a repeating element. Data circulates around the ring on a series of point-to-point links which exist between the repeaters. A node wishing to transmit must wait for its turn and then send data onto the ring in the form of a packet which must contain both the source and destination addresses as well as the data itself. Upon arrival at the destination node, the data is copied into a local buffer. The packet continues to circulate until it returns to the source node, hence providing a form of acknowledgement.

Bus and tree topologies both employ a multiple-access broadcast medium and hence only one device can transmit at any time. As with ring topology, transmission involves the generation of a packet containing source and destination address field together with data.

Topology, Bus:

Bus refers to a physical and a logical topology. As a logical topology, a bus is distinguished by the fact that packets are broadcast so that every node gets the message at the same time. Ethernet networks are the best examples of a logical bus topology.

7

As a physical topology, a bus describes a network in which each node is connected to a common line: the backbone, or trunk. A bus usually has the file server at one end, with the main trunk line extending from this point. (Although the metaphor of a backbone is useful, it should not be taken literally; just as in the real world, not all network backbones are straight.) The figure “A bus topology”

illustrates this layout.

Nodes are attached to this trunk line, and every node can hear each packet as it goes past. Packets travel in both directions along the backbone and need not go through the individual nodes. Rather, each node checks the packet’s destination address to determine whether the packet is intended for the node. When the signal reaches the end of the trunk line, a terminator absorbs the packet to keep it from traveling back again along the bus line, possibly interfering with other messages already on the line. Each end of a trunk line must be terminated so that signals are removed from the bus when they reach the end. Thin and thick Ethernet are the best examples of a physical bus topology. Twisted-pair Ethernet (10Base-T Ethernet) uses a logical bus topology, but a star for its physical topology. In a bus topology, nodes should be far enough apart that they do not interfere with each other. If the backbone cable is long, it may be necessary to boost the signal strength. The maximum length of the backbone is limited by the size of the time interval that constitutes “simultaneous” packet reception.

Token Bus: Token Bus is a network architecture defined in the IEEE 802.4 specifications. The Token Bus architecture has never been popular for Local-Area Networks (LANs) of the type found in most offices. It is, however, widely used in manufacturing contexts. The Token Bus architecture was inspired, in part, by work relating to the automation of manufacturing tasks. This architecture has, in turn, become the

8

basis for the various types of Manufacturing Automation Protocol (MAP) systems that have been developed to help automate operations in industrial contexts. The 802.4 specifications include physical layer and Media Access Control (MAC) Sub layer details for networks that use a bus topology and use token passing as the media-access method. The figure “Context and properties of Token Bus” summarizes this architecture.

Topology, Ring: A ring topology is a logical and a physical topology. As a logical topology, a ring is distinguished by the fact that packets are transmitted sequentially from node to node, in a predefined order. Nodes are arranged in a closed loop so that the initiating node is the last one to receive a packet. Token Ring networks are the most widely used example of a logical ring topology. As a physical topology, a ring describes a network in which each node is connected to two other nodes. Information traverses a one-way path so that a node receives packets from exactly one node and transmits them to exactly one other node. A packet travels around the ring until it returns to the node that originally sent the packet. In a ring topology, each node can act as a repeater, boosting the signal before sending it on. The figure “A ring topology” illustrates this layout.

9

Each node checks whether the packet’s destination node matches the node’s address. When the packet reaches its destination, the node accepts the message, and then sends it back to the sender to acknowledge receipt. Since ring topologies use token passing to control access to the network, the token is returned to sender with the acknowledgment. The sender then releases the token to the next node on the network. If this node has nothing to say, the node passes the token on to the next node, and so on. When the token reaches a node with a packet to send, that node sends its packet. Physical ring networks are rare because this topology has considerable disadvantages compared to a more practical star wired ring hybrid, which is described in a separate article. The advantages of a ring topology are that the cable requirements are fairly minimal and no wiring center or closet is needed. The disadvantages of this topology include the following:

• If any node goes down, the entire ring goes down.

• Diagnosis/troubleshooting (fault isolation) is difficult because communication is only one-way.

• Adding or removing nodes disrupts the network. Token Ring:

Token Ring is a network architecture that uses a ring network topology and a token passing strategy to control access to the network. This type of architecture works best with networks that handle heavy data traffic from many users, because of inherent fairness rules in token passing as an access method. The figure “Context and properties of Token Ring” summarizes this architecture.

10

With token passing as the media-access method, the node that has the token gets to access the network, provided the token is available (not being used to transport a packet) when the node receives it. Unlike the CSMA/CD media-access method that Ethernet networks use, token passing is deterministic.

This means each node is guaranteed to get a turn sending packets within a predefined time or number of cycles. Token Ring networks have the following features:

Topology, Star: A star topology is a physical topology in which multiple nodes are connected to a central component, generally known as a hub. The figure “A star topology” illustrates this layout. Despite appearances, such a wiring scheme actually implements a logical bus topology. The hub of a star generally is just a wiring center; that is, a common termination point for the nodes, with a single connection continuing from the hub. In rare cases, the hub may actually be a file server, with all its nodes attached directly to the server. As a wiring center, a hub may, in turn, be connected to a file server, a wall plate, or to another hub. All signals, instructions, and data going to and from each node must pass through the hub to which the node is connected.

11

One advantage of a star topology is that troubleshooting and fault isolation are easy. Also, it is easy to add or remove nodes and to modify the cable layout. A disadvantage of this topology is that if the hub fails, the entire network fails. Sometimes a backup central machine is included to make it possible to deal with such a failure. Also, a star topology requires a lot of cable.

The central point of a star topology plays the role of traffic cop in that it directs traffic to its intended destination rather than to everyone on the network. In a LAN implementation, the traffic cop is often the switch. A star topology with a single switch at its central point might look something like the illustration in Figure.

12

General Topology Configurations:

10BASE-T Ethernet and Fast Ethernet use a star topology where access is controlled by a central computer. Generally a computer is located at one end of the segment, and the other end is terminated in central location with a hub or a switch. Because UTP is often run in conjunction with telephone cabling, this central location can be a telephone closet or other area where it is convenient to connect the UTP segment to a backbone. The primary advantage of this type of network is reliability, for if one of these 'point-to-point' segments has a break; it will only affect the two nodes on that link. Other computer users on the network continue to operate as if that segment were non-existent.

A wireless LAN (WLAN or WiFi) is a data transmission system designed to provide location-independent network access between computing devices by

13

using radio waves rather than a cable infrastructure [IEEE 802.11 Wireless LANs, Technical paper].

In the corporate enterprise, wireless LANs are usually implemented as the final link between the existing wired network and a group of client computers, giving these users wireless access to the full resources and services of the corporate network across a building or campus setting.

IEEE 802.11 and the ISO Model

The major motivation and benefit from Wireless LANs is increased mobility. Untethered from conventional network connections, network users can move about almost without restriction and access LANs from nearly anywhere.

The other advantages for WLAN include cost-effective network setup for hard-to- wire locations such as older buildings and solid-wall structures and reduced cost of ownership-particularly in dynamic environments requiring frequent modifications, thanks to minimal wiring and installation costs per device and user. WLANs liberate users from dependence on hard-wired access to the network backbone; giving them anytime, anywhere network access. This freedom to roam offers numerous user benefits for a variety of work environments, such as:

• Immediate bedside access to patient information for doctors and hospital staff.

• Easy, real-time network access for on-site consultants or auditors • Improved database access for roving supervisors such as production line managers, warehouse auditors, or construction engineers • Simplified network configuration with minimal MIS involvement for temporary setups such as trade shows or conference rooms • Faster access to customer information for service vendors and retailers, resulting in better service and improved customer satisfaction • Location-independent access for network administrators, for easier on-site troubleshooting and support • Real-time access to study group meetings and research links for students.

Ethernet LANs consist of network nodes and interconnecting media. The network nodes fall into two major classes:

• Data terminal equipment (DTE)—Devices that are either the source or the destination of data frames. DTEs are typically devices such as PCs, workstations, file servers, or print servers that, as a group, are all often referred to as end stations. • Data communication equipment (DCE)—Intermediate network devices that receive and forward frames across the network. DCEs may be either standalone devices such as repeaters, network switches, and routers, or communications interface units such as interface cards and modems. The current Ethernet media options include two general types of copper cable: unshielded twisted-pair (UTP) and shielded twisted-pair (STP), plus several types of optical fiber cable.

14

Ethernet: Ethernet operates at the first two layers of the OSI model — the Physical and the Data Link layers. However, Ethernet divides the Data Link layer into two separate layers known as the Logical Link Control (LLC) layer and the Medium Access Control (MAC) layer.

Ethernet NICs: Each node must have an Ethernet NIC, which provides the computer with access to the network. An NIC converts, packetizes, and transmits data from the computer and receives, unpacketizes, and converts data received over the network. NICs are architecture-specific. This means that you cannot use an Ethernet NIC for a Token Ring network.

Protocol:

A set of rules and formats necessary for the effective exchange of information within a data communication system. Protocols are generally associated with particular services or tasks, such as data packaging or packet routing. A protocol specifies rules for setting up, carrying out, and terminating a communications connection, and also specifies the format the information packets must have when traveling across this connection. Some protocols require acknowledgment that an action has been successfully carried out, such as when a packet has been received. Under some circumstances, as in the case of a router going over modem-speed lines, such

acknowledgments can slow down a transmission enough to throw off timing

requirements for some protocols. Protocols can be distinguished by several types of properties:

• The level, or layer, at which the protocol operates. • The network architecture for which the protocol is designed. For example, bus- oriented protocols look and behave differently (in their details) than do

protocols associated with ring-based networks.

• Whether the protocol is synchronous or asynchronous. • Whether the protocol is connection oriented or connectionless.

• Whether the protocol is character or bit oriented.

The set of conventions is referred to as a protocol, which may be defined as a set of rules governing the exchange of data between two entities. The key elements of a protocol are Syntax - Includes such things as data format, coding, and signal levels.

Semantics - Includes control information for coordination and error handling. Timing - Includes speed matching and sequencing. A protocol may be either symmetric or asymmetric. Most of the protocols that we shall study are symmetric; that is, they involve communication between peer entities. Asymmetry may be dictated by the logic of an exchange (e.g., a client and a server process), or by the desire to keep one of the entities or systems as simple as possible.

15

Protocols: • Stop and Wait

- A sends data to B - B sends ack - A sends next frame of data - ...

This, with no other provisions, works only if there is no error. A protocol which involves waiting for an acknowledgment(eg, ACK) before sending another message.

When the source (end system A) sends the first packet to the destination (end system B), B sends an acknowledgment packet. Then A sends the second packet, and B sends the acknowledgement. This is a very simple protocol. But the problem is that if the acknowledgement for a packet is lost, what has to be done? A sends the first packet and then starts a timer. The destination, after receiving the packet, sends an acknowledgement. If the acknowledgement is received before the timer expires, the source sends the next packet and resets the timer. If the packet sent by the source is lost, or if the acknowledgement sent by the destination is lost, the timer will expire, and the source resends the packet

• No channel is error free. So data may be corrupted when received and must be recovered. There are two schemes normally used:

- Forward error correction (FEC). This usually means sending much more data than required for information transmission. The additional bits may be used to recover the actual data. Not normally used in data communication. - Automatic Repeat (AQR) protocols. This requires that a means of detecting errors be used and data is retransmitted if there is any error. To enable the receiver to detect error, the sender will send a few additional bits, called Cyclic Redundancy Check (CRC). These bits are generated from the information bits and are used for error detection only.

• Stop and Wait (in presence of error) - A sends data to B - B sends a NAK (if data was in error) - A retransmit the same data - ...

This scheme requires that the frames carry at least 1 bit sequence number. It also requires a timer to recover from error if the ack is not received.

Go Back N protocol: Go-Back-N error recovery is a procedure which is implemented in some communications protocols to provide reliability. Go-Back-N ARQ (is one of a number of error recovery procedures to detect and retransmits I-frames which have been corrupted due to errors in the physical link.

16

Features required for Go-Back -N ARQ: • To support Go-Back -N ARQ , a protocol must number each PDU which is

sent.(PDUS are normally numbered using modulo arithmetic, which allows the same number to re-used after a suitably long period of time . The time period is selected to ensure the same PDU number is never used again for a different PDU, until the first PDU has “left the network” (e.g. it may have been acknowledged).

• The local node must also keep a buffer of all PDUs which have been sent, but have not yet been acknowledged.

• The receiver at the remote node keeps a record of the highest numbered

PDU which has been correctly received. This number corresponds to the last acknowledgment PDU which it may have sent.

Recovery of lost PDUs using Go-Back-N: The recovery of a corrupted PDU proceeds in three stages:

First, the corrupted PDU is discarded at the remote node’s receiver. Second,

the remote node requests retransmission of the missing PDU using a

control PDU (sometimes called a NACK or REJECT). The receiver discards all

PDUs which do not have the number of the requested PDU. The final stage

consists of retransmission of the lost PDUs.

Local Node

Send PDU (N),but PDU-N Remote Node is not received.

PDU (N) is not

It then sends the correctly received.

next PDU (N+1),

because it does

not know PDU (N)

was lost.

The node receives

a control PDU

indicating that the

remote node

wishes to go back

to PDU (N).

PDU (N+1) must

also be sent.

PDU-N+1

Go-Back-N

PDU-N

PDU-N+1

PDU (N+1) is

received , indicating

loss of PDU (N).

A control PDU is

sent to indicate

loss of PDU (N), PDU

(N+1) is discarde

because the node

still needs PDU (N).

PDU (N) is received.

PDU (N+1) is received.

Retransmission using Go-Back-N

17

A remote node may request retransmission of corrupted PDUs by initiating Go- Back-N error recovery by sending a control PDU indicating the last successfully received PDU. This allows the remote node to instruct the sending node where to begin retransmission of PDUs until one is received with the expected sequence number. Upon receipt of a Go-Back-N control PDU (by the local node), the transmitter winds-back the sequence of PDUs pending transmission to the indicated PDU in its buffer of unacknowledged PDUs. The transmitter then retransmits (Goes Backto-N) the requested PDU followed by all successive PDUs. This is sometimes known as “wind back” of the transmitter.

Example of Go-Back-N: The sender in this example transmits four PDUs (1-4) and the first one (1) of these is not successfully received. The receiver notes that it was expecting a PDU numbered 1 and actually receives a PDU numbered 2. It therefore deduces that (1) was lost. It requests retransmission of the missing PDU by sending a Go-Back- N request (in this case N = 1), and discards all received PDUs with a number greater than 1.The sender receives the Go-Back-N request and retransmits the missing PDU (1), followed by all subsequently sent PDUs (2-4) which the receiver the correctly receives and acknowledges.

Suppose the window size is 7

tm 0

1

2 2tp 3

4

5

0

1

Selective Repeat protocol:

After sending 6 packets, the transmitter Finds that pkt. 0 was not received correctly

Instead of sending pkt. 6, it will then Start transmitting starting with pkt 0

time

The other general strategy for handling errors when frames are pipelined, called Selective Repeat, is to have the receiving data link layer store all the correct frames following the bad one. When the sender finally notices that something is wrong, it is just retransmits the one bad frame, not all its successors. This protocol works well if errors are rare, but if the line is poor it wastes a lot of bandwidth on retransmitted frames. An alternative strategy for handling errors is to allow the receiver to accept and buffer the frames following a damaged or lost one. Such a protocol does not discard frames merely because an earlier frame was damaged or lost.

18

In this protocol, both sender and receiver maintain a window of acceptable sequence numbers. The sender’s window size starts out at 0 and grows to some predefined maximum. MAX_SEQ. The receiver’s window, in contrast, is always fixed in size and equal to MAX_SEQ. The receiver has a buffer reserved for each sequence number within its window. Associated with each buffer is a bit (arrived) telling whether the buffer is full or empty. Whenever a frame arrives, its sequence number is checked by the function between to see if it falls within the window. If so, and if it has not already been received, it is accepted and stored.

With selective-reject ARQ, the only frames retransmitted are those that receive a negative acknowledgment, in this case called SREJ, or those that time out. Fig. illustrates this scheme. When frame 5 is received out of order, B sends a SREJ 4, indicating that frame 4 has not been received. However, continues to accept incoming frames and buffers them until a valid frame 4 is received. At that point, B can place the frames in the proper order for delivery to higher-layer software.

Selective reject would appear to be more efficient than go-back-N, because it minimizes the amount of retransmission. On the other hand, the receiver must maintain a buffer large enough to save post-SREJ frames until the frame in error is retransmitted, and must contain logic for reinserting that frame in the proper sequence. The transmitter, too, requires more complex logic to be able to send a frame out of sequence. Because of such complications, select-reject ARQ is much less widely used than go-back-N ARQ. The window size limitation is more restrictive for selective-reject than for go-back-N.

Suppose the window size is 7

tm 0

1

2 2tp 3

4

5

0

6

After sending 6 packets, the transmitter Finds that pkt. 0 was not received correctly

Instead of sending pkt. 6, it will then Transmit pkt. 0 and then continue with 6, 7 etc.

Time

Token Ring & Token Bus protocol:

• Token Bus (802.4) - The topology is bus. all stations are peers - The access protocol is token passing

• The token is passed one station to the next • Whoever is in possession of the token can transmit

19

• After transmission is complete, token is passed to the next station • The token is addressed and is passed to the next addressed station

• Token Ring (IEEE 802.5): - The topology is ring, data flows in one direction - access protocol is token passing

• The token circulates around the ring from one physical node to the next • The token can be marked ‘busy’ or ‘free’ • Any station, finding a free token, can transmit

• Token passing • When a station ‘sees’ a ‘free’ token, it changes it to a ‘busy’ token and appends its data to it. • At the end of transmission, it issues a new token which is ‘free’. This token is then available to the next station

• Token Ring - Since it is possible that a station can hold a token for a long time, some control must be exercised. This is done by the use of a token holding time (THT), specified by the network manager. - No station is allowed to have the token for more than THT. -

• Token Ring (Ring Latency) - The total delay around the ring is called ‘ring latency’ - This is a result of the cable length and delay in the nodes. Every node has at least 1-bit delay - The ring latency must not be less than the token transmission time. In other words, the latency must be large enough to ‘hold’ the token.

Sliding Window protocol:

• Sliding Window protocol can be done in one of two different ways - Go back N; or - Selective repeat

They differ only in the way the errors are handled

Collisions:

Collisions are used by Ethernet to control network access and shared bandwidth among connected stations that are trying to transmit at the same time on a shared medium, such as the network segment.

20

CSMA-CA& CSMA-CDprotocols:

In computer networking, CSMA-CA belongs to a class of protocols called as CSMA-CA. CSMA-CAstands for: Carrier Sense Multiple Access with Collision Avoidance. In CSMA-CA, a station wishing to transmit has to first listen to the channel for a predetermined amount of time so as to check for any activity on the channel. If the channel is sensed "idle" then the station is permitted to transmit. If the channel is sensed as "busy" the station has to defer its transmission. This is the essence of the "collision avoidance" part of the protocol.

CSMA/CA is a modification of pure Carrier Sense Multiple Access (CSMA). Collision avoidance is used to improve the performance of CSMA by attempting to be "less greedy" on the channel. If the channel is sensed busy before transmission then the transmission is deferred for a "random" interval. This reduces the probability of collisions on the channel.

CSMA-CA is used where CSMA-CD cannot be implemented due to the nature of the channel. CSMA-CA is used in 802.11 based wireless LANS. In a wireless

LAN, not all stations can "see" all other stations. Hence, collision detection is no longer an option.

CSMA/CA (Carrier Sense Multiple Access/Collision Avoidance):

CSMA/CA operates at the media-access-control (MAC) sub layer, as defined by the IEEE, of the data link layer in the OSI Reference Model. When a node wants to transmit on the network, the node listens for activity (CS or carrier sense). Activity is indicated by a carrier on signal. If there is activity, the node waits a period of time and then tries again to access the network. The figure “Summary of the CSMA/CA process” illustrates how the method works. The wait, known as the deferral time, depends on the following: n The activity level of the network. The deferral time is longer if there is a lot of network activity; it is shorter when there is little activity.

n A random value added to the base deferral time. This ensures that two nodes who defer at the same time do not try to retransmit at the same time. If the network is currently idle, the node sends a Request To Send (RTS) signal. This signal is sent regardless of whether the node wants to send a directed transmission (one with a particular destination) or a broadcast transmission (one sent to each node on the network). In a directed transmission, the RTS is addressed to a particular node, and the sending node waits for a Clear To Send (CTS) signal in reply from this node. The RTS and he CTS must be sent within a predefined mount of time; otherwise, the sending node assumes there is a collision and defers. Collision avoidance requires less sophisticated circuitry than collision detection, so the chip set is less expensive to manufacture. Collisions cannot always be

21

avoided, however. When they occur, Local Talk lets a higher level protocol handle the problem.

In computer networking, Carrier Sense Multiple Access with Collision Detection (CSMA/CD) is a network control protocol in which a carrier sensing scheme is used and a transmitting data station that detects another signal while transmitting a frame, stops transmitting that frame, transmits a jam signal, and then waits for a random time interval (known as "back off delay" and determined using the

truncated binary exponential back off algorithm) before trying to send that frame again.

CSMA/CD is a modification of pure Carrier Sense Multiple Access (CSMA). Please visit this article for a complete description of the basic protocol.

Collision detection is used to improve CSMA performance by terminating transmission as soon as a collision is detected, and reducing the probability of a second collision on retry.

Methods for collision detection are media dependent, but on an electrical bus such as Ethernet, collisions can be detected by comparing transmitted data with received data. If they differ, another transmitter is overlaying the first transmitter's signal (a collision), and transmission terminates immediately. A jam signal is sent which will cause all transmitters to back off by random intervals, reducing the probability of a collision when the first retry is attempted. CSMA/CD is a layer 2 protocol in the OSI model. Ethernet is the classic CSMA/CD protocol.

22

CSMA/CD (Carrier Sense Multiple Access/Collision Detect)

In the framework of CSMA/CD, the computers on a network operate as follows.

• Carrier sense— each computer on the LAN is always listening for traffic on the wire to determine when gaps between frame transmissions occur.

• Multiple accesses— any computer can begin sending data whenever it detects that the network is quiet. (There is no traffic.)

• Collision detect— If two or more computers in the same CSMA/CD network collision domain begin sending at the same time, the bit streams from each sending computer interfere, or collide, with each other, making each transmission unreadable. If this collision occurs, each sending computer must be able to detect that a collision has occurred before it has finished sending its frame.

Each computer must stop sending its traffic as soon as it has detected the collision and then wait some random length of time, called the back-off algorithm, before attempting to retransmit the frame.

23

The CSMA/CD Process:

In CSMA/CD, a node that wants to transmit on a network first listens for traffic (electrical activity) on the network. Activity is indicated by the presence of a carrier on signal on the line. The figure “Summary of the CSMA/CD process” illustrates how the method works. If the line is busy, the node waits a bit, and then checks the line again. If there is no activity, the node starts transmitting its packet, which travels in both directions on the network cable. The node continues monitoring the network. However, it is possible for two nodes to both detect no activity on the line and start transmitting at the same time. In that case, a collision occurs, and the network has packet fragments floating around. When a collision is detected, a node follows this procedure: 1. cancels its transmission by sending a jam signal (to indicate there is a collision and thereby prevent other nodes from joining the fun) 2. Waits a random amount of time (the deferral time), determined by a back off algorithm 3. Tries to access the network again internally, nodes keep track of the number of unsuccessful transmission attempts for each packet. If this number exceeds some predefined value, the node decides the network is too busy and stops trying. Each node in a network that uses CSMA/ CD listens to every packet transmitted. The listener first checks whether the packet is a fragment from a collision. If so, the node ignores it and listens for the next packet. If a packet is not a fragment, the node checks the destination address. The node will further process the packet if any of the following is the case: * The destination address is the node’s address. * The packet is part of a broadcast (which is sent to every node). * The packet is part of a multicast and the node is one of the recipients. As part of this further processing, the destination node checks whether the packet is valid. (For a summary of invalid Ethernet packets, see the section on the Ethernet frame in the Ethernet article.)

CSMA/CD is a probabilistic, contentious access method, in contrast to the deterministic token-passing and polling methods. It is contentious in that the first node to claim access to an idle network gets it. CSMA/CD is probabilistic in that a node may or may not get access when the node tries. A disadvantage stemming from this probabilistic access is that even critical requests may not get onto the network in a timely manner. CSMA/CD works best when most network activity is light. The access method works most poorly when the network traffic consists of many small messages, because nodes spend much of their time colliding, and then waiting to retransmit. To use this access method, a node must be able to detect network activity (carrier sense, or CS) and to detect collisions (collision detect, or CD). Both of these capabilities are implemented in hardware, on board the network interface card. Because CSMA/CD is a contentious access method, any node can access the network, provided that node puts in the first request when the network line is idle. This makes the method multiple accesses (MA). Unlike CSMA/CA, a CSMA/CD node must be able to detect a collision on the line.

24

Data Throughput Validation: Making Every Bit Count

Telecommunications standards, such as those developed by TIA and ISO, provide valuable guidance for designing and implementing generic cabling systems that support a wide variety of applications. These standards are also the tools used by applications engineers developing data transmission protocols and system designers planning for building cabling needs. In a perfect operating environment, all components of the data transmission infrastructure, from the physical layer, to the network interface card (NIC), to the hubs, switches, and routers, perform at the peak of their operating bands. In reality, however, LAN equipment variability, environmental conditions (i.e. heat, EMI/EMC, etc.), minimally compliant cabling, and external noise/EMI sources can slow data transfer to a crawl.

Basic Transmission Principles:

Regardless of protocol, an application’s transmission rate or throughput is always dependent upon data packets or frames actually reaching their final destination. Faults in the packets, which appear as dropped/corrupted bits or errors in the re- constructed bit sequence, result in data re-transmissions. It is the repeated re- transmission attempts that increase network traffic and seriously decrease network throughput.

If the cabling system and its connecting LAN and computer equipment are operating within specification, then errors are few and far between. For example, an optimum 1000BASE-T network might realize a maximum of 1 bad frame out of

25

every 10 million frames transmitted. However, the performance of LAN equipment typically varies across a wide range of operating tolerances over time. These variances can be caused by a variety of factors including circuit-induced jitter, changes in semiconductor performance resulting from the thermal gradient (i.e. equipment heating and cooling), environmental conditions such as heat and humidity, as well as susceptibility to electromagnetic interference and external noise.

In fact, many IS experts claim that, as a result of the cumulative effect of these variables, the useful life span of a 100BASE-T NIC card is typically less than 5 years. Additionally, expansion (in terms of nodes served) and the introduction of new (bandwidth hungry) applications as the network matures, can exacerbate these conditions and cause an exponential increase in collisions and re- transmissions. The net result is a dramatic reduction in throughput as the LAN equipment degrades and as new nodes and desktop applications compete for finite network capacity.

Fortunately, a well-designed cabling system can assist in maintaining high throughput delivery from marginally performing equipment in operating conditions that are far from optimal. Such systems have built-in transmission performance headroom, extending well beyond standards requirements. They consist of cables and connecting hardware that deliver precisely matched 100 Ohm impedance performance and have been proven to support optimum data rates under adverse conditions using throughput analysis.

Media access control (MAC) in WLAN:

The MAC is responsible for running the signaling protocol, which is also determined by the appropriate standard. The main characteristics of the MAC protocol are packet format (size, headers), channel access mechanisms and network management. The two channel access mechanisms used by the MAC protocol in wireless LAN systems are carrier sense multiple access/collision avoidance (CSMA/CA) and Polling MAC. CSMA/CA is the channel access mechanism used by most wireless LANs in the ISM bands. A channel access mechanism is the part of the protocol that specifies when to listen, when to transmit. The basic principles of CSMA/CA are listening before talk and contention. This is an asynchronous message passing mechanism (connectionless), delivering a best effort service, but no bandwidth and latency guarantee. Its main advantages are that it is suited for network protocols such as TCP/IP, adapts quite well to variable traffic conditions and is quite robust against interference.

CSMA/CA is derived from CSMA/CD (collision detection), which at the heart of Ethernet MAC: the main difference between them is the carrier sense function. On a wire, the transceiver has the ability to listen whilst transmitting and hence can detect collisions. But a wireless system cannot listen on the channel whilst transmitting, since transmit and receive frequencies are the same and because the transmit level is far higher than the receive level. Therefore the wireless MAC protocol tries to avoid, instead of detecting, collisions.

26

The protocol starts by listening on the channel (this is called carrier sense) and, if the channel is found to be idle, sends the first packet in the transmit queue. If it is busy, due to either another node transmission or interference, the node waits until the end of the current transmission and then starts the contention (waits a random amount of time). When its contention timer expires, if the channel is still idle, the node sends the packet. The node having chosen the shortest contention delay wins and transmits its packet. Because the contention is a random number, each node is given an equal chance to access the channel (on average). A form of carrier sense used by some systems is request to send/clear to send (RTS/CTS). The RTS/CTS is a handshaking protocol: before sending a packet, the transmitter sends a RTS and waits for CTS from the receiver. The reception of CTS indicates that the receiver is able to receive the RTS, so the packet may then be transmitted (the channel is clear in its area). Any node within range of the receiver hears the CTS and so knows that a transmission is about to take place. The RTS and CTS messages contain the size of the expected transmission, so any node listening will know how long the transmission will last. This is useful because the data transmission itself may not be heard. The use of RTS/CTS lowers the overhead of a collision on the medium, because RTS collisions are much shorter in time. If two nodes attempt to transmit in the same slot of the contention window, their RTS collide and they have to try again. They loose an RTS instead of a whole packet.

Algorithm: An algorithm is a predefined set of instructions for accomplishing a task. An algorithm is guaranteed to produce a result in a finite amount of time. Algorithms are used in many ways in networking. For example, there are hashing algorithms for finding file names in a directory and timing algorithms for deciding how long to wait before trying to access a network.

Distance Vector:

A class of computation intensive routing algorithms in which each router computes the distance between itself and each possible destination. This is accomplished by computing the distance between a router and all of its immediate router neighbors, and adding each neighboring router’s computations for the distances between that neighbor and all of its immediate neighbors. Several commonly used implementations are available, such as the Bellman-Ford algorithm and the ISO’s Interdomain Routing Protocol (IDRP).

Link State Algorithm: A class of routing algorithms in which each router knows the location of and distance to each of its immediately neighboring routers, and can broadcast this information to all other routers in a link state packet (LSP). If a router updates its LSP, the new version is broadcast and replaces the older versions at each other router. The scheme used to distribute the LSP greatly influences the performance of the routers. These types of algorithm are an alternative to distance-vector algorithms; rather than storing actual paths, link-state algorithms store the information needed to generate such paths. The ISO’s open shortest path first (OSPF) algorithm is an example of a link-state algorithm.

27

OSI Layers: The OSI Reference Model uses seven functional layers to define the communication capabilities needed to enable any two machines to communicate with each other. The seven layers range from the application layer at the top to the physical layer at the bottom. The top layer is where users and application programs communicate with a the network. Examples of application-layer tasks include file transfer, electronic mail (e-mail) services, and network management. Application-layer services are much more varied than the services in lower layers, because the entire gamut of application and task possibilities is available here. The specific details depend on the framework or model being used. For example, there are several network management applications. Each of these provides services and functions specified in a different framework for network management. Programs can get access to the application-layer services through application service elements (ASEs). There are a variety of such ASEs, each designed for a class of tasks. See the ASE article for details. To accomplish its tasks, the application layer passes program requests and data to the presentation layer, which is responsible for encoding the application layer’s data in the appropriate form. Application Layer Protocols: Not surprisingly, application programs are found at this layer. Also found here are network shells, which are the programs that run on workstations and that enable the workstation to join the network. Actually, programs such as network shells often provide functions that span or are found at multiple layers. For example, NETX, the Novell NetWare shell program, spans the top three layers.

The IEEE’s (802.x) networking working groups have refined the data-link layer into two sub layers: the logical-link control (LLC) sub layer at the top and the mediaaccess control (MAC) sub layer at the bottom. The LLC sub layer must provide an interface for the network layer protocols.

28

The MAC sub layer must provide access to a particular physical encoding and transport scheme.

Throughput Analysis:

Basic throughput analysis involves generating a pre-determined data stream of "1’s" and "0’s" in accordance with a specific application’s encoding rules. The data stream and resulting voltage waveform is repetitive and is specifically selected to force the maximum number of encoding transitions (i.e. -1, 0, 1, 0, -1) to simulate transmitter/receiver stress. The data stream can then be sent over any cabling system under test and throughput can be assessed at the receiver end using protocol analysis software.

This software counts the number of packets received, evaluates each packet for content and bit count, and returns a cyclic redundancy check (CRC) error if there is a defect within the packet (reference the glossary for more information on CRC errors). Modifications to the waveform algorithm that simulate the effects of adverse operating conditions such as signal jitter, noise, delay, and amplitude changes can be programmed to evaluate and assess cabling system robustness. Note that 100BASE-T 100Mb/s Ethernet is often selected as the application under study because its MLT3 encoding scheme does not utilize modulation or advanced digital signal processing techniques for data transmission or recovery.

Conclusion:

The study of throughput is a new initiative and there are certainly many new developments on the horizon. Ongoing research includes modeling additional transmitter output scenarios using alternate waveforms likely to be encountered in real-life operating conditions, as well as investigating throughput when the cabling is subjected to temperature fluctuations, humidity, alien crosstalk, electromagnetic interference, and various installation configurations.

It is a fact that LAN equipment operating performance varies greatly under realworld conditions. Based upon existing throughput study initiatives, one conclusion is clear: better cabling ensures fewer frame re-transmissions, maximized data throughput, and less network congestion.

Throughput Glossary:

Bit: The smallest discreet piece of information in digital communication. Usually represented mathematically as a ‘1’ or ‘0’

Bit error: The corruption of the received signal that causes a mistake in the processing of the logical ‘1’ or ‘0’. Normally a bit error occurs when the incoming voltage waveform is compromised so that a ‘1’ is transposed to a ‘0’ or a ‘0’ is transposed to a ‘1’. Alternately, bits may be lost or added to a transmitted frame. Byte: A grouping made up of 7 or 8 bits. When taken as a single entity, a byte often refers to a specific character. For example, the ASCII code designation for the letter ‘b’ is the 8-bit sequence ‘0110 0001’.

29

CRC (Cyclic Redundancy Checking): A very reliable error detection system, CRC is 99.99995 percent accurate in detecting transmission errors. CRC is normally used on blocks or frames of data rather than individual bytes, and relies on frame check sequence (using mathematical algorithms) which provides the means to check for errors. The CRC function looks at the bit sequence of the transmitted frame syntax and compares it to the received frame. If one or more bits are different, then a CRC error is registered. For most protocols, a CRC error would cause the sending node to re-transmit the entire frame. Note that the CRC function does not determine how many bits were corrupted, rather it only signifies that at least one bit error occurred. Thus, CRC function can determine a frame error rate, but not a bit error rate.

Frame (a.k.a. Packet): A specific grouping of bytes that are arranged in a predetermined, logical order to create an information segment for a particular protocol. For example, for Ethernet, the frame would contain in sequence:

• Preamble - 7 Bytes (synchronization sequence)

• Start Delimiter - 1 Byte (marks the start of a frame)

• Destination address - 6 Bytes (the address of the receiving node) • Source address - 6 Bytes (the address of the sending node)

• Length - 2 Bytes (tells the number of bytes in the data field)

• Data (variable length) - 46-1500 Bytes (the "data information" being sent) • CRC - 4 Bytes (cyclic redundancy error detection)

The frame represents the smallest discreet information segment that can be sent. When large amounts of information are sent over a network, the higher layers of the OSI model break the information down into multiple frames, which must then be sent sequentially to the destination node.

Frame error: A corruption of a frame (packet) caused by one or more bit errors.

Data encryption and decryption

The standard IPsec prescribes that IPsec-compliant implementations must as a minimum make available the DES and Triple-DES encryption procedures as well as the MD5 and SHA-1 hash functions. However there is no reason why another procedure should not be used here, although in this case the same procedure must also be available to the communication partner. In general, only generally recognized and established procedures should be used. The keys used for symmetric encryption procedures should be at least 80 bits long.

30

STUDY OF NETWORK TOPOLOGIES

SERVER CLIENT-1 CLIENT-2

PORT-1 PORT-2 PORT-3

SWITCH

PORT-6 PORT-5 PORT-4

CLIENT-5 CLIENT-4 CLIENT-3

Connection of computers for STAR topology

31

EXPERIMENT 1:

OBJECTIVE: To study network topologies

EQUIPMENTS: LTS-01 trainer kit

3 or more Computers with win-2K / XP and Ethernet port available on them RJ-45 to RJ-45 LAN connecting cables L-SIM LAN protocol analyzer and simulator software

PROCEDURE:

1. Connect 3 or more computer LAN ports using RJ-45 to RJ-45 LAN connecting cables provided with the system to LTS-01 star topology ports.

2. Switch on the LTS-01 & Computers. 3. Run L-SIM software on all the computers, one should be server and others

should be clients. 4. On the server computer select type of network as LAN. 5. On the server computer select the topology as STAR, select protocol as

Stop & Wait click on create network button. 6. Remote computer details will appear on the computers connected in

network, server will be able to see all clients and all clients will be able to see only server.

7. Disconnect any of the client computers from the LTS-01 port. 8. Server computer software display will indicate client-disconnected status. 9. Reconnect the client disconnected from LTS-01. Still display will show

disconnected status. 10. To bring the reconnected client into network you have to destroy existing

network and recreate the network. 11. Thus we found that in star topology any of the clients is removed will not

affect the working of other computers in network. 12. Close L-SIM software windows on all computers & remove connection of all

computers from star topology. 13. Connect 4 computer LAN ports using RJ-45 to RJ-45 LAN connecting

cables provided with the system to LTS-01 Ring topology ports. 14. Run L-SIM software on all the computers, one should be server and others

should be clients. 15. On the server computer select type of network as LAN. 16. On the server computer select the topology as RING, select protocol as

Token Ring and to visualize token passing keep minimum token time & click on create network button.

17. You will see token passing from first client to second then to third and back to server. Here actual time will vary from set time depending on system processing speed, i.e. some variations in allocated token duration may take place.

18. For actual process of file transfer you need to keep token time to maximum

32

20. Ring broken message will popup and you have to destroy the network, reconnect the client and recreate the network.

21. Thus we found that in ring topology any of the clients is removed will break the network and we cannot work further with this network.

22. Close L-SIM software windows on all computers & remove connection of all computers from ring topology.

23. Connect 5 computer LAN ports using RJ-45 to RJ-45 LAN connecting cables provided with the system to LTS-01 Bus topology ports.

24. Run L-SIM software on all the computers, one should be server and others should be clients.

25. On the server computer select type of network as LAN. 26. On the server computer select the topology as BUS, select protocol as

Token Bus and to visualize token passing keep minimum token time & click on create network button.

27. You will see token passing from first client to second to third then to fourth and back to server. Here actual time will vary from set time depending on system processing speed, i.e. some variations in allocated token duration may take place.

28. For actual process of file transfer you need to keep token time to maximum level so that sufficient time will be available to you to select file, packet size.

29. Disconnect fourth client i.e. computer connected to the LTS-01 port-5. 30. Server computer software display will indicate client-disconnected status

but other working will not hamper. 31. Disconnect first client i.e. computer connected to the LTS-01 port-2. 32. Server computer software display will indicate client-disconnected status

and work cannot continue further as bus is broken. 33. Thus we found that in bus topology any of the clients is removed from the

end of the bus will not hamper work till that client but if a client from middle or start of the bus is removed will break the network and we cannot work further with this network.

33

STUDY OF STOP & WAIT PROTOCOL

SERVER CLIENT-1 CLIENT-2

PORT-1 PORT-2 PORT-3

SWITCH

PORT-6 PORT-5 PORT-4

CLIENT-5 CLIENT-4 CLIENT-3

Connection of computers for STAR topology

34

EXPERIMENT 2:

OBJECTIVE: To study Stop & Wait protocol

EQUIPMENTS: LTS-01 trainer kit 3 or more Computers with win-2K / XP and Ethernet port available on them RJ-45 to RJ-45 LAN connecting cables L-SIM LAN protocol analyzer and simulator software

PROCEDURE: 1. Connect 2 computer LAN ports using RJ-45 to RJ-45 LAN connecting

cables provided with the system to LTS-01 star topology ports. 2. Switch on the LTS-01 & Computers. 3. Run L-SIM software on all the computers, one should be server and others

should be clients. 4. On the server computer select type of network as LAN. 5. On the server computer select the topology as STAR, select protocol as

Stop & Wait click on create network button. 6. Remote computer details will appear on the computers connected in

network, server will be able to see all clients and all clients will be able to see only server.

7. Select the computer to whom data file is to be transferred, from the load

button, previously stored/selected file information can be loaded or you can select any file, which is to be transmitted.

8. File size will appear in the software window, select the packet size, inter packet delay and click OK.

9. Total packets formed for that file will be indicated on computers.

35

10. Same details of file will appear on remote computer to which file is to be transmitted.

11. Click on file transfer button to transfer file.

Transmission started screen in transmitter

36

Transmission started screen in receiver 12. During file transfer process you can insert errors into data packets being

transmitted through software window. 13. See the effect of Bad packet error, Packet negative acknowledgment error

or auto errors on file transfer.

14. Select BAD PACKET error and click on Generate button in the transmitter window when say 7th packet is in the transmission state.

37

15. You will see that 7th packet in the receiver window will be marked as bad packet.

16. 7th packet will be retransmitted from transmitter.

38

17. Retransmitted 7th packet will be received correctly this time.

18. Select ACK LOST error and click on Generate button in the transmitter window when say 23rd packet is in the transmission state.

39

19. You will see that 23rd packet in the receiver window will be marked as unacknowledged.

20. 23rd packet will be retransmitted from transmitter.

40

21. Retransmitted 23rd packet will be received correctly this time.

22. Select AUTO ERROR and click on Generate button in the transmitter window at any packet is in the transmission state, errors are generated at random intervals and no other error insertion facility will be available to user.

41

23. Status of packets received when auto error is selected. 24. File transfer from one computer to another will take place. 25. Multiple file transfer between various server-client combinations should be

performed to observe throughput v/s packet size graph on transmitter computer.

26. Close file transfer window and click on protocol analyzer and Network analyzer buttons on transmitter computer to view details of the log created.

27. Under Network analyzer window click on Graph analyzer button. 28. Calculate throughput and click on Plot graph button. 29. Detailed graph of throughput v/s packet size for the total file transfer activity

will appear on graph window. 30. This plot can be printed by clicking on print button.

Graph for Stop & Wait protocol without any packet errors

42

Graph for Stop & Wait protocol with one ACK lost packet error

43

STUDY OF GO BACK N PROTOCOL

SERVER CLIENT-1 CLIENT-2

PORT-1 PORT-2 PORT-3

SWITCH

PORT-6 PORT-5 PORT-4

CLIENT-5 CLIENT-4 CLIENT-3

Connection of computers for STAR topology

44

EXPERIMENT 3:

OBJECTIVE: To study Go Back N protocol

EQUIPMENTS: LTS-01 trainer kit

3 or more Computers with win-2K / XP and Ethernet port available on them RJ-45 to RJ-45 LAN connecting cables L-SIM LAN protocol analyzer and simulator software

PROCEDURE: 1. Connect 3 or more computer LAN ports using RJ-45 to RJ-45 LAN

connecting cables provided with the system to LTS-01 star topology ports. 2. Switch on the LTS-01 & Computers. 3. Run L-SIM software on all the computers, one should be server and others

should be clients. 4. On the server computer select type of network as LAN. 5. On the server computer select the topology as STAR, select protocol as Go

Back N click on create network button. 6. Remote computer details will appear on the computers connected in

network, server will be able to see all clients and all clients will be able to see only server.

7. Select the computer to whom data file is to be transferred, from the load button, previously stored/selected file information can be loaded or you can select any file, which is to be transmitted.

8. File size will appear in the software window, select the packet size, inter packet delay, window size and click OK.

9. Total packets formed for that file will be indicated on computers.

45

10. Same details of file will appear on remote computer to which file is to be transmitted.

11. Click on file transfer button to transfer file.

Transmission started screen in transmitter clearly show window size of 3 with 3 packets are transmitted at a time

46

Transmission started screen in receiver

12. During file transfer process you can insert errors into data packets being transmitted through software window.

13. See the effect of Bad packet error, Packet negative acknowledgment error or auto errors on file transfer; observe carefully which packet/packets are transmitted.

14. Select BAD PACKET error and click on Generate button in the transmitter window when say 15th packet is in the transmission state.

47

15. You will see that 15th packet in the receiver window will be marked as bad packet.

16. 15th, 16th & 17th packets will be retransmitted from transmitter.

48

17. Retransmitted 15th, 16th & 17th packets will be received correctly this time, receiver will discard 16th & 17th packets and only 15th packet is accepted.

18. Select ACK LOST error and click on Generate button in the transmitter

window when say 21st packet is in the transmission state.

49

19. You will see that 21st packet in the receiver window will be marked as unacknowledged.

20. 21st, 22nd & 23rd packets will be retransmitted from transmitter.

50

21. Retransmitted 21st, 22nd & 23rd packets will be received and discarded by receiver as they were received correctly earlier.

22. Select AUTO ERROR and click on Generate button in the transmitter

window at any packet is in the transmission state, errors are generated at random intervals and no other error insertion facility will be available to user.

51

23. Status of packets received when auto error is selected. 24. File transfer from one computer to another will take place. 25. Multiple file transfer between various server-client combinations should be

performed to observe throughput v/s packet size graph on transmitter computer.

26. Close file transfer window and click on protocol analyzer and Network analyzer buttons on transmitter computer to view details of the log created.

27. Under Network analyzer window click on Graph analyzer button. 28. Calculate throughput and click on Plot graph button. 29. Detailed graph of throughput v/s packet size for the total file transfer activity

will appear on graph window.

Graph for Go Back N protocol without any packet errors 30. This plot can be printed by clicking on print button.

52

STUDY OF SELECTIVE REPEAT PROTOCOL

SERVER CLIENT-1 CLIENT-2

PORT-1 PORT-2 PORT-3

SWITCH

PORT-6 PORT-5 PORT-4

CLIENT-5 CLIENT-4 CLIENT-3

Connection of computers for STAR topology

53

EXPERIMENT 4:

OBJECTIVE: To study Selective Repeat protocol

EQUIPMENTS: LTS-01 trainer kit 3 or more Computers with win-2K / XP and Ethernet port available on them RJ-45 to RJ-45 LAN connecting cables L-SIM LAN protocol analyzer and simulator software

PROCEDURE: 1. Connect 3 or more computer LAN ports using RJ-45 to RJ-45 LAN

connecting cables provided with the system to LTS-01 star topology ports. 2. Switch on the LTS-01 & Computers. 3. Run L-SIM software on all the computers, one should be server and others

should be clients. 4. On the server computer select type of network as LAN. 5. On the server computer select the topology as STAR, select protocol as

Selective Repeat click on create network button. 6. Remote computer details will appear on the computers connected in

network, server will be able to see all clients and all clients will be able to see only server.

7. Select the computer to whom data file is to be transferred, from the load button, previously stored/selected file information can be loaded or you can select any file, which is to be transmitted.

8. File size will appear in the software window, select the packet size, inter packet delay, window size and click OK.

9. Total packets formed for that file will be indicated on computers.

54

10. Same details of file will appear on remote computer to which file is to be transmitted.

11. Click on file transfer button to transfer file.

Transmission started screen in transmitter clearly show window size of 3 with 3 packets are transmitted at a time

55

Transmission started screen in receiver

12. During file transfer process you can insert errors into data packets being transmitted through software window.

13. See the effect of Bad packet error, Packet negative acknowledgment error or auto errors on file transfer; observe carefully which packet/packets are transmitted.

14. Select BAD PACKET error and click on Generate button in the transmitter window when say 13th packet is in the transmission state.

56

15. You will see that 13th packet in the receiver window will be marked as bad packet.

16. 13th packet will be retransmitted from transmitter.

57

17. Retransmitted 13th packet will be received correctly this time.

18. Select ACK LOST error and click on Generate button in the transmitter window when say 26th packet is in the transmission state.

58

19. You will see that 26th packet in the receiver window will be marked as unacknowledged.

20. 26th packet will be retransmitted from transmitter.

59

21. Retransmitted 26th packet will be received and discarded by receiver as it was received correctly earlier.

22. Select AUTO ERROR and click on Generate button in the transmitter window at any packet is in the transmission state, errors are generated at random intervals and no other error insertion facility will be available to user.

60

23. Status of packets received when auto error is selected. 24. File transfer from one computer to another will take place. 25. Multiple file transfer between various server-client combinations should be

performed to observe throughput v/s packet size graph on transmitter computer.

26. Close file transfer window and click on protocol analyzer and Network analyzer buttons on transmitter computer to view details of the log created.

27. Under Network analyzer window click on Graph analyzer button. 28. Calculate throughput and click on Plot graph button. 29. Detailed graph of throughput v/s packet size for the total file transfer activity

will appear on graph window.

Graph for Selective Repeat protocol without any packet errors 30. This plot can be printed by clicking on print button.

61

EXIMENT SERVER CLIENT-1 CLIENT-2

PORT-1 PORT-2 PORT-3

SWITCH

PORT-6 PORT-5 PORT-4

CLIENT-5 CLIENT-4 CLIENT-3

Connection of computers for STAR topology

62

EXPERIMENT 5:

OBJECTIVE: A. To study CSMA-CA protocol using Ethernet LAN.

EQUIPMENTS: LTS-01 trainer kit

3 or more Computers with win-2K / XP and Ethernet port available on them RJ-45 to RJ-45 LAN connecting cables L-SIM LAN protocol analyzer and simulator software

PROCEDURE:

1. Connect 3 or more computer LAN ports using RJ-45 to RJ-45 LAN connecting cables provided with the system to LTS-01 star topology ports.

2. Switch on the LTS-01 & Computers. 3. Run L-SIM software on all the computers, one should be server and others

should be clients. 4. On the server computer select type of network as LAN. 5. On the server computer select the topology as STAR, select protocol as

CSMA-CA click on create network button. 6. Remote computer details will appear on the computers connected in

network, server will be able to see all clients and all clients will be able to see only server.

7. Click on the Send RTS button to get your computer into transmitter mode. 8. Select the computer to whom data file is to be transferred, from the load

button, previously stored/selected file information can be loaded or you can select any file, which is to be transmitted.

9. File size will appear in the software window, select the packet size, inter packet delay and click OK.

10. Total packets formed for that file will be indicated on computers, same details of file will appear on remote computer to which file is to be transmitted.

11. Click on file transfer button to transfer file.

63

12. During file transfer process try to get access to transmit file by clicking on Send RTS button, you will be prompted with channel is busy message.

13. Thus collision of two packets transmitted simultaneously from two senders is avoided.

14. File transfer from one computer to another will take place. 15. Multiple file transfer between various server-client combinations should be

performed to observe throughput v/s packet size graph on transmitter computer.

16. Close file transfer window and click on protocol analyzer and Network analyzer buttons on transmitter computer to view details of the log created.

17. Under Network analyzer window click on Graph analyzer button. 18. Calculate throughput and click on Plot graph button.

Graph for CSMA-CA protocol without any packet errors

64

19. Detailed graph of throughput v/s packet size for the total file transfer activity will appear on graph window.

20. This plot can be printed by clicking on print button.

B. To study CSMA-CA protocol using Wireless LAN.

EQUIPMENTS: LTS-01 trainer kit

3 or more Computers with win-2K / XP and USB port available on them L-SIM LAN protocol analyzer and simulator software Access point with accessories Wireless LAN Access cards with USB driver installed on respective computers

PROCEDURE: 1. Install the driver for Wireless USB Adapter on the computers you are going

to use for the experiment, using the driver CD for the same (see for the installation details at the beginning of this manual).

2. Connect wireless access point to one of the ports in Star topology using RJ-45 to RJ-45 LAN connecting cable provided with the wireless access point.

3. Connect Wireless USB adapters to the USB ports of the computers you are going to use for the experiment.

4. You will find wireless LAN detection on your computers, Assign IP address to the detected wireless LAN and connect it. Connection of wireless LAN will be indicated on your computers.

5. Switch on the LTS-01. 6. Run L-SIM software on all the computers, one should be server and others

should be clients. 7. On the server computer select type of network as WLAN. 8. On the server computer select the topology as STAR, select protocol as

CSMA-CA click on create network button. 9. Remote computer details will appear on the computers connected in

network, server will be able to see all clients and all clients will be able to see only server.

10. Click on the Send RTS button to get your computer into transmitter mode. 11. Select the computer to whom data file is to be transferred, from the load

button, previously stored/selected file information can be loaded or you can select any file, which is to be transmitted.

12. File size will appear in the software window, select the packet size, inter packet delay and click OK.

13. Total packets formed for that file will be indicated on computers, same details of file will appear on remote computer to which file is to be transmitted.

14. Click on file transfer button to transfer file. 15. During file transfer process try to get access to transmit file by clicking on

Send RTS button, you will be prompted with channel is busy message. 16. Thus collision of two packets transmitted simultaneously from two senders

is avoided.

17. File transfer from one computer to another will take place.

65

18. Multiple file transfer between various server-client combinations should be performed to observe throughput v/s packet size graph on transmitter computer.

19. Close file transfer window and click on protocol analyzer and Network analyzer buttons on transmitter computer to view details of the log created.

20. Under Network analyzer window click on Graph analyzer button. 21. Calculate throughput and click on Plot graph button. Detailed graph of throughput v/s packet size for the total file transfer activity

will appear on graph window.

22. This plot can be printed by clicking on print button.

66

SERVER CLIENT-1 CLIENT-2

PORT-1 PORT-2 PORT-3

SWITCH

PORT-6 PORT-5 PORT-4

CLIENT-5 CLIENT-4 CLIENT-3

Connection of computers for STAR topology

67

EXPERIMENT 6:

OBJECTIVE: To study CSMA-CD protocol

EQUIPMENTS: LTS-01 trainer kit 3 or more Computers with win-2K / XP and Ethernet port available on them RJ-45 to RJ-45 LAN connecting cables L-SIM LAN protocol analyzer and simulator software

PROCEDURE: 1. Connect 3 or more computer LAN ports using RJ-45 to RJ-45 LAN

connecting cables provided with the system to LTS-01 star topology ports. 2. Switch on the LTS-01 & Computers. 3. Run L-SIM software on all the computers, one should be server and others

should be clients. 4. On the server computer select type of network as LAN. 5. On the server computer select the topology as STAR, select protocol as

CSMA-CD click on create network button. 6. Remote computer details will appear on the computers connected in

network, server will be able to see all clients and all clients will be able to see only server.

7. Select the computer to whom data file is to be transferred, from the load

button, previously stored/selected file information can be loaded or you can select any file, which is to be transmitted.

8. File size will appear in the software window, select the packet size, inter packet delay and click OK.

9. Total packets formed for that file will be indicated on computers, same details of file will appear on remote computer to which file is to be transmitted.

10. Click on file transfer button to transfer file. 11. During file transfer process try to send file to same receiver from another

computer, file transfer from second transmitter will also gets initiated.

68

12. When packet from second sender collides with first sender it will be indicated as collision packet on server & Client-1.

69

13. File from first sender will resume after some time and second sender file will be kept on hold till first file transfer gets completed.

14. Once the first sender file reached to server its display is refreshed and

server will show packet status for second sender.

15. Second sender file transfer will also get completed and thus collision of two packets transmitted simultaneously from two senders is detected and cleared.

16. Multiple file transfer between various server-client combinations should be performed to observe throughput v/s packet size graph on transmitter computer.

17. Close file transfer window and click on protocol analyzer and Network analyzer buttons on transmitter computer to view details of the log created.

70

18. Under Network analyzer window click on Graph analyzer button. 19. Calculate throughput and click on Plot graph button.

Graph for CSMA-CD protocol

20. Detailed graph of throughput v/s packet size for the total file transfer activity will appear on graph window.

21. This plot can be printed by clicking on print button.

71

PO

RT

-1

PO

RT

-2

PO

RT

-3

PO

RT

-4

PO

RT

-5

SE

RV

ER

C

LIE

NT

-1

CL

IEN

T-2

C

LIE

NT

-3

CL

IEN

T-4

Co

nn

ecti

on

of

co

mp

ute

rs f

or

BU

S t

op

olo

gy

72

EXPERIMENT 7:

OBJECTIVE: To study token bus protocol

EQUIPMENTS: LTS-01 trainer kit

3 or more Computers with win-2K / XP and Ethernet port available on them RJ-45 to RJ-45 LAN connecting cables L-SIM LAN protocol analyzer and simulator software

PROCEDURE:

1. Connect four or more computer LAN ports using RJ-45 to RJ-45 LAN connecting cables provided with the system to LTS-01 bus topology ports.

2. Switch on the LTS-01 & Computers. 3. Run L-SIM software on all the computers, one should be server and others

should be client. Run the software in the sequence of connection i.e. server first followed by first client to last client.

4. On the server computer select type of network as LAN.

5. On the server computer select the topology as BUS, select protocol as

Token Bus and select token activation time as desired, click on create network button.

6. To just observe how token passes from one computer to another computer and effect of token time keep token duration from 5 to 40 seconds and to do actual file transfer keep token duration as 50 or 60 seconds.

7. Remote computer details will appear on the computers connected in network, server will be able to see all clients and all clients will be able to see only server.

73

8. Select the computer to whom data file is to be transferred, from the load button, previously stored/selected file information can be loaded or you can select any file, which is to be transmitted.

9. File size will appear in the software window, select the packet size, inter packet delay and click OK.

10. Total packets formed for that file will be indicated on computers, same details of file will appear on remote computer to which file is to be transmitted.

11. Click on file transfer button to transfer file. 12. File transfer from one computer to another will take place. 13. Remove connection of last client and see the effect on file transfer or token

transfer. You will find that token will process till the client who is connected in network.

14. Remove connection of client which is in between the server and last client and see the effect on file transfer or token transfer. You will find that token will process till the client who is connected in network from client and will not process from the client got disconnected from network.

74

SERVER CLIENT-1 PORT-1 PORT-2

PORT-4 PORT-3

CLIENT-3 CLIENT-2

Connection of computers for RING topology

75

EXPERIMENT 8:

OBJECTIVE: To study token ring protocol

EQUIPMENTS: LTS-01 trainer kit

4 Computers with win-2K / XP and Ethernet port available on them RJ-45 to RJ-45 LAN connecting cables L-SIM LAN protocol analyzer and simulator software

PROCEDURE:

1. Connect four computer LAN ports using RJ-45 to RJ-45 LAN connecting cables provided with the system to LTS-01 ring topology ports.

2. Switch on the LTS-01 & Computers. 3. Run L-SIM software on all the computers, one should be server and other 3

should be client. Run the software in the sequence of connection i.e. server first followed by first client to last client.

4. On the server computer select type of network as LAN.

5. On the server computer select the topology as RING, select protocol as

Token Ring and select token activation time as desired, click on create network button.

6. To just observe how token passes from one computer to another computer and effect of token time keep token duration from 5 to 40 seconds and to do actual file transfer keep token duration as 50 or 60 seconds.

7. Remote computer details will appear on the computers connected in network, server will be able to see all clients and all clients will be able to see only server.

76

8. Select the computer to whom data file is to be transferred, from the load button, previously stored/selected file information can be loaded or you can select any file, which is to be transmitted.

9. File size will appear in the software window, select the packet size, inter packet delay and click OK.

10. Total packets formed for that file will be indicated on computers, same details of file will appear on remote computer to which file is to be transmitted.

11. Click on file transfer button to transfer file. 12. File transfer from one computer to another will take place. 13. To see the effect of ring break state remove any of the client from the

hardware and close L-SIM window for that client. Ring broken message will be prompted on server computer and network will get destroyed, you need to reconfigure the network. Since the network is created with logical ring physical removal of computer from hardware will be detected when token completes its cycle and reaches to the client whose connection is removed, hence it will take some time to show disconnection of computer in case of unplugging of computer.

77

SERVER CLIENT-1 CLIENT-2

PORT-1 PORT-2 PORT-3

SWITCH

PORT-6 PORT-5 PORT-4

CLIENT-5 CLIENT-4 CLIENT-3

Connection of computers for STAR topology

78

EXPERIMENT 9:

OBJECTIVE: To study data encryption and decryption

EQUIPMENTS: LTS-01 trainer kit

3 or more Computers with win-2K / XP and Ethernet port available on them RJ-45 to RJ-45 LAN connecting cables L-SIM LAN protocol analyzer and simulator software

PROCEDURE:

1. Connect at least two computer LAN ports using RJ-45 to RJ-45 LAN connecting cables provided with the system to LTS-01 star topology ports.

2. Switch on the LTS-01 & Computers. 3. Run L-SIM software on both the computers, one should be server and

another should be client. 4. On the server computer select type of network as LAN. 5. On the server computer select the topology as STAR and select protocol as

Stop & Wait and click on create network button. 6. Remote computer details will appear on the computers connected in

network, server will be able to see client and client will be able to see server.

7. Select the computer to whom data file is to be transferred, from the load

button, previously stored/selected file information can be loaded or you can select any file, which is to be transmitted, if notepad text file is selected encryption information can be viewed very clearly for each packet formed for that file.

8. File size will appear in the software window, select the packet size, inter packet delay and click OK.

9. Total packets formed for that file will be indicated on computers, same details of file will appear on remote computer to which file is to be transmitted.

10. Click on file transfer button to transfer file. 11. Click on pause button to interrupt file transfer and click on encrypt/decrypt

button to see file packet encrypted and decrypted.

79

12. You will see actual file selected packet content and encrypted data content in encryption details window.

13. You can type any text at the bottom box, which you want to encrypt and

provide key text for encryption. Similarly same key can be typed again to decrypt and recover encrypted text. If the key at decryption stage differ from key at encryption stage, decrypted data will not be perfect as per original data.

80

14. To understand the working of how encryption took place you can view visual explanation of encryption and decryption process by clicking on visual help button.

15. Visual help showing decryption procedure. 16. You can resume file transfer by clicking on continue button. 17. Encrypted format of each packet can thus be seen by pausing the file

transfer at respective packet when it is under transmission state. 18. File transfer from one computer to another will take place. 19. To study programming of Cryptography with Encryption and Decryption

process sample executable file & program is provided inside program files - Lsim - SampleApplication.zip.

81

20. When user extracts this folder he will find cryptography folder inside which cryptography.cpp & cryptography.exe files are provided.

21. If user runs the cryptography.exe file screen with browse option for

selection of file to be encrypted and enter key for encryption option will get open for user to select the file and enter encryption key.

22. When user clicks on Encrypt button a message with Encryption completed will popup. Encrypted file will be stored at the same location from where file for encryption is selected.

23. User has to select file to be decrypted and enter decryption key.

82

24. When user clicks on Decrypt button a message with Decryption completed will popup. Decrypted file will be stored at the same location from where file for decryption is selected.

25. To verify encryption and decrypted files user has to close the cryptography.exe file before opening the encrypted and decrypted files.

26. Actual programming can be checked from cryptography.cpp program.

83

SERVER CLIENT-1 CLIENT-2

PORT-1 PORT-2 PORT-3

SWITCH

PORT-6 PORT-5 PORT-4

CLIENT-5 CLIENT-4 CLIENT-3

Connection of computers for STAR topology

84

EXPERIMENT 10:

OBJECTIVE: To plot throughput v/s packet size EQUIPMENTS: LTS-01 trainer kit 3 or more Computers with win-2K / XP and Ethernet port available on them RJ-45 to RJ-45 LAN connecting cables L-SIM LAN protocol analyzer and simulator software PROCEDURE: 1. Connect 3 or more computer LAN ports using RJ-45 to RJ-45 LAN

connecting cables provided with the system to LTS-01 star topology ports. 2. Switch on the LTS-01 & Computers. 3. Run L-SIM software on all the computers, one should be server and other

should be clients. 4. On the server computer select type of network as LAN. 5. On the server computer select the topology as STAR, select protocol as

desired let say Stop & Wait click on create network button. 6. Remote computer details will appear on the computers connected in

network, server will be able to see all clients and all clients will be able to see only server.

7. Select the computer to whom data file is to be transferred, from the load

button, previously stored/selected file information can be loaded or you can select any file, which is to be transmitted.

8. File size will appear in the software window, select the packet size, inter packet delay and click OK.

9. Total packets formed for that file will be indicated on computers, same details of file will appear on remote computer to which file is to be transmitted.

10. Click on file transfer button to transfer file. 11. During file transfer process you can insert errors into data packets being

transmitted through software window. 12. See the effect of Bad packet error, Packet no acknowledgment error or

auto errors on file transfer. 13. File transfer from one computer to another will take place. 14. Multiple file transfer between various server-client combinations should be

performed to observe throughput v/s packet size graph on transmitter computer.

15. Close file transfer window and click on protocol analyzer and Network analyzer buttons on transmitter computer to view details of the log created.

16. Under Network analyzer window click on Graph analyzer button. 17. Calculate throughput and click on Plot graph button. 18. Detailed graph of throughput v/s packet size for the total file transfer activity

will appear on graph window. 19. This plot can be printed by clicking on print button. 20. Network connection can be destroyed by clicking on destroy network

button.

21. Similarly other networks can be created with selection of topology and protocol.

22. Similar file transfers activity can be performed to observe throughput v/s packet size plot for the selected topology and protocol.

85

SERVER CLIENT

PORT-1 PORT-2 PORT-3

SWITCH

PORT-6 PORT-5 PORT-4

Connection of computers for TCP socket programming

86

EXPERIMENT 11:

OBJECTIVE: Study of socket processing.

EQUIPMENTS:

• LTS-01 trainer kit

• 2 Computers with win-2K / XP and Visual C++ installed and Ethernet port available on them

• RJ-45 to RJ-45 LAN connecting cables

PROCEDURE: 1. Connect 2 computer LAN ports using RJ-45 to RJ-45 LAN connecting

cables provided with the system to LTS-01 star topology ports. 2. Switch on the LTS-01 & Computers. 3. Run VC++ editor on both the computers. 4. Create dialog based application, for Server on any of the PC in VC++ 5. Create dialog based application, for Client on other PC in VC++ 6. TCP Test Server.exe, TCP Test Client.exe, server.h, server.cpp, client.h &

client.cpp files will be stored in the directory program files - LSIM - SampleApplication.zip.

7. After extracting the said zip files all these files can be used for socket programming.

8. Copy the server.h & server.cpp files in server workspace on first PC. 9. Copy the client.h & client.cpp files in Client workspace on second

computer. 10. server.h file contain following functions:

CreateSocket (int portNumber); ListenSocket();

SendMessage(CString strMessage); SendFile(CString strFilePath); ReceiveFile(); CloseConnection(); Error() ;

11. client.h file contain following functions:

CreateSocket(); Connection (CString IPAddressOfServer ,int portNumber); SendMessage (CString strMessage) SendFile (CString strFilePath); ReceiveFile(); CloseConnection(); Error() ;

12. Create an Object of Server class as : Server objServer 13. Create an Object of Client class as : Client objClient

14. Call the CreateSocket() , ListenSocket() function for the Server object pass

the port number for server.

87

15. Call the CreateSocket() , Connection() function for the Client object , in the connection function pass the IP address of the server and port number given at server.

16. After the connection call the SendMessage () function from Server or Client object. Pass the message to send as parameter.

17. To Send a File call the SendFile() function from Server or Client and pass the absolute path of the File to send .

18. CloseConnection () function can be called from server or client object to close the connection.

19. Thus students can use these functions to do the socket processing for TCP.

20. Students can create their own GUI and can define their own parameters after making use of the given classes and prove their programming skills.

21. Thus socket processing can be carried out. 22. To see the functionality with sample executables use TCP Test Server.exe

& TCP Test Client.exe on two different computers.

23. Run TCP Test Server.exe on one of the computer and pass port number.

24. Run TCP Test Client.exe on other computer and pass IP address of server computer and port number provided at server.

25. Check the functionality by sending message and / or files.

Note: To see the code of specific function, open the server.cpp or client.cpp file & then check the code of the function.