Routing Protocols Make decisions based on knowledge of topology and traffic/delay conditions Use dynamic routing algorithm 최소 metric 을갖는경로선택 메트릭 (metric) : 네트워크를거쳐지나갈때할당되는비용 Autonomous Systems (AS) A group of routers and networks managed by single organization which exchange information via a common routing protocol Form a connected network At least one path between any pair of nodes
IRP & ERP Interior router protocol (IRP) Intradomain Pass routing information between routers within AS Can be tailored to specific applications Need detailed model of network Exterior router protocol(erp) Interdomain Routing algorithms & tables may differ between ASs Pass routing information between routers in different ASs Routers need info on networks outside own AS Support summary information on AS reachability IRP ERP
Routing Protocols
Distance-vector Routing The route with minimum distance is chosen First generation routing algorithm for ARPANET Eg. Routing Information Protocol (RIP) Requires transmission of much info by routers Distance vector & estimated path costs Changes take long time to propagate Not effective for exterior router protocol Different ASs may have different priorities & needs
Distance-Vector Routing Each node (router or host) maintains distance and next-hop vectors for each destination
Routing Table Update Each node exchanges its routing table with its neighbors periodically and when there is a change If next-node entry is different, choose the row with the smaller cost Otherwise, choose the new row
Example Example Next Cost To C 9 E C 5 D A 4 C A 5 B - 3 A Next Cost To C 9 E C 7 D A 4 C A 5 B - 3 A Next Cost To B 10 E B 5 D A 3 C A 7 B - 3 A Updated RT Current RT RT from neighbor
Slow Convergence 인터넷일부에서발생하는변화가매우느리게다른부분에알려짐 해결방안 : 홉수를제한
Two-Node Loop Instability 상대방으로부터받은라우팅정보를역으로상대방으로전송함으로써루프발생
Three-Node Instability A->C->B->A-> Loop stops when the cost in each node reaches infinity
Split horizons 상대방으로부터받은라우팅정보를제외한라우팅정보를상대방으로전송 Problem: when no news from neighbor for some time (120s), the route is deleted from table
Poison reverse 수평분할의변형 Node B can still advertise the value for X, but if source of info is A, it replaces the distance with 16 as a warning Do not use this value; What I know about this route comes from you
Routing Information Protocol 각네트워크를동일하게취급 ( 홉수기반 ) 전체자율시스템에대한정보의공유 이웃라우터와주기적인공유 : 30초간격
RIP Example
Routing Information Protocol
RIP Message RIP message sent from R1 to R2 16 means infinity to prevent any confusion for R2 R2 uses the source address of IP datagram carrying RIP message from R1 as the next hop address RIP uses services of UDP on well known port 520
Link-State Routing Each router determines link cost on each interface and advertises link costs to all other routers Each router constructs topology of entire configuration Calculate shortest path to each dest to construct routing table Eg. Dijkstra's algorithm If link costs change, router advertises new values Ex: Open shortest path first (OSPF) protocol Not effective for exterior router protocol Different ASs may use different metrics and have different restrictions Flooding of link state information to all routers unmanageable
Link State Knowledge Each router determines link cost on each interface and advertises set of link costs to all other routers
Link State Routing Each router constructs topology of entire configuration Calculate shortest path to each dest by Dijkstra's algorithm
Dijkstra Algorithm
Dijkstra Algorithm 1. Start with the local node(router) : the root of the tree. 2. Assign a cost of 0 to this node and make it the first permanent node. 3. Examine each neighbor node of the node that was the last permanent node. 4. Assign a cumulative cost to each node and make it tentative. 5. Among the list of tentative nodes 1. Find the node with the smallest cumulative cost and make it permanent. 2. If a node can be reached from more than one direction 1. Select the direction with the shortest cumulative cost. 6. Repeat steps 3 to 5 until every node becomes permanent.
Example
Example 1 2 1 2 3 4 3 2 3 1 1 5 2 5 6 1 2 D 2 = 2 3 D 3 = 4 6 1 2 D 2 = 2 3 D 3 = 4 6 1 2 D 2 = 2 3 D 3 = 3 6 D 6 = 4 4 5 D 4 = 1 D 5 = 2 (b) M = {1, 2, 4} (c) 4 5 D 4 = 1 D 5 = 2 M = {1, 2, 4, 5} 4 5 D 4 = 1 D 5 = 2 (d) M = {1, 2, 4, 5, 6}
Example 단 계 M D 2 경로 D 3 경로 D 4 경로 D 5 경로 D 6 경로 1 {1} 2 1-2 - 1 1-4 - - 2 {1,4} 2 1-2 4 1-4-3 1 1-4 2 1-4-5-3 {1,2,4} 2 1-2 4 1-4-3 1 1-4 2 1-4-5-4 {1,2,4,5} 2 1-2 3 1-4-5-3 1 1-4 2 1-4-5 4 1-4-5-6 5 {1,2,3,4,5} 2 1-2 3 1-4-5-3 1 1-4 2 1-4-5 4 1-4-5-6 6 {1,2,3,4,5,6} 2 1-2 3 1-4-5-3 1 1-4 2 1-4-5 4 1-4-5-6
Example
Example: SPF Tree for Router 6
Open Shortest Path First Each router keeps list of state of local links to network Link-state로써 link-state database를만들고이를 SPF로계산하여 routing table을구성 Link-state: interface 에대한 description 연결된 network type, mask, 링크유형, metric 등 OSPF divides an AS into areas for efficient routing Area 개념을사용하여빠르게네트워크데이타베이스를전파 (convergence) Transmits update state info Little traffic as messages are small and not sent often Uses least cost based on user cost metric Topology stored as directed graph Vertices or nodes (router, transit or stub network) Edges (between routers or router to network) OSPF packets are encapsulated in IP datagrams
Open Shortest Path First Area Collection of networks, hosts, routers Routing information is flooded inside an area 하나의 area 안의모든라우터들은같은 link-state-database 를공유 라우터들간의 link-state-update packet 들의 flooding 과 SPF 계산의경계역할 관리자의정책에따라 area 의크기결정 Advertisements 의갯수와 overhead traffic 의영향을줄이기위함 라우터가반드시유지해야하는 database 의 size 를줄임 Area border Routers : 하나이상의 area 에속하는라우터 각 area 에대한 database 를별도로유지 Summarize area info and send it to other areas Backbone area: summarize area info and send it to other areas Area 간의모든 routing 정보를분배 Backbone is area connected to all areas inside AS As Boundary Routers 다른 AS 들과라우팅정보를주고받는라우터 다른 AS 에정보배포
Open Shortest Path First AS Area Backbone area Area border router AS boundary router
Types of Links Point-to-point link: direct link connecting two routers Transient link: network with several routers LAN or WAN with some routers Stub link: network connected to only one router Virtual link: alternative link for link failure
Types of Links
Example 2 Point-to-point links Transient link: N1, N3 Stub link: N2, N4, N5
Types of OSPF Packets LSA (Link State Advertisement)
Types of OSPF Packets HELLO Create neighborhood relationship and test reachability of neighbors First step in link state routing Link State Request Packet Request info about specific routers Answered with Link State Update Packet Database Description Message Reduce time for making its own database and calculating routing table when a router is newly connected or after a failure If neighbors hear HELLO from the router for the first time, they send Database Description Message Contain only outline (title of each line in database) Full description is made by using link state request packet
Router link LSA
Router Link 라우터의모든링크를광고 링크종류, 링크식별자, metric
Example Give the router link LSA sent by router 10.24.7.9 Link ID & Data Link Type Metric
Network Link LSA 네트워크에연결된링크를광고 네트워크마스크, 접속된모든라우터의 IP 주소 Designated Router: network에대한link- state-advertisement를 neighbor들에게보내는역할 DR을선출함으로써라우팅을 update하는데필요한 database의 size와 traffic 양을감소시킬수있음
Example
Example Router link LSA R1 sends LSA for two links, N1 and N2. R2 sends LSA for one link, N2. R3 sends LSA for two links, N2 and N3. Network link LSA R1 sends LSA for N1 R1, R2, or R3 (designated router) sends LSA for N2 R3 sends LSA for N3
Summary Link to Network LSA Area border router has 2 routing tables for 2 areas R1 sends Summary Link to Network LSA to area 1 to announce existence of other networks outside area 1
Summary Link to Network LSA Only network mask is contained in LSA IP addr of advertising router is contained in LSA header Each LSA announces only one single network Separate LSA must be issued for each network
Summary Link to AS Boundary Router Define the network to which AS boundary router is attached Route to AS boundary router
External Link AS boundary router floods AS with the cost of each network outside the AS Each LSA announces only one single network
Path-Vector Routing Provides list of all ASs visited on a route A speaker node in each AS acts on behalf of entire AS Creates a routing table and advertises only it to speaker nodes in neighboring ASs Advertisement includes only path Does not include distance or cost estimate Useful for interdomain routing Enables router to perform policy routing Eg. Avoid path to avoid transiting particular AS Eg. Link speed, capacity, tendency to become congested, and overall quality of operation, security Eg. Minimizing number of transit ASs
Path Vector Network Next Router Path N01 R01 AS14, AS23, AS67 N02 R05 AS22, AS67, AS05, AS89 N03 R06 AS67, AS89, AS09, AS34 N04 R12 AS62, AS02, AS09
Routing Tables Initial Tables Stabilized Tables
Border Gateway Protocol (BGP) Preferred ERP of Internet Within AS a router builds topology picture using IRP Routers exchange info with other routers in other AS using BGP Routers must then decide best routes AS_PATH field used to prevent loops Routers exchange messages over TCP connection Well know port 179
BGP
Open Message OPEN Used to open a neighbor relationship with another router Router makes TCP connection to neighbor KeepAlive Message Used to (1) acknowledge an Open message and (2) periodically confirm the neighbor relationship To tell other routers that this router is still here Router makes TCP connection to neighbor Notification Send when an error condition is detected
Update Message Transmit information about a single route using path attributes AS_PATH : list of AS traversed Depends on routing policies Eg. To avoid a particular AS, security, performance, quality, number of AS crossed Next_hop : IP address of border router Transmit information about list multiple routes to be withdrawn Withdraw route identified by dest IP address