Вы находитесь на странице: 1из 47

Ex no: 1 Objective

STUDY OF WIRELESS NETWORKS

To study about the wireless network concepts, various wireless standards, wireless adapters and various wireless network technologies.

Description
1. WIRLESS COMMUNICATION
Wireless communication is the transfer of information over a distance without the use of electrical conductors or "wires" The distances involved may be short (a few meters as in television remote control) or very long (thousands or even millions of kilometers for radio communications). When the context is clear the term is often simply shortened to "wireless". Wireless communication is generally considered to be a branch of telecommunications. It encompasses various types of fixed, mobile, and portable two way radios, cellular telephones, personal digital assistants (PDAs), and wireless networking. Other examples of wireless technology include GPS units, garage door openers and or garage doors, wireless computer mice, keyboards and headsets, satellite television and cordless telephones. 2. WIRELESS NETWORK TYPES Wireless Local Area Networks (WLAN) WLAN are implemented as an extension to wired LANs within a building and can provide the final few meters of connectivity between a wired network and the mobile user. WLANs are based on the IEEE 802.11 standard. There are three physical layers for WLANs: two radio frequency specifications (RF - direct sequence and frequency hopping spread spectrum) and one infrared (IR). Most WLANs operate in the 2.4 GHz license-free frequency band and have throughput rates up to 2 Mbps. The new 802.11b standard is direct sequence only, and provides throughput rates up to 11 Mbps. Currently the predominant standard, it is widely supported by vendors such as Cisco, Lucent, Apple, etc. By the middle of 2002, a new standard, 802.11a, will
1

