university of belgrade - school of electrical engineering

94
1 University of Belgrade - School of Electrical Engineering Department of Telecommunications

Upload: others

Post on 19-Mar-2022

0 views

Category:

Documents


0 download

TRANSCRIPT

1

University of Belgrade - School of Electrical EngineeringDepartment of Telecommunications

2

BGP-4Theory and Practice

Berislav Todorović[email protected]

Nenad Krajnović[email protected]

3

Routers and RoutingIntroduction to Routing

4

Objectives• Routers

– Definition and classification of routers– IP datagram forwarding algorithm

• Basic principles of routing– Routing table analysis– Less and more specific routes– Aggregation of routing information– Troubleshooting - routing loops and black holes

• Routing information exchange– Static and dynamic routing– Routing protocols– Hierarchy in the routing architecture - interior and exterior routing– Multihoming - is BGP-4 always needed?

5

What is a Router?

• Router - a multi-interface device, used to forward IP datagramsfrom one interface to another, as well as to exchange routing information with other routers, according to:– source and destination IP address of the datagram– routing information, set manually or obtained from other routers– routing policies, set by router administrator, defined by agreements.

• Routers are basically Layer 3 (network layer) devices.• Routers must be compliant with the current standards.• Requirements for IPv4 routers are summarized in RFC 1812.• RFC 1812 is a mustmust--readread--documentdocument, prior to router purchase!• Periodic software upgrades are necessary to keep up-to-date

with the current standards and minimize effects of bugs!

6

IP Forwarding Procedure(taken from RFC 1812, simplified)

• Datagram decapsulation from a data-link layer frame (e.g. Ethernet frame).• Validation of the IP datagram header, using a checksum procedure.• Processing of any IP option (source route, record route etc.).• Examination of the destination IP address (e.g. 147.91.8.55)

– if the destination is the router itself, the datagram should be delivered locally. – if the destination is outside, it should be queued for forwarding.– a copy of the datagram should be, in the latter case, queued for local delivery.

• If the datagram is to be forwarded, the router obtains next hop address from the routing table.

• Router checks access lists, to see whether forwarding to a specific destination is allowed or not. If not, datagram is discarded.

• Router decrements TTL and checks it. If TTL=0, discard the datagram.• If necessary, the router performs datagram fragmentation.• The router determines the next-hop data link layer address, encapsulates the

datagram and sends it, using the appropriate data link protocol.

7

Addressing and Routing

• Address allocation methods has strong impact on routing.• Classful addressing:

– Initially, the address space had been divided into classes (A, B, C, D, E).– Network prefix length was derived directly from the class.– Used by EGP and RIPv1.

• Classless addressing:– In a classless environment, network prefix length may be arbitary.– Network prefix length is being transmitted along with the IP net number.– Classless addressing is a basis of classless inter-domain routing (CIDR).– Used by BGP-4, OSPF and EIGRP.

8

What is CIDR?

• By definition, CIDR comprises three elements:– Topologically significant address assignment– Consistent forwarding algorithm ("longest match rule")– Aggregation of network layer reachability information

• A route to a destination might be:– More specific– Less specific

• Example - for the destination 10.91.12.610.91.12.6:– Route 10.91.12/2410.91.12/24 is more specific than the route 10.91.8/2110.91.8/21.– Route 10.91/1610.91/16 is less specific than 10.91.12/2410.91.12/24.– Route 10.91.12.6/3210.91.12.6/32 would be the most specific in any case!

9

Longest Match Routing Rule

• The routing table may contain mutually overlapping routes.• The router will always follow the most specificmost specific route available!• Example - if the routing table contained:

DestinationDestination Next hopNext hop InterfaceInterface10.91.8.0 /21 10.91.254.9 Serial010.91.8.0 /21 10.91.254.9 Serial010.91.12.0 /22 10.91.254.13 Serial110.91.12.0 /22 10.91.254.13 Serial10.0.0.0 /0 10.91.250.1 Ethernet00.0.0.0 /0 10.91.250.1 Ethernet0

• Traffic to 10.91.8.110.91.8.1 would go to the Serial0Serial0 interface• Traffic to 10.91.14.110.91.14.1 would go to the Serial1Serial1 interface• Traffic to 10.91.1.110.91.1.1 would go to the Ethernet0Ethernet0 interface.

10

Tracing the Route ...

147.91.8.6

A B147.91.8.77 147.91.241.1 147.91.241.5

Destination Gateway Netmask Interface147.91.8.0 147.91.8.6 255.255.255.0 eth00.0.0.0 147.91.8.77 0.0.0.0 eth0

Destination Gateway Netmask Interface147.91.8.0 147.91.8.77 255.255.255.0 Ethernet0147.91.241.0 0.0.0.0 255.255.255.0 Serial0147.91.242.0 0.0.0.0 255.255.255.0 Serial10.0.0.0 147.91.9.1 0.0.0.0 Ethernet1

Destination Gateway Netmask Interface147.91.241.0 147.91.241.1 255.255.255.0 Ethernet00.0.0.0 0.0.0.0 0.0.0.0 Serial0

11

Route Aggregation

147.91.8.0 147.91.8.0 -- 147.91.11.255147.91.11.255

10.91.8 10.91.8 /24/2410.91.9 10.91.9 /24/2410.91.1010.91.10 /23/23

10.91.8 /2210.91.8 /22

• Goals of route aggregation:– Save router memory– Minimize routing information update traffic among routers

• Principle: several more specific route entries could be glued together into a summary entry, if they have the same next hop

• Example:

10.91.8/24

10.91.9/24

10.91.10/23

AA BB

12

Common Aggregation Mistake

10.91.8 /2210.91.8 /22 10.91.8/24

10.91.9/24

10.91.11/24

10.91.10/24

0.0.0.0 /00.0.0.0 /0

AABB

CC DD

Black hole:Black hole:10.91.10/2410.91.10/24

ADVICE - Do not aggregate networks notbelonging or directly reachable to you !!!

13

Correct Setup

10.91.8 /2310.91.8 /2310.91.11/2410.91.11/24 10.91.8/24

10.91.9/24

10.91.11/24

10.91.10/24

10.91.10/2410.91.10/240.0.0.0 /00.0.0.0 /0

AABB

CC DD

Don’t allow former users to hold assignedaddress space upon agreement termination!

14

Static and Dynamic Routing

• Routing tables require updates, as the network grows.• Updates may be manual (static) or learnt dynamically:• Static routes:

