You are on page 1of 73

L.D.

College of Engineering EC Department

DATA COMMUNICATION NETWORKS


B.E. 7thSEMESTER

LABORATORY MANUAL
2020

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


L.D.COLLEGE OF ENGINEERING, AHMEDABAD

Data Communication Network | 0


L.D. College of Engineering EC Department

Experiment-1
Aim: To study Cisco packet tracer.
Objectives:
1. Study Cisco packet tracer.
2. Design simple LAN.

Apparatus:Personal Computer, Cisco packet tracer 5.3


Theory:

This bar provides the File, Options, and Help menus. You will find basic
1 Menu Bar commands such as Open, Save, Print, and Preferences in these menus. You
will also be able to access the Activity Wizard from the File menu.
This bar provides shortcut icons to the File menu commands, including the
Activity Wizard. On the right, you will also find the Network Information
2 Main Tool Bar
button, which you can use to enter a description for the current network (or
any text you wish to include).
This bar provides access to these commonly used workspace tools: Select,
3 Common Tools Bar Move Layout, Place Note, Delete, Inspect, Add Simple PDU, and Add
Complex PDU.
Logical/Physical You can toggle between the Physical Workspace and the Logical Workspace
4
Workspace Bar with the tabs on this bar.
This area is where you will create your network, watch simulations, and view
5 Workspace
many kinds of information and statistics.
Realtime/Simulation You can toggle between Realtime Mode and Simulation Mode with the tabs
6
Bar on this bar.

Data Communication Network | 1


L.D. College of Engineering EC Department

This box is where you choose devices and connections to put onto the
Network Component
7 workspace. It contains the Device-Type Selection Box and the Device-
Box
Specific Selection Box.
This box contains the type of devices and connections available in Packet
Device-Type Selection
8 Tracer. The Device-Specific Selection Box will change depending on which
Box
type of devices you clicked.
Device-Specific This box is where you choose specifically which devices you want to put in
9
Selection Box your network and which connections to make.
User Created Packet This window manages the packets you put in the network during simulation
10
Window scenarios.

Group of devices and connections to display the various choices

A simple LAN connection using 1 Router, 3 Switches and 6 End stations

 Open Cisco Packet Tracer.


 The bottom left hand corner of the screen (the Network Component Box) displays the icons that
represent device categories or groups, such as Routers, Switches, or End Devices. Clicking on a device
category will show specific options to the right. To select a device, first choose the device category
and then select the specific device.
 Select Connections from the Network Component Box and choose a straight-through cable (as we are
connecting dissimilar devices). Use cross wire and if they are of different types.

Data Communication Network | 2


L.D. College of Engineering EC Department

 Perform the following steps to connect Switch0:


1. Click once on Switch0.
2. Choose FastEthernet0/1.
3. Drag the cursor to PC0.
4. Notice the green link lights on PC0FastEthernet0/0 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.
5. After a about 50 seconds the amber light will change to green indicating that the port has entered
the forwarding stage. Frames can now forward out the switch port.

 Repeat the same steps to connect all other devices to each other.

Data Communication Network | 3


L.D. College of Engineering EC Department

Configuring IP Addresses and Subnet Masks on the Hosts

 Click on PC0
 Choose the Config tab. It is here that you can change the name of PC0. It is also here where you would
enter a Gateway IP Address, also known as the default gateway. This would be the IP address of the
local router.

Data Communication Network | 4


L.D. College of Engineering EC Department

 Click on Desktop tab and then onto IP Configuration in order to configure the IP address and
subnet mask for PC0.

 Configure all other PCs in the same way.


 We can also verify whether two end stations are reachable or not with the help of various network
commands like ping, traceroute etc.

Data Communication Network | 5


L.D. College of Engineering EC Department

Conclusion:

Data Communication Network | 6


L.D. College of Engineering EC Department

Experiment-2
Aim: To study router configuration using Cisco packet tracer.
Objectives:
 Design two LANs and connect those LANs using router.

Apparatus:Personal Computer, Cisco packet tracer 5.3


Theory

A two LANs connection using 1 Router, 3 Switches and 7 End stations

 Open Cisco Packet Tracer.


 The bottom left hand corner of the screen (the Network Component Box) displays the icons that
represent device categories or groups, such as Routers, Switches, or End Devices. Clicking on a device
category will show specific options to the right. To select a device, first choose the device category
and then select the specific device.
 Select Connections from the Network Component Box and choose a straight-through cable (as we are
connecting dissimilar devices). Use cross wire and if they are of different types.

 Perform the following steps to connect Switch0 to Router0:

1. Click once on Switch0.


2. Choose FastEthernet0/1.
3. Drag the cursor to Router0.
4. Click once on Router0 and choose FastEthernet0/0.
5. Notice the green link lights on Router0FastEthernet0/0 and amber light
Switch0FastEthernet0/1 port. The switch port is temporarily not forwarding frames,
while it goes through the stages for the Spanning Tree Protocol (STP) process.
6. After a about 50 seconds the amber light will change to green indicating that the port
has entered the forwarding stage. Frames can now forward out the switch port.

 Repeat the same steps to connect all other devices to each other.

Data Communication Network | 7


L.D. College of Engineering EC Department

Configuring IP Addresses and Subnet Masks on the Hosts

 Click on PC0
 Choose the Config tab. It is here that you can change the name of PC0. It is also here where you would
enter a Gateway IP Address, also known as the default gateway. This would be the IP address of the
local router.

 Click on Desktop tab and then onto IP Configuration in order to configure the IP address and
subnet mask for PC0.

Data Communication Network | 8


L.D. College of Engineering EC Department

 Configure all other PCs in the same way.


 Through GUI  Click on Router0. Click on Config Tab and then on FastEthernet0/0 to enter the
IP Address and Subnet Mask for that port and also to switch on the link. You can see equivalent
IOSCommands getting executed automatically.

 You can also configure the router through the IOS Command Line Interface by manually entering
the network commands.

Data Communication Network | 9


L.D. College of Engineering EC Department

 Let’s have a look at some of the network commands that we use while configuring the router
manually.
 To help the user keep track of what mode they are in, the command-line prompt changes each time
you enter a different mode. When you switch from unprivileged mode to privileged mode(with help
of enable command), the prompt changes from:
Router> enable
to
Router#

 To configure any feature of the router, you must enter configuration mode. This is the first sub-
mode of the parent mode. In the parent mode, you issue the command config.

Router#config
Router(config)#

 It is a good idea to name your router so that you can easily identify it. You do this in configuration
mode with the hostname command.
Router(config)#hostname ExampleName
ExampleName(config)#

 Configuring a serial port with an IP address:


ExampleName#config
ExampleName(config)#interface serial 1/1
ExampleName(config-if)#ip address 192.168.155.2 255.255.255.0

 The no shutdown command. An interface may be correctly configured and physically connected,
yet be "administratively down." In this state it will not function. The command for causing an
interface to be administratively down is shutdown.
ExampleName(config-if)#no shutdown

 To display the current state of the routing table, use the show ip route command in EXEC mode.
showip route [[ip-address [mask] [longer-prefixes]] | [protocol [process-id]]]
Data Communication Network | 10
L.D. College of Engineering EC Department

Router#showip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

C 10.0.0.0/8 is directly connected, FastEthernet0/0


C 78.0.0.0/8 is directly connected, FastEthernet1/0
C 100.0.0.0/8 is directly connected, FastEthernet4/0

Data Communication Network | 11


L.D. College of Engineering EC Department

Event List shows the route which was


taken from PC0 to PC4 and then back
from PC4 to PC0 and the time taken to
travel the same.

Verifying Connectivity in Realtime mode


 Be sure you are in Realtime mode

 Select the Add Simple PDUtool used to ping devices.

 Click once on PC0 and then on PC3.

As you can see here, the PDU Last


Status is successful, which means that
connectivity is successful between PC0
and PC3.
Data Communication Network | 12
L.D. College of Engineering EC Department

Verifying connectivity in Simulation Mode


 Be sure you are in Simulation Mode.

 Deselect all filters (All/None) and select only ICMP.

 Select the Add Simple PDU tool used to ping devices.

 Click once on PC0 and then on PC4.


 Click once on Auto Capture/ Playbutton. Youshould see the ICMP messages move between the hosts,
hub and switch. The PDU Last Status should show as Successful.

Data Communication Network | 13


L.D. College of Engineering EC Department

Event List shows the route which was


taken from PC0 to PC4 and then back
from PC4 to PC0 and the time taken to
travel the same.

Viewing the frame (Protocol Analyzer)


 To examine the actual protocols being sent, click on the colored Info box in the Event List. The
Event List shows where this Ethernet Frame is currently, “At Device”, the previous devices, “Last
Device”, and the type of information encapsulated in the Ethernet Frame, “Info”.

 Single click on the second event’s Info box to view the Ethernet frame with the encapsulated IPPacket
and the encapsulated ICMP message “At Device” PC0.

 The PDU (Protocol Data Unit) is displayed in three different formats, OSI Model, Inbound PDU
