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

Cisco Certified Network Associate

Uploaded by

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

Cisco Certified Network Associate

Uploaded by

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

Course: CCNA

Cisco Certified Network Associate (CCNA)

Student: ISHAQ AHMAD ([email protected])


Teacher’s: KASHIF + Muhammad Zubair
Location: Corvit Lahore (14-C-III, Gulberg III)
Starting Date: 19th September, 2010

CCNA 640-802

CCNA Wireless CCNA Voice 640-460 CCNA Security


640-721 640-553

CCNP CCIP CCVP CCSP

CCIE R & S CCIE Service Provider CCIE Voice CCIE Security

Prepared by: Ishaq Ahmad Corvit Lahore Page 1


Course: CCNA

Lecture no-1
What is a network?
Definition:
Whenever two or more than two devices are connected with each other and
communicate with each other is called a network.

Explanation:
There are two conditions in the network definition. First one the devices must be
connected with each other (I am not only talking about the computers because
the shape of the connected devices may be anything). Second one is
communication between them. If two devices are connected and they are not
able to communicate with each other then it is not a network. For example if you
connect two computers with a water pipeline so they cannot communicate with
each other, it is not a network. You have to remember two things, one we need a
connection and second one to communicate over that connection. Minimum
requirement for a network is to have two devices, because one device cannot
make a network.

Sharing is not a part of the network definition because there is a difference


between communication and sharing. To understands this point let’s take the
following example.

If you connect one hard disk with another hard disk in the same computer and
you have copied data from one hard disk to another and then you plug the
second hard disk into another computer. In this way you have shared one
computer data with another computer but you don’t have a network. Because
there is no communication and no connection. Sharing is done but there is no
networking. Printer sharing, file sharing are the advantages of the network.

Prepared by: Ishaq Ahmad Corvit Lahore Page 2


Course: CCNA

In a network the connected devices must have the ability to communicate with
each other.

OSI Model:
If you want to move data from one place to another place in a network then you
have to do some preparation for this transfer. You have to prepare the data for
movement. There are certain steps or stages to move data from one computer to
another computer in a network which is called OSI layers.

For effective communication to take place the whole process is divided into seven
logical groups which are called seven layers of OSI.

OSI stands for open system interconnection. It is also called ISO OSI model means
ISO (international standard organization) develop OSI model in 1970. This
organization defines standards for data communication which consists of seven
steps. These seven stages or steps are called OSI seven layer model. Every layer
has its own name and functions in this model.

It is a theoretical model it has no physical existence. It does not exist in tangible


form (tangible means you cannot touch it). It means that if you open your
computer and want to find where these layers are laid in my computer you will
see nothing because it is just a concept or process.

Let’s take an example of human preparation. Assume you are data and you want
to go from your home to your office. Now you will perform some preparation
steps to do this. i.e. first of all you will take a bath, change your clothes, take a
breakfast, sit in a car and move towards your office. This whole preparation
process of movement is divided into different steps. Step no 1 is related to taking
bath and changing clothes ,step no 2 is taking breakfast and step no 3 is sitting in
a car. Steps are not necessary for communication process if you don’t divide the
process into steps still communication will be achieved but the reason for dividing
the process into steps is to understand the whole communication or movement
process easily. If I ask that I am taking tea so you will know that it is step no 2 and

Prepared by: Ishaq Ahmad Corvit Lahore Page 3


Course: CCNA

if I talk about bath so it is step 1, now you cannot touch physically these steps you
can only know functions related to each step.

Similarly, in order to understand the data communication the whole process is


divided into seven layers of OSI model. If someone ask a question that without
layers communication is possible or not so the answer is yes communication is
possible because communication does not depend on layers. It is only the effort
of ISO to divide the communication process in steps in order to define standards.
Layers only simplify the communication process it is not adding or removing
something in the communication process.

Name and order of the OSI seven layers are:

Layer-1 Physical layer

Layer-2 Data link layer

Layer-3 Network layer

Layer-4 Transport layer

Layer-5 Session layer

Layer-6 Presentation layer

Layer-7 Application layer

You must remember name of OSI layers in proper order.

Prepared by: Ishaq Ahmad Corvit Lahore Page 4


Course: CCNA

Lecture no-2

Why OSI Model?


A question arises that what is the advantage or purpose of introducing OSI layers.
So the answer is to make the complex data communication procedure
manageable and understandable and to simplify teaching and learning.

What is Peer to Peer Communication?


Peer means at the same level in which there is no senior junior concept. If you
take the example of university, so your classmates are your peer but your senior’s
or junior’s are not your peer. When two devices are connected and they are
communicating with each other in a layered model approach so that
communication is always peer to peer.

Data movement will start from the application layer of the sending device.
Application layer is step no 1 for the sending device and data will leave the sender
computer at physical layer. The receiver computer will receive the data on the
physical layer. The receiver computer physical layer will perform all the
operations in reverse of their corresponding sender physical layer and will present
data to the data link layer. Now data link layer will perform opposite operations
on the data of their corresponding sender data link layer.

There are two important things to note in this process. First one the complete
opposite operation is done with the data on the other side. It means that each
layer perform an exact opposite operation on the data on the opposite side that is
why it is called peer to peer communication. Receiver side Data link layer undo
the work of sender side Data link layer. Similarly physical layer, transport layer,
network layer etc can undo only their corresponding layers data. It is not possible
that data link layer of receiver side will undo transport layer data from the sender
side. Second one every layer communicates with the same layer on the other
side.

Prepared by: Ishaq Ahmad Corvit Lahore Page 5


Course: CCNA

In order to evaluate the concept of peer to peer communication let us take an


example of a letter.

If a person wants to send a letter to his friend. The letter is not simply thrown in
the post office; a number of other things will be performed with that letter.
Similarly application layer handover the letter to the presentation layer, the
presentation layer will attach its own cover to the letter and pass it to the session
layer, the session layer will attach its own cover over the letter and will pass and
so on. Remember only the physical layer not attach any cover to the letter. It
passes the letter as it is received from the data link layer; frankly you can say
physical layer is an illiterate which cannot write something on the cover of the
letter. Physical layer does not include data in an envelope like other layers.

Data link layer write instructions on both sides over the envelope. In short from
the sending side every layer has written its own instructions over the envelope
except physical layer and data link layer wrote on both side.

On the receiver side the envelope is taken by the physical layer and pass it to the
data link layer. Data link layer remove its envelope from the letter inserted by
data link layer of the sending side and pass it to the network layer and so on.
Application layer receive the original letter and display it to the user on the
monitor.

In data communication process the envelope is actually headers that are attached
by each layer to the data and information is stored inside header. Every layer
attaches its own header with the data then passes it to other layer. Physical layer
do not attach any header with a data while data link layer attach header as well as
trailer with the data.

Top most three layers (application, presentation and session) are of the software
developer interests, means programmers most often deal with these layers. The
bottom four layers (transport, network, data link and physical) are of the network
administrator’s interest. Therefore being a network professional we mostly
concentrate on these four layers and the behavior of data on these layers. That is
why the top three layers can be combinedly treated as an application layer. When
Prepared by: Ishaq Ahmad Corvit Lahore Page 6
Course: CCNA

the data unit is ready on the transport layer then it is called segment. When the
network layer attaches its header and prepares a data unit then it is called packet.
When data link layer attaches its header and trailer and prepares a data unit then
it is called frame. Physical layer does not attach any header it only convert frame
into bits.

Peer to peer communication is the concept by which every layer on a computer


communicates only with its peer layer on the other computer.

Transport layer exchanges segments with each other, network layer exchanges
packets with each other, data link layer exchanges frame with each other and
physical layer exchanges bits with each other during communication.

Data gram is the second name of the packet.

Presentation layer data consists of actual data plus application layer header and
session layer data is actual data plus application layer header plus presentation
layer header.

Encapsulation and Decapsulation:


The process of attaching header with a data is called data encapsulation. On the
receiving side removing of headers from the data is called decapsulation.

Application Layer:
Application layer is responsible for receiving data from the user and converting it
into a form acceptable for the network. Inherently computer applications (word,
excel, access, games etc) were built to work on a single pc. In order to make these
application programs to work on a network plug in were added to it. But now a
day’s these application programs come with networking capabilities.

Presentation Layer:
Presentation layer is responsible for converting the data unit received from the
application layer in a form that is moved over the network. For example if you

Prepared by: Ishaq Ahmad Corvit Lahore Page 7


Course: CCNA

type your email in English. In a network this email cannot be moved in English. It
must be converted into binary form (0 and 1).

If the sending side presentation layer converts ‘A’ into 1100 and at the receiving
side presentation layer converts 1100 into ‘B’ then the user will not understand
anything. So it is necessary that the sending side presentation layer dictionary is
identical to receiving side presentation dictionary. The dictionary which is used for
this conversion is called ASCII (American Standard Code for Information
Interchange). In ASCII there is a code for each character on the keyboard. But if
you want to exchange some pictures on an internet then there are no ASCII
characters for pictures in presentation layer. For this you need another dictionary
which converts picture into binary and on the receiving side binary into picture.
These dictionaries are called JPEG, GIF etc which converts your pictures into
binary and vice versa. Similarly MP3, MIDI and WAV are audio standards that
converts audio into binary and vice versa. AVI and MPEG etc are video standards
that converts video into binary and vice

Session Layer:
Session layer is responsible for establishing a session (formal understanding)
between two computers that I want to get some data from you are you ready for
that? It monitors the communication inside that session and when the
communication reach to an end then it terminate the session.

When you click on a hyperlink then how you know that session is established you
will see this information on the status bar of the browser which will show that
page is opening means session is established and your work is in progress.

And when the session is terminated then the status bar shows done. Browser is
the software in which you will get the functionalities of application, presentation
and session layers.

Note:

Prepared by: Ishaq Ahmad Corvit Lahore Page 8


Course: CCNA

As we discussed that presentation layer is responsible for converting image,


audio or video into binary form but we also know that physical layer is responsible
for converting into bits. So what is the difference b/w these two.

The answer is that presentation layer perform binary conversion and physical
layer receive data in binary form but it gives physical shape to these bit depending
upon the medium. If the medium is copper then physical layer convert it into
voltages, if the medium is fiber then it convert these bits into light and if the
medium is wireless then it converts these bits into waves.

Lecture no-3

Protocols:
Protocols are responsible for defining the rules and regulations for operating the
functions of any particular layer. Or protocol is a set of rules and regulations or a
method for performing the functions of any particular layer. If you take the
example of driving a car, so there are different methods for driving a car by
different persons and these methods are called protocols.

Similarly in OSI model each layer has its own protocols, like HTTP (web protocol),
FTP (File Transfer Protocol), SNMP (Simple Network Management Protocol), SMTP
(Simple Mail Transfer Protocol), POP3 (Post Office Protocol version 3) etc are
application layer protocols.

Transport layer protocols are TCP (Transmission Control Protocol), UDP (User
Data Gram Protocol) and SPX (Sequence Packet Exchange (it’s a Novell company
protocol)).

Network layer protocols are IP, IPX and Apple Talk. IP works with transport layer
TCP and UDP protocols. IPX is related to SPX on the transport layer. Apple Talk is
an Apple company protocol and it can work with any protocol on a transport
layer.

Prepared by: Ishaq Ahmad Corvit Lahore Page 9


Course: CCNA

In our daily life multiple methods are available to perform the same task. For
example to prepare a tea, one method is to boil the water first then add sugar
and then add milk, second method is to boil water and milk first then add sugar,
third method first add sugar in water boil it then add milk etc…So the same task is
performed by multiple methods you can select any method.

In OSI model multiple protocols can be run on side by side in one layer. It means
that multiple protocols can work together.

Application layer protocols are not the replacement of each other because each
protocol has its own function we cannot use ftp instead of http. But transport
layer protocols are the replacement of each other. Every protocol has its own
header that he attaches to the data. It means that the header on each layer is
dependent on the protocol running on that layer. That is why the data unit got
another name PDU (Protocol Data Unit) because the header is attached to the
data by the instructions of the protocol.

We can say that the transport layer PDU can be made by TCP or UDP or SPX which
is then called TCP segment or UDP segment or SPX segment.

First we have discussed in OSI Model that what functions will be performed
(layers), and then we talked about how these functions will be performed
(protocols) and who will perform these functions according to protocols are the
software’s.

For example if I write a book how to drive a car it is a protocol. Now driver will
drive the car according to the book, he is software. Similarly Internet Explorer or
Netscape Communicator is the software of http and CuteFtp is the software of
FTP. Microsoft outlook is the software of SMTP.

Above are the protocols and software’s of the application layer now what will be
the software’s for the network layer and transport layer protocols. The answer is
operating system is responsible for performing the tasks of the network and
transport layer protocols. Protocols are not software it is just a theory and to
make this theory practical we use the software’s.

Prepared by: Ishaq Ahmad Corvit Lahore Page 10


Course: CCNA

Transport Layer:
Transport layer is a forth layer which ensures end to end safe data delivery.

For example if we want to deliver a truck full of bottle’s to Islamabad then how
we ensure that the truck is reached safely to its destination, normally a person is
seated at the top of the truck which ensure that the bottle’s are reached safely
actually he is performing the job of transport layer. Also note this point that the
person on the top of the truck has no concern with a rout followed by the truck.
Similarly transport layer has no concern with the path followed by the data to
reach its destination it only check whether the data is reached safely or not.

Now let see the functions of the transport layer which ensure end to end delivery.

First of all transport layer at the sender side attach a port number (it’s logical or
software port number not like hardware ports on your computer) with every
application so that it can communicate with the correct application on the
receiver side. Secondly transport layer divide each application data into small
pieces called segments and send segments of different application to the
destination. It is due to the port numbers that each segment is delivered to its
corresponding application at the receiver side. For example port 80 is used for
http when you download something so the computer knows that I will open this
data in the browser because with each segment port 80 is attached.

Note:

A question arises that if multiple windows of the same application is opened then
how it will differentiate among windows. So the answer is that when you open
multiple windows of the same application they cannot differentiate on the basis
of port numbers rather they can be differentiated by session ids. When you click
on link so a session is created and proper id is assigned to that session by the
computer, when data comes from the computer then it is sent to that window for
which this session is created. Session ids are assigned with data at session layer.
In one window only one session can be created there is no possibility of multiple
sessions in the same window.

Prepared by: Ishaq Ahmad Corvit Lahore Page 11


Course: CCNA

Lecture no-4

Transport layer perform connection oriented communication. It means that


sending device first establish a connection with a receiver after that it starts
communication. For example if you want to call someone, you first dial his
number means you are establishing a connection and then you talk. Telephone
communication is also connection oriented. The concept is similar to session
layer. Application establishes a session on its own part at session layer and
network establishes a connection on its own part on a transport layer.

Another important function performed by the transport layer is flow control. It


means to control speed of data between sender and receiver. A problem occurs if
the speed of sender device is more than the speed of receiver device. Data is
stored in the buffer of the receiving device if the speed of processing data of the
receiver computer buffer is slow than the speed of sending device buffer then
after some time data lost will be started.

To avoid this problem either we will increase the speed of receiver device (by
changing hardware) or we will decrease the speed of a sender device. In the
second case the receiver will receive data until its buffer is full then he send a stop
signal to the sender. When he process the data then he send a ready signal to the
sender and communication resume.

Transport layer also ensures reliable delivery, now how it ensures reliable delivery
for this you have to know two concepts. i.e. windowing and acknowledgment.

When the sender receives a receipt of the successful delivery from the receiver it
is called acknowledgment. In this case only one segment is sent to the destination
and then waits for acknowledgment.

But in order to increase the speed we use windowing in which multiple segments
are combined and sent it to the destination and then wait for a single

Prepared by: Ishaq Ahmad Corvit Lahore Page 12


Course: CCNA

acknowledgement in response to the whole window then send another window


of segments and so on.

Maximum number of un-acknowledged segments at a time is called window size.

When the sender send segment 1, 2 and 3 then receiver will send acknowledge 4
means that I have received up to 3 segments now you will send segment 4.

Now the question is that in which situation the window size be increased or
decreased. The answer is window size depends upon the reliability of the
medium, if the medium is reliable then sender and receiver can increase the
window size and if un reliable then they can decrease it. If one segment is missed
then it is recovered using the selective repeat algorithm now days in the transport
layer. Selective repeat means only send those segments which are missed rather
than sending the whole window.

Sender and receiver wait for each other response for a specific amount of time
which is called time out. When this time out completes then always the sender
retransmit not the receiver.

Lecture no-5

Note: To understand the concept of data link layer and physical layer, first we
discuss two other concepts i.e. LAN and WAN.

LAN stands for Local Area Network and WAN stands for Wide Area Network.
Generally if a communication is taking place with in a building or campus it is
called LAN. if communication is taking place between two remote places then it is
called WAN. These two definitions are the general concepts of LAN and WAN. But
technical definition of LAN and WAN is not concern about the geographical
locations rather it consider the technologies you are using.

There are different technologies for LAN and WAN. For example if two persons
are communicating with each other and they are sitting in different parts of the
world but they are using the LAN technologies then this is called LAN
communication. If two persons are sitting side by side and they are using WAN

Prepared by: Ishaq Ahmad Corvit Lahore Page 13


Course: CCNA

technology for communication with each other then it is called WAN


communication. Being a technical person categorizing LAN and WAN on the basis
of distance is not always applicable.

LAN and WAN concepts are associated to data link layer and physical layer.
Because the technologies used by LAN and WAN are working on data link and
physical layers. Lets first look LAN technologies:

Ethernet, 802.3, 802.5 and FIDDI are LAN technologies. If you use any of these
technologies for communication then we said that we are communicating in a
LAN. If you are using Ethernet and the distance between communicating devices
is more than 100 km still it is LAN communication. If you compare Ethernet with
802.3, 802.5 and FIDDI then you will see that Ethernet completely performing the
functions of both data link and physical layer. It means that Ethernet covers
physical and data link layers but 802.3, 802.5 and FIDDI covers all the functions of
physical layer but some of the data link layer. The remaining functions are then
covered by the help of 802.2 while Ethernet is alone performing functions of both
layers. 802.3 and 802.2 will work together to perform functions of both layers,
similarly 802.5 and 802.2 will work together to do both layers functions and same
is the case with FIDDI.

