Download as pdf or txt
Download as pdf or txt
You are on page 1of 69

Computer Networks Lab Manual 20EC413

Computer Networks Lab Manual

Subject Code: 4EC02


Semester: 7th
Academic Year: 2023-24

Name of Student: SHALINI R. KOTECHA

Id No.:20EC413

BACHELOR OF TECHNOLOGY
ELECTRONICS AND COMMUNICATION

BIRLA VISVAKARMA MAHAVIDHYALAYA ENGINEERING


COLLEGE
(An Autonomous Institution)

Vallabh Vidyanagar – 388120

1
Computer Networks Lab Manual 20EC413

BIRLA VISHVAKARMA MAHAVIDYALAYA


ELECTRONICS AND COMMUNICATION
DEPARTMENT

Certificate

This is to certify that Ms. Shalini R. Kotecha with ID. No.


20EC413 of Electronics & Communication has satisfactorily
completed the entire practical in the subject of 4EC02 :
Computer Networks.

Subject In-Charge Head of Department


(Prof. Anish Vahora) (Dr. Bhargav Goradiya)

2
Computer Networks Lab Manual 20EC413

INDEX

Sr. Practical Name Page Date Sign


No No.
1 Introduction to RS232 communication & BIOSCOM 4
function.
2 Implementation of code for data transfer between two PCs. 11
3 Introduction to CISCO Packet tracer 16
4 To study about different network command. 28
5 To study about Ipv4 and Ipv6 addressing and subnet. 34
6 To study about Ping and ARP packets and simulation in 39
CISCO packet tracer.
7 To study Virtual LAN and simulate in CISCO packet 47
tracer.
8 Implement Static routing using CISCO packet tracer. 51
9 Implement routing information protocol in CISCO packet 58
tracer.
10 To study about Wireshark software. 64

3
Computer Networks Lab Manual 20EC413

PRACTICAL – 1
AIM: Introduction to RS232 Communication and BIOSCOM Function.
SOFTWARE USED: CISCO Packet Tracer
THEORY:
Serial and Parallel Communication

In serial communication, data is in the form of binary pulses where one represents a
logic HIGH or 5 Volts, and zero represents a logic LOW or 0 Volts. Serial
communication can take many formsdepending on the type of transmission mode
and data transfer. The transmission modes are classified as Simplex, Half Duplex,
and Full Duplex. There will be a source (also known as a sender) and destination
(also called a receiver) for each transmission mode.

Fig. 1: Serial Communication

In data transmission, parallel communication is a method of conveying


multiple binary digits (bits) simultaneously. It contrasts with serial
communication, which conveys only a single bit at a time; this distinction is
one way of characterizing a communications link. This characteristic of
parallel communication makes it much faster than serial communication.

Fig. 2: Parallel Communication

RS232 Serial Bus


RS232 is a standard protocol used for serial communication, it is used for
connecting computer andits peripheral devices to allow serial data exchange

4
Computer Networks Lab Manual 20EC413

between them. In other words, RS-232is a long- established standard that


describes the physical interface and protocol for relatively low-speed serialdata
communication between computers and related devices. As it obtains the
voltage for the path used for the data exchange between the devices. It is used
in serial communication up to 50 feet with the rate of 1.492kbps. RS-232 was
first introduced in 1960 by the ELECTRONIC INDUSTRIES
ASSOCIATION (EIA) as a Recommended Standard.
Information being transferred between data processing equipment and
peripherals is in the form of digital data which is transmitted in either a serial
or parallel mode. Parallel communications are used mainly for connections
between test instruments or computers and printers, while serial is often used
between computers and other peripherals.
RS232 formally defines signals connecting between a DTE (data terminal
equipment) such asa computer terminal, and a DCE (data circuit-terminating
equipment) such as a modem. The standarddefines the electrical characteristics
and timing of signals, the meaning of signals, and the physical size and pin out
of connectors.

Fig. 3: RS232 Communication

Universal Asynchronous Data Receiver &Transmitter (UART) is used in


connection with RS232 for transferring data between printer and computer. The
microcontrollers are not able to handle such kind ofvoltage levels, connectors are
connected between RS232 signals. These connectors are known as the DB-9
Connector of a serial port and they are of two types: Male Connector (DTE) &
Female Connector (DCE).

Fig. 4: DB9 Serial Bus Male and Female Pins

5
Computer Networks Lab Manual 20EC413

Handshaking
Handshaking is the process which is used to transfer the signal from DTE to
DCE to make the connection before the actual transfer of data. The messaging
between transmitter & receiver can be done by handshaking.

DB9 Male Connector

Fig. 5: DB9 Male Connector

DB9 Female Connector

Fig. 6: DB9 Female Connector

6
Computer Networks Lab Manual 20EC413

DB25 Female Connector

Fig. 7: DB25 Female Connector

Working of RS232
RS232 works on the two-way communication that exchanges data to one another.
There are two devices connected to each other, (DTE) Data Transmission
Equipment & (DCE) DataCommunication Equipment which has the pins like TXD,
RXD, and RTS & CTS.
1. Now, from DTE source, the RTS generates the request to send the data.
2. Then from the other side DCE, the CTS, clears the path for receiving the data.
3. After clearing the path, it will give a signal to RTS of the DTE source to send
the signal. Then the bitsare transmitted from DTE to DCE.
4. Now from DCE source, the request can be generated by RTS and CTS of DTE
sources clears the pathfor receiving the data and gives a signal to send the data.
5. This is the whole process through which data transmission takes place.

For example: The signals set to logic 1, i.e., -12V. The data transmission starts from
next bit and to informthis, DTE sends start bit to DCE. The start bit is always ‘0’, i.e.,
+12 V & next 5 to 9 characters is data bits. If we use parity bit, then 8 bits data can be
transmitted whereas if parity doesn’t use, then9 bits are being transmitted. The stop bits
are sent by the transmitter whose values are 1, 1.5 or 2 bits after the data transmission.

7
Computer Networks Lab Manual 20EC413

BIOSCOM Function

The bioscom() function is used in this method in the serial communication


using RS-232 connecter. First, we have to set the port with the settings
depending on our need and availability. In this method,same function is used to
make the settings using control word, to send data to the port and check the
status of the port. These actions are distinguished using the first parameter of
the function. Along with that we are sending data and the port to be used to
communicate.
Declaration
bioscom(int cmd, char abyte, int port)

Note: bioscom use BIOS interrupt 0x14 to perform various RS-232


communications over the I/O port given in port.

Arguments

Argument What it is/does


OR combination of bits that specifies COM port settings (ignored if cmd
abyte =2or 3)
cmd Specifies the I/O operation to perform

port Identifies the I/O port; 0 = COM1, 1 – COM2

CMD argument of bioscom can be one of the following as defined in BIOS.H:

bioscom What it does

0 Sets the communications parameters to the value in abyte


Sends the character in abyte out over the
1 communications line
2 Receives a character from the communications line

3 Returns current status of the communication port

When CMD is equal to 2 or 3 (i.e. _COM_RECEIVE or _COM_STATUS), the


abyte argumentis ignored.

8
Computer Networks Lab Manual 20EC413

When CMD is equal to 0 (_COM_INIT), abyte is an OR combination of the following bits:

bioscom Meaning
0x02 7 DATA BITS
0x03 8 DATA BITS

0x00 1 STOP BIT


0x04 2 STOP BITS

0x00 NO PARITY
0x08 ODD PARITY
0x18 EVEN PARITY

0x00 110 BAUD


0x20 150 BAUD
0x40 300 BAUD
0x60 600 BAUD
0x80 1200 BAUD
0xA0 2400 BAUD
0xC0 4800 BAUD
0xE0 9600 BAUD

