85
Routing Basics 1

Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

  • Upload
    others

  • View
    30

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Routing Basics

1

Page 2: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Small additions by Dr. Enis Karaarslan, 2014

Purdue - Aaron Jarvis (Network Engineer)

Page 3: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Routing Concepts

• IPv4• Routing• Forwarding• Some definitions• Policy options• Routing Protocols

3

Page 4: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

IPv4

• Internet uses IPv4– Addresses are 32 bits long– Range from 1.0.0.0 to

223.255.255.255– 0.0.0.0 to 0.255.255.255 and

224.0.0.0 to 255.255.255.255 have “special” uses

• IPv4 address has a network portion and a host portion

4

Page 5: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

IPv4 address format

• Address and subnet mask– written as– 12.34.56.78 255.255.255.0 or– 12.34.56.78/24– mask represents the number of

network bits in the 32 bit address– the remaining bits are the host bits

5

Page 6: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway
Page 7: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

What does a router do?

7

Page 8: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

A day in a life of a router

find pathforward packet, forward packet,

forward packet, forward packet...find alternate pathforward packet, forward packet,

forward packet, forward packet…repeat until powered of

8

Page 9: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Routing versus Forwarding

• Routing = building maps and giving directions

• Forwarding = moving packets between interfaces according to the “directions”

9

Page 10: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

IP Routing – finding the path

• Path derived from information received from a routing protocol

• Several alternative paths may exist– best path stored in forwarding table

• Decisions are updated periodically or as topology changes (event driven)

• Decisions are based on:– topology, policies and metrics (hop count,

filtering, delay, bandwidth, etc.)

10

Page 11: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

1: How Does Routing Work?

• Internet is made up of the ISPs who connect to each other’s networks

• How does an ISP in Kenya tell an ISP in Japan what customers they have?

• And how does that ISP send data packets to the customers of the ISP in Japan, and get responses back– After all, as on a local ethernet, two way

packet flow is needed for communication between two devices

11

Page 12: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

2: How Does Routing Work?

• ISP in Kenya could buy a direct connection to the ISP in Japan– But this doesn’t scale – thousands of ISPs,

would need thousands of connections, and cost would be astronomical

• Instead, ISP in Kenya tells his neighbouring ISPs what customers he has– And the neighbouring ISPs pass this

information on to their neighbours, and so on

– This process repeats until the information reaches the ISP in Japan

12

Page 13: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

3: How Does Routing Work?

• This process is called “Routing”• The mechanisms used are called

“Routing Protocols”• Routing and Routing Protocols

ensures that the Internet can scale, that thousands of ISPs can provide connectivity to each other, giving us the Internet we see today

13

Page 14: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

4: How Does Routing Work?

• ISP in Kenya doesn’t actually tell his neighbouring ISPs the names of the customers– (network equipment does not understand names)

• Instead, he has received an IP address block as a member of the Regional Internet Registry serving Kenya – His customers have received address space from

this address block as part of their “Internet service”

– And he announces this address block to his neighbouring ISPs – this is called announcing a “route”

14

Page 15: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Routing Protocols

• Routers use “routing protocols” to exchange routing information with each other– IGP is used to refer to the process

running on routers inside an ISP’s network

– EGP is used to refer to the process running between routers bordering directly connected ISP networks

15

Page 16: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

IGP x EGP

An Interior Gateway Protocol (IGP) is a type of protocol used for exchanging routing information between gateways (commonly routers) within an Autonomous System

• Exterior gateway protocols (EGP) are

used to exchange routing information between Autonomous Systems and rely on IGPs to resolve routes within an AS.

Page 17: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

What Is an IGP?

• Interior Gateway Protocol• Within an Autonomous System• Carries information about

internal infrastructure prefixes• Two widely used IGPs:

– OSPF– ISIS

17

Page 18: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Why Do We Need an IGP?

• ISP backbone scaling– Hierarchy– Limiting scope of failure– Only used for ISP’s infrastructure

addresses, not customers or anything else

– Design goal is to minimize number of prefixes in IGP to aid scalability and rapid convergence

18

Page 19: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

What Is an EGP?

• Exterior Gateway Protocol• Used to convey routing

information between Autonomous Systems

• De-coupled from the IGP• Current EGP is BGP

19

Page 20: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Why Do We Need an EGP?

• Scaling to large network– Hierarchy– Limit scope of failure

• Define Administrative Boundary• Policy

– Control reachability of prefixes– Merge separate organizations– Connect multiple IGPs

20

Page 21: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Interior versus ExteriorRouting Protocols

• Interior– automatic

neighbour discovery

– generally trust your IGP routers