FIDDI stands for Fiber Distributed Data Interface. Ethernet is defined as a standard
by a company in 1970 for data communication. After some time IEEE was
established. IEEE (Institute of Electrical and Electronic Engineers) defines
standards of communication related to electrical and electronic concepts all over
the world. Therefore IEEE has taken the responsibility of defining standards and
established a committee for this purpose in February 1980. Since the committee
started its work in the second month of 1980 that is why it is given a name 802.
80 means 1980 and 2 means second month of 1980. This committee introduces
further committees for defining different standards which is named as 802.1,
802.2, 802.3 etc. the committee 802.3 defined a standard for LAN communication
for which they took Ethernet as a base and did very minimal changes and called it
802.3 that is why 802.3 is very similar to Ethernet but Ethernet is a proprietary
standard while 802.3 is an open standard of IEEE that can be used any company

Prepared by: Ishaq Ahmad Corvit Lahore Page 14


Course: CCNA

like CISCO, Microsoft and Dell etc they can follow this standard for making
hardware’s for layer 1 and layer 2. IBM Company has also defined its standard for
LAN communication which is known as Token Ring. IEEE has taken Token Ring and
with very few modifications, they introduced 802.5 standards. That is why it is
very similar to the IBM Token Ring. FIDDI standard is developed by IEEE itself. The
most popular standard for LAN communication is 802.3 which work together with
802.2 but now a day it is named as Ethernet. Actually it is 802.3 with the name of
Ethernet. Because there is no Ethernet implementation in the world at this time.

Lecture no-6
Some where you will study that Ethernet or 802.3 is standard and in some places
you will study that it is a protocol. Now what is the difference between standard
and protocol? Protocol is that standard for which you will need software to
implement while for standard software is not necessary. In other words in
physical layer no header is attached with the data and attaching header to the
data is the responsibility of protocols so it means that there are no protocols in
physical layer, they are called standard. Every protocol is a standard but every
standard is not a protocol. Remember that the set of rules and regulations for
physical layer is called standard while on upper layers these standards are called
protocols. Because to implement the physical layer rules and regulations we need
hardware not software.

Now let’s talk about WAN. In WAN the protocols for data link layer and physical
layer is completely different from LAN. There is no protocol in WAN that operates
both on physical layer and data link layer. Each layer protocols are totally
different from other. WAN data link layer protocols are SDLC (Synchronous Data
Link Control protocol), HDLC (High Level Data Link Control Protocol), Frame Relay,
ISDN (Integrated Services Digital Network), and PPP (Point to Point Protocol).

Physical layer WAN standards are XV.35, V.24, V.703 etc… you can take any
standard of the physical layer and you can combine it with any protocol in the
data link layer they will work together which is opposite to the LAN.

Prepared by: Ishaq Ahmad Corvit Lahore Page 15


Course: CCNA

Data Link Layer and Physical Layer:


Before going to discuss data link layer we revise some concepts about data link
layer. Data link layer number in a sequence is 2 and PDU on a data link layer is
called frame. Data link layer is different from other layers in sense it attaches
header as well as trailer with the data. There are a lot of functions to perform on
data link layer in case of LAN. In LAN environment the data link layer is divided
into two sub layers i.e. MAC (Media Access Control) sub layer and LLC (Logical Link
Control) sub layer. MAC sub layer is very close to physical layer while LLC sub
layer is close to network layer. Physical layer is hardware layer and network layer
is software layer that is why MAC sub layer is more related to hardware functions
of data link layer and LLC sub layer is more related to software functions of data
link layer. LLC sub layer make the upper layer software independent of the lower
layer hardware. Drivers for the hardware’s are actually working on the LLC sub
layer.

Summarize the whole story of the layered approach, first of all you purchase a
hardware; it comes in physical or data link layer now you have added the
functionalities of network layer and transport layer by installing operating system
now you need to get functionalities above transport layer for which you will
install applications (word, browser, games etc) and for lower layers you will install
drivers. Drivers provide a link between the data link layer and network layer.

Addressing Schemes:

Identification is important for communication. If you want to communicate over a


network then you will need addressing scheme. There can be two types of
addressing one type will occur in the MAC sub layer of the data link layer and the
other will occur on the network layer.

Data link layer addresses are called physical addresses and network layer
addresses are called logical addresses. There is a sequence or logic in the logical
addresses while there is no sequence or logic in the physical address. Physical
address is also called MAC address. It is also called Ethernet address it is
electrically burned inside a chip in an Ethernet card.
Prepared by: Ishaq Ahmad Corvit Lahore Page 16
Course: CCNA

Logical addresses can also be called IP address. It depends on the protocols


running on the network layer. If IP is running then it is called IP address, if IPX
running then it is called IPX address and if Apple Talk is running then it is called
Apple Talk address.

Structure of MAC Address:

Let’s take a look of the structure of MAC address. These are 48 bit addresses and
they are represented in the form of hexa decimal notation. Hexa decimal digits
are a number system in which one hexa decimal character represents 4 binary
digits. Therefore 48 binary digits are represented in 12 hexa decimal digits.

This address is divided into two parts 24 bits on one side and 24 bits on another
side. The left side 24 bits are called vendor code and the right side 24 bits are
called serial number. If a company wants to make LAN cards it will request to the
IEEE to assign me a vendor code. IEEE will give one combination of 24 bits to this
company. MAC addresses can never be repeated because vender code is unique
for each manufacturer.

How the communication take place on LAN:

The traffic that moves over the network will check the existence of receiver on
the basis of IP address and reaches to that network. Once it reaches to the
network then it checks the MAC address and communicates with them on the
basis of MAC address. IP addresses are used to find out MAC addresses; once
MAC addresses are known then communication is done through MAC address in a
network.

One question is why we are not communicating only on IP address; what is the
purpose of finding out MAC address. The answer is that IP addresses are
processed on network layer then every message will go to the network layer and
get processed it will waste time of computer. So using the MAC address the
processing of the message will be performed on data link layer which speed up
the communication and it will stop wasting of resources of other computers.
Prepared by: Ishaq Ahmad Corvit Lahore Page 17
Course: CCNA

Address Resolution Protocol (ARP):

The process of finding MAC addresses on the basis of IP addresses is called


Address Resolution Protocol (ARP). Once you get MAC address it will be stored in
a table called ARP table or ARP cache. ARP table does not store MAC addresses
permanently. After a specific amount of time these addresses are removed if no
communication is performed. For example CISCO router will store only for 4 hours
in the table if no communication is done with that computer then the entry is
removed from the table. This time depends on the operating system.

Lecture no-7

Behavior of MAC address and IP address when communicating devices are in


different networks:

The device which interconnects different networks is called Router. Now let
suppose one network is connected with one interface of the router and another
network is connected with another interface of the router. Since both interfaces
of a router are connected with computers therefore you have to give IP and MAC
addresses to these two interfaces. Suppose one interface name is e0 and another
interface name is e1. It is not necessary that a router has only two interfaces it
can have thousands interfaces depends upon the model. Now suppose IP
addresses from 1 to 50 are assigned to computers at left hand side network and
from 51 to 100 are assigned to the network at right hand side. If a computer from
left hand side wants to communicate with computer having IP address 75 at right
hand side. First of all this computer will send a request to 75 to give me your MAC
address now in his network no one will give him reply because no one IP
addresses is matched with the requested IP. Now router being an intelligent
device knows that 75 IP address belongs to right side network. Therefore on
behalf of that compute router sends its own MAC address to this computer. Now
this computer will store MAC address of router and start communication. Next
time when this computer send a message to 75 all computer will check this
message on data link layer only router will accept this message because MAC
address is matched with router and router will pass it to the network layer.

Prepared by: Ishaq Ahmad Corvit Lahore Page 18


Course: CCNA

Network layer check it’s IP, it is 75 the router understand that this computer
wants to send this message to some other computer via me. Therefore it route
this packet on interface e1 but before routing router will generate an ARP request
to 75 that send me your MAC address. After receiving MAC address of 75 router
remove its own MAC address from the table and store computer 75 MAC address.
Router changes source and destination MAC addresses while IP addresses
remains the same. Now if another computer on left hand side wants to
communicate with computer IP address 75 at right hand side. Again a message
will be generated by this computer asking from computer 75 MAC address. This
time router knows MAC address of 75 but he will not give why? Because if he
gives MAC of 75 then next time left side computer send a message with MAC of
75 and in left side network no one along with router will accept this message
because no one MAC is matched with it.

The process of finding MAC address across network is called Proxy ARP. The
disadvantage of proxy ARP is that you will generate new ARP request for every
destination. Now if the same computer wants to communicate hundred
computers at right side so he will generate ARP request and every time he
receives router interface MAC address, instead why not tell to this computer only
once if you want to communicate with a computer outside of your network then
use this MAC which is now days called default gateway. Gateway means the way
to go out.

Now let’s discuss Ethernet as LAN technology. Ethernet is working on both


physical and data link layers. First we see the functions Ethernet perform on
physical layer. In a physical layer it defines what will be the arrangement of
computers, which cables will be used, how cables will be used what will be the
maximum length of the cables and what will be the speed of data over these
cables, how connectors will be used with cables and what will be the shape of
signals. It’s the responsibility of Ethernet to answer all these questions.

In case of Ethernet the arrangement of computers can be of two types or you can
say that two topologies of Ethernet are possible. Topology means physical
arrangement of things. One is called Bus topology and the other is called Star

Prepared by: Ishaq Ahmad Corvit Lahore Page 19


Course: CCNA

topology. In bus topology with one main cable all the computers are attached in
different locations. In star topology all the computers are attached with a central
device called Hub.

Bus topology is an old topology which is rarely used in the world at this time.
Ethernet answer first question arrangements of computer on physical layer in the
form bus topology.

Second question which cables will be used so in bus topology coaxial cables are
used. There are further two types of coaxial cable one is called thin net coaxial
cable and thick net coaxial cable. Thin net cable has a technical name 10 base 2
and thick net cable technical name is 10 base 5.

Third question is which connectors are used? So the answer is in bus topology
BNC, T Junction and terminator connectors are used.

Forth question is distance of cables the answer is hidden in the technical name of
10 base 2. In this 10 means the data will travel on the cable with 10 mega bits
per second 2 means 200 meters it means that a maximum distance between two
computers can be 200 meters approximately and 185 meters exactly in case of
bus topology. Base means base band signaling. Signaling can be base band or
broad band. The difference is if the signal is generated on the frequency and it is
also transmitted on the same frequency then we say that base band signaling is
done. But when the generated frequency of the signal is changed during
transmitting then it is called broad band signaling. In case of 10 base 5, data
speed is 10 mega bits per second, distance is 500 meters and signaling is base
band. Now we will discuss another topology of Ethernet which is star topology.

Star topology will also give answer to all these questions that answered by bus.
Twisted pair cable is used in star topology. Inside this 4 pairs or 8 wires are there.
This cable is called UTP (Unshielded Twisted Pair cable). Technical name of this
cable is 10 base T where T stands for twisted pair. Distance limitation for this is
100 meters and this distance is between computer and hub. RJ 45 connector is
used in twisted pair cables.

Prepared by: Ishaq Ahmad Corvit Lahore Page 20


Course: CCNA

Lecture no-8

Now let see logical communication of devices on the Ethernet means behavior of
Ethernet on data link layer. For example computer A, B, C, and D are connected to
the Ethernet. Computer A wants to communicate with computer D for this
computer A send a message to computer D but this message is available to B and
C also because it is the nature of Ethernet. Only computer D accepts this message
while B and C will reject this. If we talk about the nature of the network so the
nature of Ethernet is that when we talk with one computer all other computers
will listen this and it is called broadcast nature. Because of the broad cast nature
of the Ethernet whenever we talk to one computer the voice or data reaches to
all other computers. It is clear from this that your medium can have different
types and your messages can be of different types.

There can be three types of messages. One is unicast second one is multicast and
third one is broadcast.

A message for only one person is called unicast message but the medium through
which this a message sent is broad cast.

A message for all persons in a network is called broadcast message.

A message for a group of people in a network is called multicast message.

If all the bits in a MAC address become zero then it is called broadcast address.

Now you require a medium or media to send message, Ethernet is one of the
medium which is by nature broadcast. Another medium is point to point in which
only two devices are connected and can communicate. Every medium is suitable
for different types of communication. If want to do broad cast communication
then Ethernet is more suitable for it. But you can use Ethernet for other types of
communication also.

Prepared by: Ishaq Ahmad Corvit Lahore Page 21


Course: CCNA

Error detection is one of the functions of data link layer for which FCS (Frame
Check Sequence) is used. FCS uses CRC (Cyclic Redundancy Check) method for
error detection because FCS is a generic name.

CSMA/CD (Carrier Sense Multiple Access with Collision Detection)

In Ethernet if a computer wants to communicate he will wait until medium is free


by sensing the medium because one computer can communicate at one time. But
a situation occur if multiple computers sensing the medium and when medium
become free then all send data at one time in this case collision will occur. At this
point these computers will backup and send jam signals on the medium that no
other will communicate because collision occurred and these two computers will
start timer independent of each other. That computer will communicate first
whose timer expires first. This whole process is called CSMA/CD (Carrier Sense
Multiple Access with Collision Detection). It is a logical communication which is
available on the MAC sub layer of the data link layer.

Physical layer number in OSI model is 1. It is different from other layers in a sense
it does not attach any header with the data.

Network Layer:
Network layer is the third one layer whose important work is to find the path in a
network. It selects best path in a network to reach the destination. Network layer
must use some addressing scheme for path selection.

The protocol which tells the method to perform the functions of network layer
provides this addressing scheme. IP use its own addressing scheme, IPX will use its
own and Apple Talk will use its own addressing scheme.

There are two portions in the network layer addressing one is host portion and
other is network portion. Network portion represent the network while node or
host portion address different computers in that network.

For example if I want to go 525 shadman so in this address network portion is


shadman and host portion is 525.

Prepared by: Ishaq Ahmad Corvit Lahore Page 22


Course: CCNA

Routing is always done on the basis of network portion of the destination IP


address. Within one network all the computers have same network portion but
different host portion.

Routing is always done on the next hop basis. It means that when router receives
a packet it forward this packet to next router.

Packets for unknown destination are discarded by the router. It means that if a
router does not know the destination of a received packet then he discards the
packet.

On a network layer two types of protocols can occur one is routing protocols
other is routed protocols.

Routing verses Routed Protocols

Routing protocols select best path in a network to the destination while routed
protocols is responsible for delivery of packets over that best path selected by
routing protocols to destination.

RIP (Routing Information Protocol), IGRP (Interior Gateway Routing Protocol),


EIGRP (Enhanced Interior Gateway Routing Protocol), ISIS (Intermediate System to
Intermediate System), OSPF (Open Shortest Path First) and BGP (Border Gateway
Protocol) are the examples of routing protocols.

IP, IPX and Apple Talk are the examples of routed protocols.

Routing protocols stores all these latest information of best paths in a table called
routing table. Routing protocols only runs between routers while routed protocols
runs on router as well as on computers.

Lecture no-9

Different Routed protocols can run on the same infrastructure, means that IP, IPX
and Apple Talk can use the same routers to reach its destination it is called Multi
protocol routing. That is multiple protocols share the same network
infrastructure.

Prepared by: Ishaq Ahmad Corvit Lahore Page 23


Course: CCNA

Static Routing and Dynamic Routing

Routing table can be populated by two ways.

One is the administrator enters routes information in the routing table which is
called static routes and the process is called static routing.

Second one is routing protocols stores information of routes in the routing table
which is called dynamic routes and the process is called dynamic routing.

Static routing is given a name static because in this case the data cannot adopt
alternatives with the changing situation. But in case of dynamic routing data can
change its decision with the changing situation.

The disadvantage of dynamic routing is the overhead (extra load) of routing


protocols that works as a spy for router. It also increases overhead on router
because routing protocols brings the information then router perform
calculations and take best path decision while in case of static routing all these
decisions are taken by administrator.

In some situations dynamic routing will give no advantage over static routing. This
situation occurs when there is only one path to the destination then it is better to
use static routing instead of dynamic.

According to third principle of routing when router receives a packet for which
there is no destination available in the routing table then instead of discarding it
another route is used which is called default rout and the process is called default
routing.

Now third principle become like this, in the absence of default route the router
will discard packets for unknown destination. But still there is no possibility that
the packet will reach to its destination. For example if router A default rout is
router B and the default rout of router B is router A then they will send this
packet to each other again and again which is called routing loop.

For example Corvit has a network in Lahore, Karachi and Islamabad and they are
connected with each other. Every router in Corvit network knows about his
Prepared by: Ishaq Ahmad Corvit Lahore Page 24
Course: CCNA

network. If a packet with unknown destination is received. First router will check
its destination in its own network if not found then he will forward this packet to
the default rout means to the gateway which is connected to the cyber ISP router.
Now cyber network router will check this destination in its own network if not
found then he will forward it to his default route which is PTCL router from whom
cyber ISP takes internet bandwidth. Now PTCL router will check the destination in
its own customer’s network if not found then he will forward this packet on his
default route which is Etisalat router. They are backbone router which knows
about every network in the world if there is not found the destination of this
packet then it means that this destination does not exist.

How the router knows that it is a best path?

Router decide best path selection on a criteria called Metric or you can say that
metric is that criteria on the basis of which best path selection can be done.

Every protocol has its own metrics. There are different metrics.

1. Hop count: - It counts number of routers that comes in a path from source
to destination. RIP protocol uses hop count as it’s metric. Hop count only
gives information about number of routers in a way. Hop count is not an
intelligent metric therefore RIP is not an intelligent protocol. For example if
two paths are available from source to destination and both have two
routers in a way now the hop count is two. But one way has bandwidth 56
kbps and the other is 1024 kbps now RIP considers both paths equal and
send half traffic on one path and half on another which is not a good
decision.
2. Cost: - Cost is another metric which perform best path selection on the
basis of bandwidth. OSPF protocol uses cost as it’s metric.
IGRP and EIGRP can use five metrics for best path selection. They are
bandwidth, delay (indirectly it also gives information about number of
routers in a way), reliability (it gives information that which path is more
reliable), load (it tells how much load on each path) and MTU (Maximum

Prepared by: Ishaq Ahmad Corvit Lahore Page 25


Course: CCNA

Transmission Unit). By default IGRP and EIGRP gives information about