Details and OutboundPDU Details. View them.

Data Communication Network | 14


L.D. College of Engineering EC Department

 Click on the Outbound PDU Details tab to see the protocol details including the layer 2
Ethernetframe, the layer 3 IP packet and ICMP message.

Viewing the frame (Protocol Analyzer)


 To examine the actual protocols being sent, click on the colored Info box in the Event List. The
Event List shows where this Ethernet Frame is currently, “At Device”, the previous devices, “Last
Device”, and the type of information encapsulated in the Ethernet Frame, “Info”.

 Single click on the second event’s Info box to view the Ethernet frame with the encapsulated IPPacket
and the encapsulated ICMP message “At Device” PC0.

 The PDU (Protocol Data Unit) is displayed in three different formats, OSI Model, Inbound PDU
Details and OutboundPDU Details. View them.

Data Communication Network | 15


L.D. College of Engineering EC Department

 Click on the Outbound PDU Details tab to see the protocol details including the layer 2
Ethernetframe, the layer 3 IP packet and ICMP message.

Conclusion:

Data Communication Network | 16


L.D. College of Engineering EC Department

Experiment-3
Aim:To study ICMP message using Ping Command.

Objectives:
1. To study ping command in command prompt.
2. To find the minimum size of data in ICMP packet for Ethernet.

Apparatus:Personal Computer, Cisco packet tracer5.3


Theory:
The Internet Control Message Protocol (ICMP) is one of the core protocols of the Internet protocol suite. It is
chiefly used by networked computers' operating systems to send error messages indicating, for instance, that
a requested service is not available or that a host or router could not be reached.

ICMP differs in purpose from TCP and UDP in that it is not used to send and receive data between end
systems. It is usually not used directly by user network applications, with some notable exceptions being the
ping tool and tracert.

ICMP messages are constructed at the IP layer, usually from a normal IP datagram that has generated an ICMP
response. IP encapsulates the appropriate ICMP message with a new IP header (to get the ICMP message back
to the original sending host) and transmits the resulting datagram in the usual manner.

For example, every machine (such as intermediate routers) that forwards an IP datagram has to decrement the
time to live (TTL) field of the IP header by one; if the TTL reaches 0, an ICMP Time to live exceeded in
transit message is sent to the source of the datagram.Each ICMP message is encapsulated directly within a
single IP datagram, and thus, like UDP, ICMP is unreliable.

Although ICMP messages are contained within standard IP datagram, ICMP messages are usually processed
as a special case, distinguished from normal IP processing, rather than processed as a normal sub-protocol of
IP. In many cases, it is necessary to inspect the contents of the ICMP message and deliver the appropriate

Data Communication Network | 17


L.D. College of Engineering EC Department

error message to the application that generated the original IP packet, the one that prompted the sending of
the ICMP message.

Many commonly-used network utilities are based on ICMP messages. The tracert command is implemented
by transmitting UDP datagram with specially set IP TTL header fields, and looking for ICMP Time to live
exceeded in transit (above) and "Destination unreachable" messages generated in response. The related ping
utility is implemented using the ICMP "Echo request" and "Echo reply" message

Ping [-t] [-a] [-ncount] [-lsize] [-f] [-iTTL] [-vTOS] [-rcount] [-scount] [-wtimeout] [-R] [-Ssrcaddr] [-4] [-
6] target [/?]

-t = Using this option will ping the target until you force it to stop using Ctrl-C.

-a = this ping command option will resolve, if possible, the hostname of an IP address target.

-ncount = this option sets the number of ICMP Echo Request messages to send. If you execute the ping
command without this option, four requests will be sent.

-lsize = Use this option to set the size, in bytes, of the echo request packet from 32 to 65,527. The ping
command will send a 32 byte echo request if you don't use the -l option.

-f = Use this ping command option to prevent ICMP Echo Requests from being fragmented by routers
between you and the target. The -f option is most often used to troubleshoot Path Maximum Transmission
Unit (PMTU) issues.

-iTTL = this option sets the Time to Live (TTL) value, the maximum of which is 255.

-vTOS = this option allows you to set a Type of Service (TOS) value. Beginning in Windows 7, this option
no longer functions but still exists for compatibility reasons.

-rcount = Use this ping command option to specify the number of hops between your computer and the
target computer or device that you'd like to be recorded and displayed. The maximum value for count is 9 so
uses the tracert command instead if you're interested in viewing all hops between two devices.

-scount = Use this option to report the time, in Internet Timestamp format, that each echo request is received
and echo reply is sent. The maximum value for count is 4 meaning that only the first four hops can be time
stamped.

-wtimeout = Specifying a timeout value when executing the ping command adjusts the amount of time, in
milliseconds, that ping waits for each reply. If you don't use the -w option, the default timeout value is used
which is 4000, or 4 seconds.

-R = this option tells the ping command to trace the round trip path.

-Ssrcaddr = Use this option to specify the source address.

-4 = this forces the ping command to use IPv4 only but is only necessary if target is a hostname and not an
IP address.
Data Communication Network | 18
L.D. College of Engineering EC Department

-6 = this forces the ping command to use IPv6 only but as with the -4 option, is only necessary when pinging
a hostname.

Target= this is the destination you wish to ping, either an IP address or a hostname.
/?= Use the help switch with the ping command to show detailed help about the command's several options.

Note: The -f, -v, -r, -s, -j, and -k options work when pinging IPv4 addresses only. The -R and -S options
only work with IPv6.

Procedure:

Ping Command Examples:

ping -n 5 -l 1500 www.google.com


In this example, the ping command is used to ping the hostname www.google.com. The -n option
tells the ping command to send 6 and 8 ICMP Echo Requests instead of the default of 4 and the -l
option sets the packet size for each request to 1500 bytes instead of the default of 32 bytes. The result
displayed in the Command Prompt window will look something like this:

ping 127.0.0.1
In the above example, I'm pinging 127.0.0.1, also called the IPv4 localhost IP address or IPv4 loopback IP
address, without options.
Data Communication Network | 19
L.D. College of Engineering EC Department

Using the ping command to ping 127.0.0.1 is an excellent way to test that Windows' network features are
working properly but it says nothing about your own network hardware or your connection to any other
computer or device. The IPv6 version of this test would be ping ::1.

ping -a LD

In this example I'm asking the ping command to find the IP address assigned to hostnameLD but otherwise
ping it as normal.

ping -t -6 server
In this example, I force the ping command to use IPv6 with the -6 option and continue to ping
SERVER indefinitely with the -t option.

Pinging SERVER [fe80::fd1a:3327:2937:7df3%10] with 32 bytes of data:

Reply from fe80::fd1a:3327:2937:7df3%10: time=1ms

Reply from fe80::fd1a:3327:2937:7df3%10: time<1ms

Reply from fe80::fd1a:3327:2937:7df3%10: time<1ms

Reply from fe80::fd1a:3327:2937:7df3%10: time<1ms

Reply from fe80::fd1a:3327:2937:7df3%10: time<1ms

Reply from fe80::fd1a:3327:2937:7df3%10: time<1ms

Reply from fe80::fd1a:3327:2937:7df3%10: time<1ms

Data Communication Network | 20


L.D. College of Engineering EC Department

Ping statistics for fe80::fd1a:3327:2937:7df3%10:

Packets: Sent = 7, Received = 7, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum= 0ms, Maximum= 1ms, Average= 0ms

ping -l 1500 -f www.google.com


In this example, the ping command is used to ping the hostname www.google.com. The-l option sets the
packet size for each request to 1500 bytes instead of the default of 32 bytes. The –f option is used to prevent
ICMP Echo Requests from being fragmented by routers between you and the target. The -f option is most
often used to troubleshoot Path Maximum Transmission Unit (PMTU) issues.

Find the minimum size of data that can be carried by the Ethernet standard if ‘do not fragment’ bit is set.

Conclusion:

Data Communication Network | 21


L.D. College of Engineering EC Department

DATE: _______________ Sign of Faculty: ________________

Experiment-4
Aim:To studytracert and arp commands in command prompt.

Objectives:
3. To study tracert command in command prompt.
4. To study arp command in command prompt.
Apparatus:Personal Computer, Command prompt
Theory:
Many commonly-used network utilities are based on ICMP messages. The tracert command is implemented
by transmitting UDP datagram with specially set IP TTL header fields, and looking for ICMP Time to live
exceeded in transit (above) and "Destination unreachable" messages generated in response. The related ping
utility is implemented using the ICMP "Echo request" and "Echo reply" message

How the TRACERT Command Works

The TRACERT diagnostic utility determines the route taken to a destination by sending Internet Control
Message Protocol (ICMP) echo packets with varying IP Time-To-Live (TTL) values to the destination. Each
router along the path is required to decrement the TTL on a packet by at least 1 before forwarding it, so the
TTL is effectively a hop count. When the TTL on a packet reaches 0, the router should send an ICMP Time
Exceeded message back to the source computer.