– Entered by the router administrator.– Excellent for ISPs, when connecting single-homed customers.– Bad in large network environments.

• Dynamic routing:– Routing table update by the information learnt from other rout– Routing protocols - used to exchange routing information among routers.– Bad in losely controlled networks, where users could announce junk data.

IMPORTANTIMPORTANT -- Routing protocols do not route traffic Routing protocols do not route traffic -- theytheyare only used to exchange routing information!are only used to exchange routing information!

Traffic routing is being performed by IP !!!Traffic routing is being performed by IP !!!

15

Static Routes

• Configured manually, by the router operator.

• Should not be avoided,if it is cost effective!

• Not always flexible, though, but - it works!

• Typical use in ISP networks.•• It is always better to describe It is always better to describe

an unskilled customer with an unskilled customer with static routes than to let them static routes than to let them announce junk to others!announce junk to others!

POPPOP--11

POPPOP--22

CustomersCustomers10.91.8 /2410.91.8 /24 10.91.9 /2610.91.9 /26 10.91.9.64 /2710.91.9.64 /27

10.91.1 /2310.91.1 /23

10.91.4 /2210.91.4 /22

Static routesStatic routes

DynamicallyDynamicallyannounceannounce10.91.8/2310.91.8/23

16

Dynamic Routing

POPPOP--11 POPPOP--22

10.91 /1610.91 /16

AnnounceAnnounce10.91/1610.91/16

AcceptAccept10.91/1610.91/16

Traffic is now allowed to:Traffic is now allowed to:10.91/1610.91/16

ANNOUNCE and ACCEPT policies are an essentialANNOUNCE and ACCEPT policies are an essentialpart of dynamic routing protocols!part of dynamic routing protocols!

17

Routing Protocols

• Routing protocols do not route packets in the network - IP does it!• Routing protocols are used for routing information - routing table

contents exchange among routers in a network.• Regarding the principle of operation, we distinguish among:

– Distance vector (e.g. RIPv1, RIPv2)– Link-state (e.g. OSPF)– Path vector (e.g. EGP, BGP)

• Regarding the dependence of the IP address class, we recognize:– Classful protocols (RIPv1; EGP, BGP-1, 2 and 3)– Classless protocols (RIPv2, OSPF, EIGRP; BGP-4)

18

Distance Vector Protocols

• RIPv1 and RIPv2 fall into this category• Each hop is assigned a fixed distance factor.• Each routing update message contain a vector of (address, distance) pairs.• Router, receiving the update, adds link distance and send update further to others

(except to the router it received update from).• To avoid routing loops, maximum cummulative distance is limited (15 for RIPv1

and RIPv2). This is a serious constrain in huge networks!• Convergence is another problem of distance vector protocols.

1

1

2

11AA

BB

CC

DD

10.91.8.010.91.8.0

10.91.10.010.91.10.0

10.91.8.010.91.8.0 11

10.91.10.010.91.10.0 11

10.91.8.010.91.8.010.91.10.010.91.10.0

3322

10.91.8.010.91.8.010.91.10.010.91.10.0

4433

19

Link State Protocols

• OSPF and IS-IS fall into this category.• Each router interface is assigned a cost factor.• Router sends update messages about the state of its interfaces, along with costs.• Router receives updates and use them to create a network topology graph.• The router calculates optimal routes to destinations from the constructed graph.

R1 R2

R3

Network N

R4

8

10

2224

7R1 R2

R3R4

N

8

0

0

7

10 0

24

22

20

Path Vector Protocols

AS 286

AS 27

AS 5377

AS 3 AS 11

147.91 /16Path: 286

147.91 /16Path: 286

147.91 /16Path: 3 - 286

147.91 /16Path: 11 - 3 - 286

147.91 /16Path: 27 - 286

147.91 /16Path: 27 - 286

147.91 /16Path: 27 - 3 - 286

21

Routing Protocols - Summary

Protocol Principle Application Networksize limit

CIDRsupport

Routeaggreg.

Securitysupport

Underlyingprotocol

EGP Pathvector

Exterior No No No No IPPROTO=8

BGP-4 Pathvector

Exterior No Yes Yes Yes TCPPORT=79

RIPv1 Distancevector

Interior Yes No No No UDPPORT=520

RIPv2 Distancevector

Interior Yes Yes No Yes UDPPORT=520

OSPF Linkstate

Interior No Yes Yes Yes IPPROTO=89

22

The Need for Routing Hierarchy

• Internet is a complex system of autonomous networks, operated by various entities - ISPs, companies, universities ...

• Routing in such an environment requires hierarchy!•• Autonomous system (AS)Autonomous system (AS) -- a set of routers, running under a a set of routers, running under a

single technical administration, having a single (exterior) routsingle technical administration, having a single (exterior) routing ing policy in respect to the other autonomous systems.policy in respect to the other autonomous systems.– Interior routing - routing inside an autonomous system.– Exterior routing - routing among autonomous systems.

• Different protocols are used to exchange routing information relevant for interior and exterior routing.

• Interior routing - OSPF, RIPv1, RIPv2, IGRP, EIGRP …• Exterior routing - BGP-4, EGP, BGP-3 … (mostly BGP-4!)

23

Autonomous System (AS)

• Autonomous system (AS) - a set of routers, running under a single technical administration, having a single (exterior) routing policy in respect to the other autonomous systems.

• One IP network (e.g. 147.91/16147.91/16) may belong to only one AS !!!• One AS may comprise several IP networks (e.g. AS6700AS6700

contains 147.91 /16147.91 /16, 194.106.160 /19194.106.160 /19, 195.252.64 /18195.252.64 /18 etc.).• AS identifiers - 16-bit numbers (0-65535) - limited resource!• Like IP addresses, AS numbers are centrally distributed - IANA,

regional Internet registries and ISPs.

Separate AS number is only required for a multi-homed user,running an exterior routing protocol to its peers.

AS number assignment policy is defined in RFC 1930!

Separate AS number is only required for a multi-homed user,running an exterior routing protocol to its peers.

AS number assignment policy is defined in RFC 1930RFC 1930!

24

Autonomous System and Its Vicinity

AS5377Border router

Ethernet

193.203.18.0/23

160.99.0.0/16

BeoTelNet

TaideNet

147.91.1.0 /24

AS 5479 AS 2614

AS 1800

AS5377

25

What is Exterior Routing?

• Exchange of routing information, relevant for routing IP datagrams from one AS to another.

