0% found this document useful (0 votes)
130 views46 pages

Router and Routing Basics

The document discusses routers and routing basics. It defines routers as devices that interconnect networks and must have multiple network interfaces and implement network layer protocols. It describes the core functions of routers as interconnecting networks, routing to build route tables, switching to forward packets, and connecting different network types. It then covers topics such as route tables, how routes are established and maintained, different types of routes including static, dynamic, default and float static routes, and the working principles of routing and forwarding functions in routers.

Uploaded by

Đạt Nguyễn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
130 views46 pages

Router and Routing Basics

The document discusses routers and routing basics. It defines routers as devices that interconnect networks and must have multiple network interfaces and implement network layer protocols. It describes the core functions of routers as interconnecting networks, routing to build route tables, switching to forward packets, and connecting different network types. It then covers topics such as route tables, how routes are established and maintained, different types of routes including static, dynamic, default and float static routes, and the working principles of routing and forwarding functions in routers.

Uploaded by

Đạt Nguyễn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 46

Router and Routing Basics

V1.2
Objectives

 Understand the function of router


 Know the basic conception in routing
 Know the working principle of router
 Understand IP routing process
 Understand the route between VLANs
Contents

 Router definition and function


 Basic conception
 Working principle of router
 IP routing process
 VLAN route
Router definition(1)
 Router——A kind of computer device used to
interconnect networks

 Router must have the following features:


 Multiple network layer interfaces to interconnect
different networks
 Implement the protocols up to the network layer
 Have the function of storing 、 forwarding 、 path-
finding
Router functions(2)
 The core function of router is interconnecting
networks and data forwarding.
 routing : building route table and refreshing
 switching : forwarding packet between networks.
 Insulate broadcast packets , define access rule.
 Connecting different kinds of networks.
 Rate adapting between networks.
Contents

 Router definition and function


 Basic conception
 Working principle of router
 IP routing process
 VLAN route
Route table
 The information that router need to forward data is
stored in a table, called ’route table’
 Router check the destination address of the
packet, and choose the next hop based on the
information in route table.
 Route table is stored in RAM
Route table composition
 Destination address ( Dest )
 Mask ( Mast )
 Next hop address (Gw)
 Forwarding physical interface ( interface )
 Source of the information (Owner)
 Route priority ( pri )
 metric ( metric )
Route table composition

Example
Dest Mask Gw Interface Owner pri metric

172.16.8.0 255.255.255.0 1.1.1.1 fei_1/1 static 1 0

172.16.8.0 -- Destination network address


255.255.255.0 -- Destination network mask
1.1.1.1 -- Next hop address
fei_1/1 -- Route learning interface and forwarding interface
static -- how does router learns this entry
1 -- route priority
0 -- Metric
Route table establishing and refreshing

 How is route established at the beginning?

 How to maintain the route table after it is


established?
Route Types

Directly
connected route

Static route

Dynamic route
Directly connected route

10.0.0.1/24 192.168.0.1/30
e1_1
fei_1/1
A 192.168.0.2/30 B
172.16.0.1/24

IPv4 Routing Table:


Dest Mask Gw Interface Owner pri metric

10.0.0.0 255.255.255.0 10.0.0.1 fei_1/1 direct 0 0


10.0.0.1 255.255.255.255 10.0.0.1 fei_1/1 address 0 0
192.168.0.0 255.255.255.252 192.168.0.1 e1_1 direct 0 0
192.168.0.1 255.255.255.255 192.168.0.1 e1_1 address 0 0

 Directly connected route


 When network address is configured and the status of the interface is

valid, the network configured on this network will appear in the route
table and associated with this interface , the route will change with
the status of the interface.
Static Route
 The route manually set by the network
administrator is not updated automatically with the
change of network topology.
 The route table takes effect under the condition
that the next hop is reachable.
 Advantage: It does not occupy the network
resources or system resources.
 Disadvantage: It needs to be configured by the
administrator manually one by one, and does not
automatically adjust with the change of network
status.
Static Route Configuration
Stub Network

172.16.1.0
SO
10.0.0.0
B A
B
Network 172.16.2.2 172.16.2.1

ip route 10.0.0.0 255.0.0.0 172.16.2.2

 This is a unidirectional route, there should be an


opposite route configured on the counterpart router.
Default Route
 The default route is a route in the route table,
used to transfer the data packets in the route table
that does not have a specific route entry.
 The default route can be a static route set by the
administrator, or be automatically generated by
the dynamic route protocol.
 Advantage: It dramatically reduces the number of
route entries in the route table.
 Disadvantage: If the default route is not configured
correctly, it will cause the route loop, or not the
optimal route.
Default Route Configuration

Stub Network
Example
172.16.1.0
SO
Network A B
172.16.2.2 172.16.2.1

