BGP
Iljitsch van Beijnum
Copyright 2010 O'Reilly Media, Inc.
OReilly & Associates books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (.
Nutshell Handbook, the Nutshell Handbook logo, and the OReilly logo are registered trademarks of OReilly & Associates, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and OReilly & Associates, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. The association between the image of a slender-horned gazelle and the topic of BGP is a trademark of OReilly & Associates, Inc.
While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.
Preface
This is a book about connecting to the Internet as reliably as possible. This means eliminating all single points of failure, including having just one Internet service provider (ISP). By multihoming to two or more ISPs, you can remain connected when either ISP (or your connection to them) experiences problems. However, there is a catch: if you are a regular customer, your ISP makes sure your IP addresses are known throughout the Net, so every router connected to the Internet knows where to send packets addressed to your systems. If you connect to two ISPs, youll have to do this yourself and enter the world of interdomain routing via the Border Gateway Protocol (BGP). The majority of this book deals with BGP in a practical, hands-on manner.
My involvement with BGP started in 1995, when I entered a darkened room with a lot of modem lights blinking and was told, This box connects to both our ISPs, but it doesnt do what we want it to. Maybe you can have a look. Its called a Cisco. Here are the manuals. It didnt take me long to figure out that we needed to run BGP to make this setup work as desired, but getting information on how to do this properly was a lot harder: very little of the available BGP information takes actual interdomain routing practices into account. In this book, I intend to provide an insight into these practices, based on my experiences as a network engineer working for several small multihomed ISPs and a large ISP with many multihomed customers, and as a consultant in the area of routing in general and interdomain routing in particular.
Intended Audience
The audience for this book is everyone interested in running BGP to create reliable connectivity to the Internet. It caters specifically to the needs of those who have to determine whether BGP is the right solution for them, and if so, how to go about preparing for and then implementing the protocol. The latter topic occupies most of the book. A lot of the information applies to everyone who needs reliable Internet-connectivity: end-user organizations, application service providers, web hosters, and smaller ISPs. Later in the book, the focus shifts to topics that are mainly of interest to ISPs: interconnecting (peering) with other networks and providing BGP transit services.
The network operations and engineering people at large ISPs should already be well aware of all the issues discussed in this book. However, the sales engineering, provisioning, and support staff should find its information useful when dealing with customers who run or want to run BGP.
Specific prior knowledge isnt required for reading this book, but some exposure to basic networking theory (such as the OSI model), the IP protocol, and relevant lower-layer protocols such as Ethernet would be useful for putting everything in the right perspective. References to books on these topics are spread throughout the text. The configuration examples in this book are all for Cisco routers.[] It proved impossible to provide a useful number of configuration examples for additional router brands without doubling the size of the book and having to change the title to A Comparative Analysis of BGP Implementations and Their Configuration . When using non-Cisco equipment, the book can be used alongside the sections on BGP configuration and IP filtering (access lists) in the routers manual.
[] Configuration examples are based on Cisco IOS Version 12.0 and should run on all Cisco BGP-capable platforms.
Whats in This Book?
The book contains pretty much everything you need to know to run BGP for regular IPv4 routing in all but the largest networks. But there is a lot of related information that is not in the book: the intent of this book is to help you achieve common BGP-related goals, such as reliability and balancing traffic over multiple connections, and provide an introduction into the world of interdomain routing. The book is by no means a reference on the BGP protocol or BGP configuration on a Cisco router. Consult the Cisco documentation at http://www.cisco.com for additional details on Ciscos BGP implementation and IOS in general. For more details on the internals of BGP and other protocols, see the relevant RFCs. Lower-layer protocols such as Ethernet, ATM, and SONET, arent covered in the book.
, sets the scene with some (often misunderstood) history and a discussion of how ISP networks connect together to form the worldwide Internet. It continues with an overview of TCP/IP design principles, the consequences of those principles, and how they make routing protocols necessary. There is a short overview of the IP header and an explanation of why there must be interdomain routing protocols in addition to intradomain (interior) routing protocols.
, is about IP addressing and the inner workings of the BGP protocol, including the multiprotocol extensions and the BGP route selection algorithm. The chapter ends with a discussion of previous versions of BGP and other interdomain protocols.
, discusses the physical side of the network: higher availability through redundancy, router hardware, and network topology. There are also sections on calculating bandwidth requirements and selecting ISPs.
, discusses the various types of IP address space, their limitations, and how to get those addresses. This chapter also covers renumbering IP addresses and introduces the Routing Registry system.
, explains in detail how to configure external BGP (eBGP) to a single ISP and how to determine whether your address block shows up on routers in other networks. The chapter provides examples of how to use a second router to connect to a second ISP and how to configure internal BGP sessions. The chapter also describes a setup in which two BGP routers run the Cisco Hot Standby Routing Protocol (HSRP) so the network remains usable if one router fails. Finally, the chapter provides information on minimizing the impact of link failures and an explanation of eBGP multihop.
include Routing Policy Specification Language (RPSL) examples for several routing policies described in these chapters.
, discusses the best way to secure access to your routers, the use of Telnet versus SSH, and software weaknesses. But the main topics of the chapter are protecting BGP against problems caused by other networks, intentionally or unintentionally. This includes extensive information on using BGP to deflect (Distributed) Denial of Service attacks.
, talks about the requirements interdomain routing imposes on the Network Operations Center and how to manage day-to-day BGP operation. This includes a discussion of the Simple Network Management Protocol (SNMP) management and configuration examples for the popular Multi Router Traffic Grapher (MRTG) software. This chapter also provides suggestions for router names.