For example:
If a byte = (0xE0 | 0x08 | 0x00 | 0x03), the communication port is set to:
• 9600 BAUD RATE
• ODD PARITY
• 1 STOP BIT
• 8 DATA BITS

Return value
For all values of cmd, both functions
return a 16-bit integer.The upper 8 bits
of the return value are status bits:
• If one or more status bits is set to 1, an error has occurred.
• If no status bits are set to 1, the byte was received without error.

9
Computer Networks Lab Manual 20EC413

Fig. 8: Bits of return value

The lower 8 bits of the return value depend on the value of cmd specified:

Value of cmd The lower 8 bits of return value


0 or 3 The lower bits are defined as shown in the
preceding diagram.
1 …
2 The byte read is in the lower bits of the return
value, if there is no error (no upper bits are
set to 1).

CONCLUSION: Thus, from this practical we learned about RS-232 serial


communicationport and how to use function of BIOSCOM with the help of
example.

10
Computer Networks Lab Manual 20EC413

PRACTICAL – 2
AIM: Implementation of Full Duplex Communication between two
PCs.
SOFTWARE USED: CISCO Packet Tracer
THEORY:
Duplex
A duplex communication system is a point-to-point system composed of two
or more connected parties or devices that can communicate with one another
in both directions.
Duplex systems are employed in many communications networks, either to
allow for simultaneous communication in both directions between two
connected parties or to provide a reverse path for themonitoring and remote
adjustment of equipment in the field.
There are two types of duplex communication systems: Full-Duplex
(FDX) and Half- Duplex (HDX).
Full Duplex (FDX)
Full-duplex data transmission means that data can be transmitted in both
directions on a signal carrierat the same time. For example, on a local area
network with a technology that has full- duplex transmission, one
workstation can be sending data on the line while another workstation is
receivingdata. Full-duplex transmission necessarily implies a bidirectional
line (one that can move data in both directions).

The Full Duplex PC to PC communication (Chatting) via RS-232 serial port is


done using 'C'language.
A PC can accommodate at most four serial ports but usually a PC has two RS-
232 serial ports, viz,COM1 and COM2. Any one of the serial ports can be used
in each PC for linking them together. Aserial port at the back of a PC is in the
form of 9-pin (or some-times 25-pin) D-type male connector.

11
Computer Networks Lab Manual 20EC413

Null Modem Connection

Null modem is used to connect two DTE's together. This is used to transfer files between the
computers using different protocols.
Above-mentioned figure shows the wiring of the null modem. The main feature indicated here is
that the to make the computer to chat with the modem rather than another computer. The guest &
host computer connected through the TD, RD, and SG pins. Any data that is transmitted through
TD line from the Host to Guest is received on RD line. The Guest computer must have the same
setup as the Host. The signal ground (SG) line of the both must be shorted so that grounds are
common to each computer.
The Data Terminal Ready (DTR) is looped back to Data Set Ready and Carrier Detect on both
computers. When the Data Terminal Ready is asserted active, then the Data Set Ready and Carrier
Detect immediately become active. At this point, the computer thinks the Virtual Modem to which
it is connected is ready and has detected the carrier of the other modem.

12
Computer Networks Lab Manual 20EC413

All left to worry about now is the Request to Send and Clear to Send.
As both computerscommunicate together at the same speed, flow control is
not needed thus these two lines are also linked together on each computer.
When the computer wishes to send data, it asserts the Request toSend high and
as it is hooked together with the Clear to Send, it immediately gets a reply that
it is ok to send and does so.
The Ring indicator line is only used to tell the computer that there is a ringing
signal on the phone line. As we do not have, a modem connected to the phone
line this is left disconnected.

To know about the RS232 ports available in your computer, Right click on
"My Computer”, Go to 'Properties', Select tab 'Device Manager', go to Ports
(COM & LPT), In that you will find 'Communication Port (Com1)' etc. If you
right click on that and go to properties, you will get devicestatus. Make sure
that you have enabled the port (Use this port is selected).

PROCEDURE:

1) Connection Diagram:

Null modem is a communication method to directly connect two DTEs


(computer, terminal, printer,etc.) using an RS-232 serial cable.
Wiring Configuration
a. The connection diagram shows the wiring of the null-modem that
is intended for PC terminal feels as if some modem is connected
to it rather than the other PC. The two PC terminals are connected
through TxD, RxD and GND pins.
b. The Data Terminal Ready (DTR, pin4) is looped back to Data
Set Ready (DSR, pin 6) and Data Carrier Detect (DCD, pin 1)
on both the PCs.
c. When DTR is asserted active, then the DSR and DCD
immediately become active. Atthis moment, the computer thinks
the virtual modem to which it is connected is ready and has
detected the carrier of the other modem.
d. The lines Request to Send (RTS, pin7) and clear to send (CTS, pin8)
have been linked together. When the computer wishes to send data, it
asserts RTS high which in turn asserts CTS high meaning thereby that

13
Computer Networks Lab Manual 20EC413

the virtual modem has the room for storing thedata and the computer
can send data.

2) Connect the two PCs together using the 3-wire link.


3) Run the program given in the source code on both the PCs.
4) Before sending the data, set both the sending and receiving PC
terminals to the same baudrate, and same format of data bits, parity
bits & stop bits using the macro (pre- processor directive)
'SETTINGS' in the source code.
5) When the source code is compiled and run on both the PCs, the
character strings (whose termination is indicated by pressing ENTER
key) typed in the text entry window of one PCshould appear in the
communication display window of both the PCs.
Declaration
bioscom(int cmd, char a byte, int port)
Note: bioscom use BIOS interrupt 0x14 to perform various RS-232
communications over theI/Oport given in port.
Arguments

Argument What it is/does


OR combination of bits that specifies COM port settings (ignored if cmd
abyte =2or 3)
cmd Specifies the I/O operation to perform

port Identifies the I/O port; 0 = COM1, 1 – COM2

CMD argument of bioscom can be one of the following as defined in BIOS.H:

bioscom What it does

0 Sets the communications parameters to the value in abyte


Sends the character in abyte out over the
1 communications line
2 Receives a character from the communications line

3 Returns current status of the communication port

When CMD is equal to 2 or 3 (i.e., _COM_RECEIVE or _COM_STATUS), the a


byte argument is ignored.

14
Computer Networks Lab Manual 20EC413

When CMD is equal to 0 (_COM_INIT), abyte is an OR combination of the


following bits:

bioscom Meaning
0x02 7 DATA BITS
0x03 8 DATA BITS

0x00 1 STOP BIT


0x04 2 STOP BITS

0x00 NO PARITY
0x08 ODD PARITY
0x18 EVEN PARITY

0x00 110 BAUD


0x20 150 BAUD
0x40 300 BAUD
0x60 600 BAUD
0x80 1200 BAUD
0xA0 2400 BAUD
0xC0 4800 BAUD
0xE0 9600 BAUD

CONCLUSION: In this practical we implemented full duplex communication


between twoPCs.

15
Computer Networks Lab Manual 20EC413

PRACTICAL – 3
AIM: Introduction to CISCO Packet Tracer.
SOFTWARE USED: CISCO Packet Tracer
THEORY:
Cisco Packet Tracer
• Packet Tracer is a protocol simulator developed by Dennis Frezzo
and his team at CiscoSystems.
• Packet Tracer (PT) is a powerful and dynamic tool
that displays the variousprotocols used in
networking, in either Real Time or Simulation mode.
• This includes layer 2 protocols such as Ethernet and PPP, layer 3
protocols such as IP, ICMP, and ARP, and layer 4 protocols such as
TCP and UDP. Routing protocols can alsobe traced.
Interface Overview
When you open Packet Tracer, by default you will be presented with the following
interface:

This initial interface contains ten components. They are explained in the table next:

16
Computer Networks Lab Manual 20EC413
This bar provides:
The File, Edit, Options, View, Tools, Extensions,
1 Menu Bar and Help menus. You will find basic commands such as Open, Save,
Save as Pkz, Print, and Settings and Preferences in these menus. You
will also be able to access the Activity Wizard from the Extensions
menu.
This bar provides shortcut icons to most commonly used menu
2 Main Tool Bar
commands.
This bar provides access to these commonly used workspace tools:
Select, Inspect, Delete, Resize Shape, Place Note, Drawing Palette,
3 Common Tools Add Simple PDU, and Add Complex PDU. See "Workspace Basics"
Bar for more information.

You can toggle between the Physical Workspace and the Logical
Workspace with the tabs on this bar. In Logical Workspace, this bar also
allows you to go back to a previous level in a cluster, create a New
Logical/Physic Cluster, Move Object, Set Tiled Background, and Viewport. In
4 al Workspace Physical Workspace, this bar allows you to navigate through physical
and locations, create a New City, create a New Building, create a New
Navigation Closet, Move Object, apply a Grid to the background, Set
Bar Background, and go to the Working Closet.

This area is where you will create your network, watch simulations, and
5 Workspace view many kinds of information and statistics.

You can toggle between Realtime Mode and Simulation Mode with
the tabs on this bar. This bar also provides buttons to Power Cycle
Realtime/Simulation Devices and Fast Forward Time as well as the Play Control buttons
6
Bar and the Event List toggle button in Simulation Mode. Also, it contains
a clock that displays the relative Time in Realtime Mode and
Simulation Mode.
This box is where you choose devices and connections to put into
theworkspace. It contains the Device-Type
Selection Box and the Device-Specific Selection Box. There's a
Network
7 searchable field that allows you to enter a device name to look for
Component Box
that specific device quickly. Device name shows when you mouse
over the device icon in the Device-Specific Box.

Device-Type This box contains the type of devices and connections available
8
Selection Box inPacket Tracer. The Device-Specific Selection Box will change
depending on which type of device you choose.

17
Computer Networks Lab Manual 20EC413

This box is where you choose specifically which devices you want to
put in your network and which connections to make. In this box, you'll
Device-Specific
9 find devices that may have already been obsolete. You have an option
Selection Box
to hide legacy equipment in the Preferences window under Options.

User Created This window manages the packets you put in the network
10
Packet during simulation scenarios.
Window

Types of Devices

18
Computer Networks Lab Manual 20EC413

19
Computer Networks Lab Manual 20EC413

Steps to build a Topology

1) Start Packet Tracer and Enter Realtime Mode.

20
Computer Networks Lab Manual 20EC413

1) We will begin building our network topology by selecting devices


and the medium throughwhich they will be connected. Several types
of devices and network connections can be used.

2) Building the Topology – Adding Hosts. Single click on the End Devices.

Move the cursor into topology area. You will notice it turns into a plus
“+” sign. Single clickin the topology area and it copies the device.

Add three more hosts.

21
Computer Networks Lab Manual 20EC413

2) Building the Topology – Connecting the Hosts to Hubs and Switches.

To add a Hub, Select Hubs in Network Devices and click on PT hub.

Perform the following steps to connect PC0-PC3 to Hub0:


a) Click on Connections then Choose a Connection Type.
b) Click once on PC0.
c) Choose Fast Ethernet.

22
Computer Networks Lab Manual 20EC413

d) Drag the cursor to Hub0.


e) Click once on Hub0 and choose Fast Ethernet0.

f) Repeat step a-e for the remaining PCs.


g) Notice the green link lights on both the PC0 Ethernet
NIC and the Hub0 Port 0showing that the link is active.

23
Computer Networks Lab Manual 20EC413

Perform the following steps to connect PC to Switch0:


a) Click on Connections then Choose a Connection Type.
b) Click once on PC4.
c) Choose Fast Ethernet.
d) Drag the cursor to Switch0.
e) Click once on Switch0 and choose FastEthernet0/1.
f) Repeat step a-e for PC5.
g) Notice the green link lights on PC4 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.
h) After a about 30 seconds the amber light will change to green
indicating that the port hasentered the forwarding stage. Frames can
now forward outthe switch port.

1) Configuring IP Addresses and Subnet Masks on the Hosts

24
Computer Networks Lab Manual 20EC413

Before we can communicate between the hosts, we need


to configure IP Addresses and SubnetMaskson the
devices. Click once on PC4.

Choose the Config tab: It is here that you can change the name of PC4. It is
also here where you would enter a Gateway IP Address, also known as the
default gateway. We will discuss this later, but this would be the IP address of
the local router. If you want, you can enter the IP Address 192.16.1.1, although
it will not be used in this lab.
Click on Fast Ethernet add the IP Address to 192.168.10.10. Click once in
the Subnet Mask field to8 enter the default Subnet Mask. You can leave this
at 255.255.0.0. We will discuss this later.

25
Computer Networks Lab Manual 20EC413

Also, notice this is where you can change the Bandwidth (speed) and Duplex
of the Ethernet NIC (Network Interface Card).
The default is Auto (auto negotiation), which means the NIC will negotiate
with the hub or switch. The bandwidth and/or duplex can be manually set by
removing the check from the Autobox and choosing the specific option.
Bandwidth – Auto: If the host is connected to a hub or switch port which can
do 100 Mbps, thenthe Ethernet NIC on the host will choose 100 Mbps (Fast
Ethernet). Otherwise, if the hub or switchport can only do 10 Mbps, then the
Ethernet NIC on the host will choose 10 Mbps (Ethernet).
Duplex - Auto Hub: If the host is connected to a hub, then the Ethernet NIC on
the host will chooseHalf Duplex.
Switch: If the host is connected to a switch, and the switch port is configured
as Full Duplex (or Auto negotiation), then the Ethernet NIC on the host will
choose Full Duplex. If the switch port is configured as Half Duplex, then the
9 Ethernet NIC on the host will choose Half Duplex.(Full Duplex is a much
more efficient option.) The information is automatically saved when entered.
Verify the information, to verify the information that you entered, move the
Select tool (arrow) overeach host.

For deleting a device or link, choose the Delete tool and click on the item you wish to
delete. Perform thefollowing steps to connect Hub0 to Switch0:

To connect like-devices, like a Hub and a Switch, we will use a Cross-over cable.
Click once the Cross-over Cable from the Connections options. The link light for
switch port FastEthernet0/4 will begin as amber and eventually change to green as
the Spanning Tree Protocol transitions the port to forwarding.

26
Computer Networks Lab Manual 20EC413

CONCLUSION: Hence in this practical we learned about Cisco packet tracer and
how to operate it.

27
Computer Networks Lab Manual 20EC413

PRACTICAL – 4
AIM : To study about different Network Commands.

SOFTWARE USED: Command Prompt

THEORY:
Windows has some very useful networking utilities that are accessed from a
command line (CMD
Console). On Windows 10 type CMD in the search box to open a command
console. The networking commands are mainly used for getting system
information and troubleshooting networking problems.
Let us look at some commonly used network commands:
ipconfig Command
Another indispensable and frequently used utility that is used for finding
network information aboutyour local machine-like IP addresses, DNS
addresses etc.
Basic Use: Finding Your IP Address and Default Gateway.
Type the command ipconfig at the prompt. The following is displayed:

ipconfig has a number of switches. The most common are:


ipconfig /all – displays more information about the network setup on your
systems including theMAC address.

28
Computer Networks Lab Manual 20EC413

ipconfig /release – release the current IP