bandwidth and delay.

Classes of Routing Protocols

Generally there are two classes of routing protocols one is called Distance Vector
Routing Protocols and the other one is called Link State Routing Protocols.

Another category can also be used which is called Hybrid Routing Protocols.

RIP and IGRP are the examples of distance vector routing protocols. OSPF and ISIS
are the examples of link state protocols. EIGRP comes in a category of hybrid
routing protocols.

If two protocols are running on a router then how the router will decide to
process which one protocol for best path. There is also a metric for protocol
selection which is called Administrative Distance. It is simply a number which is
assigned to each protocol by CISCO. Lower the administrative number the more
desirable protocol. The administrative distance of RIP is 120, ISIS has 115, OSFP
has 110, IGRP has 100, EIGRP has 90, BGP has 20, Static rout has 1 and directly
connected has 0.

IGRP and EIGRP are CISCO proprietary protocols they can only support CISCO
routers.

Convergence means when the network becomes stable. When there is a change
in the topology of a network i.e. when a link fails, first this information reaches to
the router close to this point then he advertise this change to all the other routers
(that don’t send traffic on this route) through which the network become stable
again which is called converge network. Convergence time means the time from
the link failure to stability. So the convergence time should be as low as possible.

Generally convergence time depends on two things. One is routing protocols,


each protocol has its own convergence time and second one is size of the
network.

Prepared by: Ishaq Ahmad Corvit Lahore Page 26


Course: CCNA

Generally speaking the convergence time of the distance vector protocol is more
while link state protocol has less convergence time.

In large network normally link state protocols are used while in small network link
state as well as distance vector protocols can be used.

Hybrid routing protocol has a very good convergence time but it is only works on
CISCO.

Lecturer no-10

IP Addressing

Connectivity of devices cannot complete the definition of networking because the


network definition is the connectivity of two or more devices so that they can
communicate with each other. Therefore first thing for the communication after
the connectivity of devices is the addressing scheme. For communication devices
follow some addressing scheme. Devices follow three addressing scheme for
communication.

1. IP addresses
2. MAC addresses
3. Port addresses

IP addressing: IP addresses are the logical addresses it means that these are
changeable addresses. It depends on the network administrator because he can
change it. There are two versions of IP addressing one is IPv4 and the other is
IPv6. Length of IPv4 is 32 bits while the length of IPv6 is 128 bits. If you want to
find out the total number of IP address in IPv4 then you can calculate this as 2 32 =?
Addresses in IPv4 scheme is almost near to finish that is why IPv6 comes and the
total number of address in IPv6 can be found as 2128 =?

There are 4 octets in IPv4 address where octets mean 8 bits. It means 8 bits + 8
bits + 8 bits + 8 bits = 32 bits. For example 10.1.0.100 in this address each octet is
separated by dot (.) there are two portions of IP addresses.
Prepared by: Ishaq Ahmad Corvit Lahore Page 27
Course: CCNA

1. Network portion: This portion identifies your particular network in which


you are working.
2. Host portion: This portion of IP address identifies each machine in the
particular network.

The daily life example of the network portion and host portion is the telephone
number i.e 042-111222 or 051-3452356 in which 042 is a city code (network ID)
which identifies that it is Lahore city network and 051 is a city code (network ID)
which represents Islamabad city network while 111222 identify a particular phone
number (host) in Lahore city and 3452356 represents a unique phone number
(host) in Islamabad city.

The IP address of each computer over the internet must be unique. For example if
I have a computer in Lahore branch network with the IP address 10.1.1.1 and also
another computer in London brand network with the IP address 10.1.1.1 and both
request for yahoo page then the yahoo server will be confused to which one IP
address reply because of the conflict. In order to well manage IP addresses
without any conflict they are divided into different classes by IANA (Internet
Assigning Number Authority). There are five classes of IP addresses.

Classes of IP addresses

Class A: 1-126

Class B 128-191

Class C 192-223

Class D 224-239

Class E 240-255

Note: if you want to find out class from a given IP address then check first octet of
the IP address and match their value to the above class ranges.

127 is the reserved IP address which is used for loop back testing. It is not used
for communication rather it is used to test your own machine that is able for

Prepared by: Ishaq Ahmad Corvit Lahore Page 28


Course: CCNA

communication or not. When a machine sends data over the internet then first it
checks whether TCP/IP suit is installed or not because without TCP/IP machine
cannot communicate over the internet. This checking or testing of TCP/IP is called
loopback testing. For loopback testing go the command prompt and type ping
127.1.1.1 if reply is coming then it means that TCP/IP suit is installed on machine.
Conceptually 127 comes in class A range but since it does not use for data
communication purpose that is why it is kept separate from classes range.

Class A, B and C are used for data communication. TCP/IP is a set of protocols or
software or application or programs that enable a machine for communication.
Class D is used for multicasting and class E is used for testing and research
purpose. Casting means to send the information from one to another end over
the network. There are three types of casting.

1. Unicasting: One to one communication is called unicasting.


2. Broadcasting: One to all communication is called broadcasting
3. Multi casting: One to a specific group is called multicasting. It is a special
type of broadcasting. Routing protocols on network layer uses multicast
addressing scheme for sharing information between routers.

In class A there are 8 network bits and 24 host bits. In class B there are 16 bits for
network and also 16 bits for host. In class C network bits are 24 and host bits are
8.

Total networks in Class A: 28= 256

Total number of hosts in each network of Class A: 224=?

Total number of valid IP addresses in each network of Class A: 224 -2=?

Total networks in Class B: 216=?

Total number of hosts in each network of Class B: 216=?

Total number of valid IP addresses in each network of Class B: 2 16 -2=?

Total networks in Class C: 224=?

Prepared by: Ishaq Ahmad Corvit Lahore Page 29


Course: CCNA

Total number of hosts in each network of Class C: 28=256

Total number of valid IP addresses in each network of Class C: 2 8 -2=254

The IP addresses are in decimal format. But the machine only understand binary
format. In binary format when the bit is “0” it means off while “1” represents that
bit is on. The counting of binary bits starts from right side whose initial value is
zero. The following structure show complete representation.

Decimal values: 128 64 32 16 8 4 2 1

Formula: 27 26 25 24 23 22 21 20

Decimal counting: 7 6 5 4 3 2 1 0

Binary bits: 1 0 0 1 1 1 1 1

Add bits which are on to find out decimal value: 128+0+0+16+8+4+2+1 = 159

Examples: IP address in decimal form: 223.191.100.97

The above IP address can be written in binary form as:


11011111.1011111111.01100100.01100001

IP address in decimal form: 212.167.194.239

IP address in binary form: 11010100.10100111.11000010.11101111

Lecture no-11

An IP address which loses its default values in a class is called classless IP


addresses. The default value of class A IP address is 8 network bits and 24 host
bits, default value of Class B IP address consists of 16 network bits and 16 host
bits and default values of Class C IP address is 24 network bits and 8 host bits. If
the network bits in Class A become 9 then it is classless IP address. The decimal
value of each octet cannot exceed than 255 in an IP address. Human being can
decide on the basis of first octet that IP address belongs to which class. But how
the machine knows that this is Class A, B or C IP address? So the answer is subnet
mask, computer identity the address class on the basis of subnet mask. ON all of
Prepared by: Ishaq Ahmad Corvit Lahore Page 30
Course: CCNA

the network bits and OFF the entire host bits in an IP address of any class can
calculate its subnet mask.

Default Subnet Mask of class A: 11111111.00000000. 00000000. 00000000

Decimal value 255.0.0.0

Default Subnet Mask of class B: 11111111. 11111111. 00000000. 00000000

Decimal value 255.255.0.0

Default Subnet Mask of class C: 11111111. 11111111. 11111111. 00000000

Decimal value 255.255.255.0

There are many features of subnet mask. It can be used to calculate the network
ID. If two computers want to communicate with each other first of all they
calculate their network ID. If both the network ID’s are same then they
communicate otherwise they cannot in LAN. The network ID can be calculated by
AND operation between the subnet mask and IP address. For example

IP Address: 10.10.100.1 subnet mask: 255.0.0.0

Convert both into binary form as

IP Address: 00001010.00001010.01100100.00000001

Subnet Mask: 11111111.00000000.00000000.00000000

Now perform AND operation (Multiplication) between IP address and subnet


mask.

00001010.00001010.01100100.00000001

11111111.00000000.00000000.00000000

00001010.00000000.00000000.00000000 = 10.0.0.0 (network id)

Another IP address: 20.10.100.2 subnet mask: 255.0.0.0


Prepared by: Ishaq Ahmad Corvit Lahore Page 31
Course: CCNA

Network id: 20.0.0.0

A question is that can 10.0.0.0 and 20.0.0.0 communicate? So the answer is that
even though both networks belong to Class A but they cannot communicate
because for communication the network ID must be same. By default two
different networks without involving anything can never communicate with each
other. Then another question arises that how a computer with IP address
192.168.0.1 can communicate with www.yahoo.com having IP address
87.248.122.122. The answer is that if you want to communicate between two
different networks then you must use a device called router.

Note: The 1’s and 0’s in the subnet mask must be contiguous.

No one can predict Class of IP address only on the basis of subnet mask. For
example 255.255.255.0 subnet mask does not means that it is class C because it
can also be used for Class B and Class A in Subnetting.

Lecture no-12

The classes can be identified in binary form as

If the first bit of the first octet is “0” then it is called Class A IP address. For
example

0xxxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx

Now in the above example first bit of the first octet is “0” the remaining bits can
be 0 or 1. If the remaining 7 bits of the first octet are 0’s t hen the decimal value
will be 0 and if all the remaining 7 bits of the first octet are 1’s then the decimal
value will be 127. It is the range of Class A in which we cannot use “0” because it
is used for Network ID and 127 is used for loopback testing purpose. In class B
first two bits of the first octet are 10 fixed which is fixed; the remaining 6 bits can
be 1’s or 0’s. For example

10xxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx

Prepared by: Ishaq Ahmad Corvit Lahore Page 32


Course: CCNA

Calculate the decimal value. If the remaining 6 bits of the first octet are 0’s then
the decimal value is 128. If the remaining 6 bits of the first octet are 1’s then the
decimal value becomes 191 which is the range of class B.

Similarly in class C first three bits of the first octet are 110 which are fixed. If the
remaining 5 bits are 0’s then the decimal value become 192 and if all the
remaining 5 bits are 1’s then the decimal value becomes 223. For example

110xxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx

In these classes some addresses are reserved which is called private IP addresses.
Private IP addresses cannot be used over the internet for communication but
these private addresses can be translated into public IP address through NAT so
that a computer with private IP address can communicate over the internet.
Following are the list of private IP addresses in each class

Class A: 10.0.0.0 10.255.255.255 (one Private network in Class A)

Class B: 172.16.0.0 172.31.255.255 (16 private networks in Class B)

Class C: 192.168.0.0 192.168.255.255 (256 private networks in Class C)

There are two types of broad casting on is called local broadcast and the other is
called directed broadcast. Local broadcast (255.255.255.255) is the very last
address in the IP addresses in which all the devices will process the packet.
Directed broadcast is the last address in any network (192.168.1.255) which
represents all hosts in that network. The main difference between them is that
router allow directed broadcast but not local broadcast.

Each network has two reserved addresses; one is network address (means first
address) and the directed broadcast address (means last address). Any address
between these two addresses can be assigned to devices.

Internet Engineering Task Force provide the following short term solutions to the
IPv4 addresses shortage:

 Subnetting

Prepared by: Ishaq Ahmad Corvit Lahore Page 33


Course: CCNA

 Variable Length in Subnetting


 Classless Interdomain routing
 Private IP addresses
 NAT (Network Address Translation)

Subnetting: Subnetting is the process of adding host bits into network bits in
order to make the utilization of IP addresses more efficient and to avoid conflicts
between IP addresses. If you have 500 machines on your network and you
purchased class B address then you are wasting over 65000 IP addresses. To
overcome this deficiency the concept of Subnetting was introduced.

For Subnetting you have to follow some rules or recommendations as follow:

1. First find out you network and host requirements: In this step you will
calculate how many subnets you are required and then in each subnet how
many hosts you need.
2. Use formula: 2x = number of networks you need, where x represent subnet
bits, 2y – 2 = number of hosts on your largest segment where y represents
host bits. In first formula you will borrow bits represented by x from host
portion which is required to create your desired subnets. In the second
formula you will calculate your hosts on each subnet.
3. X+Y<=total number of host bits: It means that in any case the number of
host bits must not increase their maximum range i.e in class A maximum
host bits are 24, in class B maximum host bits are 16 and in class C
maximum host bits are 8.

Example: Corvit has purchased a public IP address 192.168.1.0 for their network.
Now there are 4 branches of Corvit network and each branch contains 50 hosts.
Now follow the following steps one by one as:

1. Network requirements = 4 and host requirements = 50


2. 22 = 4 subnets and 26 – 2 = 64 hosts
3. 2+6 <= 8 hosts bits true in case of class C

Prepared by: Ishaq Ahmad Corvit Lahore Page 34


Course: CCNA

4. IP address 192.168.1.0/26 subnet mask = 255.255.255.192


5. List subnets: For this subtract the mask of sub netted octet from 256 i.e. in
this case 256 – 192 = 64 therefore the subnets are 0, 64, 128 and 192.

Fist subnet: 192.168.1.0 /26

First valid IP address = 192.168.1.1


Last valid IP address = 192.168.1.62
Broad cast IP address = 192.168.1.63

Second subnet: 192.168.1.64 /26

First valid IP address = 192.168.1.65


Last valid IP address = 192.168.1.126
Broad cast IP address = 192.168.1.127

Third subnet: 192.168.1.128 /26

First valid IP address = 192.168.1.129


Last valid IP address = 192.168.1.190
Broad cast IP address = 192.168.1.191

Forth subnet: 192.168.1.192 /26

First valid IP address = 192.168.1.193


Last valid IP address = 192.168.1.254
Broad cast IP address = 192.168.1.255

Assignment-1: IP address = 10.0.0.0 subnet required=9000; host required=560

Assignment-2: IP address = 172.16.0.0 subnet required=490; host required=112

VLSM (Variable Length Subnet Mask): VLSM allows an organization to use more
than one subnet mask within the same network address space. Implementing
VLSM is often called Subnetting a subnet. It can be used to maximize addressing

Prepared by: Ishaq Ahmad Corvit Lahore Page 35


Course: CCNA

efficiency. VLSM enables you to have more than one mask of the same class
address. It is supported by classless routing protocols like BGP, EIGRP, IS-IS, RIPv2
and OSPF while it is not supported by classful routing protocols like RIPv1 and
IGRP. There are two main advantages of VLSM

1. More efficient use of IP addressing


2. Ability to perform route summarization

Consider the following example scenario in which we have four routers A, B, C


and D. Router A is connected through WAN link with router B, C and D. Router B,
C and D each are connected with LAN segments. Each LAN contains 50 hosts.

In first case before VLSM for 50 hosts on each segment we borrow 2 bits to the
network and left 6 bits in the host portion which gives 62 hosts. But in this case
we used two class C addresses 192.168.1.0/26 and 192.168.2.0/26. In the above
figure router A connects with other routers through WAN link which require only
two addresses for each connection but on WAN links a lot of addresses are
wasted which is inefficient use of IP address.
Prepared by: Ishaq Ahmad Corvit Lahore Page 36
Course: CCNA

The inefficiency was removed through VLSM in which only one Class C network is
needed to assign addressing to the whole network as shown in the second figure
above. In this case the two different masks /26 and /30 were used in which /30 is
a little subnet that is assigned to WAN link show more efficient utilization of IP
addresses.

Example-1: you have a class C network (192.168.1.0) and your organization have
three LAN segments with 120, 60 and 30 hosts respectively. You are a network
administrator and you have to assign IP addresses using VLSM to this network.

Steps:

 Figure out your largest segment which is 120 in this case. Therefore for 120
hosts we need 7 bits i.e 27 = 128
 Left 7 bits in the host portion and borrow the other to the network portion.
Since 1 bit is added to the network portion therefore the total number of
network bits is 25.
 Calculate the subnet mask: 255.255.255.128
 Calculate number of subnets i.e 2n = 21 = 2 subnets
 Calculate the increasing number in each subnet i.e. 256-128 = 128
 List available subnets: 192.168.1.0 / 25 , 192.168.1.128/25
 Assign 192.168.1.0 / 25 subnet to your first LAN segment having 120 hosts.
 Since the next LAN segment contains 60 hosts and we only need 6 bits for
this segment therefore we borrow another bit to the network portion.
Again calculate the subnet mask i.e. 255.255.255.192
 Calculate number of subnets i.e 2n = 21 = 2 subnets
 Calculate the increasing number in each subnet i.e. 256-192 = 64
 List available subnets: 192.168.1.128 / 26 , 192.168.1.192/26
 Assign 192.168.1.128 / 26 subnet to your second LAN segment having 60
hosts.

Prepared by: Ishaq Ahmad Corvit Lahore Page 37


Course: CCNA

 Now the last LAN segment have 30 hosts and for this we need only 5 bits
therefore left 5 bits in the host portion and borrow another one to the
network portion.
 Calculate the subnet mask: 255.255.255.224
 Calculate number of subnets i.e 2n = 21 = 2 subnets
 Calculate the increasing number in each subnet i.e. 256-224 = 32
 List available subnets: 192.168.1.192 / 27 , 192.168.1.224/27
 Assign 192.168.1.192 / 27 subnet to your third LAN segment having 30
hosts. You have still one subnet 192.168.1.224 for future use.

Example-2: You have a class C network 192.168.2.0 / 24 and you are tasked to use
VLSM to accommodate the following requirements in which each remote site
(total 7) has no more than 30 devices. The links between the central and site
routers is point to point.

Steps

Prepared by: Ishaq Ahmad Corvit Lahore Page 38


Course: CCNA

 Figure out the largest segment in this case it is 30. It means that for 30
