Você está na página 1de 41

IPUB_401_E1

Basic Routing Principles


V1.2

Bearer Network D&T Group

Understand the function of router


Know the basic conception in routing
Know the working principle of router
Understand IP routing process

Router definition and function

Basic conception

Working principle of router

IP routing process

Router definition(1)
RouterA kind of computer device used to interconnect
network

Router must have the following features:

Multiple three layer interfaces to interconnect different networks

Implement the protocol 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.

Router definition and function

Basic conception

Working principle of router

IP routing process

Basic concepts
routed protocol
routing protocol

connected route
static route
dynamic route
default route

Routing protocol and routed protocol


10.120.2.0

172.16.2.0
E0

S0

Network
Protocol
Connected
RIP
OSPF

Destination
Network
10.120.2.0
172.16.2.0
172.17.3.0

Exit Interface
fei_0/1
e1_1
e1_2

Routed protocol: IP
Routing protocol: RIP, OSPF

172.17.3.0

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


Route table composition:
Destination address
Mask
Next hop address (Gateway)
Forwarding physical interface
Source of the information(Owner)
Route priority
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_0/1.1

static

172.16.8.0
255.255.255.0
1.1.1.1
fei_0/1.1
static
1
0

--------

Destination network address


Destination network mask
Next hop address
Route learning interface and forwarding interface
how does router learns this entry
route priority
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

Default route

Dynamic route

Directly connected route


10.0.0.1/24

192.168.0.1/30

A
IPv4 Routing Table:
Dest
Mask
10.0.0.0
10.0.0.1
192.168.0.0
192.168.0.1
ZXR10#

255.255.255.0
255.255.255.255
255.255.255.252
255.255.255.255

192.168.0.2/30

172.16.0.1/24

Gw

Interface Owner pri metric

10.0.0.1
10.0.0.1
192.168.0.1
192.168.0.1

fei_0/1
fei_0/1
fei_1/1
fei_1/1

direct
0
address 0
direct
0
address 0

0
0
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 configuration

Stub Network

172.16.1.0

10.0.0.0
Network

SO
B

172.16.2.2

172.16.2.1

A
B

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 configuration


Stub Network

Example

172.16.1.0

Network

ip route

SO
A

172.16.2.2

172.16.2.1

0.0.0.0 0.0.0.0

172.16.2.2

Default route is configured on the egress router in a stub network.

Dynamic route
OSPF

1.0.0.0/8

RIP

OSPF

2.0.0.0/8

RIP

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

10.0.0.0/16

RIP

OSPF

fei_1/1

10.0.0.0/16

10.0.0.0/16
Notice the comparison of
route priority must be between
identical routes.

fei_1/3

Route table

fei_1/3

Default route priority


Route Source
Connected interface
Static route
External BGP
OSPF
IS-IS
RIP v1, v2
Internal BGP
Special (For inner process)

Default priority
0
1
20
110
115
120
200
255

Float static route

fei_1/1

e1_2/1.1

DDN
Network

serial_3/1

PSTN

How to configure static route when there are redundant links?

Float static route


fei_1/1

e1_2/1.1

DDN
Network

serial_3/1

PSTN

ZXR10(config)#ip route 10.0.0.0 255.0.0.0 20.0.0.1 tag150


ZXR10(config)#ip route 10.0.0.0 255.0.0.0 30.0.0.1 tag155

Longest match principle


ZXR10#show ip route
IPv4 Routing Table:
Dest
Mask
metric
1.0.0.0
1.1.1.1
2.0.0.0
2.1.1.1
3.0.0.0
3.1.1.1
10.0.0.0
10.1.0.0
10.1.1.0
0.0.0.0

255.0.0.0
255.255.255.255
255.0.0.0
255.255.255.255
255.0.0.0
255.255.255.255
255.0.0.0
255.255.0.0
255.255.255.0
0.0.0.0

Gw

Interface

Owner

pri

1.1.1.1
1.1.1.1
2.1.1.1
2.1.1.1
3.1.1.1
3.1.1.1
1.1.1.1
2.1.1.1
3.1.1.1
1.1.1.1

fei_1/1.1
fei_1/1.1
fei_1/1.2
fei_1/1.2
fei_1/1.3
fei_1/1.3
fei_1/1.1
fei_1/1.2
fei_1/1.3
fei_1/1.1

direct
address
direct
address
direct
address
ospf
static
rip
static

0
0
0
0
0
0
110
1
120
0

10.1.1.1?

0
0
0
0
0
0
10
0
5
0

Router definition and function

Basic conception

Working principle of router

IP routing process

Router working principle


Routing function
Study and maintain the network topology,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)

Route function
Study and maintain the network topology mechanism is
regarded as the function of routing.It requires several basic
information

What kind of protocols to route

Is the destination network address in the route table?

Which interface to send out the packet

What is the next hop address

Forwarding Function
Frame checking and cache the
packet
Associate destination address
with the next hop interface
Create the frame head with the
physical address

Packet encapsulation and


forwarding

Coming
interface

Route
table

ARP cache
LAN Mapping list
WAN

Out
interface