address ipconfig /renew – renew IP
address ipconfig /? -shows help
ipconfig /flush dns – flush the dns cache
ping Command
The ping command is a Command Prompt command used to test the ability of the
source computerto reach a specified destination computer.
The ping command is usually used as a simple way to verify that a computer can
communicate overthe network with another computer or network device.
The ping command operates by sending Internet Control Message Protocol (ICMP)
Echo Request messages to the destination computer and waiting for a response. How
many of those responses arereturned, and how long it takes for them to return, are the
two major pieces of information that the ping command provides.

For example, you might find that there are no responses when pinging a network
printer, only to find out that the printer is offline and its cable needs replaced. Or maybe
you need to ping a routerto verify that your computer can connect to it, to eliminate it
as a possible cause for a networking issue.

29
Computer Networks Lab Manual 20EC413

arp Command

This is used for showing the address resolution cache. This command must be
used with a command line switch. arp -a is the most common. Address
Resolution Protocol (ARP) is a procedure for mapping a dynamic Internet
Protocol address (IP address) to a permanent physical machine address in a
local area network (LAN).
The physical machine address is also known as a Media Access Control or MAC
address.

The job of the ARP is essentially to translate 32-bit addresses to 48-bit


addresses and vice- versa.This is necessary because in IP Version 4 (IPv4),
the most common level of Internet Protocol (IP)in use today, an IP address
is 32-bits long, but MAC addresses are 48-bits long.

30
Computer Networks Lab Manual 20EC413

ARP works between network layers 2 and 3 of the Open Systems


Interconnection model (OSI model). The MAC address exists on layer 2 of the
OSI model, the network layer, while the IP addressexists on layer 3, the data
link layer.

31
Computer Networks Lab Manual 20EC413

When a new computer joins a LAN, it is assigned a unique IP address to use


for identification and communication. When an incoming packet destined for
a host machine on a particular LAN arrives at a gateway, the gateway asks the
ARP program to find a MAC address that matches the IP address. A table
called the ARP cache maintains a record of each IP address and its
corresponding MAC address.
All operating systems in an IPv4 Ethernet network keep an ARP cache. Every
time a host requests a MAC address in order to send a packet to another host
in the LAN, it checks its ARP cache to seeif the IP to MAC address translation
already exists. If it does, then a new ARP request is unnecessary. If the
translation does not already exist, then the request for network addresses is sent
and ARP is performed.
ARP broadcasts a request packet to all the machines on the LAN and asks if
any of the machines know they are using that particular IP address. When a
machine recognizes the IP address as its own, it sends a reply so ARP can
update the cache for future reference and proceed with the communication.

netstat Command

This is used for displaying information about TCP/UDP connections and ports.
The netstat command, meaning network statistics, is a Command Prompt
command used to display very detailedinformation about how your computer
is communicating with other computers or network devices.

tracert Command
The tracert command is a Command Prompt command that's used to show
several details about thepath that a packet takes from the computer or device
you're on to whatever destination you specify.

32
Computer Networks Lab Manual 20EC413

You might also sometimes see the tracert command referred to as the trace route
command ortraceroute command.

CONCLUSION: Thus, in this practical we learned about various networking


commandslike ipconfig, arp, netstat, ping and tracert.

33
Computer Networks Lab Manual 20EC413

PRACTICAL – 5
AIM: To study about IPv4 Addressing and Subnetting.
THEORY:
Basic Terms
• Address - The unique number ID assigned to one host or interface in a
network.
• Subnet - A portion of a network that shares a particular subnet address.
• Subnet Mask - A 32-bit combination used to describe
which portion of an address refers to the subnet and which
part refers to the host.
• Interface - A network connection
IPv4 Addressing

An IPv4 address is a 32-bit address that uniquely and universally defines the
connection of a device(for example, a computer or a router) to the Internet.
IPv4 addresses are unique. Theyare unique in the sense that each address
defines one, and only one, connection to the Internet. Two devices on the
Internet can never have the same address at the same time. If a device operating
at the network layer has m connections to the Internet, it needs to have m
addresses. The IPv4 addresses are universal in the sense that the addressing
system must be accepted by any host that wants to be connected to the Internet.
Notations
There are two prevalent notations to show an IPv4 address: binary notation
and dotted decimal notation.
Binary Notation
In binary notation, the IPv4 address is displayed as 32 bits. Each octet is often
referred to as a byte.So, it is common to hear an IPv4 address referred to as a
32-bit address or a 4-byte address. The following is an example of an IPv4
address in binary notation:
01110101 10010101 00011101 00000010
Dotted-Decimal Notation
To make the IPv4 address more compact and easier to read, Internet addresses
are usually written in decimal form with a decimal point (dot) separating the
bytes. The following is the dotted decimalnotation of the above address:
117.149.29.2
Figure below shows an IPv4 address in both binary and dotted-decimal notation. Note that
because each byte(octet) is 8 bits, each number in dotted-decimal notation is a value
ranging from 0 to 255.

34
Computer Networks Lab Manual 20EC413

With an IPv4 IP address, there are five classes of available IP ranges: Class
A, Class B, Class C, Class D and Class E, while only A, B, and C are
commonly used. Each class allows for a range ofvalid IP addresses, shown
in the following table:

Class Range
CLASS A 0.0.0.0 TO
127.255.255.255
CLASS B 128.0.0.0 TO
191.255.255.255
CLASS C 192.0.0.0 TO
223.255.255.255
CLASS D 224.0.0.0 TO
239.255.255.255
CLASS E 240.0.0.0 TO
255.255.255.255

Network Masks

These distinguishes which portion of the address identifies the network and
which portion of theaddress identifies the node.
Default Masks:

1) CLASS A: 255.0.0.0
2) CLASS B: 255.255.0.0
3) CLASS C: 255.255.255.0

35
Computer Networks Lab Manual 20EC413

Subnetting
Subnetting allows you to create multiple logical networks that exist
within a single ClassA, B, or C network. If you do not subnet, you
are only able to use one network from your Class A,B, or C network,
which is unrealistic.
Each data link on a network must have a unique network ID, with
every node on that linkbeing a member of the same network. If you
break a major network (Class A, B, or C) into smaller subnetworks,
it allows you to create a network of interconnecting subnetworks.
Each data link on this network would then have a unique
network/subnetwork ID. Any device, or gateway, that connects n
networks/subnetworks has n distinct IP addresses, one for each
network / subnetwork that it interconnects.
In order to subnet a network, extend the natural mask with some of the bits from
the hostID portion ofthe address in order to create a subnetwork ID. For
example, given a Class C network of 204.17.5.0 which has a natural mask of
255.255.255.0, you can create subnets in this manner:
204.17.5.0 - 11001100.00010001.00000101.00000000
255.255.255.224 - 11111111.11111111.11111111.11100000

|sub|

36
Computer Networks Lab Manual 20EC413

By extending the mask to be 255.255.255.224, you have taken three bits


(indicated by "sub") from the original host portion of the address and used
them to make subnets. With these three bits, it is possible to create eight
subnets. With the remaining five host ID bits, each subnet can have up to 32
host addresses, 30 of which can actually be assigned to a device since host ids
of all zeros or all ones are not allowed (it is very important to remember this).
So, with this in mind, these subnets have been created:

204.17.5.0 255.255.255.224 host address range 1 to 30


