Anda di halaman 1dari 18

Border Gateway Protocol (BGP) is an inter-autonomous system routing protocol.

It first appeared in 1989 & has gone through four versions. BGP is based on a method called path vector routing.

T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - BGP

- Prof. Neha M. Srivastava

Distance vector routing is not a good option for interautonomous system routing because there are occasions in which the route with the smallest hop count is not the preferred route. E.g., we may not want a packet to pass through an AS that is not secure even though it is the shortest route. Also, distance vector routing is unstable due to the fact that the routers announce only the number of hop counts to the destination without actually defining the path that leads to that destination. A router that receives a distance vector advertisement packet may be fooled if the shortest path is actually calculated through the receiving router itself.
T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - BGP - Prof. Neha M. Srivastava

Link state routing is also not a good candidate for inter-autonomous system routing because an internet is usually too big for this routing method. To use link state routing for the whole internet would require each router to have a huge link state database. It would also take a long time for each router to calculate its routing table using Dijkstra algorithm.
T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - BGP - Prof. Neha M. Srivastava

In path vector routing each entry in the routing table contains the destination network, the next router, & the path to reach the destination. The path is usually defined as an ordered list of AS that a packet should travel through to reach the destination.
Network N01 N02 N03 N04 Next Router R01 R05 R06 R12 Path AS14, AS23, AS67 AS22, AS67, AS05, AS89 AS67, AS89, AS09, AS34 AS62, AS02, AS09

Fig: Path vector routing table


T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - BGP - Prof. Neha M. Srivastava

The autonomous boundary routers that participate in path vector routing advertise the reachability of the n/w in their own AS to neighbor autonomous boundary routers. Two autonomous boundary routers connected to the same n/w are neighbors. An autonomous boundary router receives its information from an interior routing algorithm such as RIP or OSPF. Each router that receives a path vector message verifies that the advertised path is in agreement with its policy (a set of rules imposed by the administrator controlling the routes). If it is, the router updates its routing table & modifies the message before sending it to the next neighbor. The modification consists of adding its AS number to the path & replacing the next router entry with its own identification.
6

T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - BGP

- Prof. Neha M. Srivastava

Fig: Path vector packets

Fig: shows an internet with four AS. The router R1sends a path vector message advertising the reachability of N1. Router R2 receives the message, updates its routing table, & after adding its AS to the path & inserting itself as the next router, sends the message to router R3. Router R3 receives the message, updates its routing table, & sends the message, after changes to router R4.
- Prof. Neha M. Srivastava

T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - BGP

1)

Loop Prevention:
The instability of distance vector routing & the creation of loops can be avoided in path vector routing. When a router receives a message, it checks to see if its AS is in the path list to the destination. If it is, looping is involved & the message is ignored.

2)

Policy Routing:
Policy routing can be easily implemented through path vector routing. When a router receives a message, it can check the path. If one of the AS listed in the path is against its policy, it can ignore that path & that destination. It does not update its routing table with its path, & it does not send this message to its neighbor. This means that the routing tables in path vector routing are not based on the smallest hop count or the minimum metric; they are based on the policy imposed on the router by the administrator.
T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - BGP - Prof. Neha M. Srivastava

3)

Path Attributes:
The path in the e.g., above was presented as a list of AS, but is, in fact, a list of attributes. Each attribute gives some information about the path. The list of attributes helps the receiving router make a better decision when applying its policy. Attributes are divided into two main categories: well-known & optional. A well-known attribute is one that every BGP router should recognize. An optional attribute is one that need not be recognized by every router. Well-known attributes are themselves divided into two categories: mandatory & discretionary. A well-known mandatory attribute is one that must appear in the description of a route. A well-known discretionary attribute is one that must be recognized by each router, but is not required to be included in every update message.
- Prof. Neha M. Srivastava

T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - BGP

Examples of well-known mandatory attributes:


i. ii. iii.

ORIGIN: defines the source of the routing information. AS_PATH: defines the list of AS through which the destination can be reached. NEXT-HOP: defines the next router to which the data packet should be sent.

The optional attributes are also subdivided into two categories: transitive & non-transitive. An optional transitive attribute is one that must be passed to the next router by the router that has not implemented this attribute. An optional non-transitive attribute is one that should be discarded if the receiving router has not implemented it.
T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - BGP - Prof. Neha M. Srivastava

10

Fig: Types of BGP messages BGP uses four different types of messages: open, update, keepalive, & notification. Packet Format: All BGP packets share the same common header. The fields of the header are: 1) Marker: The 16-byte field is reserved for authentication. 2) Length: This 2-byte field defines the length of the total message including the header. 3) Type: This 1-byte field defines the type of packet. Four types of packet exists, & the values 1 to 4 defines those types.

