You are on page 1of 40

LIST OF EXPERIMENTS

Sr. No. Title LO PSO PI

1 Study of Transmission media and network components 1 2,3 2.3.1,3.3.1


5.2.1

2 Error detection using CRC 2 2,3 2.3.1,3.3.1


5.2.1

3 Study of Networking commands. 3 2,3 2.3.1,3.3.1


5.2.1

4 TCP data traffic generation using NS2 4 2,3 2.3.1,3.3.1


5.2.1

5 Static routing using GNS3 5 2,3 2.3.1,3.3.1


5.2.1

6 Dynamic routing using GNS3 5 2,3 2.3.1,3.3.1


5.2.1

7 Study of TCP/IP packet analysis using wireshark 6 2,3 2.3.1,3.3.1


5.2.1
Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
EXPERIMENT NO. 01
Aim: To study transmission media and different components of computer network.

Theory:

Transmission medium:In a data transmission system, the transmission medium is the physical path
between transmitter and receiver. The transmission media that are used to convey information can be
classified as guided or unguided. Guided media provide a physical path along which the signals are
propagated; these include twisted pair, coaxial cable, and optical fiber. Unguided media employ an
antenna for transmitting through air, vacuum, or water. In considering the design of data transmission
systems, key concerns are data rate and distance: the greater the data rate and distance the better.A
number of design factors relating to the transmission medium and the signal determine the data rate and
distance:

• Bandwidth: All other factors remaining constant, the greater the bandwidth of a signal, the
higher the data rate that can beachieved.

• Transmission impairments: Impairments, such as attenuation, limit the distance. For guided
media, twisted pair generally suffers more impairment than coaxial cable, which in turn suffers
morethan opticalfiber.

• Interference: Interference from competing signals in overlapping frequency bands can distort
or wipe out a signal. Interference is of particular concern for unguided media but is also a problem with
guided media. For guided media, interference can be caused by emanations from nearby cables. For
example, twisted pairs are often bundled together and conduits often carry multiple cables. Interference
can also be experienced from unguided transmissions.Proper shielding of a guided medium can
minimize thisproblem.

• Number of receivers: A guided medium can be used to construct a pointtopoint link or a


shared link with multiple attachments. In the latter case, each attachment introduces some attenuation
and distortion on the line, limiting distance and/or data rate. For guided transmission media,the
transmission capacity, in terms of either data rate or bandwidth, depends critically on the distance and
on whether the medium is pointtopoint ormultipoint.

Figure 1.1 Transmission characteristics of Guided Media

Computer Communication and NetworkingPage 1


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
• Unguided transmission techniques commonly used for information communications include
broadcast radio, terrestrial microwave, and satellite. Infrared transmission is used in some LAN
applications.

Networking Devices:

HUB
Hub is one of the basic icons of networking devices which works at physical layer and hence connect
networkingdevicesphysicallytogether.Hubsarefundamentallyusedinnetworksthatusetwistedpair
cabling to connect devices. They are designed to transmit the packets to the other appended devices
without altering any of the transmitted packets received. They act as pathways to direct electrical
signals to travel along. They transmit the information regardless of the fact if data packet is destined for
the device connected ornot.

Hub falls in two categories:


Active Hub: They are smarter than the passive hubs. They not only provide the path for the data
signals infact they regenerate, concentrate and strengthen the signals before sending them to their
destinations. Active hubs are also termed as ‘repeaters’.
Passive Hub: They are more like point contact for the wires to built in the physical network. They have
nothing to do with modifying the signals.

Ethernet Hubs
It is a device connecting multiple Ethernet devices together and makes them perform the functions as a
single unit. They vary in speed in terms of data transfer rate. Ether utilizes Carrier Sense
MultipleAccess with CollisionDetect (CSMA/CD) to control Media access. Ethernet hub
communicates inhalfduplexmodewherethechancesofdatacollisionareinevitableatmostofthetimes.

