430 likes | 543 Views
IT 605 Computer Networks. Prof. A. Sahoo KReSIT, IIT Bombay. Link state routing. A router describes its neighbors with a link state packet (LSP) Use controlled flooding to distribute this everywhere store an LSP in an LSP database
E N D
IT 605 Computer Networks Prof. A. Sahoo KReSIT, IIT Bombay
Link state routing • A router describes its neighbors with a link state packet (LSP) • Use controlled flooding to distribute this everywhere • store an LSP in an LSP database • if new, forward to every interface other than incoming one • all routers eventually have a copy of the network topology
Link state routing • Each router computes its routing table based on the network map • Dijkstra’s shortest path algorithm • Link state changes are flooded to all routers which will update their network maps • Sequence numbers in LSP headers • Greater sequence number is newer
Computing shortest paths • maintain a set of nodes P to whom we know shortest path • consider every node one hop away from nodes in P = T • find every way in which to reach a given node in T, and choose shortest one • then add this node to P
5 3 5 2 2 1 3 1 2 1 A D B C E F Dijkstra’s algorithm: example D(B),p(B) 2,A 2,A 2,A D(D),p(D) 1,A D(C),p(C) 5,A 4,D 3,E 3,E D(E),p(E) infinity 2,D Step 0 1 2 3 4 5 start N A AD ADE ADEB ADEBC ADEBCF D(F),p(F) infinity infinity 4,E 4,E 4,E
LSP loops and updates • To ensure same LSP message is not sent twice to a link: • Use of pair (source, sequence-no) at each node and reject duplicates • Update is sent whenever link status is changed with higher sequence number • Younger message supercedes an aged message, irrespective of sequence number
Sequence numbers • Determines the “newness” of an LSP • Greater sequence number is newer • Sequence number may wrap around • smaller sequence number is now newer • 32 bits is large enough with 1s updates • Initial sequence number on boot up • have to somehow purge old LSPs • aging; lollipop sequence space
Aging • Creator of LSP puts timeout value (TTL) in the header • Routers remove an LSP when it times out • On booting, router waits for its old LSPs to be purged • if age is too small, frequent updates required • LSP may be purged before fully flooded • if age is too large, router waits for a long time on rebooting
Lollipop sequence space • Need a unique start sequence number • a is older than b if: • a < 0 and a < b • a > 0, a < b, and b-a < N/4 • a > 0, b > 0, a > b, and a-b > N/4 • If a router gets an older LSP, it tells the sender about the newer LSP
Securing LSP databases • LSP databases must be consistent to avoid routing loops • Malicious agent may inject spurious LSPs • Routers must protect their databases • checksum LSPs • ack LSP exchanges • passwords
OSPF • Successor to RIP which uses Link-State • Each router maintains state of its links • Sends LSP updates to other routers which must be acknowledged • Each router maintains a database reflecting the known topology of the AS • Topology is expressed as a directed graph • A cost is associated with each interface
OSPF • Each router constructs its routing table from this information • Dijkstra’s shortest path algorithm • Complex • LSP databases to be protected • Runs directly over IP; supports VLSM • Supports multicasting • Implementation: gated
LS Age Options LS Type Link State ID Advertising Router LS Sequence Number LS Checksum Length 16 0 OSPF: LSP (LS Advertisement)
OSPF: LSAs • LS type: Router LSA; Summary LSA etc • Link State ID: addressing information • IP address of externally reachable network • Advertising Router: • originating router’s OSPF router ID • LS Sequence Number: 32 bits • LS Age: ranges from 0 to 30 min. • LS Checksum • Length: includes header and contents • ranges from 20-65535 bytes
OSPF: Link state database example LS Seq No LS Type Link State ID Checksum LS Age Adv Router 10.1.1.1 10.1.1.1 0x9b47 0x80000006 0 Router LSA ….. …... ….. ….. …. …...
OSPF: Hello protocol • Hello packets sent out every 10 seconds • helps to detect failed neighbors • RouterDeadInterval (default 40 seconds) • also ensures that link is bidirectional • neighboring routers agree on intervals • Each router sends LSA headers to its neighbor when connection comes up • requests only those LSAs which are recent
Hierarchical OSPF From Jim Kurose’s slides
Hierarchical OSPF • Two-level hierarchy: local area, backbone. • Link-state advertisements only in area • each nodes has detailed area topology; only know direction (shortest path) to nets in other areas. • Area border routers:“summarize” distances to nets in own area, advertise to other Area Border routers. • ABRs exchange summary LSAs • Backbone routers: run OSPF routing limited to backbone. • Boundary routers: connect to other AS’s.
Distance vector v/s Link state • In distance vector, router knows only cost to each destination • hides information, causing problems • every station must broadcast its global routing tables, but only to its neighbors. • Converges slowly after topology change • Used in inter-domain routing
Distance vector v/s Link state • In link state, router knows entire network topology • computes shortest path by itself • fast, loopless convergence • every station must broadcast its local information to all the network’s junctions • Used in intra-domain routing
Hierarchical routing • Technique used to build large networks • Minimizes use of network resources • router memory • router computing resources • link bandwidth • Flat routing: linear increase in routing table size • Hierarchical: logarithmic increase in routing table size
Hierarchical Routing • Routers divided into Regions. • Regions > Clusters > Zones > Groups > • Internal structure of a region known only to routers within that region. • Different networks do not need to know the topological structure of other ones.
Penalty for Hierarchical Routing • Path length may increase. But this increase is sufficiently small and usually acceptable. • The optimum number of levels for an N router subnet is ln N, with a total of e ln N entries per router.
Autonomous System Interior Router protocol Exterior Router Protocol
Exterior routing protocols • Divide network into a set of domains • Gateways connect domains • Nodes within domain unaware of outsiders • Gateways know only about other gateways
External and summary records • If a domain has multiple gateways • external records tell hosts in a domain which one to pick to reach a host in an external domain • summary records tell backbone which gateway to use to reach an internal node • External and summary records contain distance from gateway to external or internal node respetively
BGP: Design goals and challenges • Goal: • Leave “optimality” aside • Just find a loop-free path • Thus only bothers with reachability • Why? • Buck stops here – backbone routers must be able to route everywhere • Variability of metrics used by different Ases • Trust! • Policies.
Internet inter-AS routing: BGP • BGP (Border Gateway Protocol):the de facto standard • Requires AS numbers, assigned by IANA • Path Vector protocol: • similar to Distance Vector protocol • each Border Gateway broadcast to neighbors (peers) entire path (i.e., sequence of AS’s) to destination • BGP routes to networks (ASs), not individual hosts • E.g., Gateway X may send its path to dest. Z: Path (X,Z) = X,Y1,Y2,Y3,…,Z • Uses TCP to disseminate DVs • reliable • but subject to TCP flow control Jim Kurose’s slide
Internet inter-AS routing: BGP Suppose: gateway X send its path to peer gateway W • W may or may not select path offered by X • cost, policy (don’t route via competitors AS), loop prevention reasons. • If W selects path advertised by X, then: Path (W,Z) = w, Path (X,Z) • Note: X can control incoming traffic by controlling it’s route advertisements to peers: • e.g., don’t want to route traffic to Z -> don’t advertise any routes to Z Jim Kurose’s slide
BGP: controlling who routes to you • A,B,C are provider networks • X,W,Y are customer (of provider networks) • X is dual-homed: attached to two networks • X does not want to route from B via X to C • .. so X will not advertise to B a route to C Jim Kurose’s slide
BGP: controlling who routes to you • A advertises to B the path AW • B advertises to X the path BAW • Should B advertise to C the path BAW? • No way! B gets no “revenue” for routing CBAW since neither W nor C are B’s customers • B wants to force C to route to w via A • B wants to route only to/from its customers! Jim Kurose’s slide
BGP operation Q: What does a BGP router do? • Receiving and filtering route advertisements from directly attached neighbor(s). • Route selection. • To route to destination X, which path )of several advertised) will be taken? • Sending route advertisements to neighbors. Jim Kurose’s slide
Why different Intra- and Inter-AS routing ? Policy: • Inter-AS: admin wants control over how its traffic routed, who routes through its net. • Intra-AS: single admin, so no policy decisions needed Scale: • hierarchical routing saves table size, reduced update traffic Performance: • Intra-AS: can focus on performance • Inter-AS: policy may dominate over performance Jim Kurose’s slide
Functions of BGP • Neighbor acquisition • open and keep-alive messages • Neighbor reachability • keep alive and update messages • Network reachability • Database of reachable internal subnets • notification messages sent upon changes
BGP messages • Open: Used to open a neighbor relationship with another router • Update: Used to transmit information about a single/multiple routes • Keepalive: Used to ACK an Open message; periodically confirm status • Notification: Used when error condition is detected
BGP: Information exchange • AS_PATH: A list of AS’s that are traversed for this route • Next_Hop: The IP address of the router to be used to reach the destinations listed in NLRI field • NLRI: Network layer reachability information • List of sub-networks that can be reached by this route
Example: AS_Path: AS1 Next_Hop:IP address of R1 NLRI:all subnets in AS1 AS1 AS2 Update to R2 R1 R2 Update to R3 AS_Path: {AS2,AS1} Next_Hop:IP address of R2 NLRI:all subnets in AS1 AS3 R3
ICMP protocol • error reporting • router “signaling” • IP protocol • addressing conventions • datagram format • packet handling conventions • Routing protocols • path selection • RIP, OSPF, BGP forwarding table The Internet Network layer Host, router network layer functions: Transport layer: TCP, UDP Network layer Link layer physical layer