0% found this document useful (0 votes)
8 views

Computer Networks Lab

The laboratory manual for the Computer Networks course at Lahore Garrison University outlines guidelines for laboratory procedures, safety precautions, grading policies, and course learning outcomes. It emphasizes the importance of organized data records, collaboration, and thorough testing of code, while also detailing the grading criteria for lab performance, reports, projects, and presentations. Additionally, the manual includes specific lab experiments and objectives related to networking concepts and configurations.

Uploaded by

Mohid Bin Zahid
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Computer Networks Lab

The laboratory manual for the Computer Networks course at Lahore Garrison University outlines guidelines for laboratory procedures, safety precautions, grading policies, and course learning outcomes. It emphasizes the importance of organized data records, collaboration, and thorough testing of code, while also detailing the grading criteria for lab performance, reports, projects, and presentations. Additionally, the manual includes specific lab experiments and objectives related to networking concepts and configurations.

Uploaded by

Mohid Bin Zahid
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 79

COMPUTER NETWORKS

Course Code CSC 363

Laboratory Manual

Department of Software Engineering

Lahore Garrison University


Main Campus, Sector-C Phase-VI, DHA Lahore
Guidelines for Laboratory Procedure

The laboratory manual is the record of all work on your experiments. A complete, neat, and organized data

record is as important as the experiment itself. Please follow these guidelines for efficient performance in the

laboratory:

1. Attend the lab orientation to familiarize yourself with the lab setup.

2. Follow the designated lab schedule and complete assignments on time.

3. Write clear and well-documented code, avoiding plagiarism and unauthorized collaboration.

4. Seek help from lab instructors or peers if you encounter difficulties with programming concepts.

5. Regularly back up your code and project files to prevent data loss.

6. Use lab resources responsibly, including computers and software licenses.

7. If collaboration is allowed, work effectively with peers, ensuring each member contributes meaningfully.

8. Maintain a clean and organized workspace for better focus and efficiency.

9. Thoroughly test your code to identify and fix errors before submission.

10. Engage in lab discussions, share insights, and actively participate to enhance the learning experience.

2
Safety Precautions

1. Handle equipment carefully to prevent damage and avoid placing liquids near electronic devices.

2. Maintain an ergonomic workspace for comfortable and strain-free programming.

3. Save work frequently and use surge protectors to prevent data loss due to power issues.

4. Keep software and antivirus programs up to date and avoid downloading from untrusted sources.

5. Regularly back up code and important files to prevent data loss.

6. Establish clear communication and collaboration guidelines when working with others.

7. Be aware of emergency exits, fire extinguisher locations, and evacuation procedures.

3
Safety Undertaking

I have read all of the above, and I agree to conform to its


contents.

Name:

Registration No.:

Student Signature:

Date:

Lab Instructor:

4
Grading Policy

Lab Performance 15%


Lab Report 15%
Lab Project +Viva 20%+10%
Final Lab Exam 40%

Rubrics
Lab Performance (Continuous Assessment) / Performance Test

Sr.No. Performance Exemplar Satisfactor Unsatisfactor


Indicator y (4-5) y (2-3) y (0-1)

1 Ability to Conduct Fully understand the Has very good Has poor
Practical software including its understanding of understanding of the
features, working and the software software including
quite able to conduct the including its its features, working
entire practical with features, working and unable to
negligible help from lab and able to conduct conduct practical on
instructor practical with some his own;
help from lab
instructor

2 Data Analysis & Always analyzes and Analyzes and Analyzes and
Interpretation interprets data correctly interprets data interprets data
and always display correctly most of incorrectly most
correct output; always the time; most of of the time;
compares theory against the output are many output
practical results and correct; compares are incorrect;
resolve related error. theory against most of the
practical results time never
and resolve related attempts to
error most of the compare theory
time. against
practical
results.

5
Lab Reports

Sr. Performance Exemplary (4-5) Satisfactory (2-3) Unsatisfactory


Indicator (0-1)
1 All the code is Most of the Some of or complete
Structure very accurate and code is very code is inaccurate.
precise. accurate and Somewhat or no logical
Completely precise. Quite and systematic
logical and logical and compilation.
systematic systematic
compilation. compilation.

2 Efficiency The code is fairly The code The code is huge and
efficient without is brute appears to be patched
force and
sacrificing unnecess together.
readability and arily
understanding. long.

Viva Voce

Sr Performance Exemplary Satisfactory (2- Unsatisfactory


Indicator (4-5) 3) (0-1)

1 Responds well, Generally Non-responsive.


Responsiveness quick and very Responsive and
to Questions/ accurate all the accurate most of
Accuracy time. the times.

2 Level of Demonstration of At ease with No grasp of information.


understanding full knowledge of content and able to Clearly no knowledge of
of the learned the subject with elaborate and subject matter. No
skill explanations and explain to some questions are answered.
elaboration. degree. No interpretation made.

6
Lab Project

Sr.No. Performance Exemplary Satisfactory (2-3) Unsatisfactory


(4-5) (0-1)
Project Design
1 Implementation Project is Project is Project is completed but
and Completion completed without completed with not working properly. Or
any external quite less technical Project is not
assistance and is assistance from completed.
working properly. the instructor or
others in order to
complete the
project and is
working properly.
2 Appearance and Circuit wiring and Circuit wiring and Circuit wiring and
Problem components are components are components are
Analysis perfectly organized organized and disorganized but some
and proper some prototyping prototyping is done.
prototyping is is done.
done.
Project Report
1 Structure and Information is
Literature Information is presented in a
Review presented in a less logical way, Information is not
logical, which is little presented in a logical,
interesting way, difficult to interesting way, which
which is easy to follow. All is so difficult to
follow. All sections are in a follow. All sections
sections are in a little incorrect are incorrect order or
correct order and order or not submitted on a
submitted on a submitted little time. Collected a poor
time. Collected a late time. information--all
great deal of Collected a fine doesn’t relates to the
information—all topic.
information--all
relates to the may relates to
topic. the topic.

2 Result and Clearly discusses


Presentation what results Generally clear
mean discussion of Limited discussion
and what results and of results and
conclusions may conclusions, but conclusions. Little
be may miss some or no reference to
drawn from them. points. Some use published standards
Cites published of references and or other reports.
standards or published
other standards.
related reports.

7
Project Viva
Responds well, Generally Non-responsive.
Responsiveness to quick and very Responsive and
1
Questions/ accurate all the accurate most of
Accuracy time. the times.
Demonstration of At ease with No grasp of
full knowledge of content and able information. Clearly no
Level of
the subject with to elaborate and knowledge of subject
2 understanding
explanations and explain to some matter. No questions
of the learned
elaboration. degree. are answered. No
skill
interpretation made.
Project Presentation
Presentation is
Presentation is
clear Listener can follow
generally clear.
and logical. presentation with
A
1 Organization Listener can effort.
few minor points
easily Organization not
may be
follow line of well thought out.
confusing
reasoning
Is very confident
and explains the
details properly. Is confident to Has low confidence to
Proper eye some extent explain and deliver
contact is with quite less topic properly. Less
2 Confident
maintained all eye contact and eye contact and
the time with presentational presentational gestures
proper gestures. used.
presentational
gestures.
Responds well to
Reluctantly interacts
questions. Generally
Responsiveness to with audience.
3 Restates responsive to
Audience Responds poorly to
and summarizes questions.
questions.
when needed.
Team Work

Relays a great deal Relays some basic Relays very little


1 Share of information--most information--some
Information information--all relates relates to the topic
relates to to the topic.
the topic.
Performs all duties
Performs nearly
2 Fulfill Team of Performs very little
all
duties assigned team duties.
duties
role

8
Lab’s Course Learning Outcomes

Course Title: Operating Systems


Course Code: CSC-351
Instructor: Ms. Farwa Khan
Designation: Assistant Lecturer
E-mail: [email protected]
CLO1: Implement OS concepts like those of shell scripting, process, file manipulation and inter processes
communication.
CLO2: Demonstrate the knowledge in applying system software and tools available in modern operating
system.
Mapping of Course Learning Outcomes (CLO) to Program Learning Outcomes (PLO) / Graduate
Attributes
Course
CLOs PLO 1 PL
Code PLO2 PL PLO4 PLO5 PLO6 PLO7 PLO8 PLO9
O
/ O3
10
PLOs
CLO 1 X
CSC
- 351 CLO2
X
PLO1: Academic Education
PLO2: Knowledge for Solving Computing Problems PLO3:
Problem Analysis
PLO4: Design/ Development of Solution
PLO5: Modern Tool Usage
PLO6: Individual and Teamwork
PLO7: Communication
PLO8: Computing Professionalism and Society
PLO9: Ethics
PLO10: Lifelong Learning

9
CONTENTS

Page
Lab No. Remarks/
DATE Experiment CLOs
No. Signature
1 1 Making Straight Through & Cross UTP 3
Cables
2 8 To study IPv4 Addressing & Sub-netting 3
(using Class C Addresses)
3 13 To explore some basic Network Commands 3
and Network Configuration Commands
using command prompt and packet tracer
4 19 Configuring static routes on Cisco routers 3
5 24 Configuring RIP (Routing Information 3
Protocol) version1 and RIP version 2
6 30 Configuring OSPF (Open Shortest Path First) 3
Single Area
7 35 Configuring EIGRP (Enhanced Interior 3
Gateway Routing Protocol)
8 41 Studying basic LAN switch operation 3

9 45 Study and configure Access Lists 3

10 49 Introduction to Network Management Tools. 3


Learn how Networks can be managed using
these tools.
11 56 Introduction to WireShark (Network 3
Protocol Analyzer /Packet Sniffer) and
Layered Protocol
12 62 (a) To study the concept of a Network 3
Monitoring System (NMS).
(b) To study a SNMP based NMS and analyze
communication between a managed element
(CISCO 2950 Catalyst Switch) and NMS
system
13 66 Design the given Network in Cisco Packet Tracer 3
using a suitable Class C sub-netted IP addresses.
Configure mail, HTTP and DNS services on this
network. (Open Ended Lab)

10
TC-421 Telecommunication Networks
NED University of Engineering and Technology-Department of Telecommunications Engineering

LAB SESSION 01

OBJECTIVE

Making the following kinds of UTP cables:


• Straight through cable
• Cross cable

THEORY

There are several classifications of twisted pair cable. Let’s skip right over them
and state that we’ll use Category 5 (or CAT 5) cable for all new installations.
Likewise, there are several fire code classifications for the outer insulation of
CAT 5 cable. We’ll use CMR cable, or “riser cable,” for most of the wiring we
do. You should also be aware of CMP or plenum cable (a plenum is used to
distribute air in a building) you may be required by local or national codes to use
the more expensive plenum-jacketed cable if it runs through suspended ceilings,
ducts, or other areas, if they are used to circulate air or act as an air passage from
one room to another. If in doubt, use plenum. CMR cable is generally acceptable
for all applications not requiring plenum cable.

CAT 5 cable is available in reel-in-box packaging. This is very handy for pulling
the wire without putting twists in it. Without this kind of package or a cable reel
stand, pulling wire is a two-person job. Before the advent of the reel-in-box, we
used to put a reel of wire on a broom handle to pull it. One person would hold
the broom handle and the other would pull broom handle to pull it. You will
produce a tangled mess, if
your pull the wire off the end of the reel alone.

Standard wire patch cables are often specified for cable segments running form
a wall jack to a PC and for patch panels. They are more flexible than solid core
Figure 1.1: wire. However, the rationale for using it is that the constant flexing of patch
cables may wear-out solid core cable and break it. This is not a real concern in
UTP cable the average small network.

Most of the wiring we do simply connects computers directly to other computers or hubs. Solid core
cable is quite suitable for this purpose and for many home and small business network. It is also quite
acceptable for use as patch cables. You might consider a stranded wire patch cable if you have a
notebook computer you is constantly moving around.