hosts we need only 5 bits therefore left 5 bits in the host portion and
borrow the other bits to the network portion.
 Calculate the subnet mask: 255.255.255.224
 Calculate number of subnets i.e 2n = 23 = 8 subnets
 Calculate the increasing number in each subnet i.e. 256-224 = 32
 List available subnets: 192.168.2.0 / 27, 192.168.2.32/27, 192.168.2.64/27,
192.168.2.96/27, 192.168.2.128/27, 192.168.2.160/27, 192.168.2.192/27,
192.168.2.224/27.
 Assign subnets 192.168.2.0 / 27, 192.168.2.32/27, 192.168.2.64/27,
192.168.2.96/27, 192.168.2.128/27, 192.168.2.160/27, 192.168.2.192/27
to Router A, B, C, D, E, F and G respectively each having 30 hosts.
 Now since the central router has a point to point connection with other
router therefore it require only 2 IP addresses. Now for two hosts we need
2 bits that is why left 2 bits in the host portion and transfer the remaining
to the network portion of the available subnet.
 Calculate the subnet mask: 255.255.255.252
 Calculate number of subnets i.e 2n= 23 = 8 subnets
 Calculate the increasing number in each subnet i.e. 256-252 = 4
 List available subnets: 192.168.2.224 / 30, 192.168.2.228/30,
192.168.2.232/30, 192.168.2.236/30, 192.168.2.240/30, 192.168.2.244/30,
192.168.2.248/30, 192.168.2.252/30.
 Assign subnets 192.168.2.224 / 30, 192.168.2.228/30, 192.168.2.232/30,
192.168.2.236/30, 192.168.2.240/30, 192.168.2.244/30, 192.168.2.248/30,
192.168.2.252/30 to the point to point WAN link as follow

Prepared by: Ishaq Ahmad Corvit Lahore Page 39


Course: CCNA

Example-3: Given Class C network: 192.168.3.0 /24. Use VLSM and accommodate
the following network by using the above single Class C network.

Steps:

 Figure out the largest segment in this case it is 126. It means that for 126
hosts we need only 7 bits therefore left 7 bits in the host portion and
borrow the other bits to the network portion.
 Calculate the subnet mask: 255.255.255.128

Prepared by: Ishaq Ahmad Corvit Lahore Page 40


Course: CCNA

 Calculate number of subnets i.e 2n = 21 = 2 subnets


 Calculate the increasing number in each subnet i.e. 256-128 = 128
 List available subnets: 192.168.3.0 /25 and 192.168.3.128 /25
 Assign subnet 192.168.3.0 /25 to the backbone router having 126 hosts.
 Router A, B and C require 30 hosts therefore for 30 hosts we need only 5
bits therefore left 5 bits in host portion and transfer the remaining to the
network portion from the available subnet.
 Calculate the subnet mask: 255.255.255.224
 Calculate number of subnets i.e 2n = 22 = 4 subnets
 Calculate the increasing number in each subnet i.e. 256-224 = 32
 List available subnets: 192.168.3.128 /27, 192.168.3.160 /27, 192.168.3.192
/27, 192.168.3.224 / 27.
 Assign subnets 192.168.3.128 /27, 192.168.3.160 /27, 192.168.3.192 /27 to
router A, B and C respectively.
 Now use the last subnet for your router to router connectivity which needs
6 hosts therefore 6 hosts needs only 3 bits that is why left 3 bits in the host
portion and transfer the remaining into the network portion.
 Calculate the subnet mask: 255.255.255.248
 Calculate number of subnets i.e 2n = 22 = 4 subnets
 Calculate the increasing number in each subnet i.e. 256-248 = 8
 List available subnets: 192.168.3.224 /29, 192.168.3.232 /29, 192.168.3.240
/29, 192.168.3.248 / 29.
 Assign subnets 192.168.3.224 /29, 192.168.3.232 /29, 192.168.3.240 /29 to
WAN links as follow.

Prepared by: Ishaq Ahmad Corvit Lahore Page 41


Course: CCNA

Route Summarization

Route summarization, also called route aggregation, is a method of minimizing the number of
routes in routing table’s .As we know that with the passage of time the number of subnets and
network addresses in routing tables is increasing rapidly .This growth taxes CPU resources,
memory, and bandwidth used to maintain the routing table. In large internetworks, hundreds, or
even thousands, of network addresses can exist. It is often problematic for routers to maintain
this volume of routes in their routing tables. Route summarization (also called route aggregation
or super netting) can reduce the number of routes that a router must maintain, because it is a
method of representing a series of network numbers in a single summary address. For example,
in Figure, router D can either send four routing update entries or summarize the four addresses
into a single network number. If router D summarizes the information into a single network
number entry, the following things happen:

 Bandwidth is saved on the link between routers D and E.


 Router E needs to maintain only one route and therefore saves memory.

 Router E also saves CPU resources, because it evaluates packets against fewer entries in
its routing table.

Prepared by: Ishaq Ahmad Corvit Lahore Page 42


Course: CCNA

Route Summarization Calculation Example

In the above topology we have four routes in the routing table of D router mentioned
below,

 172.16.12.0/24
 172.16.13.0/24
 172.16.14.0/24
 172.16.15.0/24

Here first we calculate manually the summary of these Routes .The routes to be
summarized must have fulfill the two condition
 All the Routes participate in the Route summarization must belong to same
interface
 Perform longest match ( Locate the bit where the common pattern of digits ends. )
calculate and perform AND operation on all the rows

128 64 32 16 8 4 2 1

000000 00
172.16. 0 00 011 00
172.16. 0 00 011 01
172.16. 0 00 011 10

Prepared by: Ishaq Ahmad Corvit Lahore Page 43


Course: CCNA

172.16. 0 00 011 11
172.16.
12 0

172.16.12.0 / 22 -----------------------Total bits =24-2=22 Where 2 bits are UN match

Route summarization offers several important advantages over flat routing. Route summarization
can minimize the latency in a complex network, especially when many routers are involved.
Because of the reduced number of routing entries, the overhead for routing protocols is
minimized. Network stability can be improved by reducing or eliminating unnecessary routing
updates after part of the network undergoes a change in topology. Route summarization also
greatly reduces processor workloads, memory requirements and bandwidth demand.

RIP version 2 and EIGRP also both perform auto summarization on routes that are advertised
across classful network boundaries. This is done with the route summarization command "ip
summary-address." And disabled with the protocol-level command "no auto-summary".

Lecture no-13

When you want to use router in a network then first of all you will configure it.
You can configure a router by some hardware and some software methods. There
are physical ports in a router by using that ports you can configure router.
Normally two ports are used through which you can access and configure a
router. One is called console port and the other is called auxiliary port.

When router is brand new then only console port can be used to configure it.
Attach cable one end with console port of router and second end with your
computer. Then you can access the router through some software like hyper
terminal or TRT. There are different software’s running in your computer that
enable you to connect with a router through console port.

Second method that is used to access and configure the router is using auxiliary or
aux port. You can access router by auxiliary port in the same way as by console
port but you cannot access a brand new router by auxiliary port.

When you configure the router using console port then you have to be physically
close to the router. But you can configure a router by auxiliary port from any part

Prepared by: Ishaq Ahmad Corvit Lahore Page 44


Course: CCNA

of the world. You don’t need to be physically close to router. You can do this by
simply connect the auxiliary port with modem instead of computer and then
connect a modem with a telephone line. Then you can remotely access your
router by dialing the telephone number to which the router auxiliary port is
connected. Console port does not need any modem. It is used for local access and
auxiliary port is for local as well as remote access. These are called hardware
methods of accessing a router.

Now we will discuss software methods of accessing a router. First one is telnet. In
this method you can access a router by using the telnet software. But using telnet
you need a hardware port to enter in a router like serial ports or Ethernet ports.
Telnet software is built in available in operating system and for telnet five telnet
lines are used in a router which are called telnet line or Vty (Virtual Terminal
Access). They are Vty0, Vty1, Vty2, Vty3 and Vty4. It means that five persons can
telnet a router at one time.

Another method is TFTP (Trivial File Transfer Protocol) to access a router. It’s also
a software method. Another is SNMP (Simple Network Management Protocol) for
configuring the router. These are the software methods it can use any physical
path i.e. console or aux. since we learned that every protocol needs software for
implementation that is why these methods are called software methods of
configuring router.

Mostly two methods are used to access and configure router that is console and
telnet.

There are different things in router. There are serial interfaces in router for WAN
connectivity and Ethernet interfaces for LAN connectivity. There are two ports
con and aux con means console and aux means auxiliary. In old routers another
port is AUI (Attachment Unit Interface) which is used for LAN connectivity
because there are two possible topology of LAN one is Bus and the other is Star.
In Bus topology the connectors are BNC and in Star topology RJ 45 connector is
used. Therefore Cisco developed a generic interface AUI which can be used with
Bus as well as with Star connectors. A converter or transceiver was used with AUI

Prepared by: Ishaq Ahmad Corvit Lahore Page 45


Course: CCNA

which provide either RJ-45 connector or BNC connector on the other side. You
will only change the transceiver by changing the topology. But now a day only star
topology is used in the world. So you can only see RJ-45 connector port in the
router for LAN connectivity.

We can say that router is an intelligent device so let’s examine why it is intelligent
or which things make it intelligent. Intelligence comes in any device by processor
and memory.

Router being an intelligence device has processor and memory. Processors of


Cisco routers only perform network related activities it does not perform general
activities like computer processors. CISCO charge half price for hardware and half
price for software in routers.

There are different types of memory in router. RAM is one type of memory in
router that is used for general purpose work but its nature is volatile. There is no
hard disk in routers. Router operating system is called IOS (Internetwork
Operating System). IOS is stored in a memory called Flash Memory which is non
volatile in nature. Configuration file or config file or setting file of router is stored
in NVRAM (Non Volatile RAM). All hardware related information is stored in
ROM. When router boots so it perform POST (Power On Self Test) means it check
all its hardware attach to it.

The startup sequence of router starts when first of all it reads its hardware
information from ROM the he loads operating system from flash memory then he
loads configuration file from NVRAM into RAM.

Router Configuration Modes

We are accessing router through console port. So open hyper terminal software in
your computer by clicking programs then accessories then communication and
then Hyper Terminal. You will give a name for this session then give a COM1 port
through which you are connecting form computer to router. After this give the
speed 9600. The following will appear

Prepared by: Ishaq Ahmad Corvit Lahore Page 46


Course: CCNA

A> ( it means you are in the user mode of the router. it is a restricted mode
represented by greater than sign after router name. in this you can perform
a limited amount of work.)
A> Enable (press enter it will ask a password )

A# (it is called privilege mode represented by # symbol after the router name.
it is liberal mode. You can perform any type of configuration in this mode)

A# disable (press ok. It will let you back to the user mode)

A> ? (if you want to take help for commands in this mode. It will display a list
of commands in this mode with brief description. You can press spacebar to
view another page of commands. When you press enter key then it show
another line. If you press any other key then it will let you back)

A#? (it will display help for list of commands that can be applied to this mode.
It is a powerful mode all user mode commands are available here. If you want
to check only those commands that starts with letter c then type c? Similarly
cl? Will show all commands starts with cl letters)

Lets configure time on this router

A# clock (it will show incomplete command means there are other things also
with this command)

A# clock set (again incomplete command will be displayed. Now how I will
know what portion remains next so I will use ? after set)

A# clock set ? (it will show hh:mm:ss means give time in this format)

A# clock set 13:18:33 (enter but again incomplete command take a help by
placing ?)

A# clock set 13:18:35 ? (it will show dd:mm:yy means give date)

A# clock set 13:18:40 25:09:2010 (press enter)

If you want to display this time then type

Prepared by: Ishaq Ahmad Corvit Lahore Page 47


Course: CCNA

A# show clock (press enter)

Note: when you use up arrow key it will show previous commands. When you
want to know the commands entered then use show history command (A#
show history). Tab key completes the commands after typing one or two
letters of the command.

A# sh clo (press enter it also execute the same command because it uniquely
identify the command)

IOS Shortcuts Keys

Ctrl +A will take you to the start of the line

Ctrl + E will take cursor to the end of line

Ctrl + B will take cursor back one character

Ctrl + F will take cursor one character forward

Ctrl + P will show previous commands

Ctrl + N will show next commands

Ctrl + H will do the work of backspace

Ctrl + W will delete the whole word

Ctrl + U will delete complete line

Lecture no-14
If you want to check the version of IOS then

A# show version (press enter. It also show configuration register value)

When router is running then there are two types of configuration file one is
stored in NVRAM which is called Startup configuration file and the other is in
the RAM which is called Running configuration file. If you want to make some
changes in the configuration file while router is running then it is not directly

Prepared by: Ishaq Ahmad Corvit Lahore Page 48


Course: CCNA

stored in Startup config it will store in the Running config. But when you switch
off router then Running config will be lost when you switch on the router again
it will load Startup configuration file from NVRAM. If you want to make these
changes permanent then you must store your Running Config file over Startup
Config file in NVRAM.

How you will check Startup configuration file and Running configuration file?

A# show running-config (press enter. It will show configuration file running in


a RAM)

A# show startup-config (press enter. It will show configuration file stored in


NVRAM)

If you want to know the status of different interfaces of a router then

A# show interfaces (press enter. It will show details of each interface)

A# show serial0 (it will show details of serial 0 interface)

If you want to check which one routing protocols are running in router then

A# show protocol (press enter)

These commands are provide basic information about router.

A# show ip interface brief (it will show a brief description of all interfaces)

How to Save Configuration File?

A# copy running-config startup-config (it will copy running config into stratup
config)

If a situation comes when you done configuration on a router but then you
realized that the configurations were wrong then what you will do?

One solution is to undo all these changes but if there are multiple commands
then it will take time.

Prepared by: Ishaq Ahmad Corvit Lahore Page 49


Course: CCNA

Second option reboot router because these changes were not saved in the
startup configuration file. So when you reboot the router it will load startup
config from NVRAM but it will also take time.

In live network it is not suitable to reboot the router. Therefore you will copy
startup config on running config to solve the problem in seconds.

A# copy startup-config running-config (press enter)

But if you have saved the running config on startup config and then you
realized that the configurations were wrong then what you will do? Or if the
router failed during working?

Best solutions for problems like this always take a backup of startup config
before saving configuration changes to it. Backup is always kept out of router
inside a computer called TFTP Server. Install TFTP software on any computer it
will become TFTP Server.

How to store back up on TFFP Server

A# copy startup-config TFTP (press enter)

If you want to restore the backup then use

A# copy TFTP startup-config (press enter)

Note: Always take a backup after configuration being a good network


administrator

A# copy startup-config TFTP (when you press enter it will ask address and
name of TFTP Server. Then it will ask destination file name and press ok)

A# copy TFTP running-config (when you press enter key it will ask address and
name of remote host. It means from where you are restoring. Then it will ask
source file name)

In summarized form it is clear that configuration file is stored in three location


one is Running config , second one is Startup config and third one is TFTP.

Prepared by: Ishaq Ahmad Corvit Lahore Page 50


Course: CCNA

Router Configuration

For router configuration we will go to the router config mode or global config
mode.

A# configure terminal (press enter)

A (Config)# (it is a router configuration mode)

A (Config)# exit (it will again let you to enable mode or you can type end or
Ctrl+Z to exit from this mode)

A# Conf t (it is a shortcut to go to global mode or if you type conf and prss
enter two times )

A (config)# hostname AA (Press ok. It will change name of the router)

AA(config)# exit (go to privilege mode)

AA# show running-config (for confirmation to check this change in running


config)

AA# show startup-config (for confirmation to check this change in startup


config)

AA# copy running-config startup-config (It will save running-config into


startup-config)

AA# show startup-config (to verify what we have done)

AA(config-t)# banner motd # welcome to Corvit # (press enter. It is message


of the day when somebody enters into a router this message will be displayed
first)

AA(config-t)# interface serial0 (it will go to the interface config mode)

AA(config-f)# description this is a good interface (all configuration will be


applied in this mode to serial0 interface. Always give accurate description for

Prepared by: Ishaq Ahmad Corvit Lahore Page 51


Course: CCNA

example this interface is connected with Islamabad network then give in


description connected to Islamabad)

AA# show interface serial0 (it will display information about this interface)

# in the banner motd command is called delimiting character. You can give any
character as delimiting character but that character must not come in your
message because router will take that character as ending of your message.

Password Configuration

When you want to access a router through console then he asks a password
A> enable (enter. it will go to the privilege mode)

A# conf t (enter. it will go to the global configuration mode)

A(config)# line console 0 (enter)

A(config-line)#password ccna (enter. It is console line password)

A(config-line)# login (press enter. ccna password is set on login through


console)

A(config-line)#exit

A>enable (enter. it will go to the privilege mode)

A# conf t (enter. it will go to the global configuration mode)

A(config)#line vty 0 (enter)

A(config-line)#password Corvit (enter)

A(config-line)#login (enter. it will set telnet password on vty0)

A(config-line)#exit

A(config)#enable password ishaq (enter. It is enable mode password)

A(config)# exit (press enter)

Prepared by: Ishaq Ahmad Corvit Lahore Page 52


Course: CCNA

A# show running-config (enter)

A(config-t)enable secret (it will show password in encrypted form in show


running config file)

Lecture no-15

Router Startup Sequence: when the router is switched on it reads hardware


information (POST) from ROM into RAM. Then it loads the IOS from Flash by
default but you can change the default nature of the IOS loading into RAM. IOS
can be loaded from three locations. The command through which you can
change the location of the IOS is called Boot System. Second it can be loaded
from TFTP server. It is performed in a case if you want to upgrade your IOS
then either you will download IOS from internet or bring it in CD then you
store that upgraded IOS in your TFTP server and then instruct the router to
load IOS from TFTP server. Normally on TFTP server a backup of startup
configuration file and IOS is stored. Third an IOS can be loaded from the ROM.
In ROM a sub set of IOS or mini IOS is stored. If you want to load the mini IOS
then you will mention ROM in the boot system command but this is not a
complete IOS it is used only if the actual IOS is crashed then you can load this
mini IOS and you can restore the actual full featured IOS from your TFTP
server. This sub set is not upgradable because it is read only that is provided by
the cisco for trouble shooting purpose. Let see the command

A(config)#boot system ? (enter. it will show all the three options with boot
system i.e flash boot system, TFTP booty system and ROM boot system)

