Schedule
IP Address
Subnet Mask
Broadcast IP Address
OSI Model
Routing Fundamentals
Sub-netting
1
CCNA Training Document Mohan’s Networking Institute
1. NETWORKING-BASICS
Ethernet
• Ethernet uses only one cable that is used to connect all over the world –
RJ45/CAT 5/CAT 6/10 baset. Earlier Token ring was used in Ethernet.
• Types
1. Broadcast Multi-Access: All systems are connected to the network and
only the addressed system receives the packets. First messages are
broadcasted, addresses are received and then the packets are unicasted.
F
RJ45 R RJ11 O RJ11 R RJ45 Server
O
Router Telecom
Ethernet (Fibre Optics)
• Data in a network is packed such that it travels in a any media such as
RJ45,fibre optics etc.,
2
CCNA Training Document Mohan’s Networking Institute
Private
secured
R R
leased line Server
Router Router
Ethernet
Public
network
• MAC Address – Media Access Control Address. No two network cards will have the
same MAC addresses.
TCP UDP
3
IP ARP RARP ICMP IGMP
CCNA Training Document Mohan’s Networking Institute
2. IP ADDRESS
4
CCNA Training Document Mohan’s Networking Institute
• Network Classifications
Class A
NID HID
(Network ID) (Host ID)
NID – 8 bits.
HID – 24 bits.
Network ID
There 8 bits and so - 28 networks are possible = 256 networks. These 0-255 values in
first octet are shared among other classes also. We have values ranging in 0-127 for
Class A.
I octet
0 0 0 0 0 0 0 0
MSB LSB
1 1 1 1 1 1 1
128 64 32 16 8 4 2 1
Host ID
If the hosts IDs are ‘0’ then it represents the Network and not the host. If the hosts
IDs are ‘1’ then it represents the Broadcast address for the particular network.
5
CCNA Training Document Mohan’s Networking Institute
E.g.
10.0.0.0 ----------- Network Address(All HID ‘0’)
10.0.0.1 ----------- First Host IP Address(All HID
‘0’except the least)
10.255.255.254 ----------- Last Host IP Address(All HID
‘1’except the least)
10.255.255.255 ----------- Broadcast IP Address(All HID ‘1’)
Class B
NID HID
(Network ID) (Host ID)
NID – 16 bits.
HID – 16 bits.
Network ID:
I octet
1 0 0 0 0 0 0 0
MSB LSB
1 1 1 1 1 1
128 64 32 16 8 4 2 1
Host ID
If the hosts IDs are ‘0’ then it represents the Network and not the host. If the hosts
IDs are ‘255’ then it represents the Broadcast address for the particular network.
E.g.
170.27.0.0 ----------- Network Address
170.27.0.1 ----------- First Host IP Address
6
CCNA Training Document Mohan’s Networking Institute
Class C
NID HID
(Network ID) (Host ID)
NID – 24 bits.
HID – 8 bits.
Network ID
I octet 1 1 0 0 0 0 0 0
MSB 1 1 1 1 1 LSB
128 64 32 16 8 4 2 1
Host ID
If the hosts IDs are ‘0’ then it represents the Network and not the host. If the hosts
IDs are ‘255’ then it represents the Broadcast address for the particular network.
E.g.
194.21.16.0 ----------- Network Address
194.21.16.1 ----------- First Host IP Address
194.21.16.254 ----------- Last Host IP Address
194.21.16.255 ----------- Broadcast IP Address
Class D: Class D can have 224 – 239 networks. They are used for Multicasting.
Class E: Class E can have 240 – 255 networks. They are used for Research purposes.
Note: From the above given addresses some addresses are reserved for the private
networks. They are,
10.0.0.0 --------- A
7
CCNA Training Document Mohan’s Networking Institute
Broadcasting:
Broadcast involves delivering a message from one sender to many recipients. This
broadcast is 'limited' in that it does not reach every node on the Internet, only nodes on
the LAN.
Broadcast address is found by ORing the IP address and the bit complement of the
subnet mask.
SUMMARY
OSI Model
Application
(International Layer
Standard Organisation)
TCP/IP Model
(Department of Defence,US) Presentation Layer
4
Session Layer
3
Transport Layer
2
Network Layer
1
Data Link Layer
Physical Layer
PHYSICAL LAYER
AMP
9
CCNA Training Document Mohan’s Networking Institute
87.5 m (accurately)
100m cable
• If there are more then two systems,connecting them to each and every systems are
not possible.In such cases we use Hub or Switches to connect the systems.
HUB
1 3 4 5
HUB
10
CCNA Training Document Mohan’s Networking Institute
2 4 6 8
In a hub with 8 ports, each connected to a system.If system-1 has to send data to
system-8 it sends data to system-8 and also to all other systems that are connected to the
hub. If the data transfer rate is 10 mbps that is shared to send data to all the systems.
• Full Duplex
If transmission takes place in one line and data is received in another line,
it is said to be in Full Duplex.
• Half Duplex
If transmission and received in same line, it is said to be in Half Duplex.
I A
P T
IP
X 11
CCNA Training Document Mohan’s Networking Institute
10.0.0.0
Router
NETWORK LAYER
• This layer concentrates on routing the packet to the destination in the best route.
Router
• In the following figure there are 4 data links between the the two networks.
12
CCNA Training Document Mohan’s Networking Institute
TRANSPORT LAYER
Segments: The exchanged between the communicating hosts are called the
segments. This layer packetizes(i.e. turns into segments). The size of the
segment ranges to less than or equal to the MTU(Maximum Transmission
Unit=1500 bytes).
Sequence numbers
Check sum
Acknowledgement
Error checking
Windowing
3-way handshake
Port numbers
HTTP-80
FTP-21- CONTROL,20 - DATA
SMTP-25
TELNET-23
POP3-110
SESSION LAYER
• The session layer allows users on different machines to establish
sessions between them. A session management takes place whenever a session
opens and ends.
• If the port is inactive for a particular period of time the port is reset
(the session is closed).
• Source Quench: It is a message from one host to another host
saying that to reduce the speed of data transfer. It is one way to control data flow
over the network.
13
CCNA Training Document Mohan’s Networking Institute
PRESENTATION LAYER
• This layer is concerned with the presentation of data that is transferred between
two application processes.
• It ensures that the date exchanged between them has a common meaning – Shared
semantics.(common presentation style)
• Data are transferred in Binary or ASCII format .
• If any compression or encryption are needed they are also agreed upon.
APPLICAION LAYER
• This layer ensures that it provides service for an application program to
communicate with other application program in the network.
• This layer concentrates on,
Communication partners
Quality of service
User authentication
Constraints on data.
NOTE:
A
PL SL TL NL DL PL
L
14
CCNA Training Document Mohan’s Networking Institute
Ans : d,e and f takes part in all layer activities.They are all hosts.
5. ROUTING FUNDAMENTALS
• Concepts
Routing Table
Default Gateway
• Windows DOS Commands
Ipconfig
Ipconfig /all
Route Print
Route Add
Route Delete
Ping
arp –a
tracert
• Protocols
ICMP
ARP
ROUTING TABLE
A routing table is a database in which a routing protocol stores information about
the network layer topology of the intranet work (The IP Addresses are looked up here
before the packets are being routed).
Routing table can be built in two ways:
1. Manual
Route add <destn> MASK <destn SM> <Next Hop>
(Forwarding Router)
Echo Request
Echo Reply
15
CCNA Training Document Mohan’s Networking Institute
50.0.0.0 70.0.0.0
30.0.0.0 R1 R2 R3 90.0.0.0
30.0.0.1 50.0.0.1 70.0.0.2
• While pinging a host from the source,If the host/network is not configured with
the router and if it does not identify the destination system in the routing
table,then the following ICMP message is generated,
• While pinging a host from the source,If the host is connected and configured to
the router, the host sends all its messages to the router and then forwarded to the
destination. Now if the router is enable to identify the destination IP Address in
the routing table,then the following ICMP message isgenerated,
• While pinging a host from the source,If the destination host is not connected to
the network or if the cable is loosely connected or if the destination host does not
respond to the source request then the
following ICMP error message isgenerated,
arp –a
This command is used to obtain the MAC address of the destination host.
• C:\>arp -a
• C:\>arp –d 10.0.0.1
Deletes the MAC address of the particular host.
tracert
The tracert command is used to visually see a network packet being sent and
received and the amount of hops required for that packet to get to its destination.
16
CCNA Training Document Mohan’s Networking Institute
C:\>tracert
Usage: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name
Options:
-d Do not resolve addresses to hostnames.
-h maximum_hops Maximum number of hops to search for target.
-j host-list Loose source route along host-list.
-w timeout Wait timeout milliseconds for each reply.
C:\>tracert 9.184.45.148
6. SUBNETTING
Subnetting is the process of subdividing your networks into subnets that are
meaningful, for the effective management of IP Address.With the help of mathematical
functions we divide network itno subnets. Due to this congestion is controlled.
a. If 9.0.0.5 sends a packet to 9.0.0.3 hub copies and sends the packet to all the other
hosts also(Broadcasts).Once it broadcasts it receives the MAC address, it unicasts to
every hosts.Here packet is received by only the destination that matches the To
address(MAC address).
17
CCNA Training Document Mohan’s Networking Institute
9.0.0.2 9.0.0.3
9.0.0.5 9.0.0.4
HUB
b. In case if a hub is replaced by the switch, intially it broadcasts and receives the MAC
address.After that the switch sends the packet only to the particular destination host and
doesnot send copies to other systems.
c. In case if a router is replaced with the switch/hub, broadcasting and unicasting takes
place.But it ensures that the MAC address doesnot cross the particular network/LAN.
To get 2 subnets,
2n-2>=no of subnets
21-2=2-2=0 subnets
22-2=4-2=2 subnets.
Hence to get two subnets, we need to borrow 2 bits from the host id.
128 64
NID HID
To get 6 subnets,
2n-2>=no of subnets
21-2=2-2=0 subnets
22-2=4-2=2 subnets.
23-2=8-2=6 subnets
Hence to get 6 subnets, we need to borrow 3 bits from the host id.
128 64 32
NID HID
To get 14 subnets,
2n-2>=no of subnets
21-2=2-2=0 subnets
22-2=4-2=2 subnets.
19
CCNA Training Document Mohan’s Networking Institute
23-2=8-2=6 subnets
24-2=16-2=14 subnets
Hence to get 14 subnets, we need to borrow 4 bits from the host id.
128 64 32 16
NID HID
So, The no of hosts possible in each subnet = 220-2 = 1048576-2 = 1048574 hosts.
To get 23 subnets,
2n-2>=no of subnets
21-2=2-2=0 subnets
22-2=4-2=2 subnets.
23-2=8-2=6 subnets
24-2=16-2=14 subnets
25-2=32-2=30 subnets
20
CCNA Training Document Mohan’s Networking Institute
Hence to get 23 subnets, we need to borrow 5 bits from the host id.
128 64 32 16 8
NID HID
So, The no of hosts possible in each subnet = 219-2 = 524288-2 = 524286 hosts.
To get 45 subnets,
2n-2>=no of subnets
21-2=2-2=0 subnets
22-2=4-2=2 subnets.
23-2=8-2=6 subnets
24-2=16-2=14 subnets
25-2=32-2=30 subnets
26-2=64-2=62 subnets
Hence to get 45 subnets, we need to borrow 6 bits from the host id.
21
CCNA Training Document Mohan’s Networking Institute
128 64 32 16 8 4
NID HID
So, The no of hosts possible in each subnet = 218-2 = 262144-2 = 262142 hosts.
To get 2 subnets,
2n-2>=no of subnets
21-2=2-2=0 subnets
22-2=4-2=2 subnets.
23-2=8-2=6 subnets
24-2=16-2=14 subnets.
25-2=32-2=30 subnets
26-2=64-2=62 subnets.
27-2=128-2=126 subnets
28-2=256-2=254 subnets
Hence to get 75 subnets, we need to borrow 7 bits from the host id.
22
CCNA Training Document Mohan’s Networking Institute
And to get 150 subnets, we need to borrow 8 bits from the host id.
128 64 32 16 8 4 2
NID HID
128 64 32 16 8 4 2 1
NID HID
Therefore the subnets are,
75 subnet 150 subnet
10.2.0.0 10.1.0.0
10.4.0.0 10.2.0.0
10.6.0.0 10.3.0.0
| |
10.150.0.0 10.150.0.0
75 subnets
Class Subnet FHID LHID BroadCast SubnetMask
A 10.2.0.0 10.2.0.1 10.3.255.254 10.3.255.255 255.254.0.0
A 10.4.0.0 10.4.0.1 10.3.255.254 10.3.255.255 255.254.0.0
150 subnets
Class Subnet FHID LHID BroadCast SubnetMask
A 10.1.0.0 10.1.0.1 10.1.255.254 10.1.255.255 255.255.0.0
A 10.2.0.0 10.2.0.1 10.2.255.254 10.2.255.255 255.255.0.0
……. ………. ……….. …………….. …………….. …………
A 10.150.0.0 10.150.0.1 10.150.255.254 10.150.255.255 255.255.0.0
1+(0)=1 128+64+32+16+8+4+2+1=255
-----------------------------------------------------------------------------------------------------------
-
To get 9 subnets,
2n-2>=no of subnets
21-2=2-2=0 subnets
22-2=4-2=2 subnets.
23-2=8-2=6 subnets
24-2=16-2=14 subnets
Hence to get 9 subnets, we need to borrow 4 bits from the host id.
128 64 32 16
NID HID
4 5
To get 99 subnets,
2n-2>=no of subnets
21-2=2-2=0 subnets
22-2=4-2=2 subnets.
23-2=8-2=6 subnets
24-2=16-2=14 subnets
25-2=32-2=30 subnets
26-2=64-2=60 subnets
27-2=128-2=126 subnets
Hence to get 99 subnets, we need to borrow 7 bits from the host id.
128 64 32 16 8 4 2
NID HID
25
CCNA Training Document Mohan’s Networking Institute
To get 2 subnets,
2n-2>=no of subnets
21-2=2-2=0 subnets
22-2=4-2=2 subnets.
Hence to get 2 subnets, we need to borrow 2 bits from the host id.
128 64
NID HID
To get 2 subnets,
2no of bits left-2>=no of hosts
28-2=256-2=254 hosts
27-2=128-2=126 hosts
26-2=64-2=62 hosts
25-2=-32-2=30 hosts-----------------23-2=-8-2=6 subnets
24-2=16-2=14 hosts
Hence to get 23 hosts, we need to borrow 3 bits from the host id so that 5 bits will be left.
128 64 32
26
CCNA Training Document Mohan’s Networking Institute
NID HID
To get 2 subnets,
2no of bits left-2>=no of hosts
28-2=256-2=254 hosts
27-2=128-2=126 hosts
26-2=64-2=62 hosts
25-2=-32-2=30 hosts
24-2=16-2=14 hosts---------------------24-2=-16-2=14
23-2=8-2=6 hosts
Hence to get 11 hosts, we need to borrow 4 bits from the host id so that 4 bits will be left.
128 64 32 16
NID HID
192.168.1.32
192.168.1.48
|
192.168.224.(we borrow 3 bits and so 16*14=224)
To get 2 subnets,
2no of bits borrowed-2>=no of subnets
21-2=2-2=0 subnets
22-2=4-2=2 subnets
23-2=8-2=6 subnets
24-2=16-2=14 subnets
25-2=32-2=30 subnets
Hence to get 17 subnets, we need to borrow 5 bits from the host id.
128 64 32 16 8
NID HID
To get 2 subnets,
2no of bits borrowed-2>=no of subnets
21-2=2-2=0 subnets
22-2=4-2=2 subnets
23-2=8-2=6 subnets
24-2=16-2=14 subnets
25-2=32-2=30 subnets
26-2=64-2=62 subnets
Hence to get 50 subnets, we need to borrow 6 bits from the host id.
128 64 32 16 8 4
NID HID
CISCO ROUTERS
CISCO ROUTER, doesn’t have the monitor so every router needs to be connected
to the console.
• Console is to manage/administor/monitor the router.For the console to be connected
the router needs the console port.To connect the router a cable(RJ45) is provided
with 9 pins.
• For a router there should be atleast 2 ports.
Router
Ethernet Serial console powerpoint
Port port port Aux
Serial port/
Hub Switch WAN port
Power point
Console
30
CCNA Training Document Mohan’s Networking Institute
31
CCNA Training Document Mohan’s Networking Institute
• To set username and password to the router(for the user and priviliged mode)
(For console)
To set password for the user mode,
Router(config-line)#password xxxx
Router(config-line)#login
-enter the pasword
-specify that in the line console mode.
press return to get started
u will be prompted for the password
password: (once u enter the password and press enter)
Router>
Router(config-line)#no login
Router(config-line)#no password
User mode
Disable Exit
Enable mode
Exit
32
CCNA Training Document Mohan’s Networking Institute
Exit
Specific configuration mode
R R
V.35
Router Router
Network Telecom Network
company
Fig-a
• Two networks that are geographically apart are connected with the help of the
telecom company.
• The network cable given by the telecom company to the LAN is the RJ11
cable.But the cable to the router is the RJ45 cable.Hene there should be a
mediator to synchronize the flow. So, Modem is used for that process.
Modem R
RJ11 RJ45
Telecom
Company
HOR BOR
Router(config)interface e 0
Router(config-if)ip address 10.0.0.1 255.0.0.0
Router(config-if)no shutdown
Router(config-if)exit
Router(config)interface s 0
Router(config-if)ip address 20.0.0.1 255.0.0.0
Router(config-if)no shutdown
Router(config-if)exit
Router(config)interface e 0
Router(config-if)ip address 30.0.0.1 255.0.0.0
Router(config-if)no shutdown
Router(config-if)exit
Router(config)interface s 0
Router(config-if)ip address 20.0.0.2 255.0.0.0
Router(config-if)no shutdown
Router(config-if)exit
Router#sh run
Router#sh interface
Router#sh interface e 0
Router#sh interface s 0
Router#sh ip interface brief
Router#sh ip route
Router#sh controllers s 0
34
CCNA Training Document Mohan’s Networking Institute
Router(config)#interface s 0
Router(config-if)#clock rate 64000
• To debug IP packet
Router#debug ip packet
3. DYNAMIC ROUTING
40.0.0.0 50.0.0.0
R R
80.0.0.0
20.0.0.0 30.0.0.0
10.0.0.0 70.0.0.0
R R
60.0.0.0
35
CCNA Training Document Mohan’s Networking Institute
• In the above figure there are 3 different paths to travel from 10.0.0.0 network to
70.0.0.0 network.
• Based on the parameters like distance, bandwidth, no. of hops etc., the best path is
chosen.This work is done by the router based on the routing table.
• The routing protocols helps the router to find the best path.
Dynamic routing
RIP OSPF
IGRP IS-IS
BGP
EIGRP(Hybrid)
36
CCNA Training Document Mohan’s Networking Institute
• RIP decide upon the best route based on the distance and direction(of flow of
packet in terms of E0 and S0) and IGRP decide upon the best route based on
the distance,bandwidth and delay.
• Routing table is broacasted after a particular time.
RIP – every 30 sec
IGRP – every 90 sec.
Every time whether or not the table is changed it is broacasted. This
unneccessarily occupies the bandwidth.
• Each router knew only the adjacent routers.
R 10.0.0.0 S0 1 R 20.0.0.0 S0 1
R 30.0.0.0 S0 1 R 40.0.0.0 S1 1 R 10.0.0.0 S0 2
R 40.0.0.0 S0 2
• During Routing Table broadcasts RIP of R1says to the adjacent router R2 that it is
1 hop for R2.
37
CCNA Training Document Mohan’s Networking Institute
R R R
10.0.0.0 40.0.0.0
1 2 3
20.0.0.0 30.0.0.0
20(1) 20(2)
30(1) 20(1)
30(2) 30(1)
R1 will not advertise its route for R3 back to R2. On the surface, this seems redundant
since R2 will never use R1's route because it costs more than R2's route to R3. However,
if R2's route to R3 goes down, R2 could end up using R1's route, which goes through
R2; R1 would send the packet right back to R2, creating a loop. With split horizon, this
particular routing loop cannot happen.
• This logic did not suit the network with mesh topology. To overcome this ,
1. Route poisoning-Route poisoning is a method of preventing a network
from sending packets through a route that has become invalid. When the
path between two routers in a network goes bad, all the routers in the
network are informed immediately. However, it is possible for this
information to be lost, causing some routers to once again attempt to send
packets over the bad route. This requires that they be informed again that
the route is invalid, and again, this information can be lost.(Routing Loop)
Route poisoning and reverse poisoning are routing loop prevention
techniques used by distance vector routing protocols.
Route poisoning is setting a route's metric to infinity (i.e. max hops+1).
38
CCNA Training Document Mohan’s Networking Institute
• Hold-down time: A function that prevents a router from being updated for a
specified period in order to give other nodes some time to reconfigure and prevent
a routing loop. When a router is notified of a route failure, it starts the hold-down
timer. In the meantime, if a notification of a route is received from its neighbor
with equal or better metrics than the route that failed, the router stops the timer
and updates its routing table. If the new route metrics are inferior, it keeps the
timer running and does not update (possibly down).
RIP
R1(config)#router RIP
R1(config-router)#network 10.0.0.0
R1(config-router)#network 20.0.0.0
R2(config)#router RIP
R2(config-router)#network 20.0.0.0
R2(config-router)#network 30.0.0.0
IGRP
R1(config)#router IGRP 123
R1(config-router)#network 10.0.0.0
R1(config-router)#network 20.0.0.0
R2(config-router)#network 30.0.0.0
Note: 123 is the autonomous systems number.It may range from 1 to 65535.A very large
network is difficult to manage.Hence the network is divivded into autonomous systems
and are numbered. It is also done to manage the network and for administration
convenience. Routers with the same autonomous systems will only communicate.
• RIP considered only the distance and direction for routing.Since it was not
efficient IGRP came up that considerd bandwidth,distance,load,delay and other
factors into consideration.
• Router chooses the best administrative distance if two routing protocols are giving
the route to a network.Lesser the administrative distance better the path.
• RIP and IGRP also have the following differences.
RIP IGRP
Update Interval 30 60
Hold-down timer 180 280
Invalid after 180 270
Flushed after 240 630
Commands Continued..
Router#sh ip protocols
Router#debug ip routing
Router#debug ip rip
Router#debug ip igrp transactions
Router#clear ip route *
Telnet is the generic service that comes with the TCP/IP to manage the routers
automatically from anywhere.
10.0.0.0 R R 30.0.0.0
1 20.0.0.0 2
40
CCNA Training Document Mohan’s Networking Institute
R1(config)#line vty 0 4
R1(config-line)#password xxx
R1#telnet 20.0.0.2
R1>telnet 20.0.0.2
User access verification
Password:
R2>enable
No password set
R2>enable
Password:
R2#
• If there are more than 2 sessions opened.Migration can be done within sesssions
by,
Disconnecting the sessions
R2>exit
R1#
Suspend a session
R2>(Press) ctrl + shift + 6 and x
R1#
• To display the sessions opened by a particular user.
R1#sh sessions
R1#(enter)(enter)
41
CCNA Training Document Mohan’s Networking Institute
R1#session no.(enter)(enter)
R1#sh users
Line no Console IP Address
0 Console
2 Vty 0 20.0.0.1
3 Vty 2 20.0.0.2
• To disconnect a user
R1#clear line 3
[confirm]
R1#
Note: Each time to open a session we give,
R2#Telnet 20.0.0.1
R2#Telnet 20.0.0.2…..
This can be altered by
R1(config)#ip host us 20.0.0.2
Then thereafter we can use as,
R2#us
R1#sh cdp
R1#sh cdp neighbors
R1#sh cdp neighbors detail(device IP address is obtained by this command)
Note: Telnet allows only 5 sessions(vty 0 4).If the 6th session is tried to opened an
error message is displayed.
R1#telnet 20.0.0.2
Trying Telnet 20.0.0.2
% connection refused by remote host.
42
CCNA Training Document Mohan’s Networking Institute
When there are only two networks telecom network provides a dedicated line and
there is no need of a firewall here.
But when the networks are connected to the internet we need a firewall.
R R
1 2
LAN1 Internet LAN2
There are multiple users accessing the internet and there are hackers who try to access the
secured data.To overcome this firewall is used and is made to sit at the gateway(Router).
43
CCNA Training Document Mohan’s Networking Institute
Destination
VPN
R R
1 2
Source Internet
IDS-Intrusion Detection System-An Intrusion Detection System is used to detect all types
of malicious network traffic and computer usage.It is used to provide security inside the
network.
A good router will have two gateways.An access control lists has the follwing format.
Action SIP SWCM SPNO DIP DWCM DPNO Protocol Interface Direction
*Deny 10.0.0.0 0.255.255.25 >1023 30.0.0.1 0.0.0.0 80 TCP E0 in
5 0
Deny 10.0.0.1 0.0.0.0 >1023 30.0.0.1 0.0.0.0 80 TCP E0 in
0 0
Permit 20.0.0.2 0.0.0.0 >1023 30.0.0.1 0.0.0.0 80 TCP E0 in
5 0
44
CCNA Training Document Mohan’s Networking Institute
• *- This field is the definition field that is specified for the network.
• The following are the original entries that should be matched to the defined entry.
• By default all the IPs are denied once a list is created, ermission should be
specified explicitly. This is called as the implicit deny(for both incoming and
outgoing packets.)
• WCM-Wild Card Mask: This represents the bits to be compared with the IP
address.Only if the IP address matches with the defined data is forwarded.
If to be Checked – 0
If to be ignored – 1
In out
R R
E0 1 S0 S0 2 E0
LAN1 LAN2
Out in
30.0.0.0 10.0.0.0
Assume a packet moves from LAN1 to LAN2. For R1 binding can be done at E0 or at
S0.If the packet is binded at E0, it is called as in-bound and if it binded at S0, it is called
the out-bound.
Similarly if packet moves from LAN2 to LAN1.For R1, the binding may be at S0(in-
bound) or at E0(out-bound).
ACLs
Standard Extended
(1 – 99) (100 – 199)
Once u specify the list binding should be done at the interface required.
45
CCNA Training Document Mohan’s Networking Institute
R1(config)#int e 0
R1(config-if)#ip Access-group 5 in
Once u specify the list binding should be done at the interface required.
R1(config)#int s 0
R1(config-if)#ip Access-group 101 in
R1#sh Access-list
R1#sh ip Access-list
• In Extended ACL
R1(config)#Access-list 101 deny TCP 10.0.0.10 0.0.0.0 30.0.0.10 0.0.0.0 eq ftp log
Note-1: The above given ACLs were numbered Extended ACLs.There is also named
ACLs, were u can access the ACL with the names
Note-2: For an interface at any time there are minimum of two binds(in and
out).Hence for 10 interfaces there will be a minimum of 20 binds.
46
CCNA Training Document Mohan’s Networking Institute
Consider,
NAT
Dynamic Static
Original Translated
From To From port Router To port To From
10.0.0.1 30.0.0.2 1045 R1 10001 30.0.0.2 20.0.0.23
0 0 0 30.0.0.20
30.0.0.2 10.0.0.1 20.0.0.2
0 0 3
10.0.0.2 30.0.0.2 1045 R1 12678 30.0.0.2 20.0.0.23
5 0 0 30.0.0.20
30.0.0.2 10.0.0.2 20.0.0.2
0 5 3
• NAT table is maintained by the router in the RAM. Without configuring RIP
router should be able identify all the websites(using NAT table).
Default network
R1(config)#Ip route 0.0.0.0 0 0.0.0.0 S0
R1(config)#access-list 15 permit 10.0.0.0 0.255.255.255
R1(config)#int e 0
R1(config-if)#ip NAT inside
R1(config)#int s 0
R1(config-if)#ip NAT outside
20.0.0.2
R I
1 R
Private
10.0.0.10 Public
30.0.0.20
Inside local Inside global
When a packet comes through (in)E0, check the source list 5(ACL) which
gives the source and SWCM, then forward with S0 interface address and
overload for all systems.
48
CCNA Training Document Mohan’s Networking Institute
2. Pool NAT
When a packet comes through (in)E0,check the source list 5(ACL) , got to the
pool R1ACL,check the address to be translated(20.0.0.23-20.0.0.30,any
address can be assigned to the source IP) and overload for all systems.
3. Static NAT
When a packet comes from 10.0.0.10 through E0(in), then source is translated
to only one address always(20.0.0.23)
• To debug NAT
R1#debug ip NAT
• To display translations
• To clear translations
49
CCNA Training Document Mohan’s Networking Institute
• In router when RIP is configured, it sends the hop count to its adjacent routers.
• But when OSPF is configured in a router,
1. A Hello signal is send to all the neighbors of a router in all possible
connections.They can talk if other routers configures with the same
protocol. With the received information a Neighbors Table is constructed.
RB S0 – 20.0.0.1
RC S1 – 30.0.0.1
At the end each router will knew about their neighbors.
2. Once the neighbors are found they are added in a topology table.Now the
link state is calculated and entered in the table.
Link State is calculated as
Cost =108/Bandwidth
Interface Cost
Ethernet Cost = 108/10*106 10
FastEthernet Cost = 108/100*106 1
Serial Cost = 108/1.544*106 64
50
CCNA Training Document Mohan’s Networking Institute
Note: If two routers are said to have identical information, they are said to maintain
adjacency.
3. Based on the topology tree a Routing table is developed which has the best
path calculated from the Shortest Path First (SPF) algorithm.
• In OSPF,if the link goes down, router tries to calculate the
alternative path and if it is not able to find,says to the neighbor that
the link is down. The best path is calculated again with the SPF
algorithm.
• In EIGRP, there three distances maintained
When the link goes down, the router proceeds with the feasible
successor(i.e.the next best path).
Broadcast Multiaccess
Consider the following figure,
51
CCNA Training Document Mohan’s Networking Institute
40.0.0.1 30.0.0.1
R R
1 2
10.0.0.1 10.0.0.2
50.0.0.1 20.0.0.1
R HUB/SWITCH R
3 6
10.0.0.6 10.0.0.3
10.0.0.05 10.0.0.4
R R
5 4
60.0.0.1 70.0.0.1
• In the above figure, if the router sends its link state to its neighbor and
the samis done with all the routers.Finally all will receive multiple copies of the
link and results in a LSA Flooding.
• To overcome this flooding election is being conducted among the
routers and
Designated Router-DR
Back up Designated Router-BDR
Other BDRs.
• But there are some issues in this election
1. Who will be the DR?
2. How to be elected and managed?
DR is elected based on the Priority and Router-ID.
For OSPF the priority is 1.
If the priority is same, the next criteria is the router-
id. The router that has the highest IP address will be elected the router-
id.
In some case if the router with the lowest IP address
wants to be the DR. Here we can’t change the IP address but we can
assign a dummy IP address by Loopback.
R1(config)#int loopback 0
R1(config-if)#IP address 75.0.0.1 255.0.0.0
R1 is reassigned with the dummy address 75.0.0.1 which is the router-id.
Now the election is between the router-ids and R1 is elected the DR and (the
next highest router-id 70.0.0.1)R4 is elected the BDR.
• Once when the election is over all the links are sent to DR/BDR and from
there are forwareded to the other BDRs.
52
CCNA Training Document Mohan’s Networking Institute
• Even when DR and BDR are elected there is and issue that how the link is
received by DR/BDR.
• Multicast address
For OSPF – 224.0.0.6 – DR
224.0.0.5 – BDR
For EIGRP – 224.0.0.10
R
0
To solve this the network is divided into autonomous systems in EIGRP and areas
in the case of OSPF.
R
0
53
CCNA Training Document Mohan’s Networking Institute
Note: When two similar networks are seperated contiguous network.Because when
routing table is broadcasted subnetmask is not sent.So RIP can’t differentiate between the
10.6.0.0/16 and 10.5.0.0/15, since it is a classfull protocol.
When there is a choice os OSPF and EIGRP, EIGRP is chosen considering the
administrative distance.Lower the distance better the performance.
OSPF
[Process-id 1 to 65535]
R1(config-router)#network <NID> <WCM>area <areano>
R1(config)#router OSPF 15
R1(config-router)#network 10.0.0.0 0.255.255.255 area 0
R1(config-router)#network 20.0.0.0 0.255.255.255 area 0
R2(config)#router OSPF 12
R2(config-router)#network 10.0.0.0 0.255.255.255 area 0
R2(config-router)#network 20.0.0.0 0.255.255.255 area 0
EIGRP
For OSPF
• Hello time – 10 sec
• Dead time – 40 sec
• Wait time – 40 sec
• Retransmit time – 5 sec
• sh ip ospf interface e 0
• sh ip ospf int f 0
• sh ip ospf int s 0
• sh ip ospf neighbor shows neighbor router-id.
• sh ip protocols
For OSPF
55
CCNA Training Document Mohan’s Networking Institute
• sh ip eigrp neighbors
• sh ip eigrp topology
P – Passive
A – Active
U – Update
R – Reply
r – Reply-state
Note: The advantage of EIGRP over OSPF is the feasible successor in the topology table.
The basic functionality of the protocol is very much similar to the RIP V1 protocol. The
RIP V2 protocol has some additional features that are not supported by RIP V1 protocol.
b. Classless Protocol :- Supports subnetted networks, It carries the information of subnet mask
i.e, the no. of bits for network id.
2. RIP V2 uses Multicast Address; RIPV1 uses Broadcast Address. In RIPV1 Universal
Broadcast(255.255.255.255) is used to send routing table updates for every 30 secs, whereas
RIPV2 uses Multicast (224.0.0.9).
3. RIPV2 allows Authentication, it authenticates the source from which the routing updates are
originated, so that flooding of routing update can be avoided.
4. RIPV2 supports VLSM - it can be abbreviated as Variable Length Subnet Mask. VLSM is
used to conserve ip addresses and helps proper summarization. RIPV1 does not support this.
9.WAN PROTOCOLS
56
CCNA Training Document Mohan’s Networking Institute
In a LAN all the systems are connected by the same cable and technology. The datalink
layer prepares data accorcing to the physical layer.(when there is a change in the physical
layer, preparation os data in the datalink layer also changes).
• WAN operates at the datalink layer.
• WAN technology operates at the physical layer and WAN software operates at the
datalink layer.
• At the datalink layer data preparation is done by some protocols and some of them
are
HDLC – High level DataLink Control
PPP – Point-to-Point Protocol
Frame-Relay
PPP HDLC
Open to all network devices Works only on the Cisco devices
Supports multiple protocols Supports multiple protocols
User authentication is possible User authentication is not possible
Two protocols:
1.PAP-Password Authentication Protocol
2.CHAP-Challenge Handshake Authentication
Protocol.
PAP:
HO BO
R R
My name is BOR.My password
is XXX.I want to talk
When the username and pwd are matched in the HOR Database,BOR is
allowed.It is Authentication Request.
Three-way Handshake:
Client Server
S,u can(SYN/ACK)
Ok(ACK)
57
CCNA Training Document Mohan’s Networking Institute
CHAP
BOR HOR
I want to talk to u
Give me password(Challenge)
HOR(config)#int s 0
HOR(config-if)#encapsulation PPP
HOR(config-if)#exit
• When encapsulation is done only in one router link state goes up and
down ie R1--- PPP, R2---HDLC.
BOR(config)#int s 0
BOR(config-if)#encapsulation PPP
58
CCNA Training Document Mohan’s Networking Institute
BOR(config-if)#exit
HOR#sh int s 0
ISDN is an example for Circuit switching Network.Here the circuit doesn’t exists
physically but get connected when required.When needed to transmit data the user can
dial-up, get connected ,finish the work and get disconnected.
Data and voice are integrated into one services digital network. So the user can
access the network and telephone at the same time.
X Y
LAN 1 LAN 2
Z
59
Modem
CCNA Training Document Mohan’s Networking Institute
Data
System
OR/AND
Service Provoiders
Voice
Digital Phone
Data - 1*64 = 64
Barer - 23*64 = 1472
NOTE:In Dedicated line there is a G703 switch in the telecom service provider.In ISDN
there is ISDN switch.
4 pair 2 pair
Router R NT1
BRI0 S/T U
Network Terminal
Adapter-1
Service Proivder
Router R S/T U
R TA NT1
R
R
U User Mode
S/T Switch and Transfer
R Rate
TA Terminal Adapter
61
HOR BOR
CCNA Training Document Mohan’s Networking Institute
• For multiple phone calls single Dialer-list can’t be used.In that case Dialer
mapping should be done by adding multiple routers.
HOR(config-if)#Dialer load-threshold 1
11. FRAME-RELAY
HUB
63
CCNA Training Document Mohan’s Networking Institute
Non-Broadcast Multiaccess
20.0.0.2
BO
200 300
R
100
HO
DLCI PVC-Permanent Virtual Circuit
R 20.0.0.1
• In the above figure,data is sent from 20.0.0.1 to 20.0.0.2 through DLCI 100 and
data is sent from 20.0.0.2 to 20.0.0.1 through DLCI 300.
• Inverse ARP carries the IP address between the devices with the help of DLCI.
• The link between the frame-relay and the router is managed by LMI-Local
management Interface or Link management Interface.
• How to configure Frame-relay?
64
CCNA Training Document Mohan’s Networking Institute
BOR(config)#int s 0
BOR(config)#encapsulation frame-relay
If there is router that are two routers, one with S 0 and S 1 connected to the frame-
relay swtich.
20.0.0.2
R 200
2 S0 20.0.0.1 R
R 3
1 300 20.0.0.3 100 S0
S1
Frame-relay Switch
R1(config)#int S 0
R1(config-if)#frame-relay map ip 20.0.0.3 200 broadcast
R1(config-if)#frame-relay map ip 20.0.0.2 200 broadcast
(If RIP, broadcast is optional )
R3(config)#int S 0
R3(config-if)#no ip address
R3(config-if)#exit
R3(config)#int S 0.5 point-to-point
R3(config-subif)#ip address 20.0.0.1 255.0.0.0
R3(config-subif)#frame-relay interface-DLCI 100
R3-----Identified as Multi-point if in
same network
65
CCNA Training Document Mohan’s Networking Institute
R1 R2
(S0.x) (S0.y)
point-point point-point
R1(config)#Frame-relay switching
R1(config)#int S 0
R1(config-if)#encapsulation frame-relay
R1(config-if)#frame-relay intf-type DCE
R1(config-if)#frame-relay route 100 int S 1 200
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
R1(config)#int S 1
R1(config-if)#encapsulation frame-relay
R1(config-if)#frame-relay route 200 int S 0 100
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
• To clear frame-relay
R1#clear frame-relay-inarp
66
CCNA Training Document Mohan’s Networking Institute
12. SWITCHING
• In switch each port is an ethernet port. So for each port there are separate
collision domain(Area where collision is possible).
• Router breaks up both collision and broadcast domains.
• Switch-DL layer frame
Data
This frame contains all the headers and trailers from the application layer and
DataLink Layer adds its own header & trailer(MAC from & toAddress).
Trunk Port
67
CCNA Training Document Mohan’s Networking Institute
Trunk Link
Access-list
• Here unneccessarily broadcast is done. To avoid this VLANs are created.
• Modifiying the configured LAN setup is not possible.VLANs are created
without altering the physical setup.
VLAN(Virtual LAN):
• VLANs are created by making some modifications in the configurations of the
actual LAN setup.
• The ports in the swtiches are configured so that they come under different
VLANs.For eg consider the following figure,
VLAN1 VLAN2
Switch(config)#vlan <vlan-no>
Switch(config)#name < xxx>
• VLAN-no ranges from 2 to 1001(Mandatory).
• VLAN name(xxx) is optional.
Switch(config)#vlan 2
Switch(config-vlan)#name finance
Switch(config-vlan)#exit
Switch(config)#vlan 3
Switch(config-vlan)#name production
Switch(config-vlan)#exit
Switch(config)#vlan 5
Switch(config-vlan)#name marketting
Switch(config-vlan)#exit
Switch(config)#int f 0/1
Switch(config-if)#switchport access vlan <vlan-no>
Switch(config-if)#switchport access vlan 3
Switch(config-if)#exit
Switch(config)#int f 0/2
Switch(config-if)#switchport access vlan 2
Switch(config-if)#exit
• If there are more than one swtich in the VLAN and if need them to
communciate routers should be used.
• All the switches should be in the same domain.
69
CCNA Training Document Mohan’s Networking Institute
NOTE: There can be two servers but the configuration should be same on both the
switches.If two servers send the configuration details to other clients,now the decision is
made depending on the configuration revision number.
Switch(config)#VTP server/client/transparent
Data V3
Data V3
BRIDGE SWITCH
Has less number of ports Has more number of ports
Slow Fast
It’s a software It’s a hardware
70
CCNA Training Document Mohan’s Networking Institute
• In this case one switch can be made to act as Root bridge and the
other to be the normal bridge. An election is conducted between the
switches based on the value obtained by adding the MAC address of the
switch and hexadecimal value of default priority- 32768. This value is
called the BPDU(Bridge Protocol Data Unit). Lesser the BPDU, is elected
as the root bridge.
• To show the MAC address table
Switch#sh MAC-address-table
Switch#sh VLAN
Switch#sh spanning-tree
• To clear vlan
13. BOOTING
Memory:
• Flash – IOS ,image(loaded)
• RAM – Running-config volatile
• NVRAM – Non-volatile RAM – Startup-config Secondary
• ROM – Microcodes are present
POST – Power On Self Test – Makes sure that all components
are available and are properly working.
BOOTSTRAP-In this there is a configuration register number
which is 16-bit(hexadecimal,default value-0x2102). The last
71
CCNA Training Document Mohan’s Networking Institute
ROMMONITOR-similar to BIOS(0)
RxBOOT-Partial IOS(1)
If there is a problem in the booting process, the above two
booting takes place.
ROMMONITOR> ROUTER(boot)>
or
>
In case if the flash is corrupted, and when the router is not able to find the flash
of the image, it tries to find it in the network with the help of TFTP(Trivial File
Transfer Protocol). Router checks for the TFTP for 5 minutes. If it doesn’t finds it
checks the 13th bit of the configuration revision number for if it is 1(default it is 0). If
1, boots from RxBOOT else if 0 boots from ROMMONITOR.
Copy commands:
72
CCNA Training Document Mohan’s Networking Institute
For all the above copy commands to work TFTP server should be running and
the router should be able to ping that system.
Routers>confreg 0x2142
or
>0x2142
ROMMON>reset
NOTE:
1. All passwords are set during the configuration except the console
and auxillary password.
2. When running-config is copied from start-config, interface is
shutdown.
R1#sh running-config
R1#sh start-config
• To show versions
R1#sh version
• To restart
R1#reload
73