Switches
Switches are the linkage points of an Ethernet network. Just as in hub, devices in switches are
connected to them through twisted pair cabling. But the difference shows up in the manner both the
devices; hub and a switch treat the data they receive. Hub works by sending the data to all the ports on
the device whereas a switch transfers it only to that port which is connected to the destination device.
A switch does so by having an inbuilt learning of the MAC address of the devices connected to it. Since
the transmission of data signals are well defined in a switch hence the network performance is
consequently enhanced. Switches operate in fullduplexmode where devices can send and receivedata
from the switch at the simultaneously unlike in halfduplex mode. The transmission speed in switches is
double than in Ethernet hub transferring a 20Mbps connection into 30Mbps and a 200Mbps connection
to become 300Mbps. Performance improvements are observed in networking with the extensive usage
of switches in the moderndays.

Computer Communication and NetworkingPage 2


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programme in ElectronicsEngineering
Bridges
A bridge is a computer networking device that builds the connection with the other bridge networks
which use the same protocol. It works at the Data Link layer of the OSI Model and connects the
different networks together and develops communication between them. It connects two localarea
networks; two physical LANs into larger logical LAN or two segments of the same LAN that use
thesame protocol.
Apart from building up larger networks, bridges are also used to segment larger networks
into smaller portions. The bridge does so by placing itself between the two portions of two physical
networks and controlling the flow of the data between them. Bridges nominate to forward the data after
inspecting into the MAC address of the devices connected to every segment. The forwarding of the data
is dependent on the acknowledgement of the fact that the destination address resides on some other
interface. It has the capacity to block the incoming flow of data as well. TodayLearningbridges have
been introduced that build a list of the MAC addresses on the interface by observing the traffic on the
network. This is a leap in the development field of manually recording of MACaddresses.

Types of Bridges:
There are mainly three types in which bridges can be characterized:
 Transparent Bridge: As the name signifies, it appears to be transparent for the other devices
on the network. The other devices are ignorant of its existence. It only blocks or forwards the data as
per the MACaddress.
 Source Route Bridge: It derives its name from the fact that the path which packet takes
through the network is implanted within the packet. It is mainly used in Token ringnetworks.
 Translational Bridge: The process of conversion takes place via Translational Bridge. It
converts the data format of one networking to another. For instance Token ring to Ethernet and vice
versa.

Switches superseding Bridges:


Ethernet switches are seen to be gaining trend as compared to bridges. They are succeeding on the
account of provision of logical divisions and segments in the networking field. Infact switches are
being referred to as multiport bridges because of their advancedfunctionality.

Routers
Routers are network layer devices and are particularly identified as Layer 3 devices of the OSI Model.
They process logical addressing information in the Network header of a packet such as IP Addresses.
Router is used to create larger complex networks by complex traffic routing. It has the ability to
connect dissimilar LANs on the same protocol. It also has the ability to limit the flow of broadcasts. A
router primarily comprises of a hardware device or a system of the computer which has more than one
network interface and routingsoftware.

Functionality:
When a router receives the data, it determines the destination address by reading the header of the
packet. Once the address is determined, it searches in its routing table to get know how to reach the
destination and then forwards the packet to the higher hop on the route. The hop could be the final
destination or another router.
Routing tables play a very pivotal role in letting the router makes a decision. Thus a routing table is
ought to be updated and complete. The two ways through which a router can receive information are:
 StaticRouting:Instaticrouting,theroutinginformationisfedintotheroutingtablesmanually. It does
not only become a timetaking task but gets prone to errors as well. The manual updating isalso

Computer Communication and NetworkingPage 3


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
required in case of statically configured routers when change in the topology of the network or in the
layout takes place. Thus static routing is feasible for tinniest environments with minimum of one or two
routers.
 Dynamic Routing: For larger environment dynamic routing proves to be the practical solution.