204.17.5.32 255.255.255.224 host address range 33 to 62
204.17.5.64 255.255.255.224 host address range 65 to 94
204.17.5.96 255.255.255.224 host address range 97 to 126
204.17.5.128 255.255.255.224 host address range 129 to 158
204.17.5.160 255.255.255.224 host address range 161 to 190
204.17.5.192 255.255.255.224 host address range 193 to 222
204.17.5.224 255.255.255.224 host address range 225 to 254
Note: There are two ways to denote these masks. First, since you use three bits
more than the "natural" Class C mask, you can denote these addresses as having
a 3-bit subnet mask. Or, secondly,the mask of 255.255.255.224 can also be
denoted as /27 as there are 27 bits that are set in the mask.This second method
is used with CIDR. With this method, one of these networks can be described
with the notation prefix/length. For example, 204.17.5.32/27 denotes the
network 204.17.5.32 255.255.255.224.
The network subnetting scheme in this section allows for eight subnets, and
the network might appear as:

Notice that each of the routers in Figure 2 is attached to four subnetworks, one
subnetwork is common to both routers. Also, each router has an IP address for
each subnetwork to which itis attached. Each subnetwork could potentially
support up to 30 host addresses.
This brings up an interesting point. The more host bits you use for a subnet mask,
the more subnetsyou have available. However, the more subnets available, the less
host addresses available per subnet. For example, a Class C network of 204.17.5.0
and a mask of 255.255.255.224 (/27) allows you to have eightsubnets, each with 32
host addresses (30 of which could be assigned to devices).

37
Computer Networks Lab Manual 20EC413

If you use a mask of 255.255.255.240 (/28), the break down is:


204.17.5.0 - 11001100.00010001.00000101.00000000
255.255.255.240 - 11111111.11111111.11111111.11110000
|sub |
Since you now have four bits to make subnets with, you only have four bits
left for host addresses. So, in this case you can have up to 16 subnets, each of
which can have up to 16 host addresses (14 of which can be assigned to
devices).
Take a look at how subnetting is done in a Class B Network. If you have
network 172.16.0.0, then you know that its natural mask is 255.255.0.0 or
172.16.0.0/16. Extending the mask to anything beyond 255.255.0.0 means you
are subnetting. You can quickly see that you have the ability to createa lot more
subnets than with the Class C network. If you use a mask of 255.255.248.0
(/21), how many subnets and hosts per subnet does this allow for? Let us see
this below:
172.16.0.0 - 10101100.00010000.00000000.00000000
255.255.248.0 - 11111111.11111111.11111000.00000000
| sub |
You use five bits from the original host bits for subnets. This allows you to
have 32 subnets (25). After using the five bits for subnetting, you are left with
11 bits for host addresses. This allows eachsubnet so have 2048 host addresses
(211), 2046 of which could be assigned to devices.
Note: In the past, there were limitations to the use of a subnet 0 (all subnet bits
are set to zero) and all 1 subnet (all subnet bits set to one). Some devices would
not allow the use of these subnets.
Advantages of Subnetting
1) Reduces the network traffic by reducing the volume of broadcasts.
2) Helps to surpass the constraints in a local area
network (LAN), for example,the maximum number of
permitted hosts.
3) Enables users to access a work network from their
homes; there is no need toopen the complete network.

CONCLUSION: Thus, in this practical we learned about IPv4 Addressing and


Subnets.

38
Computer Networks Lab Manual 20EC413

PRACTICAL – 6
AIM: To study about ping and ARP packets with simulation in CISCO
Packet Tracer.
SOFTWARE USED: Cisco Packet Tracer
THEORY:
ping Command
The ping command is a Command Prompt command used to test the ability of
the source computerto reach a specified destination computer.
The ping command is usually used as a simple way to verify that a computer
can communicate overthe network with another computer or network device.
The ping command operates by sending Internet Control Message Protocol
(ICMP) Echo Requestmessages to the destination computer and waiting for a
response. How many of those responses arereturned, and how long it takes for
them to return, are the two major pieces of information that theping command
provides.
For example, you might find that there are no responses when pinging a network
printer, only to find outthat the printer is offline and its cable needs replaced. Or
maybe you need to ping a router to verify that your computer can connect to it, to
eliminate it as a possible cause for a networking issue.

39
Computer Networks Lab Manual 20EC413

arp Command

This is used for showing the address resolution cache. This command must be
used with a command line switch. arp -a is the most common. Address
Resolution Protocol (ARP) is a procedure for mapping a dynamic Internet
Protocol address (IP address) to a permanent physical machine addressin a
local area network (LAN).
The physical machine address is also known as a Media Access Control or MAC
address.
The job of the ARP is essentially to translate 32-bit addresses to 48-bit addresses
and vice- versa. This isnecessary because in IP Version 4 (IPv4), the most common
level of Internet Protocol (IP) in use today, an IP address is 32-bits long, but MAC
addresses are 48-bits long.

40
Computer Networks Lab Manual 20EC413

ARP works between network layers 2 and 3 of the Open Systems Interconnection
model (OSImodel). The MAC address exists on layer 2 of the OSI model, the
network layer, while the IP address exists on layer 3, the data link layer.
When a new computer joins a LAN, it is assigned a unique IP address to use
for identification and communication. When an incoming packet destined for

41
Computer Networks Lab Manual 20EC413

a host machine on a particular LAN arrives at a gateway, the gateway asks the
ARP program to find a MAC address that matches the IP address. A table
called the ARP cache maintains a record of each IP address and its
corresponding MAC address.
All operating systems in an IPv4 Ethernet network keep an ARP cache. Every
time a host requestsa MAC address in order to send a packet to another host in
the LAN, it checks its ARP cache to see if the IP to MAC address translation
already exists. If it does, then a new ARP request is unnecessary. If the
translation does not already exist, then the request for network addresses is sent
and ARP is performed.
ARP broadcasts a request packet to all the machines on the LAN and asks if
any of the machines know they are using that particular IP address. When a
machine recognizes the IP address as its own, it sends a reply so ARP can
update the cache for future reference and proceed with the communication

arp Simulation Steps:

1) Design the topology in Cisco packet tracer using one Switch, three Laptops or
PCs.

2) Assign IP addresses to the respective PCs and Laptops.

42
Computer Networks Lab Manual 20EC413

3) Now, open command prompt in Cisco packet tracer and write ping and
then copy the physicaladdress.

43
Computer Networks Lab Manual 20EC413

4) To observe the traffic closely, select the ‘Simulation Mode’ and in the
Simulation Panel clickon “Show all/none” button.

44
Computer Networks Lab Manual 20EC413

5) In the PDU information at Device PC-0, you can see how the PDUs are
traversing between the OSILayers.

It clearly shows--what is happening at 'Out Layer 3' of PC-0:


• The Ping process starts the next ping request.
• The Ping process creates an ICMP Echo Request message and
sends it to the lowerprocess.
• The device sets TTL in the packet header.
• The destination IP address is in the same subnet. The device
sets the next-hop todestination.
6) Now we will click on “Show all/none” button to send ARP traffic from PC-0 to
Switch-0.

45
Computer Networks Lab Manual 20EC413

7) This is the final step where we will test the ARP entries in the ARP
Tables of PC-0, PC- 1,andLaptop-0.

CONCLUSION: By this practical we learned about ping command and


implemented ARP addressresolution by using Cisco packet tracer.
46
Computer Networks Lab Manual 20EC413

PRACTICAL – 7
AIM: To study about Virtual LAN (VLAN) and simulate in
CISCO Packet Tracer.
SOFTWARE USED: Cisco Packet Tracer
THEORY:
VLAN
VLAN is a logical grouping of networking devices. When we create VLAN, we
actually break largebroadcast domain in smaller broadcast domains. Consider
VLAN as a subnet. Same as two differentsubnets cannot communicate with
each other without router, different VLANs also requires router to
communicate.
Advantages of VLAN
• Solve broadcast problem.
• Reduce the size of broadcast domains.
• Allow us to add additional layer of security.
• Make device management easier.
• Allow us to implement the logical grouping of devices by

