0% found this document useful (0 votes)
355 views55 pages

CN Lab Manual

CN Lab Manual

Uploaded by

Dev Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
355 views55 pages

CN Lab Manual

CN Lab Manual

Uploaded by

Dev Patel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Laboratory Manual for

Computer Networks (3161007)

B.E. Semester 6 (E&C Engineering)

Government Engineering College, Sector-28, Gandhinagar

Directorate of Technical Education, Gandhinagar, Gujarat


Government Engineering College, Sector-28,
Gandhinagar

Department of Electronics and Communication

CERTIFICATE

This is to certify that Mr./Ms. Enrollment

No. of B.E. Semester 6 E&C Engineering of this Institute

has satisfactorily completed the Practical / Tutorial work for the subject

Computer Networks (3161007) for the academic year 2023-24.

Place:

Date:

Name and Sign of Faculty member

Head of the Department


Practical – Course Outcome matrix

Course Outcomes (COs):


CO-1: Enumerate the layers of the OSI model and TCP/IP functions of each layer
CO-2: Analyze MAC Layer Protocols
CO-3: Implement routing and congestion control algorithms
CO-4: Examine the functions of Transport and application layers
CO-5: Implement the network protocols using network monitoring tools

Sr. CO CO CO CO CO
Objective(s) of Experiment
No. 1 2 3 4 5
Study of different types of Network cables and
1. √ √
practically implement the cross-wired
cable and straight through cable using clamping tool.
Study of networking devices in detail.
2. √ √
To Connect the computers in Local Area Network
3. √

Study of network topologies using packet Tracer


4. √
simulator
Study of Basic network command and Network √
5. configuration commands.
Write a program for IPV4, Implementation of √ √
6.
decimal to binary, Implementation of binary to
decimal.
Write a program to implement bit stuffing & √
7.
Destuffing
Write a program to implement Parity checker √
8.

Write a program to implement CRC. √


9.

Write a program to implement Hamming Code √


10. √

Write a program to encrypt and decrypt using Caesar


11. √ √
cipher in C
Configure network using Distant vector routing √
12.
protocol, RIP in packet tracer
Computer Networks (3161007)

Vision of E&C Department:


➢ To produce globally competitive and resourceful EC Engineers to bring out research, innovation
and teamwork for development in various fields of Electronics and Communication Engineering.

Mission of E&C Department:


➢ To impart quality education in the fields of Electronics and Communication Engineering through
effective teaching-learning processes, well equipped laboratory facilities and collaborative ventures
with industries.
➢ To provide the students of E&C engineering an environment of an academic freedom that will
ensure the exchange of ideas and the dissemination of knowledge in this discipline.
➢ To provide the platform for students to perform the project work related to needs of society.

Program Educational Objectives (PEOs) of E&C Department:


I. To prepare graduates to excel in postgraduate programs or pursue higher studies or to
succeed in industry / technical profession through global, rigorous education.

II. To train graduates with good scientific and engineering breadth so as to comprehend,
analyze, design, and create novel products and solutions for the real life problems.

III. To inculcate in graduates professional and ethical attitude, effective communication skills,
teamwork skills, multidisciplinary approach, and an ability to relate engineering issues to
broader social context.

Program Specific Outcomes (PSOs) of E&C Department:


PSO-I: The ability to implement and apply knowledge of Electronics and Communication Engineering subjects
in the analysis, design and development of various types of electronic and communication systems.

PSO-II: Demonstrate soft skills, aptitude and technical skills & knowledge to work in the
industry and Research and Development organization.

Program Outcomes (POs):

NBA has defined the following twelve POs for an engineering graduate:

I. Problem Analysis: Identify, formulate, review research literature, and analyse complex
engineering problems reaching substantiated conclusions using first principles of
mathematics, natural sciences and engineering sciences.

II. Design/Development of Solutions: Design solutions for complex engineering problems


and design system components or processes that meet the specified needs with
appropriate consideration for the public health and safety, and the cultural, societal, and
environmental considerations.

III. Conduct Investigations of Complex Problems: Use research-based knowledge and


research methods including design of experiments, analysis and interpretation of data,
Computer Networks (3161007)
and synthesis of the information to provide valid conclusions for complex problems:
that cannot be solved by straightforward application of knowledge, theories and
techniques applicable to the engineering discipline as against problems given at the end of
chapters in a typical text book that can be solved using simple engineering theories and
techniques
that may not have a unique solution. For example, a design problem can be solved in
many ways and lead to multiple possible solutions;
that require consideration of appropriate constraints / requirements not explicitly
given in the problem statement such as cost, power requirement, durability, product life,
etc.;
which need to be defined (modelled) within appropriate mathematical framework; and
IV. that often require use of modern computational concepts and tools, for example, in the
design of an antenna or a DSP filter.
1. Modern Tool Usage: Create, select, and apply appropriate techniques, resources, and
modern engineering and IT tools including prediction and modelling to complex
engineering activities with an understanding of the limitations.
2. The Engineer and Society: Apply reasoning informed by the contextual knowledge to
assess societal, health, safety, legal and cultural issues and the consequent
responsibilities relevant to the professional engineering practice.
3. Environment and Sustainability: Understand the impact of the professional
engineering solutions in societal and environmental contexts, and demonstrate the
knowledge of, and need for sustainable development.
4. Ethics: Apply ethical principles and commit to professional ethics and responsibilities
and norms of the engineering practice.
5. Individual and Team Work: Function effectively as an individual, and as a member
or leader in diverse teams, and in multidisciplinary settings.
6. Communication: Communicate effectively on complex engineering activities with the
engineering community and with society at large, such as, being able to comprehend
and write effective reports and design documentation, make effective presentations,
and give and receive clear instructions.
7. Project Management and Finance: Demonstrate knowledge and understanding of
the engineering and management principles and apply these to one’s own work, as a
member and leader in a team, to manage projects and in multidisciplinary
environments.
8. Life-long Learning: Recognize the need for, and have the preparation and ability to
engage in independent and lifelong learning in the broadest context of technological
change.
Computer Networks (3161007)

Rubrics for C o m p u t e r N e t w o r k s (3161007)


