180 likes | 474 Vues
Border Gateway Protocol BGP. Hady S. Abdel Salam. In a typical computer network with up to a few hundreds of hosts, Routers have 2 Goals to achieve: Routing (Finding Optimal Route) + Packet Forwarding.
E N D
Border Gateway Protocol BGP Hady S. Abdel Salam
In a typical computer network with up to a few hundreds of hosts, Routers have 2 Goals to achieve: Routing (Finding Optimal Route) + Packet Forwarding Many Routing Algorithms are currently available and technically they are suitable for such deployments. e.g. Distant Vector, RIP, OSPF, … etc Routing for a very large network like the Internet is something different.
To be able to see the differences, we need to have a closer look at the current structure of the Internet. The Internet can be viewed as a large collection of interconnected autonomous systems. • Autonomous System (AS):is a group of networks under the technical administration of the same entity. • e.g. Universities Networks (ODU Network). • Big Corporations Networks (IBM). • Commercial ISP (Verizon Network).
Basically, AS’s are free choosing their internal routing protocols. However an external routing protocol must be agreed upon to allow routing between different AS’s. • This way we have 2 types of routing Protocols: • Interior Gateway Protocols: to route inside the AS’s. • Exterior Gateway Protocols: to route between AS’s Can we use the same routing protocol internally inside AS’s and externally to route between them? MOST PROBABLY NO ... Why ?
Interior Gateway Protocol (IGP): runs inside autonomous systems. Main Goal: Technically find Optimal path. (e.g. minimum number of hops, minimum Delay) AS 200 AS 100 OSPF RIP BGP Exterior Gateway Protocol (EGP): runs between autonomous Systems. Main Goal: Scalable, enables routing policies. ( e.g. Political Policies: Don’t route through bad guys AS’s, Business policies: Don’t use routers of this ISP )
BGP Overview: • BGP has gone through several improvements since its original version, BGP-1, in 1989 till the deployment of BGP-4 in 1993. • BGP-4 support aggregation and CIDR. • BGP is a path vector protocol used to exchange routing information between ASs. Routing information includes sequence of ASs visited to reach some network prefix destination. • The path information associated with the routes is used to: Enable loop prevention + Enforce routing policies + Avoid Count to infinity problem.
How does BGP Work ? • Routers in ASs that are connected to external Ass are called Border Routers (Speakers). • Each router knows exactly the different routes available inside its own AS. • BGP Speakers start communication sessions to exchange routing information. • To do that, BGP uses 4 different types of messages: OPEN, UPDATE, NOTIFICATION, KEEPALIVE.
How does BGP Work ? Cont. Initially, when a BGP session is established between a set of BGP speakers, all candidate BGP routes are exchanged. After the session has been established and the initial route exchange has occurred, only incremental updates are sent. These updates may include route withdrawal. The incremental update approach has improved CPU, bandwidth overhead compared with complete periodic updates used in old protocols.
How does BGP Support Incremental Updates ? • To be able to make incremental updates, BGP must have a table to keep track of its routing table version. • If the table changes, BGP increments the table version number. • KEEPALIVE messages are very light messages that are sent periodically between BGP neighbors to ensure that the connection is kept alive.
BGP Message Header Format • 16-byte Marker field: • Used for authentication so no one should tamper with the routing tables. • 2-byte Length field: • Message length including header. • 1-byte Type field: • There are 4 different types of messages: • OPEN • UPDATE • NOTIFICATION • KEEPALIVE
Open Message Format • 1-Byte Version: BGP-1, BGP-2, BGP-3 or BGP-4. • 2-Byte: AS number of sending router. • 2-Byte Hold Timer: indicates the maximum amount of time in seconds that may elapse between the receipt of successive messages. • 4-Byte BGP Identifier: BGP ID. Router ID (RID), which is calculated as the highest IP address on the router.
Update Message Format • Update Message can withdraw 0 or more routes but it can’t advertise more than one route. • 2-Byte: Unfeasible Routes length. Followed by withdrawn routes. • 2-Byte: Total path attributes length Followed by Path attributes. • <Length (1-Byte), Prefix (Variable)> pairs, that represents advertised networks.
Notification Message Format • 1-Byte The Error code indicates the type of the notification. • 1-Byte The Error sub code provides more specific information about the nature of the error. • The Data field contains data relevant to the error, such as an illegal AS number
KEEPALIVE Message • The KEEPALIVE message is a 19-byte BGP message header with no data following it. • KEEPALIVE messages are periodic messages exchanged between peers to determine whether peers are still reachable or not. • KEEPALIVE messages are sent at a rate that ensures that the hold time will not expire (the session is considered alive). • A recommended KEEPALIVE rate is one-third of the Hold Timer value.
References • RFC 1771, “Border Gateway Protocol-4”. • Russ White, Danny McPherson, Sangli Srihari, “Practical BGP-4”, Addison Wesley, July, 2004. Chapter 1. • “Internetworking Technology Handbook”, Cisco Systems Website, http://www.cisco.com/univercd/cc/td/doc/cisintwk/ito_doc/bgp.htm • Sam Halabi, Danny McPherson, “Internet Routing Architectures”, Cisco Press, Second Edition, Chapter 4, Chapter 5.