CAT 5 cable has four twisted pairs of wire for a total of eight individually insulated wires. Each pair is
color coded with one wire having solid color (blue, orange, green, or brown) twisted around a second
wire with a white background and a stripe of the same color. The solid color may have white stripe in
some cables. Cable colors are commonly described using the background color followed by the color
of the stripe; e.g; white-orange is a wire with a white background and an orange stripe.

Connectors
1|P age
TC-421 Telecommunication Networks
NED University of Engineering and Technology-Department of Telecommunications Engineering

The straight through and cross-over patch cables are discussed in this article
which is terminated with CAT 5 RJ-45 modular plugs. RJ-45 plugs are similar
to those you’ll see on the end of your telephone cable except they have eight
as opposed to four or six contacts on the end of the plug and they are about
twice as big. Make sure they are rated for CAT 5 wiring. (RJ stands for
“Registered Jack”). Also, there are RJ-45 plugs designed for both solid core
wire and stranded wire. Others are designed specifically for one kind of wire
Figure 1.2: RJ-45 or the other. Be sure you buy plugs appropriate for the wire you are going to
Connector use. We normally use plugs designed to accommodate both kinds of wire.

Network cabling tools

1. Modular Plug Crimp Tool

You will need a modular crimp tool. This is very similar


to the ones which have been used for many years for all
kinds of telephone cable work and it works just fine for
Figure 1.3: Modular plug crimp tool
Ethernet cables. You don’t need a lot of bells and whistles,
just a tool which will securely crimp RJ-45 connectors.

Some crimpers have cutters which can be used to cut the cable and individual wires, and possibly
stripping the outer jacket.

2. Universal UTP Stripping Tool (Eclipse)


It makes a much neater cut. It is highly recommending for
anyone who will make a lot of cables.

3. Diagonal Cutters
Figure 1.4: Eclipse
It is easier to use diagonal cutters (“diags” or “dikes”) to
cut the cable off at the reel and to fine-tune the cable ends
during assembly. Also, if you don’t have a stripper, you can
strip the cable by using a small knife to carefully slice the
outer jacket longitudinally and use the diags to cut it off Figure 2.5 Diagonal Cutters
around the circumference.
Figure 1.5: Diagonal cutters
UTP basics

The 10BASE-T and 100BASE-TX Ethernet consist of two transmission lines. Each transmission line
is a pair of twisted wires. One pair receives data signals and the other pair transmits data signals. A
balanced line driver or transmitter is at one end of one of these lines and a line receiver is at the other
end. A (much) simplified schematic for one of these lines and its transmitter and receiver follows:

2|P age
TC-421 Telecommunication Networks
NED University of Engineering and Technology-Department of Telecommunications Engineering

Figure 1.6: Schematic diagram of transmission line

3|P age
Computer Networks
Lahore Garrison University- Department of Software Engineering

Pulses of energy travel down the transmission line at about the speed of light (186,000 miles/second).
The principal components of these pulses of energy are the potential difference between the wires and
the current flowing near the surface of the wires. This energy can also be considered as residing in the
magnetic field which surrounds the wires and the electric field between the wires. In other words, an
electromagnetic wave which is guided by, and travels down the wires.

The main concern are the transient magnetic fields which surround the wires and the magnetic fields
generated externally by the other transmission lines in the cable, other network cables, electric motors,
fluorescent lights, telephone and electric lines, lightning, which may literally bury the Ethernet pulses,
the conveyor of the information being sent down the line.

The twisted-pair Ethernet employs two principal means for combating noise. The first is the use of
balanced transmitters and receivers. A signal pulse actually consists of two simultaneous pulses relative
to ground: a negative pulse on one line and a positive pulse on the other. The receiver detects the total
difference between these two pules. Since a pulse of noise usually produces pulses of the same polarity
on both lines, it is essentially canceled out at the receiver. Also, the magnetic field surrounding one
wire from a signal pulse is a mirror of the one on the other wire. At a very short distance from the two
wires the magnetic fields are opposite and have a tendency to cancel the effect of each other out. This
reduces the line’s impact on the other pairs of wires and the rest of the world.

The second and the primary means of reducing cross-talk (the term cross-talk came from the ability to
overhear conversations on other lines on your phone) between the pairs in the cable, is the double helix
configuration produced by twisting the wires together. This configuration produces symmetrical
(dentinal) noise signals in each wire. Ideally, their difference as detected at the receiver, is zero. In
actuality it is much reduced.

Straight through and cross over cable

Again, the wire with colored backgrounds may have white stripes and may be denoted that way in
diagrams found elsewhere. For example, the green wire may be labeled Green-White. The background
color is always specified first.

Figure 1.7: Straight through and crossover cable wire scheme

A Straight-through cable has identical ends, whereas a Crossover cable has different ends.

EIA/TIA 568A and 568B standards

4|Page
Computer Networks
Lahore Garrison University- Department of Software Engineering

Figure 1.8: Cable connector standard ordering

It makes no functional difference which standard you use for a straight-through cable. Your can start a
crossover cable with either standard as long as the other end is the other standard. It makes no functional
difference which end is which. Despite what you may have read elsewhere, a 568A patch cable will
work in a network with 568B wiring and 568B patch cable will work in a 568A network. The electrons
couldn’t care less.

Figure 1.9: EIA/TIA 568A and 568B

PROCEDURE

To Make Cable
1. Pull the cable off the reel to the desired length and cut the total length of wire segments between a
PC and a hub or between two PC’s cannot exceed 100 Meters (328 feet or about the length of a
football field) for 100BASE-TX and 300 Meters for 100BASE-T.
2. Strip one end of the cable with the stripper or a knife and diags. If you are using the stripper, place
the cable in the groove on the blade (left) side of the stripper and align the end of the cable with the
right side of the stripper. This will strip about ½” of the jacket off the cable. Turn the stripper about
1 ¼ turn and pull. If you turn it more, you will probably nick the wires. If you are using knife and
diags, carefully slit the cable for about an inch or so and neatly trim around the circumference of
the cable with diags to remove the jacket.

3. Inspect the wires for nicks. Cut off the end and start over if you see any. You may have to adjust
the blade with the screw at the front stripper. Cable diameters and jacket thicknesses vary.

4. Spread and arrange the pairs roughly in the order of the desired cable end.

5. Untwist the pairs and arrange the wires in the order of the desired cable end. Flatten the end between
your thumb and forefinger. Trim the ends of the wires so they are even with one another.

5|Page
Computer Networks
Lahore Garrison University- Department of Software Engineering

It is very important that the unstripped (untwisted) end be slightly less than ½” long. If it is longer
than ½” it will be out-of-spec and susceptible to crosstalk. If it is less than ½” it
will not be properly clinched when RJ-45 plug is crimped on. Flatten again.
There should be little or no space between the wires.

6. Hold the RJ-45 plug with the clip facing down or away from you. Push the wire
firmly into the plug. Now, inspect before crimping and wasting the plug!
Looking through the bottom of the plug, the wire on the far-left side will have a
white background. The wires should alternative light and dark from left to right.
The furthest right wire is brown. The wires should all end evenly at the front of
the plug. The jacket should end just about where you see it in the diagram-right
on the line.

ALL ABOUT CRIMPING

7. Hold the wire near the RJ-45 plug with the clip down and firmly push it into Figure 1.10:
the left side of the front of the Crimper (it will only go in one way). Hold Preparing the RJ-45
the wire in place and squeeze the crimper handles quite firmly. This is what
will happen:

Figure 1.11: Crimping


(Crimp it once). The crimper pushes two plungers down on the RJ-45 plug. One forces, what
amounts to, a cleverly designed plastic plug/wedge onto the cable jacket and very firmly clinches
it. The other seats the “pins”, each with two teeth at its end, through the insulation and into the
conductors of their respective wires.

8. Test the crimp… if done properly an average person will not be able to pull the plug off the cable
with his or her bare hands. And that quite simply, besides lower cost, is the primary advantage of
twisted-pair cables over the older thin wire, coaxial cables. In fact, the ease of installation and the
modular RJ-45 plug is the main reason coaxial cable is no longer widely used for small Ethernet.
But, don’t pull that hard on the plug. It could stretch the cable and change its characteristics. Look
at the side of the plug and see if it looks like the diagram and give it a fairly firm tug to make sure
it is crimped well.

9. Prepare the other end of the cable so it has the desired end and crimp.

10. If both ends of the cable are within reach, hold them next to each other and with RJ-45 clips facing
away. Look through the bottom of the plugs. If the plugs are wired correctly, and they are identical,
it is a straight-through cable. If they are wired correctly and they are different, it is a crossover
cable.

PRECAUTIONS
6|Page
Computer Networks
Lahore Garrison University- Department of Software Engineering
1. Try to avoid running cables parallel to power cables.

7|Page
Computer Networks
Lahore Garrison University- Department of Software Engineering

2. If you bundle a group of cables together with cable ties (zip ties), do not over-clinch them. It’s okay
to snug them together firmly; but don’t tighten them so much that you deform the cables.

3. Keep cables away from devices which can introduce noise into them. Here’s a short list: electric
heaters, loud speakers, printers, TV sets, fluorescent light, copiers, welding machines, microwave
ovens, telephones, fans, elevator motors, electric ovens, dryers, washing machines, and shop
equipment.

4. Avoid stretching UTP cables (the force should not exceed 24 LBS).

5. Do not use a stapler to secure UTP cables. Use telephone wire hangers, which are available at most
hardware stores.

EXERCISES

1. Give the reason why it is not advisable to bend UTP cables more than four times the diameter
of the cable.

2. Why is it not advisable to run UTP cable outside of a building?

8|Page
Computer Networks
Lahore Garrison University- Department of Software Engineering

Lahore Garrison University


Department of Software Engineering
Course Title: Computer Networks

Psychomotor Domain Assessment Rubric-Level P3


Extent of Achievement
Skill Sets
0 1 2 3 4
Equipment Identification Not able to identify -- -- -- Able to identify
Sensory skill to identify the equipment. equipment as well
equipment and/or its as its components.
component for a lab work.
Equipment Use Doesn't Slightly Somewhat Moderately demon Fully
Sensory skills to demonstrate the demonstrates the demonstrates the strates the use of demonstrates the
demonstrate the use of the use of equipment. use of equipment. use of equipment. equipment. use of equipment.
equipment for the lab
work.
Procedural Skills Not able to either Able to slightly Able to somewhat Able to moderately Able to fully
Displays skills to act upon learn or perform understand lab understand lab understand lab understand lab
sequence of steps in lab lab work work procedure work procedure work procedure work procedure
work. procedure. and perform lab and perform lab and perform lab and perform lab
work. work. work. work.
Response Not able to Able to slightly Able to somewhat Able to moderately Able to fully
Ability to imitate the lab imitate the lab imitate the lab imitate the lab imitate the lab imitate the lab
work on his/her own. work. work. work. work. work.
Observation’s Use Not able to use Slightly able to Somewhat able to Moderately able to Fully able to use
Displays skills to use the the observations use the use the use the the observations
observations from lab from lab work for observations observations from observations from from lab work for
work for experimental experimental from lab work for lab work for lab work for experimental
verifications and verifications and experimental experimental experimental verifications and
illustrations. illustrations. verifications and verifications and verifications and illustrations.
illustrations. illustrations. illustrations.
Safety Adherence Doesn’t adhere to Slightly adheres Somewhat Moderately adheres Fully adheres to
Adherence to safety safety procedures. to safety adheres to safety to safety safety procedures.
procedures. procedures. procedures. procedures.
Equipment Handling Doesn’t handle Rarely handles Occasionally Often handles Handles
Equipment care during the equipment with equipment with handles equipment with equipment with
use. required care. required care. equipment with required care. required care.
required care.
Group Work Doesn't Slightly Somewhat Moderately Fully participates
Contributes in a group participate and participates and participates and participates and and contributes.
based lab work. contribute. contributes. contributes. contributes.
Laboratory Session No. Date:

Weighted CLO (Psychomotor Score)

Remarks

Instructor’s Signature with Date:

9|Page
Computer Networks
Lahore Garrison University- Department of Software Engineering

LAB SESSION 02

OBJECTIVE:

To study IPv4 Addressing & Sub-netting (using Class C Addresses)

THEORY:

IP ADDRESS & SUBNET MASK

An IP (Internet Protocol) address uniquely identifies a node or host connection to an IP network. System
administrators or network designers assign IP addresses to nodes. IP addresses are configured by
software and are not hardware specific. An IP address is a 32 bit binary number usually represented as
four fields each representing 8 bit numbers in the range 0 to 255 (sometimes called octets) separated by
decimal points.
For example: 150.215.17.9
It is sometimes useful to view the values in their binary form.
150.215.17.9
10010110.11010111.00010001.00001001

An IP address consists of two parts, one identifying the network and one identifying the node. The class
of the address determines which part belongs to the network address which part belongs to the node
address.
A Subnet mask is a 32-bit number that masks an IP address, and divides the IP address into network
address and host address. Subnet Mask is made by setting network bits to all "1"s and setting host bits
to all "0"

An IP address has two components, the network address and host address (<network><host>)
A Subnet mask is a 32-bit number that masks an IP address, and divides the IP address into network
address and host address. Subnet Mask is made by setting network bits to all "1"s and setting host bits
to all "0"s.

CLASSFUL ADDRESSING
IPv4 addressing used the concept of classes. This architecture is called classful addressing. The address
space is divided into five classes: A, B, C, D, and E. Each class occupies some part of the address space.

We can find the class of an address when given the address in binary notation or dotted-decimal

10 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

notation. If the address is given in binary notation, the first few bits can immediately tell us the class of
the address. If the address is given in decimal-dotted notation, the first byte defines the class.

Network & Broadcast Addresses

• An IP address such as 176.10.0.0 that has all binary 0s in the host bit positions is reserved for
the network address.
• An IP address such as 176.10.255.255 that has all binary 1s in the host bit positions is reserved
for the broadcast address.

SUB-NETTING
To create a subnet address, a network administrator borrows bits from the original host portion and
designates them as the subnet field.

Consider the following example:

Sub-netting Class C Addresses:


In a Class C address, only 8 bits are available for defining the hosts. Remember that subnet bits start at
the left and go to the right, without skipping bits. This means that the only Class C subnet masks can
be the following:

Binary Decimal CIDR (Classless Inter-Domain

11 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

(4thOctect) (4thOctect) Routing) or slash notation

10000000 128 /25

11000000 192 /26

11100000 224 /27

11110000 240 /28

11111000 248 /29

11111100 252 /30

Now determine the following:

How many subnets? 2x = number of subnets. x is the number of masked bits, or the 1s. For example,
in 11000000, the number of ones gives us 22 subnets. In this example, there are 4 subnets.

How many hosts per subnet? 2y– 2 = number of hosts per subnet. y is the number of unmasked bits, or
the 0s. For example, in 11000000, the number of zeros gives us 26 – 2 hosts. In this example, there are
62 hosts per subnet. You need to subtract two for the subnet address and the broadcast address, which
are not valid hosts.

What are the valid subnets? 256 – Subnet mask = block size, or increment number. An example would
be 256 – 192 = 64. The block size of a 192 mask is always 64. Start counting at zero in blocks of 64
until you reach the subnet mask value and these are your subnets. 0, 64, 128, 192.

What’s the broadcast address for each subnet? Since we counted our subnets in the last section as 0,
64, 128, and 192, the broadcast address is always the number right before the next subnet. For
example, the 0 subnet has a broadcast address of 63 because the next subnet is 64. The 64 subnet has
a broadcast address of 127 because the next subnet is 128, etc. The broadcast of the last subnet is
always 255 for Class C.

What are the valid hosts? Valid hosts are the numbers between the subnets, omitting all the 0s and all
1s. For example, if 64 is the subnet number and 127 is the broadcast address, then 65– 126 is the valid
host range—it’s always the numbers between the subnet address and the broadcast address.

EXERCISE:

1. Find the class of each address.


a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111

2. Subnets the following addresses and verify your results using any online IPv4 Addressing
& Sub-netting Calculator and attach their screen shots.

12 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

a. 192.168.10.0 (/26)
b. 192.168.10.0 (/27)

13 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Lahore Garrison University


Department of Software Engineering
Course Title: Computer Networks

Laboratory Session No. Date:


Software Use Rubric
Level of Attainment
Criterion Below Average Average Good Very Good Excellent
(1) (2) (3) (4) (5)
Identification of software Rarely Occasionally Able to
Perfectly able to
menu (syntax, Can’t identify identifies identifies identify
identify software
components, commands, software menus. software software software
menus.
tools, layout etc.). menus. menus. menus.
Skills to use software Efficiently uses
Can’t use Rarely uses Occasionally Often uses
(schematic, syntax, software (syntax,
software software uses software software
commands, tools, layout) commands, tools,
efficiently. efficiently. efficiently. efficiently.
efficiently. layout)
Adherence to safety Occasionally
Rarely handles Often handles
procedures and handling Doesn’t handle handles Handles
equipment equipment
of equipment (computing equipment with equipment equipment with
with required with required
unit, peripheral devices, required care and with required required care and
care and care and
and other equipment in safety. care and safety.
safety. safety.
lab). safety.
Ability to troubleshoot Occasionally
Not able to Rarely able to Often able to Fully able to
software errors able to
troubleshoot the troubleshoot troubleshoot troubleshoot the
(detection and troubleshoot
errors the errors the errors errors
debugging). the errors
Occasionally
Not able to Rarely able to Often able to Perfectly able
Analysis and able to
analyze and perform the perform the to perform the
interpretation of perform the
interpret analysis and analysis and analysis and
results/outputs. analysis and
results/outputs. interpretation. interpretation. interpretation.
interpretation.

Weighted CLO (Score)

Remarks

Instructor’s Signature with Date

14 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

LAB SESSION 03

OBJECTIVE:

To explore some basic Network Commands and Network Configuration Commands using command
prompt and packet tracer.

THEORY:

ipconfig:

ipconfig (internet protocol configuration) in Microsoft Windows is a console application that displays
all current TCP/IP network configuration values and can modify Dynamic Host Configuration Protocol
DHCP and Domain Name System DNS settings.

ping:

Verifies IP-level connectivity to another TCP/IP computer by sending Internet Control Message
Protocol (ICMP) Echo Request messages. The receipt of corresponding Echo Reply messages are
displayed, along with round-trip times. Ping is the primary TCP/IP command used to troubleshoot
connectivity, reachability, and name resolution. Used without parameters, ping displays help.

traceroute:

traceroute is a command-line tool included with Windows and other operating systems. Along with the
ping command, it’s an important tool for understanding Internet connection problems, including packet
loss and high latency.

If you’re having trouble connecting to a website, traceroute can tell you where the problem is. It can
also help visualize the path traffic takes between your computer and a web server.

nslookup:

nslookup is a network administration command-line tool available for many computer operating
systems for querying the Domain Name System (DNS) to obtain domain name or IP address mapping
or for any other specific DNS record.

Modes and CLI commands for Routers

Cisco routers support different modes of operation. When you access a router, it will typically be
in the “user mode”. User mode gives a user access to simple “show
commands.” From user mode the next step is “Privileged mode.” In the “Privileged mode” a user
can have full access to all the databases maintained by the router. Configuration Mode in which
we can configure the router Cisco routers use many other modes, but let us keep it simple for now.

User mode is identified by prompt ending with “>” to switch to privileged mode type “ “enable” the
prompt should end with # e.g. Router#

Configuring the Router

You will be able to learn the basic commands for configuring a router.
sh running-config - details the running configuration file (RAM)
sh startup-config - displays the configuration stored in NVRAM
setup - Will start the automatic setup; the same as when you first boot the router
config t - use to execute configuration commands from the terminal
15 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

config mem - executes configuration commands stored in NVRAM; copies startup-config to


running-config
config net - used to retrieve configuration info from a TFTP server
copy running-config startup-config - copies saved config in running config (RAM) to NVRAM or
"write memory" for IOS under ver.11
copy startup-config running-config - copies from non-volatile (NVRAM) to current running config
(RAM)
boot system flash <put file filename here> - tells router which IOS file in flash to boot from
boot system tftp - tells router which IOS file on the tftp server to boot from
boot system rom - tell router to boot from ROM at next boot
copy flash tftp - Copies flash to tftp server
copy tftp flash - Restores flash from tftp server
copy run tftp - Copies the current running-config to tftp server
copy tftp run - Restores the running-config from tftp server

General Commands

Here is a list of the general commands. These are the basic level commands and most commonly
used
no shutdown - (enables the interface)
reload - restarts the router
sh ver - Cisco IOS version, uptime of router, how the router started, where system was loaded from,
the interfaces the POST found, and the configuration register
sh clock - shows date and time on router
sh history - shows the history of your commands
sh debug - shows all debugging that is currently enabled
no debug all - turns off all debugging
sh users - shows users connected to router
sh protocols - shows which protocols are configured
banner motd # Your customized message here # - Set/change banner
hostname <give router name> - use to configure the hostname of the router
clear counters - clear interface counters

Privileged Mode commands of a router

Learn how to work in the privileged mode of a router.


enable - get to privileged mode
disable - get to user mode
enable password <give password here> - sets privileged mode password
enable secret <give password here> - sets encrypted privileged mode password
Setting Passwords on router
Here you will be able to learn how to set the password on a router.
enable secret <give password here> - set encrypted password for privileged access
enable password <give password here> - set password for privileged access (used when there is no
enable secret and when using older software)
Setting the password for console access:
(config)#line console 0
(config-line)#login
(config-line)#password <put password here>
Set password for virtual terminal (telnet) access (password must be set to access router through
telnet):
(config)#line vty 0 4
(config-line)#login
(config-line)#password <put password here>
Set password for auxiliary (modem) access:
(config)#line aux 0
(config-line)#login
(config-line)#password <put password here>
16 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Router Processes & Statistics

By these command you can see the statistics and different processes of the router.
sh processes - shows active processes running on router
sh process cpu - shows cpu statistics
sh mem - shows memory statistics
sh flash - describes the flash memory and displays the size of files and the amount of free flash
memory
sh buffers - displays statistics for router buffer pools; shows the size of the Small, Middle, Big, Very
Big, Large and Huge Buffers
sh stacks - shows reason for last reboot, monitors the stack use of processes and interrupts routines

IP Commands

Here is a list of the IP Commands


Configure IP on an interface:
int serial 0
ip address 157.89.1.3 255.255.0.0
int eth 0
ip address 2008.1.1.4 255.255.255.0

Other IP Commands:

sh ip route - view ip routing table


ip route <remote_network> <mask> <default_gateway> [administrative_distance] - configure a
static IP route
ip route 0.0.0.0 0.0.0.0 <put gateway of the last resort here> - sets default gateway
ip classless - use with static routing to allow packets destined for unrecognized subnets to use the
best possible route
sh arp - view arp cache; shows MAC address of connected routers
ip address 2.2.2.2 255.255.255.0 secondary - configure a 2nd ip address on an interface
sh ip protocol

CDP Commands (Cisco Discovery Protocol uses layer 2 multicast over a SNAP-capable link to send
data):

sh cdp neighbor - shows directly connected neighbors