The process involves use of peculiar routing protocols to hold communication. The purpose of
theseprotocols is to enable the other routers to transfer information about to other routers, so that the
other routers can build their own routing tables.

Gateways
Gateway is a device which is used to connect multiple networks and passes packets from one packet to
the other network. Acting as the ‘gateway’ between different networking systems or computer
programs, a gateway is a device which forms a link between them. It allows the computer programs,
either on the same computer or on different computers to share information across the network through
protocols. A router is also a gateway, since it interprets data from one network protocol to another.

Others such as bridge converts the data into different forms between two networking systems. Then a
software application converts the data from one format into another. Gateway is a viable tool totranslate
the data format, although the data itself remains unchanged. Gateway might be installed in some other
device to add its functionality intoanother.

Conclusion: Thus we have studied transmission media used in computer network as well as different
hardware devices used in network.

Computer Communication and NetworkingPage 4


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering

EXPERIMENT NO. 02
Aim: Write a program to implement error detection using
CRC .Theory:
Cyclic Redundancy Check (CRC) An error detection mechanism in which a parity bits are appended to a blo
A CRC is derived using a more complex algorithm than the simple CHECKSUM, involving MODULO ARITH

NAME Polynomial Application


CRC8 X +X +X+1
8 2
ATM header
CRC- X +X +X +X +X +1
10 9 5 4 2
ATM AAL
10CRC- X +X +X +1
16 12 5
HDLC
16CRC- X +X +X +X +X +X +X +X +X +X +X +X +X +X+1
32 26 23 22 16 12 11 10 8 7 5 4 2
LANs
32

Requirements of CRC :
A CRC will be valid if and only if it satisfies the following requirements:
1. It should have exactly one less bit thandivisor.
2. Appending the CRC to the end of the data unit should result in the bit sequence which isexactly
divisible by thedivisor.
The various steps followed in the CRC method are:
1. A string of n as is appended to the data unit. The length of predetermined divisor is n+1.
2. The newly formed data unit i.e. original data + string of n as are divided by the divisor using binary
division and remainder is obtained. This remainder is calledCRC.
Now, string of n Os appended to data unit is replaced by the CRC remainder (which is also of n bit).
4. The data unit + CRC is then transmitted toreceiver.
5. The receiver on receiving it divides data unit + CRC by the same divisor & checks theremainder.
6. If the remainder of division is zero, receiver assumes that there is no error in data and it acceptsit.
7. If remainder is nonzero then there is an error in data and receiver rejectsit.

Computer Communication and NetworkingPage 5


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering

For example, if data to be transmitted is 1001 and predetermined divisor is 1011. The procedure given below is u

1. String of 3 zeroes is appended to 1011 as divisor is of 4 bits. Now newly formed data is
1011000.
2. Data unit 1011000 is divided by 1011.

Computer Communication and NetworkingPage 6


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering

During this process of division, whenever the leftmost bit of dividend or remainder is 0, we usea string of Os of s
At the receiver side, data received is1001110.
This data is again divided by a divisor1011.
The remainder obtained is 000; it means there is noerror.

Conclusion:ThuswehavestudiedandimplementedCRCsuccessfully
CRC can detect all the burst errors that affect an odd number ofbits.
The probability of error detection and the types of detectable errors depends on the choice ofdivisor.

Computer Communication and NetworkingPage 7


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
Calculation Of CRC:-

/* Calculation of CRC (Cyclic Redundancy Check)*/

#include<conio.h>

#include<stdio.h>

void main()

inti,j,n,g,a,arr[20],gen[20],b[20],q[20],s;

clrscr();

printf("Transmitter side:");

printf("\nEnterno. of data bits:");

scanf("%d",&n);

printf("Enter data:");

for(i=0;i<n;i++)

scanf("%d",&arr[i]);

printf("Enter size ofgenerator:");

scanf("%d",&g);

printf("Enter generator:");