function instead of location.Steps for Simulating VLAN in Cisco Packet


Tracer
1) Build the topology as shown below:

2) Assign IP addresses to the PCs and Laptops on the Network. For this practical, the IP
addresses assigned are as follows:

47
Computer Networks Lab Manual 20EC413

PC Name IP Address
PC0 192.168.10.10/24
PC1 192.168.10.11/24
Laptop0 192.168.10.12/24
Laptop1 192.168.10.13/24

3) Configure VLAN on all switches. To do this, the following commands will


be used in global configuration:
vlan [vlan number] command is used to create the VLAN.

To create two different VLANs, run the following commands in Switch0’s CLI:
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 1
Switch(config-vlan)#exit
Switch(config)#vlan 2
Switch(config-vlan)#exit
Switch(config)#

4) Assign VLAN Memberships to PC0, PC1, Laptop0 and Laptop 1. Let us


give VLAN 1 to PC0 and Laptop0 along with VLAN 2 to PC1 and Laptop1.
To do this, the following commands will beused in global configuration:

switchport access vlan [vlan number] command is used to assign VLAN to the
interface.

Following commands in Switch0’s CLI will assign VLANs to the interfaces:

witch(config)#interface fastEthernet 0/1


Switch(config-if)#switchport access vlan 1
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/3
Switch(config-if)#switchport access vlan 1
Switch(config-if)#exit
Switch(config)#interface fastEthernet 0/2
Switch(config- if)#switchport access vlan 2
Switch(config-if)#exit

Switch(config)#interface fastEthernet 0/4


Switch(config-if)#switchport access vlan 2
Switch(config-if)#exit
Switch(config)#

5) We have successfully assigned VLAN membership. It's time to test our


configuration. To test this configuration, we will use ping command. ping
48
Computer Networks Lab Manual 20EC413

command is used to test connectivity between two devices. As per our


configuration, devices from same VLAN can communicate.
Devices from different VLANs must not be able to communicate with each other without
router.
6) Testing VLAN Configuration
Access PC's command prompt to test VLAN configuration. Click on PC-0 and click
Command Prompt.
We have two VLAN configurations VLAN 1 and VLAN 2. Let's test VLAN 1 first. In
VLAN1 we have PC0 and Laptop0 with IP addresses 192.168.10.10 and 192.168.10.12
respectively. This PC and Laptop must be able to communicate with each other. At this
point PC0 and Laptop0 fromVLAN 1 should not be allowed to access PC1 and Laptop1
from VLAN 2. VLAN 2 has PC1and Laptop1 with IP addresses 192.168.10.11 and
192.168.13 respectively.

We have successfully implemented VLAN 1 now test VLAN 2.

Same as VLAN 1, PC1 and Laptop1 from VLAN 2 must be able to


communicate with each otherwhile they should not be able to access devices on
VLAN 1 i.e PC0 and Laptop0.

49
Computer Networks Lab Manual 20EC413

We have successfully implemented VLAN 2.


CONCLUSION: By this practical we studied and implemented VLAN Simulation using
CISCOPacket Tracer.

50
Computer Networks Lab Manual 20EC413

PRACTICAL – 8
AIM: To implement Static Routing using CISCO Packet Tracer.
SOFTWARE USED: Cisco Packet Tracer
THEORY:
Static Routing
Static routing is the most secure way of routing. It reduces overhead
from network resources. In this type of routing, we manually add
routes in routing table. It is useful wherenumbers of route are
limited. Like other routing methods static routing also has its pros
and cons.
Advantages of Static Routing
• It is easy to implement.
• It is most secure way of routing, since no information is shared with other routers.
• It puts no overhead on resources

such as CPU or memory.Disadvantages of


Static Routing

• It is suitable only for small network.


• If a link fails it cannot reroute the traffic.
Steps for Simulating Static Routing in Cisco Packet Tracer

1) Build the topology as shown below:

51
Computer Networks Lab Manual 20EC413

2) Assign IP addresses to the PCs on the Network. For this practical, the IP
addresses assigned are asfollows:

Device Connected From Connected To IP Address

PC0 FastEthernet0 Router0’s FastEthernet0/0 8.0.0.2/8

Router0 FastEthernet0/0 PC0’s FastEthernet0 8.0.0.1/8

Router0 Serial0/0/0 Router1’s Serial0/0/0 192.168.0.177/30

Router1 Serial0/0/0 Router0’s Serial0/0/0 192.168.0.178/30

Router1 Serial0/0/1 Router2’s Serial0/0/0 192.168.0.181/30

Router2 Serial0/0/0 Router1’s Serial0/0/1 192.168.0.182/30

Router2 Serial0/0/1 Router3’s Serial0/0/0 192.168.0.189/30

Router3 Serial0/0/0 Router2’s Serial0/0/1 192.168.0.190/30

Router3 FastEthernet0/0 PC1’s FastEthernet0 16.0.0.1/8

PC1 FastEthernet0 Router3’s FastEthernet0/0 16.0.0.2/8

3) We need to configure IP address and other parameters on interfaces before we


could actually use them for routing. Interface mode is used to assign IP address
and other parameters. Interface mode can be accessed from global configuration
mode. Following commands are used to access the global configuration mode:
Router>enable
Router#configure terminal
Router(config)#
From global configuration mode we can enter in interface mode. From there we can
configurethe interface. Following commands will assign IP address on FastEthernet0/0:
Router(config)#interface FastEthernet0/0
Router(config-if)#ip address8.0.0.1 255.0.0.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#

interface fastEthernet 0/0 command is used to enter in interface mode. ip address 8.0.0.1

52
Computer Networks Lab Manual 20EC413

255.0.0.0 command will assign IP address to interface.no shutdown command will bring the
interface up.
exit command is used to return in global configuration mode.
Serial interface needs two additional parameters clock rate and bandwidth. Every serial
cablehas two ends DTE and DCE. These parameters are always configured at DCE end.
Now let’s assign IP address to serial interface:

Router#configure terminal
Router(config)#interface Serial 0/0/0
Router(config-if)#ip
address 192.168.0.177
255.255.255.252
Router(config-if)#clock rate 64000
Router(config-if)#bandwidth 64
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#

Router#configure terminal command is used to enter in global configuration mode.


Router(config)#interface serial 0/0/0 command is used to enter in interface mode.
Router(config-if)#ip address 192.168.0.177 255.255.255.252 command assigns IP address to
interface. For serial link we usually use IP address from /30 subnet.
Router(config-if)#clock rate 64000 and Router(config-if)#bandwidth 64: In real life
environment these parameters control the data flow between serial links and need to be set at
service providers end. In lab environment we need not to worry about these values. We can
use these values.
Router(config-if)#no shutdown command brings interface up.
Router(config-if)#exit command is used to return in global configuration mode.
We will use same commands to assign IP addresses on interfaces of remaining routers. We
need to provided clock rate and bandwidth only on DCE side of serial interface. Following
command willassign IP addresses on interface of Router1:
Router>enable
Router#configure terminal

53
Computer Networks Lab Manual 20EC413

Router(config)#interface Serial 0/0/0


Router(config-if)#ip address 192.168.0.178 255.255.255.252 Router(config-if)#no shutdown
Router(config-if)#exit Router(config)#interface Serial 0/0/1
Router(config-if)#ip address 192.168.0.181 255.255.255.252
Router(config-if)#clock rate 64000
Router(config-if)#bandwidth 64

Router(config-if)#no shutdown Router(config-if)#exit