TRACERT determines the route by sending the first echo packet with a TTL of 1 and incrementing the TTL
by 1 on each subsequent transmission until the target responds or the maximum TTL is reached. The route is
determined by examining the ICMP Time Exceeded messages sent back by intermediate routers. Note that
some routers silently drop packets with expired TTLs and are invisible to TRACERT.

TRACERT prints out an ordered list of the routers in the path that returned the ICMP Time Exceeded message.
If the -d switch is used (telling TRACERT not to perform a DNS lookup on each IP address), the IP address
of the near- side interface of the routers is reported.

In the following example, the packet must travel through two routers (157.54.48.1 and 11.1.0.67) to get to
host 11.1.0.1. In this example, the default gateway is 157.54.48.1 and the IP address of the router on the
11.1.0.0 network is at 11.1.0.67.

C:\>tracert 11.1.0.1

Tracing route to 11.1.0.1 over a maximum of 30 hops

Data Communication Network | 22


L.D. College of Engineering EC Department

1 2 ms 3 ms 2 ms 157.54.48.1
2 75 ms 83 ms 88 ms 11.1.0.67
3 73 ms 79 ms 93 ms 11.1.0.1

Trace complete.

Troubleshooting with TRACERT

The TRACERT command can be used to determine where a packet stopped on the network. In the following
example, the default gateway has determined that there is not a valid path for the host on 22.110.0.1. There
is probably a router configuration problem or the 22.110.0.0 network does not exist (a bad IP address).

C:\>tracert 22.110.0.1

Tracing route to 22.110.0.1 over a maximum of 30 hops

1 157.54.48.1 reports: Destination net unreachable.

Trace complete.

TRACERT is useful for troubleshooting large networks where several paths can be taken to arrive at the
same point, or where many intermediate systems (routers or bridges) are involved.

ARP
Displays and modifies entries in the Address Resolution Protocol (ARP) cache, which contains one or more
tables that are used to store IP addresses and their resolved Ethernet or Token Ring physical addresses.
There is a separate table for each Ethernet or Token Ring network adapter installed on your computer. Used
without parameters, arp displays help.
Syntax
arp [-a [InetAddr] [-N IfaceAddr]] [-g [InetAddr] [-N IfaceAddr]] [-d InetAddr [IfaceAddr]] [-
s InetAddrEtherAddr [IfaceAddr]]

Parameters
-a [InetAddr] [-N IfaceAddr] :

Displays current ARP cache table for all interfaces. To display the ARP cache entry for a specific IP
address, use arp -a with the InetAddr parameter, where InetAddr is an IP address. To display the ARP cache
table for a specific interface, use the -N IfaceAddr parameter where IfaceAddr is the IP address assigned to
the interface. The -Nparameter is case-sensitive.

-g [InetAddr] [-N IfaceAddr] : Identical to -a.

-d InetAddr [IfaceAddr] : Deletes an entry with a specific IP address, where InetAddr is the IP address. To
delete an entry in a table for a specific interface, use the IfaceAddr parameter where IfaceAddr is the IP
address assigned to the interface. To delete all entries, use the asterisk (*) wildcard character in place
of InetAddr.

Data Communication Network | 23


L.D. College of Engineering EC Department

-s InetAddrEtherAddr [IfaceAddr] : Adds a static entry to the ARP cache that resolves the IP
address InetAddr to the physical address EtherAddr. To add a static ARP cache entry to the table for a
specific interface, use the IfaceAddr parameter whereIfaceAddr is an IP address assigned to the interface.

Procedure:
 TRACERT Syntax

There are several command-line switches that can be used with TRACERT, but they are usually not needed
for standard troubleshooting.
TRACERT syntax:
tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name

Parameters:

-d
Specifies to not resolve addresses to host names.

-h maximum_hops
Specifies the maximum number of hops to search for target.

-j host-list
Specifies loose source route along the host-list.

-w timeout
Waits the number of milliseconds specified by timeout for each
reply.

target_name
Name or IP address of the target host.

You can use the -j option to force the outgoing datagram to pass through a specific router. To use the -j
option in this manner, use the IP source route option. For example, if you type tracert HostName, you find
that the used path is as follows:

* <router1>
* <router2>
* <router3>
* <router4>
* <hostname>

To find the path to router4 and back to the computer, type tracert -j <router4><MyComputer>.
The path to router4 and back to the computer is traced. In this example, the path is typically the following:

* <router1>
* <router2>

Data Communication Network | 24


L.D. College of Engineering EC Department

* <router3>
* <router4>
* <router3>
* <router2>
* <router1>
* <mycomputer>

tracert www.google.com
Using the tracert command as shown above, we're asking tracert to show us the path from the local computer
all the way to the network device with the hostname www.google.com.

Data Communication Network | 25


L.D. College of Engineering EC Department

In this example we can see that tracert identified fifteen network devices including our router
at 192.168.91.1 and all the way through to the target of www.google.com which we now know uses the public
IP address of 173.194.38.177.

tracert -d www.ldce.edu
In this final tracert command example, you can see that we are requesting the path to a website, this
time www.ldce.edu, but now we are preventing tracert from resolving hostnames by using the -d option.
As we can see, tracert did not resolve any hostnames this time which significantly sped up the process.

Data Communication Network | 26


L.D. College of Engineering EC Department

 ARP
To display the ARP cache tables for all interfaces, type:
arp -a
To display the ARP cache table for the interface that is assigned the IP address 10.0.0.99, type:
arp -a -N 10.0.0.99
To add a static ARP cache entry that resolves the IP address 10.0.0.80 to the physical address 00-AA-00-4F-
2A-9C, type:
arp -s 10.0.0.80 00-AA-00-4F-2A-9C

Data Communication Network | 27


L.D. College of Engineering EC Department

Data Communication Network | 28


L.D. College of Engineering EC Department

Conclusion:

Data Communication Network | 29


L.D. College of Engineering EC Department

Experiment-5
Aim:To perform static routing using Packet Tracer.

Objectives:
1. To configure network of 4 LANs.
2. To compute static routing.
Apparatus:Personal Computer, Cisco Packet tracer 5.3.
Theory:
Static routing is not really a routing protocol. Static routing is simply the process of manually entering routes into a
device's routing table via a configuration file that is loaded when the routing device starts up. As an alternative,
these routes can be entered by a network administrator who configures the routes manually. Since these manually
configured routes don't change after they are configured (unless a human changes them) they are called 'static' routes.

Static routing is the simplest form of routing, but it is a manual process.


Use static routing when you have very few devices to configure (<5) and when you know the routes will probably never
change.

Static routing also does not handle failures in external networks well because any route that is configured manually must
be updated or reconfigured manually to fix or repair any lost connectivity.

Figure:

Data Communication Network | 30


L.D. College of Engineering EC Department

Procedure:
Addressing Table

Host Interface IPAddress Subnet Mast Default


Router 0 FastEthernet0/0 74.125.10.1 255.0.0.0 Gateway
N/A
Serial 0/0 172.10.1.1 255.255.0.0 N/A
Serial 0/1 164.5.6.1 255.255.0.0 N/A
Router 2 FastEthernet0/0 10.10.1.1 255.0.0.0 N/A
Serial 0/0 134.10.1.1 255.255.0.0 N/A
Serial 0/1 172.10.1.2 255.255.0.0 N/A
Router 3 FastEthernet0/0 125.23.5.1 255.0.0.0 N/A
Serial 0/0 50.50.1.2 255.0.0.0 N/A
Serial 0/1 134.10.1.2 255.255.0.0 N/A
Router 1 FastEthernet0/0 192.168.1.1 255.255.255. N/A
Serial 0/0 164.5.6.2 0
255.255.0.0 N/A
Serial 0/1 50.50.1.1 255.0.0.0 N/A
PC0 NIC 74.125.10.2 255.0.0.0 74.125.10.1
PC1 NIC 74.125.10.3 255.0.0.0 74.125.10.1
PC2 NIC 10.10.1.2 255.0.0.0 10.10.1.1
PC3 NIC 10.10.1.3 255.0.0.0 10.10.1.1
PC4 NIC 192.168.1.2 255.255.255.0 192.168.1.1
PC5 NIC 192.168.1.3 255.255.255.0 192.168.1.1
PC6 NIC 125.23.5.2 255.0.0.0 125.23.5.1
PC7 NIC 125.23.5.3 255.0.0.0 125.23.5.1

1. On RouterR0, usethe commandlineinterface(CLI) toaccess theCiscoIOS prompt. Enter


Privilegemode (enable)and movetoconfigurationmode(configterminal):

Router0>enable
Router0#config terminal
Router0(config)#interface FastEthernet 0/0
Router0(config-if)#ip address 74.125.10.1 255.0.0.0
Router0(config-if)#no shutdown

Router0(config-if)#exit
Router0(config)#interface Serial 0/1
Router0(config-if)#ip address 164.5.6.1 255.255.0.0
Router0(config-if)#no shutdown

Router0(config-if)#exit
Router0(config)#interface Serial 0/0
Router0(config-if)#ip address 172.10.1.1 255.255.0.0
Router0(config-if)#clock rate 64000
Router0(config-if)#no shutdown