ip route 0.0.0.0 0.0.0.0 172.16.2.2


Dynamic route

OSPF RIP OSPF RIP

1.0.0.0/8 2.0.0.0/8 3.0.0.0/8

Routing protocol is a software process running on the


router. It will exchange routing information with other
routers , studying route information of network not
directly connected and adjusting the route information
when topology changes.
Route priority
 Select the route that has the highest priority to the
route table 。

RIP OSPF

10.0.0.0/16 fei_1/1 10.0.0.0/16 fei_1/3

10.0.0.0/16 fei_1/3
Notice : the comparison of Route table
route priority must be between
identical routes.
Default route priority

Route Source Default priority


Connected interface 0
Static route 1
External BGP 20
OSPF 110
IS-IS 115
RIP v1, v2 120
Internal BGP 200
Special (For inner process) 255
Float static route

fei_1/1 10M
177.1.1.1

Network
178.1.1.1
DDN

 How to configure static route when there are redundant links?


Float static route

fei_1/1 10M
177.1.1.1

Network
178.1.1.1
DDN

ZXR10(config)#ip route 10.0.0.0 255.0.0.0 177.1.1.1


ZXR10(config)#ip route 10.0.0.0 255.0.0.0 178.1.1.1 5 tag 200
Longest Prefix Match principle
ZXR10#show ip route
IPv4 Routing Table:
Dest Mask Gw Interface Owner pri metric

1.0.0.0 255.0.0.0 1.1.1.1 fei_1/1 direct 0 0


1.1.1.1 255.255.255.255 1.1.1.1 fei_1/1 address 0 0
2.0.0.0 255.0.0.0 2.1.1.1 fei_1/2 direct 0 0
2.1.1.1 255.255.255.255 2.1.1.1 fei_1/2 address 0 0
3.0.0.0 255.0.0.0 3.1.1.1 fei_1/3 direct 0 0
3.1.1.1 255.255.255.255 3.1.1.1 fei_1/3 address 0 0
10.0.0.0 255.0.0.0 1.1.1.1 fei_1/1 ospf 110 10
10.1.0.0 255.255.0.0 2.1.1.1 fei_1/2 static 1 0
10.1.1.0 255.255.255.0 3.1.1.1 fei_1/3 rip 120 5
0.0.0.0 0.0.0.0 1.1.1.1 fei_1/1 static 1 0

10.1.1.1?
Contents

 Router definition and function


 Basic conception
 Working principle of router
 IP routing process
 VLAN route
Router working principle
 Routing function :
 Study and exchange the network topology information
or route information, Produce and maintain route table.
 Forwarding function :
 Data transferring and processing procedure. (Receiving
data on one interface, then choose an appropriate
interface to send it out, including the work of frame
encapsulation and decapsulation.)
Routing function
 The functions of routing is to create and maintain
route table, make it ready for the LPM check in the
forwarding process. It requires several basic steps :

 What kind of protocols to route ?


 Is the destination network address in the route table?
 What is the next hop address ?
 Which interface to send out the packet ?
Forwarding Function

Frame checking and cache the Coming


packet = interface

Associate destination address Route Maintained by routing function


with the next hop interface = table

Create the frame head with the ARP cache


Mapping list Maintained by
= ( LAN )
physical address ( WAN ) ARP or RARP
process
Packet encapsulation and Out

forwarding interface
Router working process summary

Add route based on Search entry in route table


route priority Based on destination address
Routing
Routing
Routing
process
Routing
process
process Route Forwarding
process table process
Longest match
principles
Routing protocol study
possible route, select the
best route based on metric
Contents

 Router definition and function


 Basic conception
 Working principle of router
 IP routing process
 VLAN route
Communication in the same network—ARP
Request
Suppose A will communicate with B
A judges that it is on the same network segment with B
A searches for the MAC address of B in ARP table
A sends the ARP request packet to find the MAC address of B
MAC Port
Switch 00:20:af:00:00:01 fei_1/1
ARP request
Fei_1/1 Fei_1/3
Dest MAC: ff:ff:ff:ff:ff:ff
Fei_1/2
Source MAC:00:20:af:00:00:01

Dest IP: 192.168.1.2

Source IP: 192.168.1.1

A B C

IP: 192.168.1.1 IP: 192.168.1.2 IP: 192.168.1.3


MAC: 00:20:AF:00:00:01 MAC: 00:20:AF:00:00:02 MAC: 00:20:AF:00:00:03
Communication in the same network—ARP
Response

MAC Port
00:20:af:00:00:01 fei_1/1
00:20:af:00:00:02 fei_1/2
Switch

Fei_1/1 Fei_1/3
Fei_1/2
ARP reply
Dest MAC:00:20:af:00:00:01

Source MAC:00:20:af:00:00:02

A B Dest IP: 192.168.1.1 C