sh cdp int - shows which interfaces are running CDP
sh cdp int eth 0/0 - show CDP info for specific interface
sh cdp entry <cdp neighbor here> - shows CDP neighbor detail
cdp timer 120 - change how often CDP info is sent (default cdp timer is 60)
cp holdtime 240 - how long to wait before removing a CDP neighbor (default CDP holdtime is 180)
sh cdp run - shows if CDP turned on
no cdp run - turns off CDP for entire router (global config)
no cdp enable - turns off CDP on specific interface

IPX Commands

Enable IPX on router:


ipx routing
Configure IPX + IPX-RIP on an int:
int ser 0
ipx network 4A

17 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Other Commands:

sh ipx route - shows IPX routing table


sh ipx int e0 - shows ipx address on int
sh ipx servers - shows SAP table
sh ipx traffic - view traffic statistics
debug ipx routing activity - debugs IPS RIP packets
debug ipx sap - debugs SAP packets

Routing Protocols:

RIP, IGPR and OSPF are the routing protocols and here is a list of the commands for the working
on the routing protocols.
Configure RIP:
router rip
network 157.89.0.0
network 208.1.1.0
Other RIP Commands:
debug ip rip - view RIP debugging info
Configure IGRP:
router IGRP 200
network 157.89.0.0
network 208.1.1.0
Other IGRP Commands:
debug ip igrp events - view IGRP debugging info
debug ip igrp transactions - view IGRP debugging info
Access Lists
Here is a list of the Access list command of a router.
sh ip int ser 0 - use to view which IP access lists are applies to which int
sh ipx int ser 0 - use to view which IPX access lists are applies to which int
sh appletalk int ser 0 - use to view which AppleTalk access lists are applies to which int
View access lists:
sh access-lists
sh ip access-lists
sh ipx access-lists
sh appletalk access-lists
Apply standard IP access list to int eth 0:
access-list 1 deny 200.1.1.0 0.0.0.255
access-list 1 permit any
int eth 0
ip access-group 1 in
Apply Extended IP access list to int eth 0:
access-list 100 deny tcp host 1.1.1.1 host 2.2.2.2 eq 23
access-list 100 deny tcp 3.3.3.0 0.0.0.255 any eq 80
int eth 0
ip access-group 100 out
Apply Standard IPX access list to int eth 0:
access-list 800 deny 7a 8000
access-list 800 permit -1
int eth 0
ipx access-group 800 out
Apply Standard IPX access list to int eth 0:
access-list 900 deny sap any 3378 -1
access-list 900 permit sap any all -1
int eth 0
ipx access-group 900 out

EXERCISES
18 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

1. Using traceroute command find the engineering universities of Pakistan that are on same
network

2. Using ipconfig command find the ip of your system and its gateway

3. Using nslookup find ip address of common social media sites.

19 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Lahore Garrison University


Department of Software Engineering
Course Title: Computer Networks

Laboratory Session No. Date:


Software Use Rubric
Level of Attainment
Criterion Below Average Average Good Very Good Excellent
(1) (2) (3) (4) (5)
Identification of software Rarely Occasionally Able to
Perfectly able to
menu (syntax, Can’t identify identifies identifies identify
identify software
components, commands, software menus. software software software
menus.
tools, layout etc.). menus. menus. menus.
Skills to use software Efficiently uses
Can’t use Rarely uses Occasionally Often uses
(schematic, syntax, software (syntax,
software software uses software software
commands, tools, layout) commands, tools,
efficiently. efficiently. efficiently. efficiently.
efficiently. layout)
Adherence to safety Occasionally
Rarely handles Often handles
procedures and handling Doesn’t handle handles Handles
equipment equipment
of equipment (computing equipment with equipment equipment with
with required with required
unit, peripheral devices, required care and with required required care and
care and care and
and other equipment in safety. care and safety.
safety. safety.
lab). safety.
Ability to troubleshoot Occasionally
Not able to Rarely able to Often able to Fully able to
software errors able to
troubleshoot the troubleshoot troubleshoot troubleshoot the
(detection and troubleshoot
errors the errors the errors errors
debugging). the errors
Occasionally
Not able to Rarely able to Often able to Perfectly able
Analysis and able to
analyze and perform the perform the to perform the
interpretation of perform the
interpret analysis and analysis and analysis and
results/outputs. analysis and
results/outputs. interpretation. interpretation. interpretation.
interpretation.

Weighted CLO (Score)

Remarks

Instructor’s Signature with Date

20 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

LAB SESSION 04

OBJECTIVE:

Configuring static routes on Cisco routers

Figure 4.1: Scenario for static routes

THEORY

Routed & Routing Protocols

• A Routed Protocol is a protocol by which data can be routed. Routed protocols are IP,
AppleTalk, and IPX. In this kind of protocols we require an addressing scheme and sub netting.
Addressing scheme will be used to determine the network to which a host belongs and to
identifying that host on that particular network. All hosts on an internetwork use the services
of a routed protocol.
• A Routing Protocol is different and is only used between routers. It makes possible for routers
to build and maintain routing tables. There are three classes of routing protocols-
1) Distance Vector,
2) Link State,
3) Hybrid

Static & Dynamic Routing

The simplest method to route packets on a network is static routes. Although dynamic routing protocols
are flexible and adjust to network changes, they do have associated network traffic which competes for
network bandwidth with the user data traffic.

Configuring Static Routes

Static routes specify a fixed route for a certain destination network. They need to be configured on any
router that needs to reach a network that it is not directly connected to. The IOS command used to
configure static routes is ip route. The syntax is:

ip route destination-address subnet-mask {ip-address | outgoing-interface}


21 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

[distance] [tag tag] [permanent]


where:

• destination-address is the destination address prefix for the network that we would like the
router to reach
• subnet-mask is the subnet mask to be used on the address prefix to match for destination
addresses. Multiple networks may be combined such that the destination-address and subnet-
mask combination matches all hosts on those networks.
• ip-address specifies what ip address to forward a packet to if an IP packet arrives with a
destination address that matches the destination-address subnet-mask pair specified in this
command.
• Alternatively outgoing-interface specifies which interface the packet should be sent out of.
Adding a static route to an Ethernet or other broadcast interface (for example, ip route
0.0.0.0 0.0.0.0 Ethernet 1/2) will cause the route to be inserted into the routing
table only when the interface is up. This configuration is not generally recommended. When
the next hop of a static route points to an interface, the router considers each of the hosts within
the range of the route to be directly connected through that interface, and therefore it will send
ARP requests to any destination addresses that route through the static route.
• distance is the optional administrative distance value for the route. If unspecified the default
value is 1.
• tag value can be used as a "match" value for controlling redistribution via route maps.
• permanenet specifies that the route will not be removed even if the interface shuts down.

DTE/DCE
DCE and DTE are the interfaces. The DCE-DTE connection between routers is referred to as a null
serial cable DCE(data communication equipment) and DTE (Data terminal equipment). DCE is located
at the service provider end while the DTE is attached device.

The services that are given to the DTE is often accessed via modems or channel service unit/data service
unit(CSU/DSU). DCE provides clocking and DTE receives the clock

PROCEDURE

1. Connect the network as shown in the network diagram.

2. Configure appropriate ip addresses and clock rates(if needed) on the router interfaces as
specified in the network diagram.

3. For R1, enter the following static routes


ip route 172.16.20.0 255.255.255.0 192.168.10.2
ip route 192.168.20.0 255.255.255.0 192.168.10.2

4. On R2 enter:
ip route 172.16.10.0 255.255.255.0 192.168.10.1
ip route 172.16.20.0 255.255.255.0 192.168.20.2

5. On R3 enter:
ip route 172.16.10.0 255.255.255.0 192.168.20.1 ip
route 192.168.10.0 255.255.255.0 192.168.20.1

22 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

6. After that verify the static routes by entering the following commands in the privilege mode:

router# sh ip route

EXERCISES

1. Run the command show IP route and write its output.

2. What is the default administrative distance of static route? Write the IP route command to
modify the same.

3. Create a loop back interface on R3 and assign an IP address 10.1.0.1 /16 to it. Now add static
routes to each of the other routers to reach this interface. Verify your work by pinging the
newly created interface from routers R1 and R2 respectively.

23 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

24 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Lahore Garrison University


Department of Software Engineering
Course Title: Computer Networks

Laboratory Session No. Date:


Software Use Rubric
Level of Attainment
Criterion Below Average Average Good Very Good Excellent
(1) (2) (3) (4) (5)
Identification of software Rarely Occasionally Able to
Perfectly able to
menu (syntax, Can’t identify identifies identifies identify
identify software
components, commands, software menus. software software software
menus.
tools, layout etc.). menus. menus. menus.
Skills to use software Efficiently uses
Can’t use Rarely uses Occasionally Often uses
(schematic, syntax, software (syntax,
software software uses software software
commands, tools, layout) commands, tools,
efficiently. efficiently. efficiently. efficiently.
efficiently. layout)
Adherence to safety Occasionally
Rarely handles Often handles
procedures and handling Doesn’t handle handles Handles
equipment equipment
of equipment (computing equipment with equipment equipment with
with required with required
unit, peripheral devices, required care and with required required care and
care and care and
and other equipment in safety. care and safety.
safety. safety.
lab). safety.
Ability to troubleshoot Occasionally
Not able to Rarely able to Often able to Fully able to
software errors able to
troubleshoot the troubleshoot troubleshoot troubleshoot the
(detection and troubleshoot
errors the errors the errors errors
debugging). the errors
Occasionally
Not able to Rarely able to Often able to Perfectly able
Analysis and able to
analyze and perform the perform the to perform the
interpretation of perform the
interpret analysis and analysis and analysis and
results/outputs. analysis and
results/outputs. interpretation. interpretation. interpretation.
interpretation.

Weighted CLO (Score)

Remarks

Instructor’s Signature with Date

25 | P a g e
LAB SESSION 05

OBJECTIVE:

Configuring RIP (Routing Information Protocol) version 1 and RIP version 2

Figure 5.1: Scenario for RIP


THEORY

Distance Vector Routing Protocols

• Broadcast their entire routing table to each neighbor router at predetermined intervals
• The actual interval depends on the distance-vector routing protocol in use
• Varies between 30 and 90 seconds
• Sometimes referred to as routing by rumor
• Suffer from slow time to convergence
• Convergence is an state where all routers on the internetwork share a common view of the
internetwork routes

Routing Information Protocol (RIP)

A distance-vector protocol, RIP was designed to work with small to medium-sized networks. RIP is an
Interior Gateway Protocol (IGP), meaning it is used within an autonomous system. An autonomous
system is a collection of networks under a single administration, sharing a common routing strategy.

RIP is easy to implement, compared to newer IGPs, and has been implemented in networks around the
world. Advantage of using RIP, especially in small networks, is that there is very little overhead, in
terms of bandwidth used and configuration and management time.

RIP Timers

RIP uses timers both to regulate its performance and to help prevent routing loops. All routers that use
RIP send an update message to all of their neighbors approximately every 30 seconds; this process is
termed advertising. The Cisco implementation sends updates every 30 seconds minus up to 15 percent,
or 4.5 seconds.

If a neighbor has not responded in 180 seconds, it is assumed that the neighboring router is unavailable
or the network connecting it to the router has become unusable. When the neighbor has not responded
for 180 seconds, the route is marked invalid; 180 seconds is long enough that a route won't be
26 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

invalidated by a single missed update message. The neighbor is shown to be unreachable by sending a
normal update message with a metric of "infinity;" in the case of RIP, this number is 16. If an
advertisement is received from a neighbor with a metric of infinity, then the route is placed into hold-
down state, advertised with a distance of 16, and kept in the routing table. No updates from other
neighbors for the same route are accepted while the route is in hold-down state. If other neighbors are
still advertising the same route when the hold-down timer expires, then their updates will then be
accepted. The route will be advertised with infinity metric for a period of time after the hold-down state
if no alternate paths are found.

