LAB MANUAL-computer Network-Imp Programs
LAB MANUAL-computer Network-Imp Programs
BANGALORE
CA- C14L: COMPUTER NETWORK LAB
PART – A
PART - B
Reference:
Youtube.com/watch?v=rurs7cdT5cc
https://www.youtube.com/watch?v=_IOZ8_cPgu8
http://www.alphr.com/block-websites-windows/
Youtube.com/watch?v=rurs7cdT5cc -
Ipconfig
Displays all current TCP/IP network configuration values and refreshes Dynamic
Host Configuration Protocol (DHCP) and Domain Name System (DNS) settings.
Used without parameters, ipconfig displays Internet Protocol version 4 (IPv4) and
IPv6 addresses, subnet mask, and default gateway for all adapters.
hostname
A host name is a unique name or label assigned to any device that is connected to a
specific computer network. It facilitates the differentiation of different machines or
devices connected to the Internet, a network and/or both.
Netdiag
The Netdiag command-line diagnostic tool helps to isolate networking and
connectivity problems by performing a series of tests to determine the state of your
network client.
Netstat
Displays active TCP connections, ports on which the computer is listening,
Ethernet statistics, the IP routing table, IPv4 statistics (for the IP, ICMP, TCP, and
UDP protocols), and IPv6 statistics (for the IPv6, ICMPv6, TCP over IPv6, and
UDP over IPv6 protocols). Used without parameters, this command displays active
TCP connections.
Nslookup
nslookup is the name of a program that lets an Internet server administrator or any
computer user enter a host name and find out the corresponding IP address or
domain name system (DNS) record.
Pathping
This command sends multiple echo Request messages to each router between a
source and destination, over a period of time, and then computes results based on
the packets returned from each router
Ping route
Ping is a simple command that can test the reachability of a device on the network.
Traceroute is a command you use to 'trace' the route that a packet takes when
traveling to its destination. It's useful for tracing network problems, discovering
where connections fail, and tracking down latency problems.
Tracert
a command-line utility that you can use to trace the path that an Internet Protocol
(IP) packet takes to its destination
Experiment – 2: Study of different types of network cables.
Network cables
Sheath - The outer layer of the coaxial cable which protects the cable from
physical damage.
Braided shield - This shield protects signals from external interference and
noise. This shield is built from the same metal that is used to build the core.
Insulation - Insulation protects the core. It also keeps the core separate
from the braided shield. Since both the core and the braided shield use the
same metal, without this layer, they will touch each other and create a
short-circuit in the wire.
Conductor - The conductor carries electromagnetic signals.
Coaxial cables have two types of transmission-
Baseband Transmission – It is the process of transmitting a single signal at high
speed.
Broadband Transmission – It is the process of transmitting a multiple signals
simultaneously.
2. Twisted Pair Cables: The twisted-pair cable was primarily developed for
computer networks. This cable is also known as Ethernet cable. Almost all
modern LAN computer networks use this cable. This cable consists of color-
coded pairs of insulated copper wires. Every two wires are twisted around
each other to form pair. Usually, there are four pairs. Each pair has one solid
color and one stripped color wire. Solid colors are blue, brown, green, and
orange. In stripped color, the solid color is mixed with the white color.
3. Fiber Optics Cables: This cable consists of a core, cladding, buffer, and jacket.
The core is made from thin strands of glass or plastic that can carry data over a
long distance.
The core is wrapped in the cladding; the cladding is wrapped in the buffer, and
the buffer is wrapped in the jacket. Core carries the data signals in the form of
light.
Cladding reflects light back to the core.
Buffer protects the light from leaking.
The jacket protects the cable from physical damage.
Fiber optic cable is completely immune to EMI and RFI. This cable can transmit
data over a long distance at the highest speed. It can transmit data up to 40
kilometers at the speed of 100Gbps. Fiber optic uses light to send data. It reflects
light from one endpoint to another.
Step Index Fiber – consists of a core surrounded by the cladding which has
a single uniform index of refraction.
Graded Index Fiber - The refractive index of the optical fiber decreases as
the radial distance from the fiber axis increases.
Plastic Optical Fibers – Polyymethylmethacrylate is used as a core material
for the transmission of light.
Glass fibers – consists of fine glass fibers.
Single mode fiber – used for long-distance transmission of signals.
Multimode – use for short distance transmission of signals.
----------------------------
Experiment – 3: Practically implement the cross-wired cable and
straight wired cable using crimp tool.
Components: RJ-45 connector, Climping Tool, Twisted pair Cable
Procedure:
Step – 1: Start by stripping off about 2 inches of the plastic jacket off the end of
the cable. Be very careful at this point, as to not nick or cut into the wires, which
are inside. Doing so could alter the characteristics of your cable, or even worse
render is useless. Check the wires, one more time for nicks or cuts. If there are
any, just whack the whole end off, and start over.
Step – 2: Spread the wires apart, Category 5 cable must only have 1/2 of an inch
of 'untwisted' wire at the end; otherwise it will be 'out of spec'. At this point, you
obviously have ALOT more than 1/2 of an inch of un-twisted wire.
Step – 3: You have 2 end jacks, which must be installed on your cable. If you are
using a pre-made cable, with one of the ends whacked off, you only have one end
to install - the crossed over end.
Below are two diagrams, which show how you need to arrange the cables for
each type of cable end. Decide at this point which end you are making and
examine the associated picture below.
Yo
u Tube reference for Practical Session I Cross wired cable and straight through cable using
clamping tool: https://youtu.be/E5i8kRJXLTw
Experiment – 4: Study of network IP address configuration
(Classification of address, static and dynamic address)
An IP address is a numerical label assigned to the devices connected to a
computer network that uses the IP for communication. IP address act as an
identifier for a specific machine on a particular network. It also helps you to
develop a virtual connection between a destination and a source.
IP address Full Form: Internet Protocol address
Classification of IP Address
TCP/IP defines five classes of IP addresses: Class A, B, C, D and E. Each class has a
range of valid IP addresses.
Hub: An Ethernet hub, active hub, network hub, repeater hub, hub or concentrator
is a device for connecting multiple twisted pair or fiber optic Ethernet devices
together and making them act as a single network segment. Hubs work at the
physical layer (layer 1) of the OSI model. The device is a form of multiport
repeater. Repeater hubs also participate in collision detection, forwarding a jam
signal to all ports if it detects a collision.
Bridge: A network bridge connects multiple network segments at the data link
layer (Layer 2) of the OSI model. In Ethernet networks, the term bridge formally
means a device that behaves according to the IEEE 802.1D standard. A bridge and
switch are very much alike; a switch being a bridge with numerous ports. Switch or
Layer 2 switch is often used interchangeably with bridge.Bridges can analyze
incoming data packets to determine if the bridge is able to send the given packet to
another segment of the network.
Windows 10
Step -8: Under Internet Connection Sharing, select the Allow other network
users to connect through this computer's Internet connection check
box.
Step -9: If you are sharing a dial-up Internet connection, select the Establish
a dial-up connection whenever a computer on my network attempts
to access the Internet check box if you want to permit your computer
to automatically connect to the Internet
The network adapter that is connected to the LAN is configured with a static
IP address of 192.168.0.1 and a subnet mask of 255.255.255.0
To connect to the Internet by using the shared connection, you must confirm
the LAN adapter IP configuration, and then configure the client computer.
Step – 6: Click the General tab, click Internet Protocol (TCP/IP) in the
connection uses the following items list, and then click Properties.
IP Address: 192.168.31.202 9.
Subnet mask: 255.255.255.0 10.
Default gateway: 192.168.31.1 11.
In the Local Area Connection Properties dialog box and click
OK.
Step-3: When the Notepad opens, select “File” from the toolbar and “Open”
from the drop-down menu.
Step-5: Make sure to select the “All files” option for the files to appear. Then
open the “host” file.
Step-6: Scroll to the bottom of the page and click on the last line. Make sure to
create space.
Step-7: Enter the URL you want to block.
Method – 2:
3. Right-click on “Outbound Rules” from the menu on the left and select “New
Rule.”
4. When a new window pops up, select the “Custom” option followed by
“Next.”
5. On the next window, select “All programs” and again select “Next.”
7. Click on “Add” and enter the IP addresses you want to block. Then select
“Next.”
8. Make sure to choose the “Block the connection” option and click on “Next.”
9. Choose whether the rule applies to Domain, Private, or Public. You can also
select all three.
10.Select “Next,” add a name or description for this rule, and select “Finish” to
complete the action.
3. When the Notepad opens, select “File” from the toolbar and
“Open” from the drop-down menu.
4. Go the “C:\Windows\System32\Drivers\etc” location.
5. Make sure to select the “All files” option for the files to appear.
Then open the “host” file.
6. Scroll to the bottom of the page and click on the last line. Make
sure to create space.
7. Enter the URL you want to block.
For this to work, you must have permission to access the host file. Also, make
sure to restart your computer to ensure the website is blocked.
If the firewall permits access to questionable sites, you can set it up so no one in
your home, school, or work opens it either. Here’s how it works:
11. Launch the Control Panel on your computer.
14. When a new window pops up, select the “Custom” option
followed by “Next.”
15. On the next window, select “All programs” and again select
“Next.”
1. PC as a mobile hotspot
Step3. On the other device’s screen, search for and select your phone from the
Wi-Fi networks list.
Practical – 3: Configuration of VLAN using Packet Tracer/GNS3.
Steps:
1. configure terminal. Enter global configuration mode.
2. interface vlan vlan-id. Enter interface configuration mode, and enter the
VLAN to which the IP information is assigned. ...
3. ip address { ip-address subnet-mask | dhcp } Configure the IP address.
4. exit. ...
5. show interfaces vlan vlan-id. ...
6. copy running-config startup-config.
2. Create 2 VLANs on the switch: VLAN 10 and VLAN 20. You can give them
custom names.
Switch#config terminal
Switch(config)#vlan 10
Switch(config-vlan)#name SALES
Switch(config-vlan)#vlan 20
Switch(config-vlan)#name IT
3. Assign switch ports to the VLANs. Remember each VLAN is viewed as separate
broadcast domain.
And just before you configure, have in mind that switch ports could be
either access or trunk.
An access port is assigned to a single VLAN . These ports are configured for switch
ports that connect to devices with a normal network card, for example a PC in a
network.
A trunk port on the other hand is a port that can be connected to another switch
or router. This port can carry traffic of multiple VLANs.
So in our case, we’ll configure switch interfaces fa 0/1 through fa
0/4 as access ports to connect to our PCs. Here, interfaces fa 0/1 and fa 0/2 are
assigned to VLAN 10 while interfaces fa 0/3 and fa 0/4 are assigned to VLAN 20.
Switch Interface fa0/5 will be configured as trunk port, as it will be used to carry
traffic between the two VLANs via the router.
Switch>enable
Switch#config terminal
Switch(config)#int fa0/1
Switch(config-if)#int fa0/2
Switch(config-if)#int fa0/3
Switch(config-if)#int fa0/4
Worth noting: We could have configured all the above interfaces as access ports
using interface range command as shown below:
4 . Assign static IP addresses to the four PCs which are located in the separate
VLANs. PC1 and PC2 fall in VLAN 10 while PC3 and PC4 fall in VLAN 20.
And now it’s very clear that we treat a VLAN just like a physical LAN when
assigning IP addresses.
At this point let’s try to test connectivity within VLANs and between VLANs
Ping PC2 from PC1 both in VLAN 10. Ping test should be successful.
Ping PC3 in VLAN 20 from PC1 in VLAN 10. Ping here will definitely fail. Why?
Because inter-VLAN routing is not yet enabled. Hope you can see how we’ve
used VLANs to place the hosts into two logical networks which can be viewed as
separate broadcast domains.
Now, in order to allow the hosts in the two VLANs to communicate, we need to
do something extra. And you can guess what. We’ll configure the router to
permit inter-VLAN communication. Let’s do that right away.
We’ll configure the router so that it will enable communication between the two
vlans via a single physical interface. How is this made possible? We’ll divide the
single physical interface on the router into logical interfaces (sub interfaces). Each
sub-interface will then serve as a default gateway for each of the VLANs. This
scenario is called router on a stick (R.O.A.S) and will allow the VLANs to
communicate through the single physical interface.
Router>enable
Router#config terminal
Router(config)#int fa0/0
Router(config-if)#no shutdown
Router(config-if)#int fa0/0.10
Router(config-subif)#encapsulation dot1q 10
Router(config-subif)#
Router(config-subif)#int fa0/0.20
Router(config-subif)#encapsulation dot1q 20
As you can notice from above, the routers physical interface fa0/0 was
subdivided into two sub-interfaces( fa0/0.10 and fa0/0.20) , which are then
configured as trunk interfaces and given IP addresses.
Finally,
Here we’ll test connectivity between computers in different VLANs . Don’t forget
that its the router that enables inter-VLAN routing.
Ping PC3 in VLAN 20 from PC1 in VLAN 10. If everything is well configured, then
ping should work perfectly.