Fig: BGP packet header


T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - BGP - Prof. Neha M. Srivastava

11

Fig: BGP open message format

1) 2) 3)

4) 5)

6)

To create a neighborhood relationship, a router running BGP opens a TCP connection with a neighbor and sends an open message. If a neighbor accepts the neighborhood relationship, it responds with a keep-alive message, which means that a relationship has been established between the two routers. The fields of the open message are: Version: 1-byte field defines the version of BGP. The current version is 4. My Autonomous System: 2-byte field defines the autonomous system number. Hold Time: 2-byte field defines the maximum number of seconds that can elapse before one of the parties receives a keep-alive or update message from the other. If a router does not receive one of these messages during the hold period time, it considers the other party dead. BGP Identifier: 4-byte field defines the router that sends a open message. The router uses one of its IP addresses (because its unique) for this purpose. Option Parameter length: The open message may also contain some option parameters. If so, this 1-byte field defines the length of the total option parameters. If there are no option parameters, the value of this field is zero. Option Parameters: If the value of the option parameter length is not zero, it means that there are some option parameters. Each option parameter itself has two sub-fields: the length of the parameter & the parameter value. The only option defines so far is authentication.
T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - BGP - Prof. Neha M. Srivastava

12

1) 2)

3) 4)

Update message is the heart of BGP protocol. It is used by router to withdraw destinations that have been advertise previously, announce a route to new destination or both. BGP can withdraw several destinations that were advertise before but can only advertise one new destination in a single update Fig: BGP update message format message. 5) Network layer reachability The fields of the update message: information (NLRI): This field defines Unfeasible routes length: 2-byte field defines the n/w that is actually advertised by the length of the next field. this message. It has a length field & Withdrawn routes: This field lists all the routes an IP address prefix. The length that should be deleted from the previously defines the number of bits in the advertised list. prefix. The prefix defines the common part of the n/w address. E.g., if the Path attributes length: 2-byte field defines the n/w is 153.18.7.0/24. The length of the length of the next field. prefix is 24 & the prefix is 153.18.7.0. Path attributes: This field defines the attributes This means that BGP4 supports of the path (route) to the n/w whose classless addressing & CIDR. reachability is being announced in this message.
T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - BGP - Prof. Neha M. Srivastava

13

The routers, running the BGP protocols, exchange keep-alive messages regularly (before their hold time expires) to tell each other that they are alive. It consists of only a common header.

Fig: BGP keep-alive message format


T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - BGP - Prof. Neha M. Srivastava

14

1) 2) 3)

A notification message is sent by a router whenever an error condition is detected or a router wants to close the connection. The fields comprising the notification message are: Error Code: 1-byte field defines the category of error. Error sub-code: 1-byte field further defines the type of error in each category. Error data: This field is used to give more diagnostic information about the error.
Fig: BGP notification message format

T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - BGP

- Prof. Neha M. Srivastava

15

Error Code 1

Error Code Description Message header error Open message error

Error Sub-Code Description

Three different sub-codes are defined for this type of error: 1) Synchronization Problem 2) Bad Message Length 3) Message Type. Six different sub-codes are defined for this type of error: 1) Unsupported version number 2) Bad peer AS 3) Bad BDG identifier 4) Unsupported optional parameter 5) Authentication Failure 6) Unacceptable hold time. Eleven different sub-codes are defined for this type of error: 1) Malformed attribute list 2) Unrecognized well-known attribute 3) Missing well-known attribute 4) Attribute flag error 5) Attribute length error 6) Invalid origin attribute 7) AS\routing loop 8) Invalid next hop attribute 9) Optional attribute error 10) Invalid network field 11) Malformed ASPATH.
- Prof. Neha M. Srivastava

Update message error

T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - BGP

16

Error Code 4 5 6

Error Code Description Hold time expired Finite state machine error Cease

Error Sub-Code Description No sub-code defined. This defines the procedural error. No sub-code defined. No sub-code defined.

BGP messages are encapsulated in TCP segments using the well-known port 179. This means that there is no need for error control & flow control. When a TCP connection is opened, the exchange of update, keep-alive, & notification messages is continued until a notification message of type cease is sent. BGP uses the services of TCP on port 179.
T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - BGP - Prof. Neha M. Srivastava

17

T.Y.B.Sc.-(I.T.) - Internet Technologies - Routing Protocols - BGP

- Prof. Neha M. Srivastava

18

Anda mungkin juga menyukai