operate in the 5 GHz license-free frequency band and is expected to provide throughput rates up to 54 Mbps. WLAN configurations vary from simple, independent, peer-to-peer connections between a set of PCs, to more complex, intra-building infrastructure networks. There are also point-to-point and point-to-multipoint wireless solutions. A point-to-point solution is used to bridge between two local area networks, and to provide an alternative to cable between two geographically distant locations (up to 30 miles). Point-to-multi-point solutions connect several, separate locations to one single location or building. Both point-to-point and point-to-multipoint can be based on the 802.11b standard or on more costly infrared-based solutions that can provide throughput rates up to 622 Mbps (OC-12 speed). In a typical WLAN infrastructure configuration, there are two basic components: 1. Access Points - An access point/base station connects to a LAN by means of Ethernet cable. Usually installed in the ceiling, access points receive, buffer, and transmit data between the WLAN and the wired network infrastructure. A single access point supports on average twenty users and has a coverage varying from 20 meters in areas with obstacles (walls, stairways, elevators) and up to 100 meters in areas with clear line of sight. A building may require several access points to provide complete coverage and allow users to roam seamlessly between access points. 2. Wireless Client Adapter - A wireless adapter connects users via an access point to the rest of the LAN. A wireless adapter can be a PC card in a laptop, an ISA or PCI adapter in a desktop computer, or can be fully integrated within a handheld device. Wireless Wide Area Networks (WWAN) A WWAN differs from WLAN (wireless LAN) in that it uses Mobile telecommunication cellular network technologies such as WIMAX (though it's better applied to WMAN Networks), UMTS, GPRS, CDMA2000, GSM, CDPD, HSDPA or 3G to transfer data. It can also use LMDS and WiFi to connect to the Internet. These cellular technologies are offered regionally, nationwide, or even globally and are provided by a wireless service provider, typically on paid basis.WWAN
2

connectivity allows a user with a laptop and a WWAN card to surf the web, check email, or connect to a Virtual Private Network (VPN) from anywhere within the regional boundaries of cellular service. Various computers now have integrated WWAN capabilities. This means that the system has a cellular radio (GSM/CDMA) built in, which allows the user to send and receive data. Since radio communications systems do not provide a physically secure connection path, WWANs typically incorporate encryption and authentication methods to make them more secure. Unfortunately some of the early GSM encryption techniques were flawed, and security experts have issued warnings that cellular communication, including WWANs, is no longer secure. UMTS (3G) encryption was developed later and has yet to be broken.

3. WIRELESS IEEE STANDARDS


Home and business networkers looking to buy wireless local area network (WLAN) gear face an array of choices. Many products conform to the 802.11a, 802.11b, 802.11g, or 802.11n wireless standards collectively known as Wi-Fi technologies. Additionally, Bluetooth and various other non Wi-Fi technologies also exist, each also designed for specific networking applications.

802.11
In 1997, the Institute of Electrical and Electronics Engineers (IEEE) created the first WLAN standard. They called it 802.11 after the name of the group formed to oversee its development. Unfortunately, 802.11 only supported a maximum network bandwidth of 2 Mbps - too slow for most applications. For this reason, ordinary 802.11 wireless products are no longer manufactured.

802.11b
3

IEEE expanded on the original 802.11 standard in July 1999, creating the 802.11b specification. 802.11b supports bandwidth up to 11 Mbps, comparable to traditional Ethernet. 802.11b uses the same unregulated radio signaling frequency (2.4 GHz) as the original 802.11 standard. Vendors often prefer using these frequencies to lower their production costs. Being unregulated, 802.11b gear can incur interference from microwave ovens, cordless phones, and other appliances using the same 2.4 GHz range. However, by installing 802.11b gear a reasonable distance from other appliances, interference can easily be avoided.

802.11a
While 802.11b was in development, IEEE created a second extension to the original 802.11 standard called 802.11a. Because 802.11b gained in popularity much faster than did 802.11a, some folks believe that 802.11a was created after 802.11b. In fact, 802.11a was created at the same time. Due to its higher cost, 802.11a is usually found on business networks whereas 802.11b better serves the home market. 802.11a supports bandwidth up to 54 Mbps and signals in a regulated frequency spectrum around 5 GHz. This higher frequency compared to 802.11b shortens the range of 802.11a networks. The higher frequency also means 802.11a signals have more difficulty penetrating walls and other obstructions. Because 802.11a and 802.11b utilize different frequencies, the two technologies are incompatible with each other. Some vendors offer hybrid 802.11a/b network gear, but these products merely implement the two standards side by side (each connected devices must use one or the other).

802.11g
In 2002 and 2003, WLAN products supporting a newer standard called 802.11g emerged on the market. 802.11g attempts to combine the best of both 802.11a and 802.11b. 802.11g supports bandwidth up to 54 Mbps, and it uses the 2.4 GHz frequency for greater range. 802.11g is backwards compatible with 802.11b, meaning that 802.11g access points will work with 802.11b wireless network adapters and vice versa.

802.11n
The newest IEEE standard in the Wi-Fi category is 802.11n. It was designed to improve on 802.11g in the amount of bandwidth supported by utilizing multiple wireless signals and antennas (called MIMO technology) instead of one. When this standard is finalized, 802.11n connections should support data rates of over 100 Mbps. 802.11n also offers somewhat better range over earlier Wi-Fi standards due to its increased signal intensity. 802.11n equipment will be backward compatible with 802.11g gear.

4. WIRELESS TECHNOLOGIES
There are different wireless types. They are described here.

1. CDPD
Cellular Digital Packet Data (CDPD) was a wide-area mobile data service which used unused bandwidth normally used by AMPS mobile phones between 800 and 900 MHz to transfer
5

data. Speeds up to 19.2 kbit/s were possible. The service was discontinued in conjunction with the retirement of the parent AMPS service; it has been functionally replaced by faster services such as 1xRTT, EV-DO, and UMTS/HSPA. Developed in the early 1990s, CDPD was large on the horizon as a future technology. However, it had difficulty competing against existing slower but less expensive Mobitex and DataTac systems, and never quite gained widespread acceptance before newer, faster standards such as GPRS became dominant. CDPD had very limited consumer offerings. AT&T Wireless first offered the technology in the United States under the PocketNet brand. It was one of the first consumer offerings of wireless web service. A company named Omnisky provided service for Palm V devices. Cingular Wireless later offered CDPD under the Wireless Internet brand (not to be confused with Wireless Internet Express, their brand for GPRS/EDGE data). PocketNet was generally considered a failure with competition from 2G services such as Sprint's Wireless Web. After the four phones AT&T Wireless had offered to the public (two from Panasonic, one from Mitsubishi and the Ericsson R289LX), AT&T Wireless eventually refused to activate the devices. Despite its limited success as a consumer offering, CDPD was adopted in a number of enterprise and government networks. It was particularly popular as a first-generation wireless data solution for telemetry devices (machine to machine communications) and for public safety mobile data terminals. In 2004, major carriers in the United States announced plans to shut down CDPD service. In July 2005, the AT&T Wireless and Cingular Wireless CDPD networks were shut down. Equipment for this service now has little to no residual value.

2. HSCSD

HSCSD (High Speed Circuit Switched Data) is a specification for data transfer over GSM networks. HSCSD utilizes up to four 9.6Kb or 14.4Kb time slots, for a total bandwidth of 38.4Kb or 57.6Kb. One innovation in HSCSD is to allow different error correction methods to be used for data transfer. The original error correction used in GSM was designed to work at the limits of coverage and in the worst case that GSM will handle. This means that a large part of the GSM transmission capacity is taken up with error correction codes. HSCSD provides different levels of possible error correction which can be used according to the quality of the radio link. This means that in the best conditions 14.4 kbit/s can be put through a single time slot that under CSD would only carry 9.6 kbit/s, for a 50% improvement in throughput. The other innovation in HSCSD is the ability to use multiple time slots at the same time. Using the maximum of four time slots, this can provide an increase in maximum transfer rate of up to 57.6 kbit/s (i.e., 4 14.4 kbit/s) and, even in bad radio conditions where a higher level of error correction needs to be used, can still provide a four times speed increase over CSD (38.4 kbit/s versus 9.6 kbit/s). By combining up to eight GSM time slots the capacity can be increased to 115 kbit/s. HSCSD requires the time slots being used to be fully reserved to a single user. It is possible that either at the beginning of the call, or at some point during a call, it will not be possible for the user's full request to be satisfied since the network is often configured to allow normal voice calls to take precedence over additional time slots for HSCSD users. The user is typically charged for HSCSD at a rate higher than a normal phone call (e.g., by the number of time slots allocated) for the total period of time that the user has a connection active.
7

This makes HSCSD relatively expensive in many GSM networks and is one of the reasons that packet-switched general packet radio service (GPRS), which typically has lower pricing (based on amount of data transferred rather than the duration of the connection), has become more common than HSCSD. Apart from the fact that the full allocated bandwidth of the connection is available to the HSCSD user, HSCSD also has an advantage in GSM systems in terms of lower average radio interface latency than GPRS. This is because the user of an HSCSD connection does not have to wait for permission from the network to send a packet. HSCSD is also an option in enhanced data rates for GSM evolution (EDGE) and universal mobile telephone system (UMTS) systems where packet data transmission rates are much higher. In the UMTS system, the advantages of HSCSD over packet data are even lower since the UMTS radio interface has been specifically designed to support high bandwidth, low latency packet connections. This means that the primary reason to use HSCSD in this environment would be access to legacy dial up systems.

3. PDC-P

PDC-P (Packet Data Cellular) is a packet switching message system utilized by NTT DoCoMo in Japan. PDC-P utilizes up to three 9.6Kb TDMA channels, for a total maximum bandwidth of 28.8Kb.

4. GPRS
8

GPRS (General Packet Radio Service) is a specification for data transfer on TDMA and GSM networks.

5. 1xRTT

CDMA-2000 1xRTT is a 3G wireless technology based on the CDMA platform. The 1x in 1xRTT refers to 1x the number of 1.25MHz channels. The RTT in 1xRTT stands for Radio Transmission Technology.

6. BLUETOOTH

Bluetooth is a specification for short distance wireless communication between two devices.Bluetooth technology is named after Harald Bluetooth, a Danish king who managed to consolidate Denmark and a part of Norway in the 1900s. The choice for the name of this technology is a manifestation of how influential and central the companies from this region are to the telecommunications industry.

7. IrDA

IrDA defines a standard for an interoperable universal two way cordless infrared light transmission data port.

8. MMDS & LMDS

MMDS (Multichannel Multipoint Distribution Service) is a broadband wireless point-to-multipoint specification utilizing UHF (Ultra High Frequency) communications.
9

LMDS and MMDS have adapted the DOCSIS (Data Over Cable Service Interface Specification) from the cable modem world. The version of DOCSIS modified for wireless broadband is known as DOCSIS+.

9. WIMAX

WiMAX stands for Worldwide Interoperability for Microwave Access.WiMAX is a broadband wireless point-to-multipoint specification from the IEEE 802.16 working group.Unlike wireless LAN technologies such as Wi-Fi (802.11), WiMAX is designed to operate as a wireless MAN (Metropolitan Area Network). This places WiMAX in the same class as the earlier 802.16 standards.

10. WI-FI

Wi-Fi (802.11) is a suite of specifications for wireless Ethernet.The 802.11 standards are defined by the IEEE (Institute of Electrical and Electronic Engineers).The most common 802.11 specification, 802.11b, defines twelve channels. These channels utilize overlapping frequencies. Channels one, six, and eleven do not overlap.

5. WIRELESS ROUTING PROTOCOL (WRP)


The Wireless Routing Protocol (WRP) is a proactive unicast routing protocol for mobile ad-hoc networks (MANETs). WRP uses an enhanced version of the distance-vector routing protocol, which uses the Bellman-Ford algorithm to calculate paths. Because of the mobile nature of the nodes within the MANET, the protocol introduces mechanisms which reduce route loops and ensure reliable message exchange.
10

The wireless routing protocol (WRP), similar to DSDV, inherits the properties of the distributed Bellman-Ford algorithm. To counter the count-to-infinity problem and to enable faster convergence, it employs a unique method of maintaining information regarding the shortest distance to every destination node in the network and the penultimate hop node on the path to every destination node. Since WRP, like DSDV, maintains an up-to-date view of the network, every node has a readily available route to every destination node in the network. Pro-active (table-driven) routing This type of protocols maintains fresh lists of destinations and their routes by periodically distributing routing tables throughout the network. The main disadvantages of such algorithms are: 1. Respective amount of data for maintenance. 2. Slow reaction on restructuring and failures. Reactive (on-demand) routing This type of protocols finds a route on demand by flooding the network with Route Request packets. The main disadvantages of such algorithms are: 1. High latency time in route finding. 2. Excessive flooding can lead to network clogging. Flow-oriented routing This type of protocols finds a route on demand by following present flows. One option is to unicast consecutively when forwarding data while promoting a new link. The main disadvantages of such algorithms are:
11

1. Takes long time when exploring new routes without a prior knowledge. 2. May refer to entitative existing traffic to compensate for missing knowledge on routes. Adaptive (situation-aware) routing This type of protocols combines the advantages of proactive and of reactive routing. The routing is initially established with some proactively prospected routes and then serves the demand from additionally activated nodes through reactive flooding. Some metrics must support the choice of reaction. The main disadvantages of such algorithms are: 1. Advantage depends on amount of nodes activated. 2. Reaction to traffic demand depends on gradient of traffic volume. Hybrid (both pro-active and reactive) routing This type of protocols combines the advantages of proactive and of reactive routing. The routing is initially established with some proactively prospected routes and then serves the demand from additionally activated nodes through reactive flooding. The choice for one or the other method requires predetermination for typical cases. The main disadvantages of such algorithms are: 1. Advantage depends on amount of nodes activated. 2. Reaction to traffic demand depends on gradient of traffic volume.

6. KINDS OF WIRELESS NETWOKS


ADHOC MODE

12

An ad hoc network is a type of peer to peer wireless network mode where wireless devices communicate with each other directly, without the aid of a Wireless Access Point (WAP) device. Wireless networks typically depend on a base station or WAP device to manage and direct the stream of data between wireless devices. In an ad hoc setup, the network is built spontaneously as and when devices communicate with each other. These devices should ideally be within close range of each other; however quality of connection and speed of the network will suffer as more devices are added to the network. The security of an ad hoc network is non-existent, as wireless security norms such as WAP2, WAP, and WEP are not permitted in such direct networking. The types of ad hoc networks are as follows: 1. Mobile ad hoc networks A mobile ad hoc network (MANET) is a self forming network of mobile devices connected wirelessly. 2. Wireless mesh networks A wireless mesh network (WMN) is a communications network of radio nodes structured in a mesh topology. The clients within the network are usually laptops, mobile phones, and other wireless equipment. The mesh network, with the help of routers and gateways, transmits data to and from the wireless devices. The communication is within the mesh and not to the internet. 3. Wireless sensor networks A wireless sensor network (WSN) employs sensor based devices to jointly observe physical or environmental settings such as sound, pressure, climatic changes, and so on. Wireless sensor
13

networks are used in a wide range of areas: traffic control,vehicle detection, greenhouse monitoring and so on. WIRELESS ACCESS POINT (WAP) Wireless Access Point (WAP) is essentially hardware equipment that enables wireless devices to connect to wireless networks, via standards such as Wi-Fi, Bluetooth and so on. The WAP device typically connects to a wired network, and acts as a communication interface between the wireless devices and wired devices on the network. The WAP device enables the transmission of data between wireless and wired devices. For example, in an office setup multiple users can print documents from their workstations or laptops that are physically connected to the network, with the help of a wireless printer that is located at a central location in the office. The WAP device acts as a central hub for sending and receiving data via WLAN (Wireless Local Area Networks). The usage of WLAN and WAP has become quite common in offices, homes and educational institutions. Before the advent of wireless networking, setting up a computer network for home, corporate or institutional use was quite tedious and time-consuming, as it involved the installation of numerous cables to ensure network access for all the network devices being deployed. Presently WAP devices are designed to work with standards to send and receive data via radio frequencies. This keeps the usage of cabling to a bare minimum. The standards and frequencies are prescribed by IEEE (Institute of Electric and Electronic Engineers), and nearly all WAP devices use IEEE 802.11 standards. INFRASTRUCTURE MODE
14

Infrastructure mode wireless networking bridges (joins) a wireless network to a wired Ethernet network. Infrastructure mode wireless also supports central connection points for WLAN clients. A wireless access point(AP) is required for infrastructure mode wireless networking. To join the WLAN, the AP and all wireless clients must be configured to use the same SSID. The AP is then cabled to the wired network to allow wireless clients access to, for example, Internet connections or printers. Additional APs can be added to the WLAN to increase the reach of the infrastructure and support any number of wireless clients. Compared to the alternative, ad-hoc wireless networks, infrastructure mode networks offer the advantage of scalability, centralized security management and improved reach. The disadvantage of infrastructure wireless networks is simply the additional cost to purchase AP hardware.

7. WIRELESS ADAPTERS Service Set identifier (SSID) Service set identifier, or SSID, is a name that identifies a particular 802.11 wireless LAN. A client device receives broadcast messages from all access points within range advertising their SSIDs. The client device can then either manually or automaticallybased on configurationselect the network with which to associate. The SSID can be up to 32 characters long. As the SSID displays to users, it normally consists of human-readable characters. However, the standard does not require this. The SSID is defined as a sequence of 132 octets each of which may take any value. It is legitimate for multiple access points to share the same SSID if they provide access to the same network as part of an extended service set.

15

Some wireless access points support broadcasting multiple SSIDs, allowing the creation of Virtual Access Points, partitioning a single physical access point into several virtual access points, each of which can have a different set of security and network settings. This is not yet part of the 802.11 standard. Basic service set identifier (BSSID) A related field is the BSSID or Basic Service Set Identifier, which uniquely identifies each BSS (the SSID however, can be used in multiple, possibly overlapping, BSSs). In an infrastructure BSS, the BSSID is the MAC address of the wireless access point (WAP). In an IBSS, the BSSID is a locally administered MAC address generated from a 46-bit random number. The individual/group bit of the address is set to 0. The universal/local bit of the address is set to 1. A BSSID with a value of all 1s is used to indicate the broadcast BSSID. A broadcast BSSID may only be used during probe requests. Extended service set identifier (ESSID) An ESS is identified with an ESSID (Extended Service Set Identifier), a 32-character identifier (in ASCII format) which acts as its name on the network. The ESSID, often shortened to SSID, shows the network's name, and in a way acts a first-level security measure, since it is necessary for a station to know the SSID in order to connect to the extended network.

16

17

Ex No: 2

SIMULATION OF AD-HOC NETWORK

Objective
To simulate wireless networks in ad-hoc mode USING NS-2

Hardware/Software required
Ns-allinone2.35 on Linux

Description
An ad hoc network is a collection of wireless mobile nodes dynamically forming a temporary network without the use of existing network infra-structure or centralized administration. Due to the limited transmission range of wireless network interfaces, multiple network hops may be needed for one node to exchange data with another across the network. In such a network, each mobile node operate not only as a host but also as a router, forwarding packets for other mobile nodes in the network, that may not be within the direct reach wireless transmission range of each other. Each node participates in an ad hoc routing protocol that allows it to discover multi hop paths through the network to any other node. The idea of an ad hoc network is sometimes also called an infrastructure-less networking, since the mobile nodes in the network dynamically establish routing among themselves to form their own network on the fly.

Procedure
1. Declare the required configuration parameter using set val(name of parameter) 18

2. Create a simulator class instance using set objectref[new simulator] 3. Open a file in write mode and set trace-all function of object of simulator with parameter of Fileobj.reference 4. Now open a network animator file in write mode 5. Now call the simulator object function, track history of wireless with parameters as namefileobjectreference and topology values 6. Create an instance of class topography 7. Now call node-flatgrid function with parameters of topology 8. Now create general operations director [god] for total number of nodes 9. Call simulator class node-config method to set values of configuration types 10. Set nodes 0,1,2 using simulator o objnode 11. Set TCP agent reference and attach this agent to node 0 12. Similarly create FTP agent application and attach that agent to node 0 over TCP agent 13. Create TCP sink and attach that agent to node 2 14. Now connect TCP and TCP sink agents of node 0 and node 2 15. Declare the node movement times and destination positions for node 1 16. Now specify the simulation start and stop times 17. Call a procedure at end of simulation period 18. Declare the procedure with global parameter as simulation objects, namfileobject and wireless file object reference 19. Use simulator object flush-trace method 20. Execute the nam file and exit the procedure 21. Close the global parameter 22. Finally call the simulator run to execute Sample output:

19

20

Ex no: 3

THROUGHPUT CALCULATION USING NS2

Objective
To create a wireless network with CBR traffic and to calculate its throughput.

Hardware/Software required
Ns-allinone2.35 on Linux

Description
Throughput:
In communication networks, such as Ethernet or packet radio, throughput or network throughput is the average rate of successful message delivery over a communication channel. This data may be delivered over a physical or logical link, or pass through a certain network node. The throughput is usually measured in bits per second (bit/s or bps), and sometimes in data packets per second or data packets per time slot. The system throughput or aggregate throughput is the sum of the data rates that are delivered to all terminals in a network. The throughput can be analyzed mathematically by means of queuing theory, where the load in packets per time unit is denoted arrival rate , and the throughput in packets per time unit is denoted departure rate . Throughput is essentially synonymous to digital bandwidth consumption. Throughput is the amount of digital data per time unit that is delivered over a physical or logical link, or that is passing through a certain network node. For example, it may be the amount of data that is delivered to a certain network terminal or host computer, or between two specific computers. The

21

throughput is usually measured in bits per second (bits/s or bps), occasionally in data packets per second or data packets per timeslot.

Procedure:
1. In the tcl file, initialize the configuration parameters of the network using set keyword 2. The values other than that of link layer type of q length number of nodes and routing protocol have to be written with super class 3. Create an object for simulator class using set and new keywords 4. Create a trace file with write mode using set and open keywords 5. Using trace-all function set object to trace all the events 6. Create a nam file in write mode using set and open keywords 7. Create an object for topography class and give the values (500 , 500) 8. Pass the values of number of nodes to the create god function 9. Set values for arguments of node-config function 10. Create node and positions then with x-,y-,z- variables 11. Create udp agent and cbr application and attach them to node zero 12. Set the movement of node using at keyword and giving appropriate position with setdest keyword 13. The application start and stop are indicated by start and stop keywords 14. The end of simulation time is called finish procedure 15. In the finish procedure the variable ws, tf and are made global 16. Call the flush-trace function, close the files and exit the procedure 17. Call run with ws object 18. Write the corresponding awk script to calculate the throughput of the define network 19. Thus the throughput is calculated for the network simulation

22

Sample output

GRAPH

23

24

Ex no: 4

PERFORMANCE EVALUATION OF TCP OVER WIRELESS NETWORK

Objective
To evaluate the performance of TCP over wireless network

Hardware/Software required
Ns-allinone2.35 on Linux

Description
TCP is one of the two original components of the suite (the other being Internet Protocol, or IP), so the entire suite is commonly referred to as TCP/IP. Whereas IP handles lower-level transmissions from computer to computer as a message makes its way across the Internet, TCP operates at a higher level, concerned only with the two end systems, for example a Web browser and a Web server. In particular, TCP provides reliable, ordered delivery of a stream of bytes from a program on one computer to another program on another computer. Besides the Web, other common applications of TCP include e-mail and file transfer. Among its other management tasks, TCP controls segment size, flow control, the rate at which data is exchanged, and network traffic congestion. TCP provides a communication service at an intermediate level between an application program and the Internet Protocol (IP). That is, when an application program desires to send a large chunk of data across the Internet using IP, instead of breaking the data into IP-sized pieces and issuing a series of IP requests, the software can issue a single request to TCP and let TCP handle the IP details. Due to network congestion, traffic load balancing, or other unpredictable network behavior, IP packets can be lost, duplicated, or delivered out of order. TCP detects these problems, requests 25

retransmission of lost packets, rearranges out-of-order packets, and even helps minimize network congestion to reduce the occurrence of the other problems. Once the TCP receiver has finally reassembled a perfect copy of the data originally transmitted, it passes that datagram to the application program. Thus, TCP abstracts the application's communication from the underlying networking details. TCP is used extensively by many of the Internet's most popular applications, including the World Wide Web, E-mail, File Transfer Protocol, Secure Shell, peer-to-peer file sharing, and some streaming media applications. TCP is a reliable stream delivery service that guarantees delivery of a data stream sent from one host to another without duplication or losing data. Since packet transfer is not reliable, a technique known as positive acknowledgment with retransmission is used to guarantee reliability of packet transfers. This fundamental technique requires the receiver to respond with an acknowledgment message as it receives the data. The sender keeps a record of each packet it sends, and waits for acknowledgment before sending the next packet. The sender also keeps a timer from when the packet was sent, and retransmits a packet if the timer expires. The timer is needed in case a packet gets lost or corrupted.

Procedure
1. Declare the variable for subclass wireless channel 2. Declare the other network node parameters 3. Open wireless trace file using file open 4. Specify the topological dimensions 5. Assign dimension to nodes declared 6. Specify start and stop time 7. Start the simulation to run 8. Specify the procedure plot to plot graph between time and congestion window 9. Set congestion window as CWND as time as current time as specified time interval 10. Finally use graph to obtain plot between time and congestion window.

26

Sample Output:
Node Creation:

Node Movement:

27

GRAPH:

28

Ex. No.: 5

EVALUATION OF ROUTING PROTOCOLS


OF WIRELESS NETWORKS USING NS2

Objective
To evaluate the routing protocols of wireless network using ns2.

Hardware/Software required
Ns-allinone2.35 on Linux

Description
DSDV: In this routing protocol routing messages are exchanged between neighbouring mobile nodes (i.e mobile nodes that are within range of one another). Routing updates may be triggered or routine. Updates are triggered in case a routing information from one of t he neighbours forces a change in the routing table. A packet for which the route to its destination is not known is cached while routing queries are sent out. The pkts are cached until route-replies are received from the destination. There is a maximum buffer size for caching the pkts waiting for routing information beyond which pkts are dropped. All packets destined for the mobile node are routed directly by the address dmux to its port dmux. The port dmux hands the packets to the respective destination agents. A port number of 255 is used to attach routing agent in mobile nodes. The mobilenodes al so use a default-target in their classifier (or address demux). In the event a target is not found for the destination in the classifier (which happens when the destination of the packet is not the mobilenode itself), the pkts are handed to the default-ta rget which is the routing agent. The routing agent assigns the next hop for the packet and sends it down to the link layer. The routing protocol is mainly implemented in C++. AODV: AODV is a combination of both DSR and DSDV protocols. It has the basic route-discovery and route-maintenance of DSR and uses the hop-by-hop routing, sequence numbers and beacons of DSDV. The node that wants to know a route to a given destination generates a ROUTE REQUEST. The route request is forwarded by intermediate nodes that also creates a reverse route for itself from the destination. When the request reaches a node with route to destination it generates a ROUTE REPLY containing the number of hops requires to reach destination. All nodes that participates in forwarding this reply to the

29

source node creates a forward route to destination. This state created from each node from source to destination is a hop-by-hop state and not the entire route as is done in source routing. DSR: This section briefly describes the functionality of the dynamic source routing protocol. As mentioned earlier the SRNode is different from the MobileNode. The SRNodes entry_ points to the DSR routing agent, thus forcing all packets received by the node to be handed down to the routing agent. This model is required for future implementation of piggy-backed routing information on data packets which otherwise would not flow through the routing agent. The DSR agent checks every data packet for source-route information. It forwards the packet as per the routing information. Incase it doesnot find routing information in the packet, it provides the source route, if route is known, or caches the packet and sends out route queries if route to destination is not known. Routing queries, always triggered by a data packet with no route to its destination, are initially broadcast to all neighbours. Route-replies are send back either by intermediate nodes or the destination node, to the source, if it can find routing info for the destination in the route-query. It hands over all packets destined to itself to the port dmux. In SRNode the port number 255 points to a null agent since the packet has already been processed by the routing agent.

Procedure
1. In the tcl file, initialize the configuration parameters of the network using set keyword 2. The values other than that of link layer type of q length number of nodes and routing protocol have to be written with super class 3. Create an object for simulator class using set and new keywords 4. Create a trace file with write mode using set and open keywords 5. Using trace-all function set object to trace all the events 6. Create a nam file in write mode using set and open keywords 7. Create an object for topography class and give the values (500 , 500) 8. Pass the values of number of nodes to the create god function 9. Set values for arguments of node-config function 10. Create node and positions then with x-,y-,z- variables
30

11. Create udp agent and cbr application and attach them to node zero 12. Set the movement of node using at keyword and giving appropriate position with setdest keyword 13. The application start and stop are indicated by start and stop keywords 14. The end of simulation time is called finish procedure 15. In the finish procedure the variable ws, tf and are made global 16. Call the flush-trace function, close the files and exit the procedure 17. Call run with ws object
18. Write the corresponding awk script to evaluate the routing protocols of wireless network.

Sample output:

Terminal:

31

32

Ex. No.: 7 Objective

SIMULATION OF CHANNEL INTERFERENCE IN WIRELESS NETWORKS USING NS2

To simulate channel interference problem in wireless networks using ns2.

Hardware/Software required
Ns-allinone2.35 on Linux

Description
Channel Interference The problem of Interference occurs "when a receiver is in range of one transmitting station and slightly out-of-range of another transmitting station, but is unable to cleanly receive the closer station's signal because of the interfering presence of the other signal." Here we show 2 cases : Case 1: When 2 nodes are in range of each other, when these 2 nodes do carrier sense at different times, they detect carrier and the node that senses carrier later, backs off, thus avoiding collision at the receiver. But if the 2 nodes do carrier sense at the same time, they are not able to detect carrier and hence there is a collision at the receiver. Case 2 : When 1 node is slightly out of range of the other In this case, when both nodes send data to the receiver, some of the packets sent by the node closer to the receiver get dropped, because the receiver receives some packets from the node slightly out of range.

Sample output
33

Node 1 got message 3 Node 0 got message 3 Node 1 got message 13 Node 0 got message 13 Node 1 got message 15 Node 0 got message 15 Node 1 got message 21

34

35

Ex. No: 8 Objective

SIMULATION OF RTS-CTS-DATA-ACK IN WIRELESS NETWORKS USING NS2

To simulate RTS-CTS scenario in wireless networks using ns2.

Hardware/Software required
Ns-allinone2.35 on Linux

Description
RTS-CTS-DATA-ACK In a Wireless network topology, when not all nodes are within each other's range, carrier sense only provides information about collisions at the sender, not at the receiver. This leads to problems like "hidden terminal" (where two sender nodes out of range of each other transmit packets at the same time, to the same receiver, resulting in collisions at the receiver). To solve such problems, control packets (RTS & CTS) are used, as an alternative to the carrier sense protocol. When a node wants to transmit packets, it first sends a RTS (Request To Send) packet to the reciever. All nodes within the sender's range receive this RTS packet. Every node Hearing the RTS packet will defer transmission. If receiver is not receiving data from any other node, it responds with a CTS (Clear To Send) packet. This packet is again received by every node within receiver's range. So all nodes in the range defer transmission. Sender node sends the data packet after receiving CTS. If sender node does not hear the CTS, it will time-out and schedule retransmission of RTS. On receiving the data packet, receiver sends an ACK to the sender. Link layer ACKs are used to facilitate recovery from collision faster. RTS and CTS packets are very short, hence their collision is very less likely. If RTS packets from 2 sender nodes collide at the receiver, sender nodes will not receive a CTS packet and the nodes, as a result will back off for certain duration, resulting in collision detection. This protocol solves the hidden terminal problem, even though two sender nodes may be out of range of each other, but they both are in the range of the receiver they want to send the data packets to. Hence, when receiver responds to one node with a CTS packet, it will be heard by the other sender node too and it will defer transmission. Here we have 3 nodes 0, 1, 2. We see how the nodes behave in the following 3 cases : Case 1: Both sender nodes, nodes 0 and 2 are in range of each other, but node 1 is out of range of node 2. 36

When node 2 wants to send data to node 0 and node 0 wants to send data to node 1. In this case, both nodes 0 and 2 do carrier sense. Node 0 then sends RTS packet to no idea 1 and 2. Node 2 backs off after hearing this RTS packet. Node 1 sends a CTS to Node 0 and Node 0 performs its data transmission, at the end of which, node 2 again does a carrier sense and performs its data transmission, finding the medium free. Case 2: Both sender nodes 0 and 2 are in range of each other and in range of node 1.So, they can all hear each other's RTS and CTS packets. In this case, when node 2 wants to send data to node 1 at the same time that node 0 wants to send data to node 1, node 2 hears the RTS from node 0 and backs off, Thus deferring its transmission till node 0 finishes its transmission and hence avoiding collision at the receiver. Case 3: Both sender nodes 0 and 2 are out of range of each other but are in rang eof node 1, the receiver. In this case, nodes are not able to hear each other's RTS packets, but are able to hear CTS packet from th receiver and hence back off, deferring transmission till the other node finishes transmission. So, we see in all 3 cases, one node backs off, thus avoiding collisions at the receiver and hence solving the hidden terminal problem.

Procedure
1. In the tcl file, initialize the configuration parameters of the network using set keyword 2. The values other than that of link layer type of q length number of nodes and routing protocol have to be written with super class 3. Create an object for simulator class using set and new keywords 4. Create a trace file with write mode using set and open keywords 5. Using trace-all function set object to trace all the events 6. Create a nam file in write mode using set and open keywords 7. Create an object for topography class and give the values (500 , 500) 8. Pass the values of number of nodes to the create god function 9. Set values for arguments of node-config function 10. Create node and positions then with x-,y-,z- variables 11. Create udp agent and cbr application and attach them to node zero 12. Set the movement of node using at keyword and giving appropriate position with setdest keyword 13. The application start and stop are indicated by start and stop keywords 14. The end of simulation time is called finish procedure 15. In the finish procedure the variable ws, tf and are made global 16. Call the flush-trace function, close the files and exit the procedure 17. Call run with ws object 18. Write the corresponding awk script to To simulate RTS-CTS scenario in wireless.

37

Sample output
Node 1 got message 1 Node 1 got message 1 Node 1 got message 5 Node 1 got message 5 Node 1 got message 6 Node 1 got message 6 Node 1 got message 16 Node 1 got message 16 Node 1 got message 15

38

Ex. No.: 09 SIMULATION OF WIRED-CUM-WIRELESS NETWORK USING NS2 Objective


To simulate wired-cum-wireless networks using NS2.

Hardware/Software required
Ns-allinone2.35 on Linux

Description: There is mostly a need to simulate a topology of multiple LANs connected through wired nodes, or in other words we need to create a wired-cum-wireless topology. In this section we are going to create a mixed scenario consisting of a wireless and a wired domain, where data is exchanged between the mobile and non-mobile nodesFor the mixed scenario, we are going to have 2 wired nodes, W(0) and W(1), connected to our wireless domain consisting of 3 mobile nodes (nodes 0, 1 & 2) via a base-station node, BS. Base station nodes are like gateways between wireless and wired domains and allow packets to be exchanged between the two types of nodes. Fig below shows the topology of this type of network.

Procedure
39

1. First we create a mixed scenario consists of wired and wireless domain where data has to be transferred between mobile and non-mobile nodes. 2. Declare the configuration parameters like routing protocol, connection pattern file, node movement file etc. 3. Create simulator class instance. 4. Set up for hierarchical routing like number of domains, number of clusters in each domain, number of nodes in each cluster. 5. Open a file in write mode and set trace-all function of object of simulator with parameters of file obj reference. 6. Now open a network animator file in write mode. 7. Call the simulator object function,track history of wireless (namtrace-all-wireless) with parameters as namfile obj reference and topology values. 8. Create topography object and specify the topology and initiate General operations director. 9. Create the wireless nodes using hierarchical addresses for wired domain 10. Configure the base-station node with configuration parameters and create base station node. 11. Configure the mobile nodes with Base station node; create links between wired and BS nodes. 12. Setup TCP connections between mobile nodes and wired nodes. 13. Specify all the nodes when the simulation ends with simulation times. 14. Specify the informative headers for CMUTracefile. 15. Call a procedure at end of simulation period. 16. Declare the procedure with global parameters as simulation objects,nam file obj reference and wireless trace file obj reference. 17. Use simulator objects flush-trace method to execute the name file and exit the procedure and finally calls the simulator run to execute.

Sample Output:
$ ns wireless2.tcl $nam wireless2-out.nam

40

Wired-cum-wireless scenario

Data from Node 1 to Node 0

41

ACK from Node 0 to Node 1

42

Ex. No.: 10

SIMULATION OF MOBILE IP USING NS2

Objective:
To simulate MobileIP in wired-cum-wireless networks using Ns2.

Hardware/Software required:
Ns-allinone2.35 on Linux Description:
The Mobile IP protocol allows location-independent routing of IP datagrams on the Internet. Each mobile node is identified by its home address disregarding its current location in the Internet. While away from its home network, a mobile node is associated with a care-of address which identifies its current location and its home address is associated with the local endpoint of a tunnel to its home agent. Mobile IP specifies how a mobile node registers with its home agent and how the home agent routes datagrams to the mobile node through the tunnel.

Procedure:
1. First we create a mixed scenario consists of wired and wireless domain where data has to be transferred between mobile and non-mobile nodes.To support MobileIp create secenario with basestation nodes as Home Agent(HA) and Foreign Agent(FA).

2. Declare the configuration parameters like routing protocol, connection pattern file, node movement file etc. 3. Create simulator class instance. 4. Set up for hierarchical routing like number of domains, number of clusters in each domain, number of nodes in each cluster. 5. Open a file in write mode and set trace-all function of object of simulator with parameter of file obj reference. 6. Now open a network animator file in write mode. 7. Call the simulator object function,track history of wireless (namtrace-all-wireless) with parameters as namfile obj reference and topology values. 8. Create topography object and specify the topology and initiate General operations director.
43

9. Create the wired nodes using hierarchical addresses and domain for the FA. 10. Configure the HA and FA with configuration parameters. Turn the mobileIP flag on by configuring the node structure accordingly using option -mobileIP ON. 11. Create HA and FA and specify positions for these agents. 12. Specify the Position (fixed) for base-station nodes (HA & FA). 13. Create a mobilenode that would be moving between HA and FA. Here address of MH indicates its in the same domain as HA. 14. Specify simulation times so that the MH starts to move towards the FA in the specified time and goes back to HA. 15. Create links between wired and BaseStation nodes. 16. Setup TCP connections between mobile nodes and Mobile Hosts. 17. Specify all the nodes when the simulation ends with simulation times. 18. Specify the informative headers for CMUTracefile. 19. Call a procedure at end of simulation period. 20. Declare the procedure with global parameters as simulation objects,nam file obj reference and wireless trace file obj reference. 21. Use simulator objects flush-trace method to execute the name file and exit the procedure and finally call the simulator run to execute.

44

Sample output:
$ns wireless3.tcl $nam wireless3-out.nam

45

46

47

Вам также может понравиться