Source IP: 192.168.1.2
IP: 192.168.1.1 IP: 192.168.1.2 IP: 192.168.1.3
MAC: 00:20:AF:00:00:01 MAC: 00:20:AF:00:00:02 MAC: 00:20:AF:00:00:03
Communication in the same network—Packet
Transfer

MAC Port
00:20:af:00:00:01 fei_1/1
00:20:af:00:00:02 fei_1/2
Switch

Fei_1/1 Fei_1/3
Dest MAC:00:20:af:00:00:02 Fei_1/2
Source MAC:00:20:af:00:00:01

Dest IP: 192.168.1.2

Source IP: 192.168.1.1

A B C

IP: 192.168.1.1 IP: 192.168.1.2 IP: 192.168.1.3


MAC: 00:20:AF:00:00:01 MAC: 00:20:AF:00:00:02 MAC: 00:20:AF:00:00:03
Communication between different networks
Suppose A will communicate with B
1 A judges that B is on a different network segment
Dest network interface
10.1.1.0 255.255.255.252 fei_1/1
2 A searches for the MAC address of GW in ARP table 10.1.1.4 255.255.255.252 fei_1/2
10.1.1.8 255.255.255.252 fei_1/3
3 A sends packet to B, with the destination MAC Router
address of the GW
fei_1/3:10.1.1.10/30
fei_1/1:10.1.1.2/30 MAC:00:20:AF:00:00:05
MAC:00:20:AF:00:00:04
Dest MAC:00:20:af:00:00:04 fei_1/2:10.1.1.6/30
MAC:00:20:AF:00:00:05
Source MAC:00:20:af:00:00:01
Dest IP: 10.1.1.5

Source IP: 10.1.1.1


A B C

IP: 10.1.1.1/30 IP:10.1.1.5/30 IP: 10.1.1.9


G: 10.1.1.2 G: 10.1.1.6 G: 10.1.1.10
MAC:00:20:AF:00:00:01 MAC:00:20:AF:00:00:02 MAC:00:20:AF:00:00:03
Communication between different networks

Dest MAC:00:20:af:00:00:02
Dest network interface
Source MAC:00:20:af:00:00:05 10.1.1.0 255.255.255.252 fei_1/1
10.1.1.4 255.255.255.252 fei_1/2
Dest IP: 10.1.1.5 10.1.1.8 255.255.255.252 fei_1/3
Router
Source IP: 10.1.1.1
fei_1/3:10.1.1.10/30
fei_1/1:10.1.1.2/30 MAC:00:20:AF:00:00:05
MAC:00:20:AF:00:00:04
fei_1/2:10.1.1.6/30
MAC:00:20:AF:00:00:05

A B C

IP: 10.1.1.1/30 IP:10.1.1.5/30 IP: 10.1.1.9


G: 10.1.1.2 G: 10.1.1.6 G: 10.1.1.10
MAC:00:20:AF:00:00:01 MAC:00:20:AF:00:00:02 MAC:00:20:AF:00:00:03
Communication process
Get peer IP address

Whether in YES Is the peer MAC YES Data link layer


the same network address in ARP table? encapsulation
with peer

NO NO
Get peer MAC
Address by ARP Send data at
physical layer

YES YES
Is gateway Is the gateway MAC Data link layer
configured ? address in ARP? encapsulation

NO NO
End
Get gateway MAC
Send error message
address by ARP
IP communication process
 IP communication process KEY features:
 IP communication is hop by hop communication
 Source IP and destination IP address is unchanged
 Every time the packet passed a data link layer, there
will be a new encapsulation of the packet
 The return path is not related to the forwarding path
Routing process example
R1 route table
192.168.4.0 255.255.255.0 192.168.4.1 e1_1/1.1 direct 0 0
192.168.2.0 255.255.255.0 192.168.2.1 fei_1/1 direct 0 0
192.168.1.0 255.255.255.0 192.168.4.2 e1_1/1.1 rip 120 1
192.168.1.0 /24 192.168.6.0 255.255.255.0 192.168.4.2 e1_1/1.1 rip 120 1
fei_1/1 192.168.3.0 255.255.255.0 192.168.4.2 e1_1/1.1 rip 120 2
R2
e1_1/1.1 e1_2/1.1
192.168.6.0 /24
192.168.4.0 /24

e1_1/1.1
e1_1/1.1
R3
R1
fei_1/1
fei_1/1 Destination address:
192.168.3.3 192.168.3.0 /24
192.168.2.0 /24