LEVEL Excellent Good Satisfactory Need improvement
Score
CRITERIA 1 0.8 0.6 0.4
Clearly describes the Objectives of Adequately describes the Objectives of Describes the Objectives of the Lab Does not adequately describe
the Lab as well as the skill the Lab and the skill information and information learned, but some the Objectives of the Lab, what
1. Objectives information learned. Discusses learned. But does not discuss possible details are lacking. Does not describe was learned, or any possible
possible sources of experimental sources of experimental errors, their any experimental errors or describes experimental errors.
errors, their likely effects and likely effects. their likely effects.
ways to minimize them.
Conclusions illustrate a through Conclusions illustrate a through and Conclusions illustrate a limited Conclusions illustrate an
and accurate understanding of accurate understanding of most understanding of concepts inaccurate understanding of
technical concepts underlying the concepts underlying the lab. But does underlying the lab. Does not concepts underlying the lab.
2. Conclusions lab. Describes numerous future not describes skill and information’s describes skill and information’s No meaningful applications to
applications to real life situations learned or make it clear how they learned, any possible applications to real life situations are
and make it clear how they would would be useful. real life situations, or explain how describe.
be useful. they could be useful.
Clearly describe the problems Adequately describe the problems Describe the problems encountered Does not adequately describe
encountered and how they were encountered and how they were but does not describe how they were the problems encountered or
solved. Problems cited are highly solved. But may leave some solved. Problems cited are only describe how they were
3. Problem relevant to the purpose of the unanswered questions. Problems cited somewhat relevant to the purpose solved. Problems cited are not
Analysis
lab. Appears to use an efficient are relevant to the purpose of the lab. of the lab. Appears to use an relevant to the purpose of the
and effective strategy to solve the Appears to use an effective strategy to effective strategy to solve the lab. Really uses an effective
problems. solve the problems. problems, but does not do it strategy to solve the problems.
consistently.
Adequately detailed results are Adequately detailed results are shown Results are shown for each Results and/or details are
shown for each procedure step. for each procedure step. Almost (80-89 procedure step, but some details are lacking for some procedure
4. Observation 90-100 % of the steps have no %) of the steps have no errors. Used lacking. Most (70-79 %) of the steps step. More than 30 % of the
/
Measurements/ errors. Used time well in lab and time pretty well. Stayed focused have no errors. Did the lab but did not steps have errors. Participation
focused attention on the experiment most of time. appear very interested. Focus was minimal or student was
Results
experiment. was lost on several occasions. hostile about participation.
90-100 % of the solution steps and Almost all (80-89 %) of the solution Most (70-79 %) of the solution steps More than 30 % of the solution
5. Questions explanations have no errors. steps and explanations have no errors. and explanations have no errors. steps and explanations have
errors.
Write score in the table given at the end of each experiment for rubric wise marks. Total Points:
Computer Networks (3161007)

Index
(Progressive Assessment Sheet)

Sr. Objective(s) of Experiment Page Date of Assessment Sign Remarks


No. No. submission Marks

1 Study of different types of Network


cables and practically implement the
cross-wired cable and straight through
cable using clamping tool.
2 Study of networking devices in detail.

3 To Connect the computers in Local


Area Network
4 Study of network topologies using
packet Tracer simulator
5 Study of Basic network command and
Network configuration commands.
6 Write a program for IPV4,
Implementation of decimal to binary,
Implementation of binary to decimal.
7 Write a program to implement bit
stuffing& Destuffing
8 Write a program to implement Parity
checker
9 Write a program to implement CRC.

10 Write a program to implement


Hamming Code
11 Write a program to encrypt and decrypt
using Caesar cipher in C
12 Configure network using Distant vector
routing protocol, RIP in packet tracer

Total
Computer Networks (3161007)

Experiment No: 1

Study of different types of Network cables and practically implement the cross-wired cableand
straight through cable using clamping tool.

Date:
Competency and Practical Skills:
➢ Understanding the types of network cables and practically implement this and test
it for network purpose in LAN and WAN.

Relevant CO:
CO-1: Enumerate the layers of the OSI model and TCP/IP functions of each layer

CO-5: Implement the network protocols using network monitoring tools

Objectives:
To categorize standard cable types and their properties

Equipment/Instruments: RJ-45 connector, Clamping Tool, Twisted pair Cable

Theory:
1. Start by stripping off about 2 inches of the plastic jacket off the end of the cable. Be very careful
at this point, as to not nick or cut into the wires, which are inside. Doing so could alter the
characteristics of your cable, or even worse render is useless. Check the wires, one more time for
nicks or cuts. If there are any, just whack the whole end off, and start over.

2. Spread the wires apart, but be sure to hold onto the base of the jacket with your other hand. You
do not want the wires to become untwisted down inside the jacket. Category 5 cable must only have
1/2 of an inch of 'untwisted' wire at the end; otherwise, it will be 'out of spec'. At this point, you
obviously have ALOT more than 1/2 of an inch of un-twisted wire.

3. You have 2 end jacks, which must be installed on your cable. If you are using a pre-made cable,
with one of the ends whacked off, you only have one end to install - the crossed over end. Below are
two diagrams, which show how you need to arrange the cables for each type of cable end.

The codes are commonly depicted with RJ-45 jacks as follows (the view is from the front of the jacks)
Computer Networks (3161007)

Diagram shows you how to prepare Cross wired connection

Purpose of Crossover Cable-

Crossover cables are very similar to straight-through cables, except that they have pairs of wiresthat
crisscross. This allows for two devices to communicate at the same time. Unlike straight through
cables, we use crossover cables to connect like devices.

Crossover cables are typically used in the following situations:

Use a crossover cable when:


1. Connecting a computer to a router
2. Connecting a computer to a computer
3. Connecting a router to a router
4. Connecting a switch to a switch
5. Connecting a hub to a hub
Computer Networks (3161007)

Diagram shows you how to prepare straight through wired connection

Purpose of Straight through Cable-


Straight-through cables get their name from how they are made. Out of the 8 pins that exist on both
ends of an Ethernet cable, each pin connects to the same pin on the opposite side.

A straight-through cable is typically used in the following situations:


Use a straight-through cable when:
1. Connecting a router to a hub
2. Connecting a computer to a switch
3. Connecting a LAN port to a switch, hub, or computer

Conclusion: -
Computer Networks (3161007)

Quiz:
1. What type of connector do twisted pair cables on computer network use?

A. RJ11
B. RJ30
C. RJ45
D. None of the above

Ans-

2. How is unique MAC address assigned to a Network card?


A. It is built into the card when the card is manufactured
B. The network administrator must assign the address
C. A unique address is automatically assigned when the card drivers are installed
D. A unique address is automatically assigned when you boot up the computer