Now we know how to assign IP addresses on interfaces. We will use same commands to assign IP
addresses on interfaces of Router2:
Router>enable
Router#configure terminal Router(config)#interface Serial 0/0/0
Router(config-if)#ip address 192.168.0.182 255.255.255.252
Router(config-if)#no shutdownRouter(config-if)#exit Router(config)#interface Serial 0/0/1
Router(config-if)#ip address 192.168.0.189 255.255.255.252
Router(config-if)#clock rate 64000
Router(config-if)#bandwidth 64
Router(config-if)#no shutdown
Router(config-if)#exit
Repeat same process for Router3:
Router>enable
Router#configure terminal
Router(config)#interface FastEthernet 0/0 Router(config-if)#ip address 16.0.0.1 255.0.0.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface Serial 0/0/0
Router(config-if)#ip address 192.168.0.190 255.255.255.252 Router(config-if)#no shutdown
Router(config-if)#exit

4) Now routers have information about the networks that they have on their own interfaces.
Routers do not exchange network information between them on their own. We need to
implement a mechanism that insists them to share this information. This mechanism is
called routing. By default, when a packet arrives in interface, router checks destination
filed in packet and compare it with routing table. If it finds a match for destination
network then it will forwardthat packet from related interface. If it does not find a match

54
Computer Networks Lab Manual 20EC413

in routing table then it will discard that packet. This is the default behavior of router. We
do not need to configure directly connected networks.
Run following command from global configuration mode in routers:

Router0:
Router(config)#ip route 8.0.0.0 255.0.0.0 8.0.0.2
Router(config)#ip route 16.0.0.0 255.0.0.0 192.168.0.178

Router1:
Router(config)#ip route 8.0.0.0 255.0.0.0 192.168.0.177
Router(config)#ip route 16.0.0.0 255.0.0.0 192.168.0.182

Router2:
Router(config)#ip route 8.0.0.0 255.0.0.0 192.168.0.181
Router(config)#ip route 16.0.0.0 255.0.0.0 192.168.0.190

Router3:
Router(config)#ip route 8.0.0.0 255.0.0.0 192.168.0.189
Router(config)#ip route 16.0.0.0 255.0.0.0 16.0.0.2

5) That’s all we need to switch packet from one network to another. To


verify the result, we can use ping command. Access the command
prompt of PC0 and use ping command to test the connectivity from PC1.

55
Computer Networks Lab Manual 20EC413

56
Computer Networks Lab Manual 20EC413

We have successfully implemented static routing in our network.

CONCLUSION: By this practical we studied and implemented Static Routing in a


network usingCISCO Packet Tracer.

57
Computer Networks Lab Manual 20EC413

PRACTICAL – 9
AIM: To implement Routing Information Protocol (RIP) using
CISCO PacketTracer.
SOFTWARE USED: Cisco Packet Tracer
THEORY:
Routing Information Protocol (RIP)

RIP routing protocol uses the concept of distance-vector routing.


Routers running RIP protocol learn about the destination networks
from neighboring routers through broadcast messages. Routers
running RIP protocol periodically broadcast the configured
networks from all ports. Listing routers update their routing tables
from these broadcasts. The Routing Information Protocol (RIP) is
one of the oldest distance-vector routing protocols which employ the
hop count as a routing metric. RIP prevents routing loops by
implementing a limit on the number of hops allowed in a path from
source to destination. The largest number of hops allowed for RIP is
15, which limits the size of networks that RIP can support.
Steps for Simulating Routing Information Protocol (RIP) in Cisco Packet Tracer

1) Build the topology as shown below:

2) Assign IP addresses to the PCs on the Network. For this practical, the IP addresses
assigned areas follows:

58
Computer Networks Lab Manual 20EC413

Device Connected From Connected To IP Address


PC0 FastEthernet0 Router0’s FastEthernet0/0 8.0.0.2/8
Router0 FastEthernet0/0 PC0’s FastEthernet0 8.0.0.1/8
Router0 Serial0/0/0 Router1’s Serial0/0/1 192.168.1.177/30
Router0 Serial0/0/1 Router2’s Serial0/0/1 192.168.1.182/30
Router1 Serial0/0/0 Router2’s Serial0/0/0 192.168.1.178/30
Router1 Serial0/0/1 Router0’s Serial0/0/0 192.168.1.189/30
Router2 Serial0/0/0 Router1’s Serial0/0/0 192.168.1.190/30
Router2 Serial0/0/1 Router0’s Serial0/0/0 192.168.1.181/30
Router2 FastEthernet0/0 PC1’s FastEthernet0 16.0.0.1/8
PC1 FastEthernet0 Router2’s FastEthernet0/0 16.0.0.2/8

3) We need to configure IP address and other parameters on interfaces before we


could actually use them for routing. Interface mode is used to assign IP address
and other parameters. Interface mode can be accessed from global configuration
mode. Following commands are used to access the global configuration mode:
Router>enable
Router#configure terminal
Router(config)#
From global configuration mode we can enter in interface mode. From there we can
configure the interface. Following commands will assign IP address on FastEthernet0/0:
Router(config)#interface FastEthernet0/0
Router(config-if)#ip address 8.0.0.1 255.0.0.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#
interface fastEthernet 0/0 command is used to enter in interface mode. ip address
8.0.0.1
255.0.0.0 command will assign IP address to interface.no shutdown command will bring
the interface up.
exit command is used to return in global configuration mode.
Serial interface needs two additional parameters clock rate and bandwidth. Every serial
cable has two ends DTE and DCE. These parameters are always configured at DCE end.
Now let’s assign IP address to serial interface:
Router#configure terminal
Router(config)#interface Serial 0/0/0
Router(config-if)#ip address 192.168.1.177 255.255.255.252
Router(config-if)#clock rate 64000

59
Computer Networks Lab Manual 20EC413

Router(config-if)#bandwidth 64
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface Serial 0/0/1
Router(config-if)#ip address 192.168.1.182 255.255.255.252
Router(config-if)#clock rate 64000
Router(config-if)#bandwidth 64
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#
Router#configure terminal command is used to enter in global configuration mode.
Router(config)#interface serial 0/0/0 command is used to enter in interface mode.
Router(config-if)#ip address 192.168.0.177 255.255.255.252 command assigns IP
address tointerface. For serial link we usually use IP address from /30 subnet.
Router(config-if)#clock rate 64000 and Router(config-if)#bandwidth 64: In real life
environment these parameters control the data flow between serial links and need to be set
at service providers end. In lab environment we need not to worry about these values. We
can use these values.
Router(config-if)#no shutdown command brings interface up.
Router(config-if)#exit command is used to return in global configuration mode.
We will use same commands to assign IP addresses on interfaces of remaining routers. We
need to provided clock rate and bandwidth only on DCE side of serial interface.

Following command will assign IP addresses on interface of Router1:


Router>enable
Router#configure terminal
Router(config)#interface Serial 0/0/0
Router(config-if)#ip address 192.168.1.178 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface Serial 0/0/1
Router(config-if)#ip address 192.168.1.189 255.255.255.252
Router(config-if)#clock rate 64000
Router(config-if)#bandwidth 64
Router(config-if)#no shutdown
Router(config-if)#exit
Now, use same commands to assign IP addresses on interfaces of Router2:
Router>enable

60
Computer Networks Lab Manual 20EC413

Router#configure terminal
Router(config)#interface FastEthernet 0/0
Router(config-if)#ip address 16.0.0.1 255.0.0.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface Serial 0/0/0
Router(config-if)#ip address 192.168.1.190 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface Serial 0/0/1
Router(config-if)#ip address 192.168.1.181 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
4) Now routers have information about the networks that they have on their own
interfaces. Routers will not exchange this information between them on their
own. We need to implement RIP routing protocol that will insist them to share
this information.

Run following command from global configuration mode in routers:Router0:


Router(config)#router rip
Router(config-router)# network 8.0.0.0
Router(config-router)# network 192.168.1.0