The actual timers used to accomplish the above tasks are a routing-update timer, a route-invalid timer,
a route-hold-down timer, and a route-flush timer. The RIP routing-update timer is generally set to 30
seconds, ensuring that each router will send a complete copy of its routing table to all neighbors every
30 seconds. The route-invalid timer determines how much time must expire without a router having
heard about a particular route before that route is considered invalid. When a route is marked invalid or
put in hold-down state, neighbors are notified of this fact. This notification must occur prior to
expiration of the route-flush timer. When the route flush-timer expires, the route is removed from the
routing table. Typical initial values for these timers are 180 seconds for the route-invalid and route-
holddown timers and 240 seconds for the route-flush timer. The values for each of these timers can be
adjusted with the timers basic router configuration command.

Several Stability Features

To adjust for rapid network-topology changes, RIP specifies numerous stability features that are
common to many routing protocols. RIP implements split horizon with poison-reverse and hold-down
mechanisms to prevent incorrect routing information from being propagated. Split horizon prevents
incorrect messages from being propagated by not advertising routes over an interface that the router is
using to reach the route. Implementing split horizon helps avoid routing loops. Poison reverse operates
by advertising routes that are unreachable with a metric of infinity back to the original source of the
route. Hold-down is a method of marking routes invalid (expired). As discussed above, no updates from
other neighbors for the same route are accepted while the route is in hold-down state.

Triggered updates are also an included convergence and stability feature. Updates are triggered
whenever a metric for a route changes. Triggered updates may also contain only information regarding
routes that have changed, unlike scheduled updates.

RIP version 2
RIPv2 is almost the same as the RIP version 1. RIPv2 also sends its complete routing table to its active
interfaces at periodic time intervals. The timers, loop avoidance schemes and administrative distance
are the same as Rip version 1.But RIPv2 is considered classless routing protocol because it also sends
subnet information’s with each router. It also allows authentication using MD5 encryption scheme. And
it also supports dis-contiguous networks. Configuring RIP version 2 on a router is very simple; it just
requires one additional command

PROCEDURE

Configuring RIP

1. Cable up the network as shown in the diagram.

2. Assign the IP address as shown in the diagram to the appropriate interfaces. For the serial links,
has been used to indicate a DCE port.
27 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

3. Issue RIP routing commands on all the routers starting from the global config mode.

4. On R1:
router rip
network 172.16.10.0
network 192.168.10.0
On R2
router rip
network 192.168.10.0
network 192.168.20.0

On R 3
router rip
network 10.0.0.0
network 192.168.20.0

5. To verify the working of RIP ping one host, say H2, on LAN connected to R3 from the host,
say H1, on LAN connected to R1. Also run some other debugging command to explore more.

Configuring RIP version 2

1. Issue the following commands on R1.

Router rip version 2


network 172.16.10.0
network 192.168.10.0

2. Repeat the same for R2 and R3.


3. Verify and debug, as you did earlier for RIP.

EXERCISES

1. Configure RIP on all three routers, note down routing table of router R1, and run command
Debug ip rip to note the address on which updates are sent.

28 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

2. Write commands to modify the default update and hold-down timers.

3. Repeat exercise #1 for RIPv2 and note down the multicast address on which RIPv2 forwards
the updates.

4. Write down the source IP address for the ping packets when you ping H1 from R1.

29 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

5. While working on R1, how could you check if H1 can reach the loopback interface? In other
words, how can you verify if a ping from H1 to loopback of R1 is successful?

30 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Lahore Garrison University


Department of Software Engineering
Course Title: Computer Networks

Laboratory Session No. Date:


Software Use Rubric
Level of Attainment
Criterion Below Average Average Good Very Good Excellent
(1) (2) (3) (4) (5)
Identification of software Rarely Occasionally Able to
Perfectly able to
menu (syntax, Can’t identify identifies identifies identify
identify software
components, commands, software menus. software software software
menus.
tools, layout etc.). menus. menus. menus.
Skills to use software Efficiently uses
Can’t use Rarely uses Occasionally Often uses
(schematic, syntax, software (syntax,
software software uses software software
commands, tools, layout) commands, tools,
efficiently. efficiently. efficiently. efficiently.
efficiently. layout)
Adherence to safety Occasionally
Rarely handles Often handles
procedures and handling Doesn’t handle handles Handles
equipment equipment
of equipment (computing equipment with equipment equipment with
with required with required
unit, peripheral devices, required care and with required required care and
care and care and
and other equipment in safety. care and safety.
safety. safety.
lab). safety.
Ability to troubleshoot Occasionally
Not able to Rarely able to Often able to Fully able to
software errors able to
troubleshoot the troubleshoot troubleshoot troubleshoot the
(detection and troubleshoot
errors the errors the errors errors
debugging). the errors
Occasionally
Not able to Rarely able to Often able to Perfectly able
Analysis and able to
analyze and perform the perform the to perform the
interpretation of perform the
interpret analysis and analysis and analysis and
results/outputs. analysis and
results/outputs. interpretation. interpretation. interpretation.
interpretation.

Weighted CLO (Score)

Remarks

Instructor’s Signature with Date

31 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

LAB SESSION 06

OBJECTIVE:

Configuring OSPF (Open Shortest Path First) Single Area

THEORY

Open Shortest Path First (OSPF) was developed by the Internet Engineering Task Force (IETF) as a
replacement for the problematic RIP and is now the IETF-recommended Interior Gateway Protocol
(IGP). OSPF is a link state protocol that, as the name implies, uses Dijkstra's Shortest Path First (SPF)
algorithm. It is an open standards protocol—that is, it isn't proprietary to any vendor or organization.
Link-state routing protocols perform the following functions:

• Respond quickly to network changes


• Send triggered updates only when a network change has occurred
• Send periodic updates known as link-state refreshes
• Use a hello mechanism m to determine the reachability of neighbors
• Each router keeps track of the state or condition of its directly connected neighbors by
multicasting hello packets
• Each router also keeps track of all the routers in its network or area of the network by using
link-state advertisements (LSAs).

Like all link state protocols, OSPF's major advantages over distance vector protocols are fast
convergence, support for much larger internetworks, and less susceptibility to bad routing information.
Other features of OSPF are:

• The use of areas, which reduces the protocol's impact on CPU and memory, contains the flow
of routing protocol traffic, and makes possible the construction of hierarchical internetwork
topologies
• Fully classless behavior, eliminating such class-full problems as dis-contiguous subnets.
Support of classless route table lookups, VLSM, and super-netting for efficient address
management
• A dimensionless, arbitrary metric
• Equal-cost load balancing for more efficient use of multiple paths.
• Support of authentication for more secure routing
• The use of route tagging for the tracking of external routes

32 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Characteristics of OSPF

Characteristic OSPF

VLSM support Yes

Manual summarization Yes

Type of protocol Link state

Classless support Yes


Auto-summarization No

Dis-contiguous support Yes

Route propagation Multicast on change

Hop count limit None

Convergence Fast

Peer authentication Yes

Hierarchical network Event triggered/ Dijkstra


Updates/ Route computation

DR and BDR

DR (Designated Routers)

DR has the following duties:

• To represent the multi-access network and its attached routers to the rest of the internetwork
• To manage the flooding process on the multi-access network.
• The concept behind the DR is that the network itself is considered a "pseudo node," or a virtual
router. Each router on the network forms an adjacency with the DR which represents the
pseudo-node. Only the DR will send LSAs to the rest of the internetwork.

Note: router might be a DR on one of its attached multi-access networks, and it might not be the DR on
another of its attached multi-access networks. In other words, the DR is a property of a router's interface,
not the entire router.

BDR(Backup Designated Router):

A Backup Designated Router (BDR) is a hot standby for the DR on multi-access links. The BDR
receives all routing updates from OSPF adjacent routers but doesn’t flood LSA updates.
33 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Note: if the router interface priority value is set to zero then that router won’t participate in the DR
or BDR elections on that interface.

Fig 6.1: Scenario for OSPF implementation

After assigning ip addresses to interfaces of the routers the following IP Routing commands of OSPF
on each other will be given as below.

Router A:
Router_A#config t
Router_A(config)#router ospf 1
Router_A(config-router)#network 192.168.10.64 0.0.0.7 area 0
Router_A(config-router)#network 10.255.255.80 0.0.0.3 area 0

The Router_A is using a /29 or 255.255.255.248 mask on the fa0/0 interface. This
is a block size of 8, which is a wildcard of 7. The s0/0 interface is a mask of 255.255.255.252 block
size of 4, with a wildcard of 3. Similarly the other subnet ,mask, and wildcard can be determined by
looking
at the IP address of an interface.

Router B:
Router_B#config t
Router_B(config)#router ospf 1
Router_B(config-router)#network 10.255.255.80 0.0.0.3 area 0
Router_B(config-router)#network 10.255.255.8 0.0.0.3 area 0

Router C:
Router_C#config t
Router_C(config)#router ospf 1 Router_C(config-
router)#network 192.168.10.16 0.0.0.7 area 0 Router_C(config-
router)#network 10.255.255.8 0.0.0.3 area 0

EXERCISES

Fig 6.2: Scenario for exercise problems

34 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Simulate the network shown above on packet tracer. Assign appropriate IP addresses on
the interfaces and configure OSPF on the routers. Write down the configuration
commands entered on all three routers for configuration of OSPF.

1. Router 1:

2. Router 2

3. Router 3

35 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Lahore Garrison University


Department of Software Engineering
Course Title: Computer Networks

Laboratory Session No. Date:


Software Use Rubric
Level of Attainment
Criterion Below Average Average Good Very Good Excellent
(1) (2) (3) (4) (5)
Identification of software Rarely Occasionally Able to
Perfectly able to
menu (syntax, Can’t identify identifies identifies identify
identify software
components, commands, software menus. software software software
menus.
tools, layout etc.). menus. menus. menus.
Skills to use software Efficiently uses
Can’t use Rarely uses Occasionally Often uses
(schematic, syntax, software (syntax,
software software uses software software
commands, tools, layout) commands, tools,
efficiently. efficiently. efficiently. efficiently.
efficiently. layout)
Adherence to safety Occasionally
Rarely handles Often handles
procedures and handling Doesn’t handle handles Handles
equipment equipment
of equipment (computing equipment with equipment equipment with
with required with required
unit, peripheral devices, required care and with required required care and
care and care and
and other equipment in safety. care and safety.
safety. safety.
lab). safety.
Ability to troubleshoot Occasionally
Not able to Rarely able to Often able to Fully able to
software errors able to
troubleshoot the troubleshoot troubleshoot troubleshoot the
(detection and troubleshoot
errors the errors the errors errors
debugging). the errors
Occasionally
Not able to Rarely able to Often able to Perfectly able
Analysis and able to
analyze and perform the perform the to perform the
interpretation of perform the
interpret analysis and analysis and analysis and
results/outputs. analysis and
results/outputs. interpretation. interpretation. interpretation.
interpretation.

Weighted CLO (Score)

Remarks

Instructor’s Signature with Date

36 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

LAB SESSION 07

OBJECTIVE:

Configuring EIGRP (Enhanced Interior Gateway Routing Protocol)

THEORY

EIGRP is a proprietary Cisco protocol that runs on Cisco routers. It is important to understand EIGRP
because it is probably one of the two most popular routing protocols in use today. Like IGRP, EIGRP
uses the concept of an autonomous system to describe a set of contiguous routers that run the same
routing protocol and share routing information. But unlike IGRP, EIGRP includes the subnet mask in
its route updates.

Why prefer EIGRP?