Ans-

3. What is the speed of Gigabit Ethernet?


A. 1 Mb/s
B. 10 Mb/s
C. 100 Mb/s
D. 1000 Mb/s
Ans-

4. What is the maximum length of cat5/cat5e/cat6 UTP cable?


A. 10 meters
B. 100 meters
C. 1000 meters
D. 1 mile

Ans-
Computer Networks (3161007)

Suggested Reference:
1. Computer Networks by Andrew S. Tanenbaum, 4th Edition, Prentice Hall Publication
2. Data Communication and Networking by Behrouz Forouzan, 4th Edition, Tata McGraw-Hill Publication

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks
Computer Networks (3161007)

Experiment No: 2

Study of following networking devices in detail


• Repeater
• Gateway
• Bridge
• Switch
• Hub
• Router

Date:
Competency and Practical Skills:
➢ To understand function of networking device.
➢ Able to do network configuration using network devices.
Relevant CO:
CO-1: Enumerate the layers of the OSI model and TCP/IP functions of each layer

CO-5: Implement the network protocols using network monitoring tools

Objectives:

The purpose of networking devices is to enable smooth communication between different hardware
connected to a network. Addition of a network device helps in hassle free sharing of network resources
between different systems.

Equipment/Instruments: No software or hardware is needed.

Theory:

Following should be done to understand this practical.

Repeater: Functioning at Physical layer. A repeater is electronics device that regenerate the signalover
the same network before the signal becomes too weak or corrupted so as to extend the length towhich
the signal can be transmitted over the same network. It does not amplify the signal. When thesignal
becomes weak, they copy the signal bit by bit and regenerate it at the original strength. It is a 2-port
device.

Gateway: In communication network, a network node equipped for interfacing with another
network that uses different protocol. A gateway operates at any network layer. It is a passage to
connect two networks together that may work upon different networking models. It works as the
messenger agents that take data from one system, interpret it, and transfer it to another system.
Gateways are also called protocol converters.

Bridge: A bridge operates at data link layer. A bridge is a repeater, with add on functionality of filtering
content by reading the MAC addresses of source and destination. It is also used for interconnecting two
Computer Networks (3161007)

LANs working on the same protocol. It has a single input and single output port, thus making it a 2-
port device.

Switch: A switch is a multi-port bridge with a buffer and a design that can boost its efficiency and
performance. Switch is data link layer device. Switch processes and routes data at the data link layer
(layer 2) of the OSI model. Switches that additionally processes data at network layer (layer 3) are
often referred to as Layer 3 switches or multilayer switches. Switch can perform error checking before
forwarding data.

Hub: A hub is a device for connecting multiple twisted pair and fiber optic. Hubs work at physical
layer (layer 1) of OSI the model. The device is form of multiport repeater. Hubs cannot filter data,
so data packets are sent to all connected devices. Also, they do not have intelligence tofind out best
path for data packets which leads to inefficiencies and wastage. Repeater Hubs alsoparticipate in
collision detection, forwarding a jam signal to all ports if it detects a collision.
Router: A router is a device like a switch that routes data packets based on their IP addresses. Router
is mainly a Network Layer device. Routers normally connect LANs and WANs together andhave a
dynamically updating routing table based on which they make decisions on routing the data packets.
Router divide broadcast domains of hosts connected through it.

Conclusion :

Quiz:
1. When microwave signals follow the curvature of the earth, this phenomenon is known as
A. Troposcatter
B. Ducting
C. Ionospheric reflection
D. Faraday effect
Ans-
Computer Networks (3161007)

2. Using the point to point propagation prediction model the path loss slope will have a
standard deviation of less than only.
A. 1 dB
B. 2-3 dB
C. 6-8 dB
D. 10-12 dB
Ans-

3. Electromagnetic waves are refracted when they


A. Encounter a perfectly conducting surface
B. Pass through a small slot in a conducting plane
C. Pass in to a medium of different dielectric constant
D. Are polarised at right angles to the direction of propagation
Ans-

Suggested Reference:
1. Computer Networks by Andrew S. Tanenbaum, 4th Edition, Prentice Hall Publication
2. Data Communication and Networking by Behrouz Forouzan, 4th Edition, Tata McGraw-Hill Publication

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks
Computer Networks (3161007)

Experiment No: 3

To Connect the computers in Local Area Network

Date:
Competency and Practical Skills:
➢ Understanding the development of LAN.
Relevant CO:
CO-1: Enumerate the layers of the OSI model and TCP/IP functions of each layer

CO-5: Implement the network protocols using network monitoring tools

Objectives:
To design the Local Area Network using various network top olog y.
Equipment/Instruments: No software or hardware is needed.

Theory:

On the host computer, follow these steps to share the Internet connection:

1. Log on to the host computer as Administrator or as Owner.


2. Click Start, and then click Control Panel.
3. Click Network and Internet Connections.
4. Click Network Connections.
5. Right-click the connection that you use to connect to the Internet. For example, if you connect to
the Internet by using a modem, right-click the connection that you want under Dial-up / another
network available.
6. Click Properties.
7. Click the Advanced tab.
8. Under Internet Connection Sharing, select the Allow other network users to connect through this
computer's Internet connection check box.
9. If you are sharing a dial-up Internet connection, select the Establish a dial-up connection whenever
a computer on my network attempts to access the Internet check box if you want to permityour computer
to automatically connect to the Internet.
10. Click OK.
You receive the following message: When Internet Connection Sharing is enabled, your LAN adapter
will be set to use IP address192.168.0.1. Your computer may lose connectivity with other computers
on your network. If these other computers have static IP addresses, it is a good idea to setthem to obtain
their IP addresses automatically. Are you sure you want to enable Internet Connection Sharing?
11. Click Yes.
The connection to the Internet is shared to other computers on the local area network (LAN). The
network adapter that is connected to the LAN is configured with a static IP address of192.168.0.1
and a subnet mask of 255.255.255.
Computer Networks (3161007)

On the client computer

To connect to the Internet by using the shared connection, you must confirm the LAN adapter IP
configuration, and then configure the client computer. To confirm the LAN adapter IP configuration,
follow these steps:

1. Log on to the client computer as Administrator or as Owner.