– prefixes go to all IGP routers

– binds routers in one AS together

• Exterior– specifically

configured peers– connecting with

outside networks– set

administrative boundaries

– binds AS’s together

21

Page 22: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Interior versus ExteriorRouting Protocols

• Interior– Carries ISP

infrastructure addresses only

– ISPs aim to keep the IGP small for efficiency and scalability

• Exterior– Carries customer

prefixes– Carries Internet

prefixes– EGPs are

independent of ISP network topology

22

Page 23: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Hierarchy of Routing Protocols

23

BGP4

BGP4and OSPF/ISIS

Other ISPs

CustomersIXP

Static/BGP4

BGP4

Page 24: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

FYI: Cisco IOS Default Administrative Distances

24

Connected Interface Connected Interface 00Static RouteStatic Route 11Enhanced IGRP Summary RouteEnhanced IGRP Summary Route 55External BGPExternal BGP 2020Internal Enhanced IGRPInternal Enhanced IGRP 9090IGRPIGRP 100100OSPFOSPF 110110IS-IS IS-IS 115115RIP RIP 120120EGPEGP 140140External Enhanced IGRPExternal Enhanced IGRP 170170Internal BGPInternal BGP 200200UnknownUnknown 255255

Route SourceRoute Source Default DistanceDefault Distance

Page 25: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Dynamic Routing Slide

Page 26: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

26

Basics of Dynamic Routing

Presented by Aaron Jarvis Network Engineer

Page 27: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Agenda

•Introduction to Dynamic Routing

•Choosing the Right Protocol

•Configuring Dynamic Routing

•How the ITaP Production Data Network uses dynamic routing

Page 28: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Agenda

•Introduction to Dynamic Routing

•Choosing the Right Protocol

•Configuring Dynamic Routing

•How the ITaP Production Data Network uses dynamic routing

Page 29: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Introduction to Dynamic Routing

•What is routing?•How data is forwarded between subnets•Network Layer or Layer 3 in the OSI Model•Provides end-to-end reachability

Page 30: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Introduction to Dynamic Routing

•How are routing decisions made?•Forwarded based on the destination IP address•Router builds/maintains a routing table

•Current view of the network•Populated either dynamically or manually

router#show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route

Gateway of last resort is 192.5.40.54 to network 0.0.0.0

69.0.0.0/19 is subnetted, 1 subnetsO E2 69.51.160.0 [110/1] via 192.5.40.54, 6d21h, Port-channel61O E2 199.233.104.0/24 [110/1] via 192.5.40.54, 3w4d, Port-channel61 192.5.40.0/24 is variably subnetted, 19 subnets, 4 masksD 192.5.40.238/32 [90/131328] via 192.31.0.13, 2d16h, Vlan4094 [90/131328] via 192.31.0.113, 2d16h, Vlan4084O IA 192.5.40.225/32 [110/2] via 192.5.40.54, 3w4d, Port-channel61O IA 192.5.40.227/32 [110/4] via 192.5.40.54, 3w4d, Port-channel61C 192.5.40.240/28 is directly connected, Vlan898D 192.5.40.168/29 [90/3072] via 192.31.0.113, 7w0d, Vlan4084 [90/3072] via 192.31.0.13, 7w0d, Vlan4094Snip……

Page 31: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Agenda

•Introduction to Dynamic Routing

•Choosing the Right Protocol

•Configuring Dynamic Routing

•How the ITaP Production Data Network uses dynamic routing

Page 32: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Choosing the Right Protocol

•Interior Routing Protocols•Used within an autonomous system•Used within an area of administrative control

•Exterior Routing Protocols•Used between autonomous systems•Used to peer with networks in which you have no administrative control

Page 33: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Choosing the Right Protocol

•Interior Routing Protocols•Static•RIP•OSPF•EIGRP•ISIS

•Exterior Routing Protocols•BGP

NOTE: This is not an exhaustive list of protocols available but merely a list of those commonly used.

Page 34: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Choosing the Right Protocol

•Static Routing•May be suitable on small networks•Administration intensive as changes have to be made on each router•Commonly used for default routing

•0.0.0.0/0 Next Hop Router

Page 35: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Choosing the Right Protocol

•Dynamic Routing Protocol Types•Distance Vector

•Routing Information Protocol(RIP)•Interior Gateway Routing Protocol(IGRP)•Enhanced Interior Gateway Routing Protocol(EIGRP)

•Link State•Open Shortest Path First(OSPF)•Intermediate System to Intermediate System(ISIS)

•Path Vector•Border Gateway Protocol(BGP)

Page 36: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Choosing the Right Protocol

