Routing Basics
Internet Routing Fundamentals
21-23 Nov 2022
1
Back to basics J
Application
Application Application
Presentation (HTTP, DNS, FTP) Data (HTTP, DNS, FTP)
Session
Transport Transport
Transport E2E connectivity (app-to-app) Data Transport
(TCP/UDP) Header
– Port numbers (sockets) (TCP/UDP)
Internet Device to device IP Transport Internet
Network Data
(IPv4/IPv6) – IPv4/IPv6 Header Header (IPv4/IPv6)
address
Data Link Media access
Frame IP Transport Dat
Network control Network
Header Header Header a
Access – MAC Access
Physical address
(Ethernet, PPP) (Ethernet, PPP)
0011010100000111
Addressing is the key!
2
Internet/Network Layer
• Host to host communication across networks
– Addressing
• unique and hierarchical network-wide address
– Routing
• the best path to the destination
• Current protocols
– IPv4 and IPv6
3
L3 Device/Router
• L3 device gets the packet one step closer
– The next hop to reach the destination!
• Router
– Exchanges network information
– Finds the best path to a destination, and
– Forwards the packet to the next hop (a step closer) to reach the
destination
4
Best path lookup – Routing Decision
• Inspects the destination address of the packet
– Network portion
• Looks up its routing table for a “best match”
– Longest matching left-most bits
• If no match, checks for default route
– If no default route, drop the packet!
5
Best path (route) lookup
Dest IP: 2001:db8:1::1/128
2001:db8::/32
R3
GE 1/0
GE 0/0
R1 R2 GE 1/1
R2#sh ipv6 route
R4 2001:db8:1::/48
2001:db8::/32 via R3
2001:db8:1::/48 via R4
………………………
2001:db8::/32 0010000000000001:1101101110000000::
2001:db8:1::/48 0010000000000001:1101101110000000:0000000000000001::
6
Best path (route) lookup
Dest IP: 2001:db8:1::1/128
2001:db8::/32
R3
GE 1/0
GE 0/0
R1 R2 GE 1/1
R2#sh ipv6 route
R4 2001:db8:1::/48
2001:db8::/32 via R3
2001:db8:1::/48 via R4
Match! ………………………
2001:db8:1::1 0010000000000001:1101101110000000:0000000000000001:0:0:0:0:0000000000000001
FFFF:FFFF:: (/32) 1111111111111111:1111111111111111:0000000000000000:0:0:0:0:0000000000000000
AND
2001:db8:: 0010000000000001:1101101110000000::
7
Best path (route) lookup
Dest IP: 2001:db8:1::1/128
2001:db8::/32
R3
GE 1/0
GE 0/0
R1 R2 GE 1/1
R2#sh ipv6 route
R4 2001:db8:1::/48
2001:db8::/32 via R3
2001:db8:1::/48 via R4
………………………
Match!
2001:db8:1::1 0010000000000001:1101101110000000:0000000000000001:0:0:0:0:0000000000000001
FFFF:FFFF:FFFF:: 1111111111111111:1111111111111111:1111111111111111:0:0:0:0:0000000000000000
AND
(/48)
2001:db8:1:: 0010000000000001:1101101110000000:0000000000000001::
8
Best path (route) lookup
Dest IP: 2001:db8:1::1/128
2001:db8::/32
R3
GE 1/0
GE 0/0
R1 R2 GE 1/1
R2#sh ipv6 route
R4 2001:db8:1::/48
2001:db8::/32 via R3
2001:db8:1::/48 via R4
………………………
Longest Match!
2001:db8:1::1 0010000000000001:1101101110000000:0000000000000001:0:0:0:0:0000000000000001
FFFF:FFFF:FFFF:: 1111111111111111:1111111111111111:1111111111111111:0:0:0:0:0000000000000000
AND
(/48)
2001:db8:1:: 0010000000000001:1101101110000000:0000000000000001::
9
Packet Forwarding
• If a best match is found, the router determines
– the correct exit interface to reach the next-hop/destination
Is the best match Directly YES Forward to host
connected
a subnet of …. interface? on local subnet
NO
YES Forward out the
Remote
Network?
exit interface to
the next-hop
NO
NO Is there a YES Forward out the
Drop the gateway of exit interface to
packet! last resort? the next-hop
10
Process vs Hardware Switching
• Incoming packet forwarded to the control plane (CPU)
– routing table (RIB) lookup, frame re-write (next-hop MAC), and
forwarded to the exit interface
Control Plane
RIB
Data Plane
Incoming Packets Outgoing Packets
11
Process vs Hardware Switching
• Instead two hardware based tables
– FIB derived from the RIB- all destinations and next-hops
– Adjacency table from the ARP table- L2 header info for each next-hop
in the FIB
Control Plane
RIB
Data Plane
Incoming Packets Outgoing Packets
FIB & Adjacency Table
12
Internet Routing
• How does a user in VN access a service hosted in the BT?
– The ISP in VN could directly connect to the ISP in BT
• Neither scalable nor economical
– Instead, the VN ISP shares its network information with its neighbor ISPs
– The ISP in BT does the same with its own neighbors
– Neighbor ISPs propagate the information to their neighbors, and so on…
• Eventually, they both learn about each other’s network!
13
Internet Routing
VN BT
AS-X AS-N
Routing flow
Traffic flow
SG IN
AS-Y AS-M
Exchange of network information – Routing
Networks (ASes) connected together – Internet
14
Autonomous System (AS)
• A group of networks with the same routing policy (external)
– Usually under single administrative control
AS-X
15
Routing Flow & Traffic Flow
• Traffic and network info always flow in opposite direction!
– network info exchanged in both directions for bi-directional traffic flow
Packet Flow
Receive Routing Flow
Advertise
AS X AS Y
R1 Accept R2
Send Routing Flow
AS X Packet Flow
16
Routing & Traffic Flow: Internet
VN BT
AS-1 AS-7
Routing flow
Traffic flow
SG IN
AS-3 AS-5
• For user (N1) in AS1 to send traffic to user (N7) in AS7:
– AS7 must originate and announce N7 to AS5.
– AS5 must accept N7 from AS7 and advertise to AS3.
– AS3 must accept and forward N7 to AS1
– AS1 must accept N7 from AS3
17
Routing Policy
• To manipulate/control traffic flow in/out of a network
– manipulate inbound routing info to influence outgoing traffic
– manipulate outbound routing info to influence incoming traffic
18
Routing Protocols
• How do routers exchange network information with each
other?
– Routing Protocols!
– IGP & EGP
19
Interior Gateway Protocol
(IGP)
• To exchange network info within an AS
– Allows all routers within an AS to learn about each other
– To carry infrastructure information (loopbacks & ptp)
• No customer routes!
– The design goal is scalability and fast convergence
• Hence, minimise the number of prefixes carried in IGP!
• Two most widely used IGPs in operator networks
– OSPF & IS-IS
• Uses the SPF algorithm
• Best path selection based on lowest cost/metric
• Supports hierarchical routing – scalability!
20
Exterior Gateway Protocol
(EGP - BGP)
• To exchange network information between ASes
– Implement routing policies (manipulate traffic path)
– Define administrative boundary
• BGP is the de facto EGP!
21
Routing Protocols Hierarchy
Other ISPs
eBGP
iBGP &
OSPF/IS-IS
eBGP Static/eBGP
IX or direct Customers
Peers
22
How it all works
eBGP eBGP
iBGP iBGP iBGP
IGP IGP IGP
AS X AS Y AS Z
Barry Greene & Philip Smith “Cisco ISP Essentials”
23
24
Thank You!
END OF SESSION
25
25