Maintained by routing
protocol
Maintained by
ARP or RARP
process

Route working process summary


Add route based on route priority

Routing
Routing
Routing
process
Routing
process
process
process

Search entry in route table


Based on destination address

Route
table

Forwarding
process
Longest match
principles

Routing protocol study


possible route,select the
best route based on metric

Router definition and function

Basic conception

Working principle of router

IP routing process

Communication in the same network


Network
A

To router1
Hub/switch

Communication
requirement

Communication process
Network

A
Hub

IP address 192.168.1.1
MAC
address
00:20:AF:00:00:01

Protocol
layer

IP layer

Encapsulate IP
address in
packet and send
to 192.168.1.2

No need to consider
higher layer protocols

IP address 192.168.1.2
MAC
address
00:20:AF:00:00:02

decapsulate
IP packet
Receiving
IP packet

IP layer

ARP
Ethernet

Encapsulate MAC
address in frame
and send to MAC
address
00:20:AF:00:00:02

Decapsulate
MAC frame
Receiving
MAC frame

Ethernet

Communication between different network


Router
DDN
Network A

Ethernet

PPP

Communication
requirements

Router
Network B

Ethernet

Communication between different network


Network
PPP
Ethernet

Ethernet

fei-1/1
HOST A

Ethernet

Send host
A

e1_2/1.1

No need to consider
higher layer protocols

Protocol
IP layer

e1_2/1.1

IP
packet

IP
packet

MAC
frame

IP layer

Ethernet
interface

Serial
interface

fei-1/1
HOST B

No need to consider
higher layer protocols

IP
IP
packet packet

PPP
frame

router

IP layer

Serial
interface

Ethernet
interface

router
PPP
packet

IP
IP
packet packet

IP layer

Ethernet

MAC
frame
Receiving
host B

Communication process
Get peer IP address
Whether in the same
network
with peer

YES

NO

Is the peer MAC


address in ARP table?

YES

Data link layer


encapsulation

NO

Get peer MAC


Address by ARP

Is gateway
configured
NO

Send error message

YES

Is the gateway MAC


address in ARP?

YES

Send data at
physical layer

Data link layer


encapsulation

NO

End
Get gateway MAC
address by ARP

IP communication process
IP communication process basic conception:

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

Network protocol layer process


X

C
A

X
Application
Presentation
Session
Transport
Network
Data Link
Physical

A
Network
Data Link
Physical

Y
B

Network
Data Link
Physical

C
Network
Data Link
Physical

Application
Presentation
Session
Transport
Network
Data Link
Physical

Routing process example

192.168.1.0 /24

fei_1/1

R2
e1_1/1.1
192.168.4.0 /24

R1 route table
192.168.4.0 255.255.255.0 192.168.4.1 e1_1/1.1
0
0
192.168.2.0 255.255.255.0 192.168.2.1 fei_1/1
0
0
192.168.1.0 255.255.255.0 192.168.4.2 e1_1/1.1
120 1
192.168.6.0
e1_2/1.1 255.255.255.0 192.168.4.2 e1_1/1.1
120 1
192.168.6.0
/24
192.168.3.0
255.255.255.0
192.168.4.2 e1_1/1.1
120 2
e1_1/1.1

e1_1/1.1

R3

R1
fei_1/1

Destination address:
192.168.3.3

192.168.2.0 /24
192.168.2.3

fei_1/1
192.168.3.0 /24

B
192.168.3.3

direct
direct
rip
rip
rip

Routing process example

192.168.1.0 /24

fei_1/1

R2

e1_1/1.1
192.168.4.0 /24

e1_1/1.1

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 1e1_2/1.1
192.168.3.0 255.255.255.0 192.168.6.2 e1_1/1.1 rip
192.168.6.0 /24
120 1

Destination Address:
192.168.3.3

e1_1/1.1

R1

R3
fei_1/1

fei_1/1

192.168.3.0 /24

192.168.2.0 /24
192.168.2.3

1.Destination address:192.168.3.3
192.168.3.3

Routing process example

192.168.1.0 /24

fei_1/1

R2

e1_1/1.1
192.168.4.0 /24

e1_1/1.1

R3 route table
192.168.3.0 255.255.255.0 192.168.3.1 fei_1/1
0
0
192.168.6.0 255.255.255.0 192.168.6.2 e1_1/1.1
0
0
192.168.1.0 255.255.255.0 192.168.6.1 e1_1/1.1
120 1
192.168.4.0 255.255.255.0 192.168.6.1 e1_1/1.1
e1_2/1.1
120 1
192.168.6.0
/24
192.168.2.0
255.255.255.0
192.168.6.1 e1_1/1.1
120 2

Destination address:
192.168.3.3

R1

e1_1/1.1

R3
fei_1/1

fei_1/1

192.168.3.0 /24

192.168.2.0 /24

192.168.2.3

Return path

192.168.3.3

direct
direct
rip
rip
rip

Review
Definition of router
Router functions
Basic conceptions in routing
IP routing process within the same subnet
IP routing process between different subnet

Questions
Whats 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 .

univ.zte.com.cn

Você também pode gostar