This document provides instructions for setting up a wireless ad hoc network between two Windows 7 laptops to share files and internet access. The key steps are:
1. Create an ad hoc wireless network on one laptop and configure a WPA2 security key.
2. Join the ad hoc network from the other laptop and verify both laptops receive IP addresses on the same subnet.
3. Browse and share files between the laptops using the wireless connection.
4. Optionally, one laptop can share its wired internet connection by configuring its Ethernet interface for sharing. This allows the other laptop indirect internet access over the ad hoc wireless network.
1. 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
2. 1
Introduction
There 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 similarin this regard. It must be saidthat 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. adhoc
In 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).
INTERNET
Figure.1 Infrastructure WLAN
3. 2
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 Subnetting
Before 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 systemfor 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, eachIP 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.
4. 3
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 all1s and therefore the first two octets in any suchaddress identify the subnet.
A class Caddress has the default subnet mask of 255.255.255.0 which means the firstthree 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.
5. 4
Objective
Enable 2 wireless laptops to share their files and also share a single Internet connection.
Procedure
A. 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.
6. 5
Figure.4 IP addressing mode
B. Create an Adhoc Network
1- On one laptop, do the following:
Control panel Network & Internet Manage Wireless Networks Add create an adhocnetwork.
Figure.5 Adding a Wireless Network
7. 6
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 Network
1- 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.
8. 7
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 automaticconnections
9. 8
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:
10. 9
D. File Sharing
1- 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
Ethernet
11. 10
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.