CN & OS Lab-Record
CN & OS Lab-Record
1.(a) Study different types of Network cables (Copper and Fiber) and prepare cables (Straight
and Cross) to connect Two or more systems. Use crimping tool to connect jacks. Use LAN tester
to connect the cables.
Aim:- To Study different types of Network cables(Copper and Fiber) and prepare cables (Straight
and Cross) to connect two or more systems.
Types of Network Cables:-
There are three types of Network cables: coaxial, twisted pair, and fiber-optic cabling. In modern
Local Area Networks, twisted pair cable cabling is the most popular type of cabling, but fiber-optic
cabling usage is increasing, especially in high-end networks. Coaxial cabling is usually used for cable
over the Internet. Let’s explain all three Types of Ethernet Cables in detail.
1: Coaxial Cabling:-
A coaxial cable has an internal conductor that runs down the middle of the cable. The conductor is
surrounded by a layer of insulation which is then surrounded by another carrying conductor shield,
which makes this type of cable resistant to external obstruction. This type of cable comes in two types
– thinnet and thicknet. Each type has a maximum transmission speed of 10 Mbps. Coaxial cables
were previously used in computer networks, but are now replaced by twisted pair cables.
A single-core coaxial cable uses a single central metal (usually copper) conductor, while a multi-
core coaxial cable uses multiple thin strands of metal wires. The following image shows both types
of cable.
2: Twisted-pair Cabling:-
The twisted-room has four pairs of wires. These wires are twisted almost to each other to reduce
crosstalk and external interference. This type of cabling is common in current LANs.
Twisted pair cables can be used for telephone and network cables. It comes in two versions: UTP
(Unshielded Twisted-Pair) and STP (Shielded Twisted-Pair). The difference between these is that
the STP cable has an additional layer of protection to protect the data from external interference.
• Both STP and UTP can transmit data over 10Mbps, 100Mbps, 1Gbps, and 10Gbps.
• STP cables are more expensive than UTP cables because they contain more material.
• Both cables use the same RJ-45 (registered slot) module connector.
• STP provides more noise and EMI resistance than UTP cable.
• The maximum length of the two cable segments is 100 meters or 328 feet.
• The two cables can accommodate a maximum of 1,024 nodes per segment.
3: Fiber-optic Cabling:-
This type of cable uses optical fibers to transmit data in the form of a light signal. The cables have
fiberglass strands surrounded by cladding material.
The core is wrapped in cladding; The cladding is wrapped in a buffer, and the buffer is wrapped in a
jacket.
1. The key is to transmit information signals in the form of light.
2. The cladding reflects light back into the core.
3. The buffer prevents light from leaking.
4. This jacket protects the cable from physical damage.
Fiber optic cables are fully immune to EMI and RFI. This cable can transmit data over long distances
at maximum speed. It can transmit 40 km of data at 100Gbps.
Fiber optic cables use light to transmit data. It reflects light from one point to another. There are two
types of fiber optic cables based on how much light they transmit at a given time; SMF to MMF.
This type of cable can support longer cable lengths than other cable types (a few miles). The cable
has no electromagnetic interference. As you can see, this cable method has many advantages over
other methods, but its main disadvantage is that it is more expensive.
There are two types of fiber-optic cables:
• Single-mode fiber (SMF) – uses only one light beam to transmit information. Used for longer
distances.
• Multi-mode fiber (MMF) – uses multiple light beams to transmit data. Less expensive than SMF.
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.
2. Spread the wires apart, but be sure to hold onto the base of the jacket with your other hand. You
do not want the wires to become untwisted down inside the jacket. Category 5 cable must only
have ½ of an inch of ‘untwisted ‘ wire at the end. Otherwise it will be ‘out of spec’. At this point,
you obviously have A LOT more than ½ of an inch of un- twisted wire.
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.
Diagram show you how to prepare Straight wired connec on:
LAN testers:-
A LAN cable tester is a tool that is used for testing LAN cables. It has the capability to find certain
problems associated with the cable. Any defect can easily be detected with this small but very useful
instrument. Generally, a LAN cable tester consists of a source of electric current, a voltmeter and
switching matrix that is used to connect the source and the voltmeter to the contact points.
Usually, the testing process is done in two stages. The first stage is called the open test, and this stage
makes sure that every planned connections is properly set. The second, called the short test, helps
find unintended connections. The LAN cable testers are not only used for testing LAN cables, but for
telecommunication and data communication cables as well. In short, a LAN cable tester is a tool that
offers a lot and is a must- have network testing tool.
RESULT
Thus Study different types of Network cables is done successfully.
Experiment-1(b)
1(b) Install and configure Network Devices: HUB, Switch and Routers. Consider both
manageable and non-manageable switches. Do the logical configuration of the system. Set the
bandwidth of different ports.
Aim: To Install and configure Network Devices
Description:
Network Devices:
1. Repeater:
Functioning at Physical Layer. A repeater is an electronic device that receives a signal and
retransmits it at a higher level and/or higher power, or onto the other side of an obstruction, so that
the signal can cover longer distances. Repeater have two ports ,so cannot be use to connect for more
than two devices
2. 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.
3. Switch:
A network switch or switching hub is a computer networking device that connects network
segments. The term commonly refers to a network bridge that processes and routes data at the data
link layer (layer 2) of the OSI model. Switches that additionally process data at the network layer
(layer 3 and above) are often referred to as Layer 3 switches or multilayer
switches.
A network switch connects devices within a network (often a local area network, or LAN) and
forwards data packets to and from those devices. Unlike a router, a switch only sends data to the
single device it is intended for (which may be another switch, a router, or a user's computer), not to
networks of multiple devices.
An unmanaged switch simply creates more Ethernet ports on a LAN, so that more local devices can
access the Internet. Unmanaged switches pass data back and forth based on device MAC addresses.
A managed switch fulfils the same function for much larger networks, and offers network
administrators much more control over how traffic is prioritized. They also enable administrators to
set up Virtual LANs (VLANs) to further subdivide a local network into smaller chunks.
4. 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.
5. Router:
A Router is an electronic device that interconnects two or more computer networks, and selectively
interchanges packets of data between them. Each data packet contains address
information that a router can use to determine if the source and destination are on the same network,
or if the data packet must be transferred from one network to another. Where multiple routers are
used in a large collection of interconnected networks, the routers exchange information about target
system addresses, so that each router can build up a table showing the preferred paths between any
two systems on the interconnected networks.
6. Gate Way:
In a communications network, a network node equipped for interfacing with another network that
uses different protocols.
• A gateway may contain devices such as protocol translators, impedance matching devices, rate
converters, fault isolators, or signal translators as necessary to provide system interoperability. It
also requires the establishment of mutually acceptable administrative procedures between both
networks.
• A protocol translation/mapping gateway interconnects networks with different network
protocol technologies by performing the required protocol conversions.
Step 1: Take a router of model 1841.
Step 2: Take two hub of model Hub-PT.
Step 3: Take two switch of model 2950-24.
Step 4: Take pc0, pc1 for switch0, take pc2, pc3 for switch1.
Step 5: Connect pc0, pc1 to Switch0 with Straight through cable, connect pc2, pc3 to Switch1 with
straight through cable, and connect Switch0 to Hub0 with cross over cable, connect Switch1 to Hub1
with cross over cable. Connect Hub0, Hub1 to Router0 with straight through cable.
Step 6: Router configuration:
Go to Router0 → CLI
Router>enable
Router# configure terminal
Router(config) # interface fast Ethernet 0/0
Router(config-if) #ip address 10.10.1.1
255.0.0.0 Router(config-if) # no shutdown
Router(config-if)# exit
Router(config)#interface fastEthernet 0/0
Router(config-if)#ip address 192.168.1.1
255.255.255.0 Router(config-if)#no shutdown
Step 7: All pc Configuration:
Go to PC0 → Desktop → IP Configura on → Static
IP Address 10.10.1.5
Subnet Mask 255.0.0.0
Default Gateway 10.10.1.1
RESULT:
Thus Install and configure Network Devices is done successfully.
Experiment-1(c)
1(c) Install and configure wired and wireless NIC and transfer files between systems in wired
LAN and wireless LAN. Consider both Adhoc and infrastructure mode of operation.
Aim:- To install and configure wired and wireless NIC and transfer files between systems in wired
LAN and wireless LAN.
After connecting A computer to an ethernet cable, click the Start button, and select Settings.
Select Network and Internet.
In Status, click Network and Sharing Center.
Choose Change adapter settings on the left side menu.
Right-click Ethernet and then choose Properties.
Select Internet Protocol Version 4 (TCP/IPv4), then click Properties.
Set up the IP to use, then click OK to save your settings. You may want to restart your
computer.
Open a web browser to test your connection. In some instances, you may be asked to register
your computer onto CU Boulder's network. If you register your computer, you should clear
your web browser's cache after registration.
The optimal placement is in a central location, free from obstructions that could cause
wireless interference..
Plug an Ethernet cable (typically provided with the router) into the router WAN port. Then,
connect the other end of the Ethernet cable to the modem.
Plug one end of another Ethernet cable into the router LAN port (any port will work)
and the other end of the Ethernet cable into the Ethernet port of a laptop.
It's best if you turn on these devices in the proper order. Turn on the modem first.
When the modem lights are all on, turn on the router. When the router is on, turn on the
computer.
Configure the router name, static or dynamic ip addresses and security password to the
router and save configuration.
After saving the router's configuration settings, unplug the cable that connects the
computer to the router. Then, plug a USB or PC card wireless adapter into the laptop if it
doesn't have a wireless adapter installed or built-in.
Your computer may automatically install the drivers, or you may have to use the setup
CD that came with the adapter.
On your computer and other wireless-enabled devices, find the new network you set up
and connect to the network.
If the hosts are connected to the network via a base station or an access point (fixed
infrastructure), then the network is said to be operating in infrastructure mode.
Cellular networks work in infrastructure mode because all the cell phones connect to
the network through the base stations (cell towers).
In an Ad hoc mode of operation, the wireless hosts can communicate with each other without
an access point.
No fixed infrastructure such as access point is required for the wireless hosts.
RESULT
Thus the Install and Configure Wired and Wireless NIC is done & executed successfully.
Experiment-2
2. Work with the commands Ping, Tracert, Ipconfig, pathping, telnet, ftp, getmac, ARP,
Hostname, Nbtstat, netdiag, and Nslookup
Description:
Networking commands are essential tools used in computer systems to configure, troubleshoot,
monitor, and manage network connections. These commands provide a way to interact with and
diagnose various aspects of network functionality. Below are the key purposes and uses of
networking commands:
Next, let’s take a look at the networking commands.
1. Ping
The Ping command is one of the most widely used commands in the prompt tool, as it allows the
user to check the connectivity of our system to another host.
Purpose: Tests connectivity to a host and measures the round-trip time of packets.
Syntax:
ping <hostname or IP>
ping google.com
C:\>ping:
Ping network configuration commands are versatile and can detect connectivity in Windows, Linux
and MacOS systems. The main purpose of 'ping' is to determine whether a host is reachable and the
quality of the connectivity. 'ping' determines whether a target system reacts quickly by delivering
Internet Control Message Protocol Echo Query messages.
Ip Config:
The command IP config will display basic details about the device’s IP address configuration. Just
type IP config in the Windows prompt and the IP, subnet mask and default gateway that the current
device will be presented. If you have to see full information, then type on command prompt config-
all and then you will see full information. There are also choices to assist you in resolving DNS and
DHCP issues.
C:\>ipconfig: The ipconfig command displays information about the host (the computer your
sitting at)computer TCP/IP configuration.
C:\>ipconfig /all: This command displays detailed configuration information about your
TCP/IP connection including Router, Gateway, DNS, DHCP, and type of Ethernet adapter in
your system.
C:\>Ipconfig /renew: Using this command will renew all your IP addresses that you are currently
(leasing) borrowing from the DHCP server. This command is a quick problem solver if you are
having connection issues, but does not work if you have been configured with a static IP address.
C:\>Ipconifg /release: This command allows you to drop the IP lease from the DHCP
server.
Tracert:
The TRACERT command is used to trace the route during the transmission of the data packet over to
the destination host and also provides us with the “hop” count during transmission.
Using the number of hops and the hop IP address, we can troubleshoot network issues and identify
the point of the problem during the transmission of the data packet.
Syntax:
tracert IP-address (OR)
tracert www.destination_host_name.com
C:\>tracert: The tracert command displays a list of all the routers that a packet has to go through to
get from the computer where tracert is run to any other computer on the internet.
Traceroute: Tracert is a command which can show you the path a packet of information takes from
your computer to one you specify. It will list all the routers it passes through until it reaches its
destination, or fails to and is discarded. In addition to this, it will tell you how long each 'hop' from
router to router takes.
4. Pathping
The pathping command is a network tool that sends pings to intermediate hops to evaluate network
status. It's only available if the Internet Protocol (TCP/IP) protocol is installed in the network adapter
properties.
Syntax:
pathping <hostname or IP>
pathping google.com
C:\>pathping: Pathping is unique to Window’s, and is basically a combination of the Ping and
Tracert commands. Pathping traces the route to the destination address then launches a 25 second test
of each router along the way, gathering statistics on the rate of data loss along each hop.
Telnet command:
The telnet command is used to connect to remote servers and troubleshoot network issues. The
command's syntax is:
telnet [domain name or IP address] [port]
Domain name or IP address: The server's domain name or IP address and Port: The port number on
which the server is listening for connections
Here are some examples of using the telnet command:
Ftp command:
The ftp command uses the File Transfer Protocol (FTP) to transfer files between the local host and a
remote host or between two remote hosts. Remote execution of the ftp command is not
recommended.
The FTP protocol allows data transfer between hosts that use dissimilar file systems. FTP is used to
transfer the files from one device to another device on the Internet. FTP command is very useful to
the FTP client.
Getmac Command:
This command Returns the media access control (MAC) address and list of network protocols
associated with each address for all network cards in each computer, either locally or across a
network. This command is particularly useful either when you want to enter the MAC address into a
network analyzer, or when you need to know what protocols are currently in use on each network
adapter on a computer..
ARP Command:
C:\>arp –a: ARP is short form of address resolution protocol, It will show the IP address of your
computer along with the IP address and MAC address of your router.
Arp
The arp command is a short form for Address Resolution Protocol. This command is used to display
and modify the IP to the physical address translation table used by the address resolution protocol. It
has many options, of which a few are to display current ARP entries, specify an internet address,
delete a host in the ARP table, specify a physical address, and many more.
o arp -a: It shows the ARP cache as of right now. The "-a" command in arp displays current
ARP entries by interrogating the current protocol data.
o arp -d <ip_address>: It deletes a particular ARP cache entry.
Hostname Command:
The HostName command is used to display the host name of the computer or device in a network.
When you run the HostName command in a command prompt or terminal, it will return the name
assigned to the device on the local network. The host name is a unique identifier used to distinguish
devices in a network and is used in various networking protocols and configurations.
Syntax: hostname
This command will output the hostname of your machine, such as DESKTOP-1234ABC.
C:\>hostname:. It simply displays the name of your computer.
Nbtstat command:
nbstat: NetBIOS Statistics and Troubleshooting
The NBTSTAT command is a useful tool in the complex world of Windows networking, giving users
control and insightful information about NetBIOS data. The command-line tool NBTSTAT, which
stands for NetBIOS over TCP/IP Statistics, is essential for maintaining and debugging network
connections.
C:\>nbtstat –a: This command helps solve problems with NetBIOS name resolution. (Nbt stands for
NetBIOS over TCP/IP)
o nbtstat -a <hostname or IP>: It shows the NetBIOS details of the designated remote
machine.
o nbtstat -r: It displays the local NetBIOS name cache and names resolved via broadcast.
Netstat command:
Net stat utilities to debug the network issues: 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). 9 Used without parameters, netstat displays active TCP connections
Syntax :
netstat [-a] [-e] [-n] [-o] [-p Protocol] [-r] [-s] [Interval]
-a : Displays all active TCP connections and the TCP and UDP ports on which the computer is
listening.
-e : Displays Ethernet statistics, such as the number of bytes and packets sent and received This
parameter can be combined with -s.
C:\>netstat: Netstat displays a variety of statistics about a computers active TCP/IP connections. This
tool is most useful when you’re having trouble with TCP/IP applications such as HTTP, and FTP.
Netdiag command:
C:\>net diag: Netdiag is a network testing utility that performs a variety of network diagnostic tests,
allowing you to pinpoint problems in your network. Netdiag isn’t installed by default, but can be
installed from the Windows XP CD after saying no to the install. Navigate to the CD ROM drive
letter and open the support\tools folder on the XP CD and click the setup.exe icon in the
support\tools folder.
Nslookup command:
nslookup: Displays information from Domain Name System (DNS) name servers. C:\>nslookup:
Nslookup is used for diagnosing DNS problems. If you can access a resource by specifying an IP
address but not it’s DNS you have a DNS problem.
- The NSLOOKUP command is used to troubleshoot network connectivity issues in the system. Using the
nslookup command, we can access the information related to our system’s DNS server, i.e., domain name and
IP address.
This command is commonly used to troubleshoot DNS-related issues, check DNS resolution, and
gather information about domain configurations.
C:\>route: The route command displays the computers routing table. A typical
computer, with a single network interface, connected to a LAN, with a router is fairly
simple and generally doesn’t pose any network problems. But if you’re having trouble
accessing other computers on your network, you can use the route command to make sure the
entries in the routing table are correct.
RESULT:
Thus Work with the commands done successfully.
Experiment-3
Aim:-Use Packet tracer software to build network topology and configure using Distance vector
routing protocol
Packet Tracer:
Packet Tracer is a protocol simulator developed by Dennis Frezzo and his team at Cisco Systems.
Packet Tracer (PT) is a powerful and dynamic tool that displays the various protocols used in
networking, in either Real Time or Simulation mode.
Distance Vector Routing Protocol:
A distance vector routing algorithm operates by having each router maintain a table (vector) giving
the best known distance to each destination and which link to use to get there. These tables are
updated by exchanging information with the neighbors. Eventually, every router knows the best link
to reach each destination.
The distance vector routing algorithm is sometimes called by other names, most commonly
the distributed Bellman-Ford routing algorithm
Distance Vector: Let dx(y) be the cost of the least-cost path from node x to node y. Then the least
costs are related by the celebrated Bellman-Ford equation, namely,
Dx(y) = minv{c(x,v) + Dv(y)} for each node y in N
Step 4: Building the Topology – Connecting the Hosts to Hubs and Switches
• Adding a Hub: Select a hub, by clicking once on Hubs and once on a Generic hub.
• Connect PC0 to Hub0 by first choosing Connections.
• Click once on the Copper Straight-through cable
Perform the following steps to connect PC0 to Hub0:
1. Click once on PC0
2. Choose Fast Ethernet
3. Drag the cursor toHub0
4. Click once on Hub0 and choosePort0
5. Notice the green link lights on both the PC0 Ethernet NIC and the Hub0
Port0 showing that the link is active.
Repeat the steps above for PC1 connecting it to Port1 on Hub0. (The actual hub port you choose
does not matter.)
Adding a Switch
Select a switch, by clicking once on Switches and once on a 2950-24 switch. Add the switch by
moving the plus sign "+" below PC2 and PC3 and click once.
• Connect PC2 to Switch0 by first choosing Connections.
• Click once on the Copper Straight-through cable.
• Perform the following steps to connect PC2 to Switch0:
1. Click once on PC2
2. Choose Fast Ethernet
3. Drag the cursor to Switch0
4. Click once on Switch0 and choose FastEthernet0/1
5. Notice the green link lights on PC2 Ethernet NIC and amber light Switch0
FastEthernet0/1 port. The switch port is temporarily not forwarding frames, while it goes
through the stages for the Spanning Tree Protocol (STP) process.
6. After a about 30 seconds the amber light will change to green indicating that the port has
entered the forwarding stage. Frames can now be forwarded out the switch port.
Repeat the steps above for PC3 connecting it to Port3 on switch0 on port Fast Ethernet0/2. (The
actual switch port you choose does not matter.)
Move the cursor over the link light to view the port. Fa means FastEthernet, 100 MbpsEthernet.
The link light for switch port FastEthernet0/3 will begin as amber and eventually change to green as
the Spanning Tree Protocol transitions the port to forwarding.
Go to Router0 → CONFIG
Fast Ethernet 0/0 ip address 192.168.10.1 subnet mask 255.255.255.0 and port status on.
Serial port2/0 ip address 10.0.0.2 subnet mask 255.0.0.0 clock rate 64000 and port status on.
RIP Network addresses 192.168.10.1 and10.0.0.2
Pc0 ip address 192.168.10.2 255.255.255.0 default gateway 192.168.10.1
Go to Router1 → CONFIG
• Fast Ethernet 0/0 ip address 192.168.20.1 subnet mask 255.255.255.0 and port status on.
• Serial port2/0 ip address 10.0.0.3 subnet mask 255.0.0.0 clock rate 64000 and port status on.
• Serial port3/0 ip address 20.0.0.2 subnet mask 255.0.0.0 clock rate 64000 and port status on.
• RIP Network addresses 192.168.20.1,10.0.0.3 and 20.0.0.2
• Pc1 ip address 192.168.20.2 255.255.255.0 default gateway 192.168.20.1
Go to Router2 → CONFIG
• Fast Ethernet0/0 ip address 192.168.30.1 subnet mask 255.255.255.0 and port status on.
• Serial port2/0 ip address 20.0.0.3 subnet mask 255.0.0.0 clock rate 64000 and port status on.
• RIP Network addresses 192.168.30.1 and 20.0.0.3
• Pc2 ip address 192.168.30.2 255.255.255.0 and default gateway 192.168.30.1
Step 7: Start the simulation and analyze the distance vector routing protocol.
RESULT
Thus the Distance vector routing protocol is done & executed successfully
Experiment-4
4. Use Packet tracer software to build network topology and configure using Link State routing
protocol.
Aim: Use Packet tracer software to build network topology and configure using Link State routing
protocol.
Description:
Packet Tracer:
Packet Tracer is a protocol simulator developed by Dennis Frezzo and his team at Cisco Systems.
Packet Tracer (PT) is a powerful and dynamic tool that displays the various protocols used in
networking, in either Real Time or Simulation mode.
Link State routing protocol:
A link state routing protocol is a type of routing protocol that helps determine the best path between
nodes in a network. It's used in packet switching networks, such as the internet, to help routers
decide how to send data packets.
Link-state routing protocols are more like a road map because they create a topological map of the
network and each router uses this map to determine the shortest path to each network. Just as you
refer to a map to find the route to another town, link-state routers use a map to determine the preferred
path to reach another destination.
Routers running link-state routing protocol send information about the state of its links to other
routers in the routing domain. The state of those links refers to its directly connected networks and
includes information about the type of network and any neighboring routers on those networks-hence
the name link-state routing protocol.
The ultimate objective is that every router receives all of the link-state information about all other
routers in the routing area. With this link-state information, each router can create its own topological
map of the network and independently calculate the shortest path to every network.
How it works
Map the network: Each node in the network creates a map of the network's
connectivity. This map shows which nodes are connected to each other.
Share link state information: Each node shares information about its directly connected
links with all other nodes in the network.
Calculate the best path: Each node calculates the best path to every other node in the
network.
Create a routing table: Each node creates a routing table based on the best paths it
calculated.
Procedure:
Link state routing works on the following principle.
• Discover the neighbour and keep their network address.
• Measure the delay or cost to each of its neighbour.
• Construct a packet telling all it has just learned.
• Send the packet to all router.
• Compute the shortest path to every router.
Open the Cisco Packet Tracer software.
• Add the router and PCs according to our design.
• Configure all the routers and PCs.
• Trace the destination in PC’s command prompt.
• Verify the output.
Step 1: Take Five routers model 1841.
Step 2: Take two switch of model 2960- 24.
Step 4: Connect pc0 to Switch0 with Straight through cable, connect pc2 to Switch1 with straight
through cable, and connect Switch0 to Router with Straight cable, connect Switch1 to Router2 with
Straight cable. Connect Router0, Router1, Router2, Router3 and Router4 with each other through
Cross cable.
Step 5: Routers configuration:
Go to Router0 → CLI
Router>enable
Router # configure terminal
Router(config) # interface fastEthernet 0/0
Router(config-if) # ip address 192.168.10.2
255.255.255.0 Router (config-if) # no shutdown
Router(config-if) #exit
Router(config) #interface serial 0/0
Router(config-if) #ip address 10.0.0.3
255.0.0.0 Router(config-if) #no shutdown
Router(config-if) # exit
Router(config) # interface serial 0/1
Router(config-if)#ip address 17.0.0.3
255.0.0.0 Router(config-if) #no shutdown
Router(config-if) # exit
Go to Router1 →CLI
Router > enable
Router # configure terminal
Router(config) # interface serial 0/0
Router(config-if)#ip address 10.0.0.2
255.0.0.0 Router(config-if) # no shutdown
Router(config-if) # exit
Router(config) # interface serial 0/1
Router(config-if) # ip address 11.0.0.1
255.0.0.0 Router(config-if) # no shutdown
Router(config-if)#exit
Go to Router2 →CLI
Router > enable
Router # configure terminal
Router(config) # interface fast Ethernet 0/0
Router(config-if) # ip address 192.168.20.2
255.255.255.0 Router(config-if) # no shutdown
Router(config-if) # exit
Router(config) # interface serial 0/0
Router(config-if) # ip address 17.0.0.2
255.0.0.0 Router(config-if) # no shutdown
Router(config-if) # exit
Router(config) # interface serial 0/1
Router(config-if) # ip address 15.0.0.2
255.0.0.0 Router(config-if) # no shutdown
Router(config-if) # exit
Go to Router3 → CLI
Router > enable
Router # configure terminal
Router(config) # interface serial 0/0
Router(config-if) # ip address 14.0.0.2
255.0.0.0 Router(config-if) # no shutdown
Router(config-if) # exit
Router(config) # interface serial 0/1
Router(config-if) # ip address 15.0.0.2
255.0.0.0 Router(config-if) # no shutdown
Router(config-if) # exit
Go to Router4 → CLI
Router > enable
Router # configure terminal
Router(config) # interface serial 0/0
Router(config-if) # ip address 10.0.0.2
255.0.0.0 Router(config-if) # no shutdown
Router(config-if) # exit
Router(config) # interface serial 0/1
Router(config-if)#ip address 17.0.0.2
255.0.0.0 Router(config-if) #no shutdown
Router(config-if) # exit
RESULT
Thus the Link State routing protocol. is done & executed successfully.
Experiment-5
5. Using JAVA RMI Write a program to implement Basic Calculator.
Aim:- To Use JAVA RMI to Write a program to implement Basic Calculator.
Description:
Remote Method Invocation in Java:
RMI stands for Remote Method Invocation. It is a mechanism that allows an object residing in one
system (JVM) to access/invoke an object running on another JVM. RMI is used to build distributed
applications; it provides remote communication between Java programs. It is provided in the package
java.rmi.
The RMI (Remote Method Invocation) is an API that provides a mechanism to create distributed
application in java. The RMI allows an object to invoke methods on an object running in another
JVM.
The RMI provides remote communication between the applications using two objects stub and
skeleton.
Programme:
Calculator.java
public interface Calculator extends java.rmi.Remote
{
public long add(long a, long b) throws java.rmi.RemoteException;
public long sub(long a, long b) throws java.rmi.RemoteException;
public long mul(long a, long b) throws java.rmi.RemoteException;
public long div(long a, long b) throws java.rmi.RemoteException;
}
CalculatorClient.java
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.net.MalformedURLException;
import java.rmi.NotBoundException;
public class CalculatorClient {
public static void main(String[] args)
{
try
{
Calculator c = (Calculator)Naming.lookup("rmi://localhost/CalculatorService");
System.out.println( c.sub(4, 3) );
System.out.println(c.add(4, 5));
System.out.println(c.mul(3, 6));
System.out.println( c.div(9, 3) );
}
catch (MalformedURLException murle)
{
System.out.println( );
System.out.println("MalformedURLException");
System.out.println(murle);
}
catch (RemoteException re)
{
System.out.println();
System.out.println("RemoteException");
System.out.println(re);
}
catch (NotBoundException nbe)
{
System.out.println();
System.out.println( "NotBoundException");
System.out.println(nbe);
}
catch (java.lang.ArithmeticException ae)
{
System.out.println();
System.out.println("java.lang.ArithmeticException");
System.out.println(ae);
}
}
}
CalculatorImpl.java
public class CalculatorImpl extends java.rmi.server.UnicastRemoteObject implements Calculator
{
// Implementations must have an
//explicit constructor
// in order to declare the
//RemoteException exception
public CalculatorImpl() throws java.rmi.RemoteException
{
super();
}
public long add(long a, long b) throws java.rmi.RemoteException
{
return a + b;
}
public long sub(long a, long b) throws java.rmi.RemoteException
{
return a - b;
}
public long mul(long a, long b) throws java.rmi.RemoteException
{
return a * b;
}
public long div(long a, long b) throws java.rmi.RemoteException
{
return a / b;
}
}
CalculatorServer.java
import java.rmi.Naming; public class CalculatorServer
{
public CalculatorServer()
{
try
{
Calculator c = new CalculatorImpl();
Naming.rebind("rmi://localhost:1099/CalculatorService", c);
}
catch (Exception e)
{
System.out.println("Trouble: " + e);
}
}
public static void main(String args[])
{
new CalculatorServer();
}
}
Now use rmic to create the stub and skeleton class files.
> rmic CalculatorImpl
Running the RMI System
You are now ready to run the system! You need to start three consoles, one for the server, one for the
client, and one for the RMI Registry.
Start with the Registry. You must be in the directory that contains the classes you have written. From
there, enter the following:
> rmiregistry
If all goes well, the registry will start running and you can switch to the next console. In the second
console start the server hosting the CalculatorService, and enter the following:
> java CalculatorServer
It will start, load the implementation into memory and wait for a client connection. In the last
console, start the client program.
> java CalculatorClient
RESULT
Thus the implement Basic Calculator is done & executed successfully.
Experiment-6
6. Implement a Chatting application using JAVA TCP and UDP sockets.
Aim: To Implement a Chatting application using JAVA TCP and UDP sockets.
TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) are both network protocols
that operate at the transport layer, responsible for managing data transmission between applications
on different devices; TCP prioritizes reliable, ordered data delivery while UDP prioritizes speed and
efficiency, even if it means occasional data loss, making it suitable for applications where fast
response time is crucial like online gaming or live streaming.
Procedure:
1. In any Client/Server Application, we need to run the server before the client, because the
server keeps waiting for the client to be connected.
2. Server keeps listening for the client on an assigned IP & Port
3. For establishing connection client must know the IP & Port of the server.
4. When we start Client Application, It creates a connection to the server.
5. After the Successful connection Client & Server Applications can send & receive messages.
Programmes:
Server Code:-
import java.net.*;
import java.util.Scanner;
public class Server
{
public static void main(String[] args) throws Exception
{
ServerSockets s=new ServerSocket(7888);
Socket s=ss.accept();
DataInputStream din=new DataInputStream(s.getInputStream());
String str;
str=din.readUTF();
System.out.println("Client:\t",+str );
DataOutputStream dout=new DataOutputStream(s.getOutputStream());
DataInputStream msg=new DataInputStream(System.in);
while(true)
{
str=din.readUTF();
System.out.print("Client:\t"+str);
System.out.print("Server:\t");
str=msg.readLine();
dout.writeUTF(str);
}
}
}
Client Code:-
import java.io.*;
import java.net.Socket;
import java.util.Scanner;
public class Client
{
public static void main(String[] args) throws Exception
{
Socket s=new Socket("127.0.0.1",7888);
if(s.isConnected())
{
System.out.println("Connected to server");
}
DataInputStream msg=new DataInputStream(System.in);
String str="Start Chat ";
DataOutputStream dout=new DataOutputStream(s.getOutputStream());
dout.writeUTF(str);
System.out.println(str);
DataInputStream din=new DataInputStream(s.getInputStream());
while(true)
{
System.out.print("Client:\t"); str=msg.readLine();
dout.writeUTF(str+"\n");
str=din.readUTF();
System.out.println("Server:\t"+str);
}
}
}
Sample Output:-
Server
Client
Aim: To Create chat application using either UDP protocol.
Description:
UDP (User Datagram Protocol):
User datagram protocol (UDP) is a message-oriented communication protocol that allows computing
devices and applications to send data via a network without verifying its delivery, which is best
suited to real-time communication and broadcast systems.
UDP is not connection-based. In this case, “connectionless” refers to the fact that no connection is
established before communication occurs.
Furthermore, it does not ensure the delivery of the data packets from the server. It is commonly
referred to as the “fire-and-forget” protocol because it is not concerned about whether or not the
client receives the data.
In most cases, UDP is faster than TCP because it does not assure delivery of the packets as TCP does.
User Datagram Protocol (UDP) is a communication protocol that sends data packets between
computers over the internet. It's used for applications that require speed over reliability, such as
gaming, video playback, and voice over IP (VoIP).
Key differences between TCP and UDP:
Connection-oriented vs. Connectionless:
TCP is connection-oriented, meaning it establishes a connection before sending data, while UDP is
connectionless, sending data without first confirming a connection.
Reliability:
TCP guarantees reliable data delivery by checking for errors and retransmitting lost packets, while
UDP does not guarantee delivery and may lose packets without notification.
Data Ordering:
TCP ensures data arrives in the same order it was sent, whereas
UDP does not guarantee data sequence.
Programmes:-
Server code:-
import java.io.*;
import java.net.*;
public class Server
{
public static void main(String[] args) throws Exception
{
DatagramSocket socket=new DatagramSocket(9861);
byte receiveByte[]=new byte[1024];
byte sendByte[]=new byte[1024];
while(true)
{
//data receiving
DatagramPacketreceivePacket= new
DatagramPacket(receiveByte,receiveByte.length);
socket.receive(receivePacket);
String receiveStr=new String(receivePacket.getData());
receiveStr=receiveStr.trim();
System.out.println("Client:"+receiveStr);
//data sending
DataInputStream din=new DataInputStream(System.in);
System.out.print("Server:");
String sendStr=din.readLine();
sendByte=sendStr.getBytes();
InetAddressip=receivePacket.getAddress();
int port=receivePacket.getPort();
DatagramPacketsend Packet= new
DatagramPacket(sendByte,sendByte.length,ip,port);
socket.send(sendPacket);
}
}
}
Client Code:-
import java.net.*;
import java.io.*;
public class Client
{
public static void main(String[] args) throws Exception
{
DatagramSocket socket=new DatagramSocket();
InetAddressip=InetAddress.getLocalHost();
byte sendByte[]=new byte[1024];
byte receiveByte[]=new byte[1024];
while(true)
{
//Data Sending
DataInputStream din=new DataInputStream(System.in);
System.out.print("Client:");
String sendStr=din.readLine();
sendByte=sendStr.getBytes();
DatagramPacketsendPacket= new
DatagramPacket(sendByte,sendByte.length,ip,9861);
socket.send(sendPacket);
//Data Receiving
DatagramPacketreceivePacket=new
DatagramPacket(receiveByte,receiveByte.length);
socket.receive(receivePacket);
String receiveStr=new String(receivePacket.getData());
receiveStr=receiveStr.trim();
System.out.println("Server:"+receiveStr);
}
}
}
Sample Output:-
Server
Client
RESULT
Thus chat application using either TCP or UDP protocol is done & executed successfully.
Experiment-7
7. Implement Hello and Echo commands using JAVA.
Aim: To implement Hello and Echo commands using JAVA.
Description:
Hello command is used to know whether the machine at the other end is working or not. Echo
command is used to measure the round-trip time to the neighbour.
Program:
Source Code:
import java.util.Scanner;
public class Echo
{
public static void main (String[] args)
{
String inData;
Scanner scan = new Scanner( System.in );
System.out.println("Enter the data:");
inData = scan.nextLine();
System.out.println("You entered:" + inData );
}
}
Output:
C:\> javac Echo.java
C:\> java Echo
Enter the data:
Hello World
You entered: Hello World
Socket programming with echo command in java:
Socket programming with the echo command in Java typically involves creating a simple Echo Server
and Echo Client. The server receives a message from the client and sends the same message back —
hence the name echo.
How It Works:
1. The Server listens for client connections.
2. The Client sends a message.
3. The Server reads the message and sends the exact same message back.
4. The Client receives the echoed message.
Echo Server:
import java.io.*;
import java.net.*;
import java.lang.*;
public class eserver
{
public static void main(String args[])throws IOException
{
ServerSocket s=null;
String line;
DataInputStream is;
PrintStream ps;
Socket c=null;
try
{
s=new ServerSocket(8080);
}
catch(IOException e)
{
System.out.println(e);
}
try
{
c=s.accept();
is=new DataInputStream(c.getInputStream());
ps=new PrintStream(c.getOutputStream());
while(true)
{
line=is.readLine();
System.out.println("msg received and sent back to client");
ps.println(line);
}
}
catch(IOException e)
{
System.out.println(e);
}
}
}
OUTPUT:
CLIENT :
Enter the IP address 127.2.3.8
CONNECTION ESTABLISHED
Enter the data CSE
Client received CSE
SERVER :
CONNECTION ACCEPTED
Server received CSE
RESULT:
Thus Implement Hello and Echo commands using JAVA is done & executed successfully.
Experiment-8
Aim: Using Wireshark perform the following operations:
- Inspect HTTP Traffic
- Inspect HTTP Traffic from a Given IP Address,
- Inspect HTTP Traffic to a Given IP Address
Description:
Network protocol analyzer - wireshark
Wireshark: Wireshark is free & Open source network packet analyzer that is used for network
analysis, troubleshooting, etc.
Wireshark is a network packet analyzer. A network packet analyzer presents captured packet data in as
much detail as possible.
Wireshark is quite similar to tcpdump, the major difference between the two is that Wireshark has a
graphical interface with built-in filtering options, which make it easy to use.
Wireshark is a software protocol analyzer, or “packet sniffer” application, used for network
troubleshooting, analysis, software and protocol development, and education. As data streams travel
back and forth over the network, the sniffer “captures” each protocol data unit (PDU) and can decode
and analyze its content according to the appropriate RFC or other specifications.
Wireshark is a useful tool for anyone working with networks and can be used with most labs in the
CCNA courses for data analysis and troubleshooting. This lab provides instructions for downloading
and installing Wireshark.
Required Resources
• PC (Windows 7, 8, or 10 with internet access)
Download and Install Wireshark
Wireshark has become the industry standard packet-sniffer program used by network engineers. This
open source software is available for many different operating systems, including Windows, Mac, and
Linux. In this lab, you will download and install the Wireshark software program on your PC.
Step 1: Download Wireshark.
After completing the activity, click on the Stop button (red square icon) to stop capturing packets.
To stop capturing, press Ctrl+E. Or, go to the Wireshark toolbar and select the red Stop button that's
located next to the shark find.
To use Wireshark to inspect HTTP traffic, capture network traffic, then filter for HTTP, and optionally,
filter by IP address. You can use the filter box to specify "http" for general HTTP traffic, or refine it
further with IP addresses using syntax like ip.src == <IP address> or ip.dst == <IP address>.
Figure 2: Wireshark captures packets and lets you examine their contents.
httr && ip.src == <IP address> to display only HTTP traffic originating from the
specified IP address.
Replace <IP address> with the actual source IP address you want to filter by.
Packet List:
The packet list pane, located at the top of the window, shows all packets found in the active capture
file. Each packet has its own row and corresponding number assigned to it, along with each of these
data points:
No: This field indicates which packets are part of the same conversation. It remains blank until
you select a packet.
Time: The timestamp of when the packet was captured is displayed in this column. The
default format is the number of seconds or partial seconds since this specific capture file was
first created.
Source: This column contains the address (IP or other) where the packet originated.
Destination: This column contains the address that the packet is being sent to.
Protocol: The packet's protocol name, such as TCP, can be found in this column.
Length: The packet length, in bytes, is displayed in this column.
Info: Additional details about the packet are presented here. The contents of this column can
vary greatly depending on packet contents.
Wireshark Filters:-
Capture filters instruct Wireshark to only record packets that meet specified criteria. Filters can also
be applied to a capture file that has been created so that only certain packets are shown. These are
referred to as display filters.
Wireshark provides a large number of predefined filters by default. To use one of these existing filters,
enter its name in the Apply a display filter entry field located below the Wireshark toolbar or in the
Enter a capture filter field located in the center of the welcome screen.
For example, if you want to display TCP packets, type tcp. The Wireshark autocomplete feature shows
suggested names as you begin typing, making it easier to find the correct moniker for the filter you’re
seeking
Another way to choose a filter is to select the bookmark on the left side of the entry field. Choose
Manage Filter Expressions or Manage Display Filters to add, remove, or edit filters. You can also
access previously used filters by selecting the down arrow on the right side of the entry field to display
a history drop-down list. Capture filters are applied as soon as you begin recording network traffic. To
apply a display filter, select the right arrow on the right side of the entry field
View and Analyze Packet Contents
The captured data interface contains three main sections:
The packet list pane (the top section)
The packet details pane (the middle section)
The packet bytes pane (the bottom section)
Statistics in Wireshark
Other useful metrics are available through the Statistics drop-down menu. These include size and
timing information about the capture file, along with dozens of charts and graphs ranging in topic
from packet conversation breakdowns to load distribution of HTTP requests.
Display filters can be applied to many of these statistics via their interfaces, and the results can be
exported to common file formats, including CSV, XML, and TXT
Combine IP Filters:
You can combine source and destination IP filters using the && (and) operator. For example, ip.src ==
192.168.1.10 && ip.dst == 10.0.0.1.
Analyzing Captured Packets:
Packet List Pane:
The top pane displays a list of captured packets with information like protocol, source/destination
addresses, and time.
Packet Details Pane:
Select a packet in the list pane to view detailed information about that packet in the lower panes.
Protocol Tree:
The protocol tree pane shows the hierarchical structure of the packet, allowing you to examine specific
protocol fields.
Statistics:
Use the Statistics menu to analyze the captured traffic, such as IP addresses, protocols, and ports.
Follow TCP Stream:
If you're interested in a specific TCP conversation, use the "Follow TCP Stream" option to see the
entire flow of data between two hosts.
Example:
To capture and filter HTTP traffic from the IP address 192.168.1.10, you would:
1. Start Wireshark and capture traffic.
2. Type http && ip.src == 192.168.1.10 in the filter box and press Enter.
3. This will show HTTP traffic going to the specified IP.
RESULT:
Thus Capture information about packets is done successfully. The Wireshark tool was successfully
used to capture, filter, and analyze network packets for HTTP, TCP, and UDP protocols.