Before you begin assembling the network, follow the steps below:
cmd.exeto bring up the context menu.
nk (netkitteh): Send/receive bytes using TCP or UDP. Usage: nk [-h] [-u] [-l port] [host port] -h = print this help message -u = use UDP -l = listen on 'port' host = name of a server listening on 'port' (hostname, domainname, or IP address) Examples: TCP server: nk -l 12345 client: nk foo.bar.net 12345 UDP server: nk -u -l 12345 client: nk -u 22.214.171.124 12345
As required, download
nk.exeand save it to
nkworking on your laptop will result in a grade deduction on the lab, and/or the instructor option portion of your grade.
cmdprocesses, to assist with the various lab activities.
netsh advfirewall set allprofiles state off
arp -d *will not return any output.
arp -d *↑ Worksheet Question
In this first part of the lab, you will create a wired Ethernet network to communicate with your classmates. As discussed in class, the very basic layout of a wired network is as follows:
Assemble the network (left) with three other students using your laptop and the provided Ethernet switch and cables. First, connect the switch's power cord and plug it into an electrical outlet. Next, plug one end of the Ethernet cable into an empty port on the switch and the other end into the Ethernet port on your laptop (located on the opposite side of the CD/DVD drive). ← Worksheet Question
Now that you have an assembled computer network, you need to configure your computer with an IP address and subnet mask so that you can communicate over the network. To do this, execute the following in the Administrator Windows command prompt, consulting the table below for your IP address and subnet mask.
<FORM>below to assign IP addresses for your group.
Enter the following information to generate a command to copy and paste into your Windows shell.
|Group Number||Assigned IP Addresses||Subnet Mask|
|Group 1||126.96.36.199 - 188.8.131.52||255.255.255.224|
|Group 2||184.108.40.206 - 220.127.116.11||255.255.255.224|
|Group 3||18.104.22.168 - 22.214.171.124||255.255.255.224|
|Group 4||126.96.36.199 - 188.8.131.52||255.255.255.224|
|Group 5||184.108.40.206 - 220.127.116.11||255.255.255.224|
Verify your IP address actually changed by executing the
ipconfig command in a Windows shell. ← Worksheet Question 2
Once you have verified that your IP is correct, test your connectivity with the other computers on the network using
ping IPaddress in a shell to test your connection with the computer
← Worksheet Question 3
If you have connectivity, you should see something like this:
If, instead of reply messages, you see destination unreachable messages, then there is a problem with the network. Check and double check the following possible causes:
ncto listen to ports from that time onwards! To fix things, give the following command in an Administrator shell:
netsh advfirewall firewall delete rule name=nc
netsh advfirewall firewall delete rule name=nkLater we'll talk about firewalls, but to give you a peek ahead: NOT clicking Allow access creates firewall rules that stops
ncfrom being able to listen to ports. The above command removes those rules.
At this point, you have a functional network of four hosts. Let's do something interesting with it, like chat with each other. There are many ways to talk to each other via computers, but this lab will focus on using netkitten over TCP.
Let's start chatting with other members of our group who share the same network.
nk -l 42123Hit Enter. Important: Click "Allow access" if a permission Window pops up!
nk IPaddress 42123
netstat -ant | moreUse spacebar to scroll through the output one page at a time. Look for the entry in the output for
netstatthat shows your TCP connection to your group member's host.
netstatto find the connection.
What message did you receive? Why didn't it work?
Take another look at the IP address and subnet mask combinations for each group. Enter the IP address and subnet mask for two hosts from different groups and compare the network address that is calculated using the below form. If they are equal, then the two IP addresses are on the same network and the packet is sent directly to the destination host. If not, the packet needs to be sent to a router, which knows where to send the packet next. Your computer does this exact same comparison prior to sending each packet out on the network because it needs to know where to send the packet.
Now you see that each group is a separate network and know that a router is necessary to connect with other groups, let's do something about it. ← Worksheet Question 5
Now disconnect your switch from the other one and plug the Ethernet cable into your group's designated port on the router using the below diagram as a guide. ← Worksheet Question 6
OK, now that you are all connected to the router, try to
ping a host from one of the other networks again.
What message did you get this time? Now why didn't it work? ← Worksheet Question 7
When a host sends a packet to a host on another network, that
packet must go to the router, called a gateway router. Well, the
sender needs to know where the router is (i.e. it needs to know the router's IP
address) in order to send anything there. Type
ipconfig in your shell...is there an IP address listed for Default Gateway? Nope. This means your host doesn't know the gateway router's IP address. The router has one configured, but no network server was available to specifically tell your host to use that gateway IP address. So, go back and set
your host's Default Gateway router IP address based on your group number. The complete table is below:
|Group Number||Assigned IP Addresses||Subnet Mask||Default Gateway|
|Group 1||18.104.22.168 - 22.214.171.124||255.255.255.224||126.96.36.199|
|Group 2||188.8.131.52 - 184.108.40.206||255.255.255.224||220.127.116.11|
|Group 3||18.104.22.168 - 22.214.171.124||255.255.255.224||126.96.36.199|
|Group 4||188.8.131.52 - 184.108.40.206||255.255.255.224||220.127.116.11|
|Group 5||18.104.22.168 - 22.214.171.124||255.255.255.224||126.96.36.199|
Copy and paste the following command (minus the comments in green) into the administrator shell:
route add 0.0.0.0 mask 0.0.0.0 <GatewayIPAd> #adds a default gateway address for all foreign networks. #The 0.0.0.0 mask 0.0.0.0 is a fancy way of saying all #networks other than my own
Now that everything is set completely and correctly, test your connection with a host on any other network!
nk), to send a message to a host on another network (be the connector). Use netstat during the connection to find the active connection.
tracertcommand using the
doption to another member of your group and then traceroute using the Windows
tracertcommand to a member not in your group. Record each hop's IP address only for each result on your worksheet.
C:>tracert -d ip.add.re.ss
arp -av... and examine the output. Explain what determines whether or not a host from the classroom appears in the ARP table. ← Worksheet Question 12
Setting up a new network requires configuration changes to every host added to the network, as you saw today. Before you reconnect to the USNA network, you must undo the changes you made in lab.
netsh advfirewall set allprofiles state on
Fn-Print Screen (Air Plane Mode)toggle your laptops wireless radios on.
netsh interface ipv4 set address name="Ethernet" source=dhcp↑ Worksheet Question 14
ipconfig. You have one last question to answer. ← Worksheet Question 15