Sie sind auf Seite 1von 8

1

NETMANIAS TECH-BLOG Please visit www.netmanias.com to view more posts


Switching and Routing - Part 2. Packet Forwarding
by I P Router
June 18, 2014 | By Netmanias (tech@netmanias.com)


As noted in the previous post, we will explain the logic of IP packet delivery among routers.

Network Topology

Seen in the left figure below is the network topology to help you understand the packet delivery process
among routers. In the middle of the figure lies a router (R1), and in the bottom, four servers are connected to
the router through the ports ge1/1 ~ ge1/4, respectively. On the top of the router lie two ports (ge2/1 and
ge2/2), and two routers (R2 and R3) are connected to R1 through these two ports, respectively. R2 is
connected to 100.1.1.0/24 network, and R3 is connected to 200.1.1.0/24 network.



Now, we will see how packets are delivered from SVR1, via R1 or R2, to 100.1.1.0/24 network. The MAC and IP
addresses of the routers and servers are as follows:







Netmanias Tech-Blog: Switching and Routing - Part 2. Packet Forwarding by IP Router



2

1. Installing Routing Entries in RIB/FIB Using OSPF Protocol



R1 installs routing entries in the RIB/FIB by performing the following steps:
R1 exchanges OSPF LSA (routing information) with its OSPF neighbors, R2 and R3.
It saves all the routing information in the Link State Data Base (LSDB).
For OSPF, the best forwarding strategy is "to use the least-cost path". So, it calculates the shortest (least-
cost) path to each destination through Shortest Path First (SPF) calculation.
It installs the results (the shortest path routing entries) in the RIB.
Then, the installed routing entries are copied to the FIB on each line card.

In case of the example in the figure above, the following routing information is installed in the RIB/FIB as a
result of the foregoing steps: "(1) the destination network 1.1.1.0/24 is directly connected to R1, and the
outgoing interface (OIF) is ge1/1, and (2) the destination network 100.1.1.0/24 is not connected to R1, and so
the next hop is R2 (20.1.1.1) and and the OIF is ge2/1".

Please note that the routing entries for 100.1.1.0/24 and 200.1.1.0/24 are installed in the RIB/FIB according to
the steps explained above, whereas the rest routing entries are installed when the system operator configures
an IP address for each interface (port) through CLI (e.g. when configuring an IP address (i.e. 1.1.1.1/24) for
interface ge1/1).


Netmanias Tech-Blog: Switching and Routing - Part 2. Packet Forwarding by IP Router



3

2. R1 MAC Address Learning by Device/Server (Filling in ARP
Table)



Now, SVR1 wants to send an IP packet destined to 100.1.1.1 (Destination IP address = 100.1.1.1).
SVR1 refers to the routing table, and finds out that the destination is matched to the default route
(0.0.0.0/0), and thus 1.1.1.1 (R1) is the gateway to use, and lan1 is the OIF.
Note: In case of usual user devices (like regular PCs), the gateway IP address for the default route is also
obtained when IP address is obtained through DHCP. In case of a server, however, the IP address and the
gateway IP address of the default route are manually set by the administrator of each server.
SVR1 refers to its ARP table before sending a packet to the destined OIF (lan1) because it should know the
MAC address of gateway 1.1.1.1 in order to send the packet (In Ethernet L2 (Link Layer), the MAC addresses of
a sender (SVR1) and receiver (R1) should be respectively entered in the Source MAC address and Destination
MAC address fields of the Ethernet header). Then, it finds no corresponding entry in the ARP table (ARP miss).
So, SVR1 sends an ARP Request packet to lan1 port to get the MAC address of gateway 1.1.1.1.
R1, upon receiving the ARP Request through ge1/1 port, responds to the request by sending an ARP Reply
packet (informing of a1, the MAC address of gateway 1.1.1.1) back to SVR1.
SVR1 fills in its ARP table with the received information (saving a1 as the MAC address).








Netmanias Tech-Blog: Switching and Routing - Part 2. Packet Forwarding by IP Router



4

3. Sending a Packet from Device/Server to Router R1 for the
First Time



Netmanias Tech-Blog: Switching and Routing - Part 2. Packet Forwarding by IP Router



5

SVR1, now with a1, the MAC address of gateway 1.1.1.1, sends a packet destined to 100.1.1.1 through lan1
port. At this time the packet contains the following information:

