1 / 44

CMPT 471 Networking II

CMPT 471 Networking II. BGP. BGP messages: Keep-Alive. Contains only the header, (length 19 octets) Used for neighbor reachability exchanged to tell the other endpoint of the TCP connection that the connection is still live.

shona
Télécharger la présentation

CMPT 471 Networking II

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CMPT 471Networking II BGP

  2. BGP messages: Keep-Alive • Contains only the header, (length 19 octets) • Used for neighbor reachability • exchanged to tell the other endpoint of the TCP connection that the connection is still live. • Needed because TCP only determines if the TCP connection is live when data are sent through the connection • TCP does not use available TCP feature to monitor connectivity

  3. BGP messages: Keep-Alive • Each neighbor must receive a keep-alive message (or an update) once per hold time to verify the TCP connection is still available • Each neighbor must send a keep-alive message (or an update) periodically to verify the TCP connection is still available • Since propagation times are not ‘constant’ messages are sent more often than 1 per hold time (usually 3x per hold time ~ every 2 minutes)

  4. BGP: neighbor reachability • Failure to receive either at least one keep-alive or at least one update during the hold time will indicate that the even if the connection is functioning the neighbor at the other end is not. • If a neighbor wishes to continue the neighbor relationship but has no routing update to send it will send a Keep Alive message • Each BGP router maintains a database of reachable networks. When a change is made to this database, that is when new or updated routing information is available, the router will send an Update Message containing this change

  5. Update messages • Update messages are also sent when anew neighbor relationship is being created • Consider routers A and B who have established a TCP connection and negotiated BGP connection parameters • All routing information to be shared must be exchanged • Each route in the router A’s data base will be sent to the router B (one per update message) • Each route in the router B’s data base will be sent to the router A (one per update message) • Each of it’s new neighbors routes will be received in an update message from that neighbor

  6. Update messages • Update messages are also sent when any BGP router receives new information that causes it to update it external routing database • The resulting changes to the BGP routers database will be sent to the BGP routers neighbors (one change per BGP update) • Note that only changes are sent in update packets. Routers must remember the contents of each update packet since that information will not be sent to them again

  7. Update messages • When a new path is received it will be compared to the presently used path: • The route is checked to assure it is usable (no loops, acceptable to router) • if the new path is usable and is better (define ‘better’ below) it will replace the old path • If the new path is usable and does not already exist in the data base it will be added • If the present path is declared ‘unreachable’ then check the most recent advertisements from all neighbors and find the best replacement path

  8. BGP update message

  9. Update Message • Update message include two sections one containing data for withdrawal of destinations and one containing information about addition of a path • One path can be added by one update message • For BGP versions 1-3 only one destination could be withdrawn by one update message and classfull addressing was used • For BGP 4 a list of destinationsbelonging to one or more paths can be withdrawn using a single update message and CIDR is supported

  10. What is a path? • In terms of BGP a path has two primary components • A list of ASs traversed or reached by the path • A list of networks reached by the path • The path can also include other attributes of the path that may later be used to choose between paths (more later)

  11. What is a destination? • A destination describes a network that can be reached by a path. • Each AS in a path may have several destinations that are reachable within or through that AS • Each destination is described using a CIDR prefix and a mask length. For example 197.8.2/23

  12. How to represent a destination • Within an update message destinations are represented as follows • A 1 octet length field containing the number of bits in the prefix (the number of bits in the netid of the network or the number of ones in the netmask) • A variable length field containing the prefix (netid). The field will be padded to the nearest octet boundary. The value used for padding is not relevant

  13. Update Message: withdrawal • The first section of an update message includesa list of destinations being withdrawn • Withdrawn destinations: A list of destinations to be withdrawn. Each destination in the list is represented as discussed on the previous slide • Withdrawn Length: length of the list of destinations being withdrawn.A withdrawn length of 0 indicates no routes are being withdrawn

  14. Withdrawing destinations • Multiple destinations can be withdrawn using 1 update message • These ‘destinations’ need not be parts of the same ‘path’ • Note that to reduce the length of the ‘path’ aggregation of paths can be used (more later) • It is possible that ASs related to the withdrawn routes (including the withdrawn destinations) will become superfluous. These ASs remain part of the path but may no longer lead to any destinations

  15. BGP update message

  16. BGP update message • Can add 0 paths or 1 path using 1 update message • Path Length: length of the list of attributes that are part of the new path. (0 length implies no added path) • Path Attributes: list of attributes describing the ASs along the path (to base choice of ‘best’ path on) • The attributes will include AS_PATH which describes ASs traversed by the path • Destination networks: a list of destination networks that can be reached through the ASs given in the AS_PATH (minus those that have been withdrawn)

  17. BGP update: destination networks • Length of the destination networks field is 0 if the path length field is 0. (no path added) • Length of the destination networks field is not given explicitly in the update message (to reduce size of the update message). • Length of the destination networks field is calculated using the following relationship UPDATE message Length - 32 - Total Path Attributes Length - Withdrawn Routes Length

  18. List of destinations for a path • Destinations in the list of destinations are represented in the same way as the withdrawn destinations were represented. • Adding one AS to the path may add more than one additional destination

  19. Attributes: AS_PATH (1) • AS_Path: list of ASs traversed on the path, • ordered sequences, and/or unordered sets describing a path from the source to a particular destination • Used to detect loops. Each time an AS is traversed it will check • Is this AS is already in the AS_PATH list? • If it is then a loop has occurred and the packet is dropped

  20. Attributes: AS_PATH (2) • AS_Path: • Is this AS is already in the AS_PATH list? • If it is not the information about the path is added to the routing database of the intermediate router • If it is not the information may also propagated to additional routers. To propagate the AS information for the current AS is added to the start (leftmost end) of the AS_Path as a sequenced entry of the list and the destinations in this AS are added to the list of destinations

  21. Example: AS path and aggregation • Customers of provider with AS T, have been allocated addresses that form AS X and Y AS: T 197.8.4/23 197.8.0/23 AS: X 197.8.2/24 A D To AS Z C AS: Y 197.8.3/24 B E

  22. Announcing paths • Want to send information about the path to AS T and the path through AS T to routers outside AS T to build a path from outside AS T to AS T • Consider a AS Z connected to T by a point to point connection from router C to router X in AS Z ( a neighbor of T) • Simplest way to advertise the networks reached in and through T is to announce three paths (1 to each AS) Path 1: “T,” reaches 197.8.0/23 and 197.8.4/23 Path 2: “T,X, “ reaches 197.8.2/24 Path 3: “T,Y,” reaches 197.8.3/24

  23. Announcing paths Path 1: “T,” reaches 197.8.0/23 and 197.8.4/23 Path 2: “T,X, “ reaches 197.8.2/24 Path 3: “T,Y,” reaches 197.8.3/24 • Each of these paths includes an ordered list of ASs that are traversed and a list of networks that can be reached • The ordered list of ASs traversed gives an indication of the number of ASs along the path • To reduce the size of our path database at Z we want to minimize the number of paths advertised by T

  24. Aggregation of paths • Aggregate the four networks reached by the three paths to give 197.8.0/21 • How do we aggregate the list of ASs? • We could include the entire list of ASs reached and announce that Path 1: “T,X,Y” reaches 197.8.0/21 But this is misleading since in implies that Y is reached by passing through T then X (indicates 3 hops, which is not correct)

  25. Aggregation of paths • How do we aggregate the list of ASs? • We define two separate lists of ASs, one ordered list (called a sequence) and one unordered (list called a set) • In the sequence we place all ASs that must be passed through to reach all hosts in the aggregated destination network • In the set we place all ASs that can be reached by passing through the networks in the sequence

  26. Aggregation of paths • Aggregate the four networks reached by the three paths to give 197.8.0/21 • Aggregate the three ASs reached into a sequence and a set • We now see that T is reached on the first hop and an additional hop will allow us to reach X and Y Path1: ( Sequence (T), Set(X,Y) ) reaches 197.8.0/22

  27. Forwarding • Next consider AS Z. • AS Z may choose to propagate the path to AS T • AS Z is connected by a point to point link to AS T. If Z chooses to forward the path advertised by T to one of its other neighbors (not directly connected to T) then it will • Add its own AS name to the beginning of the sequence • Send the new extended path to its other neighbor Path: (Sequence(Z,T), Set(X,Y))

  28. Multiple paths • A router may receive announcements of multiple paths to a particular destination • How does the router choose between those paths? • The simplest approach is to choose the path with the shortest sequence (that is consistent with the choosing AS’s policies) • However, we can also take into account other properties of each AS. These additional properties are communicated as additional attributes in the list of attributes.

  29. Form of Attributes • Each attribute has flags, type and a value • Flags, stored in the first four bits of first octet, second four bits of the first octet are reserved • Highest order bit is set if the attribute is optional, If it is not set the attribute is well know (required). It is not expected that all BGP implementations support all optional attributes • Next highest order bit indicates if the option is transitive (1) or not transitive (0) • Optional attributes can be nontransitive (local), or transitive (updated and shared between routers).

  30. BGP update message

  31. Form of Attributes • Each attribute has flags, type and a value • Flags, stored in the first four bits of first octet, second four bits of the first octet are reserved • Third highest order bit of flags indicates whether the information given is complete (0) or partial (1) • Well known attributes must be complete • Fourth highest order bit indicates if the attribute length fills one octet (0) or 2 octets (1) (2 only allowed if length > 255 octets) If it fills two octet the type is moved to the third octet • Remaining four bits are not used • The final 3 flags are used for protocol extensions

  32. Properties of Attributes • Well known attributes must be recognized by all implementations of BGP. • Well know attributes must be transitive and complete (partial bit 0) • Optional attributes that are non transitive must be complete • Option transitive attributes that are not understood are passed along with the path

  33. Other Attributes: • Next_hop: (well known) IP address next BGP router on this route • Multi_Exit_Disc: (optional nontransitive) Information about non BGP routers inside AS. This information is used to determine the best route in cases of multiple available routes, • Origin: (well known) was the network reachabililty information learned from router in local AS (IRP) or from a router external AS (ERP)

  34. Attributes: 4 • Local_pref: (well known) Information about other routers within AS or degree of preference for a particular path, no significance outside local AS, sent between BGP routers in the same AS • Atomic_Aggregate,(well-know),indicates that the networks on the route cannot be disaggregated (Uses address tree structure to reduce amount of info needed). Passed on to all routes containing this route.It is used by a BGP speaker to inform other BGP speakers that the local system selected a less specific route without selecting a more specific route which is included in it.

  35. Which routes to advertise? AS: X AS: Z A B iBGP connection AS: Y C D

  36. Internal and External BGP • We have been discussing BGP connections between BGP speakers that are members of different ASs. These are external BGP connections, eBGP connections) • In an AS containing multiple BGP speakers connections between these BGP speakers are needed. These connections are within the AS itself and are referred to as iBGP connections • All BGP speakers in the AS should be fully connected to all other BGP speaker in the AS

  37. iBGP • Internal BGP connections • Carry BGP routing information throughout the AS (independent of the IRP) so that all BGP speakers in the AS can coordinate their routing • Carry external BGP traffic through the AS independent of (without using) the IRP • The policy of the AS can determine if such transmission of BGP traffic through the network is permitted. (by determining which routes are advertised by each router

  38. Which routes to advertise? AS: X AS: Z A B G iBGP connection AS: Y F C D

  39. Error Notifications • If a BGP speaker • Fails to receive an update message during a period longer than the hold time • Receives a badly formed message • Receives a message containing incorrect or impossible values • Then it will report the problem to its neighbor using a notification message, then gracefully close the TCP connection to that neighbor

  40. Error Code Meaning 1 Message header error 2 OPEN message error 3 Update message error 4 Hold timer expired 5 State machine error 6 Cease: terminate without error Notification message 0 7 Error Code Error Subcode Data (variable length)

  41. Some error subcodes for code 1 • Error Subcode Meaning 1 connection not synchronized 2 bad message length 3 bad message type

  42. Some error subcodes for code 2 • Error Subcode Meaning 1 unsupported version 2 bad peer AS 3 bad BGP identifier 4 unsupported option 5 Authentication failure 6 Unacceptable hold time

  43. Some error subcodes for code 3 • Error Subcode Meaning 1 format error, attribute list 2 unrecognized well known attribute 3 missing well know attribute 4 flag error 5 length error 6 invalid origin 7 routing loop

  44. BGP Routing: Information Exchange • Within AS, router builds topology picture using IGP • Router issues Update message to other routers outside AS using BGP • These routers exchange info with other routers in other ASs • Routers must then decide best routes

More Related