• Exterior routing protocols (EGP, BGP-4) “see” the whole global network as a directed graph (tree), with AS’s as its nodes.

• Using the information from the routing tables, learnt via exterior routing protocols, IP forwards datagrams from a router in one AS to the router in another one.

• Using an exterior routing protocol, router announces a list of IP networks belonging to its AS (Network-Layer ReachabilityInformation - NLRI).

• Historically, there were many exterior routing protocols (GGP, EGP, BGP), of which BGP-4 is mostly being used today.

26

When to Use Exterior Routing?

• Most answers to this question are given in the RFC 1930RFC 1930.• Exterior routing and a separate public AS number is needed when

the customer is connected to the ISP’s, belonging to different AS’s.• Exterior routing is not really needed and should be avoided if:

– the customer is single-homed, i.e. connected to a single ISP.– the customer is multi-homed, but all peer ISP’s belong to the same AS.– the customer is multi-homed, but the peer ISP’s are directly connected.

• Multi-homed user, having a small network (prefix > /19) might experience connectivity problems (Sprint’s BGP update filtering policies).

• Alternate solution: obtain address space from all ISP’s (a small IP network, say /26 or less), use private address space in your network and NAT on the router.

27

Multi-homing to the Same AS

AS 5377

AS 702

AS 3561

ISP ABackbone

ISPISP B

User AS 701

195.252.96/24

195.252.96/24

195.252.96 /24

195.

252.

96 /2

4

195.252.96 /24

195.252.96 /24

BGP-4

OSPF, EIGRP, RIP ...

28

Multi-homing to Directly Connected ISP’s

Ethernet

ISP A(AS 8400)

ISP B(AS 6700)

160.99.32 /19

160.99.32 /19 160.

99 /1

6

160.99.32 /19

AS 8400

BGP-4

OSPF, EIGRP...

160.99 /16

160.99 /16160.99 /16

ISP C(AS 5377)

ISP D(AS 8534)

29

BGP-4Border Gateway Protocol

(Principles of Operation)

30

BGP-4(Border Gateway Protocol - RFC 1771, 1772)

• Exchanges inter-AS routing information, between two routers in the same or different AS (BGP speakers, border routers, peers).

• A TCP connection (port 179) must be established between peers.• Upon startup, the whole (or partial routing table) is exchanged.• Later, only incremental NLRI is exchanged, depending on inter-

AS link states.• Supports policy-based routing (policies).• All routing policies, based on the hop-by-hop paradigm are

supported by the BGP-4.• Supports route aggregation, saving router memory and inter-AS

communication link bandwidth usage.• Supports CIDR.

31

BGP-4 - Messages

• BGP-4 uses four standard types of messages:– OPEN - used to negotiate neighbor parameters.– UPDATE - used to exchange NLRI between the BGP speakers.– NOTIFICATION - used to report errors.– KEEPALIVE - used to check inter-BGP-speaker link availability.

• OPEN - contains: version, AS number, hold time, router ID (highest IP address on the router, or highest loopback address).

• NOTIFICATION - contains the error code.• KEEPALIVE - sent periodically to assure availability of the link

between BGP speakers, at rate less than hold timer. If hold timer expires, the BGP session is closed and the routes withdrawn.

• UPDATE - used to exchange NLRI.

32

How BGP-4 Works?

• Two BGP speakers, located in the same or different AS’s establish a TCP connection (port 179).

• The BGP speakers exchange OPEN messages, to negotiate parameters.• Initially, the whole routing table is exchanged. Later, only incremental

changes are being exchanged.• Upon receiving an update, a BGP speaker decides whether to accept it or not

and whether or not to announce it further.• Data used in decision-making process are:

– Route to the destination already existing in the routing table (if it does exist).– Routing policies, set locally by the network administration.– Routing policies, set by the neighbor network administrators.

• Decision-making process might result in– Installing a new route in the routing table– Ignoring the update, but announcing it further.– Total ignorance of the update, without announcing it further.

33

UPDATE Message Format

Message headerWL <- Widthdrawn route list length (2 bytes)

<- Path attributes list length (2 bytes)PLRoute 1 Route 2 Route 3

Attribute 1 Attribute 2 Attribute 3NLRI route 1 NLRI route 2 NLRI route 3

Route format: Prefix length Prefix address

...

...

...

AS_PATH: Flags 2 #AS's ...AS 1 AS 2

34

BGP Path Attributes

• Attributes - set of parameters used to keep track of route-specific information (path, route preferences, next hop, aggregation etc.).

• Used in decision-making process of a BGP process on the routers.• Format: attribute typeattribute type, , attribute lengthattribute length, , attribute valueattribute value• Well-known attributes - must be supported by all implementations:

– Well-known mandatory - must be present in each update (e.g. AS path)– Well-known discretionary - may or may not be present in each update

• Optional attributes - not required by all BGP implementations:– Optional transitive - the attribute must be passed to other BGP speakers.– Optional non-transitive - should be ignored and not passed to others.

35

Review of BGP Path Attributes

Code Attribute Name Cat. Short description1 Origin WK-M Origin of info (IGP/EGP/incomplete)2 AS_Path WK-M List of traversed AS numbers3 Next_hop WK-M IP address of next hop to destination4 Multi_exit_disc Opt-NT Advise other AS on path selection5 Local_pref WK-D Used in path select. within a local AS6 Atomic_aggr WK-D Used to control route aggregation7 Aggregator Opt-T Used to control route aggregation8 Community Opt-T Grouping of routes with same policies

36

Basic Mode of Operation

AS 286

AS 27

AS 5377

AS 3 AS 11

147.91 /16Path: 286

147.91 /16Path: 286

147.91 /16Path: 3 - 286

147.91 /16Path: 11 - 3 - 286

147.91 /16Path: 27 - 286

147.91 /16Path: 27 - 286

147.91 /16Path: 27 - 3 - 286

37

Basic Routing Configurations

AS 2

AS 27

AS 5377

AS 3 AS 11

Stub ASStub ASOnly one

neighbor AS

MultiMulti--homed AShomed ASMultiple neighbors, no transit!

Transit ASTransit ASFull transit

38

Stub AS

CustomerAS 6701AS 6701

10.91 /1610.91 /16172.16.64 /18172.16.64 /18

ISPAS 27AS 27

• Customer AS 6701 must be “visible” from the Internet.• Thus, AS6701 has to announce its IP networks to AS 27.• That will allow incoming traffic to 6701 to flow.