•Routing Information Protocol(RIP)•RFC 1058(RIPv1), 1988

•Classful, no support for VLSM•No support for authentication

•RFC 2453(RIPv2), 1998•Classless, support for CIDR•Support for authentication

•Uses hop count as routing metric•Slow to converge•Not very scalable

•Limited to 15 hops

Page 37: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Choosing the Right Protocol

•Interior Gateway Routing Protocol(IGRP)•Invented by Cisco to overcome limitations of RIP•Allows for hop count up to 255•Allows for multiple route metrics

•Bandwidth•Delay•Load•MTU•Reliability

•Classful, no support for VLSM

Page 38: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Choosing the Right Protocol

•Enhanced Interior Gateway Routing Protocol(EIGRP)

•Replaced IGRP•Maintains a Topology table

•Successors, feasible successors•Allows for multiple route metrics•Classless, support for CIDR•Very fast to converge•Maintains neighbor relationships•Difusing Update Algorithm(DUAL)•Not as CPU intensive as OSPF

Page 39: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

CIDR (Classless Inter-Domain Routing, sometimes known as supernetting) is a way to allocate and specify the Internet addresses used in inter-domain routing more flexibly than with the original system of Internet Protocol (IP) address classes.

Page 40: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Choosing the Right Protocol

•Open Shortest Path First(OSPF)•RFC 2328(OSPFv2), 1998•Maintains neighbor relationships•Concept of Areas

•Diferent areas can be used to control flooding of routing information

•Classless, supports VLSM•Fast to converge•CPU Intensive Dijkstra Algorithm•Designing can be complicated

Page 41: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Choosing the Right Protocol

•Intermediate System to Intermediate System(ISIS)

•RFC 1142, 1990•Dijkstra Algorithm•Mainly used by large service providers•Does not use IP to carry routing information

•Uses ISO addresses•Level Concept

•Level 1 or Intra Area•Level 2 or Inter Area•Level 1/2 or Both

•Classless, supports VLSM

Page 42: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Choosing the Right Protocol

•Border Gateway Protocol(BGP)•RFC 4271(BGPv4), 2006•Peers manually defined•Used typically for multi-homing to ISP(s)•Very scalable•Makes decisions based upon AS Path•Lots of policy options•Very granular control

Page 43: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Agenda

•Introduction to Dynamic Routing

•Choosing the Right Protocol

•Configuring Dynamic Routing

•How the ITaP Production Data Network uses dynamic routing

Page 44: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Configuring Dynamic Routing

•How to configure dynamic routing?•Choose a protocol that meets your needs•Each vendor has specific commands but should have a configuration guide available to assist•Plan well to ensure a functional network

•Create a diagram•Consider high availability technologies

HSRP VRRP

Page 45: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

HSRP - Hot Standby Router Protocol (HSRP) is a Cisco proprietary redundancy protocol for establishing a fault-tolerant default gateway,

The Virtual Router Redundancy Protocol (VRRP) is a computer networking protocol that provides for automatic assignment of available Internet Protocol (IP) routers to participating hosts. This increases the availability and reliability of routing paths via automatic default gateway selections on an IP subnetwork.

Page 46: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Configuring Dynamic Routing

•Best Practices•Only enable a routing protocol for interfaces you intend on using

•If compromised can cause a lot of problems

•Enable authentication(if available)•Use authentication to ensure that the remote routers are valid peers

Page 47: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Configuring Dynamic Routing

•Best Practices Cont…•Control Network Advertisements

•Only allow networks to be advertised that should be

•Private Address Space•Use only within your organization

•Private AS Numbers•Strip before sending to ISP

Page 48: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

End of Inserted Slide

Page 49: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

IP route lookup

• Based on destination IP address• “longest match” routing

– More specific prefix preferred over less specific prefix

– Example: packet with destination of 10.1.1.1/32 is sent to the router announcing 10.1/16 rather than the router announcing 10/8.

49

Page 50: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

IP route lookup

• Based on destination IP address

50

10/8 announced from here

10.1/16 announced from here

Packet: DestinationIP address: 10.1.1.1

10/8 R310.1/16 R420/8 R530/8 R6…..

R2’s IP routing table

R1 R2

R3

R4

Page 51: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

IP route lookup:Longest match routing

• Based on destination IP address

51R2’s IP routing table

10.1.1.1 && FF.0.0.0 vs.10.0.0.0 && FF.0.0.0

Match!10/8 R310.1/16 R420/8 R530/8 R6…..

10/8 announced from here

10.1/16 announced from here

R1 R2

R3

R4

Packet: DestinationIP address: 10.1.1.1

Page 52: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