router rip command tell router to enable the RIP routing protocol.
network command allows us to specify the networks which we want to advertise. We
onlyneed to specify the networks which are directly connected with the router.

That’s all we need to configure the RIP. Follow same steps on remaining routers.

Router1:
Router(config)#router rip
Router(config-router)# network 192.168.1.0
Router2:
Router(config)#router rip
Router(config-router)# network 16.0.0.0
Router(config-router)# network 192.168.1.0

61
Computer Networks Lab Manual 20EC413

5) Our network is ready to take the advantage of RIP routing. To verify the setup,
we will use ping command. ping command is used to test the connectivity
between two devices.
Access the command prompt of PC1 and use ping command to test the connectivity from
PC0.

62
Computer Networks Lab Manual 20EC413

We have successfully implemented RIP routing in our network.


CONCLUSION: By this practical we studied and implemented Routing Information
Protocol(RIP)in a network using CISCO Packet Tracer.

63
Computer Networks Lab Manual 20EC413

PRACTICAL – 10
AIM : To study about Wireshark Software.
SOFTWARE USED : Wireshark
THEORY:

Wireshark
Wireshark is a network packet analyzer. A network packet analyzer presents
captured packet data in as much detail as possible. The term packet sniffer is
also used for such software.
You could think of a network packet analyzer as a measuring device for
examining what’s happening inside a network cable, just like an electrician
uses a voltmeter for examining what’s happening inside an electric cable (but
at a higher level, of course).
In the past, such tools were either very expensive, proprietary, or both.
However, with the advent ofWireshark, that has changed. Wireshark is
available for free, is open source, and is one of the best packet analyzers
available today.

Reasons for using Wireshark

• Network administrators use it to troubleshoot network problems.


• Network security engineers use it to examine security problems.
• QA engineers use it to verify network applications.
• Developers use it to debug protocol implementations.
• People use it to learn network protocol internals.

Features of Wireshark
• Available for UNIX and Windows.
• Capture live packet data from a network interface.

64
Computer Networks Lab Manual 20EC413

• Open files containing packet data captured with


tcpdump/WinDump, Wireshark, andmany other packet capture
programs.
• Import packets from text files containing hex dumps of packet data.
• Display packets with very detailed protocol information.
• Save packet data captured.
• Export some or all packets in a number of capture file formats.
• Filter packets on many criteria.
• Search for packets on many criteria.
• Colorize packet display based on filters.
• Create various statistics.

Getting Wireshark

In order to run Wireshark, you will need to have access to a computer that
supports both Wireshark and the libpcap or WinPCap packet capture library.
The libpcap software will be installed for you, if it is not installed within your
operating system, when you install Wireshark.
Download and install the Wireshark software:
• Go to http://www.wireshark.org/download.html and download and install the
software.

Running Wireshark
When you run the Wireshark program, the Wireshark graphical user interface
shown in figure belowwill be displayed. Initially, no data will be displayed in the
various windows.

65
Computer Networks Lab Manual 20EC413

Five Major Components of Wireshark


1. The command menus are standard pull down menus located at the top of the
window. Of interestto us now is the File and Capture menus. The File menu
allows you to save captured packet data or open a file containing previously
captured packet data and exit the Wireshark application. The Capture menu
allows you to begin packet capture.
2. The packet-listing window displays a one-line summary for each packet
captured, including thepacket number (assigned by Wireshark; this is not a
packet number contained in any protocol’s header), the time at which the
packet was captured, the packet’s source and destination addresses, the
protocol type, and protocol-specific information contained in the packet. The
packet listing canbe sorted according to any of these categories by clicking
on a column name. The protocol type field lists the highest-level protocol
that sent or received this packet, i.e., the protocol that is the source or ultimate
sink for this packet.
The packet-header details window provides details about the packet selected
(highlighted) in the packet listing window. These details include information about
the Ethernet frame and IP datagram that contains this packet. The amount of Ethernet
and IP- layer detail displayed can be expanded or minimized by clicking on the right-
pointing or down-pointing arrow head to the leftof the Ethernet frame or IP datagram
line in the packet details window. If the packet has been carried over TCP or UDP,
TCP or UDP details will also be displayed, which can similarly be expanded or
minimized. Finally, details about the highest-level protocol that sent or received this

66
Computer Networks Lab Manual 20EC413

packet are also provided.


3. The packet-contents window displays the entire contents of the captured
frame, in both ASCII and hexadecimal format.
4. Towards the top of the Wireshark graphical user interface, is the
packet display filter field, into which a protocol name or other
information can be entered in order to filter the information
displayed in the packet-listing window (and hence the packet-
header and packet-contents windows). In the example below, we’ll
use the packet-display filter field to have Wireshark hide (not
display) packets except those that correspond to HTTP messages.
Steps to use Wireshark
1) Start your favorite web browser, which will display your selected homepage.

2) Start up the Wireshark software. You will initially see a window


similar to that shownin figures above, except that no packet data
will be displayed in the packet listing, packet-header, or packet-
contents window, since Wireshark has not yet begun capturing
packets.
3) To begin packet capture, select the Capture pull down
menu and select Options.This will cause the “Wireshark:
Capture Options” window to be displayed, as shown below.

4) Click on the interface you want to capture. Press Start.


5) Once you begin packet capture, a packet capture summary window will
appear. This window summarizes the number of packets of various types
that are being captured, and contains the Stopbutton that will allow you to
stop packet capture. Don’t stop packet capture yet.
6) While Wireshark is running, enter the URL: http://gaia.cs.umass.edu/wireshark-

67
Computer Networks Lab Manual 20EC413

labs/INTRO- wireshark-file1.html, and have that page displayed in your browser.


In order to display this page, your browser will contact the HTTP server at
facebook.com and exchange HTTP messages withthe server in order to download
this page.
7) After your browser has displayed the INTRO-wireshark-file1.htmlpage,
stop Wireshark packet capture by selecting stop in the Wireshark capture
window. This will cause the Wiresharkcapture window to disappear and the
main Wireshark window to display all packets captured since you began
packet capture. The main Wireshark window should now look similar to
Figures above. You now have live packet data that contains all protocol
messages exchanged between your computer and other network entities.
The HTTP message exchanges with the gaia.cs.umass.edu web server
should appear somewhere in the listing of packets captured. But there will
be many other types of packets displayed as well even though the only action
you took was to download a web page, there were evidently many other
protocols running on your computerthat are unseen by the user.
8) Type in “http” (without the quotes, and in lower case – all protocol names
are in lower case in Wireshark) into the display filter specification window
at the top of the main Wireshark window. Then select Apply (to the right of
where you entered “http”). This will cause only HTTP message to be
displayed in the packet-listing window.
9) Select the first http message shown in the packet-listing window. This
should be the HTTP GET message that was sent from your computer to the
gaia.cs.umass.edu HTTP server. When youselect the HTTP GET message,
the Ethernet frame, IP datagram, TCP segment, and HTTP message header
information will be displayed in the packet-header window3. By clicking on
rightpointing and down-pointing arrowheads to the left side of the packet
details window, minimize the amount of Frame, Ethernet, Internet Protocol,
and Transmission Control Protocol information displayed. Maximize the
amount information displayed about the HTTP protocol. Your Wireshark
display should now look roughly as shown in Figures above. (Note, in
particular, the minimized amount of protocol information for all protocols
except HTTP, and the maximized amount of protocol information for HTTP
in the packet-header window).
10) Exit Wireshark.

68
Computer Networks Lab Manual 20EC413

We have successfully operated Wireshark Software.

CONCLUSION: By this practical we learned about how to operate and use of Wireshark
software.

69

You might also like