Announce10.91/16172.16.64/18

TRAFFIC

• The ISP AS27AS27 must provide enough information to AS6701.• Thus, they will have to announce ANY information they have.• Alterately, they will announce a default route only.

39

Stub AS - a Better Approach

CustomerAS 65500AS 65500

10.91 /1610.91 /16172.16.64 /18172.16.64 /18

ISPAS 27AS 27

Announce10.91/16172.16.64/18origin: AS65500origin: AS65500

• AS numbers are a limited resource (only 65535 numbers!).

• IANA has reserved the range 64512 64512 -- 6553565535 for private AS’s.• Private AS numbers do not get included in the AS path attribute.• Thus, the customer might want to use a private AS number (say, AS65500AS65500).• The customer will announce their networks to the ISP (AS27AS27).• Since the private AS number is ignored, all routing information will look like it

originated from AS27.

Announce10.91/16

172.16.64/18origin: AS27origin: AS27

40

Stub AS - the Best Solution

ISP

AS 27AS 27• Running BGP-4 with a stub AS is not recommended at all.• In the stub AS case, BGP-4 only wastes link bandwidth!• Recommended solution:

– place the customer’s network in the ISP AS (AS 27).– the customer will announce routes to the ISP using an IGP, or the ISP will

use static routes to the customer.– the customer will place a default (0.0.0.0/0) route to the ISP.

Customer10.91 /1610.91 /16

172.16.64 /18172.16.64 /18

default

static routes

41

Multi-homed Non-transit AS

AS 27 AS 12 AS 5377

Task:• AS12 wants to use links to AS27 and AS5377 for load balancing.• AS12 doesn’t want to allow traffic from AS5377 to AS27 to pass through it.•• AS12 will announce its networks only to AS 27 and AS 5377.AS12 will announce its networks only to AS 27 and AS 5377.

• AS27 and AS5377 must provide full routing information they have to AS12.• Full global IP routing table (takes about 32 MB) is necessary for load sharing!• It is also possible to have partial IP routing information.•• Partial or full routing information must be announced by both ASPartial or full routing information must be announced by both AS27 and AS5377.27 and AS5377.

42

Preventing Dirty Games

AS 27AS 2710.12/16

AS 12AS 1210.1/1610.1/16

AS 5377AS 537710.91/16

Task:• AS12 doesn’t want to allow traffic from AS5377 to AS27 to pass through it.Problem:• AS27 and AS5377 may place static routes to each other and to “cheat” on AS12.

Static route to 10.91 /16Static route to 10.91 /16

Static route to 10.12 /16Static route to 10.12 /16

Solution:• Apply “accessaccess--class 101 inclass 101 in” on the interfaces to both ISP’s (AS27, AS5377).• The access-list 101 would be of the form:

access-list 101 permit ip any 10.1.0.0 0.0.255.255access-list 101 deny ip any any

43

Transit AS

• Transit may be full or restricted.• Full transit assumes passing traffic from any AS to any other AS.• Restricted transit assumes passing traffic coming from certain AS’s to certain

other AS’s.• Transit routing policies need not to be symmetrical, though it is desirable they

are. Examples:– Consider AS12, passing traffic between AS27 and AS5377.– AS12 may want to pass traffic from AS27 to AS5377, but not in the opposite way. – AS12 may want to pass traffic from AS4, coming through AS27 to AS5377.

AS 27AS 2710.12/16

AS 12AS 1210.1/1610.1/16

AS 5377AS 537710.91/16

AS 4AS 4

44

Transit AS - an Example

Task:• To AS5377, AS12 wants to provide transit service for AS27 and AS4.• To AS27, AS12 wants to provide transit service for AS5377, but not for AS5.• AS12 itself will use both links to AS27 and AS5377, with default to AS27.

AS 27AS 2710.12/16

AS 12AS 1210.1/1610.1/16

AS 5377AS 537710.91/16

AS 4AS 4 AS 5AS 5

Solution:• To AS5377, AS12 will announce all routes from AS27 and AS4.• To AS27, AS12 will announce all routes from AS5377, but not routes from AS5.• Accept anything AS27 and AS5377 announce, except default from AS5377.• Accept default route from AS27.

announceAS27, AS4AS27, AS4

announceAS5377AS5377

45

Basic BGP-4 Routing Configurations Review

• Stub AS:– Standalone AS, connected to its neighbor using a single logical link.– Explicitly forbidden (RFC 1930RFC 1930), except as a temporary solution in the initial

phase of a new AS setup.– If BGP is needed anyway, use a private AS number (64512-65536)!

• Multi-homed, non-transit AS:– Customer AS X, connected to two or more different AS’s.– Transit from one neighbor network to another using AS X is not allowed!

• Tranzitni AS (Transit AS):– Customer AS X, connected to two or more different AS’s.– The customer allows partial or full transit to its neighbors.– Backbone ISP’s orpeate in full-transit mode, to ensure global connectivity.

46

BGP-4Border Gateway Protocol

(Setting up and Running)

47

Scope of this Section

• Setting up a BGP-4 connection between peer routers• Passing BGP-4 information inside of the AS• Injecting routing information into BGP• Decision-making process• BGP attributes and their usage• Path Selection Criteria.

48

Establishing a BGP-4 Session

• That is not always possible:– some AS’s have multiple exit points– some routers cannot run BGP

• BGP-4 peer routers must be directly physically connected!

AS1AS1 AS3AS3AS2AS2

• Possible solutions:– Internal BGP (IBGP)– External BGP (EBGP) multi-hop

AS1AS1 AS3AS3

AS2AS2

AS1AS1 AS3AS3

AS2AS2

49

Passing BGP InformationInside an AS

• An AS might have a single or (more oftenly) multiple exit points.• Information learnt via BGP-4 from one exit point must be passed

along the AS to all other exit points.• This can be done using two different approaches:

–– Establish an internal BGP (IBGP) session between border routers.Establish an internal BGP (IBGP) session between border routers.–– Redistribute BGP information into an IGP on entry and back to BGRedistribute BGP information into an IGP on entry and back to BGP on exit.P on exit.

• The first approach is better, since it preserves route attributes.• The latter approach might result in complete loss of BGP attributes.• Two basic rules are applied when passing BGP information out:

–– Do not advertise a network without checking whether it is internDo not advertise a network without checking whether it is internally ally reachable within the AS.reachable within the AS.

