adhoc network workshop

14
Friday, April 29, 2016 Workshop on Wireless Adhoc Networks in Windows7 Setup and Applications Instructor: Ali Nezhad School of Engineering Technology and Applied Science Department of Information and Communication Engineering Technology Computer Systems and Network

Transcript of adhoc network workshop

Page 1: adhoc network workshop

Friday, April 29, 2016

Workshop on

Wireless Adhoc Networks in Windows7

Setup and Applications

Instructor: Ali Nezhad

School of Engineering Technology and Applied Science

Department of Information and Communication Engineering Technology

Computer Systems and Network

Page 2: adhoc network workshop

IntroductionThere are two kinds of Wireless Local Area Networks (WLAN); infrastructure and adhoc. You most probably are familiar with the former and may have even been to our own workshop on that topic. This workshop is focused on creating and using the latter in a Win7 environment. Other versions of Windows are almost similar in this regard. It must be said that WiFi (IEEE802.11) is the dominant protocol as far as WLANs are concerned but adhoc networks may be built using other wireless technologies such as Bluetooth, Zigbee, etc.

Infrastructure vs. adhocIn an infrastructure WLAN, wireless devices connect to a central device known as a base station (a.k.a access point among other names). The most familiar example of such a network is your WiFi network at home. The residential gateway, commonly known as router, is the access point in your network, which all your wireless devices such as mobile phones, laptops and tablets connect to in a star formation and can also allow Internet access through a modem connected to your Internet Service Provider (ISP).

Figure.1 Infrastructure WLAN

1

Page 3: adhoc network workshop

An adhoc wireless network on the other hand does not rely on a central access point. It allows wireless devices to directly connect to each other and have the same role. The fact that these networks do not rely on an infrastructure makes them ideal for extreme conditions such as exploration, disaster recovery, etc.

In this workshop you will learn how to create an adhoc wireless network using two Win7 laptops and then use it to share files between them. Furthermore, you will learn how to let one laptop to connect to the Internet indirectly via the other laptop if it is connected to the Internet. Printer sharing is another useful application but we will not attempt that.

Figure.2 Adhoc WLAN

IP Addressing and SubnettingBefore we start, let’s talk briefly about IP addresses. In a network, every device needs to be somehow identified so that information may be delivered to it from other devices exactly like the mailing system. In fact, a single device may have multiple IP addresses, one for each of its networking interfaces. At this time, the dominant system for this purpose is called IPv4 and each device in the network is identified by an IPv4 address or simply an IP address. Also, in the same way that a city is divide up into many postal zones, a big network can be divided into subnetworks or simply subnets. A subnet has an address of its own as well. In fact, each IP address is comprised of two main parts; a subnet ID and a host (meaning the device) ID. You can think of these as the city name and the house number in a mailing address.

2

Page 4: adhoc network workshop

An IPv4 address is actually a binary number consisting of 32 bits (1 or 0) and it also has an equivalent decimal representation consisting of 4 decimal numbers (called octets) separated by dots. In a big network, routers forwarding information packets only care about the subnet portion of an IP address not the host portion exactly the same way a mail sorter at a national post office only cares about the city name not the house numbers. So, how does a router know which part of an address is the subnet ID and which part is the host ID? The answer is by using a subnet mask. A subnet mask looks very much like an IP address except it has all 1s in the subnet portion and all 0s in the host portion. However, we usually use the decimal representation of that.

By default there are only three major groups of IP addresses called classes A, B and C.

A class A address has the default subnet mask of 255.0.0.0 which means the first octet is all 1s and therefore the first octet in any such address identifies the subnet.

A class B address has the default subnet mask of 255.255.0.0 which means the first and the second octets are all 1s and therefore the first two octets in any such address identify the subnet.

A class C address has the default subnet mask of 255.255.255.0 which means the first three octets are all 1s and therefore the first three octets in any such address identify the subnet.

Example:

192.168.1.1 with a subnet mask of 255.255.255.0 is a class C address and the subnet ID is 192.168.1.0.

Note: Two devices that belong to the same network share the same subnet ID and the same subnet mask. For example, another device in the above network may have an address of 192.168.1.12.

3

Page 5: adhoc network workshop

ObjectiveEnable 2 wireless laptops to share their files and also share a single Internet connection.

ProcedureA. Preparations

1- Each group is given 2 laptops. Log into your laptops with the password “wireless”.

2- Take note of the names of your PCs (e.g. CNET324-PC1) by going to

control panel system & security system

Computer1_Name: …………………… Computer2_Name: ……………………..

Figure.3 Computer name and other properties

3- Confirm that the wireless interfaces of both PCs are configured to obtain an IP address

automatically not manually. This will allow Windows to properly configure IP addresses

so that both laptops will belong to the same subnet and can communicate.

4

Page 6: adhoc network workshop

Figure.4 IP addressing mode

B. Create an Adhoc Network1- On one laptop, do the following:

Control panel Network & Internet Manage Wireless Networks Add create an adhoc network.

Figure.5 Adding a Wireless Network

5

Page 7: adhoc network workshop

2- Give it a name such as adhoc1 for PC1. 3- Choose the security type. WPA2 is the preferred mode. Provide a security key which you will

remember.

Figure.6 Configuring the name and security mode of the adhoc network

Write your security key here: ……………………

4- At this point you can turn file sharing on or off. We will keep this at its default mode which is on.

C. Join the Adhoc Network1- On both PCs join the adhoc wireless network. The PC which did not create the adhoc

network will have to provide the password which was configured by the other PC.

6

Page 8: adhoc network workshop

Figure.7 Connect to the adhoc network

Note: First stop the PCs from automatically joining the CCwGuest, CCwSecure or any other network. Otherwise, your work may be periodically interrupted as the connection jumps from your adhoc network to another network automatically.

Figure.8 Prevent automatic connections

7

Page 9: adhoc network workshop

2- Launch a command prompt buy running “cmd” from the Windows Start menu.3- Using the command “ipconfig” Verify that windows has provided both PCs with IP

addresses in the same subnet.

Figure.9 Find the IP address of your wireless interface

What are the IP addresses and the subnet masks of the wireless interfaces of your PCs?Computer Name: IP Address: Mask:

Computer Name: IP Address: Mask:

8

Page 10: adhoc network workshop

D. File Sharing1- In Windows Explorer locate your peer PC under “Network”.2- Browse the files on the peer PC. You can even stream a video or audio file.

Figure.10 Accessing files on the peer PC

E. Internet Sharing

If one of the devices has an extra networking interface it can allow the peer PC to use that too. In this experiment we will enable one PC to share the Ethernet interface of the peer PC. We will then connect that Ethernet interface to the Internet and allow the peer PC to gain access as well.

Figure.11 Sharing a single Internet connection

9

Ethernet

Page 11: adhoc network workshop

1- Configure the LAN interface for automatic IP addressing as you did in the preparation step for the wireless interface.

2- At the same time, share this interface with other devices.

Figure.12 Allow sharing of the wired LAN interface

3- Test that both PCs can access websites on the Internet.

Free Practice

If there is time, feel free to experiment. For instance, join another group and try to add three or 4 laptops to the same wireless ad hoc network.

10