2. Click Start, and then click Control Panel.
3. Click Network and Internet Connections.
4. Click Network Connections.
5. Right-click Local Area Connection and then click Properties.
6. Click the General tab, click Internet Protocol (TCP/IP) in the connection uses the following items
list, and then click Properties.
7. In the Internet Protocol (TCP/IP) Properties dialog box, click Obtain an IP address automatically(if
it is not already selected), and then click OK. Note: You can also assign a unique static IP address in
the range of 192.168.0.2 to192.168.0.254. For example, you can assign the following static IP address,
subnet mask, and default gateway:

8. IP Address 192.168.31.202
9. Subnet mask 255.255.255.0
10. Default gateway 192.168.31.1
11. In the Local Area Connection Properties dialog box, click OK.

12. Quit Control Panel.

Conclusion:

Quiz:
1. Which of the following services use TCP?
A. DHCP
B. SMTP
C. HTTP
D. TFTP
E. FTP
Ans-
Computer Networks (3161007)

2. You want to implement a mechanism that automates the IP configuration, including


IP address, subnet mask, default gateway, and DNS information. Which protocol will
you use to accomplish this?
A. ARP
B. SMTP
C. SNMP
D. DHCP
Ans-

3. Which of the following is private IP address?


A. 12.0.0.1
B. 168.172.19.39
C. 172.15.14.36
D. 192.168.24.43

Ans-

Suggested Reference:
1. Computer Networks by Andrew S. Tanenbaum, 4th Edition, Prentice Hall Publication
2. Data Communication and Networking by Behrouz Forouzan, 4th Edition, Tata McGraw-Hill Publication

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks
Computer Networks (3161007)

Experiment No: 4

Study of network topologies using packet tracer software

Date:
Competency and Practical Skills:
➢ To develop skills of design, implement, manage and monitor the wide area and local area
networks of businesses and organizations
➢ To develop skills for designing using hardware, software, protocols, and topologies for a
network, as well as ensuring its security, reliability, scalability, and performance.
Relevant CO:
CO-1: Enumerate the layers of the OSI model and TCP/IP functions of each layer

Objectives: To understand various network topologies and able to design network in LAN and WAN

Equipment/Instruments: Packet tracer Software

Theory:

To implement this practical following network topology is required to be configure during the
commands. After configuring the given network, a packet should be ping from any one machine
to another.

(1) Ring Topology:


Computer Networks (3161007)

(2) Star Topology:

(3) Hybrid Topology:

(4) Mesh Topology:


Computer Networks (3161007)

(5) Bus Topology:

Conclusion:

Quiz:
(1) The data in the network layer is in the form of
a. IP Packets
b. Frames
c. Cables
d. None of the above
Ans.

(2) If there are n devices in a mesh topology network then the total number of duplex links are

a. n (n-1)/2
b. n+2
c. n-1
d. n(n+1)
Ans.
Computer Networks (3161007)

(3) Which topology requires multipoint and hub?


a. Bus and Star
b. Ring and star
c. Bus and ring
d. Mesh and ring
Ans.

Suggested Reference:
1. Computer Networks by Andrew S. Tanenbaum, 4th Edition, Prentice Hall Publication
2. Data Communication and Networking by Behrouz Forouzan, 4th Edition, Tata McGraw-Hill Publication

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks
Computer Networks (3161007)

Experiment No: 5
Study of Basic network command and Network configuration commands

Date:
Competency and Practical Skills:
➢ Understanding the various command of network design models
Relevant CO:
CO-3 Analyze MAC Layer Protocols

Objectives:
To design the Local Area Network using network con f igu ratio n command
Equipment/Instruments: Packet tracer software

Theory:
To understand basic commands e.g. ping and tracert etc. All commands related to Network
configuration which includes how to switch to privilege mode and normal mode and how to
configure router interface and how to save this configuration to flash memory or permanent
memory.

This command includes

• Configuring the Router commands


• General Commands to configure network
• Privileged Mode commands of a router
• Router Processes and Statistics
• IP Commands
• Other IP Commands e.g. show ip route etc.

Ping: It sends an ICMP ECHO_REQUEST packet to the specified host. It the host responds, you getand
ICMP packet back. You can ping an IP address to if a machine is alive. If there is no response, you know
something is wrong.
Computer Networks (3161007)

Traceroute :

Traceroute is a command which can show you the path a packet of information taken from your
computer to one you specify. It will list all the routers it passes through until it reaches its
destination. Or fails to and is discarded. It will tell you how long each “hop” from router to router
takes.
Computer Networks (3161007)

Nslookup command : nslookup cisco.com

This command queries DNS servers to find out the IP address or addresses associated with the domain
name cisco.com.

IP Route command : show ip route

It gives you detailed information about the networks that are know to the router, either directly
connected to the router, statically configured using static routing or automatically added to the routing
table using dynamic routing protocols.

Conclusion:

Quiz:
1. Which of the following has stored the startup configuration of a Router
A. ROM
B. Flash
C. RAM
D. NVRAM
Ans-

2. How many bytes is an Ethernet address:


A. 4
B. 6
C. 16
D. 48
Ans-
Computer Networks (3161007)

3. Which of the following feature can be used to carry all the VLAN traffic on one link from a
Switch to a Router
A. PAGP
B. LACP
C. Trunking
D. ACL
Ans-

Suggested Reference:
1. Computer Networks by Andrew S. Tanenbaum, 4th Edition, Prentice Hall Publication
2. Data Communication and Networking by Behrouz Forouzan, 4th Edition, Tata McGraw-Hill Publication

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks
Computer Networks (3161007)

Experiment No: 6
Write a C program for IPV4, Implementation of decimal to binary,
Implementation ofbinary to decimal and study of network IP

• Classification of IP address
• Subnetting and Supernetting

Date:
Competency and Practical Skills:
➢ To understand IP address which is used to connect network devices that connect
to the internet.

➢ To understand how to access data and information available on the web when the
client device sends a request to the server and is passed through routers, hubs and
network nodes.

Relevant CO:
1) CO-3: Implement routing and congestion control algorithms
Objectives:
To understand IP address, subnetting and super netting and Classification of IP address.
Equipment/Instruments: Turbo C, C++
Theory:
Classification of IP address: As shown in figure we teach how the IP addresses are classified and
when they are used.

Subnetting and Super netting: A subnetting is a process of dividing a network into subnetworks. The
number of bits of network addresses is increased. A super netting is a process of combining small
networks into a larger network. The number of bits of host addresses is increased.

Code(a): Implementation of IPV-4


#include<stdio.h>
#include<conio.h>
Computer Networks (3161007)