–– Do not advertise an external route, until all routers within AS Do not advertise an external route, until all routers within AS dondon’’t learn it t learn it (the rule of (the rule of SynchronizationSynchronization)!)!

50

External and Internal BGP(EBGP, IBGP)

AS 2

AS 27

AS 5377

AS 11

External BGPExternal BGPPeering between different AS’s

??

Internal BGPInternal BGPPeering inside of an

AS

51

Another Solution - Use of an IGP(OSPF, RIPv1, RIPv2 …)

AS 2

AS 27

AS 5377

AS 11

External BGPExternal BGPPeering betweendifferent AS’s

IGP (RIP, OSPF)IGP (RIP, OSPF)Routing information

exchange using IGP’s

External BGPExternal BGPBGP attributes received from

AS2 are lost !!!

52

BGP Continuity Inside of an AS

• To avoid routing loops inside the AS, BGP does not advertise routes learnt from other IBGP peers to other internal BGP peers.

– Router A will advertise its EBGP routes to B, but B won’t pass them to C.– Router C will advertise its EBGP routes to B, but B won’t pass them to A.– Router B will advertise its EBGP routes to A and C.

• Apparently, there is a need for an IBGP session between routers A and C!

AA

BB

CC

IBGPIBGP IBGPIBGP

EBGPEBGP EBGPEBGP

EBGPEBGP

The IBGP sessions must be fullyThe IBGP sessions must be fully--meshed inside an AS!meshed inside an AS!

IBGPIBGP

53

Synchronization Within an AS

IBGPIBGP

• Router A receives update for 10.91/1610.91/16, via EBGP from its neighbor.• Router A passes the update to the router C, using the existing IBGP session.• Router C passes the update to its neighbor, router D, using EBGP.• Upon receiving update, router D can send traffic for 10.91/1610.91/16 via router C.• Router C receives this and passes it to router B3, which doesn’t know of 10.91/1610.91/16!

AA

B1B1

CC

EBGPEBGPEBGPEBGP

B2B2B3B3

10.91/1610.91/16

10.91/1610.91/16

DD

BGP BGP must notmust not advertise a route outside the AS, until the route isadvertise a route outside the AS, until the route islearnt by all routers within the AS, either statically or by IGPlearnt by all routers within the AS, either statically or by IGP!!

This default This default behaviourbehaviour may be turned off, if needed!may be turned off, if needed!

54

Injecting Routes into BGP

• Routes may be injected into BGP:– Statically (redistribute static)– Semidynamically (network command)– Dynamically (from an IGP)

• Statically injected routes are stable, but it must be assured that the route goes down when the link goes down (interface-associated).

• Semidynamic method is more effective - it allows injection of a selected set of IGP routes. This method assures good stability!

• Dynamical injection of the whole IGP routing table is not recommended, unless there is a substantial degree of control within the AS and there is a large number of network prefixes.

55

Common Injection Problems

• Injection of private IP addresses (RFC 1918)• Injection of reserved and unallocated addresses• Injection of small networks, filtered by some backbone ISP’s• Injection of a classful network - lack of “ip classless” command

– Best known case - network 62/8, upon startup of its exploatation.

• Unstable routes, route flapping• Paperwork and procedural problems

– Injection without proper documenting in an Internet routing registry (IRR)– Inconsistency between the data in the IRR and the applied routing policy– Changing routing policy, without notificating ANS.

56

Backdoors

• Learning of routing information from different routing protocols is very common.

• For example, the same route (say, 10.91/1610.91/16) may be learnt via BGP (from another BGP speaker), OSPF (from a router inside of AS), static route etc.

• Table of precedence is given on the left - less distance, more preference. The values are changeable.

Protocol DistanceDirect 0Static 1EBGP 20EIGRP (int.) 90IGRP 100OSPF 110ISIS 115RIP 120EGP 140EIGRP (ext.) 170IBGP 200BGP Local 200Unknown 255

57

Backdoors - Example

• Routers A, B and C learn about the same route (10.1/1610.1/16) using EBGP sessions.• However, a direct line between border routers A and C is established.• If the routing information between A and C is exchanged using OSPF, then:

– Router B will announce 10.1/1610.1/16 to C, distance value being 2020.– Router A will annoucne 10.1/1610.1/16 to C, using OSPF, distance value being 110110.– Thus, route via AS2 and router B will always have a precedence.

• This can be changed used a “network a.b.c.d backdoor” command, which raises distance value to 200, placing it less preferred than OSPF.

AA

BB

CC

10.1/1610.1/16EBGPEBGP

10.1/1610.1/16EBGPEBGP

10.1/1610.1/16OSPFOSPF

AS 1AS 1 AS 3AS 3

AS 2AS 2

10.1/1610.1/16

58

Decision-making Process

• The router receives a pool of routes from its peers, by BGP updates.• Input policies are being performed to filter-out update messages.• BGP routing table is being updated and the best route selected.• The best route gets installed in the IP routing table.• A set of output policies is being used to determine what routes

should be advertised further, with what attributes.

Inputpolicies

BGPBGProutingrouting

tabletable

IProutingtable

Outputpolicies UpdatesUpdates

BGP attributes BGP attributes -- play the most important role in theplay the most important role in theroute selection process!route selection process!

59

BGP Path Attributes

• Attributes - set of parameters used to keep track of route-specific information (path, route preferences, next hop, aggregation etc.).

• Used in decision-making process of a BGP process on the routers.• Format: attribute typeattribute type, , attribute lengthattribute length, , attribute valueattribute value• Well-known attributes - must be supported by all implementations:

– Well-known mandatory - must be present in each update (e.g. AS path)– Well-known discretionary - may or may not be present in each update

• Optional attributes - not required by all BGP implementations:– Optional transitive - the attribute must be passed to other BGP speakers.– Optional non-transitive - should be ignored and not passed to others.

60

NEXT_HOP Attribute

• With most IGPs, the next hop to a route is the IP address of the connected interface of the router that has announced the route.

• When speaking of BGP, the next hop is:– EBGP - the IP address of the neighbor that announced the route.– IBGP -

– For routes originated inside the AS - the IP address of the neighbor that announced the route.

– For routes outside the AS (that came via EBGP) - the next hop is carried unaltered (IP address of the external neighbor).

– On multiaccess media - the IP address of the interface connected to the media.

61

NEXT_HOP - Example

