CN LAB File
CN LAB File
APJ
GL BAJAJ
Institute of Technology & Management
Abdul Kalam Technical University, Lucknow, U.P., India]
Department of Applied Computational Science &
Greater Noida Engineering
KCS-653
SESSION:- 2023-2024
Semester - VI
INDEX
S. No. Experiments Date Signature
Brief Theory
RJ 45- Registered Jack 45 (RJ45) is a standard type of physical connector for network cables.
RJ45 connectors are most commonly seen with Ethernet cables and networks. Modern Ethernet
cables feature small plastic plugs on each end that are inserted into the RJ45 jacks of Ethernet
devices.
CAT-6 Cable- Category 6 Cable (Cat 6), is a standardized twisted pair cable for Ethernet and
other network physical layers.
Crimping Tool- Crimping Tool is a device used to conjoin two pieces of metal by deforming one
or both of them in a way that causes them to hold each other.
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, 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 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.
Diagrams for preparing Cross wired connection
Figure 1.2: Color coding sequence for RJ45 connectors at both ends in cross wired connection
Diagram for preparing straight through wired connection
Figure1.3: Straight through wired connection
Figure 1.4: Color coding sequence for RJ45 connectors at both ends in straight through wired
connection
Result- Configuration of networking hardware like RJ-45 connector, CAT-6 cable, crimping
tool, etc. is learned.
Experiment-2
Objective: Configuration of router, hub, switch etc. (using real device or simulators)
Procedure:
Configuration of Hub using Star Topology
Step 1:- Open Cisco packet Tracer Software and choose Generic Hub on workspace.
Step 4:- Now select Simple Message(PDU) from right side of window and click over sender
Step 1:- Open Cisco packet Tracer Software and choose Generic Switch on workspace.
Configuration of Router
3. Global Configuration Mode to Fast Ethernet Interface Mode: Router (config)# interface
FastEthernet 0/0
Step 3: Now click on each end device and enter IP address such as 10.0.0.1 and label the device
with corresponding IP address using text tool available in cisco packet tracer. Be ensure that
router should connect two different networks.
Figure 2.11:IP configuration in end devices
Step 4: Double click router and type router commands to configure router at interface fa0/0 and
fa0/1
Router>enable
Router#configure terminal
Router(config)#hostname R1
Router(config)#interface fastethernet 0/0
Router(config-if )# 10.0.0.1 255.0.0.0
Router(config-if )# no shut down
Procedure: In this experiment students must understand basic networking commands e.g.
ping, tracert etc.
All commands related to Network configuration which includes how to switch to privilege
mode and normal mode and how to configure router interface and how to save this
configuration to flash memory or permanent memory.
This commands includes
• Configuring the Router commands • General Commands to configure network • Privileged
Mode commands of a router • Router Processes & Statistics • IP Commands • Other IP
Command e.g. show ip route etc.
ping:
Verifies IP-level connectivity to another TCP/IP computer by sending Internet Control
Message Protocol (ICMP) Echo Request messages. The receipt of corresponding Echo Reply
messages is displayed, along with round-trip times. Ping is the primary TCP/IP command used
to troubleshoot connectivity, reachability, and name resolution.
You can use ping to test both the computer name and the IP address of the computer. If pinging
the IP address is successful, but pinging the computer name is not, you might have a name
resolution problem. In this case, ensure that the computer name you are specifying can be
resolved through the local Hosts file, by using Domain Name System (DNS) queries, or
through NetBIOS name resolution techniques.
Traceroute:
Determines the path taken to a destination by sending Internet Control Message Protocol
(ICMP) Echo Request messages to the destination with incrementally increasing Time to Live
(TTL) field values. The path displayed is the list of near-side router interfaces of the routers in
the path between a source host and a destination. The near-side interface is the interface of the
router that is closest to the sending host in the path. Used without parameters, tracert displays
help.
To trace the path to the host named www.google.co.in use following command
tracert www.google.co.in
Ipconfig:
This command can be used to set up a device's IPv4 address, subnet mask and default
gateway. These values are entered in following format Ipconfig Entering only ipconfig
returns IP address, subnet default gateway across all interfaces for selected device.
Nslookup (stands for “Name Server Lookup”) is a useful command for getting information
from DNS server. It is a network administration tool for querying the Domain Name System
(DNS) to obtain domain name or IP address mapping or any other specific DNS record. It is
also used to troubleshoot DNS related problems.
5. Ipconfig /all:
This command returns all the addresses but along with IP subnet default gateway of all interfaces, it
also returns server address along DHCP, DNS servers.
Experiment-4
Objective: - Network packet analysis using tools like Wireshark, tcpdump, etc.
The fundamental tool of almost all network traffic collection is tcpdump. It is an open-source
application that comes installed on almost all Unix-like operating systems. Tcpdump is an
excellent collection tool and comes complete with a very complex filtering language. It’s
important to know how to filter the data at collection time in order to end up with a manageable
chunk of data to analyze. Capturing all data from a network device on even a moderately busy
network can create too much data to analyze easily.
In some rare cases, allowing tcpdump to output its capture directly to your screen may be
enough to find what you’re looking for. For example, in writing this article, I captured some
traffic and noticed that my machine was sending traffic to an IP I did not recognize. It turns out
that my machine was sending data to a Google IP address of 172.217.11.142. Since I did not
have any Google products running, nor Gmail open, I did not know why this was happening. I
examined my system and found this:
Tcpdump is a favorite tool among sysadmins because it is a command-line tool. This means
that it doesn’t require a full-blown desktop to run. It is unusual for production servers to provide
a desktop because of the resources that would take, so command-line tools are preferred. As
with many advanced tools, tcpdump has a very rich and arcane language that takes some time
to master. A few of the very basic commands involve selecting the network interface from
which to collect data, and writing that data to a file so it can be exported for analysis elsewhere.
The -i and -w switches are used for this.
file tcpdump_packets
tcpdump_packets: tcpdump capture file (little-endian) - version 2.4 (Ethernet, capture length
262144)
The standard TCP capture file is a pcap file. It is not text so it can only be read by an analysis
program that knows how to read pcap files.
2. WinDump
Most useful open source tools are eventually cloned to other operating systems. When this
happens, the application is said to have been ported over. Windump is a port of tcpdump and
behaves in very similar ways.
One major difference between WinDump and tcpdump is that Windump needs the WinpCap
library installed prior to being able to run WinDump. Despite both WinDump and WinpCap
being provided by the same maintainer, they are separate downloads.
WinpCap is an actual library that needs to be installed. But, once it is installed, WinDump is
an .exe file that needs no installation so it can just run. That may be something to keep in mind
if you’re running a Windows network. You don’t necessarily need WinDump installed on every
machine since you can just copy it over as needed, but you will want WinpCap installed in
order to support WinDump.
As with tcpdump, WinDump can output network data to the screen for analysis, be filtered in
the same way, and also write data to a pcap file for analysis offsite.
7. Wireshark
wireshark is probably the next best-known tool in any sysadmin’s toolkit. It can not only
capture data, but also provides some advanced analysis tools. Adding to its appeal, Wireshark
is open source, and has been ported over to almost every server operating system that exists.
Starting life named Etheral, Wireshark now runs everywhere, including as a standalone
portable app.
If you’re analyzing traffic on a server with a desktop installed, Wireshark can do it all for you.
It can collect the data, and then analyze it all in one spot. However, desktops are not common
on servers, so in many cases, you’ll want to capture the network data remotely and then pull
the resulting pcap file into Wireshark.
At first launch, Wireshark allows you to either load an existing pcap file, or start capturing. If
you elect to capture network traffic, you can optionally specify filters to pare down the amount
of data Wireshark collects. Since its analysis tools are so good, it’s less important to ensure you
surgically identify the data at collection time with Wireshark. If you don’t specify a filter,
Wireshark will simply collect all network data that your selected interface observes.
One of the most useful tools Wireshark provides is the ability to follow a stream. It’s probably
most useful to think of a stream as an entire conversation. In the screenshot below we can see
a lot of data has been captured, but what I am most interested in is that Google IP. I can right-
click it and Follow the TCP Stream to see the entire conversation.
If you’ve captured traffic elsewhere, you can import the pcap file using Wireshark’s File ->
Open dialogue. The same filters and tools that can be used for natively captured network data
are available for imported files.
Result- Network packet analysis using tools like Wireshark, tcpdump, etc.is done and
understood.
Experiment-5
Objective: Network simulation using tools like Cisco Packet Tracer, NetSim, OMNeT++,
NS2, NS3, etc.
Brief Theory:
Cisco Packet Tracer- Packet Tracer allows users to create simulated network topologies by
dragging and dropping routers, switches and various other types of network devices. A
physical connection between devices is represented by a 'cable' item. Cisco Systems claims
that Packet Tracer is useful for network experimentation.
NetSim-NetSim is an end-to-end, full stack, packet level network simulator and emulator. It
provides network engineers with a technology development environment for protocol
modeling, network R&D and military communications.
A network simulator enables users to virtually create a network comprising of devices, links,
applications etc, and study the behavior and performance of the Network.
Figure 5.2 NetSim Enviroment
Some example applications of network simulators are
Building the model – Create a network with devices, links, applications etc
Running the simulation - Run the discrete event simulation (DES) and log different
performance metrics
Visualizing the simulation - Use the packet animator to view the flow of packets
Analyzing the results - Examine output performance metrics such as throughput, delay, loss
etc. at multiple levels - network, link, queue, application etc.
Developing your own protocol / algorithm - Extend existing algorithms by modifying the
simulator’s source C code
OMNeT++ -OMNeT++ (Objective Modular Network Testbed in C++)is a modular,
component-based C++ simulation library and framework, primarily for building network
simulators.OMNeT++ itself is a simulation framework without models for network protocols
like IP or HTTP. The main computer network simulation models are available in several
external frameworks. The most commonly used one is INETwhich offers a variety of models
for all kind of network protocols and technologies like for IPv6, BGP etc. INET also offers a
set of mobility models to simulate the node movement in simulations. The INET models are
licensed under the LGPL or GPL.
Components
Features of NS2
2. It provides substantial support to simulate bunch of protocols like TCP, FTP, UDP, https
and DSR.
NS2 consists of two key languages: C++ and Object-oriented Tool Command Language
(OTcl). While the C++ defines the internal mechanism (i.e., a backend) of the simulation
objects, the OTcl sets up simulation by assembling and configuring the objects as well as
scheduling discrete events. The C++ and the OTcl are linked together using TclCL
NS3- Computer network simulation in the sense connection of two or more computer system
linked together for communication. Networking is the practice of interfacing two or more
computing devices with each other for the purpose of sharing data. Computer networks are
built with a combination of hardware and software.ns-3 is a discrete-event network simulator,
targeted primarily for research and educational use. ns-3 is free software, licensed under the
GNU GPLv2 license, and is publicly available for research, development, and use.
NS-3 is intended to provide better support than in NS-2 for the following items:
• Modularity of components
• Scalability of simulations
• Integration/reuse of externally developed code and software utilities
• Emulation
• Tracing and statistics
• Validation
Result- Network simulation is done using tools like Cisco Packet Tracer, NetSim, OMNeT++,
NS2, NS3, etc.
Experiment-6
Objective:-Socket programming using UDP and TCP (e.g., simple DNS, data & time
client/server, echo client/server, iterative & concurrent servers).
Brief Theory-
10. Stop
Client:
8. Stop
Server:
8. Stop
Client:
1. Create a socket and establish connection with the server
9. Stop
6.3 Write a program to send and receive message between Client and Server using TCP.
Class:
Server Socket:
This class implements server sockets. A server socket waits for requests to come in over the
network. It performs some operation based on that request, and then possibly returns a result
to the requester.
Pseudo-code(methods) Description
ServerSocket() Creates an unbound server socket
6.4 Write a program to send and receive message between Client and Server using
UDP.
Class:
Datagram Socket:
This class represents a socket for sending and receiving datagram packets. A datagram
socket is the sending or receiving point for a packet delivery service. Each packet sent or
received on a datagram socket is individually addressed and routed. Multiple packets sent
from one machine to another may be routed differently and may arrive in any order.
User Datagram Protocol (UDP) broadcasts always enabled on a Datagram Socket. In order to
receive broadcast packets a Datagram Socket should be bound to the wildcard address. In
some implementations, broadcast packets may also be received when a Datagram Socket is
bound to a more specific address.
Pseudo-code(methods) Description
DatagramSocket(int port) Constructs a datagram socket and binds it
to any available port on the local host
machine.
receive(DatagramPacket p) Receives a datagram packet from this
socket
send(DatagramPacket p) Sends a datagram packet from this socket
DatagramPacket(byte[] buf, int length) Constructs a Datagram Packet for
receiving packets of length.
DatagramPacket(byte[]buf,int,length, Constructs a datagram packet for sending
InetAddress address, int port) packets of length to the specified port on
the specified host.
getData() Returns the data buffer
Table 6.2: Psedo Code Discription
Experiment-7
Objective: Configure and connect two PCs using Crossover and Straight forward wire
connection.
Apparatus required (Software): Cisco packet Tracer
Flow Chart:
Browse command prompt and enter ping the other side PCs Ip
address
Pc to Pc connection
established
Procedure:
Step1: Select two end devices (PC, laptop, etc)
Move the cursor to the left corner of environment window and select the option after
click on end device PC0 and PC1.
Step2: Connect the end devices via appropriate wire (Cross over or straight forward)
Take straight forward wire and connect switch with PCs through switch. Take cross
over wire to directly connect with other PC.
\
Step4: Browse command prompt and enter ping the other side PCs Ip address
Go to command prompt of any one of PCs and then enter command Ping IP address
of other PCS.
Step5: Check on the reply if it appears then ok.
Experiment-8
Objective: Configure a DNS server in along with existing network using Cisco Packet
Tracer.
Apparatus required (Software): Cisco packet Tracer
Flow Chart:
Take one more HTTP server and add one website on that.
DNS Configuration
Successful
Procedure:
Step1: Select two end devices (PC, laptop, etc)
Move the cursor to the left corner of environment window and select the option after
click on end device PC0 and PC1.
Step2: Connect the end devices with server via intermediate switch
Take straight forward wire and connect switch with PCs and Server through switch.
\
Step3: Take one more HTTP server and add one website on that.
Select HTTP server after assigning IP address move connect it with same switch and
network. After that go on services and add HTTP html pages of the website.
Step4: Add domain name and map it with logical address on DNS server.
On DNS server go to services and select DNS service add here domain name of
website and map it with IP address.
Step5: Check on the web browser after entering the website domain name inside URL.
Go and check on any one of the web browser and then if website is showing then it is
successful.
Experiment-9
Objective : Configure Routing Information Protocol (RIP) for an autonomous network
using Cisco Packet Tracer.
Flow Chart:
Yes
Configuration Successful
Step1: Configure the Router as per the network topology shown in figure
Configure the interfaces on the R1, R2, and R3 routers with the IP addresses from the table
under the Topology Diagram.
Step 3: Configure Ethernet interfaces of PC1, PC2, and PC3
Configure the Ethernet interfaces of PC1, PC2, and PC3 with the IP addresses and default
gateways from under the Topology Diagram.
Step4: Enable dynamic routing
To enable a dynamic routing protocol, enter global configuration mode and use the Router
command. Enter router? at the global configuration prompt to a see a list of available routing
protocols on your router.
To enable RIP, enter the command router rip in global configuration mode.
R1(config)#router rip
Step 5: Enter classful network addresses
Once We are in routing configuration mode, enter the classful network address for each directly
connected network, using the network command with the following command:
R1(config-router)#network 192.168.4.0
R1(config-router)#network 192.168.5.0
Repeat the same step 4 & 5 for R2 & R3.
Step 6: Check the connection using other side network IP address
Once the network configured then go to any one PCs desktop and enters the other network
address. See the output on command prompt.
ping 192.168.5.0
Step 7: If the reply comes connection will be considered as successful otherwise repeat
the same and troubleshoot from step 3 onward.
Output: Double click PC1 move to desktop then command prompt give the command ping
192.168.5.2 in PC1 you will get reply from PC3.
Experiment-10
Aim: Configure an email server using Cisco Packet Tracer.
Flow Chart:
Compose mail from any one user to another user over the
network
Email Configuration
Successful
Procedure:
Step1: Select two end devices (PC, laptop, etc)
Move the cursor to the left corner of environment window and select the option after
click on end device PC0 and PC1.
Step2: Connect the end devices with email server via intermediate switch
Take straight forward wire and connect switch with PCs and Server through switch.
Step3: Take one more server and add one website on that.
Select server after assigning IP address move connect it with same switch and
network. After that go on services and add HTTP html pages of the website.
Step4: Register users (PCs) email address and Password on email server.
On email server go to services and select email service register here users ID
password.
Step5: Compose mail from any one user to another user over the network
Go and check on any one user side after composing an email for another user and then
Send it.
Step6: Check at receiver side if the same mail is appearing.
Go and check on receiving user side if same emails have been received then ok.