EIGRP is sometimes referred to as a hybrid routing protocol because it has characteristics of both
distance vector and link state protocols. For example, EIGRP doesn’t send link-state packets as OSPF
does; instead it sends traditional distance vector updates containing information about networks plus
the cost of reaching them from the perspective of the advertising router. And EIGRP has link state
characteristics as well – it synchronizes routing tables between neighbors at startup and then sends
specific updates only when topology changes occur. This makes EIGRP suitable for very large
networks. EIGRP has a maximum hop count of 255 (the default is set to 100).

EIGRP metric calculation:


EIGRP unlike many other protocols that vuse a single factor to compare routes and select the best
possible path, EIGRP can use a combination of four:
1) Bandwidth 2) Delay
3) Load 4) Reliability

Configuring EIGRP
Lets view the topology

Router1 Router2

PC1

172.16.3 172.16.16.2/24
2.2/24

Fig 7.1: Scenario for EIGRP implementation

37 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Following are the IP addresses assigned to the interfaces

Router2#sh ip int brief

Interface IP-Address OK? Method Status Protocol

FastEthernet0/0 unassigned YES Manual up down


FastEthernet1/0 172.16.32.1 YES Manual up up
Serial2/0 172.16.64.2 YES Manual up up
Serial3/0 unassigned YES Manual administratively down
Down
FastEthernet4/0 unassigned YES manual administratively down
Down
FastEthernet5/0 unassigned YES manual administratively down
Down
Modem6/0 unassigned YES manual down down
Modem7/0 unassigned YES manual down down
Modem8/0 unassigned YES manual down down

Router1#sh ip int brief


Metho Protoco
Interface IP-Address OK? d Status l
FastEthernet0/
0 172.16.32.1 YES Manual up up
FastEthernet1/ administratively down
0 Unassigned YES Manual down
Serial2/0 172.16.64.1 YES Manual up up
manual administratively

Serial3/0 Unassigned YES down down


FastEthernet4/ manual administratively
0 Unassigned YES down down
FastEthernet5/ manual administratively
0 Unassigned YES down down

To start EIGRP process on both routers the following configurations will be done.

Router1(config)#router eigrp 1
Router1(config-router)#network 172.16.64.0 0.0.0.255
Router1(config-router)#network 172.16.32.0 0.0.0.255
Router1(config-router)#exit

Router2(config)#router eigrp 1
Router2(config-router)#network 172.16.64.0 0.0.0.255
Router2(config-router)#network 172.16.16.0 0.0.0.255
Router2(config-router)#exit

Now verifying the routing tables.

Router2#sh ip route
38 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

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

172.16.0.0/24 is subnetted, 3 subnets


C 172.16.16.0 is directly connected, FastEthernet0/0
D 172.16.32.0 [90/20514560] via 172.16.64.1, 00:01:36, Serial2/0
C 172.16.64.0 is directly connected, Serial2/0

Router1#sh 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

172.16.0.0/24 is subnetted, 3 subnets


D 172.16.16.0 [90/20514560] via 172.16.64.2, 00:01:53,
Serial2/0 C 172.16.32.0 is directly connected, FastEthernet0/0
C 172.16.64.0 is directly connected, Serial2/0

Now we will check end to end connectivity from PCs.

PC2>ping 172.16.32.2

Pinging 172.16.32.2 with 32 bytes of data:

Reply from 172.16.32.2: bytes=32 time=156ms TTL=126


Reply from 172.16.32.2: bytes=32 time=125ms TTL=126
Reply from 172.16.32.2: bytes=32 time=127ms TTL=126
Reply from 172.16.32.2: bytes=32 time=141ms TTL=126

Ping statistics for 172.16.32.2:


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

39 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Approximate round trip times in milli-seconds:


Minimum = 125ms, Maximum = 156ms, Average = 137ms

PC1>ping 172.16.16.2

Pinging 172.16.16.2 with 32 bytes of data:

Reply from 172.16.16.2: bytes=32 time=140ms TTL=126


Reply from 172.16.16.2: bytes=32 time=156ms TTL=126
Reply from 172.16.16.2: bytes=32 time=125ms TTL=126
Reply from 172.16.16.2: bytes=32 time=141ms TTL=126

Ping statistics for 172.16.16.2:


Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 125ms, Maximum = 156ms, Average = 140ms

Now displaying eigrp topology on R2 only

Router2#sh ip eigrp topology


IP-EIGRP Topology Table for AS 1

Codes: P - Passive, A - Active, U - Update, Q - Query, R -


Reply, r - Reply status

P 172.16.64.0/24, 1 successors, FD is
20512000 via Connected, Serial2/0
P 172.16.16.0/24, 1 successors, FD is 28160

via Connected,
FastEthernet0/0
P 172.16.4.0/24, 1 successors, FD is
20512000
via Connected,
Serial3/0
P 172.16.32.0/24, 1 successors, FD is
20514560
via 172.16.64.1 (20514560/28160),
Serial2/0
P 172.16.8.0/24, 2 successors, FD is
21024000
via 172.16.64.1 (21024000/20512000),
Serial2/0
via 172.16.4.1 (21024000/20512000),
Serial3/0
Router2#sh ip
eigrp neighbors
IP-EIGRP neighbors for process
1
H Address Interface Hold Uptime SRTT RTO Q Seq
(sec
) (ms) Cnt Num
0 172.16.64.1 Se2/0 12 00:02:50 40 1000 0 20
1 172.16.4.1 Se3/0 10 00:02:50 40 1000 0 24

40 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

EXERCISES

1. What four routed protocols are supported by EIGRP?

2. When is redistribution required for EIGRP?

41 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Lahore Garrison University


Department of Software Engineering
Course Title: Computer Networks

Laboratory Session No. Date:


Software Use Rubric
Level of Attainment
Criterion Below Average Average Good Very Good Excellent
(1) (2) (3) (4) (5)
Identification of software Rarely Occasionally Able to
Perfectly able to
menu (syntax, Can’t identify identifies identifies identify
identify software
components, commands, software menus. software software software
menus.
tools, layout etc.). menus. menus. menus.
Skills to use software Efficiently uses
Can’t use Rarely uses Occasionally Often uses
(schematic, syntax, software (syntax,
software software uses software software
commands, tools, layout) commands, tools,
efficiently. efficiently. efficiently. efficiently.
efficiently. layout)
Adherence to safety Occasionally
Rarely handles Often handles
procedures and handling Doesn’t handle handles Handles
equipment equipment
of equipment (computing equipment with equipment equipment with
with required with required
unit, peripheral devices, required care and with required required care and
care and care and
and other equipment in safety. care and safety.
safety. safety.
lab). safety.
Ability to troubleshoot Occasionally
Not able to Rarely able to Often able to Fully able to
software errors able to
troubleshoot the troubleshoot troubleshoot troubleshoot the
(detection and troubleshoot
errors the errors the errors errors
debugging). the errors
Occasionally
Not able to Rarely able to Often able to Perfectly able
Analysis and able to
analyze and perform the perform the to perform the
interpretation of perform the
interpret analysis and analysis and analysis and
results/outputs. analysis and
results/outputs. interpretation. interpretation. interpretation.
interpretation.

Weighted CLO (Score)

Remarks

Instructor’s Signature with Date

42 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

LAB SESSION 08

OBJECTIVE:

Studying basic LAN switch operation

THEORY:

LAN switch performs 3 operations


- Address learning
- Forward filter decision
- Loop avoidance

In this session, we will explore how an Ethernet switch learns addresses of the attached hosts.

Address learning
A new switch has empty MAC address table. As each frame transits switch, it learns source MAC
address against the source port. As the switch does not know to which port the destination is attached,
it initially transmits the frame to all ports. This process is called flooding. As the responses are received,
the MAC address table is further populated.

PROCEDURE:

Consider the following scenario

Fig 8.1: Scenario for LAN switch operation

Initially the MAC database of switch will be

Switch#sh mac-address-table

Mac Address Table

Vlan Mac Address Type Ports

1 0006.2a75.100c DYNAMIC Fa0/1


Switch#

43 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

And that of second switch is;

Switch#sh mac-address-table

Mac Address Table

Vlan Mac Address Type Ports

1 0060.471b.ae01 DYNAMIC Eth0/1

switch#

Now as any of the computers generates ping for any of the remaining computers, the MAC address
table will grow

Switch#sh mac-address-table

Mac Address Table

Vlan Mac Address Type Ports

1 0006.2a75.100c DYNAMIC Fa0/1


1 0040.0ba5.183a DYNAMIC Fa0/1
1 00e0.f7a4.475c DYNAMIC Fa0/2
Switch#

Also for second switch:

switch#sh mac-address-table

Mac Address Table

Vlan Mac Address Type Ports

1 0040.0ba5.183a DYNAMIC Eth1/1


1 0060.471b.ae01 DYNAMIC Eth0/1
1 00e0.f7a4.475c DYNAMIC Eth0/1
switch#

44 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

EXERCISE:

1. If a destination MAC address is not in the forward/filter table, what will the switch do with
the frame?

2. If a frame is received on a switch port and the source MAC address is not in the forward/filter
table, what will the switch do?

45 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Lahore Garrison University


Department of Software Engineering
Course Title: Computer Networks

Laboratory Session No. Date:


Software Use Rubric
Level of Attainment
Criterion Below Average Average Good Very Good Excellent
(1) (2) (3) (4) (5)
Identification of software Rarely Occasionally Able to
Perfectly able to
menu (syntax, Can’t identify identifies identifies identify
identify software
components, commands, software menus. software software software
menus.
tools, layout etc.). menus. menus. menus.
Skills to use software Efficiently uses
Can’t use Rarely uses Occasionally Often uses
(schematic, syntax, software (syntax,
software software uses software software
commands, tools, layout) commands, tools,
efficiently. efficiently. efficiently. efficiently.
efficiently. layout)
Adherence to safety Occasionally
Rarely handles Often handles
procedures and handling Doesn’t handle handles Handles
equipment equipment
of equipment (computing equipment with equipment equipment with
with required with required
unit, peripheral devices, required care and with required required care and
care and care and
and other equipment in safety. care and safety.
safety. safety.
lab). safety.
Ability to troubleshoot Occasionally
Not able to Rarely able to Often able to Fully able to
software errors able to
troubleshoot the troubleshoot troubleshoot troubleshoot the
(detection and troubleshoot
errors the errors the errors errors
debugging). the errors
Occasionally
Not able to Rarely able to Often able to Perfectly able
Analysis and able to
analyze and perform the perform the to perform the
interpretation of perform the
interpret analysis and analysis and analysis and
results/outputs. analysis and
results/outputs. interpretation. interpretation. interpretation.
interpretation.

Weighted CLO (Score)

Remarks

Instructor’s Signature with Date

46 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

LAB SESSION 09

OBJECTIVE:

Studying and configuring Access Lists

THEORY:

An access list is essentially a list of conditions that categorize packets. One of the most common and
easiest to understand uses of access lists is filtering unwanted packets when implementing security
policies. Access lists can even be used in situations that don’t necessarily involve blocking packets.

There are a few important rules that a packet follows when it’s being compared with an access list:

Rule#1: It’s always compared with each line of the access list in sequential order—that is, it’ll always
start with the first line of the access list, then go to line 2, then line 3, and so on.

Rule#2: It’s compared with lines of the access list only until a match is made. Once the packet
matches the condition on a line of the access list, the packet is acted upon and no further comparisons
take place.

Rule#3: There is an implicit “deny” at the end of each access list—this means that if a packet doesn’t
match the condition on any of the lines in the access list, the packet will be discarded. Each of these
rules has some powerful implications when filtering IP packets with access lists, so keep in mind that
creating effective access lists truly takes some practice.

There are two main types of access lists:

1. Standard access lists

2. Extended access lists

