You are on page 1of 66

D-Type-9 pin no.

D-Type25 Pin no. 2 3 4 5 6 7 8 20 22

Pin outs

Function

3 2 7 8 6 5 1 4 9

RD TD RTS CTS DSR SG DCD DTR RI

Receive Data (Serial data input) Transmit Data (Serial data output) Request to send (acknowledge to modem that UART is ready to exchange data Clear to send (i.e.; modem is ready to exchange data) Data ready state (UART establishes a link) Signal ground Data Carrier detect (This line is active when modem detects a carrier Data Terminal Ready. Ring Indicator (Becomes active when modem detects ringing signal from PSTN

Expt. No.: Date:

STUDY AND IMPLEMENTATION OF SERIAL AND PARALLEL PORTS

Aim:

Theory: Serial Port: RS232 is the most known serial port used in transmitting the data in communication and interface. Even though serial port is harder to program than the parallel port, this is the most effective method in which the data transmission requires less wires that yields to the less cost. The RS232 is the communication line which enables the data transmission by only using three wire links. The three links provides transmit, receive and common ground. The transmit and receive line on this connecter send and receive data between the computers. As the name indicates, the data is transmitted serially. The two pins are TXD & RXD. There are other lines on this port as RTS, CTS, DSR, DTR, and RTS, RI. The 1 and 0 are the data which defines a voltage level of 3V to 25V and -3V to -25V respectively. The RS-232D has existed in two types. i.e., D-TYPE 25 pin connector and DTYPE 9 pin connector, which are male connectors on the back of the PC. You need a female connector on your communication from Host to Guest computer. The pin outs of both D-9 & D-25 are show in the table. Null Modems

A Null Modem is used to connect two DTE's together. This is commonly used as a cheap way to network games or to transfer files between computers using Zmodem Protocol, Xmodem Protocol etc. This can also be used with many Microprocessor Development Systems.

NULL MODEM

It only requires 3 wires (TD, RD & SG) to be wired straight through thus is more cost effective to use with long cable runs. The theory of operation is reasonably easy. The aim is to make to computer think it is talking to a modem rather than another computer. Any data transmitted from the first computer must be received by the second thus TD is connected to RD. The second computer must have the same setup thus RD is connected to TD. Signal Ground (SG) must also be connected so both grounds are common to each computer. Procedure: 1. Connect one end of the 9 pin D-type female to female connector to the serial port of your PC(system1). 2. Connect other end to the 9 pin D-type female connector of the PC to PC communication trainer kit. 3. Repeat step 1 and 2 with the other PC(system2). 4. Connect RXD pin of system1 to TXD pin of system2. 5. Connect RXD pin of system2 to TXD pin of system1. 6. Connect DTR pin of system1 to DSR pin of system2. 7. Connect DTR pin of system2 to DSR pin of system1. 8. Connect RTS pin of system1 to CTS pin of system2. 9. Connect RTS pin of system2 to CTS pin of system1. 10. Common the ground terminals. 11. Run serial.exe in both PCs. 12. Select the comm terminal and baud rate. NOTE: baud rate selected should be same for both the PCs. 13. Click SET_SERIAL_PORT button. successfully changed message appears. 14. The status of CTS pin will read notok in both receiver and transmitter. 15. The status of DSR pin will read notok in both receiver and transmitter. 16. Click RTS button in the transmitting PC and receiver PC. 17. The status of CTS pin will read ok in both receiver and transmitter. 18. Click DTR button in the transmitting PC and receiver PC. 19. The status of DSR pin will read ok in both receiver and transmitter. 20. Type the message to be transmitted in the text box. 21. Click TRANSMIT button to transmit the typed content. 22. Click CLR SCREEN button to clear the text box.

IBM-PC PARALLEL PRINTERPORT FEMALEDB-25SOCKETEXTERNAL PINLAYOUT: Theusedpinsforthisexperimentareasfollows.

Theusedpinsforthisexperimentasfollows: Pin 1 2 3 4 5 6 7 8 9 10 18 Signals -Strobe +databit0 +databit1 +databit2 +databit3 +databit4 +databit5 +databit6 +databit7 AC K GROUND Purpose D0 D1 D2 D3 D4 D5 D6 D7

To transmit a file: 23. Type the message in the text box. 24. Type the file path with file name to which the contents to be written. 25. Click WRITE_SCREEN_TO_FILE button to write the contents. 26. Click CLR SCREEN button to clear the text box. 27. Click READ_FILE_TO_SCREEN button to read the contents of the file. 28. Click TRANSMIT_FILE button to transmit the file content. NOTE: the transmitted file content will be stored in the path given in the receiving PC. 29. Click CLR SCREEN to repeat the process. 30. Click STOP button to exit. Connection for null modem method: To connect the systems using null modem method 1. Connect DTR of system1 to DSR of system1 2. Connect DTR of system2 to DSR of system2 3. Connect RTS of system1 to CTS of system1

4. Connect RTS of system2 to CTS of system2 Parallel Port: DESCRIPTION:

The main aim of the experiment is to transfer a file from a PC to another PC using parallel port. The interface between the PCs is done through the parallel port(LPT) in the PC,a male to male 25 pin D-type connector is used to connect together. The parallel port is configured to run in bi-directional mode. The data lines D0-D8 (pins 2 to 9) are used to read/write a byte of data. The control line STROBE and status line ACK make the handshaking signal. The digital data pins are connected directly to the 74LS244 bi-directional buffer. The output of the buffer is connected to the data lines of the parallel port.

OPERATION: 1. The data byte to be transmitted is placed on the data register (0x378). 2. The control pin STROBE is made low to indicate a valid data on the data bus. 3. The receiver PC waits for status pin ACK(which is cross connected with the STROBE pin of transmitter PC) to go high. 4. Once the ACK pin goes high the data in the data register is read.

5. The receiver PC then acknowledges by giving a pulse in its STROBE pin .The width of the acknowledge pulse can be set by the user. 6. This handshaking sequence is repeated for every byte until end of file.

PROCEDURE: 1. Connect one end of the 25 pin D-type male to male connector to the parallel port of your PC(LPT)(system1). 2. Connect other end to the 25 pin D-type female connector of the PC to PC communication trainer kit. 3. Repeat step 1 and 2 with the other PC(system2). 4. Connect the STROBE pin of system1 to the ACK pin of system 2 in the trainer kit. 5. Connect the STROBE pin of system2 to the ACK pin of system 1 in the trainer kit. 6. Connect data pins D0 to D7 of system1 to pins D0 to D7 of system2. 7. Common the ground terminals. 8. Run parallel.exe in both the PCs. For transmitting system: 9. Select the file to be sent in the PC from which you want to transfer file (say system1). For receiving system: 10. Set the transmission rate. The user can choose the preset rate if choose delay option is selected or can assign any rate from 1 to 100 ms if user delay option is selected. 11. Select the path for the file to be stored.

NOTE: The receive file button is disabled until the file path for the receiving file is selected. 12. Click send file button in the transmitting PC. 13. Click receive file button in the receiver PC. 14. file transfer completed message appears both in the transmitter and receiver PC once the transfer is complete. 15. The file contents will be displayed on the text box in the receiver PC. 16. Click clear button to clear the contents in the text box. 17. Repeat all the above steps to send a new file.

Result:

Expt. No.: Date:

IMPLEMENTATION AND STUDY OF ETHERNET LAN PROTOCOL

Aim:

Theory: Ethernet is a family of frame-based computer networking technologies for local area networks (LAN). The name was inspired by the physical concept of the ether. It defines a number of wiring and signaling standards for the Physical Layer of the OSI networking model as well as a common addressing format and Media Access Control at the Data Link Layer. Ethernet is standardized as IEEE 802.3. The combination of the twisted pair versions of Ethernet for connecting end systems to the network, along with the fiber optic versions for site backbones, is the most widespread wired LAN technology. It has been used from around 1980[1] to the present, largely replacing competing LAN standards such as token ring, FDDI, and ARCNET. Despite the physical star topology, repeater based Ethernet networks still use half-duplex and CSMA/CD, with only minimal activity by the repeater, primarily the Collision Enforcement signal, in dealing with packet collisions. Every packet is sent to every port on the repeater, so bandwidth and security problems are not addressed. The total throughput of the repeater is limited to that of a single link, and all links must operate at the same speed.

Time vs. Frame:

Time Vs Frame Transferred


40 35 30 25 20 15 10 5 0 00:00 00:02 00:03 00:05 Frame 00:07 00:09 00:10

Output:

Source node IP address Destination node IP address Payload delivered (Kbytes) Overheads (Kbytes) Queuing Time (ms) Medium Access Time (ms) Dropped frames Frame errors Checksum errors Mean Delay (ms) Average attempts Simulation time (ms) Throughput (Kbps) Goodput (Kbps) Data frames generated Frame Transmission Probability (%) Collision count Defer count

0.0.0.1 0.0.0.2 36.777 2.81 5465.4 9109 0 0 0 253.03 1 9109 32.3757 32.2995 36 100 0 0

Procedure: 1. Connect two PCs using RJ-45 cable and run Simulator software in both the computers. 2. Select LAN Topologies and click Ethernet icon. 3. Select the input parameters as follows: i. Number of Nodes :3 ii. Frame Interval : 250ms iii. Error Generation : 0.00000001 iv. Frame Size : 1500Bytes v. Maximum Back off : 8 4. Click Apply. Then Assign IP address for each node. 5. Select the source node, file to transfer and destination IP address. 6. Click Send button to start file transfer. 7. Click Result button to show the various Result Criterion. 8. Click Store button to store the results in <DIR>:\Simulator Directory 9. In the Ethernet Directory Sender node directory, Performance statistics and Time vs. Frame graph can be found and in the Destination node directory the sent file can be found.

Result:

Expt. No.: Date:

STUDY AND IMPLEMENTATION OF TOKEN BUS PROTOCOL

Aim:

Theory: Token bus is a network implementing the token ring protocol over a "virtual ring" on a coaxial cable. A token is passed around the network nodes and only the node possessing the token may transmit. If a node doesn't have anything to send, the token is passed on to the next node on the virtual ring. Each node must know the address of its neighbour in the ring, so a special protocol is needed to notify the other nodes of connections to, and disconnections from, the ring. Token bus was standardized by IEEE standard 802.4. It is mainly used for industrial applications. Token bus was used by GM (General Motors) for their Manufacturing Automation Protocol (MAP) standardization effort. This is an application of the concepts used in token ring networks. The main difference is that the endpoints of the bus do not meet to form a physical ring. The IEEE 802.4 Working Group is disbanded. In order to guarantee the packet delay and transmission in Token bus protocol, a modified Token bus was proposed in Manufacturing Automation Systems and flexible manufacturing system (FMS).

Time vs. Frame:

Time Vs Frame Transferred


40 35 30 25 20 15 10 5 0 00:00

00:09

00:17

00:26

00:35 Frame

00:43

00:52

01:00

Output:

Source node IP address Destination node IP address Payload delivered (Kbytes) Overheads (Kbytes) Queuing Time (ms) Frame errors Checksum errors Mean Delay (ms) Simulation time (ms) Throughput (Kbps) Goodput (Kbps) Data frames generated Frame Transmission Probability (%) Token count

0.0.0.1 0.0.0.2 36.777 2.59 37641.1 0 0 1493.69 53773 5.5417 5.4714 36 33.96 106

Procedure:

1. Connect two PCs using RJ-45 cable and run Simulator software in both the computers. 2. Select LAN Topologies and click Token Bus icon. 3. Select the input parameters as follows: i. Number of Nodes :3 ii. Error Generation : 0.00000001 iii. Frame Size : 2048Bytes 4. Click Apply. Then Assign IP address for each node. 5. Click Submit for File Transfer. 6. Select the source node, file to transfer and destination IP address. 7. Click C button after each node in Preset Values column to connect it in the bus. 8. Click Send button to start file transfer. 9. Click Result button to show the various Result Criterion. 10. Click G button to store the results in <DIR>:\Simulator Directory. 11. In the Token_Bus Directory Sender node directory, Performance statistics and Time vs. Frame graph can be found and in the Destination node directory the sent file can be found.

Result:

Expt. No.: Date:

STUDY AND IMPLEMENTATION OF TOKEN RING PROTOCOL

Aim:

Theory: Token ringlocal area network (LAN) technology is a local area network protocol which resides at the data link layer (DLL) of the OSI model. It uses a special threebyte frame called a token that travels around the ring. Token-possession grants the possessor permission to transmit on the medium. Token ring frames travel completely around the loop. Token Ring comes in standard 4 and 16 Mbsp and high-speed Token Ring at 100Mbps(IEEE 802.5t) and 1Gbps (IEEE 802.5v). Many mainframes (and until recently, ALL IBM mainframes) used a Front End Processor (FEP) with either a Line Interface Coupler (LIC) at 56kbps, or a Token-ring Interface Coupler (TIC) at 16 Mbps. Cisco still produces FEP cards for their routers (as of 2004). Token Ring uses a ring based topology and passes a token around the network to control access to the network wiring. This token passing scheme makes conflicts in accessing the wire unlikely and therefore total throughput is as high as typical Ethernet and Fast Ethernet networks. The Token Ring protocol also provides features for allowing delaysensitive traffic, to share the network with other data, which is key to a mainframe's operation. This feature is not available in any other LAN protocol, except Asynchronous Transfer Mode (ATM). Token Ring does come with a higher price tag because token ring hardware is more complex and more expensive to manufacture. As a network technology, token ring is passing out of use because it has a maximum speed of 16 Mbps which is slow by today's gigabit Ethernet standards.

Time vs. Frame:

Time Vs Frame Transferred


40 35 30 25 20 15 10 5 0 00:00

00:04

00:09 Frame

00:13

00:17

00:22

Output:

Source node IP address Destination node IP address Payload delivered (Kbytes) Overheads (Kbytes) Frame errors Checksum errors Simulation time (ms) Throughput (Kbps) Goodput (Kbps) Data frames generated Frame Transmission Probability (%) Token count

0.0.0.1 0.0.0.2 36.777 2.808 2 0 19625 15.0681 14.9919 36 47.37 76

Procedure:

1. Connect two PCs using RJ-45 cable and run Simulator software in both the computers. 2. Select LAN Topologies and click Token Ring icon. 3. Select the input parameters as follows: i. Number of Nodes :3 ii. Error Generation : 0.00000001 iii. Frame Size : 2048Bytes 4. Click Apply. Then Assign IP address for each node. 5. Click Submit for File Transfer. 6. Select the source node, file to transfer and destination IP address. 7. Click C button after each node in Preset Values column to connect it in the bus. 8. Click Send button to start file transfer. 9. Click Result button to show the various Result Criterion. 10. Click G button to store the results in <DIR>:\Simulator Directory. 11. In the Token_Ring Directory Sender node directory, Performance statistics and Time vs. Frame graph can be found and in the Destination node directory the sent file can be found.

Result:

Access Point

Expt. No.: Date:

IMPLEMENTATION AND STUDY OF WIRELESS LAN PROTOCOL

Aim:

Theory: A wireless local area network (WLAN) links two or more devices using some wireless distribution method (typically spread-spectrum or OFDM radio), and usually providing a connection through an access point to the wider internet. This gives users the mobility to move around within a local coverage area and still be connected to the network. Wireless LANs have become popular in the home due to ease of installation, and the increasing popularity of laptop computers. Public businesses such as coffee shops and malls have begun to offer wireless access to their customers; often for free. Large wireless network projects are being put up in many major cities: New York City, for instance, has begun a pilot program to provide city workers in all five boroughs of the city with wireless Internet access. Architecture

Stations
All components that can connect into a wireless medium in a network are referred to as stations.All stations are equipped with wireless network interface cards (WNICs).Wireless stations fall into one of two categories: access points, and clients. Access points (APs), normally routers, are base stations for the wireless network. They transmit and receive radio frequencies for wireless enabled devices to communicate with. Wireless clients can be mobile devices such as laptops, personal digital assistants, IP phones and other smartphones, or fixed devices such as desktops and workstations that are equipped with a wireless network interface.

Basic service set


The basic service set (BSS) is a set of all stations that can communicate with each other.There are two types of BSS: Independent BSS (also referred to as IBSS), and infrastructure BSS.Every BSS has an identification (ID) called the BSSID, which is the MAC address of the access point servicing the BSS.An independent BSS (IBSS) is an ad-hoc network that contains no access points, which means they cannot connect to any other basic service set.An infrastructure can communicate with other stations not in the same basic service set by communicating through access points.

Time vs. Frame:

Time Vs Frame Transferred


40 35 30 25 20 15 10 5 0 00:00

00:04

00:09

00:13

00:17

00:22 Frame

00:26

00:30

00:35

00:39

00:43

Output: Source node IP address Destination node IP address Payload delivered (Kbytes) Overheads (Kbytes) Dropped frames Frame errors Checksum errors Simulation time (ms) Throughput (Kbps) Goodput (Kbps) Data frames generated Frame Transmission Probability (%) Collision count Defer count 0.0.0.1 0.0.0.2 36.777 2.736 0 1 0 52074 5.7242 5.65 36 57.14285714 27 125

Extended service set

An extended service set (ESS) is a set of connected BSSes. Access points in an ESS are connected by a distribution system. Each ESS has an ID called the SSID which is a 32-byte (maximum) character string.

Distribution system
A distribution system (DS) connects access points in an extended service set. The concept of a DS can be used to increase network coverage through roaming between cells.DS can be wired or wireless. Current wireless distribution systems are mostly based on WDS or MESH protocols, though other systems are in use.

Procedure: 1. Connect two PCs using Wireless Router and run Simulator software in both the computers. 2. Select LAN Topologies and click Wireless icon. 3. Select the input parameters as follows: i. Number of Nodes :3 ii. Frame Interval : 250ms iii. Frame Size : 1500Bytes iv. Maximum Back off : 8 v. Error Generation : 0.00000001 4. Click Apply. Then Assign IP address for each node. 5. Click Submit for File Transfer. 6. Select the source node, file to transfer and destination IP address. 7. Click Send button to start file transfer. 8. Click Result button to show the various Result Criterion. 9. Click G button to store the results in <DIR>:\Simulator Directory. 10. In the Wireless Directory Sender node directory, Performance statistics and Time vs. Frame graph can be found and in the Destination node directory the sent file can be found.

Result:

Expt. No.:

IMPLEMENTATION AND STUDY OF STOP & WAIT PROTOCOL


Date:

Aim:

Theory: Stop-and-wait ARQ is a method used in telecommunications to send information between two connected devices. It ensures that information is not lost due to dropped packets and that packets are received in the correct order. It is the simplest kind of automatic repeat-request (ARQ) method. A stop-and-wait ARQ sender sends one frame at a time; it is a special case of the general sliding window protocol with both transmit and receive window sizes equal to 1. After sending each frame, the sender doesn't send any further frames until it receives an acknowledgement (ACK) signal. After receiving a good frame, the receiver sends an ACK. If the ACK does not reach the sender before a certain time, known as the timeout, the sender sends the same frame again. The above behavior is the simplest Stop-and-Wait implementation. However, in a real life implementation there are problems to be addressed. Typically the transmitter adds a redundancy check number to the end of each frame. The receiver uses the redundancy check number to check for possible damage. If the receiver sees that the frame is good, it sends an ACK. If the receiver sees that the frame is damaged, the receiver discards it and does not send an ACK -- pretending that the frame was completely lost, not merely damaged. One problem is where the ACK sent by the receiver is damaged or lost. In this case, the sender doesn't receive the ACK, times out, and sends the frame again. Now the receiver has two copies of the same frame, and doesn't know if the second one is a duplicate frame or the next frame of the sequence carrying identical data. Another problem is when the transmission medium has such a long latency that the sender's timeout runs out before the frame reaches the receiver. In this case the sender resends the same packet. Eventually the receiver gets two copies of the same frame, and sends an ACK for each one. The sender, waiting for a single ACK, receives two ACKs, which may cause problems if it assumes that the second ACK is for the next frame in the sequence.

Time vs. Frame:

Time Vs Frame Transferred at 2048 Kbytes


20 18 16 14 12 10 8 6 4 2 0 00:00 00:04 00:09 Frame 00:13 00:17 00:22

Output: Payload delivered (Kbytes) Transfer time (ms) Throughput (Kbps) Losses 36.777 1998.4 147.2258 2

To avoid these problems, the most common solution is to define a 1 bit sequence number in the header of the frame. This sequence number alternates (from 0 to 1) in subsequent frames. When the receiver sends an ACK, it includes the sequence number of the next packet it expects. This way, the receiver can detect duplicated frames by checking if the frame sequence numbers alternate. If two subsequent frames have the same sequence number, they are duplicates, and the second frame is discarded. Similarly, if two subsequent ACKs reference the same sequence number, they are acknowledging the same frame. Stop-and-wait ARQ is inefficient compared to other ARQs, because the time between packets, if the ACK and the data are received successfully, is twice the transit time (assuming the turnaround time can be zero). The throughput on the channel is a fraction of what it could be. To solve this problem, one can send more than one packet at a time with a larger sequence number and use one ACK for a set. This is what is done in Go-Back-N ARQ and the Selective Repeat ARQ.
Procedure: 1. Select Data Transfer Protocols from the Simulator window and Click on Stop and Wait icon. 2. Select the input parameters as follows: a. Packet Size b. Loss Rate c. RTT d. Retransmit Timeout : 2048 Bytes : 10% : 50ms : 100 ms

3. Click Submit button to apply the data. 4. Select the Source file and click Start button to start Data Transfer. 5. Click Store button under both Receiver and Sender to store the Output statistics data. 6. Stats can be viewed under Results column in Simulator window itself or you can find them in <Drive>:\Simulator\Stop_And_Wait Directory.

Result:

Expt. No.: Date:

IMPLEMENTATION AND STUDY OF GO BACK N PROTOCOL

Aim:

Theory: Go-Back-N ARQ is a specific instance of the automatic repeat request (ARQ) protocol, in which the sending process continues to send a number of frames specified by a window size even without receiving an acknowledgement (ACK) packet from the receiver. It is a special case of the general sliding window protocol with the transmit window size of N and receive window size of 1. The receiver process keeps track of the sequence number of the next frame it expects to receive, and sends that number with every ACK it sends. The receiver will ignore any frame that does not have the exact sequence number it expects whether that frame is a "past" duplicate of a frame it has already ACK'ed[1] or whether that frame is a "future" frame past the last packet it is waiting for. Once the sender has sent all of the frames in its window, it will detect that all of the frames since the first lost frame are outstanding, and will go back to sequence number of the last ACK it received from the receiver process and fill its window starting with that frame and continue the process over again. Go-Back-N ARQ is a more efficient use of a connection than Stop-and-wait ARQ, since unlike waiting for an acknowledgement for each packet, the connection is still being utilized as packets are being sent. In other words, during the time that would otherwise be spent waiting, more packets are being sent. However, this method also results in sending frames multiple times if any frame was lost or damaged, or the ACK acknowledging them was lost or damaged, then that frame and all following frames in the window (even if they were received without error) will be re-sent. To avoid this, Selective Repeat ARQ can be used.

Time vs. Frame:

Time Vs Frame Transferred


20 18 16 14 12 10 8 6 4 2 0 00:00 00:04 00:09 Frame 00:13 00:17 00:22

Output: Payload delivered (Kbytes) Transfer time (ms) Throughput (Kbps) Losses 36.777 1892.3 155.4806 66

Procedure:

1. Select Data Transfer Protocols from the Simulator window and Click on GoBack-N icon. 2. Select the input parameters in Menu bar as follows: a. Packet Size b. Bandwidth c. RTT d. Packet Loss Rate e. Window Size f. Retransmit Timeout : 2048 Bytes : 1000kbps : 50ms : 10% : 5 Packets : 100 ms

3. Select the Source file and click Start button to start Data Transfer. 4. Click Store button under both Receiver and Sender to store the Output statistics data. 5. Stats can be viewed under Results column in Simulator window itself or you can find them in <Drive>:\Simulator\Go_Back_n Directory.

Result:

Expt. No.: Date:

IMPLEMENTATION AND STUDY OF SELECTIVE REPEATPROTOCOL

Aim:

Theory: Selective Repeat ARQ / Selective Reject ARQis a specific instance of the Automatic Repeat-reQuest (ARQ) Protocol. It may be used as a protocol for the delivery and acknowledgement of message units, or it may be used as a protocol for the delivery of subdivided message sub-units. When used as the protocol for the delivery of messages, the sending process continues to send a number of frames specified by a window size even after a frame loss. Unlike Go-Back-N ARQ, the receiving process will continue to accept and acknowledge frames sent after an initial error; this is the general case of the sliding window protocol with both transmit and receive window sizes greater than 1. The receiver process keeps track of the sequence number of the earliest frame it has not received, and sends that number with every acknowledgement (ACK) it sends. If a frame from the sender does not reach the receiver, the sender continues to send subsequent frames until it has emptied its window. The receiver continues to fill its receiving window with the subsequent frames, replying each time with an ACK containing the sequence number of the earliest missing frame. Once the sender has sent all the frames in its window, it resends the frame number given by the ACKs, and then continues where it left off. The size of the sending and receiving windows must be equal, and half the maximum sequence number (assuming that sequence numbers are numbered from 0 to n1) to avoid miscommunication in all cases of packets being dropped. To understand this, consider the case when all ACKs are destroyed. If the receiving window is larger than half the maximum sequence number, some, possibly even all, of the packages that are resent after timeouts are duplicates that are not recognized as such. The sender moves its window for every packet that is acknowledged.[1] When used as the protocol for the delivery of subdivided messages it works somewhat differently. In non-continuous channels where messages may be variable in length, standard ARQ or Hybrid ARQ protocols may treat the message as a single unit. Alternately selective retransmission may be employed in conjunction with the basic ARQ mechanism where the message is first subdivided into sub-blocks (typically of fixed length) in a process called packet segmentation. The original variable length message is thus represented as a concatenation of a variable number of sub-blocks.

Time vs. Frame:

Time Vs Frame Transferred


20 18 16 14 12 10 8 6 4 2 0 00:00 00:04 00:09 Frame 00:13 00:17

Output: Payload delivered (Kbytes) Transfer time (ms) Throughput (Kbps) Losses 36.777 1790.8 164.2931 62

While in standard ARQ the message as a whole is either acknowledged (ACKed) or negatively acknowledged (NAKed), in ARQ with selective transmission the NAKed response would additionally carry a bit flag indicating the identity of each sub-block successfully received. In ARQ with selective retransmission of sub-divided messages each retransmission diminishes in length, needing to only contain the sub-blocks that were NAKed. In most channel models with variable length messages, the probability of error-free reception diminishes in inverse proportion with increasing message length. In other words it's easier to receive a short message than a longer message. Therefore standard ARQ techniques involving variable length messages have increased difficulty delivering longer messages, as each repeat is the full length. Selective retransmission applied to variable length messages completely eliminates the difficulty in delivering longer messages, as successfully delivered sub-blocks are retained after each transmission, and the number of outstanding subblocks in following transmissions diminishes.

Procedure: 1. Select Data Transfer Protocols from the Simulator window and Click on Selective Repeat icon. 2. Select the input parameters in Menu bar as follows: a. Packet Size : 2048 Bytes b. Bandwidth : 1000kbps c. RTT : 50ms d. Packet Loss Rate : 10% e. Window Size : 5 Packets f. Retransmit Timeout : 100 ms 3. Select the Source file and click Start button to start Data Transfer. 4. Click Store button under both Receiver and Sender to store the Output statistics data. 5. Stats can be viewed under Results column in Simulator window itself or you can find them in <Drive>:\Simulator\Selective_Repeat Directory.

Result:

Expt. No.: Date:

STYDY OF DATA ENCRYPTION AND DECRYPTION

Aim:

Theory: A security protocol (cryptographic protocol or encryption protocol) is an abstract or concrete protocol that performs a security-related function and applies cryptographic methods. A protocol describes how the algorithms should be used. A sufficiently detailed protocol includes details about data structures and representations, at which point it can be used to implement multiple, interoperable versions of a program. Cryptographic protocols are widely used for secure application-level data transport. A cryptographic protocol usually incorporates at least some of these aspects:

Key agreement or establishment Entity authentication Symmetric encryption and message authentication material construction Secured application-level data transport Non-repudiation methods

The RSA algorithm involves three steps: key generation, encryption and decryption. Key generation RSA involves a public key and a private key. The public key can be known to everyone and is used for encrypting messages. Messages encrypted with the public key can only be decrypted using the private key. The keys for the RSA algorithm are generated the following way: 1. Choose two distinct prime numbersp and q. o For security purposes, the integersp and q should be chosen at random, and should be of similar bit-length. Prime integers can be efficiently found using a primarily test. 2. Compute n = pq. o n is used as the modulus for both the public and private keys 3. Compute (n) = (p1)(q1), where is Euler's totient function. 4. Choose an integer e such that 1 <e<(n) and gcd(e,(n)) = 1, i.e. e and (n) are co-prime.

Output (RSA Algorithm): p = 97 q=7 n = pq = 679 s = (p-1)*(q-1) = 576 d=5 e = 461 AsciiValues : m = 97 m = 98 m = 99 Encrypted Text : m^d mod n = 97^5 mod 679 = 97 m^d mod n = 98^5 mod 679 = 98 m^d mod n = 99^5 mod 679 = 323

e is released as the public key exponent. e having a short bit-length and small Hamming weight results in more efficient encryption - most commonly 0x10001 = 65537. However, small values of e (such as 3) have been shown to be less secure in some settings.[4] 5. Determine d = e1 mod (n); i.e. d is the multiplicative inverse of e mod (n). o This is often computed using the extended Euclidean algorithm. o d is kept as the private key exponent. The public key consists of the modulus n and the public (or encryption) exponent e. The private key consists of the private (or decryption) exponent d which must be kept secret. Notes:

o o

An alternative, used by PKCS#1, is to choose d matching de 1 mod with = lcm(p1,q1), where lcm is the least common multiple. Using instead of (n) allows more choices for d. can also be defined using the Carmichael function, (n). The ANSI X9.31 standard prescribes, IEEE 1363 describes, and PKCS#1 allows, that p and q match additional requirements: be strong primes, and be different enough that Fermat factorization fails.

Encryption Alice transmits her public key (n,e) to Bob and keeps the private key secret. Bob then wishes to send message M to Alice. He first turns M into an integer 0 <m<n by using an agreed-upon reversible protocol known as a padding scheme. He then computes the ciphertextc corresponding to c = me(mod n). This can be done quickly using the method of exponentiation by squaring. Bob then transmits c to Alice. Decryption Alice can recover m from c by using her private key exponent d via computing m = cd(mod n). Given m, she can recover the original message M by reversing the padding scheme. (In practice, there are more efficient methods of calculating cd using the pre computed values below.)

A worked example Here is an example of RSA encryption and decryption. The parameters used here are artificially small, but one can also use Open SSL to generate and examine a real key pair. 1. Choose two distinct prime numbers, such as p = 61 and q = 53. 2. Compute n = pq giving n = 61 53 = 3233. 3. Compute the totient of the product as (n) = (p 1)(q 1) giving (3233) = (61 1)(53 1) = 3120. 4. Choose any number 1 <e< 3120 that is co-prime to 3120. Choosing a prime number for e leaves us only to check that e is not a divisor of 3120. Let e = 17. 5. Compute d, the modular multiplicative inverse of e(mod (n)) yielding d = 2753. The public key is (n = 3233, e = 17). For a padded plaintext message m, the encryption function is m17(mod 3233). The private key is (n = 3233, d = 2753). For an encrypted texts, the decryption function is c2753(mod 3233). For instance, in order to encrypt m = 65, we calculate c = 6517(mod 3233) = 2790. To decrypt c = 2790, we calculate m = 27902753(mod 3233) = 65. Both of these calculations can be computed efficiently using the square-andmultiply algorithm for modular exponentiation. In real life situations the primes selected would be much larger; in our example it would be relatively trivial to factor n, 3233, obtained from the freely available public key back to the primes p and q. Given e, also from the public key, we could then compute d and so acquire the private key.

Procedure: 1. Open simulator window and select Encryption and Decryption. 2. Select either one of the Encryption techniques. a. Shifting Algorithm b. RSA Algorithm For shifting algorithm: 3. Input text, select Shifting index (1 to 5). 4. Press Shift button to see Encrypted text. 5. Press Re-shift to see Decrypted original text. For RSA algorithm: 6. Give the input text. 7. Click Next button to Generate RSA algorithm based encryption. 8. Finally the text will be Encrypted and stored in Desktop. 9. Select Decrypt menu and click Decrypt to get back the input text.

Result:

Expt. No.: Date:

IMPLEMENTATION OF LINK STATE ROUTING ALGORITHM

Aim:

Theory: A router is a device that forwards data packets across computer networks. Routers perform the data "traffic direction" functions on the Internet. A router is a microprocessor-controlled device that is connected to two or more data lines from different networks. When a data packet comes in on one of the lines, the router reads the address information in the packet to determine its ultimate destination. Then, using information in its routing table, it directs the packet to the next network on its journey. A data packet is typically passed from router to router through the networks of the Internet until it gets to its destination computer. Routers also perform other tasks such as translating the data transmission protocol of the packet to the appropriate protocol of the next network. LINK-STATE ROUTING A link-state routing protocol is one of the two main classes of routing protocols used in packet switching networks for computer communications, the other major class is the distance-vector routing protocol. Examples of link-state routing protocols include OSPF and IS-IS. The link-state protocol is performed by every switching node in the network (i.e. nodes that are prepared to forward packets; in the Internet, these are called routers). The basic concept of link-state routing is that every node constructs a map of the connectivity to the network, in the form of a graph, showing which nodes are connected to which other nodes. Each node then independently calculates the next best logical path from it to every possible destination in the network. The collection of best paths will then form the node's routing table. This contrasts with distance-vector routing protocols, which works by having each node share its routing table with its neighbors. In a link-state protocol the only information passed between nodes is connectivity related.

Output: For 3 Routers with the distance as follows: AB: 2 BC: 3 CA: 4 Selected Source Node: A Iteration : 1 Nodes in Group P Node: A Distance : 0 Predecessor : A Nodes in Group T Node: B Distance : 2 Predecessor : A Node: C Distance : 4 Predecessor : A All nodes have been considered Iteration : 2 Nodes in Group P Node: A Distance : 0 Predecessor : A Node: B Distance : 2 Predecessor : A Nodes in Group T Node: C Distance : 4 Predecessor : A All nodes have been considered Iteration : 3 Nodes in Group P Node: A Distance : 0 Predecessor : A Node: B Distance : 2 Predecessor : A Node: C Distance : 4 Predecessor : A Nodes in Group T All nodes have been considered

Calculating the shortest paths: Each node independently runs an algorithm over the map to determine the shortest path from itself to every other node in the network; generally some variant of Dijkstra's algorithm is used. This is based around a link cost across each path which includes available bandwidth among other things. Basically, a node maintains two data structures: a tree containing nodes which are "done", and a list of candidates. The algorithm starts with both structures empty; it then adds to the first one the node itself. The algorithm then repetitively does the following:

All nodes which are connected to the node just added to the tree (excepting any nodes which are already in either the tree or the candidate list) are added to the second (candidate) list. Each node in the candidate list is compared to each of the nodes already in the tree. The candidate node which is closest to any of the nodes already in the tree is itself moved into the tree and attached to the appropriate neighbor node. When a node is moved from the candidate list into the tree, it is removed from the candidate list and is not considered in subsequent iterations of the algorithm.

The above two steps are repeated as long as there aren't any nodes left in the candidate list. (When there are none, all the nodes in the network will have been added to the tree.) This procedure ends with the tree containing all the nodes in the network, with the node on which the algorithm is running as the root of the tree. The shortest path from that node to any other node is indicated by the list of nodes one traverses to get from the root of the tree, to the desired node in the tree.
Procedure: 1. Run the Network Simulator software, Select Routing Protocols and click Link State Algorithm icon. 2. Select the number of Routers and specify the distance between them. 3. Click Submit button. 4. Select any source node (Router) and then click Next button until the Simulator iteration completes computing the least cost paths. 5. We can view the results in the Side window space or in <Drive>:\Simulator\Link_State\Results.txt

Result:

Expt. No.: Date:

IMPLEMENTATION OF DISTANCE VECTOR ROUTINGALGORITHM

Aim:

Theory: In computer communication theory relating to packet-switched networks, a distancevector routing protocol is one of the two major classes of routing protocols, the other major class being the link-state protocol. A distance-vector routing protocol uses the Bellman-Ford algorithm to calculate paths. A distance-vector routing protocol requires that a router informs its neighbors of topology changes periodically and, in some cases, when a change is detected in the topology of a network. Compared to link-state protocols, which require a router to inform all the nodes in a network of topology changes, distance-vector routing protocols have less computational complexity and message overhead.[citation needed] Distance Vector means that Routers are advertised as vector of distance and direction. 'Direction' is represented by next hop address and exit interface, whereas 'Distance' uses metrics such as hop count. Routers using distance vector protocol do not have knowledge of the entire path to a destination. Instead DV uses two methods: 1. Direction in which or interface to which a packet should be forwarded. 2. Distance from its destination. Examples of distance-vector routing protocols include Routing Information Protocol Version 1 & 2, RIPv1 and RIPv2 and IGRP. EGP and BGP are not pure distancevector routing protocols because a distance-vector protocol calculates routes based only on link costs whereas in BGP, for example, the local route preference value takes priority over the link cost. The methods used to calculate the best path for a network are different between different routing protocols but the fundamental features of distance-vector algorithms are the same across all DV based protocols. Distance Vector means that Routers are advertised as vector of distance and Direction. Direction is simply next hop address and exit interface and Distance means such as hop count.

Output: For 3 Routers with the distance as follows: AB: 2 BC: 3 CA: 4 Routing Information for selected node: A

Iteration : 1 --------------------------------------From Neighbor B To A: 2 To B: 0 To C: 3 --------------------------------------From Neighbor C To A: 4 To B: 3 To C: 0 --------------------------------------Routing Table To B : 2 Next Hop : B To C : 4 Next Hop : C

Iteration : 2 --------------------------------------From Neighbor B To A: 2 To B: 0 To C: 3 --------------------------------------From Neighbor C To A: 4 To B: 3 To C: 0 --------------------------------------Routing Table To B : 2 Next Hop : B To C : 4 Next Hop : C

Routers using distance vector protocol do not have knowledge of the entire path to a destination. Instead DV uses two methods: 1. Direction in which or interface to which a packet should be forwarded. 2. Distance from its destination. As the name suggests the DV protocol is based on calculating the direction and distance to any link in a network. The cost of reaching a destination is calculated using various route metrics. RIP uses the hop count of the destination whereas IGRP takes into account other information such as node delay and available bandwidth. Updates are performed periodically in a distance-vector protocol where all or part of a router's routing table is sent to all its neighbors that are configured to use the same distance-vector routing protocol. RIP supports cross-platform distance vector routing whereas IGRP is a Cisco Systems proprietary distance vector routing protocol. Once a router has this information it is able to amend its own routing table to reflect the changes and then inform its neighbors of the changes. This process has been described as routing by rumor because routers are relying on the information they receive from other routers and cannot determine if the information is actually valid and true. There are a number of features which can be used to help with instability and inaccurate routing information.
Procedure: 1. Run the Network Simulator software, Select Routing Protocols and click Link State Algorithm icon. 2. Select the number of Routers and specify the distance between them. 3. Click Submit button. 4. Select any source node (Router) and then click Next button until the Simulator iteration completes computing the least cost paths. 5. We can view the results in the Side window space or in <Drive>:\Simulator\Distance_Vector\Results.txt

Result:

SOCKET PROCESSING - HTTP

Expt. No.: Date:

Aim:

Theory:

Procedure:

1. Run the Network Simulator software, Select Network Sockets and click Web: HTTP icon. 2. Set Client IP address and Server as desired. 3. Click Activate the Server button. 4. Then the Server will be listening at port 80. 5. Set the Target Server IP address as same as the above Server IP address and click Connect. 6. Click Go button, so that the Client and Server interact using HTTP protocol and displays the predefined Web page located in C:\Simulator\Index.html

Result:

SOCKET PROCESSING - FTP

Expt. No.: Date:

Aim:

Theory:

Procedure:

1. Run the Network Simulator software, Select Network Sockets and click FTP icon. 2. Set Client IP address and Server as desired. 3. Click Activate the Server button. 4. Then the Server will be listening at port 21. 5. Set the Target Server IP address as same as the above Server IP address and click Connect. 6. Click Go button, so that the Client and Server interact using FTP protocol and displays the contents of File stored in C:\Simulator\Index.txt

Result:

SOCKET PROCESSING - SMTP

Expt. No.: Date:

Aim:

Theory:

Output:

Procedure:

1. Run the Network Simulator software, Select Network Sockets and click E-mail: SMTP icon. 2. Set Client IP address and Server as desired. 3. Click Activate the Server button. 4. Then the SMTP, POP Server will be listening at port 25, 110 respectively. 5. Set the Target Server IP address as same as the above Server IP address and click Connect. 6. Type the desired text in the field provided and click Go button to send the mail. 7. The mail will be sent to the Mail Server and then redirected to the receiver. 8. Simulator will show Mail sent Notification, Click Ok to proceed. 9. Click Check mail on remote receiver section in Simulator window. 10. Then the sent mail can be seen in Receiver window side.

Result:

You might also like