void main ()
{
int IP1,IP2,IP3,IP4;
printf("enter IP address:");
scanf("%d\n",&IP1);
scanf("%d\n",&IP2) ;
scanf("%d\n",&IP3) ;
scanf("%d",&IP4);
printf("%d . %d . %d . %d\n",IP1,IP2,IP3,IP4);
if(IP1>255 || IP2>255 || IP3>255 || IP4>255)
{
printf("INVALID ");
}
else if (IP1>=0 && IP1<128)
{
printf ("IP ADDRESS BELONGS TO CLASS A");
}
else if (IP1>=128 && IP1<192)
{
printf ("IP ADDRESS BELONGS TO CLASS B");
}
else if(IP1>=192 && IP1<224)
{
printf("IP ADDRESS BELONGS TO CLASS C");
}
else if(IP1>=224 && IP1<240)
{
printf("IP ADDRESS BELONGS TO CLASS D");
}
else if(IP1>=240 && IP1<=255)
{
printf("IP ADDRESS BELONGS TO CLASS E");
}
else
{printf("INVALID IP ADDRESS");
}
getch();
}
Computer Networks (3161007) Enrollment No.

Output:

Code (b): Implementation of decimal to binary

#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<math.h>
void main()
{
clrscr();
int a, b, c, d, e, x [50], stop, count, code;
printf("\n enter the desimal bit of max. upto 80000 digit\n");
Scanf ("\n %d \n",&c) ;
Printf ("%d", c) ;
code=c; count=0;
printf("\n digit reminder /n");
for(a=1;a<50;a++)
{
Computer Networks (3161007) Enrollment No.

count++;
d=c;
if(d==1)
{
goto stop;
}
e=d/2;
b=d%2;
x[a]=b;
c=e;
}
stop:
printf("\n %d is converted in to binary code \n",code);
printf("1");
for(a=count-1;a>0;a--)
{
printf("%d",x[a]);
}
getch();
}

Output:
Computer Networks (3161007) Enrollment No.

Code (C): Implementation of decimal to binary

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr ();
int num, bnum,dec=0,base=0,rem; printf
(“Enter the binary number => ”);
scanf(“%d”,&num);
bnum=num;
while(num>0)
{
rem=num%10;
dec=dec+rem*base;
num=num/10;
base=base*2;
}
printf (“Decimal number => %d”,dec);
getch();
}

Output:
Computer Networks (3161007) Enrollment No.

Conclusion:

Quiz:
1. implies that all subnets obtained from the same subnet mask
A. Static subnetting
B. Dynamic subnetting
C. Variable length subnetting
D. Dynamic length subnetting
Ans-

2. The combination of and is often termed the local address of the


local portion of the IP address

A. Network number and host number


B. Subnet number and host number
C. Network number and subnet number
D. Host number
Ans-

Suggested Reference:
1. Computer Networks by Andrew S. Tanenbaum, 4th Edition, Prentice Hall Publication
2. Data Communication and Networking by Behrouz Forouzan, 4th Edition, Tata McGraw-Hill Publication

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks
Computer Networks (3161007) Enrollment No.

Experiment No: 7

Write a program to implement bit stuffing & Destuffing

Date:
Competency and Practical Skills:
➢ Understand framing methods of data link layer.

Relevant CO:
CO-2: Analyze MAC Layer Protocols
Objectives:
To implement bit stuffing and D e Stuffing framing methods in turbo C / C++
Equipment/Instruments: Turbo C / C++
Theory:

In a data link frame, the delimiting flag sequence generally contains six or more consecutive 1s. In
order to differentiate the message from the flag in case of the same sequence, a single bit is stuffed
in the message. Whenever a 0 bit is followed by five consecutive 1bits in the message, an extra 0 bit
is stuffed at the end of the five 1s.
Computer Networks (3161007) Enrollment No.

When the receiver receives the message, it removes the stuffed 0s after each sequence of five 1s. The
un-stuffed message is then sent to the upper layers.