Standard access lists


These use only the source IP address in an IP packet as the condition test. All decisions are made based
on the source IP address. This means that standard access lists basically permit or deny an entire suite
of protocols. They don’t distinguish between any of the many types of IP traffic such as web, Telnet,
UDP, and so on.
Its command syntax is: access-list <number> {permit| deny} <destination> [log]

Fig 9.1: Standard Access list to allow my network

Commands on router will be


47 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

R1(config)#aaccess-list 1 permit 172.16.0.0 0.0.255.255


R1(config)#interface ethernet 0
R1(config)#ip access-group 1 out
R1(config)#interface ethernet 1
R1(config)#ip access-group 1 out

The above commands will permit the network 172.16.0.0 only and will block other network through
the router on its ethernet interfaces in its out side directions

Extended access lists

Extended access lists can evaluate many of the other fields in the layer 3 and layer 4 headers of an IP
packet. They can evaluate source and destination IP addresses, the protocol field in the Network layer
header, and the port number at the Transport layer header. This gives extended access lists the ability
to make much more granular decisions when controlling traffic.

Its command syntax is: access-list <number> {permit| deny}


<protocol><source>[<ports>]<destination>[ports][<options>]

Fig 9.2: Extended access list

Commands on the router will be:


access-list 101 deny tcp 172.16.4.0 0.0.0.255 any eq 23 access-list 101 permit ip any any
interface ethernet 0
ip access-group 101 out
The above commands will deny only the Telnet from subnet 172.16.40.0 out of E0 and will permit
all other traffic.

EXERCISE:

Give commands to enable logging for the given access list and to show the entries that have
been blocked

48 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

49 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Lahore Garrison University


Department of Software Engineering
Course Title: Computer Networks

Laboratory Session No. Date:


Software Use Rubric
Level of Attainment
Criterion Below Average Average Good Very Good Excellent
(1) (2) (3) (4) (5)
Identification of software Rarely Occasionally Able to
Perfectly able to
menu (syntax, Can’t identify identifies identifies identify
identify software
components, commands, software menus. software software software
menus.
tools, layout etc.). menus. menus. menus.
Skills to use software Efficiently uses
Can’t use Rarely uses Occasionally Often uses
(schematic, syntax, software (syntax,
software software uses software software
commands, tools, layout) commands, tools,
efficiently. efficiently. efficiently. efficiently.
efficiently. layout)
Adherence to safety Occasionally
Rarely handles Often handles
procedures and handling Doesn’t handle handles Handles
equipment equipment
of equipment (computing equipment with equipment equipment with
with required with required
unit, peripheral devices, required care and with required required care and
care and care and
and other equipment in safety. care and safety.
safety. safety.
lab). safety.
Ability to troubleshoot Occasionally
Not able to Rarely able to Often able to Fully able to
software errors able to
troubleshoot the troubleshoot troubleshoot troubleshoot the
(detection and troubleshoot
errors the errors the errors errors
debugging). the errors
Occasionally
Not able to Rarely able to Often able to Perfectly able
Analysis and able to
analyze and perform the perform the to perform the
interpretation of perform the
interpret analysis and analysis and analysis and
results/outputs. analysis and
results/outputs. interpretation. interpretation. interpretation.
interpretation.

Weighted CLO (Score)

Remarks

Instructor’s Signature with Date

50 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

LAB SESSION 10

OBJECTIVE:

Introduction to Network Management Tools. Learn how Networks can be managed using these tools.

THEORY:

Network management refers to the activities, methods, procedures, and tools that can be used for
maintaining following three operations on a network.

(i) Operation deals with keeping the network (and the services that the network provides) up and
running smoothly. It includes monitoring the network to spot problems as soon as possible, ideally
before a user is affected.

(ii)Administration involves keeping track of resources in the network and how they are assigned. It
deals with all the “housekeeping” that is necessary to keep things under control.

(iii) Maintenance is concerned with performing repairs and upgrades—for example, when a line card
must be replaced, when a router needs a new operating system image with a patch, when a new
switch is added to the network. Maintenance also involves corrective and preventive proactive
measures such as adjusting device parameters as needed to make the managed network run “better.”

(iv) Provisioning is concerned with configuring resources in the network to support a given service.
For example, this might include setting up the network so that a new customer can receive voice
service.

Network Management Tools: There are plenty of Tools that can be used for Network Management.
A few of them are described below;

Company Product URL Comments


10-strike LANState http://www.10- LANState builds a network map
strike.com/lanstate/ automatically by scanning Windows
network neighborhood or IP address
range. It can monitor the network or
individual traffic of each NE. Also
supports SNMP based management.
Castlerock SNMPc http://www.castlerock.c The SNMPc 9 Network manager is
om/ appropriate for small networks Itsupports
SNMPv3, as does the Enterprise edition
that provides other capabilities. Cost of
the SNMPc Enterprise and SNMPc
OnLine is $12500.00 The company has
been a leader in the SNMP
field
Solar Engineers http://solarwinds.net/ Provides a number of management tools
Winds Toolset ranging in price from $145 to $1995. The
$1495.00 package is Web-enabled. The
51 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Engineers Toolset at $1450.00 looks like


the most attractive as it contains most of
the features in a package
MG-SOFT Net Inspector http://www.mg-soft.si/ Net Inspector Lite is $495.00. MG-SOFT
Lite provides many other more
comprehensive products and products
can be enhanced by proxy front-end
modules. There are also products that
support SNMPv3

PROCEDURE:

We will use LANSTATE tool to demonstrate how a network manager discovers a network and
creates/maintains a graphical view of its network in a single window. Open LANSTATE software. Run
“Map Creation Wizard” from File menue. A window will appear as shown below,

Figure 10.1 LANState New Network Map Wizard

Click Next, a second window like below will appear,

52 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Figure 10.2 Setting IP Address Range on LANState

Enter the IP Address range of you target network to be discovered and click next to get following
window

Figure 10.3 Scanning methods and parameters on LANState

53 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Now clicking Next button will result in start of network discovery process as shown below,

Figure 10.4 Searching and Selecting hosts for placing on map

The finally discovered network would be like as shown below,

Figure 10.5 LANState Network Map

Students are encouraged to explore the features of this software.

Now open the PowerSnmp from start menu. You should get a window like below,

54 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Figure 10.6 PowerSNMP Free Manager Main window

Go to Discover →SNMP Agents to obtain the following window, In the address bar you can specify
the target network to be discovered or use the default broadcast address and press find. Based on the
SNMP community (public and NED) set in the properties clients with SNMP agent enabled will be
discovered. Add these discovered clients to obtain the below window,

Figure 10.7 Network Agent Discovery

Now select the parameter of sysDescr from the SNMP MIT shown in the rightest window and select
any discovered agent from left most window, right click on it and select query, a windows will pop up
in which press query button again to obtain the below window .You can see that it has returned the

55 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

complete description of the selected client. You can similarly any of the supported parameter in the
SNMP MIT.

Figure 10.8 Query Agent

Now select any of the SNMP agent and select the sysUptime parameter from MIT and select the add
watch option from the right click options on the selected agent.

EXERCISE:

1) Design a network in packet tracer 5.3. Add a server to the network and configure HTTP service on it.
Use this service from any client in the network.

2) Using LANSTATE discover a network (preferably your home network if applicable) and export the
discovered network to Microsoft Visio.

56 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Lahore Garrison University


Department of Software Engineering
Course Title: Computer Networks

Laboratory Session No. Date:


Software Use Rubric
Level of Attainment
Criterion Below Average Average Good Very Good Excellent
(1) (2) (3) (4) (5)
Identification of software Rarely Occasionally Able to
Perfectly able to
menu (syntax, Can’t identify identifies identifies identify
identify software
components, commands, software menus. software software software
menus.
tools, layout etc.). menus. menus. menus.
Skills to use software Efficiently uses
Can’t use Rarely uses Occasionally Often uses
(schematic, syntax, software (syntax,
software software uses software software
commands, tools, layout) commands, tools,
efficiently. efficiently. efficiently. efficiently.
efficiently. layout)
Adherence to safety Occasionally
Rarely handles Often handles
procedures and handling Doesn’t handle handles Handles
equipment equipment
of equipment (computing equipment with equipment equipment with
with required with required
unit, peripheral devices, required care and with required required care and
care and care and
and other equipment in safety. care and safety.
safety. safety.
lab). safety.
Ability to troubleshoot Occasionally
Not able to Rarely able to Often able to Fully able to
software errors able to
troubleshoot the troubleshoot troubleshoot troubleshoot the
(detection and troubleshoot
errors the errors the errors errors
debugging). the errors
Occasionally
Not able to Rarely able to Often able to Perfectly able
Analysis and able to
analyze and perform the perform the to perform the
interpretation of perform the
interpret analysis and analysis and analysis and
results/outputs. analysis and
results/outputs. interpretation. interpretation. interpretation.
interpretation.

Weighted CLO (Score)

Remarks

Instructor’s Signature with Date

57 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

LAB SESSION 11

OBJECTIVE:

Introduction to WireShark (Network Protocol Analyzer /Packet Sniffer) and Live network monitoring

THEORY
A better way to understand network protocols is to observe how they actually work. A basic tool for
observing the messages exchanged between executing protocol entities is the packet sniffer, which is
an essential part of network protocol analyzer. WireShark is a free and open-source network protocol
analyzer that runs on various operating systems including Linux, Unix, Mac, and Windows.

WireShark:
WireShark (previously called Ethereal) is one of the most widely used network protocol analyzer. It
passively sniffs packets that are sent from or received by a designated network interface, but never
sends packets itself. It receives a copy of packets that are sent from or received by the applications and
protocols executing on the end-system (e.g., your computer). WireShark also has a graphical front-end
to display the packets that it sniffs.

Figure 11.1 Structure of Packet Capture Software/ Protocol Analyzer

Figure 12.1. shows the structure of a network protocol analyzer. At the right of the figure shows the
protocol stack and applications (such as a web browser or an FTP client) that normally run on your
computer. The network protocol analyzer, shown within the dashed rectangle, has two parts, the packet
capture and the packet analyzer. The packet capture library receives a copy of every link-layer frame
that is sent from or received by a designated network interface. The messages exchanged by higher
layer protocols such as HTTP, FTP, TCP, UDP, DNS, or IP all are eventually encapsulated in link-
layer frames that are transmitted over physical media such as an Ethernet cable. In Figure 12.1 the
assumed physical media is an Ethernet, and so all upper layer protocols’ headers are eventually
encapsulated within an Ethernet frame. Capturing all link-layer frames thus gives you all messages sent
from or received by all protocols and applications executing in your computer.

58 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

The second component is the packet analyzer, which displays the contents of all fields within a link-
layer frame. In order to do so, the packet analyzer must understand the structure of messages exchanged
by the protocols. For example, we are interested in displaying the various fields in messages exchanged
by the HTTP protocol in Figure 12.1. The packet analyzer understands the format of Ethernet frames,
and so it can identify the IP datagram within an Ethernet frame. It also understands the IP datagram
format, so it can extract the TCP segment within the IP datagram. It understands the TCP segment
structure, so it can extract the HTTP message contained in the TCP segment. Finally, it understands the
HTTP protocol and so, for example, knows that an HTTP message may contain the string of “GET”,
“POST” or “HEAD”.

Layered Protocol:
Two reference models are used to describe the network architecture, the OSI/ISO reference model and
the TCP/IP reference model. The OSI/ISO model divides the network into seven layers and the TCP/IP
model divides the network into four layers. No matter which model is used, the basic principle of the
layered architecture is that each layer performs some services for the layer above it.

PROCEDURE

Installation
WireShark is free to download at http://www.wireshark.org/. How to build and install WireShark onto
machines first consult the WireShark User's Guide, the WireShark Developers Guide and the various
README files provided with WireShark.