• Router C runs an EBGP session with router D and learns the route 10.91.8/2410.91.8/24.– Since this is an EBGP-learnt route, the next hop will be 1.1.1.11.1.1.1 (neighbor D interface)

• Router A runs an IBGP session with router C and learns the route 10.91.1/2410.91.1/24.– Since this is an IBGP-learnt route, locally originated, the next hop will be 2.2.2.22.2.2.2 .

• Router A also learns the route the route 10.91.8/2410.91.8/24 from the router C.– Since this is an IBGP-learnt route, externally originated, the next hop will be 1.1.1.11.1.1.1.

DD

AA

BB

CC

IBGPIBGP

10.91.1/2410.91.1/24

10.91.8/2410.91.8/24

1.1.1.11.1.1.1

2.2.2.22.2.2.2

3.3.3.33.3.3.3

EBGPEBGP

62

NEXT_HOP and Multi-access Media

• Router C learns the route to 11.1.2/2411.1.2/24 from router A, using OSPF.• Router B runs an EBGP session with router C and learns the route 11.1.2/2411.1.2/24.• Question: What is the next hop to 11.1.2/2411.1.2/24? Router C?• Answer: Nope! Router A (10.91.8.310.91.8.3!).

CC

10.91.8.110.91.8.1

EBGPEBGP

11.1.2/2411.1.2/24

10.91.8.310.91.8.3

BBAA

10.91.8.210.91.8.2

OSPFOSPF

On multi-access media (Ethernet, FDDI etc.) a router shouldadvertise the actual source of the route as the next hop, if

the source is on the same multi-access media as the router!

63

NEXT_HOP and NBMA (FR, ATM)

• Router B learns the route to the network 11.11.11/2411.11.11/24 from C by OSPF.• If nothing specified, router B will advertise 11.11.11/2411.11.11/24 to B by BGP, placing the

address of router C (10.91.1.310.91.1.3) as the next hop.• Routers A and C are not directly connected by a PVC and this will fail.• Solution: the router B should always install itself as the next hop for routes

learnt from the router C. This is done by using “next-hop-self”parameter in the “neighbor” command.

CC

10.91.1.210.91.1.2

10.91.1.110.91.1.1

BB

AA

11.11.11/2411.11.11/24

Frame RelayNetwork

10.91.1.310.91.1.3EBGPEBGP

OSPFOSPF

64

AS_Path Attribute

• Sequence of AS numbers a route has traversed to reach a destination• The AS originating the route adds its own AS number and forwards

the update further.• Each AS, receiving the update add (prepend) its own AS number at

the beginning of the sequence and forwards the update further.• At the end, each route will contain the sequence of AS numbers the

update message has traversed. The shortest AS path is preferredThe shortest AS path is preferred!• To prevent routing loops, if an AS finds itself prior in the AS

sequence (which means that update traversed it once) - it will discard the update and stop forwarding it further.

• When traversing through the same AS (IBGP), AS_Path is left untouched.

65

AS_Path - Example

AS 286

AS 27

AS 5377

AS 3 AS 11

147.91 /16Path: 286

147.91 /16Path: 286

147.91 /16Path: 3 - 286

147.91 /16Path: 11 - 3 - 286

147.91 /16Path: 27 - 286

147.91 /16Path: 27 - 286

147.91 /16Path: 27 - 3 - 286

66

AS_Path Prepending

• From AS12, there are two paths to AS300. Path 400 - 300 is better.• However, the administrator might want to prefer the other path.• There are many ways to do so, of which AS number prepending is

the most simple one.

AS 12AS 12

AS 100AS 100

AS 400AS 400

AS 200AS 200

AS 300AS 300

10.91 /1610.91 /16300300

10.91 /1610.91 /1630030010.91 /1610.91 /16

400 300400 300

10.91 /1610.91 /16200 300200 300

10.91 /1610.91 /16

100 200 300

100 200 300

67

AS_Path Prepending

• When an update wants to leave the AS, AS number is prepended.• That number might be prepended multiple times.• For example, let’s prepend AS300 three times (300 300 300 300 300300).• Now, instead of 400 300400 300, at AS12 we have 400 300400 300 300300 300300 300300.• Automatically, the other path (100 200 300100 200 300) will be shorter.

AS 12AS 12

AS 100AS 100

AS 400AS 400

AS 200AS 200

AS 300AS 300

10.91 /1610.91 /16300300

10.91 /1610.91 /16300 300 300300 300300 300300

10.91 /1610.91 /16200 300200 300

10.91 /1610.91 /16

100 200 300

100 200 300

10.91 /1610.91 /16400 300 400 300 300300 300300 300300

68

Local Preference Attribute

• Degree of preference given to a route to compare it with other routes for the same destination. The highest local preference is preferredThe highest local preference is preferred!

• This attribute is defined locally in the AS.• This attribute is valid for all BGP speakers within the same AS.• It is being exchanged normally via IBGP, but not via EBGP.• Used to set the exit point from the AS for a certain destination.• It affects outgoingoutgoing traffic from the AS only. Incoming traffic will

still have a possibility to reach from an arbitary AS entry/exit point (unless AS path prepending or similar technique is not applied).

• Cisco Systems have defined a similar attribute, but valid for the local BGP speaker only - not exchanged even with other speakers in the same AS. It’s called WEIGHT attribute.

69

Local preference - Example

• Both AS200 and AS300 offer the route 10.91/1610.91/16.• However, the path to AS300 may be preferred (higher bandwidth).• The administrator of the router A sets local_pref 200 for that route.• The administrator of the router B sets local_pref 300 for that route.• A and B exchange local_pref attributes and agree on preference.• Incoming traffic may go via either link - local_pref doesn’t have any impact on it!

AS 12AS 12

ISP AAS 100AS 100

ISP BAS 300AS 300

NNAAPP

AS500AS50010.91/1610.91/1610.91 /1610.91 /16

Local Local prefpref = 200= 200

10.91 /1610.91 /16Local Local prefpref = 300= 300

10.91/1610.91/16

10.91/1610.91/16

10.91/1610.91/16

10.91/1610.91/16

AA

BB

70

Multi-exit Discriminator (MED)

• Hint to external neighbors about the preferred path into an AS with multiple exit points. The lowest MED is preferredThe lowest MED is preferred!

• Exchanged between AS’s.• Not transitive - once it enters an AS it doesn’t get transmitted in the

further updates to other neighbors!• When the route is originated by the AS itself, MED for it follows its