Code:

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main ()
{
int i, j=0;
char a [20], b [20];
char flag[8]="01111110",esc='0';
clrscr();
printf ("\n Enter any bit stream:");
fflush (stdin);
gets(a);
for (i=0; i<8; i++)
{
b[j]=flag[i];
j++;
}
for (i=0; a[i]! ='\0’; i++)
{
if(a[i-1] =='1'&&a[i-2] =='1'&&a[i-3] =='1'&&a[i-4] =='1'&&a[i-5] =='1')
{
b[j]=esc;
j++;
b[j]=a[i];
j++;
a[i-1] =0;
}
else
{
b[j]=a[i];
j++;
}
}
for (i=0; i<8; i++)
{
b[j]=flag[i];
j++;
}
Computer Networks (3161007) Enrollment No.

b[j]='\0';
printf ("\n Stuffed bit stream is:");
Date:
Page No.
puts(b);
printf ("\n Destuffed bit stream is:");
for (j=0, i=0;i<8;j++,i++)
{
if (b[j]==flag[i])
{
for (j=0; b[j]! ='\0’; j++)
{
if(b[j]=='0'&&b[j+1]=='1'&&b[j+2]=='1'&&b[j+3]=='1'&&b[j+4]=='1'&&b[j+5]=='1'&&b[j+6]
=='1'&&b[j+7] =='0')
}
goto end;
{
else if(b[j]=='0'&&b[j-1]=='1'&&b[j-2]=='1'&&b[j-3]=='1'&&b[j-4]=='1'&&b[j-5]=='1')
}
else
{
printf ("\%c”, b[j]);
}
end:
getch ();
}
Output:

Conclusion:
Computer Networks (3161007) Enrollment No.

Quiz:
1. A bit-stuffing based framing protocol uses an 8-bit delimiter pattern of 01111110. If the
output bit-string after stuffing is 01111100101, then the input bit-string is
A. 0111110100
B. 0111110101
C. 0111111101
D. 0111111111
Ans-

2. The range of the possible sequence numbers of Go-Back-N Protocol which is the
concern of the receiver is called the
A. Sender sliding window
B. Pipelining at the sender
C. Pipelining at the receiver
D. Receiver sliding window

Ans-

3. The term that is used to define the end of the frame and the beginning of the next frame is called
A. byte stuffing
B. byte unstuffing
C. fixed size framing
D. variable size framing
Ans-

4. Error control in the data link layer is based on


A. automatic repeat request
B. manually repeat request
C. situation based
D. both a and b
Ans-
Computer Networks (3161007) Enrollment No.

Suggested Reference:
1. Computer Networks by Andrew S. Tanenbaum, 4th Edition, Prentice Hall Publication
2. Data Communication and Networking by Behrouz Forouzan, 4th Edition, Tata McGraw-Hill Publication

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks
Computer Networks (3161007) Enrollment No.

Experiment No: 8

Write a program to implement parity check

Date:
Competency and Practical Skills:
➢ Understand error detection method
Relevant CO:
CO-2: Analyze MAC Layer Protocols
Objectives:
To understand the parity checker method in turbo c/c++ .
Equipment/Instruments: Turbo C/C++
Theory:
A parity bit is an extra bit included in binary message to make total number of 1’s either odd or even.
Parity word denotes number of 1’s in a binary string. There are two parity system – even and odd
parity checks
1. Even Parity Check: Total number of 1’s in the given data bit should be even. So, if the total
number of 1’s in the data bit is odd then a single 1 will be appended to make total number of
1’s even else 0 will be appended (if total number of 1’s is already even). Hence, if any error
occurs, the parity check circuit will detect it at the receiver’s end
2. Odd Parity Check: In odd parity system, if the total number of 1’s in the given binary string
(or data bits) are even then 1 is appended to make the total count of 1’s as odd else 0 is
appended. The receiver knows that whether sender is an odd parity generator or even parity
generator. Suppose if sender is an odd parity generator, then there must be an odd number of
1’s in received binary string. If an error occurs to a single bit that is either bit is changed to 1
to 0 or 0 to 1, received binary bit will have an even number of 1’s which will indicate an
error.

Code:

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int i=0,j=0;
char msg[]="110011100"; for(i=0;i<=strlen(msg);i++)
{ if(msg[i]==1
{
Computer Networks (3161007) Enrollment No.

j=j+1;
}
}
if (j%2==0)
printf ("Even Parity"); else
printf("Odd Parity")
}

Output:

Conclusion:

Quiz:

1. Parity check usually can detect

A. 1 bit error
B. 2-bit error
C. 8-bit error
D. Any bit error
Ans-

2. Which one of the following set of gates are best suited for parity checking and parity
Computer Networks (3161007) Enrollment No.

generation.
A. AND, OR, NOT gates
B. EX NOR or EX OR gates
C. NAND gates
D. NOR gates

Ans-

3. The circuit shown in the figure represents

A. Even parity generator


B. Odd parity checker
C. Odd parity generator
D. Even parity checker
Ans-

Suggested Reference:
1. Computer Networks by Andrew S. Tanenbaum, 4th Edition, Prentice Hall Publication
2. Data Communication and Networking by Behrouz Forouzan, 4th Edition, Tata McGraw-Hill Publication

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks
Computer Networks (3161007) Enrollment No.

Experiment No: 9
Write a program to implement CRC
Date:
Competency and Practical Skills:
➢ Understand and implement Cyclic Redundancy Check in Data link layer
Relevant CO:
CO-2: Analyze MAC Layer Protocols
Objectives:
Understand the error detection method such as CRC in computer networks
Equipment/Instruments: Turbo C/C++
Theory:
The cyclic redundancy check (CRC) is a technique for detecting errors in digital data. It is used in data
transmission. In the CRC method, a certain number of check bits, often called a checksum, are appended
to the message being transmitted. The receiver can determine whether or not the check bits agree with
the data, to ascertain with a certain degree of probability whether or not an error occurred in
transmission. If an error occurred, the receiver sends a "negative acknowledgement" (NAK) back to
the sender, requesting that the message be retransmitted.

Code:
#include<stdio.h>
#include<conio.h>
#include<string.h>
int main ()
{
char st1[10], st2[15], div [5], q[15],i_ans[5], i_op[5],cw[15];int
l,i,n,m;
printf ("\nEnter the string:");
scanf ("%s",st1);
strcpy(div,"10101");
strcpy(st2,st1);
strcat(st2,"000000");
printf("\nDivisor is : %s",div);
printf("\nDividendo is : %s\n",st2);
l=strlen(st2);
for(i=0;i<5;i++)
{i_op[i]=st2[i];}
l=l-5;
i_op[5]='\0';
for(n=0;n<l;n++)
{
if (i_op[0]=='0')
{
strcpy(i_ans, i_op);
q[n]='0';
}
Computer Networks (3161007) Enrollment No.

else
{
for(i=0;i<5;i++)
{
if (i_op[i]==div[i])
i_ans[i]='0'; else
i_ans[i]='1'; }
i_ans[5]='\0';
q[n]='1';
}
q[n+1]='\0';
for(i=0;i<4;i++)
{m=i+1;
i_op[i]=i_ans[m];}
i_op[4]=st2[n+5];
i_op[5]='\0';
} q[n+1]='\0';
strcpy(cw,st1);
strcat(cw,i_op);
printf("\ni_op=%s",i_op);
printf("\nq=%s\n",q);
printf("\ncodeword=%s",cw);
getch();
}

Output:

Conclusion:
Computer Networks (3161007) Enrollment No.

Quiz:
1. In CRC if the data unit is 100111001 and the divisor is 1011 then what is dividend at the receiver
?
A. 100111001101
B. 100111001011
C. 100111001
D. 100111001110
Ans-

2. Which of the following is/are the popular techniques for error detection?
A. Cyclic redundancy check
B. Checksum
C. Simple parity check
D. All of the options
Ans-

3. In data link control, which of the following is used for error correction?
A. Backward error correction
B. Simple parity check
C. Checksum
D. Cyclic Redundancy Checks (CRC)
Ans-

Suggested Reference:
1. Computer Networks by Andrew S. Tanenbaum, 4th Edition, Prentice Hall Publication
2. Data Communication and Networking by Behrouz Forouzan, 4th Edition, Tata McGraw-Hill Publication

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks
Computer Networks (3161007) Enrollment No.

Experiment No: 10
Write a program to implement Hamming code.
Date:

Competency and Practical Skills:


➢ To study error correction techniques.
Relevant CO:
CO-2: Analyze MAC Layer Protocols

Objectives:

To study error detection and correction techniques such as Hamming code

Equipment/Instruments: Turbo C/C++


Theory:

Hamming code is a block code that is capable of detecting up to two simultaneous bit errors and
correcting single-bit errors. It was developed by R.W. Hamming for error correction.

In this coding method, the source encodes the message by inserting redundant bits within the message.
These redundant bits are extra bits that are generated and inserted at specific positions in the message
itself to enable error detection and correction. When the destination receives this message, it performs
recalculations to detect errors and find the bit position that has error.

The procedure used by the sender to encode the message encompasses the following steps −

• Step 1 − Calculation of the number of redundant bits.


• Step 2 − Positioning the redundant bits.
• Step 3 − Calculating the values of each redundant bit.

Once the redundant bits are embedded within the message, this is sent to the user.

Step 1 − Calculation of the number of redundant bits.

If the message contains m𝑚number of data bits, r𝑟number of redundant bits are added to it so that m𝑟
is able to indicate at least (m + r+ 1) different states. Here, (m + r) indicates location of an error in each
of (𝑚 + 𝑟) bit positions and one additional state indicates no error. Since, r𝑟 bits can indicate 2r𝑟 states,
2r𝑟 must be at least equal to (m + r + 1). Thus the following equation should hold 2r ≥ m+r+1
Computer Networks (3161007) Enrollment No.

Step 2 − Positioning the redundant bits.

The r redundant bits placed at bit positions of powers of 2, i.e. 1, 2, 4, 8, 16 etc. They are referred in
the rest of this text as r1 (at position 1), r2 (at position 2), r3 (at position 4), r4 (at position 8) and so on.

Step 3 − Calculating the values of each redundant bit.

The redundant bits are parity bits. A parity bit is an extra bit that makes the number of 1s either even
or odd. The two types of parity are −

• Even Parity − Here the total number of bits in the message is made even.
• Odd Parity − Here the total number of bits in the message is made odd.

Each redundant bit, ri, is calculated as the parity, generally even parity, based upon its bit position. It
covers all bit positions whose binary representation includes a 1 in the i th position except the position
of ri. Thus −

• r1 is the parity bit for all data bits in positions whose binary representation includes a 1 in the
least significant position excluding 1 (3, 5, 7, 9, 11 and so on)
• r2 is the parity bit for all data bits in positions whose binary representation includes a 1 in the
position 2 from right except 2 (3, 6, 7, 10, 11 and so on)
• r3 is the parity bit for all data bits in positions whose binary representation includes a 1 in the
position 3 from right except 4 (5-7, 12-15, 20-23 and so on)

Decoding a message in Hamming Code


Step 2 − Positioning the redundant bits

The r redundant bits placed at bit positions of powers of 2, i.e. 1, 2, 4, 8, 16 etc. Once the receiver gets
an incoming message, it performs recalculations to detect errors and correct them. The steps for
recalculation are −

• Step 1 − Calculation of the number of redundant bits.


• Step 2 − Positioning the redundant bits.
• Step 3 − Parity checking.
• Step 4 − Error detection and correction

Step 1 − Calculation of the number of redundant bits

Using the same formula as in encoding, the number of redundant bits is ascertained.

2r ≥ m + r + 1 where m is the number of data bits and r is the number of redundant bits.
Computer Networks (3161007) Enrollment No.

Step 3 − Parity checking

Parity bits are calculated based upon the data bits and the redundant bits using the same rule as during
generation of c1,c2 ,c3 ,c4 etc. Thus

c1 = parity(1, 3, 5, 7, 9, 11 and so on)

c2 = parity(2, 3, 6, 7, 10, 11 and so on)

c3 = parity(4-7, 12-15, 20-23 and so on)

Step 4 − Error detection and correction

The decimal equivalent of the parity bits binary values is calculated. If it is 0, there is no error.
Otherwise, the decimal value gives the bit position which has error. For example, if c1c2c3c4 = 1001, it
implies that the data bit at position 9, decimal equivalent of 1001, has error. The bit is flipped to get
the correct message.

Code:

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a, b,c, d,f,g,i,x[5],y[8];
printf(“Enter 4 digit data => ”);
for(i=1;i<5;i++)
scanf(“%d”,&x[i]);
a=x[1];
b=x[2];
c=x[3];
d=x[4];
e=a+b+d;
f=a+c+d;
g=b+c+d;
y[1]=e%2;
y[2]=f%2;
y[3]=a;z
y[4]=g%2;
y[5]=b;
Computer Networks (3161007) Enrollment No.

y[6]=c;
y[7]=d;
printf(“Newly generated Hamming Code \n based on even parity => ”);
for(i=1;i<8;i++)
printf(“%d”,y[i]);
getch();
}

Output:

Conclusion:
Computer Networks (3161007) Enrollment No.

Quiz:
1. The representation of 4 bit code 1101 into 7 bit, even parity Hamming code is
A. 1010101
B. 1111001
C. 1011101
D. 1110000
Ans-

2. What is the hamming distance between the codes “11001011” and “10000111”
A. 2
B. 3
C. 4
D. 5
Ans-

3. The final code after encoding data bits 1101 into 7 bit even parity Hamming Code is
A. 1110101
B. 1011101
C. 1010101
D. 0110101
Ans-

Suggested Reference:
1. Computer Networks by Andrew S. Tanenbaum, 4th Edition, Prentice Hall Publication
2. Data Communication and Networking by Behrouz Forouzan, 4th Edition, Tata McGraw-Hill Publication

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks
Computer Networks (3161007) Enrollment No.

Experiment No: 11

Write a program to encrypt and decrypt data using Caesar cipher in C

Date:
Competency and Practical Skills:
➢ Able to understand the encryption and decryption algorithm
Relevant CO:
CO-4: Examine the functions of Transport and application layers

Objectives:
To understand encrypt and decrypt algorithm in network security.

Equipment/Instruments: Turbo C/C++

Theory:
• The Caesar cipher is a simple encryption technique. It works by shifting the letters in the
plaintext message by a certain number of positions, known as the “shift” or “key”.
• The Caesar Cipher technique is one of the earliest and simplest methods of encryption
technique. It’s simply a type of substitution cipher, i.e., each letter of a given text is replaced
by a letter with a fixed number of positions down the alphabet. For example with a shift of 1,
A would be replaced by B, B would become C, and so on.
• The encryption can be represented using modular arithmetic by first transforming the letters
into numbers, according to the scheme, A = 0, B = 1,…, Z = 25.
• For example, if the shift is 3, then the letter A would be replaced by the letter D, B would
become E, C would become F, and so on. The alphabet is wrapped around so that after Z, it
starts back at A.
• Here is an example of how to use the Caesar cipher to encrypt the message “HELLO” with a
shift of 3:
1. Write down the plaintext message: HELLO
2. Choose a shift value. In this case, we will use a shift of 3.
3. Replace each letter in the plaintext message with the letter that is three positions to the right
in the alphabet.
H becomes K (shift 3 from H)
E becomes H (shift 3 from E)
L becomes O (shift 3 from L)
L becomes O (shift 3 from L)
O becomes R (shift 3 from O)
4.The encrypted message is now “KHOOR”.
• To decrypt the message, you simply need to shift each letter back by the same number of
positions. In this case, you would shift each letter in “KHOOR” back by 3 positions to get the
original message, “HELLO”.
Computer Networks (3161007) Enrollment No.

Code:
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
clrscr();
int i;
char a[20];
for(i=0;i<20;i++)
a[20]='\0';
printf("enter the word with max 20 char=");
scanf("%s",&a);
i=0;
while(a[i]!='\0')
{
a[i]=a[i]+3;
i++;
}
printf("encoded data =%s",a);
i=0;
while (a[i]!='\0')
{
a[i]=a[i]-3;
i++;
}
printf("\n decoded data = %s",a);
getch();
}

Output:

Conclusion:
Computer Networks (3161007) Enrollment No.

Quiz:
1. We are provided the plain text “SUN”. You need to convert the given plain text into
ciphertext under the Ceasar cipher encryption technique. Which of the following options is the
correct ciphertext for the given text if the key is 2?
A. UWP
B. NUS
C. WUP
D. QSL
Ans-

2. Which of the following is not a type of encryption?


A. Symmetric encryption
B. Asymmetric encryption
C. Hashing
D. Compression
Ans-

Suggested Reference:
1. Computer Networks by Andrew S. Tanenbaum, 4th Edition, Prentice Hall Publication
2. Data Communication and Networking by Behrouz Forouzan, 4th Edition, Tata McGraw-Hill Publication

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks
Computer Networks (3161007) Enrollment No.

Experiment No: 12

Configure network using Distant vector routing protocol, RIP

Date:
Competency and Practical Skills:
➢ Understand distant vector routing algorithm RIP.
Relevant CO:
CO-4: Examine the functions of Transport and application layers

Objectives:
The main objective of Distance vector routing algorithm is used to find the shortest route from one
node to another node in the network. It is called as Bellman-Ford algorithm.
Equipment/Instruments: Packet tracer software

Theory:

It is used in computer networks to choose the optimal path for data to travel between nodes
It works by exchanging data with its nearby nodes that are directly linked in order to compile a table
of the most direct paths to every other node in the network.
Every node in the network keeps a routing table that details the distance to each target node as well as
the subsequent hop node on the way there.
Normally, the distance is expressed in terms of the number of hops or the travel duration to the
destination.
The Bellman-Ford algorithm is used by the Distance vector routing algorithm to update the routing
database. Each node sends its routing table to its neighbours on a regular basis, and they use the data
they receive to update their own tables. Until every node has access to the most recent routing
information, this procedure is repeated.
It is best suitable for small sized computer networks. As the number of nodes in the network increase,
the data transfer becomes slow due to the slow convergence rate of the DVR algorithm.

RIP is one of the most commonly used routing protocols in the networking industry. Here you can
build a multi-router network and use RIP to automatically propagate routes, so hosts on remote
networks can communicate.
Computer Networks (3161007) Enrollment No.

Required Resources

The following resources are required:


• Two routers, each with an Ethernet and serial interface.
• Two Windows XP computers
• Two straight-through Category 5 Ethernet cables (H1 to switch and switch to R1)
• Crossover Category 5 Ethernet cable (H2 to router R2)
• Null serial cable
• Console cables (from H1 and H2 to routers R1 and R2)
• Access to the H1 and H2 command prompt
• Access to the H1 and H2 network TCP/IP configuration

Configure the hosts.

• Configure host H1 attached to R1 with an IP address, subnet mask, and default gateway thatis
compatible with the IP address of the R1 Fast Ethernet interface (172.16.0.1/24).
Host H1 IP configuration:
IP address: 172.16.0.2
Subnet mask: 255.255.0.0
Default gateway: 172.16.0.1

• Configure host H2 attached to R2 with an IP address, subnet mask, and default gateway thatis
compatible with the IP address of the R2 Fast Ethernet interface (172.18.0.1/24).
Host H2 IP configuration:
IP address: 172.18.0.2
Subnet mask: 255.255.0.0
Default gateway: 172.18.0.1
Computer Networks (3161007) Enrollment No.

Test end-to-end connectivity.

R1#ping 172.18.0.1
C:\>ping 172.18.0.2

In global configuration mode, enter the following on R1.

R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#network 172.16.0.0
R1(config-router)#network 172.17.0.0
R1(config-router)#exit R1(config)#exit

Save the R1 router configuration. R1#copy running-config startup-configc.

In global configuration mode, enter the following on R2.

R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#network 172.17.0.0
R2(config-router)#network 172.18.0.0
R2(config-router)#exit R2(config)#exit

Save the R2 router configuration. R2#copy running-config startup-config


Test end-to-end connectivity.

a. From R1, ping the R2 router Fast Ethernet interface.

R1#ping 172.18.0.1

b. From the host H1 command prompt, ping H2 (from network 172.16.0.2 to network 172.18.0.2).

C:\>ping 172.18.0.2

On router R1, enter the debug ip rip command from privileged EXEC mode.

R1#debug ip ripRIP protocol debugging is on

On router R2, enter the undebug all to stop all debugging activity.

R1#undebug all All possible debugging has been turned off


Computer Networks (3161007) Enrollment No.

Conclusion:

Quiz:

1. The size of an updating packet in distance vector routing is normally the size of an
updating packet in a link state routing.
A. Smaller than
B. Larger than
C. The same as
D. None of the above
Ans-

2. In distance vector routing, the updating packet conveys the knowledge of the router about
.
A. The whole internetwork
B. The neighborhood
C. Either a or b
D. Neither a not b
Ans-

Suggested Reference:
1. Computer Networks by Andrew S. Tanenbaum, 4th Edition, Prentice Hall Publication
2. Data Communication and Networking by Behrouz Forouzan, 4th Edition, Tata McGraw-Hill Publication

References used by the students:

Rubric wise marks obtained:

Rubrics 1 2 3 4 5 Total
Marks

You might also like