In the same way, configure Router1, Router2 and Router 3 as well with the entries shown in addressing table.

Data Communication Network | 31


L.D. College of Engineering EC Department

(2) In our network design, there are 8 networks and hence each router should have 8 different entries in its
routing table to be reachable to each and every device in the network. We can see the routing table of a
particular router with the help of show ip route command.

Router0#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - Periodic downloaded static route

Gateway of last resort is not set

C 74.0.0.0/8 is directly connected, FastEthernet0/0


C 164.5.0.0/16 is directly connected, Serial0/1
C 172.10.0.0/16 is directly connected, Serial0/0

As you can see here, instead of 8 entries, there are only 3 entries in the table, which are directly connected to
Router0.
For the rest of the 5 entries, we need to make static routes.

(3) Configuring static routes: Static routes can be configured with the help of following command:

Router (config) #ip route network-address subnet-mask ip-address


Network-addressDestination network address of the remote network to be added to therouting table.
Subnet-maskSubnet mask of the remote network to be added to the routing table. The subnetmask can be
modified to summarize a group of networks.
Ip-addressCommonly referred to as the next-hop router’s IP address.

Now, in order to configure the 5 static routes on Router0, go to CLI mode of Router 0 and perform following
steps:

Router0>enable
Router0#configure terminal
Router0(config)#interface Serial0/1
Router0(config)#ip route 192.168.1.0 255.255.255.0 164.5.6.2
Router0(config)#ip route 50.0.0.0 255.0.0.0 164.5.6.2
Router0(config)#ip route 125.0.0.0 255.0.0.0 172.10.1.2
Router0(config)#ip route 134.0.0.0 255.0.0.0 172.10.1.2
Router0(config)#ip route 10.0.0.0 255.0.0.0 172.10.1.2

Now, process show ip route command again on Router0 and you will be able to see 8 entries out of which 3
will be directly connected (C) and 5 will be static (S).

Router0#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

Data Communication Network | 32


L.D. College of Engineering EC Department

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area


* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

S 10.0.0.0/8 [1/0] via 172.10.1.2


S 50.0.0.0/8 [1/0] via 164.5.6.2
C 74.0.0.0/8 is directly connected, FastEthernet0/0
S 125.0.0.0/8 [1/0] via 172.10.1.2
S 134.0.0.0/8 [1/0] via 172.10.1.2
C 164.5.0.0/16 is directly connected, Serial0/1
C 172.10.0.0/16 is directly connected, Serial0/0
S 192.168.1.0/24 [1/0] via 164.5.6.2

In the same way, configure static router for other routers as well.

(4) Now to check the connectivity across the routers, click on PC1 which is in network 74.0.0.0 and wants to
ping to PC4 which is in network 192.168.1.0 with two one more network in between the 2 PCS i.e. 164.5.0.0.

Conclusion:

DATE: _______________ Sign of Faculty: ______________

Experiment-6
Data Communication Network | 33
L.D. College of Engineering EC Department

Aim: To Configure RIP on packet tracer.


Objectives:To configure routing table using distance vector routing protocol (RIP).
Apparatus:Personal Computer, Cisco packet tracer5.3
Theory:
The Routing Information Protocol (RIP) is a distance-vector protocol that uses hop count as its metric. RIP is widely
used for routing traffic in the global Internet and is an interior gateway protocol (IGP), which means that it performs
routing within a single autonomous system. RIP only uses hop count to determine the best route to a remote
network, RIP has a maximum hop count of 15, 16 is deemed unreachable. RIP works well in small internetworks, but
is inefficient for large networks. RIP is susceptible to all the problems normally associated with distance vector routing
protocols. It is slow to converge and forces routers to learn network information only from neighbors. RIP version 1
uses classful routing (all devices in the network must use the same subnet mask because RIP version 1 doesn't send
updates with subnet information). RIP version 2 uses classless routing and does send subnet mask information with
route updates. RIP networks need the same hop count to load balance multiple links.

Routing Updates
RIP sends its complete routing table out to all active interfaces at regular intervals (every 30 seconds) and when the
network topology changes. When a router receives a routing update that includes changes to an entry, it updates its
routing table to reflect the new route. The metric value for the path is increased by one, and the sender is indicated as
the next hop. RIP routers maintain only the best route (the route with the lowest metric value) to a destination. After
updating its routing table, the router immediately begins transmitting routing updates to inform other network routers
of the change. These updates are sent independently of the regularly scheduled updates that RIP routers send.

RIP Routing Metric


RIP uses a single routing metric (hop count) to measure the distance between the source and a destination
network. Each hop in a path from source to destination is assigned a hop-count value, which is typically when a router
receives a routing update that contains a new or changed destination-network entry, the router adds one to the metric
value indicated in the update and enters the network in the routing table. The IP address of the sender is used as the
next hop.RIP prevents routing loops from continuing indefinitely by implementing a limit on the number of hops allowed
in a path from the source to a destination (15 hops). If a router receives a routing update that contains a new or changed
entry, and if increasing the metric value by one causes the metric to be infinity (that is, 16), the network destination is
considered unreachable.

Addressing Table
Host Interface IPAddress Subnet Mast Default
Router 0 FastEthernet0/0 74.125.10.1 255.0.0.0 Gateway
N/A
Serial 0/0 172.10.1.1 255.255.0.0 N/A
Serial 0/1 164.5.6.1 255.255.0.0 N/A
Router 2 FastEthernet0/0 10.10.1.1 255.0.0.0 N/A
Serial 0/0 134.10.1.1 255.255.0.0 N/A
Serial 0/1 172.10.1.2 255.255.0.0 N/A
Router 3 FastEthernet0/0 125.23.5.1 255.0.0.0 N/A
Serial 0/0 50.50.1.2 255.0.0.0 N/A
Serial 0/1 134.10.1.2 255.255.0.0 N/A
Router 1 FastEthernet0/0 192.168.1.1 255.255.255. N/A
Serial 0/0 164.5.6.2 0
255.255.0.0 N/A
Serial 0/1 50.50.1.1 255.0.0.0 N/A
PC0 NIC 74.125.10.2 255.0.0.0 74.125.10.1
PC1 NIC 74.125.10.3 255.0.0.0 74.125.10.1

Data Communication Network | 34


L.D. College of Engineering EC Department

PC2 NIC 10.10.1.2 255.0.0.0 10.10.1.1


PC3 NIC 10.10.1.3 255.0.0.0 10.10.1.1
PC4 NIC 192.168.1.2 255.255.255.0 192.168.1.1
PC5 NIC 192.168.1.3 255.255.255.0 192.168.1.1
PC6 NIC 125.23.5.2 255.0.0.0 125.23.5.1
PC7 NIC 125.23.5.3 255.0.0.0 125.23.5.1

Figure:

Dynamic Routing (RIP)


Procedure:
Configuring RIP

Instructions

1. Router 0 is connected to two networks i.e. 192.168.10.0 and 172.168.0.0. Hence, to configure RIP protocol, the
command used is “router rip” and then the networks that need to be connected to.

Router>enable
Router#configure terminal
Router(config)#router rip
Router0(config-router)#network 172.10.0.0
Router0(config-router)#network 165.5.0.0
Router0(config-router)#network 74.0.0.0
Router(config-router)#
Router(config-router)#exit

Data Communication Network | 35


L.D. College of Engineering EC Department

2. Do the same on 2nd router as well. Router 1 is connected to two networks i.e. 172.168.0.0 and 34.0.0.0.

To show the RIP routing protocol configured, use following command:


Router#show ip protocols

Routing Protocol is "rip"


Sending updates every 30 seconds, next due in 13 seconds
Invalid after 180 seconds; hold down 180, flushed after 240
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Redistributing: rip
Default version control: send version 1, receive any version
Interface Send Recv Triggered RIP Key-chain
Serial0/0 1 21
FastEthernet0/0 1 21
Automatic network summarization is in effect
Maximum path: 4
Routing for Networks:
74.0.0.0
165.5.0.0
172.10.0.0
Passive Interface(s):
Routing Information Sources:
Gateway Distance Last Update
172.10.1.2 120 00:00:14
Data Communication Network | 36
L.D. College of Engineering EC Department

Distance: (default is 120)


Router#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - Periodic downloaded static route

Gateway of last resort is not set

R 10.0.0.0/8 [120/1] via 172.10.1.2, 00:00:04, Serial0/0


R 50.0.0.0/8 [120/2] via 172.10.1.2, 00:00:04, Serial0/0
C 74.0.0.0/8 is directly connected, FastEthernet0/0
R 125.0.0.0/8 [120/2] via 172.10.1.2, 00:00:04, Serial0/0
R 134.10.0.0/16 [120/1] via 172.10.1.2, 00:00:04, Serial0/0
C 164.5.0.0/16 is directly connected, Serial0/1
C 172.10.0.0/16 is directly connected, Serial0/0
R 192.168.1.0/24 [120/3] via 172.10.1.2, 00:00:04, Serial0/0