IGP metric, which is useful for multiple connections to the same ISP.• At the same time, MED’s reflect the internal topology of an AS.• Only MED’s for paths from the same neighbor AS are compared.

This behaviour may be changed by using “always-compare-med”.

71

MED - Example

• Routers C and D (AS200AS200), as well as router B (AS20AS20) offer the route to 10.91/1610.91/16.• Normally, router A will compare MED’s from routers C and D (AS200AS200 only!).• The router A will chose MED=120 and, therefore, the route via the router C.• If “always-compare-med” is used, it will also take into account router B MED.• In that case the router A will chose MED=50 and, thus, the route via the router B.

AS10AS1000

AS500AS500

AS20AS20MED=50MED=50

MED=200MED=200MED=120MED=120

AABB

CC DD

10.91/1610.91/16

72

ORIGIN Attribute

• Indicates the origin of the routing update, with respect to the AS that originated it.

• BGP considers three types of origins:– IGP - the NLRI at the originating AS is learnt by an IGP– EGP - the NLRI is on the origin learnt by the EGP protocol– INCOMPLETE - NLRI is learnt by some other means (e.g. static)

• Each type of origin is associated a number: IGP=0, EGP=1, INCOMPLETE=1. The lowest ORIGIN value is preferredThe lowest ORIGIN value is preferred!

73

Community Attribute

• Group of destination, sharing some common property.• Communities have no physical boundaries - they are not restricted to

a network or an AS!• A group of IP networks and/or AS’s may form a community, for

which separate routing policies may be set.• Community is a transitive atttributes (passed to other AS’s).• Well-known communities with global meaning (reserved values);

– From 0x00000000 to 0x0000FFFF and from 0xFFFF0000 to 0xFFFFFFFF.– NO_ADVERTISE (0xFFFFFF02) - route in this community - not to be adv.

• Usually, first two bytes are AS number and last is community in AS.• Example: in AS256, good choice is to use 256:1 (0x01000001)• A route may have multiple community attributes. A BGP speaker

may follow one, some or all community attributes in the route.

74

Community Attribute - Example

• Regional multi-homed ISP’s (AS6505AS6505, AS6711AS6711), connect two single-homed branch offices (Bahrain, Muscat).

• The ISP’s announce their routes to their peers, using community attribute: 55:2255:22.• London office is multi-homed (AS55AS55) - we may decide to:

– Use one link for general Internet traffic (but not for traffic to our offices!).– Use another link for the traffic to our offices only!

• Solution: set the router in the London office to: – Accept all routes with community set to 55:2255:22 on the interface Serial0Serial0.– Accept any other route on the interface Serial1Serial1.

Internet

Bahrainoffice

ISPISP

Muscatoffice

ISPISP

AS6505AS6505

AS6711AS6711London office

AS55AS55

75

NO_EXPORT Community - Example

• A customer AS100AS100 with two offices, connected to a WAN is multi-homed.• The customer has two links - each one near one of the offices.• Both links are capable of routing the whole traffic, however this is not efficient.• On the other hand, if we let Bahrain and Muscat offices to announce all more

specific routes, they will be propagated to the NAP.• Solution: set NO_EXPORT community to all routes from AS100 to AS200.• Advertise only the aggregated route to the NAP.

10.91.0/2410.91.0/2410.91.1/2410.91.1/2410.91.2/2410.91.2/24……10.91.15/2410.91.15/24

NNAAPP

10.16/22

AS100AS100AS200AS200

Bahrain

Muscat

NO_EXPORTNO_EXPORT

NO_EXPORTNO_EXPORT

76

BGP Path Selection Criteria

• BGP bases its decision on path selection on the attribute values.• When multiple routes to a same destination exist, the following

sequence of operations is being performed:– If the next hop is inaccessible, the route is ignored.– Prefer the path with the largest WEIGHT parameter.– If the weights are same, prefer the route with the largest local preference.– If the local pref’s are same, prefer the routes with the shortest AS paths.– If AS path length is the same, prefer the route with the loweset ORIGIN.– If origins are the same, prefer the route with the lowest MED.– If the routes have the same MED, prefer EBGP-learnt over IBGP-learnt.– If that fails too, try to find the route with the shortest path to its next hop.– If nothing other helps, the router with lower router ID will be preferred!

77

BGP-4Basic Routing Policies

78

Objectives• Redundancy

– Building stability by providing alternate default routes in the case of link failure. How to do it?

• Symmetry– Configuring routes in such manner that certain traffic enters and exits an

AS at the same point.

• Load balancing– Capability to divide traffic optimally over multiple links.

• Typical scenarios– Controlling inbound and outbound traffic when multihoming to single

and different ISP’s.

79

Redundancy

• Redundancy - possibility to use a backup link to the global network if the main link fails.

• Redundancy is one of the major goals of BGP.• The most simple technique to achieve redundancy is to introduce

multiple default routes inside the AS.• Default route - 0.0.0.0 /00.0.0.0 /0 - is the least specific route in the router

forwarding table, that is used if more specific route for a destination does not exist (Cisco term: gateway of last resort).

• Default route can be learnt:– Dynamically, via BGP or some IGP.– Statically - manually entered by the operator - it can point to a next hop

IP address, specific router interface or a remote IP network.

80

Dynamically Learnt Default Routes

• To achieve redundancy, default routes from multiple sources will be received.

• One route will always be primary, while other will be backup.• Using local preference, we can always prefer one route over the

other.

Primary

Backup

1.1.1.11.1.1.1

2.2.2.22.2.2.2

EBGPEBGP

EBGPEBGP

IBGPIBGP AS2AS2AS1AS1

set localset local--prefpref100100

set localset local--prefpref5050

81

Statically Set Default Routes

1.1.1.11.1.1.1AS1AS1AS10AS10

10.212/1610.212/16 NNAAPP

AS2AS224.32.64/1824.32.64/18

AS5AS538.2 /1638.2 /16

Serial0Serial0

Default routepointing to a

router interfacerouter interface

Default routepointing to the

next hopnext hop

Default routepointing to a

remote IP networkremote IP network

82

Usage of Static Default Routes

• The customer sets a separate default route to AS2AS2 on each router.• Each static route will point to the remote IP network 38.2 /1638.2 /16.• Using local preference, the customer can always prefer one route

over the other.

Primary

Backup

38.2 /1638.2 /16

38.2 /1638.2 /16

0/00/0

IBGPIBGP AS2AS2AS1AS1

set localset local--prefpref100100

set localset local--prefpref5050

