1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers...
Transcript of 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers...
![Page 1: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/1.jpg)
Internet Routing Basics
![Page 2: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/2.jpg)
2
Back to basics J
Device to device– IPv4/IPv6 address
E2E connectivity (app-to-app)– Port num bers (sockets)
Media access control
– MAC address
Addressing is the key!
Application
Presentation
Session
Transport
Network
Data Link
Physical
Application (HTTP, DNS, FTP)
Transport (TCP/UDP)
Internet (IPv4/IPv6)
Network Access
(Ethernet, PPP)
DataTransport Header
IP Header
DataTransport Header
Data
DataTransport Header
IP Header
Frame Header
0011010100000111
Transport (TCP/UDP)
Internet (IPv4/IPv6)
Network Access
(Ethernet, PPP)
Application (HTTP, DNS, FTP)
![Page 3: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/3.jpg)
Internet/Network Layer
3
• 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
![Page 4: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/4.jpg)
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
![Page 5: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/5.jpg)
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
![Page 6: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/6.jpg)
Best path (route) lookup
6
R2#sh ipv6 route
2001:db8::/32 via R32001:db8:1::/48 via R4………………………
R1 R2
R3
R4
Dest IP: 2001:db8:1::1/1282001:db8::/32
2001:db8:1::/48
GE 1/0
GE 1/1GE 0/0
2001:db8::/32 0010000000000001:1101101110000000::
2001:db8:1::/48 0010000000000001:1101101110000000:0000000000000001::
![Page 7: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/7.jpg)
Best path (route) lookup
7
R2#sh ipv6 route
2001:db8::/32 via R32001:db8:1::/48 via R4………………………
R1 R2
R3
R4
Dest IP: 2001:db8:1::1/1282001:db8::/32
2001:db8:1::/48
GE 1/0
GE 1/1GE 0/0
2001:db8:1::1 0010000000000001:1101101110000000:0000000000000001:0:0:0:0:0000000000000001
FFFF:FFFF:: (/32)
1111111111111111:1111111111111111:0000000000000000:0:0:0:0:0000000000000000
2001:db8:: 0010000000000001:1101101110000000::
AND
Match!
![Page 8: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/8.jpg)
Best path (route) lookup
8
R2#sh ipv6 route
2001:db8::/32 via R32001:db8:1::/48 via R4………………………
R1 R2
R3
R4
Dest IP: 2001:db8:1::1/1282001:db8::/32
2001:db8:1::/48
GE 1/0
GE 1/1GE 0/0
2001:db8:1::1 0010000000000001:1101101110000000:0000000000000001:0:0:0:0:0000000000000001
FFFF:FFFF:FFFF:: (/48)
1111111111111111:1111111111111111:1111111111111111:0:0:0:0:0000000000000000
2001:db8:1:: 0010000000000001:1101101110000000:0000000000000001::
AND
Match!
![Page 9: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/9.jpg)
Best path (route) lookup
9
R2#sh ipv6 route
2001:db8::/32 via R32001:db8:1::/48 via R4………………………
R1 R2
R3
R4
Dest IP: 2001:db8:1::1/1282001:db8::/32
2001:db8:1::/48
GE 1/0
GE 1/1GE 0/0
2001:db8:1::1 0010000000000001:1101101110000000:0000000000000001:0:0:0:0:0000000000000001
FFFF:FFFF:FFFF:: (/48)
1111111111111111:1111111111111111:1111111111111111:0:0:0:0:0000000000000000
2001:db8:1:: 0010000000000001:1101101110000000:0000000000000001::
AND
Longest Match!
![Page 10: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/10.jpg)
Packet Forwarding
• If a best match is found, the router determines – the correct exit interface to reach the next-hop/destination
10
Is the best match a subnet of ….
Directly connected interface?
Remote Network?
Is there a gateway of last resort?
Forward to host on local subnet
Forward out the exit interface to
the next-hop
Forward out the exit interface to
the next-hop
NO
YES
NO
YES
YESNODrop the packet!
![Page 11: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/11.jpg)
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
11
Control PlaneRIB
Data PlaneIncoming Packets Outgoing Packets
![Page 12: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/12.jpg)
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
12
Control PlaneRIB
Data PlaneIncoming Packets Outgoing PacketsFIB & Adjacency Table
![Page 13: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/13.jpg)
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
![Page 14: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/14.jpg)
14
Exchange of network information – RoutingNetworks (ASes) connected together – Internet
Internet Routing
AS-X
VN
Routing flow Traffic flow
AS-N
BT
AS-Y
SGAS-M
IN
![Page 15: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/15.jpg)
Autonomous System (AS)
• A group of networks with the same routing policy (external)– Usually under single administrative control
15
AS-X
![Page 16: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/16.jpg)
Routing Flow & Traffic Flow
• Traffic and network info always flow in opposite direction!
– network info exchanged in both directions for bi-directional traffic flow
16
AS X AS Y
Packet Flow
Routing Flow
Packet Flow
Routing Flow
AS X
Advertise
Accept
Receive
SendR1 R2
![Page 17: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/17.jpg)
17
Routing & Traffic Flow: Internet
AS-1VN
Routing flow Traffic flow
AS-7BT
AS-3SG
AS-5IN
• 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
![Page 18: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/18.jpg)
18
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
![Page 19: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/19.jpg)
19
Routing Protocols
• How do routers exchange network information with each other?– Routing Protocols!– IGP & EGP
![Page 20: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/20.jpg)
20
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!
![Page 21: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/21.jpg)
21
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!
![Page 22: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/22.jpg)
22
Routing Protocols Hierarchy
eBGP
iBGP &OSPF/IS-IS
Other ISPs
CustomersIX or direct Peers
Static/eBGP
eBGP
![Page 23: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/23.jpg)
How it all works
23
AS X AS Y AS Z
iBGP iBGP iBGP
IGP IGP IGP
eBGP eBGP
Barry Greene & Philip Smith “Cisco ISP Essentials”
![Page 24: 1. Routing Basics - start [APNIC TRAINING WIKI] · E2E connectivity (app -to-app) – Port numbers (sockets) Media access control – MAC address Addressing is the key! Application](https://reader034.fdocuments.us/reader034/viewer/2022042308/5ed48df53d6f7d64f9067a69/html5/thumbnails/24.jpg)
24