Conclusion:

DATE: _______________ Sign of Faculty: ________________

Data Communication Network | 37


L.D. College of Engineering EC Department

Experiment-7
Aim:ToConfigure a network with sub-netting along with DNS Server.
Objectives:
1. To perform sub-netting.
2. To configure DNS server.
Apparatus:Personal Computer, Cisco Packet tracer 5.3
Theory:
Subnetting allows you to create multiple logical networks that exist within a single Class A, 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 link being a member of the same
network. If you break a major network (Class A, B, or C) into smaller sub-networks, it allows you to create a network
of interconnecting sub-networks. Each data link on this network would then have a unique network/sub-network ID.
Any device, or gateway, connecting n networks/sub-networks has n distinct IP addresses, one for each network / sub-
network that it interconnects.

In order to subnet a network, extend the natural mask using some of the bits from the host ID portion of the address to
create a sub-network 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|-------

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).

Note: There are two ways to denote these masks. First, since you are using 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.

In our network, we want to make 5 sub-networks, and hence we need minimum 23 = 8 sub-network scheme.
The network address taken into consideration is 192.168.10.0 and the default mask for this network is
255.255.255.0. Since, we want to make 8 sub-networks and hence we would be taking only 3 bits from the
net id for the subnet id as 23 = 8.

1st subnet: 192.168.10.00000000  192.168.10.0


192.168.10.00000000  192.168.10.31

2ndsubnet: 192.168.10.00100000  192.168.10.32


192.168.10.00100000  192.168.10.63

3rdsubnet: 192.168.10.01000000  192.168.10.64


192.168.10.01000000  192.168.10.95

4th subnet: 192.168.10.01100000  192.168.10.96


192.168.10.01100000  192.168.10.129

Data Communication Network | 38


L.D. College of Engineering EC Department

5th subnet: 192.168.10.10000000  192.168.10.130


192.168.10.10000000  192.168.10.161

Subnet mask: 255.255.255.11100000  255.255.255.224

Also, the number of bits assigned now would be 24(net id) + 3(subnet id) + 5(host id).
Hence, /27 will be used to denote the ip address for the particular network.

Figure:

Procedure:
The addresses assigned to the sub networks should be in the range provided above.
The configuration is listed as shown below.

Addressing Table
Host Subnet Interface IPAddress Subnet Mast Default Gateway
Router 0 FastEthernet0 192.168.10.1 255.255.255.224 N/A
/0
FastEthernet0 192.168.10.40 255.255.255.224 N/A
/1
Ethernet0/0/0 12.10.78.2 255.0.0.0 N/A
Ethernet0/1/0 192.168.10.135 255.255.255.224 N/A
Ethernet0/2/0 192.168.10.100 255.255.255.224 N/A
Ethernet0/3/0 192.168.10.65 255.255.255.224 N/A
Router 4 FastEthernet0 12.10.78.3 255.0.0.0 N/A
/0
FastEthernet0 172.56.89.2 255.255.0.0 N/A
Router 2 /1
FastEthernet0 172.56.89.3 255.255.0.0 N/A
/0
FastEthernet0 75.67.10.2 255.0.0.0 N/A
Server1 /1
FastEthernet 192.168.10.91 255.255.255.0 192.168.10.64
DNS
PC0 1st NIC 192.168.10.12/27 255.255.255.224 192.168.10.1/27

Data Communication Network | 39


L.D. College of Engineering EC Department

PC1 1st NIC 192.168.10.13/27 255.255.255.224 192.168.10.1/27


PC2 2nd NIC 192.168.10.33/27 255.255.255.224 192.168.10.40/27
PC3 2nd NIC 192.168.10.34/27 255.255.255.224 192.168.10.40/27
PC4 3rd NIC 192.168.10.90/27 255.255.255.224 192.168.10.64/27
PC5 3rd NIC 192.168.10.91/27 255.255.255.224 192.168.10.64/27
PC6 4th NIC 192.168.10.120/27 255.255.255.224 192.168.10.100/27
PC7 4th NIC 192.168.10.100/27 255.255.255.224 192.168.10.100/27
PC8 5th NIC 192.168.10.156/27 255.255.255.224 192.168.10.135/27
PC9 5th NIC 192.168.10.157/27 255.255.255.224 192.168.10.135/27
Server0 75.67.10.3 255.0.0.0 75.67.10.2
Web
Server
DNS SERVER

The Domain Name System (DNS) is a standard technology for managing the names of Web sites and other Internet
domains. DNS technology allows you to type names into your Web browser like compnetworking.about.com and your
computer to automatically find that address on the Internet. A key element of the DNS is a worldwide collection
of DNS servers.

A DNS server is any computer registered to join the Domain Name System. A DNS server runs special-purpose
networking software, features a public IP address, and contains a database of network names and addresses for other
Internet hosts.

IP address lookup is the process of translating between IP addresses and Internet domain/computer names. Forward IP
address lookup converts an Internet name to an address. Reverse IP address lookup converts the number to the name.

Several Internet services support both forward and reverse IP lookup for public addresses. On the Internet, these
services rely on the Domain Name System (DNS) and are known asDNS lookup and reverse DNS lookup services.
See the sidebar for locations of some popular DNS lookup sites.

Configuring DNS Server


Suppose we want to fetch a web address “www.google.com” having an IP address 75.67.10.3, that we have configured
on Server 0 as shown in the figure.

Instructions
1. In any one of the subnet, set up a local DNS server, the local client will send requests to this DNS Server for accessing
the web address www.google.com which in turn will look up for the web address.
In the local DNS Server, we need to make a record for the web address that we are looking up to. Hence, the web server’s
address is 75.67.10.3.

Data Communication Network | 40


L.D. College of Engineering EC Department

(2) On the web server, we again need to make a record of the web address that we are accessing which is
www.google.com which is located at 100.1.100.1.

(3) On a local PC, in the same sub-network, where DNS Server is configured and provide the address of DNS
server on the local PC.

(4) Now go to the web browser of the local PC and type www.google.com and you will get the page that has
been made on the web server.

Data Communication Network | 41


L.D. College of Engineering EC Department

Conclusion:

DATE: _______________ Sign of Faculty: ________________

PRACTICAL – 8
Data Communication Network | 42
L.D. College of Engineering EC Department

AIM:To configure Static NAT, Dynamic NAT with packet tracer

Objectives:

1. To configure static NAT.


2. To configure Dynamic NAT.

Apparatus:Personal Computer, Cisco Packet tracer 5.3

Theory:
The Internet is expanding at an exponential rate. As the amount of information and resources increases, it is
becoming a requirement for even the smallest businesses and homes to connect to the Internet. Network
Address Translation (NAT) is a method of connecting multiple computers to the Internet (or any other IP
network) using one IP address. This allows home users and small businesses to connect their network to the
Internet cheaply and efficiently.

The impetus towards increasing use of NAT comes from a number of factors:
 A world shortage of IP addresses
 Security needs
 Ease and flexibility of network administration

The basic purpose of NAT is to multiplex traffic from the internal network and present it to the Internet as if
it was coming from a single computer having only one IP address.

In NAT terminology, the inside network is the set of networks that are subject to translation. The outside
network refers to all other addresses. Usually these are valid addresses located on the Internet. The following
list of NAT terms is defined:

 Inside local address: The IPv4 address that is assigned to a host on the inside network. The inside
local address is likely not an IPv4 address assigned by the Network Information Center or service
provider.

 Inside global address: A legitimate IPv4 address assigned by the NIC or service provider that
represents one or more inside local IPv4 addresses to the outside world.

 Outside local address: The IPv4 address of an outside host as it appears to the inside network. Not
necessarily legitimate, the outside local address is allocated from a routable address space on the inside.

 Outside global address: The IPv4 address that is assigned to a host on the outside network by the host
owner. The outside global address is allocated from a globally routable address or network space.

Data Communication Network | 43


L.D. College of Engineering EC Department

STATIC NAT

Mapping an unregistered IP address to a registered IP address on a one-to-one basis.Particularly useful


when a device needs to be accessible from outside the network.

In static NAT, the computer with the IP address of 192.168.32.10 will always translate to 213.18.123.110

Addressing Table
Host Interface IPAddress Subnet Mast Default Gateway
Router 0 FastEthernet0/0 10.1.1.1 255.0.0.0 N/A
NAT Router (Inside local)
FastEthernet0/1 192.168.10.2 255.255.255.0 N/A
(Inside global)
Router 1 FastEthernet0/0 192.168.10.3 255.255.255.0 N/A
FastEthernet0/1 34.34.5.6 255.0.0.0 N/A
PC0 NIC 10.1.1.2 255.0.0.0 10.1.1.1
PC1 NIC 10.1.1.3 255.0.0.0 10.1.1.1
Server0 NIC 34.34.5.7 255.0.0.0 34.34.5.6

DYNAMIC NAT