0/00/0

83

Symmetry

• Symmetry: traffic leaving the AS from an exit point comes back trhough the same point.

• In multi-homed environment symmetry is hardly achievable.• In some configurations asymmetry is preferred:

Customernetwork

Satellite

ISPISP

OutboundOutbound

traffictraffic

InboundInbound

traffictraffic

84

Load Balancing

• Capability to divide data traffic over multiple connections.• Load balancing does not mean equal distribution of the load.• Perfectly equal load distribution is rarely achievable.• Load balancing might be done on:

Customer

ISP AISP A

ISP BISP B

ISP CISP C

Outbound trafficOutbound traffic

Customer

ISP AISP A

ISP BISP B

ISP CISP C

Inbound trafficInbound traffic

85

Outbound Traffic Load Balancing

Customer

ISP AISP A

ISP BISP B

ISP CISP C

Outbound traffic load balancing mostly depends on what we’llreceive from our peers.By applying appropriate attributes and route filters we canthe effect of their updates.Outbound traffic will depend on the results of decision-makingprocess of our router.

86

Inbound Traffic Load Balancing

Customer

ISP AISP A

ISP BISP B

ISP CISP C

Inbound traffic mostly depends on what we’ll announce to ourpeers. What we announce is what traffic we’ll get!For example, we may decide to announce 10.1/1610.1/16 to ISP A,10.2/1610.2/16 to ISP B and 10.3/1610.3/16 to ISP C. Traffic to 10.1/1610.1/16 will flow from the link to ISP A, traffic to10.2/1610.2/16 from ISP B and traffic to 10.3/1610.3/16 from ISP C.

87

Basic Topology Scenarios

Cases:• One customer, multihoming to a single ISP.• One customer, multihoming to different ISP’s.• Two customers of the same ISP, with a mutual backup link.Configurations:• Minimal configuration - default routes only.• Primary/backup configuration.• Routing with partial BGP routing table (“customer routes”).• Routing with full BGP routing table (cca 50000 routes!).

88

Multihoming to a Single ISPDefault Only, Primary/Backup

Customer Customer ouboundoubound traffic:traffic:• The customer sets two

separate default routes to AS2AS2 on its router.

• One default will be preferred, using local preference.

• One default will be primary, other one backup.

AS2AS2ISPISP

CustomerCustomerAS1AS1

Customer inbound traffic:Customer inbound traffic:• Customer announces

its IP networks to the ISP AS2AS2.

• If nothing applied by the customer, traffic will flow according to the distance between destination and POP.

AA BB

The user may wantThe user may wantto apply differentto apply different

MEDMED’’ss whenwhenadvertising routes.advertising routes.

89

Multihoming to a Single ISPDefault Only, Primary/Backup + Partial Routing

AS2AS2

ISPISP

AS1AS1

AA BB

YYXX ZZ

C1C1 C2C2 C3C3 C4C4

AA BB

Outbound:Outbound: prefer link via A to reach C1 and C2, link B for others.Inbound:Inbound: prefer link via A to reach X, Y; link via B to reach Z.Default route:Default route: link to the location B is primary, with backup to A.

Local_prefLocal_pref::C1, C2: 300C1, C2: 300other: 200other: 200

Local_prefLocal_pref::C3, C4: 300C3, C4: 300other: 250other: 250

MEDMEDX, Y: 200X, Y: 200other: 300other: 300

MEDMEDZ: 200Z: 200other: 250other: 250

90

Multihoming to Multiple ISP’sDefault only, Primary/Backup

Customer Customer ouboundoubound traffic:traffic:• The customer sets

default routes to AS2AS2and AS3AS3 on its router.

• The default should point to a remote network out of ISP A and ISP B network.

• One default will be preferred, using local preference.

AS2AS2

CustomerCustomerAS1AS1

Customer inbound traffic:Customer inbound traffic:• Customer announces

its IP networks to the ISP AS2AS2.

• If nothing applied by the customer, traffic will flow according to the distance between destination and POP.

AA

MEDMED’’ss cannot becannot beused here! Anotherused here! Anotherapproach must beapproach must be

used !!!used !!!

BB AS3AS3

91

Multihoming to Multiple ISP’sDefault only, Primary/Backup + Partial Routing

AS1AS1

AA

YYXX ZZ

C1C1 C2C2

AA BB

Outbound:Outbound: prefer link via A to reach C1 and C2, link B for others.Default route:Default route: link to the location B is primary, with backup to A.

Local_prefLocal_pref::C1, C2: 300C1, C2: 300other: 200other: 200

Local_prefLocal_pref::C3, C4: 300C3, C4: 300other: 250other: 250

AS2AS2BB

C3C3 C4C4AS3AS3

92

Multihoming to Multiple ISP’sInbound Traffic (AS_Path Prepending Technique)

Task: Use AS2AS2 to reach network X, while AS3AS3 to reach network Y and others.

CustomerCustomerAS21AS21

AS23AS23AS22AS22

XX YY

AS50AS50

AS_PathAS_Path::X: 21X: 21Y: 21Y: 21

AS_PathAS_Path::X: 21X: 21Y: 21Y: 21

AS_PathAS_Path::X: 21X: 21Y: 21 Y: 21 2121 2121 2121

AS_PathAS_Path::X: 21 X: 21 2121 2121 2121Y: 21Y: 21

AS_PathAS_Path::X: 22 21X: 22 21Y: 22 21 Y: 22 21 2121 2121 2121

AS100AS100

AS_PathAS_Path::X: 23 21 X: 23 21 2121 2121 2121

23 50 22 2123 50 22 21Y: 23 21Y: 23 21

23 50 22 21 23 50 22 21 2121 2121 2121

93

Customers of the Same ISP + Mutual Backup

CustomerAS1

ISPISPAS10AS10

CustomerAS2

Task:• From AS1AS1 and AS2AS2 use links to AS10AS10 to access all sites.• If any of the links to AS10AS10 fails, allow transit through the remaining link.AS1 - outbound traffic:• Use two default routes, with preference set for default to AS10AS10. AS1 - inbound traffic:• To AS10AS10 announce routes from AS1AS1, without prepending anything.• To AS2AS2 announce routes from AS1AS1, but prepend AS1AS1 at least 3 times.

AS1: 1 1 1AS1: 1 1 1

AS1: 1AS1: 1 AS1: 1 1AS1: 1 11 2 1 1 11 2 1 1 1

94

Thanks!