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, you’ll 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 doesn’t do what we want it to. Maybe you can have a look. It’s called a Cisco. Here are the manuals.” It didn’t 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 isn’t 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.[1] 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 router’s manual.

What’s 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 Cisco’s 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, aren’t covered in the book.

Chapter 1, 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.

Chapter 2, 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.

Chapter 3, 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.

Chapter 4, 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.

Chapter 5, 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.

Chapter 6, explains how to take advantage of having two connections to the Internet by optimizing the traffic flow for input and output traffic. The chapter provides many examples of how to configure the mechanisms that influence route selection, such as manipulation of the AS path, the Multi Exit Discriminator, and communities. Chapter 5 and Chapter 6 include Routing Policy Specification Language (RPSL) examples for several routing policies described in these chapters.

Chapter 7, 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.

Chapter 8, 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.

Chapter 9, starts with a small section on managing the troubleshooting process and then explains how to troubleshoot physical and datalink layer problems and, in detail, interdomain routing and reachability problems.

Chapter 10, examines the challenges of designing a large, stable network. It discusses BGP peer groups, use of loopback addresses for internal BGP (iBGP), iBGP scaling using route reflectors and confederations, and preservation of CPU cycles by dampening route flaps. It also contains examples of how to use OSPF as the interior routing protocol, the pitfalls of route redistribution, and traffic engineering in the internal network.

Chapter 11, explains how to provide your multihomed customers with the tools they need to make the best use of their connection to you if you provide transit services. This includes ways for them to deflect Denial of Service attacks and communities for traffic engineering. The chapter also tells you how you can connect non-BGP customers with a backup connection and discusses providing IPv6 and multicast services.

Chapter 12, is mainly about connecting to a public exchange point such as an Internet Exchange, network access point (NAP), or Metropolitan Area Exchange (MAE). It presents the business case for exchanging traffic with other networks (peering), how to connect to an exchange point, and the routing issues associated with connecting to several exchange points. The chapter ends with configuration examples for securing border routers against abusive traffic from peers.

There are three appendixes. Appendix A, tells you how to perform configuration changes on a Cisco router and explains a basic IP configuration. Appendix B, shows how netmasks and prefixes work in their native binary representation. Appendix C, is an overview of the IPv4 address space and address ranges reserved for special purposes.

Finally, there is a Glossary that defines terminology related to BGP.

How to Read This Book

The book is structured such that it’s best read from the beginning to the end. If you are new to Cisco routers, read Appendix A first. If you’re unfamiliar with configuring BGP and properly filtering incoming and outgoing routing updates, you should read and understand those sections in Chapter 5 before moving on. Chapter 6 explains how route maps work; they’re extensively used in examples in later chapters. Apart from this you can implement individual examples as desired, but remember that the examples are just that: they show how something could be done, which isn’t necessarily the best way to do it in your particular situation. However, the text should provide you with enough information to be able to adapt the examples to the particulars of your network. Chapter 10, Chapter 11, and Chapter 12 are mostly of interest if you work in an ISP environment, but they should be informative for others as well, if not immediately applicable.

Conventions Used in This Book

Italic is used for:
  • Commands, filenames, statements, keywords, and directories

  • New terms where they are defined

  • Internet addresses, such as domain names and URLs

Constant width is used for:
  • IP addresses, subnet masks, error messages, formulas, attributes, prefixes, and BGP communities

Constant width italic is used for:
  • Replaceable text

Constant width bold is used for:
  • User input

Tip

This icon designates a note, which is an important aside to the nearby text.

Warning

This icon designates a warning relating to the nearby text.

The word “host” is used for any system implementing TCP/IP that doesn’t perform any networking functions on behalf of other systems, such as forwarding packets, i.e., a regular PC or workstation. A “router” is any system performing IP forwarding. A “system” is either a host or a router. All addresses, AS numbers, and domain names used in examples are fictional, and where they are the same as actual numbers or names used on the Internet, this is completely coincidental. Replace those numbers with your own when implementing the examples.

Interdomain routing borrows jargon from different disciplines, resulting in many words being used in different ways by different people. I’ve tried to be consistent in my use of technical terms, but I’m sure I haven’t been completely successful in avoiding the use of different words for the same thing, or the same word for different things. When in doubt, look the word up in the Glossary or the Index.

How to Contact Us

Please address comments and questions concerning this book to the publisher:

O’Reilly & Associates, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
(800) 998-9938 (in the United States or Canada)
(707) 829-0515 (international or local)
(707) 829-0104 (fax)

We have a web page for this book, where we list errata, examples, or any additional information. You can access this page at:

http://www.oreilly.com/catalog/bgp

To comment or ask technical questions about this book, send email to:

For more information about our books, conferences, Resource Centers, and the O’Reilly Network, see our web site at:

http://www.oreilly.com

Acknowledgments

First of all, I’d like to thank everyone who gave me the opportunity to work on their network over the years, specifically Michel, Sylvia, Joost, Roy, Patrick, Mark, and Irene. I owe another debt of gratitude to the technical reviewers: Elsa Lankford, Frank Pohlman, Jonathan Hassell, Ravi Malhotra, and Nick Vermeulen. The comments from Ravi and Nick were especially valuable. Richard Jimmerson and Job Witteman provided important suggestions as well. And thanks to my editor Jim Sumser for his constant encouragement, and to all the people at O’Reilly who turned this book from a bunch of letters on the screen into something tangible.



[1] Configuration examples are based on Cisco IOS Version 12.0 and should run on all Cisco BGP-capable platforms.

Get BGP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.