Starting WireShark

When you run WireShark, you will see the graphical user interface (GUI) as shown in Figure 12.2.
There are four main fields:

a. Filter field: Used to filter out uninteresting packets with the entered specifications, so you
can choose which packets should (not) be shown on the screen;
b. Captured packets: Lists the packets captured by the selected interface;
c. Details of selected packet: Lists information about the packet that is selected in the captured
packets window;
d. Content of packet in hex/ASCII: Displays the content of the captured packet, in hex and
ASCII.

59 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Figure 11.2: WireShark Graphical User Interface

Capture Trace
Use the following procedure to capture the trace:
a. Pick a URL and fetch it through web browser. For example, open a new window of your
browser and type https://www.google.com.pk.
b. Close web browser. By minimizing browser activity you will stop your computer from fetching
unnecessary web content, and avoid incidental traffic in the trace.
c. Now launch Wireshark. Choose the network interface that we would like to capture the packets
on. To do this, select “Capture options” from the command menu. Select the interface you are
using. Uncheck “Capture packets in promiscuous mode”. This mode is useful to overhear
packets sent to/from other computers on broadcast networks. We only want to record packets
sent to/from your computer. See figure 12.3
d. Use capture filter “tcp port 80”. This filter will record only standard web traffic and not other
kinds of packets that your computer may send. Click “Start” to start the packet capture process.
e. When the capture is started, repeat the web fetch using web browser. This time, the packets
will be recorded by Wireshark as the content is transferred.
f. After the fetch is successful, return to Wireshark and use the menus or buttons to stop the trace
(“Capture Stop”). If you have succeeded, the upper Wireshark window will show multiple
packets. How many packets being captured will depend on the size of the web page. An
example is shown in Figure 12.4

Layered Protocol
By inspecting the captured trace, we can understand the layered protocol.

60 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Figure 11.3 Capture options window

a. Select an HTTP GET packet. This packet carries the HTTP request sent from your computer to
the server.
b. HTTP is the application layer web protocol used to fetch URLs. It runs on top of the TCP/IP
transport and network layer protocols. The link layer protocol shown in the figure is Ethernet. It
may be other protocol, depends on your network.
c. Click on one HTTP packet, and turn to the middle panel with details of the packet. The first block
is “Frame”. This is a record that describes overall information about the packet, including when
it was captured and how many bits long it is.
d. The second block is “Ethernet” (You may have taken trace in a computer with 802.11, but still
you will see an Ethernet block. This is because Wireshark capture traffic in Ethernet format
determined on the capture options. See Link-layer header type.).
e. Then we can see IP, TCP, and HTTP. This is a bottom-up order, because as packets are passed
down the protocol stack, the header of the lower layer protocol is added to the front of the
information from the higher layer protocol. That is, the lower layer protocols come first in the
packet.

61 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Figure 11.4 Packet trace

When an Ethernet frame arrives at a computer, the Ethernet layer must hand the packet that it contains
to the next higher layer to be processed. In order to do this, the protocol use information in its header
to determine the higher layer data unit encapsulated.

EXERCISE:
Capture a SNMP packet using Wireshark and record your observation.

62 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Lahore Garrison University


Department of Software Engineering
Course Title: Computer Networks
Laboratory Session No. Date:
Software Use Rubric
Level of Attainment
Criterion Below Average Average Good Very Good Excellent
(1) (2) (3) (4) (5)
Identification of software Rarely Occasionally Able to
Perfectly able to
menu (syntax, Can’t identify identifies identifies identify
identify software
components, commands, software menus. software software software
menus.
tools, layout etc.). menus. menus. menus.
Skills to use software Efficiently uses
Can’t use Rarely uses Occasionally Often uses
(schematic, syntax, software (syntax,
software software uses software software
commands, tools, layout) commands, tools,
efficiently. efficiently. efficiently. efficiently.
efficiently. layout)
Adherence to safety Occasionally
Rarely handles Often handles
procedures and handling Doesn’t handle handles Handles
equipment equipment
of equipment (computing equipment with equipment equipment with
with required with required
unit, peripheral devices, required care and with required required care and
care and care and
and other equipment in safety. care and safety.
safety. safety.
lab). safety.
Ability to troubleshoot Occasionally
Not able to Rarely able to Often able to Fully able to
software errors able to
troubleshoot the troubleshoot troubleshoot troubleshoot the
(detection and troubleshoot
errors the errors the errors errors
debugging). the errors
Occasionally
Not able to Rarely able to Often able to Perfectly able
Analysis and able to
analyze and perform the perform the to perform the
interpretation of perform the
interpret analysis and analysis and analysis and
results/outputs. analysis and
results/outputs. interpretation. interpretation. interpretation.
interpretation.

Weighted CLO (Score)

Remarks

Instructor’s Signature with Date

63 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

LAB SESSION 12

OBJECTIVE:

• To study the concept of a Network Monitoring System (NMS)


• To study a SNMP based NMS and analyze communication between a managed element (CISCO
2950 Catalyst Switch) and NMS system

THEORY

Short for Network Management System, NMS is a computer that has been setup to monitor and/or
manage a Data/voice network and the devices contained in that network. Network management refers
to the activities, methods, procedures, and tools that pertain to the operation, administration,
maintenance, and provisioning of networked systems.

NMS implementation using SNMP

Simple Network Management Protocol (SNMP) is a UDP-based network protocol. It is used mostly in
network management systems to monitor network-attached devices for conditions that warrant
administrative attention. SNMP is a component of the Internet Protocol Suite as defined by the IETF.
It consists of a set of standards for network management, including an application layer protocol, a
database schema, and a set of data objects.

SNMP exposes management data in the form of variables on the managed systems, which describe the
system configuration. These variables can then be queried (and sometimes set) by managing
applications.

In typical SNMP use, one or more administrative computers have the task of monitoring or managing
a group of hosts or devices on a computer network. Each managed system (also called Slave) executes,
at all times, a software component called an agent (see below) which reports information via SNMP to
the managing systems (also called Masters).

Essentially, SNMP agents expose management data on the managed systems as variables (such as "free
memory", "system name", "number of running processes", "default route"). But the protocol also
permits active management tasks, such as modifying and applying a new configuration. The managing
system can retrieve the information through the GET, GETNEXT and GETBULK protocol operations
or the agent will send data without being asked using TRAP or INFORM protocol operations.
Management systems can also send configuration updates or controlling requests through the SET
protocol operation to actively manage a system. Configuration and control operations are used only
when changes are needed to the network infrastructure. The monitoring operations are usually
performed on a regular basis.

The variables accessible via SNMP are organized in hierarchies. These hierarchies such as type and
description of the variable are described by Management Information Bases (MIBs). Typically, SNMP
uses UDP ports 161 for the agent and 162 for the manager. The manager may send requests from any
available source port to port 161 in the agent. The agent response will be sent back to the source port.
The manager typically receives notifications on port 162. The agent may generate notifications from
any available port.

64 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Figure 12.1 Two-tier model


PROCEDURE

We have a very simple network comprising of following components;


A CISCO 2950 CATALYST Switch configured for SNMP
A PC loaded with IReasoning MIB Browser.

We have simple Ethernet connectivity between the two elements with following IPs assigned:
192.168.10.1 assigned to PC
192.168.10.2 assigned on VLAN1 in Cisco 2950 Switch.

Open the IReasoning MIB Browser on the PC. It should load as shown below;

Figure 12.2 MIB Browser window

Ensure that RFC-1213 MIB file is loaded in the left pane. Also go to ‘Advanced ‘Option and ensure
that the SNMP v1 is selected, the Port No is 161 and the community name is ‘public’.
Now go to the CISCO Switch 2950 prompt using Hyper Terminal and type following commands to
configure SNMP on the Switch:

Switch#conf t

Switch(config)#snmp-server enable

65 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Switch(config)#snmp-server enable informs

Switch(config)#snmp-server community public

Now go back to IReasoning MIB Browser and go to RFC-1213→Interfaces→ifTable in the left pane
and right click on it and then select the option Table View. You will get the following view:

Figure 12.3 ifTable snapshot

EXERCISE:

Observe the different parameters of the managed element being shown in this Table and write
your comments in the result section\

66 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Lahore Garrison University


Department of Software Engineering
Course Title: Computer Networks

Laboratory Session No. Date:


Software Use Rubric
Level of Attainment
Criterion Below Average Average Good Very Good Excellent
(1) (2) (3) (4) (5)
Identification of software Rarely Occasionally Able to
Perfectly able to
menu (syntax, Can’t identify identifies identifies identify
identify software
components, commands, software menus. software software software
menus.
tools, layout etc.). menus. menus. menus.
Skills to use software Efficiently uses
Can’t use Rarely uses Occasionally Often uses
(schematic, syntax, software (syntax,
software software uses software software
commands, tools, layout) commands, tools,
efficiently. efficiently. efficiently. efficiently.
efficiently. layout)
Adherence to safety Occasionally
Rarely handles Often handles
procedures and handling Doesn’t handle handles Handles
equipment equipment
of equipment (computing equipment with equipment equipment with
with required with required
unit, peripheral devices, required care and with required required care and
care and care and
and other equipment in safety. care and safety.
safety. safety.
lab). safety.
Ability to troubleshoot Occasionally
Not able to Rarely able to Often able to Fully able to
software errors able to
troubleshoot the troubleshoot troubleshoot troubleshoot the
(detection and troubleshoot
errors the errors the errors errors
debugging). the errors
Occasionally
Not able to Rarely able to Often able to Perfectly able
Analysis and able to
analyze and perform the perform the to perform the
interpretation of perform the
interpret analysis and analysis and analysis and
results/outputs. analysis and
results/outputs. interpretation. interpretation. interpretation.
interpretation.

Weighted CLO (Score)

Remarks

Instructor’s Signature with Date

67 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

LAB SESSION 13
Open Ended Laboratory
Objective:

Design the given Network using a suitable sub-netted IP address scheme. The address scheme should
consider 10% growth in future. Configure mail, HTTP and DNS services on this network.

Network Layout:

Refer to the Figure 13.1 below for the configuration and connection details. The shown connections
are just for illustration purpose and actual connections may need to be changed. The number of end
devices connected to Router 0 and Router 1 are 100 and to Router 2 are 20. Use OSPF routing
protocol.

Figure 13.1: Figure showing the topology of the target Open ended Lab

Result:

1. Show that you can ;


a. Send / Receive email from all the hosts to any other host in the network.
b. Develop a web page at the server and assign it a URL.
c. Show that the URL is accessible from all the hosts on the network.

68 | P a g e
Computer Networks
Lahore Garrison University- Department of Software Engineering

Lahore Garrison University


Department of Software Engineering
Course Title: Computer Networks

Assessment Rubric for Open Ended Lab

Level of Attainment
Below
Criterion Average Good Very Good Excellent
Average
(1) (2) (3) (4)
(0)
Did not try to Tried to Partially Completely Completely
understand the understand the understood the understood the understood the
Problem Problem problem problem problem but problem and
Understanding could not was able to
explain it explain it
properly properly
No creative Tried a Some creativity Adopted a Adopted a
effort was seen creative was visible creative creative
Creativity approach approach but approach and
could not was able to
explain it explain it
No Intellectual Tried to show Intellectual Intellectual Intellectual
Intellectual contribution some contribution contribution contribution
Contribution was seen contribution was partially was evident was evident
evident and appreciable
No viability Viability Viability Viability Viability
approach was approach was approach was approach was approach was
Solution
adopted inappropriate appropriate but appropriate and appropriate,
Viability
not convincing convincing convincing and
appreciable

Student’s Name: Roll No.:

Total Score =

Instructor’s Signature:

69 | P a g e

You might also like