Upload
aman-jaiswal
View
34
Download
0
Embed Size (px)
Citation preview
1 | 48
Internet Working6th lecture
Chair of Communication SystemsDepartment of Applied Sciences
University of Freiburg2005
2 | 48
Internet WorkingLast lecture and practical course
● ARP (address resolution protocol), IP helper protocol for broadcast networks– Mapping 48bit MAC addresses to IP addresses
– ARP – insecure protocol
– MAC addresses assigned globally unique by vendor
– IP addresses depends on subnet where end system is located
● An other helper protocol – IP messaging and error reporting– ICMP, part of IP
– Send network error and informational messages
3 | 48
Internet WorkingLast lecture
● Dynamic IP address assignment– By client itself
– By centrally managed server
● DHCP, UDP based, application layer protocol for dynamic assignment of IP addresses in broadcast networks (layer 2: ethernet, TokenRing, ...)
4 | 48
Internet Workingplan for this lecture
● Packet routing in IP networks– Discussed address adaptation in broadcast nets for local
delivery
– Talked of routing principles (matching destination addresses against network address of an interface)
– Mostly involves static routing (addresses, netmasks, ...) assigned by administrator directly or via DHCP
● How does routing LANwide or globally work?
5 | 48
Internet Workingdefinition of routers
● Somehow magically an IP packet travels long distances and finds its way between two end systems (from source machine to destination)
● As we talked in introduction:– IP is a packet switched network so on every intermediate
system a routing decision is to be made
● These intermediate systems normally have more than one IP interfaces (each interface with its own IP number matching to the net the machine is member of)
● Formally: each machine with interfaces in two different IP subnets (and the ability to forward packets from one interface to the other) is called a router
6 | 48
Internet Workingdefinition of routers cont.
● Every router maintains a routing table● In the simplest case the router has three entries in that table
– Route to local subnet #1
– Route to local subnet #2
– Default route with the router in one of the subnets
– The routing table grows with the number of interfaces and nets connected to each
7 | 48
Internet Workingrouting example
8 | 48
Internet Workingrouting example
● The routing tables of the two routers #1, #2 are longer then routing table of end system– For each interface a routing entry is present
– We find a default route on both of them (most routers have default entry, we will see why later)
● Maintaining this routing information manually is the standard mechanism used for relatively static and very small LAN environments
● Routing tables on a larger scale are not as fixed as local ones● Remember the networking structure graphs of BelWue, DFN and
Geant, many network nodes are connected one more than one path with each others
9 | 48
Internet Workingrouting cont.
● Reasons for multilink IP connections– Every ISP must have more than one uplink connection to get
the permission to operate (fox hole principle)
– Links are of differing bandwidth, quality, latency and price
● These variables may differ over time periods (different rates for daily or night use, failing lines, congested paths, ...)
● You will need mechanisms to consider these information and compute an optimal way to every destination network
● Routing techniques and protocols working over IP are to be introduced ...
10 | 48
Internet Workingrouting protocols
● In general: routing protocols are not IP specific● Routing protocols may be needed on different network layers● It depends on the type of underlying networking infrastructure and
concept of connection● We can make some general assumptions on routing algorithms
independently of the type of network● Within connection orientated networks like ATM infrastructure we
find virtual channel switching– ATM packets follow a previous installed route
– Route is active during the whole session
11 | 48
Internet Workingrouting protocols
● IP – packet orientated network
– Routing decision is renewed for every packet (introduction to static IP routing last lecture)
– No state of previous routing decisions is kept (!)
● Static routing (manual setup) is acceptable in small networks● Routing setup for end systems often by DHCP (last lecture)● These mechanisms not suitable for routing on larger scale, e.g.
– Campuswide inter LAN routing
– DFNwide, interproviderrouting, ...
12 | 48
Internet Workingrouting protocols
● Routing tables grow relatively fast, e.g. simple subnetting in university LAN of roughly 256 classC subnets in 132.230.X.Y IP domain produces long tables in core routers– IP subnet aggregation is often impossible
– Routers may have several links
– Network should have redundant links ...
● Routing could be defined: Algorithms to establish routing table to make widely distributed endpoints appear to be directly connected
● So mechanisms for automated setup of router tables desired● Different routing protocols run on routers implement several
routing algorithms
13 | 48
Internet Workingrouting protocols – general considerations
● In general: forwarding is local made decision, requiring only next hop information
● But: computation of best route requires global information● This information is challenging:
– Hard to collect, often outdated, huge amounts of data
– No single network owner
● General needs for routing– Compute optimal paths for each destination (we need a
definition of term “optimal”)
– Minimize control message exchanges
– Minimize routing table space
14 | 48
Internet Workingrouting protocols – pitfalls
● While considering automatic setup of routing tables some risks may show up
– Loops: should local forwarding information be inconsistent with global topology – it can form loops (black holes in which packets “disappear” you may have observed this phenomenon with traceroute when a route oscillated between two routers ...)
– Oscillations: dynamically adapting to load can shift load, lead to congestion and repeat (often with paths of small bandwidth – consider two ISDN lines with heavy load ...)
● Normally these scenarios unusual under normal operation, often due to misconfiguration
15 | 48
Internet Workingrouting protocols – theory
● Routing itself (discussed with IP addressing) is part of the network layer and responsible for deciding which output line an incoming packet should take– Routing algorithms often implemented in applications run on
top of the underlying IP network
● For routing decisions hence every routing algorithm certain properties are desirable:– Correctness of routes
– Simplicity of protocol
– Robustness
– Stability
– Fairness and optimality
16 | 48
Internet Workingrouting protocols – theory
● Correctness and simplicity are obvious requirements● Robustness
– Once a major network is set up system wide failures and outages are not desired
– Should catch up with topology changes
– Cope with hardware failures
– Route changes (because of pricing changes, new infrastructure, expanding of the network, ...)
● ... that means, not all connected hosts shouldn't be affected
17 | 48
Internet Workingrouting – theory cont.
● Stability – Routing algorithms should converge towards equilibrium in a
certain amount of time
● Fairness and optimality– Obvious but often contradictory goals
– See the following picture, if the six hosts 1,1' ; 2,2' ; 3,3' communicate with each other and saturate the link the communication of X,X' should be shut off completely ...
18 | 48
Internet Workingrouting – theory cont.
● Conflict between Fairness and optimality (depends of course on underlying network topology)
19 | 48
Internet Workingrouting protocols – theory
● Before decision on tradeoff between the described problem could be done – we should see what we seek to optimize:– Maximum total network throughput could be one parameter
– Minimum mean packet delay is an other
● These two goals in conflict too: since operating any queuing system near limit implies long delays
● Many networks try to compromise with minimizing the number of hops (passing a routing engine) to take from source to destination
● Such the delay is reduced and the amount of bandwidth consumed minimized
20 | 48
Internet Workingrouting protocols – in packet networks
● Internet doesn't have very predictable traffic flow, may have unreliable links
● Routers are assumed to know– Address of each neighbor
– Cost of reaching each neighbor
● Choices for Internet routing– Centralized vs. distributed routing
– Source based vs. hopbyhop
– Single or multipath
– Dynamic vs. static
21 | 48
Internet Workingrouting strategies – (non)adaptive routing
● Routing algorithms are grouped into two major classes● Nonadaptive RA do not base their routing decisions on
(continuous) measurements or estimates of current bandwidth usage and topology– No need for specific measurement service run continuously or
scheduled
● The routes to use are computed in advance, offline and downloaded to routers when network is coming up
● That is the typical scenario for networked end systems – normally the system administrator provides the routes during machine setup
● Or the routing information is transferred via DHCP (centralized setup of networking resources)
22 | 48
Internet Workingadaptive routing
● Routing done that way often named static (type of routing discussed yet falls into that category)
● Adaptive algorithms change their routing decisions to reflect changes in traffic/bandwidth usage and topology
● Algorithms differ in where they get their information ...– Locally from own measurements or from adjacent routers
– Or (globally) from all routers
● ... and when changes are executed
– Every T seconds when network load changes
– Or changes in topology occur
– Or event driven ...
23 | 48
Internet Workingadaptive routing cont.
● Measure / function needed to represent certain values● Metric can be seen as a value for measuring routing costs● These costs could be
– Physical distance between two routers
– Number of hops packets travel from source to destination
– Estimated transit time
– Monetary costs (cheap satellite link vs. expensive sea cable for continental crossing or vice versa)
● Different routing algorithms (RA) use different metrics for their routing decisions
● Different metrics have different costs of computing them
24 | 48
Internet Workingrouting – optimality principle
● Before discussing specific RA one can state in general there is a optimal route without regarding network topology
● The optimality principle states: If router B is optimal path from router A to router C, then route from B to C falls to the same path (measured in hops)
25 | 48
Internet Workingrouting – optimality principle cont.
● Proving that name the part from A to B r1 and the rest of the route r2: If there is a better route r2 (e.g. the dotted line) it would be concatenated to r1 to improve the whole route, contradicting that r1r2 is optimal
● Consequence: Set of optimal routes from all sources to given destination form a tree rooted at destination
26 | 48
Internet Workingrouting – optimality principle cont.
● Example of a sink tree with hop count metric● Not necessarily unique – router 12 may connected over 3 with
same hop count
27 | 48
Internet WorkingICMP – further messages
● Goal of all RA is to discover such trees for all routers of a given subnet
● Since sink tree is a tree it does not contain any loops, so packets should be delivered within a finite and bounded number of hops
● In practice operation of networks is not as easy:– Links may go down and recover after a while
– Different routers may have different ideas about topology
– It was not stated how routers acquire information for tree computing (itself, predefined, centrally, ...)
28 | 48
Internet Workingrouting algorithms – flooding
● A relative specific routing algorithm is flooding● Every incoming packet is sent out on every outgoing line except
the one the packet was received from● Flooding obviously generates a vast number of packets, so
measures should be taken to damp the process– Install a hop counter, so if packet hop counter reaches zero
the packet is discarded
– Keep track of which packets have been flooded, use sequence number and discard duplicate packets
– Each router has to keep a list which packets have been seen from which source
29 | 48
Internet Workingflooding cont.
– To prevent of growing lists out of bound use a counter k, meaning that all packets up to k have been seen
– When packet comes in it is easy to check if it has already be seen
– List below k is not needed, because it summarizes all packets up to that number
● Flooding is not practical in most applications, because or the very suboptimal utilization of bandwidth and network capacity
● But it finds the most effective route in every case, because every route is checked (and the fastest packet arrives first)
30 | 48
Internet Workingrouting algorithms – flooding
● Mechanism could be found e.g. in unswitched ethernets with hubs connecting segments – very cheap and simple principle – no complicated logic has to
be build into components – hubs in ethernets simply regenerate and amplify passing signals
– That principle renders unswitched ethernets unusable with more than a few end systems added (generating certain amount of traffic)
● Another advantage – no/very simple routing tables have to be kept
● Flooding can be useful in special IP routing scenarios we will see later
31 | 48
Internet Workingrouting algorithms – routing mechanisms
● Distance vector & link state routing– Distributed algorithms
● Distance vector– Tell neighbors about distances to each destination
– Each nodes computation depends on its neighbors
● Link state– Tell all routers distance to each neighbor
– Each router computes its best paths
● Distance vector uses shortest path– Single adaptive cost of a link
32 | 48
Internet Workingshortest path routing
● Routing technique widely used, because it is simple and easy to understand
● Idea: Build a graph of the subnet with each node representing a router and each arc representing a link
● To choose a route between a given pair of nodes the algorithm just finds the shortest path on the graph
● You have to explain the metric used for shortest path measuring:– Hop count, physical distance, bandwidth, latency,
communication costs, mean queue length, ...
33 | 48
Internet Workingshortest path routing
● Hop count metric has same length for path 125 and 123 (nodes are fat numbers, costs smaller numbers between nodes)
● Geographic distance is for 123 much longer then for 125 (assuming the graph is drawn in scale)
● For other metrics the weighting function may be computed through hourly test packets sent and computed
● Criteria for computation of metric may combined
34 | 48
Internet Workingshortest path routing cont.
● One algorithm for computing the shortest path is Dijkstras● Each node is labeled with its distance from source node along the
best known path● Initially no paths are known (and labeled accordingly)● As algorithm proceeds and paths are discovered labels may
change reflecting better paths
35 | 48
Internet Workingshortest path routing cont.
● The shortest path (sp) from 1 to 4 is searched for● We are using the geographic distance for computing the sp● Started from 1 marking it permanent (big dot), then examined the
adjacent nodes to 1 (node 2 and 7)● Whenever a node is (re)labeled the source node we come from is
filled in (distance, source node)
36 | 48
Internet Workingshortest path routing cont.
● When adjacent routes are examined the smallest distance is labeled permanent (node 2)
● In the next step the process is restarted from node 2 ● We have to take the sums of the route up to here in to account
and we get node 5 (last picture)● Note: In next step node 7 has to be relabeled { (6,1) > (5,5) }
37 | 48
Internet Workingshortest path routing cont.
● Path with 3 hops to 7 has lesser costs than direct with 1 hop● Next step shows that from node 7 the metric to 8 is higher than
from node 5 over 6 to 8● Node 8 has to be relabeled then (see next slide)
38 | 48
Internet Workingshortest path routing cont.
● Step shows that from node 7 the metric to 8 is higher than from node 5 over 6 to 8 (node 8 has to be relabeled)
● There is a more optimal route to node 8– 1 – 2 – 5 – 7 – 8 (4 hops with cost of 9)
– 1 – 2 – 5 – 6 – 8 (4 hops with cost of 8)
39 | 48
Internet Workingshortest path routing cont.
● For getting the path we start from the destination and get the predecessor from the labels
● In the end we get a route 1 – 2 – 5 – 6 – 8 – 4● Remember: route optimal in “costs” not in hops
– Simple hop count routing would prefer 1 – 2 – 3 – 4 (cost of 12) or 1 – 7 – 8 – 4 (same cost) – 2 points higher than route named above
40 | 48
Internet Workingdistance vector routing
● For distance vector routing each router maintains a table (called a vector for a given destination – computed with shortest path) delivering the best known distance to each destination
● This tables are updated by regularly exchanging information with neighbors
● Other name of this algorithm is distributed BellmannFord or FordFulkerson
● In distance vector routing each router maintains a routing table containing the pair of each router of the (sub)net and the destination to it
● Entry contains information on outgoing line and the estimate of time, distance to destination
41 | 48
Internet Workingdistance vector routing cont.
● The metric might be one of the types we named earlier● Every router should know the distance to its neighbors, with hop
count (typically used with RIP – explained next lecture in greater detail) it is just one hop
● Queue length as metric might be computed through simply checking each outgoing line
● For delay the router might ping each neighbor with special ECHO packets and compute the round trip time
● For setting up of the tables each router sends a packet with the list of distances to each router in the (sub)net
● Every router receives such packets and uses them for computing of an updated table
42 | 48
Internet Workingdistance vector routing cont.
● Each destination might be reachable on different paths, but the router takes the shortest distance from all packets and removes the other information to the same destination
● Such the router computes information on which line which router is reachable
● This mechanism works quite well in theory, but has some drawbacks too ...
43 | 48
Internet Workingcounttoinfinity problem
● Although distant vector converges to the correct answer it may doing it very slowly
● It reacts fast to positive news but leisurely to bad ones● To see how fast good news propagates see the next simple
example (five routers on a linear subnet, hops to 1 shown)
44 | 48
Internet Workingcounttoinfinity problem
● With 1 down initially no router knows a path to it (in routing terms: infinite route)
● With 1 coming up at the first exchange (for simplicity: all routing information is exchanged at exact the same moment) 2 gets the good news that 1 has a route of “0” to 1
● 2 adds this information to its table● In the next round of exchange 2 tells 3 that it knows a route with
hop count “1” to 1, 3 learns that and adds the metric “2” for the route to 1
● Nexts steps are accordingly – process ends after the 4th round
45 | 48
Internet Workingcounttoinfinity problem
● Now compute the routes for the opposite scenario (router 1 is going down for some reason)
46 | 48
Internet Workingcounttoinfinity problem
● All lines where initially up, but 1 failed● The first round of packet exchange 2 hears nothing from 1, but 3
says “no worry, I know a route to 1”● Hence 2 updates its table to the hop count of “3” for path to 1● 2 does not know that 3s route runs through itself● With second exchange router 3 has two entries for 1 with the
same metric of “3”, therefore picks one at random and updates its table to a hop count of “4”
● Problem: No one router has a hop count greater than the minimum of all neighbors, gradually they walk up to inifinty
47 | 48
Internet Workingcounttoinfinity problem
● When router 1 is set “unreachable” depends on the value for infinity
● Therefor the value for infinity should set to the maximum diameter of the network plus “1”
● But even in moderate sized networks the exchanges needed for setting a router “unreachable” may regarded as to much
● If the metric is a time delay then the upper bound of the inifinity value should be set reasonable high, else simple problems within the network (congestions of a short moment, delays in queues, ...) could bring routers out of range
● One of many suggested solutions (no one solved the problem) is the “SplitHorizonHack” (introduced next lecture!)
48 | 48
Internet Workingrouting: literature list
Routing Theory● Tanenbaum: Computer Networks, 4th edition: Section 5.2 Routing Algorithms, Section
5.2.1 The Optimality Principle
Flooding::● Tanenbaum: Computer Networks, 4th edition: Section 5.2.3 Flooding
Shortest Path Routing● Tanenbaum: Computer Networks, 4th edition: Section 5.2.2 Shorest Path Routing
Distance Vector Routing● Tanenbaum: Computer Networks, 4th edition: Section 5.2.4 Distance Vector Routing
CounttoInfinity Problem● Tanenbaum: Computer Networks, 4th edition: Section 5.2.4 Distance Vector Routing, The
CounttoInfinity Problem
Routing Algorithms● Kurose & Ross: Computer Networking, 3rd edition: Section 4.5 Routing Algorithms