A(config)#boot system flash Name_of_File (enter. you will give name of the
file because there may be multiple IOS inside the flash)

A(config)#boot system TFTP Name_of_file IP Address (enter. In case of TFTP


you will mention name of IOS and also IP address of TFTP server)

A(config)#boot system ROM (enter. In case of ROM no name is mentioned


because there is only one IOS stored in ROM)

Prepared by: Ishaq Ahmad Corvit Lahore Page 53


Course: CCNA

A(config)#copy running config startup config (enter)

Save the above configuration in the startup configuration file and next time
when the router reboot then he will follow the above sequence. You can check
the version of IOS through show version command on router.

If you want to know which one IOS is stored in flash then use the command

A> Show flash (enter. it will display the size and name of IOS)

IOS is in binary form while the configuration file is in text form. From this
command you know size of IOS file, used space of Flash, available space
on Flash, total size of Flash and IOS file name which you can mention in
boot system command.

If you did not configure router through boot system then first of all router try to
load IOS from Flash if here not found then go to the TFTP server for loading IOS
and the third option is ROM this is the default sequence.

A question arises that when we store the above startup sequence in the startup
configuration file which is stored in NVRAM but we know that when a router
boots then first he performs POST in ROM then load IOS from flash and in the last
step loads the startup configuration file from NVRAM it means that the loading
step of IOS comes first than the configuration file loading then what is the
advantage of storing startup sequence of router in the startup configuration file.
So the answer is that after performing POST router read the configuration register
value. Configuration register is a special hardware inside router and its value
determine that what the router will do after POST. In order to check the
configuration register value run the show version command and look at the end
configuration register value is 0x2102 where 0x means that this number is in
hexadecimal format. Since these are four hexadecimal numbers therefore
consists of 16 bits because one hexadecimal number is equal to 4 bits. 0x2102 is
the default value of the configuration register. In this number the right most digit
2 determine the next step of the router after POST. On this position the minimum
value is 0 and maximum value is F if the right most digit of the configuration

Prepared by: Ishaq Ahmad Corvit Lahore Page 54


Course: CCNA

register value is 0 (0x2100) then it is an instruction for the router to load the non
IOS operating system from ROM. There are three things in ROM one is hardware
information second is sub set of IOS means mini IOS and the third one is non-IOS
which is used for low level debugging and password recovery. If the value of the
configuration register’s right most digit is 1 (0x2101) then it is an instruction for
the router to load the sub set or Mini IOS from ROM. If the right most digit is from
2 to F then it means that first go to configuration file check the boot sequence
from the boot system commands and load IOS according to the sequence.

A (config) #copy flash TFTP (it will copy IOS from flash to TFTP server)

A (config) #copy TFTP flash (it will restore IOS from TFTP to flash)

A (config) # copy running TFTP (it will copy running configuration file on TFTP
server)

A (config) # copy startup TFTP (it will copy startup configuration file on TFTP
server)

Note: you can make changes in the configuration file on TFTP server because it is
a text file and these changes will be implemented when you copy configuration
file from TFTP server to Router.

A (config) # copy TFTP running (it will copy configuration file from TFTP server to
the running configuration file in router. similarly you can do it for startup config)

CDP (Cisco Discovery Protocol): It is a Cisco proprietary protocol that works on


layer 2 (data link layer). It means that this protocol is only supported on Cisco
devices not on non-Cisco devices. Through CDP a router knows information about
its neighboring devices that which one device is running in its neighbor. First and
most important thing for a network administrator to manage the network is the
need of network diagram. You will know about the network topology from the
network diagram. If you are asked to manage a network that have no diagram
then you have to login in any router and through CDP you come to know that
which devices are connected in its neighbor. Then login on another router and run
CDP through which you know about its neighbors. Similarly repeat this process on
Prepared by: Ishaq Ahmad Corvit Lahore Page 55
Course: CCNA

all routers and add them into your diagram and on this way you will create a
complete topology of your network. It means that CDP will provide from no
network diagram to a complete network diagram which become easy for you to
trouble shoot and manage your network. CDP provides you all the information
about the network through which you can create a picture of your network. CDP
is not a replacement of routing protocols because it only carries information
about directly connected devices in its neighbor while routing protocols carries
information about the paths in the whole network. Secondly routing protocols are
working on network layer while CDP works on data link layer. Every router after
some time advertises its information on all its interfaces. This information is sent
after every 60 seconds by default which is called CDP timer. All routers store this
information in its table where it remains for 180 seconds by default which is
called CDP hold time. It means that before discarding the packet up to which time
it remains in table. CDP hold time is controlled by that router who sends the
information. CDP timer is also controlled by the advertising router you can change
the timing consider the following command

A> show CDP (enter. it will show CDP timer and hold time information)

To change the timer and hold time information go to configuration mode and
type command as:

A (config) # CDP Timer 30 (now this router will send updates after every 30
seconds to its interfaces)

A (config)# CDP holdtime 90 (this information will kept for 90 seconds by other
routers)

A>show CDP (now it will show cdp timer 30 and cdp holdtime 90)

If you want to know about the neighbors of the router then use the following
command.

A>show CDP neighbor (it will display CDP table that contains information about
neighbor)

Prepared by: Ishaq Ahmad Corvit Lahore Page 56


Course: CCNA

If you want to check detail information then use the following command

A>show CDP neighbor detail (enter)

A>show CDP entry C (it will only show details of router C)

Lecture no-16
TCP/IP Model: TCP/IP is the family of protocols which consists of TCP, UDP, CDP,
POP3, SNMP, DHCP etc. TCP/IP has its own layered Model called TCP/IP Model
like OSI in which communication task is divided into different layers. It is very
much like to the OSI model. It is older than OSI model. The first three layers
(application, presentation and session) of TCP/IP model is collectively called
Application layer. Second layer is called transport layer, third layer is called
internet layer and forth is called data link layer and the last one is called physical
layer. The last two layers (data link and physical) can be collectively called
network interface layer because TCP/IP does not cover it and has no concern with
these two layers. There is no protocol of TCP/IP which works on these two layers.
Therefore you can treat it as a single layer or separate layers.

Now look at the application layer that which one protocols is offered by TCP/IP
model on it. TCP/IP provides different protocols for performing different types of
functionalities on application layer. They are TFTP and FTP for file transfer
similarly for email POP3, SMTP and IMAP. For network management SNMP, for
remote management Telnet and for LAN management DNS is used on the
application layer. Transport layer have two protocols of TCP/IP family which are
TCP and UDP. TCP and UDP are used on the basis of application requirements.

TCP is Connection Oriented protocol which provides logical connection not


physical by 3 way handshake while UDP is Connectionless protocol like postal
services in which a person does not informed in advance about a letter.

TCP is a reliable protocol which means that it receives an acknowledgment from


the receiver. Because reliability depends upon acknowledgment it is not
necessary that a connection oriented communication must be reliable and
connectionless communication will be unreliable. These two properties are
Prepared by: Ishaq Ahmad Corvit Lahore Page 57
Course: CCNA

independent from each other. It there is no concept of acknowledgment in a


communication then it is called unreliable communication. UDP is unreliable
because it receives not acknowledgement from the receiver. TCP communication
is slow while UDP communication is fast. Data or application which needs
reliability not speed will use TCP and that application which needs speed not
reliability will use UDP. Email applications uses TCP for communication on
transport layer. SMTP, HTTP, FTP uses TCP for communication on transport layer.
In voice communication delay must be minimal otherwise it is not acceptable for
which UDP is used on transport layer. Similarly video like TV also uses UDP
because voice and video are real time applications. Chat application uses both
TCP and UDP for communication if you are chatting within a chat room it uses
UDP while private chat with individual uses TCP. The TCP header consists of 20
bytes without option filed and 24 bytes with header field. Port numbers are
assigned with each request on transport layer. There are well known port
numbers like port 80 is used for http, ftp has 20, 21 and telnet has 23 port
number these are reserved port numbers for these application. Well known port
numbers are only used on server side not on client side. Well known port
numbers are always server side port numbers. There are 65536 total port
numbers. Initially from 0 to 255 port numbers were reserved for well known port
numbers but now this range was extended to 1023. Client side port numbers are
assigned randomly by the computer and these port numbers should be greater
than 1023. If the direction of communication is from client to server then the
destination port number is well known (fixed) and if the direction of
communication is from server to client then the source port is well known (fixed)
while the destination will be random in this case. SMTP has 25 port number, port
number 53 is assigned to DNS, TFTP has port number 69, POP3 has 110 port
number, SNMP has 161, and RIP has 520 port number

Socket number is the combination of IP address and port numbers.

UDP header is always fixed in length and consists of 8 bytes. IP is the most
common protocol of TCP/IP family which works on network or internet layer.
ICMP, ARP, RARP are also the internet protocols which belongs to TCP/IP family.

Prepared by: Ishaq Ahmad Corvit Lahore Page 58


Course: CCNA

Ping is a utility not an application which based on ICMP. ICMP also gives the
destination unreachable message. RARP is not used today instead of this DHCP is
used because the functionality of both are same but DHCP is more advance than
RARP. IP header can be from 20 to 24 bytes depending upon the option field.
When IP encapsulate the packet received from transport layer then first it
identifies UDP and TCP on the basis of protocol field of header. If it is TCP traffic
then IP assigns protocol number 6 and if it is UDP traffic then IP assign protocol
number 17.

Lecture no-17
How to configure IP address on different interfaces of a router:

Consider you have three routers named A, B and C. Router A is connected with
Router B through serial port and Router B is connected with Router C through
serial port. You can view the IP address if assigned to different interfaces of router
through commands:

A# show running-config (enter) or

B# show interfaces (enter) or

C# show IP interface brief (enter)

Note: if you want to assign or change the IP address of any interface then you will
move to the interfaces configuration mode from global configuration mode. For
example if I want to assign IP address to ethernet1 port then

A (config) # interface ethernet1 (enter)

A (config-if) #IP address 10.10.10.1 255.0.0.0 (enter)

A (config-if) # no shutdown (enter. It will up the interface)

A (config-if) # no bandwidth (enter)

A>show running-config interface serial1 (enter. it will show only information


about serial 1 interface)

Prepared by: Ishaq Ahmad Corvit Lahore Page 59


Course: CCNA

A (config) # no IP address (enter. it will remove all IP addresses from router


interfaces)

How to Ping routers

A>ping 1.1.1.2 (enter. it will send five steps packets and each packet will be 100
bytes in size. when you send a message it is called echo message or echo request.
The answer of the echo request is called echo reply time out is 2 seconds means
that the reply of each packet should reach within 2 seconds. Five exclamation
marks mean that five packets come back after hitting their targets. It shows that
connectivity to that router is 100% correct.it will also show the time of each
packet and time of all five packets in milliseconds i.e. 2 seconds=2000
milliseconds. similarly if there is no connectivity between the routers then instead
of exclamation marks there will be displayed five dots.)

A# show IP route (enter. it will display the routing table of that router)

Note: when a router ping itself then it takes double of the time as compared to
ping other router because in this case first ping request is generated by router A
now router A checks that this address belongs to which interface of this network
then it forward this ping on that interface the ping request reached to router B he
checks it is a ping and compare it with its own interface now router B knows that
this IP address is connected to my this interface he forward again the ping request
to router A now router A checks the address and gives the ping reply and send it
to router B when router B receive this ping reply he knows that it is for router A
therefore it send it again to router A that is why it takes double time.

How to telnet a router

Telnet is a utility through which you can access a router or other devices
remotely.

A# telnet 1.1.1.2 (enter. It will ask vty password after that you will be in router B.
after performing your desired operations type exit to come back to router A)

Prepared by: Ishaq Ahmad Corvit Lahore Page 60


Course: CCNA

Note: If you simply write 1.1.1.2 without telnet and press enter then it also goes
to router B because the IOS by default assume that this person wants to telnet.

A (config)# IP host routerB 1.1.1.2 (enter. This command maps any IP address with
English like name. For example in this case IP address 1.1.1.2 is mapped with
routerB. Now you can only write name of routerB instead of IP address)

A# telnet routerB (enter. It will go to the router B without entering IP address of


B)

A# show host (enter. It will show mapping names with IP addresses)

Advantage of mapping is that if you have a large network for example you have
branches in Peshawar, Lahore, Karachi and head office in Islamabad. When you
want to telnet any router in branch offices from head office then without
remembering their IP address just map once their IP addresses to names then
telnet or ping it by names. Also remember that names are case sensitive. But its
disadvantage is that router will go down if he performs name mapping due to the
processing load actually it is the functionality of DNS server to map name into IP.
You just mention to the router the IP address of DNS server for this conversion so
that router forward name or IP conversion to the DNS server. You can give the IP
address of the DNS server as:

A (config) # IP name-server 5.1.1.1 5.1.1.2 (enter. You can six DNS IP


addresses because there may be more than one DNS servers in your network)

A (config)# IP domain-lookup (enter)

Now type any random word then the router will send this word to the first DNS if
not found then he forward to the second DNS server and finally it will show an
error message that unknown command or computer name or unable to find
computer address i.e.

A# hi (enter)

When you type anything on a router then it generally assume that it is one of my
command but if he does not found this word or command in his database then he
Prepared by: Ishaq Ahmad Corvit Lahore Page 61
Course: CCNA

display unknown command message. Then he checks its own local name database
for name mapping against this word if not found then display the message
unknown computer name. In third attempt router sends this word to the DNS
server for resolving and at last display the message unable to find computer
address. Router checks each command in these three steps one after another if
not solved. If there is no DNS server in your network and you want to stop router
from searching DNS then use the command

A (config) # no IP domain-lookup (enter. It means that you will not search DNS
server)

If you want to remove the DNS servers configuration from you router then

A (config) # no IP name-server 5.1.1.1 (enter)

A (config) # no IP name-server 5.1.1.2 (enter)

Now if you type any word after removing the DNS server configuration and on the
IP domain-lookup then it will broad cast this word on the network and searches
for any DNS server on the network.

When you write an IP address in front of ping command then it is called simple
ping. You can also perform extended ping for extended ping you will not write IP
address with ping command. It means that you can change the default
parameters of the ping command through extended ping.

A# ping (enter. Now it will ask for target IP address then it will ask for repeat
come here you will mention the echo packets which is by default 5 after this it will
ask for the size of echo message which is by default 100 bytes after this it will ask
about time out which is by default 2 seconds you can change it)

Lecture no-18
Router initially knows about the networks which are directly connected to it. All
this information is stored in the routing table of a router. To display the routing
table use the following command:

Prepared by: Ishaq Ahmad Corvit Lahore Page 62


Course: CCNA

A# show IP route (enter. It will show all the networks that are directly connected
with this router through C letter.)

How the router knows about its directly connected networks. The answer is that
when you give IP address to its interface it perform an AND operation on that IP
and its subnet mask and store the result in this table. In this case you can only
ping the directly connected network IP addresses. It means that initially the
router without running static or dynamic routes it can only communicate with its
directly connected networks. You can only ping an IP address whose entry is
available in the routing table. There are two methods to make an entry of IP
address in the routing table one is called static in which we manually enter the IP
address of a network and the other is running routing protocols which is called
dynamic routing.

Configuring Static Routes

For configuring static route you will switch to the global configuration mode of a
router and give the following command

A (config) # IP route destination_network_IP_Adress subnet mask


next_hop_IP_address

In the above command destination network IP means that the network to which
you want to reach so first you will enter IP address and subnet mask of it and next
hop IP address means that through which interface you will send packet to reach
to the destination. By this command you have configured you static route in order
to check it in the routing table use the command show IP route (enter). It will
show the static route with the character S followed by IP address and it will also
show via IP address which is the IP address of next hop. Administrative distance of
static route is 1 which is also shown in the routing table. Now if you ping the
destination network configured through static route in the routing table but it will
not give any reply actually from source to destination the static path is configured
but from destination to source the path is unknown for the destination router.
Therefore configure a static route also on the destination router for the source
network. And also note that if the destination network is not directly connected
Prepared by: Ishaq Ahmad Corvit Lahore Page 63
Course: CCNA

with next hop then you also configure static route on that router. Configuring
static route on router you must know that all the routers in the way must know
about the destination and in reply all routers also know the source otherwise no
ping will be successful. In other words if you want to provide full reachability in a
network then you must configure static route on each router for all networks.
Static routes are typically used in smaller networks. With a network that has
hundreds of routes; static routes are not scalable, since you would have to
configure each route, and any redundant paths for that route, on each router
which increases the configuration overhead and complication. The solution of this
situation is the dynamic routing in which different protocols perform all these
tasks.

Configuring Dynamic Routes

Unlike static routes that require manual configuration to tell the router where
destination networks are, dynamic routing protocols learn about destination
networks from neighboring routers. Dynamic routing protocols fall under one of
three categories: distance vector, link state, and hybrid. Each of these routing
protocol types takes a different approach in sharing routing information with
neighboring routers and choosing the best path to a destination.

Configuration of RIP is very simple you will only give a command router RIP in the
global configuration mode of the router. For configuring any type of routing
protocol you will write router then name of the routing protocol.

A (config) # router RIP (enter. It will enable routing protocol RIP on this router)

A (config) # network 1.1.1.0 (enter. It will include all the interface of this network
in RIP)

Now check the routing table of this router and check the remote networks by

A# show IP route (enter)

But it will not show because on the other routers RIP is not configured. It sends its
own information to the neighbors and accepts the neighbor information and

Prepared by: Ishaq Ahmad Corvit Lahore Page 64


Course: CCNA

stores it in his routing table. Therefore configure RIP on all other routers in the
network. In the routing table RIP is represented by R character. Now you can ping
any IP in the network. In the routing table it shows information about the
administrative distance, metric (hop count) [ad/metric]. If there are two paths
and have the same metric then it is called load balancing or load sharing or load
distribution. RIP sends updates after every 30 seconds to its neighbors.

Lecture no-19

IGRP Configuration

IGRP configuration is very similar to RIP first you have to enter into the global
configuration mode.

A (config) # router IGRP 1 (enter. You will go to the router mode of IGRP)

A (config-router) # network 1.0.0.0 (enter)

A (config-router) # nework 4.0.0.0 (enter)

In the routing table IGRP is represented by symbol I. You can also check
information about running protocols by the commands