[Ethernet Header] Destination MAC address = a1 (R1's MAC address), Source MAC address = m1 (SVR1's
MAC address)
[IP Header] Destination IP address = 100.1.1.1, Source IP address = 1.1.1.10 (SVR1's IP address)

This packet is received by R1 through ge1/1 port of the line card #1, and held in the ingress packet buffer
momentarily (during FIB lookup).
Next, the packet processor, through FIB lookup (LPM: Longest Prefix Match) for the received packet, finds
out the next hop and OIF are 20.1.1.1 and ge2/1, respectively.
The packet processor attaches an internal header to the front of the packet, and forwards it to the switch
module. This internal header may contain various information depending on each vendor's implementation.
However, for easier understanding, here we assume there are only two types of information contained: (1)
information about the line card/OIF where the packet is forwarded (i.e. ge2/1 here), and (2) address
information of the next hop (router) where the packet is forwarded (i.e. 20.1.1.1).
Now, the packet is passed through the switch module, and kept in the egress packet buffer of the line card
#2.
The packet processor at the line card #2 checks the ARP table for the MAC address of the next hop 20.1.1.1.
No corresponding entry in the ARP table. So, the packet processor informs the control module of the ARP
Miss event (reporting that there is no MAC address for 20.1.1.1).
In response to the report, the control module sends an ARP Request packet to ge2/1 port, and receives an
ARP Reply packet from R2.
The control module saves the received MAC address of 20.1.1.1 (i.e. b2) in its ARP table.
Next, it forwards the saved information to the line card #2 that has informed of the ARP Miss event, having
the same copied to the ARP table of the card (but, not to other line cards).
The packet processor at the line card #2 now has the MAC address of the next hop 20.1.1.1 (i.e. b2). So, it
can simply forward the packet it previously kept in the egress packet butter to ge2/1. When forwarding the
packet, the egress packet processor may either send the packet immediately according to the pre-set QoS
policy (scheduling algorithm), or hold it in the egress packet buffer for a while to handle other packet(s) with a
higher priority first. The packet forwarded by R1 to R2 consists of the following information.

[Ethernet Header] Destination MAC address = b2 (R2's MAC address), Source MAC address = a5 (R1's MAC
address)
[IP Header] Destination IP address = 100.1.1.1, Source IP address = 1.1.1.10 (SVR1's IP address)

Two things to note:
First, the main concern of the line cards is to forward packets at wire-speed. So, other exceptional events like
ARP miss are taken care of by the control module.
Second, an ingress packet buffer is where packets are kept momentarily (instantaneously) while FIB lookup is
performed, and hence is pretty small-sized (about hundreds of Kbytes). On the other hand, an egress packet
buffer is where packets are kept according to the QoS policy when congestion occurs, and hence is pretty
large-sized (several Mbytes).



Netmanias Tech-Blog: Switching and Routing - Part 2. Packet Forwarding by IP Router



6

4. Sending a Packet from Device/Server to Router R1 for the
Second Time





Netmanias Tech-Blog: Switching and Routing - Part 2. Packet Forwarding by IP Router



7

Now, SVR1 sends a packet destined to 100.1.1 network for the second time.
and are the same as explained above, and so will not be discussed here again.
The packet processor at the line card #2 refers to the ARP table, and finds out the MAC address of the next
hop 20.1.1.1 is b2.
So, according to the QoS policy (scheduling algorithm), it takes the packet out of the egress packet buffer,
and forwards to ge2/1 port. The packet forwarded by R1 to R2 consists of the following information.

[Ethernet Header] Destination MAC address = b2 (R2's MAC address ), Source MAC address = a5 (R1's MAC
address)
[IP Header] Destination IP address = 100.1.1.1, Source IP address = 1.1.1.10 (SVR1's IP address)

About NMC Consulting Group (www.netmanias.com)
NMC Consulting Group is an advanced and professional network consulting company, specializing in IP network areas (e.g., FTTH, Metro Ethernet and IP/MPLS), service
areas (e.g., IPTV, IMS and CDN), and wireless network areas (e.g., Mobile WiMAX, LTE and Wi-Fi) since 2002.
Copyright 2002-2014 NMC Consulting Group. All rights reserved.


8






Carrier WiFi
Data Center Migration
Wireline
Network
LTE
Mobile
Network
Mobile WiMAX
Carrier Ethernet
FTTH
Data Center
Policy Control/PCRF
IPTV/TPS
Metro Ethernet
MPLS
IP Routing
99 00 01 02 03 04 05 06 07 08 09 10 11 12 13
eMBMS/Mobile IPTV
Services
CDN/Mobile CDN
Transparent Caching
BSS/OSS
Cable TPS
Voice/Video Quality
IMS
LTE Backaul
Netmanias Research and Consulting Scope
Visit http://www.netmanias.com to view and download more technical documents.
Future
LTE
I
P
/
M
P
L
S
C
a
r
r
i
e
r

E
t
h
e
r
n
e
t
Networks
C
o
n
s
u
l
t
i
n
g
POC
T
r
a
i
n
i
n
g
W
i
-
F
i
Infrastructure Services
C
D
N
T
r
a
n
s
p
a
r
e
n
t

C
a
c
h
i
n
g
IMS
Concept Design
DRM
e
M
B
M
S
protocols
Analyze trends, technologies and market
Analysis
Report
Technical documents
Blog
One-Shot gallery
We design the future
We design the future
We design the future