Dynamic NAT is similar to static NAT in that the NAT router creates a one-to-one mapping between an inside local
and inside global address and changes the IP addresses in packets as they exit and enter the inside network. However,
the mapping of an inside local address to an inside global address happens dynamically. Dynamic NAT
accomplishes this by setting up a pool of possible inside global addresses and defining criteria for the set of inside
local IP addresses whose traffic should be translated with NAT.

With dynamic NAT, you can configure the NAT router with more IP addresses in the inside local address list than
in the inside global address pool. When the number of registered public IP addresses is defined in the inside global
address pool, the router allocates addresses from the pool until all are allocated. If a new packet arrives, and it needs
a NAT entry, but all the pooled IP addresses are already allocated, the router discards the packet. The user must try
again until a NAT entry times out, at which point the NAT function works for the next host that sends a packet. This
can be overcome through the use of Port Address Translation (PAT).

Configuring Static NAT

Procedure:

1. Establish static translation between an inside local address and an inside global address.

RouterX(config)# ipnat inside source static local-ip global-ip

Router(config)#ipnat inside source static 10.1.1.2 192.168.10.5

Data Communication Network | 44


L.D. College of Engineering EC Department

Router(config)#ipnat inside source static 10.1.1.3 192.168.10.6

Enter the no ipnat inside source static global command to remove the static source translation.

2. Specify the inside interface.

RouterX(config)# interface type number

Router(config)#interface FastEthernet 0/0

3. Mark the interface as connected to the inside.

RouterX(config-if)# ipnat inside

Router(config-if)#ipnat inside  This means that we are specifying FastEthernet 0/0 having network
id 10.0.0.0 as the inside local network or private network.

4. Specify the outside interface.

RouterX(config-if)# interface type number

Router(config)#interface FastEthernet 0/1

5. Mark the interface as connected to the outside.

RouterX(config-if)# ipnat outside


Router(config-if)#ipnat outside  This means that we are specifying FastEthernet 0/1 having network
id 192.168.10.0 as the inside global network or public network.

6. Use the command show ipnat translations in EXEC mode to display active translation information.

Router#showipnat translations

Pro Inside global Inside local Outside local Outside global


--- 192.168.10.5 10.1.1.2 --- ---
--- 192.168.10.6 10.1.1.3 --- ---

Addressing Table
Host Interface IPAddress Subnet Mast Default Gateway
R1 FastEthernet0/0 192.168.1.7 255.255.255.0 N/A
NAT Router
FastEthernet0/1 202.96.1.1 255.255.255.0 N/A
R2 FastEthernet0/0 202.96.1.2 255.255.255.0 N/A
H1 NIC 192.168.1.1 255.255.255.0 192.168.1.7
H2 NIC 192.168.1.2 255.255.255.0 192.168.1.7

Goal: Visualize how to configure dynamic NAT and see its effect on ping.
Topology: H1 and H2 are in the inside network. Their gateway is R1. R2 is located in the outside network.
Steps: 1) Configure dynamic NAT at R1. The public address pool contains one address
2) H1 ping R2. Ping's source address and Echo's destination address are mapped by NAT.
Data Communication Network | 45
L.D. College of Engineering EC Department

3) View NAT translation table and statistics to see the effect of ping on NAT.

Configuring Dynamic NAT

STEPS
1. Define a pool of global addresses to be allocated as needed.

RouterX(config)# ipnat pool name start-ip end-ip {netmasknetmask | prefix-length prefix-length}

R1(config)#ipnat pool DynamicNAT 202.96.1.3 202.96.1.100 netmask 255.255.255.0


// Define an address pool that contains addresses between 202.96.1.3/24 and 202.96.1.100/24.

Enter the no ipnat pool global command to remove the pool of global addresses.

2. Define a standard access control list (ACL) that permits the addresses that are to be translated.

RouterX(config)# access-list access-list-number permit source [sourcewildcard]

R1(config)#access-list 1 permit 192.168.1.0 0.0.0.255 // ACL allowed address.

Enter the no access-list access-list-number global command to remove the ACL.3. Mark the interface as
connected to the inside.

3. Establish dynamic source translation, specifying the ACL that was defined in the prior step.

RouterX(config)# ipnat inside source list access-list-number pool name

R1(config)#ipnat inside source list 1 pool DynamicNAT

// Map inside adresses allowed by ACL to addresses from the address pool.
Enter the no ipnat inside source global command to remove the dynamic source translation.

4. Specify the inside interface.

RouterX(config)# interface type number

R1(config)#interface fastEthernet 0/0


5. Mark the interface as connected to the inside.

RouterX(config-if)# ipnat inside

R1(config-if)# ipnat inside

6. Specify the outside interface.

RouterX(config-if)# interface type number

R1(config-if)#interface fastEthernet 0/1

7. Mark the interface as connected to the outside.

RouterX(config-if)# ipnat outside

R1(config-if)#ipnat outside

Data Communication Network | 46


L.D. College of Engineering EC Department

8. Check NAT translation table


Now the translation table is empty.
The table is being filled up when traffics are passing through NAT's inside/outside interfaces.

Ping R2 (test NAT)


H1 ping R2.
Ping's source IP address is 192.168.1.1.

NAT maps Ping's source address


When R1 receives Ping, it does:
- Check ACL. Ping' source address 192.168.1.1 is allowed by ACL.
- NAT chooses an available address (202.96.1.3) from the pool dynamically and replaces Ping's source
address this address.
- Tansmit ping from the outside interface fastEthernet 0/1. Ping's source IP is mapped to 202.96.1.3.

R1 maps Echo's destination address


- Echo's destination IP address is 202.96.1.3.
- When R1 receives Echo, it looks up its translation table, finds a match, and maps Echo's destination address
back to H1's local address 192.168.1.1.

Check NAT translation table


- Run command “show ipnat translations” again. It shows.
Pro Inside global Inside local Outside local Outside global
icmp 202.96.1.3:1192.168.1.1:1 202.96.1.2:1 202.96.1.2:1

An ICMP flow is record from the Ping/Echo traffic. NAT describes how to map addresses for packets belong
to this flow.

Check NAT statistics

R1#show ipnat statistics


Total translations: 1 (0 static, 1 dynamic, 0 extended)
Outside Interfaces: fastEthernet 0/1
Inside Interfaces: FastEthernet0/0
Hits: 1 Misses: 0
Expired translations: 0
Dynamic mappings:
-- Inside Source
access-list 1 pool DynamicNATrefCount 1
poolDynamicNAT: netmask 255.255.255.0
start 202.96.1.3 end 202.96.1.100
type generic, total addresses 98 , allocated 1 (1%), misses 0

CONCLUSION:

Data Communication Network | 47


L.D. College of Engineering EC Department

DATE: _______________ Sign of Faculty: ______________

Practical-09

AIM:To Configuration of frame relay& Wireless LAN using access point and
wireless router.

Objectives:

Data Communication Network | 48


L.D. College of Engineering EC Department

1. To configure frame Relay.


2. To configure wireless LAN using access point and wireless router.

Apparatus:Personal Computer, Cisco Packet tracer 5.3

Theory:

A) Frame Relay is a protocol standard for LAN internetworking which provides a fast and efficient method
of transmitting information from a user device to LAN bridges and routers.

The Frame Relay protocol uses a frame structured similar to that of LAPD, except that the frame header is
replaced by a 2-byte Frame Relay header field. The Frame Relay header contains the user-specified DLCI
field, which is the destination address of the frame. It also contains congestion and status signals which the
network sends to the user.

These two factors make Frame Relay a desirable choice for data transmission; however, they also necessitate
testing to determine that the system works properly and that data is not lost.

B) A wireless access point connects wireless clients to the wired LAN. Its job is to convert the TCP/IP data
packets from their 802.11 frame encapsulation format in the air to the 802.3 Ethernet frame format on the
wired Ethernet network. Wireless clients must associate with an access point to join the 802.11 network and
obtain network services. It is similar to the plugging in to a wired LAN. Access point oversees a DCF called
CSMA/CA. This simply means that devices on WLAN must wait until the medium is free before sending. If
an access point receives data from a client station, it sends an acknowledgement to the client that the data has
been received. This acknowledgement keeps the client from assuming that a collision occurred and prevents
a data retransmission by the client. If two clients are at the maximum range to reach the access point, they will
not be able to reach each other. So neither of those stations senses the other on the medium, and they may end
up transmitting simultaneously.

This practical covers how to configure an access point in packet tracer. Given is the network topology
designed in the practical. Packet tracer has two wireless devices that may be added to networking scenarios.

Procedure:

A.
The following topology is designed for the practical.

Data Communication Network | 49


L.D. College of Engineering EC Department

Step-01: Design the network according to the diagram.

Step-02: Configuration of Router-0:

Router(config)#interface fa0/0
Router(config-if)#ip address 20.0.0.1 255.0.0.0
Router(config-if)#exit
Router(config-if)#ip address 200.0.0.1 255.255.255.0
Router(config-if)#exit
Router(config)#router rip
Router(config-router)#network 20.0.0.0
Router(config-router)#network 200.0.0.0

Step-03: Similarly configure other two routers.

Step-04: Configuration of the cloud.