A # show ip protocols (enter)

A # show running-cofig (enter)

Administrative distance of IGRP is 100 and the metric of IGRP is a composite. It


can use five metrics but by default IGRP uses two metrics i.e. one is bandwidth
and the other is delay. It combines these two metrics and performs some
mathematical calculations and generates a composite metric value. In case of RIP
the routing updates are refreshed after every 30 seconds while in case of IGRP it
is refreshed after every 90 seconds.

Digit 1 after the IGRP command is called autonomous system number or AS


numbers. This number can be any number from 1 to 65535.

Prepared by: Ishaq Ahmad Corvit Lahore Page 65


Course: CCNA

A collection of networks under one administrative control is called autonomous


system. Every company can have multiple branches in the world which is
independent of any other company. They purchase autonomous number from
IANA like IP addresses. For example PTCL, IBM, CISCO etc have their own
autonomous systems in which they run routing protocols according to their
requirements. RIP, IGRP, EIGRP, IS-IS and OSPF perform routing within the same
autonomous system called intra autonomous system routing while BGP perform
routing among different autonomous systems. BGP is used for inter autonomous
systems routing. All those protocols which perform intra autonomous routing or
routing within the same autonomous systems are called IGP (Interior Gateway
Protocols) while BGP is called EGP (Exterior Gateway Protocols). There is only one
protocol for EGP which is BGP it is same for all over the world.

You must ensure that all the routers inside one autonomous system have same AS
number because if we give different AS numbers to different routers within same
AS then they cannot exchange each other routing information.

More than one routing protocols can run in the same autonomous system but If
you run two protocols at the same time then routing table only shows routes
selected by those protocols whose administrative distance is lower. For example if
you run RIP and IGRP then only the IGRP routes will be visible in routing table
because the IGRP administrative distance is 100 which is less than the RIP
administrative value 120.

IGRP metric can be calculated as

First run the command show ip route to know the distance between the source
and destination network. Let’s assume it is 8576 now we have to find out how this
value is calculated or generated. For this we will find out bandwidth and delay
from source network to destination network. First you will determine from how
much interfaces source router will exit to reach the destination router network.
For example two interfaces contribute in this metric calculation. On these two
interfaces you will check the bandwidth value and delay value configured. Every
interface has value configured for bandwidth, delay, reliability, MTU and loading.

Prepared by: Ishaq Ahmad Corvit Lahore Page 66


Course: CCNA

you have to calculate the bandwidth and delay value on all exiting interfaces in
order to calculate total metric.

D# show interface serial 0 (enter. Now check bandwidth and delay value of this
interface)

Let’s the bandwidth value is 1544 kbps and delay value is 20000 microseconds.
Similarly find out bandwidth and delay values of the other interface contributing
in metric. For example

C# show interface Ethernet 0 (enter)

Let’s assume here the bandwidth value is 10000 kbps and delay is 1000
microseconds. These are the default values of bandwidth and delay on each serial
and Ethernet interfaces. Since we have find out values of the interfaces now first
treat bandwidth. For this we use the formula

Bandwidth IGRP = 107 / lower bandwidth in kilobits = 107 /1544 =6476

Delay IGRP = delay / 10 =20000/10 = 2000

Delay IGRP = delay / 10 =1000/10 = 100

Now add the above three values = 6476 + 2000 + 100 = 8576

Note: In case of bandwidth you will consider the lower bandwidth value from all
interfaces while for delay you will consider all values. This is how IGRP calculate
the composite metric. In simple words it is the lowest bandwidth plus total delay.
You can also change the default values for bandwidth and delay of any interface.

C (config) # interface serial 0 (enter)

C (config-if) # bandwidth 64 (enter. It will set the bandwidth to 64 kilobits)

C (config-if) # delay 2000 (enter. You will enter delay in 10’s of microseconds
means if you want to set the delay 20000 then you will enter 2000 because
20000/10 = 2000)

Prepared by: Ishaq Ahmad Corvit Lahore Page 67


Course: CCNA

You can change the metric for two reasons. One if you want to manually dictate
routing for any reason that sale department router always drop packets that is
why don’t use this path. But don’t change the default metric unless you know the
impact of this change on your network. Second if you want to show actual picture
not the default of any interface then you can manipulate the metric.

Lecture no-20

OSPF (Open Shortest Path First): OSPF is a link state routing protocol while RIPv1
and IGRP are distance vector protocols. In link state protocols subnet mask
information is sent with routing updates while in distance vector only subnet id or
network id is sent without subnet mask in exchanging routing updates. Subnet
mask information makes dis-contiguous subnet possible which is not supported
by distance vector protocol. In case of RIP there is a limitation of 15 hop count
while there is no such limitation in OSPF. The metric of OSPF consider bandwidth.
Distance means the distance between source and destination network and vector
means direction i.e. in which direction you will exit. OSPF or link state protocol
keeps the complete picture of the topology that is why in this case the decision is
taken very intelligently and there is no chance of loops. OSPF supports VLSM
while RIP and IGRP do not support VLSM. If you do not advertise subnet mask
information with routing updates then other routers will either assume a default
subnet mask or one which is configured on its own interfaces. That is why RIP
keeps the same subnet mask because when RIP was introduced at that time there
was no concept of VLSM. OSPF is a classless routing protocol while RIP is a classful
routing protocol. RIP advertises its routing table after every 30 seconds which
increases overhead on a link especially when the routing table size is large and
link bandwidth is low. OSPF does not exchange routing table after every 30
seconds or periodic basis. It only exchanges information when there is a change in
the topology and only sends changed information not the whole table. OSPF is
very intelligent protocol but complicated because sophisticated things are always
complicated. OSPF first develop a neighbor relationship with other OSPF speaking
routers while RIP without knowing about neighbors sends their routing updates.
When the OSPF speaking router is switched on first of all it sends a hello packet

Prepared by: Ishaq Ahmad Corvit Lahore Page 68


Course: CCNA

on all of its OSPF enabled interfaces. In Hello packet he sends information about
himself to its possible neighbors. Hello packet does not carry routing information
it only carries router information. All other OSPF speaking routers on these
interfaces will accept this hello packet and store information about this router
and will send a reply hello packet in which they send their own information to this
router. There are different states of OSPF. When both sides OSPF speaking router
do not about each other then we say that OSPF speaking routers are in down
state. But when source router sends a hello packet to other then a one way
relationship is established so we say that it is INIT state of the OSPF speaking
routers. When the destination router send a reply hello packet to the source
router now both routers know about each other therefore we say that now they
are in two way state. Actually OSPF speaking router sends a hello packet on a
reserved multicast address (as you know that the multicast addresses range is
224.0.0.0 to 239.255.255.255). In this range some addresses are reserved for a
specific purpose in which 224.0.0.5 is reserved multicast address for OSPF. Once a
two way state is established then DR and BDR election take place. DR stands for
Designated Router and BDR stands for Backup Designated Router. The purpose of
DR is that all OSPF speaking routers will only exchange information with DR and
since the role of DR is so critical that is why there must be a backup due to which
BDR is established. OSPF speaking routers have some priority whose value can be
from 0 to 255. Router whose priority value is highest than others then he will be
elected as DR and second highest priority value router will be elected as BDR. By
default every router has a priority value 1. If you want to make a router as a DR
then increase its priority to highest value. If you set the priority value of any
router to zero then he is ineligible for DR and BDR election. If the priorities are
equal then DR and BDR election is done on the basis of router ID. In OSPF every
router has its own router ID or identification which must be unique through which
other routers know it. If a loopback interface is configured on a router which is an
imaginary or logical interface that you can configure on any router which is used
mostly for testing and to be used as a router ID for that router. Loopback
interface acts as a router ID in the OSPF. Loopback interface is not pre-configured
on the router you have to configure it manually. If there are many loopback

Prepared by: Ishaq Ahmad Corvit Lahore Page 69


Course: CCNA

interfaces configured on the router then the highest lP address loopback interface
will be considered as router ID. If there is no loopback interface configured on the
router then the highest IP address among all the active physical interfaces of this
router will be considered as a router ID. It means that any physical interface with
highest IP address will be a router ID in the absence of loopback interface. When
each router calculate its router ID then all routers will compare its router ID’s with
each other and the router having highest router ID will be elected as DR. Routers
that are neither DR no BDR are also called DR others. Once the DR and BDR
election is completed let’s assume that this election is done on the basis of
priority value. After DR and BDR election routers reaches to the XSTART state. In
this state DR establishes a master slave relationship with all other routers in
which one router become master and other becomes slave on the basis of router
ID means highest router ID is master and lowest router ID is slave. It is not
compulsory that DR will always be the master it can be a slave if DR election is
done on the basis of priority value rather than router ID. If the DR router ID is less
than the other then it acts a slave. In master slave relationship routing
information exchange process will only start by master that is followed by slave.
After master/slave routers reaches to the exchange state. OSPF does not build
routing table directly. OSPF first discover neighbors and build neighbor table then
on the basis of neighbor table it creates a topology picture and build topology
table which is also called topology database and on the basis of topology table it
builds routing table. In simple words neighbors information are stored in neighbor
table, all possible routes information are stored in topology table and best routes
information are stored in routing table. Every router will make a list of their
routes and will exchange with each other. For example you want to buy some
goods and shopkeeper sends a catalog and you choose only those goods that are
not available with you and discard other goods that you already have. It means
that routers initially exchange only list of routes not actual routes because actual
routes contains other information like metric, subnet mask etc. This list of routes
or topology table list exchange packet is called database description packet. It
means that in exchange state dbd or ddp is exchanged. Now in the next step
routers will request to each other for those routes which are not in their list. It

Prepared by: Ishaq Ahmad Corvit Lahore Page 70


Course: CCNA

means that now they will exchange the actual routes. These requests are called
LSR (Link State Request) and the other side in response to the LSR will send actual
routes. Actual routes are exchanged in the loading state in the form of LSA (Link
State Advertisement). LSA are used to exchange routing information in OSPF. For
each roué the router will send a separate LSR and one LSA will carry only one
route information. In OSPF packet multiple LSA’s are packed and send which is
called LSU (Link State Update). One LSU contains multiple LSA’s. Once all the
routing information has been exchanged then both routers topology table
become exactly identical then we say that both routers are in full state which is
the final state. When all routers topology table become identical then every
router runs on its topology table SPF (Shortest Path First) algorithm which has
another name also called Dijkstra algorithm. Dijkstra is the name of a computer
scientist. On the basis of SPF it builds its routing table.

Lecture-21

Whenever you are designing an OSPF network then the network is divided into
multiple parts called Area. There is a central area with which different areas are
attached. This central area is called backbone area which is always called Area
Zero. All the areas are assigned different numbers. If any area wants to join OSPF
domain it must be directly connected to Area zero. The interaction of these areas
with each other make OSPF complicated but in CCNA we only discuss operation of
OSPF in a single area. When all routers topology table become exactly same it is
only true for the routers in the same area. It means that when the routers belong
to the same area then its topology tables will be same and those routers which
belong to different areas will have different topology table because a router only
knows about the complete details of all routes in its own area and it have very
limited information about the other area network. That is why within the same
area routing loops will never be created because every router has a complete
picture of the area. The reason of creating loops is due to inaccurate or limited
information. One router can belong to different areas where one interface is
connected with one area and other interfaces are connected with other areas
such type of router is called Area Border Router. Area Border Router is

Prepared by: Ishaq Ahmad Corvit Lahore Page 71


Course: CCNA

responsible for propagation of information from one area to another area. A


router which connects your OSPF domain or Autonomous system to the internet
is called ASBR (Autonomous System Boundary Router). ASBR can be any router it
can be from any area and can be any type of router. If you configure OSPF within
a single area then that area can be either Area zero or non-Area zero but if there
are two areas then one must be Area zero otherwise two non-backbone areas
cannot exchange routing updates with each other. Now let’s configure OSPF on
four routers topology. For the configuration of OSPF you have to configure three
additional things.

A (config) # router OSPF 1 (enter)

Here 1 represent process ID. It means that you can run multiple instances of OSPF
on any router. If you run another OSPF on this router then you will write OSPF 2
because it is another instance. You can include some interfaces in OSPF 1 and
some in OSPF 2. It is similar as two different protocols are running on the same
router. These protocols will not exchange routes with each other because the
process ID’s are different. There are 32 instances in which you can assign 28. It is a
unique feature of OSPF in which you can run it multiple times on one router
within the same autonomous system.

A (config-router) #network x.x.x.x wildcard mask Area-ID (enter)

Wildcard mask is the opposite of subnet mask. For example the subnet mask of
class C is 255.255.255.0 therefore wildcard is 0.0.0.255

B (config) # router OSPF 1 (enter)

Here you can also run different process ID like OSPF 2 because the routers are
different but keep it same so that you can easily remember it in future while in
case of IGRP you must keep the AS number same on all routers.

B (config-router) # network x.x.x.x wildcard mask Area-ID

Similarly configure OSPF on other two routers.

A # show ip route (enter)


Prepared by: Ishaq Ahmad Corvit Lahore Page 72
Course: CCNA

In routing table OSPF is represented by symbol “O”. There are other information
like network Id, subnet mask, and 110 which is administrative distance of OSPF
and metric of OSPF which is called cost which dependent on bandwidth. Cost is
inversely proportional to bandwidth means higher the bandwidth will lower the
cost and vice versa.

If you want to show the neighbor table of OSPF then use the following command

A # show IP OSPF neighbor (enter)

It will show router id which is the highest IP address on all interfaces of that
router, priority value, and state of the router, dead time and sending router
interface address. After every 10 seconds a hello packet is sent when the network
is converged and if router does not receive hello packet from its neighbor then it
remove that entry after 40 seconds it means that the dead time is 40 seconds in
OSPF. You will see two IP addresses of the other router one is the router ID and
the other is the IP address of the interface but there is a possibility that both are
the same when that interface is also represent router ID.

If you want to know OSPF details on your own router then you can use two
commands.

A # show IP protocols (enter)

A # show IP OSPF (enter. It will give more details about OSPF)

A # show IP OSPF interface (enter. It will show all interfaces running OSPF)

Two routers cannot become neighbors if there hello and dead intervals are
different. As we discussed above that each router has a priority value actually it is
the priority value of the interface and you can change this priority value on each
interface individually.

If you want to check the topology table or database of OSPF then use the
command

A # show IP OSPF database (enter)

Prepared by: Ishaq Ahmad Corvit Lahore Page 73


Course: CCNA

A # show IP OSPF database router (enter. It will show complete detail)

How to calculate OSPF metric cost

First consider the outgoing interfaces to the destination network. Then us formula

Cost OSPF = 108 / bandwidth in bits per second

A # show interface serial 0 (You can check the serial interface bandwidth which is
1544 kilobits per second it means that 1.544 megabits per second which is equal
to 1.544 x 106 bits per second)

Cost OSPF for serial interface = 108 / 1.544 x 106 = 108-6 /1.544 = 102 /1.544

= 100 / 1.544 = 64

Now Ethernet bandwidth is 10 megabits per second which is equal 10 x 10 6 bits


per second.

Cost OSPF for Ethernet interface = 108 / 10x 106 = 108-6 /10 = 100/10 = 10

Total cost = 64 + 10 = 74

Lecture no-22

EIGRP: EIGRP is designed for larger networks which is CISCO proprietary protocol.
EIGRP most features resemble with link state protocol but it is not a pure link
state protocol it is a hybrid protocol. EIGRP discover neighbors with hello packet
like OSPF. It sends hello packet after every 5 seconds and keep it in its neighbor
table for 15 seconds. It means that its dead time is 15 seconds while OSPF dead
time is 40 seconds and OSPF sends hello packet after every 10 seconds. In EIGRP
after building the neighbor table then it builds a topology table. OSPF run DiJkstra
algorithm on its topology table while EIGRP run DUAL algorithm on its topology
table to build routing table. Similarly EIGRP dos not send update at regular
interval once the network is converged; it is very quick protocol. EIGRP only
exchange information when there is a change in the topology table and sends that
changed information like OSPF. It performs more efficient work than OSPF
because it sends the information only to those routers that are affected by the
Prepared by: Ishaq Ahmad Corvit Lahore Page 74
Course: CCNA

topology change. It does not send information to those routers which are not
affected by the change of topology table. It means that three things you have to
remember when the information is sent, which information is sent, and to whom
the information will be send. So the answer of the first question is when a change
in the topology table occur then the information is send, second answer is only
the changed information will be sent and third answer is the information will be
sent to those routers that are affected by this change. OSPF only support one
network layer routed protocol which is IP while EIGRP support multiple network
layer routed protocols like IP, IPX and Apple talk which was the major advantage
in previous stages.

In EIGRP when the topology table is built after neighbor table then it checks if
there are four paths available to destination then which one is the best path. It
takes that best path and put it in its routing table and this path is called successor
route and that neighbor is called successor neighbor while in other routes it
makes feasible successors. The criterion for feasible successor is that their metric
must come in some range of successor route metric. When a successor route
becomes unavailable then feasible successor is promoted as successor route
without informing or exchanging information with neighbors about it which is the
advantages of EIGRP. But if there is no feasible successor in the topology table
then it must consult neighbors for successor route and will exchange updates. The
distance that advertised by the neighbor for any destination is called advertised
distance or it is a distance which is advertised to you by your neighbor to reach
any network. When you add your neighbor distance within advertised distance
then it is called feasible distance.

For any route to be a feasible successor its advertised distance should be less than
the feasible distance of the successor route. This condition ensures to avoid
routing loops. It means that if the neighbor advertised distance is less than my
feasible distance then he is not going through my route but if his advertised
distance is greater than my feasible distance then there is a chance that he may
use my path which creates looping problems.

Prepared by: Ishaq Ahmad Corvit Lahore Page 75


Course: CCNA

If there is no feasible successor and when successor route become un available


then router sends query to its neighbor that the successor route is un available
with me now what should we do. This is actually the functionality of DUAL
algorithm in which you send a query and wait for response and till that time you
keep that route in passive state.

A (config) # router EIGRP 1

A (config-router) # network x.x.x.x (give all the directly connected interfaces with
network command on which you want to run EIGRP)

In the routing table EIGRP is represented by symbol D and its Administrative