192.168.2.3 A B
192.168.3.3
Routing process example
R2 route table
192.168.4.0 255.255.255.0 192.168.4.2 e1_1/1.1 direct 0 0
192.168.6.0 255.255.255.0 192.168.6.1 e1_2/1.1 direct 0 0
192.168.1.0 255.255.255.0 192.168.1.1 fei_1/1 direct 0 0
192.168.2.0 255.255.255.0 192.168.4.1 e1_1/1.1 rip 120 1
192.168.1.0 /24
192.168.3.0 255.255.255.0 192.168.6.2 e1_2/1.1 rip 120 1
fei_1/1
R2
e1_1/1.1 e1_2/1.1

192.168.4.0 /24 192.168.6.0 /24

Destination Address: e1_1/1.1


e1_1/1.1 192.168.3.3
R3
R1
fei_1/1
fei_1/1
192.168.2.0 /24 192.168.3.0 /24

192.168.2.3 1.Destination address:192.168.3.3

192.168.3.3
Routing process example
R3 route table
192.168.3.0 255.255.255.0 192.168.3.1 fei_1/1 direct 0 0
192.168.6.0 255.255.255.0 192.168.6.2 e1_1/1.1 direct 0 0
192.168.1.0 255.255.255.0 192.168.6.1 e1_1/1.1 rip 120 1
192.168.1.0 /24 192.168.4.0 255.255.255.0 192.168.6.1 e1_1/1.1 rip 120 1
fei_1/1 192.168.2.0 255.255.255.0 192.168.6.1 e1_1/1.1 rip 120 2
R2
e1_1/1.1 e1_2/1.1

192.168.4.0 /24 192.168.6.0 /24

Destination address: e1_1/1.1


e1_1/1.1 192.168.3.3
R3 Return path ?
R1
fei_1/1
fei_1/1
192.168.2.0 /24 192.168.3.0 /24

192.168.2.3 192.168.3.3
Contents

 Router definition and function


 Basic conception
 Working principle of router
 IP routing process
 VLAN route
Route Between VLANs

fei_1/1 fei_1/1.1
fei_1/1.2 802.1Q trunk
fei_1/2
fei_1/1.3 encapsulation
fei_1/3
VLAN
VLAN

VLAN
VLAN
VLAN

VLAN

VLAN
VLAN
VLAN
three

three

three
two

two
one

one

two
one
Method 1: Method 2: Method 3: L3
Normal route One-arm route switch
Method 1: Normal Route

Feature: Several router physical


interfaces are required; high cost; poor fei_1/1

flexibility and expandability fei_1/2

fei_1/3

Configuration: On the several physical


interfaces of the router, configure the

VLAN
VLAN
VLAN
default gateway IP addresses of different

three
two
one
VLANs. The port of the switch is
configured as ACCESS PORT.
Method 2: One-arm Route

ZXR10(config)#interface fei_1/1.1 fei_1/1.1


ZXR10(config-subif)#encapsulation dot1Q 1 fei_1/1.2 802.1Q trunk
fei_1/1.3 encapsulation
ZXR10(config-subif)#ip add 1.1.1.1 255.0.0.0

ZXR10(config)#interface fei_1/1.2
ZXR10(config-subif)#encapsulation dot1Q 2
ZXR10(config-subif)#ip add 2.1.1.1 255.0.0.0

VLAN
VLAN
VLAN
three
two
one
ZXR10(config)#interface fei_1/1.3
ZXR10(config-subif)#encapsulation dot1Q 3
ZXR10(config-subif)#ip add 3.1.1.1 255.0.0.0
 Feature:
 Only one router physical interface is required; low cost, good expandability; the router
needs to support the trunk encapsulation.
 Configuration:
 On one physical interface of the router, configure several sub-interfaces, and
encapsulate them by 802.1Q. Different sub-interfaces configure the default gateway IP
addresses of different VLANs. The port of the switch is configured as 802.1Q trunk.
Method 3: L3 Switch

ZXR10(config)#interface vlan 1
ZXR10(config-if)#ip add 1.1.1.1 255.0.0.0

ZXR10(config)#interface vlan 2
ZXR10(config-if)#ip add 2.1.1.1 255.0.0.0

ZXR10(config)#interface vlan 3
ZXR10(config-if)#ip add 3.1.1.1 255.0.0.0

VLAN
VLAN
VLAN
three
two
one
 Feature:
 One device integrates the routing and switching functions.
The visible interfaces are all L2 ports, and the L3 interfaces
needs to be created to be associated with VLAN.
 Configuration:
 Each VLAN needs to be configured with the logical interface.
Its IP address is the default gateway address of the
corresponding VLAN.
Review
 Definition of router
 Router’s functions
 Basic concepts in routing
 Working principle of a router
 IP routing process within the same network
 IP routing process between different network
 Inter VLAN routing
Questions
 What’s the two main functions of router?
 How is the route table established?
 What is the standard when a router is selecting
the route to route table?
 When forwarding IP packet, If there are many
matches, what will router do?
 Describe the encapsulation and decapsulation
during the process of IP routing .

You might also like