In the configuration tab, enter the DLCI for the serial communications from routers sequentially.

Data Communication Network | 50


L.D. College of Engineering EC Department

Similarly, configure other two serial lines.

Step-05: Frame Relay

Data Communication Network | 51


L.D. College of Engineering EC Department

Step-06: In router-0 encapsulation for frame relay:

Router(config-if)#encapsulation frame-relay
Similarly, follow this step for router-1 and router-2.

Testing the configuration:

B.

Packet tracer has two wireless devices that may be added to networking scenarios.

Data Communication Network | 52


L.D. College of Engineering EC Department

Step-01: Configure the router0.

Router(config-if)# ip address 75.125.1.1 255.0.0.0


Router(config-if)# exit
Router(config-if)#ip address 192.168.1.1 255.255.255.0

Step-02: Configuring the access point.

Data Communication Network | 53


L.D. College of Engineering EC Department

Step-03: Configure the access point2 same as the above.

Step-04: Configure the Laptop1 with the given settings.

Set the IP configurations of laptop1 with


IP address: 75.125.1.2
Subnet mask: 255.0.0.0
Default gateway: 75.125.1.1

Set the IPv6 settings of the device from config tab as auto config as shown in the figure.

Mention the channel name which is provided in the access point in the SSID field of the
wireless interface.

Step-05: Configure the another lap top in the similar way.

Data Communication Network | 54


L.D. College of Engineering EC Department

Testing the connectivity:

Data Communication Network | 55


L.D. College of Engineering EC Department

Configuring WLAN using Wireless Router:

Below is the network topology designed for the practical.

Step-01: Cable the network as shown in the diagram.

Step-02: The router and the end devices can be configured as the devices used in other networks.

Step-03: Configure the end-device as shown.

Data Communication Network | 56


L.D. College of Engineering EC Department

Testing the connectivity:

Data Communication Network | 57


L.D. College of Engineering EC Department

Conclusion:

DATE: _______________ Sign of Faculty: ______________

Data Communication Network | 58


L.D. College of Engineering EC Department

Experiment-10
Aim:Implement the data link layer framing methods.
Objectives:
1. Implement the data link layer framing method, bit stuffing.
2. Implement the data link layer framing method, character stuffing.
Apparatus:Personal Computer, Turbo C
Theory:

The data link layer needs to pack bits into frames, so that each frame is distinguishable from another. Our
postal system practices a type of framing. The simple act of inserting a letter into an envelope separates one
piece of information from another; the envelope serves as the delimiter.

The new technique allows data frames to contain an arbitrary number if bits and allows character codes with
an arbitrary no of bits per character. Each frame begins and ends with special bit pattern, 01111110, called a
flag byte. Whenever the sender’s data link layer encounters five consecutive ones in the data, it automatically
stuffs a 0 bit into the outgoing bit stream. This bit stuffing is analogous to character stuffing, in which a DLE
is stuffed into the outgoing character stream before DLE in the data.

The framing method gets around the problem of resynchronization after an error by having each frame start
with the ASCII character sequence DLE STX and the sequence DLE ETX. If the destination ever losses the
track of the frame boundaries all it has to do is look for DLE STX or DLE ETX characters to figure out. The
data link layer on the receiving end removes the DLE before the data are given to the network layer. This
technique is called character stuffing

Data Communication Network | 59


L.D. College of Engineering EC Department

Procedure:
A) ALGORITHM:

Begin
Step 1: Read frame length n
Step 2: Repeat step (3 to 4) until i<n(: Read values in to the input frame (0’s and 1’s) i.e.
Step 3: initialize I i=0;
Step 4: read a[i] and increment i
Step 5: Initialize i=0, j=0,count =0
Step 6: repeat step (7 to 22) until i<n
Step 7: If a[i] == 1 then
Step 8: b[j] = a[i]
Step 9: Repeat step (10 to 18) until (a[k] =1 and k<n and count <5)
Step 10: Initialize k=i+1;
Step 11: Increment j and b[j]= a[k];
Step 12: Increment count;
Step 13: if count =5 then
Step 14: increment j,
Step 15: b[j] =0
Step 16: end if
Step 17: i=k;
Step 18: increment k
Step 19: else
Step 20: b[j] = a[i]
Step 21: end if
Step 22: increment I and j
Step 23: print the frame after bit stuffing
Step 24: repeat step (25 to 26) until i< j
Step 25: print b[i]
Step 26: increment i
End

SOURCE CODE:

Data Communication Network | 60


L.D. College of Engineering EC Department

// BIT Stuffing program

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int a[20],b[30],i,j,k,count,n;
clrscr();
printf("Enter frame length:");
scanf("%d",&n);
printf("Enter input frame (0's & 1's only):");
for(i=0;i<n;i++)
scanf("%d",&a[i]);
i=0; count=1; j=0;
while(i<n)
{
if(a[i]==1)
{
b[j]=a[i];
for(k=i+1;a[k]==1 && k<n && count<5;k++)
{
j++;
b[j]=a[k];
count++;
if(count==5)
{
j++;
b[j]=0;
}
i=k;
}}
else
{
b[j]=a[i];
}
i++;
j++;
}
printf("After stuffing the frame is:");
for(i=0;i<j;i++)
printf("%d",b[i]);
getch();
}

OUTPUT:

Data Communication Network | 61


L.D. College of Engineering EC Department

B) ALGORITHM:

Begin
Step 1: Initialize I and j as 0
Step 2: Declare n and pos as integer and a [20],b [50],ch as character
Step 3: read the string a
Step 4: find the length of the string n, i.e n-strlen(a)
Step 5: read the position, pos
Step 6: if pos> n then
Step 7: print invalid position and read again the position, pos
Step 8: end if
Step 9: read the character, ch
Step 10: Initialize the array b, b[0…5] as ’d’, ’l’, ’e’, ’s’ ,’t’ ,’x’respectively
Step 11: j=6;
Step 12: Repeat step[(13to22) until i<n
Step 13: if i==pos-1 then
Step 14: initialize b array,b[j],b[j+1]…b[j+6] as‘d’, ‘l’, ‘e’ ,’ch, ’d’, ‘l’,‘e’respectively
Step 15: increment j by 7, i.e j=j+7
Step 16: end if
Step 17: if a[i]==’d’ and a[i+1]==’l’ and a[i+2]==’e’ then
Step 18: initialize array b, b[13…15]=’d’, ‘l’, ‘e’ respectively
Step 19: increment j by 3, i.e j=j+3
Step 20: end if
Step 21: b[j]=a[i]
Step 22: increment I and j;
Step 23: initialize b array,b[j],b[j+1]…b[j+6] as‘d’, ‘l’,‘e’ ,’e’,‘t’, ‘x’,‘\0’respectively
Step 24: print frame after stiuffing
Step 25: print b
End

SOURCE CODE:
//PROGRAM FOR CHARACTER STUFFING
#include<stdio.h>
#include<conio.h>
#include<string.h>

Data Communication Network | 62


L.D. College of Engineering EC Department

#include<process.h>
void main()
{
int i=0,j=0,n,pos;
char a[20],b[50],ch;
clrscr();
printf("enter string\n");
scanf("%s",&a);
n=strlen(a);
printf("enter position\n");
scanf("%d",&pos);
if(pos>n)
{
printf("invalid position, Enter again :");
scanf("%d",&pos);
}
printf("enter the character\n");
ch=getche();
b[0]='d';
b[1]='l';
b[2]='e';
b[3]='s';
b[4]='t';
b[5]='x';
j=6;
while(i<n)
{
if(i==pos-1)
{
b[j]='d';
b[j+1]='l';
b[j+2]='e';
b[j+3]=ch;
b[j+4]='d';
b[j+5]='l';
b[j+6]='e';
j=j+7;
}
if(a[i]=='d' && a[i+1]=='l' && a[i+2]=='e')
{
b[j]='d';
b[j+1]='l';
b[j+2]='e';
j=j+3;
}
b[j]=a[i];
i++;
j++;
}
b[j]='d';
b[j+1]='l';

Data Communication Network | 63


L.D. College of Engineering EC Department

b[j+2]='e';
b[j+3]='e';
b[j+4]='t';
b[j+5]='x';
b[j+6]='\0';
printf("\nframe after stuffing:\n");
printf("%s",b);
getch();
}
OUTPUT:

Conclusion:

DATE: _______________ Sign of Faculty: ________________

Data Communication Network | 64


L.D. College of Engineering EC Department

Experiment-11
Aim:To implement Dijktra’s algorithm using ‘C’ language to find the shortest path
within a subnet.
Theory:

Dijkstra's algorithm is a graph search algorithm that solves the single-source shortest path problem for a
graph with nonnegative edge path costs, producing a shortest path tree. This algorithm is often used in routing
and as a subroutine in other graph algorithms.

For a given source vertex (node) in the graph, the algorithm finds the path with lowest cost (i.e. the shortest
path) between that vertex and every other vertex. It can also be used for finding costs of shortest paths from a
single vertex to a single destination vertex by stopping the algorithm once the shortest path to the destination
vertex has been determined. For example, if the vertices of the graph represent cities and edge path costs
represent driving distances between pairs of cities connected by a direct road, Dijkstra's algorithm can be used
to find the shortest route between one city and all other cities. As a result, the shortest path first is widely used
in network routing protocols, most notably IS-IS and OSPF (Open Shortest Path First).

Let the node at which we are starting be called the initial node. Let the distance of node Y is the distance
from the initial node to Y. Dijkstra's algorithm will assign some initial distance values and will try to improve
them step by step.

1. Assign to every node a tentative distance value: set it to zero for our initial node and to infinity for all
other nodes.
2. Mark all nodes unvisited. Set the initial node as current. Create a set of the unvisited nodes called the
unvisited set consisting of all the nodes except the initial node.
3. For the current node, consider all of its unvisited neighbors and calculate their tentative distances. For
example, if the current node A is marked with a tentative distance of 6, and the edge connecting it with
a neighbor B has length 2, then the distance to B (through A) will be 6+2=8. If this distance is less
than the previously recorded tentative distance of B, then overwrite that distance. Even though a
neighbor has been examined, it is not marked as "visited" at this time, and it remains in the unvisited
set.
4. When we are done considering all of the neighbors of the current node, mark the current node as visited
and remove it from the unvisited set. A visited node will never be checked again; its distance recorded
now is final and minimal.

Data Communication Network | 65


L.D. College of Engineering EC Department

5. If the destination node has been marked visited (when planning a route between two specific nodes)
or if the smallest tentative distance among the nodes in the unvisited set is infinity (when planning a
complete traversal), then stop. The algorithm has finished.
6. Set the unvisited node marked with the smallest tentative distance as the next "current node" and go
back to step 3.

Procedure:
Pseudocode

In the following algorithm, the code u := vertex in Q with smallest dist[], searches for the vertex u in the vertex
set Q that has the least dist[u] value. That vertex is removed from the set Q and returned to the user. Distance
between(u, v) calculates the length between the two neighbor-nodes u and v. The variable alt on lines 20 & 22
is the length of the path from the root node to the neighbor node v if it were to go through u. If this path is
shorter than the current shortest path recorded for v, that current path is replaced with this alt path. The
previous array is populated with a pointer to the "next-hop" node on the source graph to get the shortest route
to the source.

functionDijkstra(Graph, source):
for each vertex v in Graph: // Initializations
dist[v] := infinity ; // Unknown distance function from
// source to v
previous[v] := undefined ; // Previous node in optimal path
end for// from source

dist[source] := 0 ; // Distance from source to source


Q := the set of all nodes in Graph ; // All nodes in the graph are
// unoptimized - thus are in QwhileQis not empty: // The
main loop
u := vertex in Q with smallest distance in dist[] ; // Start node in first case
remove u from Q ;
ifdist[u] = infinity:
break ;// all remaining vertices are
end if// inaccessible from source
for each neighbor v of u: // where v has not yet been
// removed from Q.
alt := dist[u] + dist_between(u, v) ;
ifalt<dist[v]: // Relax (u,v,a)dist[v] := alt ;
previous[v] := u ;
decrease-keyv in Q; // Reorder v in the Queue
end if
end for
end while
returndist;

If we are only interested in a shortest path between vertices source and target, we can terminate the search
at line 13 if u = target. Now we can read the shortest path from source to target by reverse iteration:

S:= empty sequence


u := target
while previous[u] is defined: // Construct the shortest path with a stack S
insertu at the beginning of S// Push the vertex into the stack
u := previous[u] // Traverse from target to source
end while ;

Conclusion:
Data Communication Network | 66
L.D. College of Engineering EC Department

DATE: _______________ Sign of Faculty: __________

Data Communication Network | 67


L.D. College of Engineering EC Department

Experiment-12
Aim: To study encryption and decryption.
Theory:
In cryptography, encryption is the process of encoding messages (or information) in such a way that
eavesdroppers or hackers cannot read it, but that authorized parties can. In an encryption scheme, the message
or information is encrypted using an encryption algorithm, turning it into an unreadable cipher text. This is
usually done with the use of anencryption key, which specifies how the message is to be encoded. Any
adversary that can see the ciphertext should not be able to determine anything about the original message. An
authorized party, however, is able to decode the ciphertext using a decryptionalgorithm that usually requires
a secret decryption key that adversaries do not have access to. For technical reasons, an encryption scheme
usually needs a key-generation algorithm, to randomly produce keys.
There are two basic types of encryption schemes: private-key encryption and public-key encryption. In
private-key schemes, the encryption and decryption keys are the same. Thus communicating parties must
agree on a secret key before they wish to communicate. By contrast, in public-key schemes, the encryption
key is public: that is, anyone (friend or foe) has access to the encryption key, and can encrypt messages.
However only the receiving party has access to the decryption key and thus is the only one capable of reading
the encrypted messages. Public-key encryption is a relatively recent invention: historically, all encryption
schemes have been private-key schemes.
Encryption has long been used by militaries and governments to facilitate secret communication. It is now
commonly used in protecting information within many kinds of civilian systems. For example, the Computer
Security Institute reported that in 2007, 71% of companies surveyed utilized encryption for some of their data
in transit, and 53% utilized encryption for some of their data in storage.Encryption can be used to protect data
"at rest", such as files on computers and storage devices (e.g. USB flash drives). In recent years there have
been numerous reports of confidential data such as customers' personal records being exposed through loss or
theft of laptops or backup drives. Encrypting such files at rest helps protect them should physical security
measures fail. Digital rights management systems which prevent unauthorized use or reproduction of
copyrighted material and protect software against reverse engineering are another somewhat different
example of using encryption on data at rest.
Encryption is also used to protect data in transit, for example data being transferred via networks (e.g.
the Internet, e-commerce),mobile telephones, wireless microphones, wireless
intercom systems, Bluetooth devices and bank automatic teller machines. There have been numerous reports
of data in transit being intercepted in recent years. Encrypting data in transit also helps to secure it as it is often
difficult to physically secure all access to networks.
Encryption, by itself, can protect the confidentiality of messages, but other techniques are still needed to
protect the integrity and authenticity of a message; for example, verification of a message authentication
code (MAC) or a digital signature. Standards andcryptographic software and hardware to perform encryption
are widely available, but successfully using encryption to ensure security may be a challenging problem. A
single slip-up in system design or execution can allow successful attacks. Sometimes an adversary can obtain
unencrypted information without directly undoing the encryption.
Digital signature and encryption must be applied at message creation time (i.e. on the same device it has been
composed) to avoid tampering. Otherwise any node between the sender and the encryption agent could
potentially tamper it. It should be noted that encrypting at the time of creation only adds security if the
encryption device itself has not been tampered with.

Data Communication Network | 68


L.D. College of Engineering EC Department

Write a C-Program for Encryption of String using X-Or Method.


#include<stdio.h>
#include<conio.h>

void
main()
{
int
key,i,f=0;
char *str;

clrscr();
printf("Enter String to be Encrypted: ");
gets(str);
printf("Enter Cipher key : ");
scanf("%d",&key);
follow:

for(i=0;i<strlen(str);i++)
{
str[i]=str[i]^key;
}
if(f==0)
{
printf("\nEncrypted String is %s",str);

getch();
f=1;
goto follow;
}
printf("\nDecrypted String is %s",str);
getch();

}
#include<stdio.h>

Data Communication Network | 69


L.D. College of Engineering EC Department

#include<conio.h>
void
main()
{

int
i,j,len,c,d,f=0;
char *str;
clrscr();
printf("Enter the string to be Transposed :");
gets(str);

len=strlen(str);
c=len/2;
if(len%2==1)
goto odd;
else
goto even;

odd: c++;
even: cont:
for(i=0;i<len/2;i++)
{
if(i%2 == 0)
{

d=str[i];
str[i]=str[i+c];
str[i+c]=d;
}
else
{

d=str[i];
str[i]=str[len-i-1];

Data Communication Network | 70


L.D. College of Engineering EC Department

str[len-i-1]=d;
}
}
if(f==0)

{
printf("\nTransposed String is %s",str);
getch();
}

Write a C-Proagram for Encryption and Decryption of Data using Add-


Subtract Cipher Key Method.
#include<stdio.h>
#include<conio.h>
void
main()
{

int key, i;
char *data;
clrscr();
printf("Please Enter the Data to be Encrypted : ");
gets(data);
printf("Please Enter the Cipher Key : ");

scanf("%d",&key);
for(i=0;i<strlen(data);i++)
{
data[i]= data[i] + key;
}
printf("\nEncrypted Data is %s",data);

getch();
for(i=0;i<strlen(data);i++)
{

Data Communication Network | 71


L.D. College of Engineering EC Department

data[i]=data[i] -key;
}
printf("\nDecrypted Data is %s",data);
getch();

}
Output:

CONCLUSION:

DATE: _______________ Sign of Faculty: __________

Data Communication Network | 72

You might also like