distance is 90. Its metric is similarly dependent on bandwidth and delay like IGRP.
There is no difference in the calculations of EIGRP and IGRP metric. You have to
calculate the metric of IGRP and multiply it by 256 you will get the metric of
EIGRP.

Metric of EIGRP = (107 / bandwidth in kilobits) + delay of the interface


represented in 10’s of microseconds = result x 256

To know topology table of EIGRP use the command

A # show IP EIGRP topology (enter. It will only show successor route and feasible
successor routes)

Lecture no-23

Access Control List

Access List is used to stop, restrict, limit or block traffic due to any reason.
Actually it is used for traffic management. Access list can be used in two directions
i.e. incoming and outgoing.

Incoming means when the traffic enters into the router and outgoing means when
the traffic exit from the router both types of traffics can be controlled by access
list. You can perform two actions on traffic by using Access List. These two actions
are permit and deny. Access List configuration can be performed in two steps.

Prepared by: Ishaq Ahmad Corvit Lahore Page 76


Course: CCNA

First step is defining an Access List and second step is applying an Access List. You
can define an Access List in global configuration mode and you will apply an
Access List in the interface configuration mode.

There are two types of Access List one is Standard Access List and second is
Extended Access List. Access List can be applied on the basis of three criteria. One
is source IP address of the packet, second destination IP address of the packet and
third Port number of the packet. On the basis of these three main criteria you can
permit or deny traffic.

If you are permitting or denying traffic on the basis of source IP address then we
say that we are using Standard Access List. It means that Standard Access List can
only check traffic on the basis of source IP address of the packet while Extended
Access List is complicated which can check traffic on the basis of source IP address
or destination IP address or Port number or source and destination IP address or
source IP address and Port number or destination IP address and Port number or
source and destination IP addresses and port numbers. It means that Extended
Access List can use any combination of these three criteria.

Access list can be configured in multi-line but it consume more memory and take
more processing time of the router that is why you can also configure multiple
lines in a single line range. You will mention wildcard mask with this range.
Actually wildcard directed to the router that don’t check those octets whose
corresponding value is 255 you have to deny it. For example if you write IP
address 0.0.0.0 and wildcard mask 255.255.255.255 it means that don’t check any
octet simply deny traffic of any IP address. In the wildcard mask “0” means must
match this octet with coming packet and “255” don’t match. In fact wildcard mask
control the comparison of the configured IP address and coming IP address in the
router. If the octet value in the wildcard mask is “0” then the configured IP
address and coming IP address must compare that octet and if the octet value in
the wildcard mask is “1” then it will not compare that octet of the configured IP
address and coming IP address. If all the octets in the wildcard mask are zero then
it compares every octet of the configured IP address with the coming IP address
and it means that you are permitting or denying only one IP address. If all the

Prepared by: Ishaq Ahmad Corvit Lahore Page 77


Course: CCNA

octets in the wildcard mask are 1’s then it will not compare any octet of the
coming IP address with the configured IP address and it means that you are
permitting or denying all IP addresses. In this case we have discussed if you want
to allow or deny one or all IP addresses of Class A, B and C but if you want to
permit or deny certain nodes within the block then you have to write starting IP
address of the range and last IP address of the range in binary form and write 0 in
the wildcard mask if the corresponding bits are same and write 1 if the
corresponding bits are different.

Example-1

192.1.1.16 to 192.1.1.31

192.1.1.00010000 (binary form of last octet of first IP address)

192.1.1.00011111 (binary form of last octet of last IP address)

0.0.0.00001111 (write 0 below if both column are same and 1 if different)

0.0.0.15  wildcard mask of this range

Example-2 192.1.1.16 to 192.1.1.23

192.1.1.00010000 (binary form of last octet of first IP address)

192.1.1.00010111 (binary form of last octet of last IP address)

0.0.0.00000111 (write 0 below if both column are same and 1 if different)

0.0.0.7  Wildcard mask of this range

Example-3 192.1.1.16 to 192.1.1.47

192.1.1.00010000 (binary form of last octet of first IP address)

192.1.1.00101111 (binary form of last octet of last IP address)

0.0.0.00111111 (write 0 below if both column are same and 1 if different)

0.0.0.63  Wildcard mask of this range

Prepared by: Ishaq Ahmad Corvit Lahore Page 78


Course: CCNA

In the above example 1 and 2 if you simply subtract starting IP address last
decimal value from last IP address last decimal value then you will get wildcard
decimal value without converting it into binary i.e.

31-16 = 15 (first example)

31-23 = 7 (second example)

47-16 = 31(third example)

But in third example it is not true i.e. 47-16 = 31 because subtraction process will
not always give you correct result. For the subtraction process you have to check
one thing that the given range must come in valid subnet range. For example first
one is from 16 to 31 therefore first valid subnet range is from 0 to 15 and then
from 16 to 31. In second case first valid subnet is similar from 0 to 15 and then
from 16 to 31 in this case we have 23 it means that we are extra covering from 24
to 31. In order to perform exact match you have to make smaller subnet blocks
like from 0 to 7 then from 8 to 15 then 16 to 24. Similar is the case of example-3

Note: A simple trick to find out wildcard mask from the subnet mask is to subtract
each value of subnet mask from 255 you will get wildcard mask.

Lecture no-24

Configuration of ACL

ACL can be configured for IP as well as IPX and Apple Talk protocols. When you
configure standard ACL for IP then you can assign numbers from 1-99 while for
Extended ACL you can assign numbers from 100-199. From these numbers you
can easily find out whether it is a Standard ACL or Extended ACL. Let’s configure a
Standard ACL:

A (config) # access-list number (any number 1-99) action (permit or deny)


Source_IP_Address Wildcard_Mask

Now apply this ACL on any interface in the interface configuration mode as:

A (config-if) # IP access-group number direction (in, out)


Prepared by: Ishaq Ahmad Corvit Lahore Page 79
Course: CCNA

Example: Suppose two networks are connected with router on ethernet0 and
ethernet1 interfaces. I72.16.3.0 is connected with ethernet0 and 172.16.4.0 is
connected with ethernet1 of the router while on the serial interface of this router
internet is connected.

A (config) # access-list 1 permit 172.16.0.0 0.0.255.255 (enter)

One important behavior of the CISCO router is that when you explicitly allow or
deny some addresses then all other addresses are implicitly denied by the router
in default. If you want to deny some range and wants to permit all other then you
have to mention this at the end otherwise it will be denied. But if you want to
permit some addresses and deny all others then you don’t need to mention
anything at the end because there is an implicit deny all at the end of every ACL.

A (config) # interface ethernet0 (enter. We want to apply it on ethernet0


interface)

A (config-if) # IP access-group 1 out (enter. ACL is applied on ethernet0 interface)

A (config) # interface ethernet1 (enter)

A (config-if) # IP access-group 1 in (enter)

If there are more than conditions in ACL then write first the most specific and
then less specific. ACL is processed from top to down and if the match is found
then it does not check the remaining lines.

Now let’s configure Extended ACL

A (config) # acess-list number (100-199) [deny|permit] IP_protocol

source_address source_wildcard_mask

[protocol_information]

destination_address destination_wildcard_mask

[protocol_information]

Prepared by: Ishaq Ahmad Corvit Lahore Page 80


Course: CCNA

Standard ACL should always be place close to destination and Extended ACL
should always be placed close to source.

Lecture no-25

WAN Structure

If we take our daily life example of movement from one place into another place
within a city then it is called LAN structure. For this movement we use our own
vehicles like cycle, bicycle. In technical words Ethernet, Token Ring and FDDI are
the vehicles for LAN movement. But if we want to go from Pakistan to London
then we cannot use our own vehicles. For this movement there are certain service
providers like PIA, SHAHEEN etc. we will use the services of these service
providers to reach our destination. In technical words FRAME RELAY, ISDN, ATM
etc. are the WAN technologies or vehicles.

We don’t care how the service providers for example PTCL or Multi Net spread
their fiber but being a network administrator our goal is to connect with these
service providers then they are responsible for the data movement across their
infrastructure. Companies pay some amount to these services providers for their
services instead of spreading their own fiber optic to their destinations.

There are different devices and switches in the service provider’s cloud but they
have different protocols. If you are using ATM services then ATM switches will be
used and for Frame Relay services Frame Relay switches are used. You have to
connect with the central office switch which is called CO switch. The connection
can be established from your router to the CO switch through cable or wireless
which is called local loop or local leap or last mile connection. There is equipment
called CPE (Customer Premises Equipment). It is placed in the premises of
customer network but is the property of service provider which acts as an
interface between the customer network and the service provider network. You
can assume that it is the representative of the service provider. Every service has
different CPE. For example if you are using Leased Line or TDM services then you

Prepared by: Ishaq Ahmad Corvit Lahore Page 81


Course: CCNA

CPE is called CSU (Channel Service Unit) /DSU (Data Service Unit). If you are using
Frame Relay service then your CPE is called Frame Relay CSU/DSU. If your WAN
service is X.25 then your CPE is called Packet Assembler Disassembler (PAD). If
you are using ISDN WAN service then CPE is called NT1. According to the Europe
standard CPE is provided by the service provider but in USA you have to purchase
the CPE by yourself.

Demarcation is the boundary between the service provider network and


customer network. In this case the demarcation will be the cable which connects
service provider to CPE.

WAN Protocols

Point to Point Protocol (PPP): If you want to transfer your data from Lahore
office to Karachi office then you have two options. Either uses a dialup connection
if your data transfer is less required in which you will dial your destination and
when the data transfer is complete then block the connection or use Leased line
connection if your data transfer is frequent where the line will be available only to
you 24 hours. PPP can be used for dialup connection as well as for leased line
connection. Your WAN connectivity can be of two types

1. Circuit Switch Network: Dialup connection and Leased Line connections are
the examples of circuit switch network. ISDN is a Dialup connection while
DXX (digital cross connect) is a Leased Line connection.

2. Packet Switch Network

Before PPP there was another protocol which is called SLIP (Serial Line Internet
Protocol). The limitation of SLIP was that it can only support IP. It works on data
link layer it receives only the traffic from network layer if IP is running on the
network layer otherwise it will not support other protocols IPX, Apple Talk traffic.

Contrary PPP also works on the data link layer but it support all protocols (IP, IPX,
and APPLE TALK) traffic that is why PPP becomes more popular. Now a day PPP is
the default standard in all over the world. 99% PPP is used for dialup connection
and also mostly used for leased line.
Prepared by: Ishaq Ahmad Corvit Lahore Page 82
Course: CCNA

When you activate PPP it passes through three steps. The first step is called LCP
(link control protocol) second step is called authentication (optional) and third
step is NCP (Network control protocol or program).

When you dial a connection then you are observe certain types of noise which is
the process of handshaking that are performed by LCP step of PPP. During the
handshaking process certain agreements are done between source and
destination. One of the important agreements is the speed that at which speed
both modems will exchange data and they decide each other highest speed
available. If both are 56K Modems then both will exchange data on 56K speed but
if one side is 56K and the other side modem is 33K then will communicate on 33K.
If there is some noise in the line then they will try to communicate with their
lowest speed. If the line is too much noise then modems drop the connection.
After speed agreement another they perform authentication. PPP gives two
options for authentication one is called PAP (Password Authentication Protocol)
and other is CHAP (Challenge Handshake Authentication Protocol). Compression
agreement is performed after authentication agreement. Two options are
available for compression one is called Stacker and other is called predicator.
Then error detection agreement is performed after this multi-linking agreement is
done for which multi-linking PPP is used. You can achieve almost double speed by
multi-linking but you have to plug two modems on both sides offices. For multi-
linking the source and destination must be same because multi-linking cannot be
performed between different destinations. All these things come in LCP phase.
Now the second phase means authentication starts in which your username and
password is checked and then when a message comes registering network then it
means that third step NCP start. NCP is that phase in which actual data is
exchanged. NCP receives traffic from network layer and have different
components. Now which one component is active it depends on the protocol
which is running on network layer. If IP is running on the network layer then NCP
component which is activated is called IPCP, when IPX is running on network layer
then NCP activate its IPXCP component and if apple talk is running then NCP
activate its APCP component. Because of NCP components PPP support all
protocols.

Prepared by: Ishaq Ahmad Corvit Lahore Page 83


Course: CCNA

If you want to activate PPP on your serial interface then you will use command

A (config-if) encapsulation PPP (enter)

By default HDLC is activated on serial interfaces of a router.

Lecture no-26

Frame Relay: Frame Relay is a data link layer technology and it can use any
standard of physical layer. Now when you want to connect with the service
provider CO switch then you need CPE and the frame relay CPE is called Frame
Relay CSU/DSU and the connection between CO switch and CPE is called Local
loop or local leap. Some routers have built in CSU/DSU.

Frame Relay belongs to Packet Switch network. There are two types of networks
one is called SVC (Switched Virtual Circuit) and the other is PVC (Permanent
Virtual Circuit). In case of circuit switch network if you are using dialup or leased
line connection you are assigned a physical dedicated circuit. For example if PTCL
have 1000 lines circuit capacity from Lahore to Karachi. It means that 1000 people
can simultaneously talk from Lahore to Karachi but if 1001th person wants to
communicate from Lahore to Karachi then he will receive a message that all lines
are busy at the moment please try later. Now in case of voice communication if
you are using dialup or leased line then 40 to 50 percent silence period or gap
occurs but you have occupied the line on other person can use the line at that
time which is very inefficient use of the network resources. This inefficient
utilization of network occurs because of the circuit switching technology which is
basically designed for voice communication. For data communication in circuit
switching the silence periods are more because when you are typing an e-mail
now you have occupied the link but not utilizing during typing or if you have
downloaded page and reading it the link is still occupied by you but become idle
during the reading time.

Therefore for data communication Packet Switched Network was introduced in


which no one is assigned a dedicated or fixed circuit for communication. Let us
assume that a train with 30 portions which travel from Lahore to Karachi regularly

Prepared by: Ishaq Ahmad Corvit Lahore Page 84


Course: CCNA

now in this case it means that we have 30 channels available from source to
destination but there is no fixed reservation for any one in case of packet
switching because a person will load its luggage in that channel which is available.

In packet switching a user is assigned virtual circuit instead of physical circuit. SVC
is not used in case of Frame Relay because PVC is used in it. SVC works similar to
Dialup in which when you send data then you establish a connection because
there is no permanent connection in this case while PVC is similar to leased line
where it is always connected.

For the PPP connection negotiation different parameters like LCP is used similarly
to establish a virtual connection or to negotiate it’s parameter a standard is used
in Frame Relay which is called LMI (Local Management Interface). Frame Relay is a
connection oriented protocol for data communication.

LCP in PPP negotiates only end to end parameters. It means that when you dial an
ISP you modem only perform handshaking with the ISP modem leaving the in
between switches. But LMI perform negotiation with your router and local Frame
Relay switch or exchange. It is similar as your modem is negotiating with your
local exchange. In 11.2 or earlier version of IOS you have to select the LMI type
manually but you have to select that type of LMI which is your Frame Relay
switch. It means that you have to configure that type of LMI on your router which
is configured on the service provider side. Your service provider will tell you that if
you configure this type of LMI on your router then you can communicate or
negotiate with our Frame Relay switch. There are three types of LMI

1. CISCO

2. ANSI

3. Q933A

You have to configure one of these three LMI type of your router but it depends
which one is configured on your service provider Frame Relay Switch. After 11.2
versions of IOS it is auto detect on your router whenever you connect your router

Prepared by: Ishaq Ahmad Corvit Lahore Page 85


Course: CCNA

with the frame relay switch then it detect the type of LMI automatically and
configure it. There are two types of encapsulation of frame relay on data link layer

1. CISCO

2. IETF (Internet Engineering Task Force)

Now which one you will use it depends on the router on remote site to whom you
are establishing a virtual circuit. If the router on remote site is of CISCO then you
will use CISCO encapsulation and if it is other than CISCO router then you will use
IETF encapsulation.

If you want to dial the remote site then you must need some identification. For
example if you want to call someone then you need to know his number. In case
of frame relay the identification is called DLCI (Data Link Connection Identifier). In
frame relay every virtual circuits has identification rather than individuals. Every
virtual circuit is identified by two DLCI. Let’s assume that virtual circuit is a pipe
and there are two ends of a pipe and you have assigned one DLCI to each end.
Service providers will give you DLCI number after configuring on his side which is
unique throughout the frame relay cloud. On layer-3 for identification IP
addresses are used but in this case all the IP addresses will be of the same address
because it can go to multiple destinations.

When you get connection in Frame Relay then you must specify how much
bandwidth you need which is called CIR (Committed Information Rate). The
concept of CIR means that service provider will guarantee that whenever you
send your traffic every time you will get at least this bandwidth and if the network
condition allows us then we can give you more bandwidth at that time which is a
commitment of the service provider. This extra bandwidth called committed burst
rate. Committed burst is actually the CIR of some other person which is not using
the connection at that time therefore it is not sure when that person wants to use
the connection then this bandwidth is taken away from you. If you purchase 64K
CIR then service provider give 64K at every time. For example if the service
provider has 1000K bandwidth and they want to subscribe 10 connections then
each connection will be of 100K but if they want to increase the number of
Prepared by: Ishaq Ahmad Corvit Lahore Page 86
Course: CCNA

connections then they must decrease each subscriber bandwidth. During load or
congestion on frame relay switch it generate two types of messages one is called
BECN (Backward Explicit Congestion Notification) which sends a notification to the
source that don’t send me more data because there is load on me or I am facing
congestion this time and the other one is called FECN (Forward Explicit
Congestion Notification) which inform the destination that don’t expect more
data from me because I am facing congestion therefore delay your
acknowledgement.

Lecture no-27

Configuration of Frame Relay

Frame relay configuration is done on your router serial interface which is


connected with the frame relay cloud of the service provider. You will give the
command on serial interface.

A (config-if) # encapsulation frame-relay

In other case like PPP and HDLC you only configure IP addresses on both side of
the serial link and run encapsulation of either PPP or HDLC and they start
communicating with each other but in case of frame relay when you give IP
addresses and encapsulation command on both sides of the serial interfaces then
still they are unable to ping each other. The reason is that when you assign IP
addresses to the interface but frame relay cloud is unable to recognize the layer 3
address because if it is a point to point link then there is only one destination of
the packet but in this case when the router exit the packet from its serial interface
then it travel in the frame relay cloud. Therefore you will send the packet address
to the frame relay cloud which frame relay understand and we know that frame
relay only understand DLCI number. You have to link layer 3 IP address with layer
2 DLCI number for exact communication. Therefore you must perform mapping of
IP address into DLCI number in order to send traffic through frame relay cloud.
You have to manually map remote IP with its local DLCI number as:

Prepared by: Ishaq Ahmad Corvit Lahore Page 87


Course: CCNA

A (config-if) # frame relay map remote_IP_address local_DLCI_number


[ietf/cisco (if your remote route is of cisco then write cisco otherwise write ietf)]
[broadcast] (enter)

You will give this map statement on both sides otherwise they will not
communicate. If you want to ping your own IP address then again perform
mapping for your own address.

There is no broadcast in case of frame relay but if you want to perform then you
will mention the keyword broadcast with the mapping statement of that router
then only this router will receive broadcast not others. It is a good practice to add
the broadcast keyword in every mapping command in order to avoid routing
problems. If your router is connected with every other router in frame relay then
it is called fully meshed topology and if it is connected with some routers but not
all then it is called partial mesh topology and if your router has a connection with
the central router and also with some other routers then it is called hub-and-
spoke topology.

NBMA: It stands for Non Broadcast Multiple Access. In LAN when one device
generate a broadcast then it is visible to all other devices connected to the LAN
but in case of WAN there is a point to point connection between two devices
which allows you to access multiple devices without broadcast. In this case if you
want to view other devices your broadcast you have to manually add a keyword
broadcast with his IP address otherwise he will be unable to see your broadcast.

The main problem associated with NBMA is Split Horizon which means that when
a router receive routing updates on an interface he will not send that routing
updates out on the same interface. Split horizon create problems in routing
where central router have one VC with multiple other routers and that routers
are not directly have VC with each other and will send routing updates through
central router. This problem can be solved either by using fully meshed topology,
or using static routing, or disable split horizon or defining logical sub interfaces.
But the most appropriate method is the sub interfaces in which a physical

Prepared by: Ishaq Ahmad Corvit Lahore Page 88


Course: CCNA

interface is divided into sub logical interfaces and each logical interface different
subnet id to overcome the problem of split horizon.

Lecture no-28

There are two types of sub interfaces one is called point to point sub interface
and the other is point to multi point sub interface.

In point to point sub interface one physical interface is divided into multiple
logical sub interfaces and each logical sub interface is connected to separate
neighbor. In point to multi point sub interface you can connect one logical sub
interface to multiple neighbors and each sub interface IP address will have
different subnet IP. For the configuration of sub interfaces first of all you will go to
the main interface as:

A (config-if) # encapsulation frame-relay (enter)

A (config-if) # no IP address (enter. You will not assign IP address to main interface
because you will assign IP addresses to sub interfaces)

Now again come to the global configuration mode and enter the following
command

A (config) # interface serial2.2 point-to-point (enter. You will enter into the sub
interface config mode)

A (config-subif) # IP address x.x.x.x subnet_mask (enter)

A (config-subif) # frame-relay interface-dlci 102 (enter. It associate this interface


to 102 dlci)

There is no need of mapping in case of sub interfaces because each sub interface
is connected to only one neighbor.

Similarly for point to multipoint sub interface configuration we do the following:

A (config-if) encapsulation frame-relay (enter)

A (config-if) no IP address (enter)


Prepared by: Ishaq Ahmad Corvit Lahore Page 89
Course: CCNA

A (config) # interface serial2.3 multipoint (enter)

A (config-subif) # IP address x.x.x.x subnet mask (enter)

A (config-subif) # frame-relay interface-dlci 103 (enter)

A (config-subif) # frame-relay interface-dlci 104 (enter)

Lecture no-28

Switching

Hub is an old device which is used in start topology to interconnect devices now a
day switch is used instead of hub. It is called LAN switch and logically it is the
central location for every device connected to it. If the speed of hub is 10
megabits per second then this speed is shared by all the computers connected to
it because Ethernet is a shared medium. For example if 10 computers are
connected to this hub and everyone is allowed to use the medium for 1 second
then the average data transferred by all the computers are 1 megabits per
second. Average speed can be calculated by total data transfer divided by total
time and one computer can send 10 Mbps in 10 seconds therefore 10/10 = 1
Mbps. This is because of using the shared medium. By increasing the number of
computer it will decrease the network performance in case of shared medium.
You cannot increase number of computers from a specific range in case of hub. In
contrast if has 10 mbps switch then it means that 10 mbps speed is available on
each port of the switch. Switch does not divide its speed on all of its interfaces
like hub. Therefore when you increase the number of computers in switch then it
will not decrease performance. In case of switch multiple simultaneous
communications can take place in your network. There is no collision in switches
because the communication of switches are full duplex while in hub the
communication is half duplex that is why collision can occur. Communication can
be of three types

Prepared by: Ishaq Ahmad Corvit Lahore Page 90


Course: CCNA

1. Simplex communication: One way communication means that one will


speak the other will only listen. E.g. Radio, TV or one way road etc.

2. Half duplex communication: Two way communication but one at a time


not simultaneous. Example is walki talki

3. Full duplex communication: Two way communication at the same time.


E.g. telephone.

Collision domain and Broadcast domain: if one person is talking in the room and
at the same time another person also starts talking in the same room then
collision of data occur in the same collision domain or room. Devices connected to
the hub are always in the same collision domain. Second example is that when
one person is talking in one room and another person is talking in another room
then they are in different collision domain or different rooms. Therefore devices
connected to the switch are always in different collision domain. If there are 24
ports in a switch then we say that 24 collision domains exist in this switch and 24
people can talk with each other simultaneously without any collision. Now in case
of hub if there are 12 ports then we can say that it is a single collision domain in
which only one person can talk to other at one time otherwise collision will occur.
When you connect multiple hubs with each other then all hubs come in one
collision domain. Router each port is in different broad cast domain while hub and
switch is single broadcast domain.

There are mainly three types of switching.

 Store and forward switching: In store and forward switching switch


receives a frame and store it in its buffer when the frame become complete
then it forwards the frame. The disadvantage of store and forward
switching is latency (delay). Error detection can be performed in this type
because CRC is stored in the trailer of the frame.

 Cut through switching: In this type of switching switch receives the frame
and at the same time it forward it to the destination port. In cut through
type switch receives first 8 bytes of frame which contain destination

Prepared by: Ishaq Ahmad Corvit Lahore Page 91


Course: CCNA

address and send it to the destination without waiting for the remaining
frame. Cut through switching is faster than store and forward switching. No
error detection can be performed because it does not wait for the trailer.

 Fragment free switching: Fragment free switching falls in between store


and forward, and cut through switching in which 64 bytes are stored before
forwarding the frame to the destination.

Switch performs five operations i.e. learning, flooding, forwarding, filtering and
ageing. Switch builds a switching table where it stores MAC addresses of the
exiting interfaces. Initially when the switch is on it does not know about any MAC
address running outside their interfaces. When the switch receives a frame for
unknown destination MAC address or broad cast messages then it will flood the
frame on all of its ports except receiving one. Then switch learn the MAC address
of the sending device and store it in the switching table as port-no/ MAC address
or entering the source MAC address along with associated port number in the
switching table is called learning. When the switch sends the traffic for known
destination then it is called forwarding process. Before forwarding the frame
other ports perform some processing to know whether it is for him or not which is
called filtering process. Ageing means when for a specific period of time the
computer do not respond then delete its entry from the switching table.

Lecture no-29

Spanning Tree Protocol (STP)

In large software houses where for example exist two segments. On one segment
programmers are working and on the other segment, the quality insurance is
working. When the programmer writes some code then he sends it to the quality
insurance. These two segments are connected through switches because if they
connected through straight wire then the broadcast problem can occur. Now if
we connect these two segments through a single switch then there is a possibility
that this switch can be corrupted. Therefore due to the security and reliability
reason we have plugged redundant switches between these two segments so that
when one switch fails then the redundant switch will work as a backup.
Prepared by: Ishaq Ahmad Corvit Lahore Page 92
Course: CCNA

But redundant switches create layer-2 looping problems. For example if one
computer from segment-1 wants to communicate with another computer then
for the first time when there is no entry of the destination computer in the MAC
table, switch1 flood this request to all of the ports except the incoming port.
When this message reaches to the redundant switch he also flood the frame
across their ports and again the frame reaches to switch1 and therefore again
switch1 will broadcast this frame due to which a loop will be created which is
called switching loop or spanning tree. This loop can consume all of your network
resources and no communication can take place. One solution of this problem is
to manually disable the port of the switch which creates this loop so that the loop
can be broken and the frame never travels the second segment. Another solution
is the spanning tree protocol.

When one switch is down another is automatically up, this work is performed by
spanning tree protocol. This protocol avoids the spanning tree which detects
automatically that which ports needs to be block and which one needs to be keep
up. In order to run STP switches need to share information which is called BPDUs
(Bridge Protocol Data Units)

Spanning Tree Protocol Algorithm

This algorithm addresses five components

1. Root Bridge or switch

2. Non Root Bridges

3. Designated port

4. Root port

5. Non designated port

Root Bridge or Switch

It is the most powerful and head of the network bridge/switch. To make this
bridge, proper election is conducted in the network among the bridges/switches.

Prepared by: Ishaq Ahmad Corvit Lahore Page 93


Course: CCNA

The switch/bridge having less priority number or less MAC address wins this
election. In the election process first priority number is checked, when the priority
numbers of all the switches are same then election is done through MAC address
now that switch who has low MAC address than all others he wins the election
process and elected as a root bridge while the remaining switches/bridges are
called non root bridge.

By default all CISCO switches has 32768 priority number which can be changed.

Designated Port

A single port on each segment which is used to connect the segment with the root
bridge is called designated port. Designated port can also be selected through
election process. There is only one designated port per segment. Priority number
of a switch is also a number of a port. Ports election also takes place through the
priority number or MAC address. Therefore port on a segment having less priority
number or MAC address is called designated port. The same election process is
performed on the other segment. The connected switch on the segment with the
lowest accumulated path cost to the root bridge will be used.

Root Port

Root port always elected on a non-root bridge. After the root switch is elected,
every other switch in the network needs to choose a single port on itself that it
will use to reach the root. This port is called the root port or the port which
connects the switch to the root bridge is called root port. If there are more than
one port reaching to the root bridge then the port having lower cost (which is
invers of bandwidth) is consider the root port.

Non Designated Port

The port which is neither a designated nor root port is called non designated port.

Prepared by: Ishaq Ahmad Corvit Lahore Page 94


Course: CCNA

VLAN (Virtual Local Area Network)

If we have a switch to which technical and marketing departments are connected.


Now when computer “A” of marketing department wants to communicates for
the first time with a computer “B” of a technical department, then broadcast will
occur that will receive all other computers on the switch. It means that
information is broadcasted on a single broad cast domain, which increases traffic
on the switch and also a security threat.

According to the “VLAN” groups are constructed on the switch i.e.

“Dividing logically the switch into groups where each group is called VLAN. This is
done through configuration to reduce the broadcast in order to enhance security”
or

“To split a single broadcast domain into multiple broadcast domain is called
VLAN.”

By default there exist a VLAN called VLAN1 and all the ports are the members of
default VLAN1.

Trunk port

Switch 1 100mb Switch 2

10mb 11

Access port E0

Types of Switch Ports

Access port: A port to which computer or Hub is attached is called access port.

Trunk port: A port is said to be trunk port if another switch is attached to this port
and the link through which switches are connected is called trunk link which will
be at least fast Ethernet 100 mbps.

Prepared by: Ishaq Ahmad Corvit Lahore Page 95


Course: CCNA

Models of Cisco switches: 2950, 2900, 2915, 295000, 3560, 3550

Trunk link carries multiple VLAN data. There are two types of trunking protocols
which enable trunk link to carry multiple VLAN data. These are

CISCO ISL (inter switch link) which is developed by CISCO and another is IEEE
802.1q developed by IEEE.

Consider the following commands:

A # show VLAN (enter. It will display the default VLAN1 and all the ports are the
member of this default VLAN1)

A (config) # VLAN2 (enter. It creates another vlan2)

A (config) # show VLAN2 (enter)

How to make a port as a member of a VLAN

A (config) # interface fastEthernet 0/1

A (config) # switch port mode access (enter. When the computer is attached)

A (config) # switch port access VLAN2 (enter)

A # show VLAN (enter)

A # ping 10.1.1.2 (enter. No ping will occur)

Now the other port to which computer A is attached, we will make it part of
VLAN2 as:

A (config) # interface FastEthernet 0/2 (enter)

A (config) # switch port mode access (enter)

A (config) # switch port access VLAN2 (enter)

Port 1 and port 2 are now members of the VLAN2. Now ping will be successful. It
means that if both ports are the member of same VLAN then ping will be
successful otherwise not.
Prepared by: Ishaq Ahmad Corvit Lahore Page 96
Course: CCNA

A (config) # VLAN3 (enter. It will create third VLAN)

A (config) # interface FastEthernet 0/3 (enter. Making port 3 as a member of


VLAN3)

A (config) # switch port mode access (enter)

A (config) # switch port access VLAN3 (enter)

A (config) # no VLAN3 (enter. It will remove VLAN2)

VLAN Trunking Protocol (VTP)

VTP is used by the switches to advertise VLAN configuration information. For


example if you have created, deleted and renamed any VLAN on a switch then
VTP advertise this information to other switches. VLAN information is consistence
throughout the VTP domain due to this which is a big advantage.

VTP Mode: It means that a switch having VTP can be placed in one of the three
modes.

1. Server

2. Client

3. Transparent

Server Mode: if I create any VLAN, or rename any VLAN in this mode on a switch
A then same information is advertised to switch B and to switch C. It means that if
switch A is in server mode and I create a VLAN then this VLAN will also be created
on switch B and C. There is no need to go on switch B and C to create VLAN. If
your network has maximum number of switches then use this mode for this you
make a CISCO switch as server and create VLAN on it which will be created on
other switches as well. Remember that if you delete the VLAN then it will also be
deleted from other switches, similar is the case of renaming in server mode. All
these information are stored in NVRAM.

Prepared by: Ishaq Ahmad Corvit Lahore Page 97


Course: CCNA

Client Mode: If a switch is in client mode, then it must follow the instructions of
server. A VTP client switch cannot make changes to its VLAN configuration itself. It
requires a server switch to tell it about the VLAN changes. When a client switch
receives a VTP message from a server switch, it incorporates the changes and
then floods the VTP message out its remaining trunk ports. An important point to
make is that a client switch does not store its VLAN configuration information in
NVRAM. Instead, it learns this from a server switch every time it boots up.

Transparent Mode: In this mode a switch is just like a server in which you can
create, rename and delete VLAN but it does not implements on other switches. It
does not share and advertise their information to other switches. It means that if
a VLAN is created on a switch in transparent mode this VLAN will not be created
on other switches. If a server mode switch creates a VLAN then it will neither be
created on transparent mode switch nor save this configuration in their NVRAM,
instead, it will advertise this configuration to other switches.

By default switches are in server mode.

Switch A# show interfaces trunk (enter. It will show that how many ports on your
switch is in a trunk state)

Switch B# show VTP status (enter. It will give information related to VTP. Like VTP
operating server, VTP operating Domain name, configuration revision)

Configuration revision: When we configure VLAN on a server mode, then switch


in a server mode advertise this thing and this advertisement is added in a client
mode switch as a revision number 1. When we delete a VLAN it is revision number
2. It helps the client, that it’s new information or old information.

For example we have two switches A and B. We are making switch A as a server
and switch B as a domain. By default switch A is in server mode therefore no need
to change its mode. We have to make switch B as a domain and will assign it
name as cisco. You can perform this in the following two steps.

a. Create a domain

Prepared by: Ishaq Ahmad Corvit Lahore Page 98


Course: CCNA

b. Make switch B as a client of the domain

By default both switches are in server mode. You can check it through “show vtp
status” command for both switch A and B. now first create the domain

A (config) # vtp domain cisco (enter. Domain name is cisco which will also
displayed on switch B. check by show vtp status command. it will also show
configuration revision number 1)

Now make switch B client as:

B (config) # vtp mode client (enter. Mode is not advertise)

B# show vtp status (enter)

Now I am going to create VLAN on switch A as:

A # show VLAN (enter. It will show information about VLAN on a switch A)

A (config) # VLAN 10 (enter. It will create VLAN 10)

A (config-VLAN) # name Sales (enter. It is the name of VLAN10)

A # show vtp status (enter. Now it will show VTP operating servre, VTP Domain
Names cisco, configuration Revision 1)

Now go to switch B

B # show vtp status (enter. It will also show VTP operating client, VTP Domain
cisco and configuration revision)

A (config) # no VLAN (enter. It will remove VLAN )

How to make transparent mode on a switch

B (config) # VTP mode Transparent (enter. It will create a transparent mode)

B (config) # VLAN 20 (enter. It will create VLAN 20)

B # show vtp stauts (enter. It will show vtp operating transparent, vtp domain
name server, configuration revision 1 which is always remain the same)
Prepared by: Ishaq Ahmad Corvit Lahore Page 99
Course: CCNA

Port Security

Port security is that mechanism through which you can fix a port to a specific
computer so that when this computer is plugged in then port will be enable
otherwise disabled which can be done through MAC address.

B # Show MAC_address table (enter. It will show switch table or mac address
table)

B (config) # interface FastEthernet 0/1 (enter. It will go to the specified interface


mode)

# Switch port mode access (enter. You have to made an access port not trunk)

# switch port port-security MAC-Address 000aaffccbb (enter. By default all the


ports are trunks so we have to made it forcefully as no because computer has to
attached in front of it)

The above command is an instruction to this port that when a computer having
the above MAC address is attached to you then become active otherwise remains
disabled.

If you want to enable then attach this computer which computer MAC address is
matched and give the following commands:

A (config) # interface FastEthernet 0/1 (enter)

A (config) # shut down (enter)

A (config) # no shut down (enter)

When you perform configuration then save it with the following command

A # copy run startup (enter)

Prepared by: Ishaq Ahmad Corvit Lahore Page 100

You might also like