Professional Documents
Culture Documents
Outline
Basic Routing Routing Information Protocol (RIP) Open Shortest Path First (OSPF) Border Gateway Protocol (BGP)
Autonomous Systems
Global Internet viewed as collection of autonomous systems. Autonomous system (AS) is a set of routers or networks administered by a single organization Same routing protocol need not be run within the AS But, to the outside world, an AS should present a consistent picture of what ASs are reachable through it Stub AS: has only a single connection to the outside world. Multihomed AS: has multiple connections to the outside world, but refuses to carry transit traffic. It carries only local traffic Transit AS: has multiple connections to the outside world, and can carry transit and local traffic.
AS Number
For exterior routing, an AS needs a globally unique AS 16-bit integer number Currently, there are about 11,000 registered ASs in Internet (and growing) Stub AS, which is the most common type, does not need an AS number since the prefixes are placed at the providers routing table Transit AS needs an AS number Request an AS number from the ARIN, RIPE and APNIC
AS A
AS B
Outline
Basic Routing Routing Information Protocol (RIP) Open Shortest Path First (OSPF) Border Gateway Protocol (BGP)
RIP Operation
Router sends update message to neighbors every 30 sec A router expects to receive an update message from each of its neighbors within 180 seconds in the worst case If router does not receive update message from neighbor X within this limit, it assumes the link to X has failed and sets the corresponding minimum cost to 16 (infinity) If the router later receives a valid min cost to X from another neighbor, the router will replace infinity with the new min cost Uses split horizon with poisoned reverse to reduce routing loops Convergence speeded up by triggered updates neighbors notified immediately of changes in distance vector table
RIP entry
...
Up to 25 RIP entries per message
Allows the RIP packets to carry more info (Ex: subnet mask, next hop and routing domain) Provides a simple authentication procedure
Outline
Basic Routing Routing Information Protocol (RIP) Open Shortest Path First (OSPF) Border Gateway Protocol (BGP)
OSPF
Fixes some of the deficiencies in RIP Enables each router to learn complete network topology Each router monitors the link state to each neighbor and floods the link-state information to other routers Called link-state protocol Each router builds an identical link-state database Allows router to build shortest path tree with router as root OSPF typically converges faster than RIP when there is a failure in the network The shortest path is computed by Dijkstras algorithm
OSPF Features
Multiple routes to a given destination, one per type of service Support for variable-length subnetting by including the subnet mask in the routing message More flexible link cost which can range from 1 to 65,535 Distribution of traffic over multiple paths of equal cost Authentication to ensure routers exchange information with trusted neighbors Multicast rather than broadcast of its messages to reduce the load on systems that do not understand OSPF Support host-specific routes as well as net-specific routes Designated router to minimize table maintenance overhead To improve scalability, OSPF introduces a two level hierarchy that allows an AS to be partitioned into groups called areas, that are connected by a central backbone area
Flooding
Used in OSPF to distribute link state (LS) information Forward incoming packet to all ports except where packet came in Packet eventually reaches destination as long as there is a path between the source and destination Generates exponential number of packet transmissions Approaches to limit # of transmissions: Use a TTL at each packet; wont flood if TTL is reached Each router adds its identifier to header of packet before it floods the packet; wont flood if its identifier is detected Each packet from a given source is identified with a unique sequence number; wont flood if sequence number is same
OSPF Network
To improve scalability, AS may be partitioned into areas Area is identified by 32-bit Area ID Router in area only knows complete topology inside area & limits the flooding of link-state information to area Area border routers summarize info from other areas, that have connections to multiple areas Each area must be connected to backbone area (0.0.0.0) Distributes routing info between areas
OSPF Network
Four types of routers are defined Internal router has all links to nets within the same area Area border router has links to more than one area backbone router has links connected to the backbone Autonomous system boundary router (ASBR) has links to another autonomous system ASBRs learn about routes outside the AS through an exterior gateway protocol such as BGP
OSPF Areas
To another AS
N1 R1 N4
N5
R3 R6 R7 N6 R5
N2 R2
R4 N3
Area 0.0.0.1
R8
Area 0.0.0.0
Area 0.0.0.2
N7
Designated Routers
Reduces number of adjacencies Elected by each multiaccess network after neighbor discovery by hello protocol Generates link advertisements that list routers attached to a multi-access network Backup prepared to take over if designated router fails
OSPF Operation
OSPF packets transmitted directly on IP OSPF packets sent to multicast address 224.0.0.5 OSPF packets sent on specific IP addresses on non-broadcast nets Five OSPF packet types: Hello Database description Link state request Link state update Link state ack
OSPF Header
0 Version 8 Type Router ID 16 Packet length 31
Area ID
OSPF
common
Checksum
Authentication type
header
Authentication
Authentication
OSPF
Data
packet body
OSPF Header
Version: current version is 2 Type: specifies the type of OSPF packet (Hello, Database description, Link state request, Link state update, Link state acknowledgements) Packet Length: specifies the length of OSPF packet in bytes, including the OSPF header Router ID: identifies the sending router, set to the IP address of one of its interfaces Area ID: identifies the area this packet belongs to. The area ID of 0.0.0.0 is reserved for backbone Authentication Type and Authentication: used to authenticate OSPF packets
OSPF Stages
1. Discover neighbors by sending Hello packets (every 10 sec) and designated router elected in multiaccess networks Adjacencies are established & link state databases are synchronized Link state advertisements (LSAs) are exchanged by adjacent routers to allow topological databases to be maintained and to advertise interarea and interAS routes The routers use the info in the database to generate routing table
2. 3.
4.
LSA Header
0 16 24 31
Link-state age
Options
Link-state type
Link-state ID
Advertising router
Link-state checksum
Length
LSA Header
Link state age : describes how long ago the LSA was originated. Options : Optional capabilities that are supported by the router. Link-state type : specifies the type of LSA . The possible types are: router, network, summary( for IP network), summary (for ASB routers), and AS-external. In a network of routers connected by point-to-point links, OSPF uses only router LSAs. Link-state ID : this field identifies the piece of the routing domain that is being described by the LSA. The contents of this field depend on the link-state type.
LSA Header
Advertising router : identifies the router ID of the router that originated the LSA. Link-state sequence number : numbers the LSAs sequentially & can be used to detect old or duplicate LSAs. Link-state checksum: the checksum includes the entire contents of the LSA except the link-state age. Length: specifies the length in bytes of the LSA including this header
LSA Header
There are several link state types
Router link advertisement: generated by all OSPF routers and is flooded within the area only Network link advertisement: generated by all Designated routers and is flooded within the area only Summary link advertisement: generated by all area border routers, it gives routes to destinations in other areas and routes to ASBRs AS External link advertisement: generated by all ASBRs routers, describes routes to destinations outside the OSPF network and is flooded in all areas in the OSPF network
...
Router sends a LS request (type 3) packet to neighbor to update part of its link-state database Each LSA request is specified by the link state type, link state ID, and the advertising router.
LSA 1
...
LSA n
In response to LS request or router finds the link state has changed, the router will send new LS info using the LS update message (type 4) Contents are composed of link state advertisements (LSAs) LS update message is acknowledged using LS ack pkt to ensure that the flooding algorithm is reliable; Link state acknowledgement packets consist of a list of LSA headers.
LSA 1
...
LSA n
When the link state database is updated, the router needs to recompute the shortest path algo and modify the RT according to the updated info
Outline
Basic Routing Routing Information Protocol (RIP) Open Shortest Path First (OSPF) Border Gateway Protocol (BGP)
R2 AS2 R1
R3
AS1
R2 AS2
R3
R1 AS1
R4
N1 AS3
BGP Router
Each BGP router establishes a TCP connection with one or more BGP routers A pair of BGP routers exchange BGP messages to set up a BGP session Exchanges info about new routes that are active or about old routes that have become inactive and to report error that lead to termination of the TCP connection The network reachability info contains a sequence of Ass that packets must traverse to reach a destination network or a group of networks
AS5
AS4
AS7
BGP exchange network reachability information among BGP routers (also called BGP speakers) Network reachability info contains sequence of ASs that packets traverse to reach a destination network Info exchanged between BGP speakers allows a router to construct a graph of AS connectivity
Routing loops can be pruned Routing policy at AS level can be applied
BGP Features
BGP is path vector protocol: advertises sequence of AS numbers to the destination network Path vector info used to prevent routing loops BGP enforces policy through selection of different paths to a destination and by control of redistribution of routing information The BGP routing process begins with the application of import policies to accept, deny or set preferences on the route advertisements received from the neighbors The best routes are selected and the RT are set Export policies are applied to determine which routes should be advertised to neighbors Import policies can be used to filter out route info (unreliable)
iBGP
iBGP to ensure net reachability info is consistent among the BGP speakers in the same AS
usually not directly connected iBGP speakers exchange info learned from other iBGP speakers, and thus fully meshed (TCP connections)
Path Selection
Each BGP speaker Evaluates paths to a destination from an AS border router Selects the best that complies with policies Advertises that route to all BGP neighbors BGP assigns a preference order to each path & selects path with highest value; BGP does not keep a cost metric to any path When multiple paths to a destination exist, BGP maintains all of the paths, but only advertises the one with highest preference value
BGP Protocol
Opening & confirming of a BGP connection with a neighbor router Maintaining the BGP connection Sending reachability information Notification of error conditions
All BGP msgs begin with a fixed size header that identifies the msg type Marker: authenticates incoming BGP messages or detects loss of synchronization between a pair of BGP peers. Length: total length of the msg in octet, including header Type: the type of the msg, 4 msg types are
OPEN UPDATE NOTIFICATION KEEPALIVE
The first msg sent by a BGP router after the TCP connection is established Marker: authenticates incoming BGP messages or detects loss of synchronization between a pair of BGP peers Version: BGPv4 My autonomous system: AS number of the sending router
Hold time: this field is used by the sender, to propose the number of seconds between transmission of successive KEEPALIVE messages. The value 0 indicates that KEEPALIVE messages will not be exchanged at all BGP ID: identifies sending BGP router; value is determined by one of the IP local interface addresses of the BGP router; used to transmit the BGP msgs Optional parameters length: the total length of the optional parameters in octets, otherwise set to 0
Optional parameters: a list of optional parameters, encoded in TLV (parameter type, parameter length, parameter value) structure Currently, only authentication info (parameter type 1) is defined The parameter value contains an authentication code field (one octet) followed by an authentication data field, variable length The authentication code specifies the type of authentication mechanism used, the form and meaning of the authentication data, and the algo used for computing the value of the marker
Marker
Length
Type: KEEPALIVE
BGP speakers continuously monitor the reachability of the peers by exchanging the KEEPALIVE messages periodically KEEPALIVE message is BGP header with the type field set to 4 This msg are exchanged to prevent the hold timer from expiring
Marker
Error code
When BGP speaker detects error or exception, it sends NOTIFICATION message and then closes TCP connection Error Code indicates the type of error condition The error subcode provides more specific info about the nature of the error The data field describes the reason for the notification
Message header error 1. connection not synchronized 2. Bad message length 3. Bad message type OPEN message error 1. unsupported version number 2. Bad peer AS 3. Bad BGP identifier 4. unsupported option parameter 5. Authentication failure 6. Unacceptable Hold Time UPDATE message error 1. Malformed attribute list 2. Unrecognized well-known attribute 3. missing well known Attribute 4. attributes flags error 5. attribute length error 6. invalid origin attribute 7. AS routing loop 8. invalid NEXT_HOP attribute 9. optional attribute error 10. invalid attribute error 11. Malformed AS_PATH Hold time expired Finite state machine error Cease
Update Message
After connection established, BGP peers exchange routing information using the UPDATE messages UPDATE messages used to construct a graph of AS connectivity Info: Unfeasible Routes, Path Attributes; Network Layer Reachability Information (NLRI). UPDATE message can advertise single route &/or withdraw list of routes.
Route Advertisement
The withdrawn routes field provides a list of IP address prefixes for the routes that need to be withdrawn from BGP RT The unfeasible routes length field indicates the total length of the withdrawn routes field in octets
An UPDATE msg can withdraw multiple unfeasible routes from service
BGP router uses NLRI, Total Path Attributes Length, and Path Attributes, to advertise a route NLRI contains list of IP address prefixes that can be reached by the route Path Attributes describe characteristics of the route and is used to affect routing behavior
Route Advertisement
If the NLRI field is present, the total path attribute length field indicates the total length of the path attributes field in octets. Otherwise set to 0, that no route is being advertised UPDATE message has a variable length sequence of path attributes. Each path attribute is a triple <Attribute Type, Attribute Length, Attribute Value>
O bit indicates whether the attribute is optional (O = 1) or required T bit indicates whether the attribute is transitive or nontransitive P bit indicates whether the info in optional transitive attribute is partial (P = 1) or complete E bit indicates whether the attribute length is one octet (E = 0) or two octets
Attributes
Attribute Codes ORIGIN: defines origin of NLRI. A value 0 indicates that the NLRI is interior to the originating AS A value 1 indicates that the NLRI is learned via BGP A value 2 indicates that the NLRI is learned when a static route is distributed to BGP and the origin of the route will be incomplete AS_PATH lists sequence of ASs that route has traversed to reach the destination (detects the loop) NEXT_HOP defines IP address of border router that should be used as the next hop to the destinations listed in the NLRI. For eBGP the next hop is the IP address of the BGP peers. For iBGP the next hop advertised by eBGP should be carried into iBGP
BGP NEXT_HOP
10.1.2.0/24 10.10.1.2
R4 AS2 R1
10.10.3.0/24
10.10.4.2
eBGP
iBGP
10.10.4.1
iBGP
iBGP R2
10.10.1.3
R3 10.10.1.1
AS1
- Reach 10.1.2.0/24 via next hop 10.10.1.2 - Reach 10.10.3.0/24 via next hop 10.10.4.1
- Reach 10.1.2.0/24 via next hop 10.10.1.2 - Reach 10.10.3.0/24 via next hop 10.10.4.2
Attributes Codes
MULTI_EXIT_DISC: used to discriminate among multiple entry/exit points to neighboring AS and to hint about the preferred path. LOCAL_PREF: informs other BGP speakers within the same AS of its degree of preference for an advertised route and this attribute is exchanged only among the iBGP peers and should not be exchanged by the eBGP peers ATOMIC_AGGREGATE: informs other BGP speakers that it selected a less specific route without selecting a more specific one which is included in it. AGGREGATOR: specifies last AS number that formed the aggregate route followed by the IP address of the BGP speaker that formed the aggregate route
BGP MULTI_EXIT_DISC
Multi-Exist Discriminator used to give another AS a hint as to which route is preferred In example, AS2 uses weight values to indicate to AS1 that it prefers that route via R2 be used
R2
R1
AS2
AS1
10.1.1.0/24 with MED=200
R3
Multicast Routing
Reverse path Broadcasting Internet Group Management Protocol Reverse path Multicasting
Multicast Routing
Example: Teleconferencing (a source to multiple destination simultaneously) In unicast routing the source can send each copy of the packet separately to each destination An efficient method to minimize the no. of copies Each packet is transmitted once per link The bandwidth saving becomes more substantial as the no. of destination increases To generate multicast tree, the approach is MBONE Class D address
Multicast Routing
Multicast routing useful when a source wants to transmits its packets to several destinations simultaneously Relying on unicast routing by transmitting each copy of packet separately works, but can be very inefficient if number of destination is large Typical applications is multi-party conferencing over the Internet Example: Multicast Backbone (MBONE) uses reverse path multicasting
Assume Source S transmits a multicast packet with group G1 and parent ports are shown in bold lines S sends a packet to node 1 Node 1 forwards to all ports, except parent port
Nodes 2, 3, 4, and 5 broadcast, except on parent ports All nodes, not only G1, receive packets
BW is wasted regardless of the multicast group This problem can be solved by TRPB Truncated RPB : Leaf routers do not broadcast if none of its attached hosts belong to packets multicast group
Graft
DHCP Operation
When a host wishes to obtain an IP address, the host broadcasts DHCP Discover message on its physical network Server replies with Offer message (IP address + configuration information) Several servers may reply to the host, so the host selects one of the offers and broadcasts DHCP Request message The selected server then allocates the given IP address to the host and sends a DHCP ACK message assigning the IP address to the host for some period of lease time T
DHCP Operation
The msg also includes two threshold times T1 (=1/2 T) and T2 (=.875T) When time T1 expires the host attempts to extend the lease period by sending DHCP Request message to original server If the host gets the corresponding ACK msg, receives new values for T, T1 and T2 If no reply by T2, host broadcasts DHCP Request to any server If no reply by T, host must relinquich IP address and start from the beginning
NAT Device
Hosts inside private networks generate packets with private IP address & TCP/UDP port #s NAT maps each private IP address & port # into shared global IP address & available port # Translation table allows packets to be routed unambiguously
Mobile IP
Proliferation of mobile devices: PDAs, laptops, cellphones, A simple IP solutions for mobile computers Mobile IP allows a portable devices called mobile hosts to roam from one area to another while maintaining the communication sessions MH must use its permanent IP address even as it roams to another area Problem: IP address specifies point-of-attachment to Internet Changing IP address involves terminating all connections & sessions Mobile IP: device can change point-of-attachment while retaining IP address and maintaining communications
Home Agent (HA) keeps track of location of each Mobile Host (MH) in its network; HA periodically announces its presence If an MH is in home network, HA forwards packets directly to MH When an MH moves to a Foreign network, MH obtains a care-of-address from foreign agent (FA) and registers this new address with its HA The care-of-address reflects the MHs current location and is typically the address of the FA Once the HA knows the care-of-address of the MH, the HA can forward the registration packet to the MH via the FA
Correspondent Host (CH) sends packets as usual (1) Packets are intercepted by HA which then forwards to Foreign Agent (FA) (2) FA forwards packets to the MH MH sends packet to CH as usual (3) How does HA send packets to MH in foreign network?
IP - to - IP Encapsulation
The problem is solved by providing a tunnel between the HA and FA Implemented by encapsulating each IP packet at the HA with an outer IP header has HAs address as source address and care-of-address as destination address The FA decapsulates the packet that produce the original packet with the CHs address as source address and the MHs address as dest address and the FA delivers the packet to MH
To improve the routing mechanism so that the CH may send packets directly to the care-of-address endpoint in subsequent changes When HA receives packet from CH (1), it tunnels using care-ofaddress (2a); HA also sends a binding message back to the CH containing the current care-of-address (2b) CH can then send packets directly to care-of-address (4)