for(j=0;j<g;j++)

scanf("%d",&gen[j]); printf("\n\

tThegenerator matrix:");

for(j=0;j<g;j++)

printf("%d",gen[j]);

a=n+(g-1);

printf("\n\tTheappended matrix is:");

for(i=0;i< g;++i)

arr[n+i]=0;

for(i=0;i< a;++i)

printf("%d",arr[i]);

for(i=0;i< n;++i)

q[i]= arr[i];
Computer Communication and NetworkingPage 8
Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
for(i=0;i< n;++i)

if(arr[i]==0)

for(j=i;j<g+i;++j)

arr[j] = arr[j]^0;

else

arr[i] = arr[i]^gen[0];

arr[i+1]=arr[i+1]^gen[1];

arr[i+2]=arr[i+2]^gen[2];

arr[i+3]=arr[i+3]^gen[3];

printf("\n\tTheCRC is :");

for(i=n;i<a;++i)

printf("%d",arr[i]);

s=n+a;

for(i=n;i<s;i++)

q[i]=arr[i];

printf("\n\n");

printf("\t The Transmitted Code is:");

for(i=0;i<a;i++)

printf("%d",q[i]);

getch();

Computer Communication and NetworkingPage 9


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
/* Output

Transmitter side:

Enter no. of data bits:8

Enter data:1 0 1 0 0 0 0 1

Enter size of generator:4

Enter generator:1 0 0 1

The generator matrix:1001

The appended matrix

is:10100001000The CRC is :111

The Transmitted Code is:10100001111

Computer Communication and NetworkingPage 10


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering

.EXPERIMENT NO. 3
AIM: To study basic networking commands using command prompt: hostname, getmac, arp, ipconfig,
ping, tracert and netstat.
THEORY:
1. hostname:
The hostname command displays the hostname of the computer currently logged in.
Syntax: hostname
2. getmac:
Each device on an Ethernet network has its own Network Interface Card (NIC) and this NIC provides
the device with a link layer address (MAC address). It is a 6 byte (48 bits) address, normally written in
hexadecimal notation with colon between the bytes. The getmac command displays the MAC address
of the computer currently logged in.
Eg: 8C:89:A5:3C:9E:EC
Syntax: getmac
3. arp:
ARP (Address Resolution Protocol) is a network layer protocol and it helps IP to find the MAC address
of the destination host or a router when its IP address is known.
Syntax: arp –a 192.168.5.247 (provides the MAC address of gateway router)
arp –a (provides the arp table of the device)
4. ipconfig:
The ipconfig command is utilized to verify network connection and network settings. This command
displays all current TCP/IP network configuration values such as:
1) Connectionspecific DNS suffix: It is the suffix name of the network to which the NIC is
connected to.
2) IPv4: IPv4 uses 4 byte (32 bit) address written in decimal notation which consists of four 8 bit
of address separated by decimalpoint.
Eg: 192.168.3.72
3) Subnet mask: It is a 32 bit address that masks an IPaddress.
4) Default Gateway: Provides the IP address of a router that serves as an entrance to another
network.
Syntax: ipconfig
ipconfig /all (Provides detailed network configuration values)

Computer Communication and NetworkingPage 11


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
5. ping:
The ping command allows sending a signal to another device on the network to see if it is active or not.
It is used to test the ability of the source computer to reach the specified destination computer.
How it works?

 ping uses ICMP (Internet Control Message Protocol) packet to send out an ‘echo request’ to the
destination device and gets back an ‘echo response’ if the receiving device is active.
Syntax: ping www.google.com(DNS)
ping 192.168.5.247 (Gateway Router)
ping (options)
 ping –twww.google.com(continous ping)
 ping –n 2www.google.com(number of ping =2)
 ping –l 20www.google.com(defines buffer size i.e. no. of bytes for pinging i.e. Bytes =20)
6. tracert:
The tracert command is used to show several details about the path that a packet takes from sender to
destination. It shows the IP address of each hop between source and destination. This command is
mainly used for troubleshooting network problems.
Syntax:
tracertwww.google.comt
racertwww.yahoo.com
7. netstat:
The netstat command is used to display the TCP/IP network protocol statistics and information. It
provides very detailed information about how computer is communicating with other computers. It
provides the following information:
1. Protocol: The name of the protocol used (TCP orUDP).
2. Local Address: Provides the IP address of the local computer and the port number being used.
3. Foreign Address: Provides the IP address and the port number of devices in path.
4. State: Indicates the state of a TCPconnection.
Syntax:netstat
netstat (options)
 netstat –e (number of bytes sent/received)
 netstat –n (Display active TCP connection and address and Port no. are expressed in numbers)
Conclusion: Thus we have studied about different networking commands used in computer networks:
hostname, getmac, arp, ipconfig, ping, tracert and netstat
Computer Communication and NetworkingPage 12
Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
 Syntax:hostname

 Syntax:getmac

 Syntax: arp –a 192.168.5.247 (provides the MAC address of gatewayrouter)

 Syntax: arp –a (provides the arp table of thedevice)

Computer Communication and NetworkingPage 13


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering

 Syntax:ipconfig

 Syntax: ipconfig /all (Provides detailed network configurationvalues)

Computer Communication and NetworkingPage 14


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering

Syntax: ping www.google.com(DNS)

Computer Communication and NetworkingPage 15


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
 Syntax: ping 192.168.5.247 (GatewayRouter)

 Syntax: ping –twww.google.com(continuousping)

 Syntax: ping –n 2www.google.com(number of ping =2)

Computer Communication and NetworkingPage 16


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
 Syntax: ping –l 20www.google.com(defines buffer size i.e. no. of bytes for pinging i.e. Bytes =
20)

 Syntax: tracertwww.google.com

Computer Communication and NetworkingPage 17


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
 Syntax: tracertwww.yahoo.com

 Syntax:netstat

Computer Communication and NetworkingPage 18


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
 Syntax: netstat –n (Display active TCP connection and address and Port no. are expressed in
numbers)

 netstat –e (number of bytessent/received)

Computer Communication and NetworkingPage 19


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering

Experiment No 4
AIM: To study network simulator NS2 basic commands and Implementing Simple topology by creating no

THEORY:
The network simulator is discrete event packet level simulator. The network simulator covers a very
large number of applications of different kind of protocols of different network types consisting of
different network elements and traffic models. Network simulator is a package of tools that simulates
behavior of networks such as creating network topologies, log events that happen under any
load,analyze the events and understand the network. The main aim of our first experiment is to learn
how to use network simulator and to get acquainted with the simulated objects and understand the
operations of network simulation and we also need to analyze the behavior of the simulation object
using network simulation.
Backend Environment of Network Simulator
Network Simulator is mainly based on two languages. They are C++ and Tcl. Tcl is the object oriented
version of Tool Command language. The network simulator is a bank of different network and protocol
objects. C++ helps in the following way:
 It helps to increase the efficiency of simulation.
 It is used to provide details of the protocols and their operation.
 It is used to reduce packet and event processing time.
Tcl helps in the followingway:
 With the help of Tcl we can describe different network topologies
 It helps us to specify the protocols and their applications
 It allows fast development
 Tcl is compatible with many platforms and it is flexible for integration
 Tcl is very easy to use and it is available in free
To start a new simulator we write
set ns [new Simulator]
From the above command we get that a variable ns is being initialized by using the set command. Here the code [

Creating the output files


#To create the trace files we write set tracefile1 [open out.tr w]
$ns trace­all $tracefile1
#To create the nam files we write set namfile1 [open out.nam w]

The termination program is done by using a ' finish' procedure

proc finish {} {
global ns namfile
$ns flushtrace
close $namfile
Computer Communication and NetworkingPage 20
Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
execnamout.nam&
exit 0
}
In the above the word 'proc' is used to declare a procedure called 'finish'.The word 'global' is used to tell
what variables are being used outside the procedure.

'flushtrace' is a simulator method that dumps the traces on the respective files.the command 'close' is
used to close the trace files and the command 'exec' is used to execute the namvisualization.The
command 'exit' closes the application and returns 0 as zero(0) is default for clean exit.
In ns we end the program by calling the ' finish' procedure
$ns at 5 "finish"
Thus the entire operation ends at 5 seconds.

Tobegin thesimulation we wil lusethecommand


$ns run

Defining nodes,links,queues andtopology


set n0 [ns node]
In the above we created a node that is pointed by a variable n0.While referring the node in the scriptwe use $n0. S

$ns duplex­link $n0 $n2 10Mb 10msDropTail


So we are creating a bi­directional link between n0 and n2 with a capacity of 10Mb/sec and a propagation delay o
In NS an output queue of a node is implemented as a part of a link whose input is that node to handle the overflow

Computer Communication and NetworkingPage 21


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering

CONCLUSION: Thus, we have studied network stimulation and implemented the given topology.

Computer Communication and Networking


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering

EXPERIMENT NO. 5
AIM: To configure routers using static routing using GNS3 simulation tool.

THEORY:
Routers can forward packets over static routes or dynamic routes based on the router configuration.
Two ways to tell the router where to forward the packets that are not directly connected are as follows:

 StaticRoutes: The router uses a route that a network administrator enters into the router manually.
The administrator must manually update this static route entry whenever an internetwork topology
change requires an update. Static routes are userdefined routes that specify the path that packets moving
between a source and destination take. These administratordefined routes allow very precise control
over the routing behaviour of the IP internetwork.
Disadvantage: 1) Infrastructure changes must be manually adjusted
2) Impractical on large network.

PROCEDURE:
1) Create a simulation network by connecting all the routers using fast Ethernetlinks.
2) Configure each router using their respective console port and initially reset all the port
(interface) configuration status to down.
3) Assign IP address to each of the interface of respective router and change its status to up.
4) Apply static routing for end to end connectivity.
5) Ping the destination router to check its end to end connectivity.

COMMANDS:
1) enable
2) config tto configure the router
3) hostname{any name to assign that particular router}configuration mode
4) interface{specific interface number}to configure that particular interface of the router
5) ip addr{ipaddress}{subnetmask}assigning IPaddress to that particular interface
6) no shutto change the status of that interface to up
7) show ip int briefto check interface configuration in enable mode
8) static routing: configuration mode
a) ip route {destination network}{subnet mask}{ip address of next hop}
9) ping{destination address}enable mode

Computer Communication and NetworkingPage 33


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
Command Purpose
Step 1 configure terminal Enters configuration mode.
Example:
switch# configure
terminal
switch(config)#
Step 2 ip route {ipprefix| ip- Configures a static route and the
addr/ipmask} {[next interface for this static route. Use ?to
hop | nhprefix] | display a list of supported interfaces.
[interface nexthop| nh You can specify a null interface by
prefix]} [name nexthop using null 0.
name] [tagtag You can optionally configure the next-
value] [pref] hop address.
Example:
switch(config)# iproute The preference value sets the
192.0.2.0/8 ethernet1/2 administrative distance. The range is
192.0.2.4 from 1 to 255. The default is 1.
Step 3 show {ip| ipv6} static (Optional) Displays information about
route static routes.
Example:
switch(config)# show
ipstaticroute

CONCLUSION:
Thus we have configured routers using static and dynamic routing using GNS3 simulation tool

Computer Communication and NetworkingPage 34


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering

Computer Communication and NetworkingPage 35


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering

Computer Communication and NetworkingPage 36


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering

Computer Communication and NetworkingPage 37


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
EXPERIMENT NO. 6
AIM: To configure routers using dynamic routing using GNS3 simulation tool.

THEORY:
Routers can forward packets over static routes or dynamic routes based on the router configuration.
Two ways to tell the router where to forward the packets that are not directly connected are as
follows:

 Dynamic Routes: The router dynamically learns after an administrator configures routing protocol
that helps determine routes. Unlike the situation with static routes, after the network administrator
enables dynamic routing, the routing process automatically updates route knowledge whenever new
topology information is received. The routers learn and maintain routes to the remote destination by
exchanging routing updates with other routers in the internetwork. Example: RIP and OSPF routing
protocol.
Advantage: 1) Simple to configure on larger networks
2) Will dynamically choose a different route if a link goes down
Disadvantage: 1) The choice of the “best route” is in the hands of the routing protocol, and not the
network administrator.
PROCEDURE:
1) Create a simulation network by connecting all the routers using fast Ethernet links.
2) Configure each router using their respective console port and initially reset all the port (interface)
configuration status to down.
3) Assign IP address to each of the interface of respective router and change its status to up.
4) Apply static/dynamic routing for end to end connectivity.
5) Ping the destination router to check its end to end connectivity.

COMMANDS:
1) Enable
2) Config tto configure the router
3) hostname{any name to assign that particular router}configuration mode
4) interface{specific interface number}to configure that particular interface of the router
5) ip addr{ip address}{subnet mask}assigning IP address to that particular interface
6) no shutto change the status of that interface to up
7) show ip int briefto check interface configuration in enable mode
8) dynamic routing:  configuration mode
a) router ospf 100initiates dynamic routing using ospf routing protocol
b) network{current network}{wildcard mask}area0creating and sharing its routing table
9) ping{destination address}enable mode

Computer Communication and NetworkingPage 38


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
Detailed Step

Command or Action Purpose


Step 1 enable Enables privileged EXEC mode.
 Enter your password if
Example: prompted.
Device> enable

Step 2 configure terminal Enters global configuration mode.

Example:
Device# configure terminal

Step 3 router ospf processid Enables OSPF routing and enters


Example: router configuration mode.
Device(config)# router ospf 109

Step 4 network ipaddress wildcard mask Defines an interface on which


area areaid OSPF runs and defines the area ID
for that interface.
Example:
Device(configrouter)# network
192.168.129.16 0.0.0.3 area 20

Step 5 end Exits router configuration mode


and returns to privileged EXEC
Example: Device(config- mode.
router)# end

CONCLUSION:
Thus we have configured routers using static and dynamic routing using GNS3 simulation tool

Computer Communication and NetworkingPage 39


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering

Computer Communication and NetworkingPage 40


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering

Computer Communication and NetworkingPage 41


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering

Computer Communication and NetworkingPage 42


.

Computer Communication and NetworkingPage 48


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
Experiment 7
Aim:To study different layers of TCP/IP protocol involved in data packets using wireshark.
Theory:What is wireshark?
Wireshark is a network packet analyzer that runs on Windows, Linux/Unix, and Mac Computers. In
computer network, data is exchanged in form of packets. A network packet analyzer captures network
packets and tries to display that packet data as detailed as possible. Wireshark is one of the best open
source packet analyzer available today.
The basic tool for observing the messages exchanged between executing protocol entities is called a
packet sniffer. As the name suggests, a packet sniffer captures (sniffs) messages being sent/received
from/by the computer; it will also typically store and/or display the contents of the various protocol fields
in these captured messages. Wireshark packet sniffer is used todisplay the contents of messages being
sent/received from/by protocols at different levels of the protocol stack.
Running Wireshark:While starting Wireshark program, a startup screen appears as shown in figure 1. The
upper left hand side of the screen consist of “Interface List”. It provides the list of network interfaces on
user computer. On selecting one particular interface, Wireshark will capture all packets on that interface
(i.e. Wireshark begins capturing all packetsbeing sent to/from that interface) and a screen like shown in the
figure. Once packets start getting captured, it can stop by using the capture pull down menu and selecting
stop. The Wireshark interface has five major components:

 The command menus are standard pull down menus located at the top of the window of interest
for now is the File and Capture menu. The File menu allows saying captured packet data or opening a file
containing previously captured packet data, and exiting the Wireshark application. The capture menu
allows beginning packetcapture.
 The packetlisting window displays aoneline summary for each packet captured, including the
packet number (assigned by Wireshark), the time at which the packet was captured, the packet’s source
and destination address, the protocol type and protocol specific information contained in thepacket.
 The packetheader detail window provides detailed information about the packet selected
(highlighted) in the packetlisting window. These details include information about different layers of
TCP/IP with which packet isinvolved.
 The packetcontent window displays the entire contents of each layers of TCP/IP for each captured
frame in both ASCII and hexadecimalformat.
 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 packetlisting window (and hence the packetheader and packetcontentswindows).
Procedure:
1) Start up the web browser which will display selected homepage.
2) Start up the Wireshark software, Initially can see a window similar to that shown in figure 1,
Wireshark has not yet begun capturingpackets.
3) To begin packet capture, select the capture pull down menu and select Interfaces, this will cause
the “Wireshark: Capture Interfaces” window to bedisplayed.

4) A list of the interface on the computer as well as a count of the packets that have been observed
onthatinterfacesofarisdisplayed.Clickonstartfortheinterfaceonwhichyouwanttobeginpacket

Computer Communication and NetworkingPage 49


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering
capture. Packet capture will now begin. Wireshark is now capturing all packets being sent/received
from/by that computer.

5) After starting packet capture, a window similar will appear. This window shows the packets being
captured which are generated by some network traffic using a web browser, which will use the HTTP
protocol. Packet capture can be traffic using a web browsers can be stop by selecting capture pull down
and selectingstop.

6) While Wireshark is running, enter URL:http://www.shahandanchor.comand have thatpage


displayed in the browser. In order to display this page, browser will contact the HTTP server at
shahandanchor.com and exchange HTTP messages with the server in order to download this page. The
Ethernet frames containing these HTTP messages (as well as all other frames passing through anEthernet
adapter) will be captured byWireshark.

7) After the browser has displayed the webpage, stop Wireshark packet capture by selecting stop in
the Wireshark capture window. The main Wireshark window should niow look similar to figure
4consisting live packet data that contains all protocol messages exchanged between user computer and
other network entities.The HTTP messaged exchanged with the shahandanchor.com webserver should
appear somewhere in the listing of packets captured. Even though only a webpage of shahandanchor.com
was opened, there are evidently many other protocols running on the computer that are unseen by the
user(e.g. the many different protocol types shown in the protocol columns in figure4).

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 eentered “http”). This will cause only HTTP message to be
displayed in the packet listingwindow.

9) Find the HTTP GET message that was sent from user computer to the shahandanchor.com HTTP
server. Look for an HTTP GET message in the “Listing of captured packets” portion of the Wireshark
window that shows “GET” followed by the URL entered. When the HTTP GET message is selected,
detailed information about the Ethernet frame, IP datagram, TCP segment, and HTTP message header
information is displayed in the packetheader window, corresponding information content in ASCII and
Hexadecimal format is provided in packet contentwindow.

10) The File menu allows saving this captured packet data and exitWireshark.

Conclusion:
Thus we have studied different layers of TCP/IP protocol involved in data packets using Wireshark.

Computer Communication and NetworkingPage 50


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering

Computer Communication and NetworkingPage 51


Mahavir Education Trust' s
Shah & Anchor Kutchhi Engineering College,
Chembur, Mumbai 400 088
UG Programmein ElectronicsEngineering

Computer Communication and NetworkingPage 52

You might also like