IP route lookup:Longest match routing

• Based on destination IP address

52

10.1.1.1 && FF.FF.0.0 vs.10.1.0.0 && FF.FF.0.0

Match as well!

10/8 R310.1/16 R420/8 R530/8 R6…..

R2’s IP routing table

10/8 announced from here

10.1/16 announced from here

R1 R2

R3

R4

Packet: DestinationIP address: 10.1.1.1

Page 53: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

IP route lookup:Longest match routing

• Based on destination IP address

53

10.1.1.1 && FF.0.0.0 vs.20.0.0.0 && FF.0.0.0

Does not match!

10/8 R310.1/16 R420/8 R530/8 R6…..

R2’s IP routing table

10/8 announced from here

10.1/16 announced from here

R1 R2

R3

R4

Packet: DestinationIP address: 10.1.1.1

Page 54: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

IP route lookup:Longest match routing

• Based on destination IP address

54

10.1.1.1 && FF.0.0.0 vs.30.0.0.0 && FF.0.0.0

Does not match!

10/8 R310.1/16 R420/8 R530/8 R6…..

R2’s IP routing table

10/8 announced from here

10.1/16 announced from here

R1 R2

R3

R4

Packet: DestinationIP address: 10.1.1.1

Page 55: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

IP route lookup:Longest match routing

• Based on destination IP address

55

10/8 R310.1/16 R420/8 R530/8 R6…..

R2’s IP routing table

Longest match, 16 bit netmask

10/8 announced from here

10.1/16 announced from here

R1 R2

R3

R4

Packet: DestinationIP address: 10.1.1.1

Page 56: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

IP Forwarding

• Router decides which interface a packet is sent to

• Forwarding table populated by routing process

• Forwarding decisions:– destination address– class of service (fair queuing, precedence,

others)– local requirements (packet filtering)

• Forwarding is usually aided by special hardware

56

Page 57: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Routing Tables Feed the Forwarding Table

57

BGP 4 Routing Table

OSPF – Link State Database

Static RoutesRou

tin

g I

nfo

rmati

on

Base (

RIB

)

Forw

ard

ing

In

form

ati

on

Base

(FIB

)

Connected Routes

Page 58: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

RIBs and FIBs

• FIB is the Forwarding Table– It contains destinations and the interfaces to get

to those destinations– Used by the router to figure out where to send the

packet– Careful! Some people still call this a route!

• RIB is the Routing Table– It contains a list of all the destinations and the

various next hops used to get to those destinations – and lots of other information too!

– One destination can have lots of possible next-hops – only the best next-hop goes into the FIB

58

Page 59: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Packet-switched networks• Packet-switched networks are built on

mesh topologies in which multiple paths to a destination exist. The links in the mesh are point-to-point links joined by routers.

Page 60: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Packet-switched networks

A path to a destination may go through any number of routers, and the path may change at any time due to traffic problems or failed links. In this environment, there are two possible packet-routing methods:- Hop-by-hop, destination-based routing

- Explicit routing

Page 61: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Hop-by-hop, destination-based routing

• This scheme is like getting directions along the way. A packet has a destination address. Each router looks at the address and makes a routing decision about how to forward the packet. Thus, decisions are made on a hop-by-hop basis in the network until the packet reaches its destination.

Page 62: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Explicit routing

• This scheme relies on a network made of switch routers or ATM switches. A predefined path is specified in advance for a packet. This is a virtual circuit in the ATM world. Since the path is predefined, the packet is switched at each node, thus eliminating the need to make routing decisions at every node along the path.

Page 63: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Explicit routing

Explicit routing is useful for traffic engineering, QoS (Quality of Service), and the prevention of routing loops. It requires path setup in advance, something that can be done in IP networks with MPLS (Multiprotocol Label Switching). Source routing is a form of explicit routing in which end systems discover a path through the network in advance of sending packets. Constraint-based routing is a related technique that builds paths based on various constraints programmed into the network, such as bandwidth requirements for specific types of traffic.

Page 64: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Explicit versus Default Routing

• Default:– simple, cheap (cycles, memory,

bandwidth)– low granularity (metric games)

• Explicit (default free zone)– high overhead, complex, high cost, high

granularity• Hybrid

– minimise overhead– provide useful granularity– requires some filtering knowledge

64

Page 65: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Egress x Ingress

• Egress Traffic: Network traffic that begins inside of a network and proceeds through its routers to a destination somewhere outside of the network.

• Ingress Traffic: Network traffic that originates from outside of the networks routers and proceeds toward a destination inside of the network.

Page 66: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Egress Traffic

• How packets leave your network• Egress traffic depends on:

– route availability (what others send you)

– route acceptance (what you accept from others)

– policy and tuning (what you do with routes from others)

– Peering and transit agreements

66

Page 67: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Ingress Traffic

• How packets get to your network and your customers’ networks

• Ingress traffic depends on:– what information you send and to

whom– based on your addressing and AS’s– based on others’ policy (what they

accept from you and what they do with it)

67

Page 68: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

BGP and AS

• Internet is a network of interconnected networks.

• Border Gateway Protocol (BGP) is widely used for routing in the backbone of the Internet. BGP identifies networks which are under a common management as Autonomous Systems (AS).

• Each AS uses a unique Autonomous System Number (ASN) in BGP routing.

• According to CAIDA dataset, there are 45658 different (2014) ASN worldwide.

Page 69: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Autonomous System (AS)

• Collection of networks with same routing policy

• Single routing protocol• Usually under single ownership, trust and

administrative control69

AS 100

Page 70: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Caida As-rank http://as-rank.caida.org/

Page 71: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

NSP – IXP - Tier1

Network Service Providers (NSP) are organizations which provides direct access to the Internet. The biggest transit-free NSPs that can reach all other networks are called Tier-1. Tier-1 networks peer with every other Tier-1 network.

• Internet Exchange Points (IXP) are the aggregation points where networks peer with each other and high rate of network traffic is present. As an example, LINX is an IXP which has aggregated traffic up to 1.194 Tbps. There are 125 known IXPs in Europe.

Page 72: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway
Page 73: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway
Page 74: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway
Page 75: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway
Page 76: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Definition of terms

• Neighbours– AS’s which directly exchange routing information– Routers which exchange routing information

• Announce– send routing information to a neighbour

• Accept– receive and use routing information sent by a

neighbour

• Originate– insert routing information into external

announcements (usually as a result of the IGP)

• Peers– routers in neighbouring AS’s or within one AS

which exchange routing and policy information76

Page 77: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Routing flow and packet flow

For networks in AS1 and AS2 to communicate:AS1 must announce to AS2AS2 must accept from AS1AS2 must announce to AS1AS1 must accept from AS2

77

routing flowacceptannounce

announceaccept

AS 1 AS 2packet flow

packet flow

Page 78: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Routing flow and Traffic flow

• Traffic flow is always in the opposite direction of the flow of Routing information– Filtering outgoing routing

information inhibits traffic flow inbound

– Filtering inbound routing information inhibits traffic flow outbound

78

Page 79: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Routing Flow/Packet Flow:With multiple ASes

• For net N1 in AS1 to send traffic to net N16 in AS16:– AS16 must originate and announce N16 to AS8.– AS8 must accept N16 from AS16.– AS8 must announce N16 to AS1 or AS34.– AS1 must accept N16 from AS8 or AS34.

• For two-way packet flow, similar policies must exist for N1

79

AS 1

AS 8

AS 34

AS16

N16

N1

Page 80: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Routing Flow/Packet Flow:With multiple ASes

• As multiple paths between sites are implemented it is easy to see how policies can become quite complex. 80

AS 1

AS 8

AS 34

AS16

N16

N1

Page 81: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Routing Policy

• Used to control traffic flow in and out of an ISP network

• ISP makes decisions on what routing information to accept and discard from its neighbours– Individual routes– Routes originated by specific ASes– Routes traversing specific ASes– Routes belonging to other groupings

• Groupings which you define as you see fit81

Page 82: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Routing Policy Limitations

• AS99 uses red link for traffic to the red AS and the green link for remaining traffic

• To implement this policy, AS99 has to:– Accept routes originating from the red AS on the

red link– Accept all other routes on the green link

82

red

green

packet flow

Internetred

green

AS99

Page 83: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Routing Policy Limitations

• AS99 would like packets coming from the green AS to use the green link.

• But unless AS22 cooperates in pushing traffic from the green AS down the green link, there is very little that AS99 can do to achieve this aim

83

packet flow

red

green

red

green

InternetAS22 AS99

Page 84: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Routing Policy Issues

• Late May 2012:– 410000 prefixes

• Not realistic to set policy on all of them individually

– 42000 origin AS’s• Too many to try and create individual

policies for• Routes tied to a specific AS or path may

be unstable regardless of connectivity• Solution: Groups of AS’s are a natural

abstraction for filtering purposes

84

Page 85: Routing Basicswiki.netseclab.mu.edu.tr/images/c/cc/Routing.pdf · Protocol •Dynamic Routing Protocol Types •Distance Vector •Routing Information Protocol(RIP) •Interior Gateway

Routing Basics

End

85