Routing AlgorithAms

102
1 Computer Networks Network Layer

description

Ini adalah Algoritma Routing dari networking komputer. Algoritma dari suatu NAT atau routing sebuah topologi.

Transcript of Routing AlgorithAms

  • *Computer Networks Network Layer

    Veton Kpuska

  • *Network LayerMain function of Network Layer:Routing of packets form the source machine to the destination machine.

    Veton Kpuska

  • Network Layer Design IssuesStore-and-forward packet switchingServices provided to transport layerImplementation of connectionless serviceImplementation of connection-oriented serviceComparison of virtual-circuit and datagram networks

    Veton Kpuska

  • Store-and-Forward Packet SwitchingThe environment of the network layer protocols.ISPs equipment

    Veton Kpuska

  • Services Provided to the Transport LayerServices independent of router technology.Transport layer shielded from number, type, topology of routers.Network addresses available to transport layer use uniform numbering planeven across LANs and WANs

    Veton Kpuska

  • Implementation of Connectionless ServiceRouting within a datagram networkISPs equipmentAs table (initially) As table (later) Cs Table Es Table

    Veton Kpuska

  • Implementation of Connection-Oriented ServiceRouting within a virtual-circuit networkISPs equipmentAs table Cs Table Es Table

    Veton Kpuska

  • Comparison of Virtual-Circuit and Datagram NetworksComparison of datagram and virtual-circuit networks

    Veton Kpuska

  • Routing Algorithms Optimality principleShortest path algorithmFloodingDistance vector routingLink state routingRouting in ad-hoc networks

    Veton Kpuska

  • Routing Algorithms Broadcast routingMulticast routingAnycast routingRouting for mobile hostsRouting in ad hoc networks

    Veton Kpuska

  • Routing AlgorithmsRouting Algorithm:Network Layer Software responsible for deciding which output line an incoming packed should be transmitted on.Datagrams:require computation of decision making tables for each packedVirtual Circuit:routing decision are made only when a new virtual circuit is being set up.Session Routing:data packets follow the same routing for the entire session.*

    Veton Kpuska

  • Routing AlgorithmsRouting vs. Forwarding:Routing:Filling and Updating routing tables Forwarding:making the decision which routes to use based on routing tables.Adaptive vs. Non-Adaptive Algorithms.Non-Adaptive Algorithms:Routing decision is based on pre-computed measurements or estimates and do not update the table based on current traffic and topologyAdaptive Algorithms:Change their routing decisions to reflect changes in the topology and traffic.

    *Veton Kpuska*

    Veton Kpuska

  • Fairness vs. EfficiencyNetwork with a conflict between fairness and efficiency.

    Veton Kpuska

  • *Veton Kpuska*Optimality PrincipleIf router J is on the optimal path from router I to router K, then the optimal path form J to K also falls along the same (optimal path) route.r1: I to J graphr2: The rest of the graphIf a route better than r2 existed from J to K it could be concatenated with r1 to improve the route from J to K! Contradiction with the base assumption that r1r2 are optimal.

    Veton Kpuska

  • The Optimality Principle(a) A network. (b) A sink tree for router B.

    Veton Kpuska

  • *Veton Kpuska*Shortest Path RoutingOptimization criterion:Distance,Bandwidth,Average TrafficCommunication cost,Mean Queue Length,Measured Delay, Algorithms:DijkstraFloodingSelective Flooding

    Veton Kpuska

  • Shortest Path AlgorithmThe first five steps used in computing the shortest path from A to D. The arrows indicate the working node

    Veton Kpuska

  • Shortest Path AlgorithmDijkstras algorithm to compute the shortest path through a graph.. . .

    Veton Kpuska

  • Shortest Path Algorithm (3)Dijkstras algorithm to compute the shortest path through a graph.. . .. . .

    Veton Kpuska

  • Shortest Path Algorithm Dijkstras algorithm to compute the shortest path through a graph.. . .

    Veton Kpuska

  • *Veton Kpuska*Distance Vector RoutingStatic Routing AlgorithmsDo not take into account actual network load.Dynamic Routing AlgorithmsTaking into account actual network loadDistance Vector Routing: Each router maintain a table with the best known distance to each destination and which line to use to get there. Tables updated by exchanging information with the neighbors.Link State Routing

    Veton Kpuska

  • Distance Vector Routing(a) A network. (b) Input from A, I, H, K, and the new routing table for J.

    Veton Kpuska

  • *Veton Kpuska*Countto-Infinity ProblemSlow Convergence to the correct answer. Good news Propagate fastBad news Propagate slowly:The core of the problem is that when X tells Y that I has a path somewhere, Y has no way of knowing whether it itself is on the path.

    Veton Kpuska

  • The Count-to-Infinity ProblemThe count-to-infinity problem

    Veton Kpuska

  • *Veton Kpuska*Link State RoutingDistance Vector Routing was used in the ARPANET until 1979 when it was replaced by link state routing.Delay Metric was Queue Length thus did not take into account line bandwidth when choosing routes.Problem when line bandwidth changed for some bands from 56 kbps to 230 kbps or 1.544 Mbps.Algorithm took to long to converge (the count-to-infinity problem).Solution: Link State Routing

    Veton Kpuska

  • *Veton Kpuska*Link State Routing (2)Each router must do the following:

    Discover its neighbors and learn their network addresses.Measure the delay or cost to each of its neighbors.Construct a packet telling all it has just learned.Send this packet to all other routers.Compute the shortest path to every other router.

    Complete topology and all delays are experimentally measured and distributed to every router. Dijkstras algorithm can be run to find the shortest path to every other router.

    Veton Kpuska

  • *Veton Kpuska*(1) Learning About the NeighborsHELLO packed send on each point-to-point line from a booted router. Router on the other end must reply by sending its globally unique name.

    Example of routers connected by a LAN.

    Veton Kpuska

  • *Veton Kpuska*(1) Learning About the NeighborsNine routers and a LAN:

    One way to model LAN is to consider it as node (Graph model).BADCGFEFRouterIRouters connected to LANGraph ModelANBCDEFIGH

    Veton Kpuska

  • *Veton Kpuska*(2) Measuring Line CostIt is required by the Link State Routing algorithm that each router not have a reasonable estimate of the delay/cost to each of its neighbors.Send ECHO packet (ping) that the other side is required to send back immediately.Measure Round Trip time; Divide by 2 to get an estimate.More accurate estimate by repeating the process several times and by averaging estimates.Assumes symmetric delay. Channel Load Issue when Measuring DelayTo factor the load in: round trip timer must be started when the ECHO packed is queued.To ignore the load: round trip timer must be started when ECHO packed reaches front of the queue.

    Veton Kpuska

  • *Veton Kpuska*(2) Measuring Line Cost (cont.)Including Traffic-induced Delays:If a router has a choice from 2 lines with the same bandwidth, one of which is heavily loaded all the time and one of which is not, the router will regard the route over the unloaded line as shorter path. This choice in general will result in better performanceProblem with Oscillations in the choice of best path.

    Veton Kpuska

  • *Veton Kpuska*(2) Measuring Line Cost (cont.)ABC DEIJFHGWestEast

    Veton Kpuska

  • *Veton Kpuska*(3) Building Link State PacketsPacket Format:Identity of SenderSequence NumberAgeList of NeighborsCorresponding Delay

    Packets easily built problem with knowing when to built them.E

    ASeq.AgeB4E5

    BSeq.AgeA4C2F6

    CSeq.AgeB2D3E1

    ESeq.AgeA5C1F8

    FSeq.AgeB6D4E8

    DSeq.AgeC3F4

    Veton Kpuska

  • *Veton Kpuska*(4) Distributing the Link State PacketsDistributing Link State Packets Reliably is tricky:As the packets are distributed and installed, the routers getting the first ones will change their routes before other routers in the network update their routing tables.Different Routers may be using different versions of the topology (inconsistencies, loops, unreachable machines, etc.)Basic Algorithm: FloodingSequence Number (incremented for each new packet sent) is used to keep the flood in check.Routers keep track of all the source router packets they have been sent to.New link state packets is checked against the track list:If new/unseen (based on the sequence number) then it is broadcasted to all neighboring routers with exception of the sender. If duplicate, it is disregarded.If sequence number is lower than the highest one in the track list, it is rejected.

    Veton Kpuska

  • *Veton Kpuska*(4) Distributing the Link State Packets (cont)Problems with basic algorithm:Sequence Number wrap around.Make a long precision number (e.g., 32-bit)Crash of a router: losing track of sequence number.Corruption of sequence number.Solution: Include Age of each packet.Decrement this value once per second. When zero, this state information is disregarded.

    Normally a new packed is send every 10 sec.Router information times out when:Router is down, orA Number of (e.g., 6) consecutive packets have been lost.

    Veton Kpuska

  • *Veton Kpuska*(4) Distributing the Link State Packets (cont)Refinements of Distribution Algorithm:Holding the packet:Example of packed buffer for router B of subnet in previous figure (Fig. 5-13 (a))

    Sent FlagsAcknowledged FlagsSourceSeq.AgeACFACFDataA2160011100F2160110001E2159010101C2060101010D2159100011

    Veton Kpuska

  • *Veton Kpuska*Hierarchical RoutingLarge Networks:Proportionally large routing tables are required for each routerMore CPU time is needed to scan them More bandwidth is needed to send status reports.At certain point network may grow so large where it is no longer feasible for every router to have an entry for every other router.Solution: Routing has to be done hierarchically.

    Veton Kpuska

  • *Veton Kpuska*Hierarchical Routing (cont.)Routers divided in Regions (as in telephone network):Each router knows how to route packets to destinations within its own region.However, router does not have any information regarding the topology of the network of other regions.When different networks are interconnected they are regarded as a separate region in order to free the routers in one network from having to know the topological structure of the other ones.Huge networks will require more than two-level hierarchy. How many hierarchical levels are optimal.Kamoun and Kleinrock (1979): optimal number for an N router subnet is ln(N), requiring total of e*ln(N) entries per router.

    Veton Kpuska

  • *Veton Kpuska*Hierarchical Routing (cont.)Example: Berkley, California Router to Malindi, Kenya.Berkley to Los Angeles router (in-state traffic)Los Angeles to New York router (out-of-state traffic)New York to Nairobi (international traffic)

    Veton Kpuska

  • *Veton Kpuska*Region 1Two Level Hierarchical Routing Example 1A1B1C2A2B2C2D4B4A4C5B5C5E5D5A3A3BRegion 2Region 3Region 4Region 5

    Full table for 1ADest.LineHops1A--1B1B11C1C12A1B22B1B32C1B32D1B43A1C33B1C24A1C34B1C44C1C45A1C45B1C55C1B55D1C65E1C5

    Hierarchical table for 1ADest.LineHops1A--1B1B11C1C121B231C241C351C4

    Veton Kpuska

  • *Veton Kpuska*Broadcast RoutingSending a packed to all destinations simultaneously is called Broadcasting.Direct Method: Source sends a distinct packet to each destination routers in the subnet:Wasteful of the bandwidth.It requires source to have a list of all destinations.In practice this may be the only feasible solution.Flooding:Ordinarily ill suited for point-to-point communication:Generates to many packets, andConsumes to much bandwidth.

    Veton Kpuska

  • *Veton Kpuska*Broadcast Routing (cont.)Multi-destination RoutingEach packets contains:A list of designations, orA bit map indicating the desired destinations.When packet arrives at a router:The router checks all the destinations to determine the set of output lines that will be needed.Generates a new copy of the packed for each output line to be used and includes in each packet only those destinations that are to use the line.After a sufficient number of hops, each packed will carry only one destination and can be treated as normal packet.Multi-destination routing is like separately addressed packets, except that when several packets must follow the same rout, one of them pays full fare and the rest ride free.

    Veton Kpuska

  • *Veton Kpuska*Broadcast Routing (cont.)Spanning Tree:It is a subset of the subnet that includes all routers but contains no loops.Each router knows which of its lines belong to the spanning tree, it can copy an incoming broadcast packet onto all the spanning tree lines except the one it arrived on. Makes excellent use of bandwidth (generates absolute minimum number of packets necessary to do the job)Must have knowledge of some spanning tree for the method to be applicable. Information available in some instances (e.g., link state routing)Information not available (e.g., distance vector routing)

    Veton Kpuska

  • *Veton Kpuska*Broadcast Routing (cont.)Reverse Path Forwarding:Router checks if the broadcast packet arrived on the line that is normally used for sending packets to the source of the broadcast.If so, there is excellent chance that the broadcast packet itself followed the best route from the router and is therefore the first copy to arrive at the router. The router forwards copies of it onto all lines except the one it arrived on.If the broadcast packet arrived on a line other than the preferred one for reaching the source, the packet is discarded as a likely duplicate.

    Veton Kpuska

  • *Veton Kpuska*Broadcast Routing (cont.)Example of Reverse path ForwardingABCDGJOMNLKHEIFABCDGJOMNLKHEIFA subnetA sink tree for router I

    Veton Kpuska

  • *Veton Kpuska*Broadcast Routing (cont.)The tree build by reverse path forwarding. After 5 hops and 24 packets the broadcasting terminates compared to 14 packets had the sink tree been followed exactly

    Veton Kpuska

  • *Veton Kpuska*Broadcast Routing (cont.)Reverse Path Forwarding in spite of not being optimal procedure:Efficient and easy to implement AlgorithmIt does not require routers to know about spanning trees.Does not have the overhead of destination list or bit map in each broadcast packet (as multi-destination addressing).It does not require any special mechanism to stop the process as flooding does (hop counter in each packed and a priori knowledge of the subnet diameter, or a list of packets already seen per source)

    Veton Kpuska

  • *Veton Kpuska*Multicast RoutingApplication that require separate processes (i.e., each from separate location) access and ability to work on the same data.Small group can use point-to-point messaging to accomplish this task.Broadcasting can be used but communicating with 1000 interested machines out of million-node network is inefficient.Need a mechanism that would send messages to well-defined groups that are numerically large in size but small compared to the network as a whole.Sending a message to a such a group is called multicasting.Corresponding routing algorithm is called multicast routing.

    Veton Kpuska

  • *Veton Kpuska*Multicast Routing (cont)Requirements:Create and Destroy GroupsNodes should be able to Join and Leave Groups, etc.Group Management.

    When a process joins a group it informs its host.Routers must know which of their hosts belong to which group. Host must inform their routers about changes in group membership, orRouters must query their hosts periodically.Information shared with Neighboring Routers (propagation of information through the subnet).

    Veton Kpuska

  • *Veton Kpuska*Multicast Routing (cont)Each Router Computes Spanning Tree Covering all other routers. Example of a network with nodes belonging to two groups (1 & 2).211111A Multicast Tree for group 122222A Multicast Tree for group 22

    Veton Kpuska

  • *Veton Kpuska*Multicast Routing Tree PruningLink State Routing each router is aware of the complete topology, including which hosts belong to which groups.Pruning starting from leaf-node up toward root node.Distance Vector Routing Basic pruning algorithm is based on reverse path forwarding.Router with no hosts interested in a particular group and no connections to other routers responds with PRUNE message to a multicast message.Also when a router with no group members among its hosts receives a multicast message it too will respond with a PRUNE message effectively recursively pruning the subnet.Potential Problem:Scales poorly to large networks. Network with n groups,Each Group on average has m members.For each Group m spanning trees must be stored; total of m*n trees.Significant storage requirements for large number of groups.

    Veton Kpuska

  • *Veton Kpuska*Multicast Routing Tree PruningCore-Based Trees an alternative algorithm:Uses one spanning tree per group,Root (core) node near the middle of the group.Host sends multicast message to core node; which in turn sends the message along the spanning tree.Tree will not be optimal for every source,Reduction is storage from m trees to one tree per group.

    Veton Kpuska

  • Multicast Routing Tree Pruning*Veton Kpuska*Core-based tree for group 1.Sending to group 1.

    Veton Kpuska

  • ANyCast RoutingDelivery models in which a source sends to a single destination (called unicast) to all destination (called broadcast) have been discussed so far.Another method that is useful is called anycast in which a packed is delivered to the nearest member of a group.Why one would want anycasting?Sometimes nodes provide a service, such as time of day or content distribution for which it is getting the right information all what is required (not the node that is connected too).

    *Veton Kpuska*

    Veton Kpuska

  • Anycast RoutingAnycast routes to group 1. Topology seen by the routing protocol.

    Veton Kpuska

  • *Veton Kpuska*Routing for Mobile HostsIncreasing number of users of Portable Computers and Personal Computer Devices. They require access to:E-mailFile System, etc.In order to route a packet to a mobile host, the network first has to find it.World Model of communication network:WAN consisting of routers and hosts,LANs connected to WAN, andMANs connected to WAN.

    Veton Kpuska

  • *Veton Kpuska*Routing for Mobile Hosts (cont)A WAN to which LANs, MANs and wireless cells are attached:Wireless cellForeign LANForeign AgentMobile HostMANHome LANHome AgentWAN

    Veton Kpuska

  • *Veton Kpuska*Routing for Mobile Hosts (cont)Stationary Hosts:Hosts that never move.Migratory Hosts:Stationary hosts who move from one fixed site to another from time to time but use the network only when they are physically connected to it.Roaming Hosts:Need to maintain their connections as they move around.Mobile Hosts:Migratory and Roaming Hosts that is all host that are away from home and still want to be connected.

    Veton Kpuska

  • *Veton Kpuska*Routing for Mobile Hosts (cont)All hosts are assumed to have:A permanent home location, andA permanent home address:Used to determine their home location (analogous to telephone number; e.g., 1-212-555-1212).Routing goal in systems with mobile hosts:To make possible to send packets to mobile hosts using their home address, and Have the packets efficiently reach them wherever they may be.Trick is off course to find them first.

    Veton Kpuska

  • *Veton Kpuska*Routing for Mobile Hosts (cont)According to the sketch in previous slide world is divided up (geographically) into small units areas.Areas are typically LANs or wireless cells.Each area has one or moreForeign agents:Processes that keep track of all mobile hosts visiting the area.Home agent:Keeps track of hosts whose home is in the area, but who are currently visiting another area.

    REGISTRATION with Foreign Agent: When a new host enters an area, either by connecting to it (e.g., plugging into LAN), or wandering into the cell it must register itself with the foreign agent of that area.

    Veton Kpuska

  • *Veton Kpuska*Registration Procedure of Mobile HostsEach foreign agent broadcasts periodically a packet announcing its existence and address.Newly-arrived mobile host may:Wait for one of these message, or if none arrives quickly enoughCan broadcast a packet saying: Are there any foreign agents around?

    The mobile host registers with the foreign agent:Gives its home address,Current data link layer address, and Some security information.

    Veton Kpuska

  • *Veton Kpuska*Registration Procedure of Mobile HostsThe foreign agent contact the mobile hosts home agent and informs it about a mobile host in his area. This message contains:The foreign agents network address,Security information (to convince the home agent that the mobile host is really there).

    The home agent authenticates security information containing:Timestamp (to prove that it was generated within the past few seconds), etc.Acknowledges foreign agent by indicating to proceed if everything checks out.

    Foreign agent registers and informs the mobile host.

    Veton Kpuska

  • Registration Procedure of Mobile HostsChecking out when done (typically mobile hosts just turn-off their computers).

    *Veton Kpuska*

    Veton Kpuska

  • *Veton Kpuska*Packet Routing for Mobile HostsExample of sending a packed to a mobile host that has been registered.1. Packet is sent to the mobile hosts home address2. Packet is tunneled to the foreigh agent3. Sender is given foreign agents address4. Subsequent packets are tunneled to the foreign agent

    Veton Kpuska

  • *Veton Kpuska*Packet Routing for Mobile HostsExample: Sender wants to send a packet to a host in New York. Packets sent to the mobile host on its home LAN in NEW York are intercepted by the home agent (step 1).

    Home agent looks up mobile hosts new (temporary) location and finds the address of the foreign agent handling the mobile host (i.e., Los Angeles).

    Home agent does:

    It encapsulates the packet in the payload field of an outer packet and sends the latter to the foreign agent (step 2). This mechanism is called tunneling. After getting the encapsulated packet, the foreign agent removes the original packet from the payload field and sends it to the mobile host as a data link frame.

    The home agent tells the sender to henceforth send packet to the mobile host by encapsulating them in the payload of packets explicitly addressed to the foreign agent instead of just sending them to the mobile host's home address (step 3.) Subsequent packets can now be routed directly to the host via foreign agent (step 4.), bypassing the home agent entirely.

    Veton Kpuska

  • *Veton Kpuska*Routing in Ad Hoc NetworksAd Hoc networks refers to the extreme case of mobility where not only the hosts are mobile but routers as well. Examples:

    Military vehicles on a battlefield with no existing infrastructure.A fleet of ships at sea.Emergency workers at en earthquake that destroyed the infrastructure.A gathering of people with notebook computers in an area lacking 802.11 (IEEE Wireless LAN protocol).

    Veton Kpuska

  • *Veton Kpuska*Routing of Ad Hoc Networks (cont)Each node consists of a router and a host usually on the same computer.Networks of neighboring nodes are called ad hoc networks or MANETs (Mobile Ad-hoc NETworks).Features of such networks:Routers come and go or appear in new places all the time.Consequently, Network Topology may be changing all the time.Validity of paths can thus change spontaneously.

    Veton Kpuska

  • *Veton Kpuska*Ad hoc On-demand Distance Vector routing (AODV) AlgorithmAODV takes into account limited bandwidth and low battery life of devices.It is a on-demand algorithm; that is it determines a route to some destination only when there is a demand to send a packed to a destination.

    Veton Kpuska

  • *Veton Kpuska*Ad hoc On-demand Distance Vector routing (cont)Route DiscoveryAd-hoc network can be described by a graph of the nodes (routers + hosts).Two nodes are connected (depicted via an connecting arc in the graph) if they can communicate directly using their radios.For simplicity connection is assumed symmetric (e.g., case where node A has a more powerful transmitter then node B thus node A can communicate to B but not vice versa is not considered).

    Veton Kpuska

  • *Veton Kpuska*Ad hoc On-demand Distance Vector routing Example ABCDGEFHIRange of As BroadcastRange of As BroadcastABCDGEFHIAfter B and D have received of As BroadcastABCDGEFHIAfter C,F and G have received of As BroadcastABCDGEFHIAfter E,H and I have received of As Broadcast

    Veton Kpuska

  • *Veton Kpuska*AODV AlgorithmScenario: A wants to send a packet to node I.

    AODV algorithm maintains a table at each node keyed by destination giving information about that destination including which neighboring node to send packets to in order to reach the destination.

    Suppose node A can not find the information about destination node I. Thus it needs to discover a route to node I.

    Algorithm Details.

    Veton Kpuska

  • *Veton Kpuska*AODV Algorithm (cont)To locate an unknown node (I), source node A constructs a special ROUTE REQUEST packet and broadcasts it.The packed reaches As neighboring nodes B and D. B and D at this time are directly communicating with A (as opposed to F for example).Format of ROUTE REQUEST PACKET:

    Source and Destinations Address (typically IP address).Request ID local counter maintained separately by each node and incremented each time a ROUTE REQUEST is broadcast.Source Address and Request ID uniquely identify the ROUTE REQUEST packet. This allow nodes to discard any duplicate packets they may receive.Sequence Counters Each node also maintains a second sequence counter incremented whenever a ROUTE REQUEST is sent (or a reply to someone's elses ROUTE REQUEST) . It is used to tell new routes form old routes.Hop Count keeps track of how many hops the packet has made.

    Veton Kpuska

  • *Veton Kpuska*AODV Processing on a node (cont)When ROUTE REQUEST packet arrives at a node (B & D in this case), it is processed in the following steps:

    The Source Address, Request ID pair is looked up in local history table to see if this request has already been seen and processed. If duplicate it is disregardedIf not duplicate pair is entered in history table.

    The receiver node looks up the destination in its route table. If a fresh route to the destination is know, a ROUTE REPLY packet is sent back to the source informing it how to get to the destination. Fresh means that the Destination sequence number stored in the routing table is greater than or equal to the Destination sequence number in the ROUTE REQUEST packet. If it is less, the stored route is older than the previous route the source had for the destination thus next step 3 is executed.ABCDGEFHIAfter B and D have received of As Broadcast

    Veton Kpuska

  • *Veton Kpuska*Since the receiver node does not know a fresh route to the destination, it:Increments the Hop count field,Rebroadcast the ROUTE REQUEST packet to its neighboring nodes with exception to node from which it has received it.Extracts the data from the packed and stores it as a new entry in its reverse route table. This information will be used to construct the reverse route so that the reply can get back to source later as specified with reverse arrows.A timer is started for the newly-made reverse route entry. If it expires the entry is deleted.

    ABCDGEFHIAfter C,F and G have received of As Broadcast

    Veton Kpuska

  • *Veton Kpuska*AODV Algorithm (cont)Since neither B nor D knows where I is, each creates reverse route entry pointing back to A, and broadcasts the packet with Hop count set to 1.Broadcast from B reaches C and D.C makes an entry for it in its reverse route table and rebroadcasts it.D in contrast rejects it as a duplicate.Broadcast from Ds is rejected by B as a duplicate, however, it is accepted by F and G. ABCDGEFHIAfter C,F and G have received of As Broadcast

    Veton Kpuska

  • *Veton Kpuska*AODV Algorithm (cont)After E, H, and I receive the broadcast, the ROUTE REQUEST finally reaches a destination that knows where I is, namely I itself.

    Note: Broadcast from each node are not coordinated in any way.

    ABCDGEFHIAfter E,H and I have received of As Broadcast

    Veton Kpuska

  • *Veton Kpuska*Reply Packet in AODVIn response to the incoming request, I builds a ROUTE REPLY packet and:

    The Source address, Destination address, Hop Counter are copied from the incoming request.Destination sequence number is taken from its counter.The Hop count field is set to 0.The Lifetime field controls how long the route is valid.This packed is cast back to the node that ROUTE REQUERST packed came form, in this case node G.From G it follows the reverse path to D and finally to A. At each node Hop count is incremented so the node can see how far from the destination (I) is.

    Veton Kpuska

  • *Veton Kpuska*Reply Packet in Intermediate nodesAt each intermediate node the packed is inspected and entered into local routing table as a route to I if one or more of the following three conditions are met:

    No route to I is known.The sequence number for I in the ROUTE REPLY packed is greater than the value in the routing table.The sequence numbers are equal but the new route I s shorter.

    This ensures that all nodes on the reverse route learn the route to I for free as a byproduct of As route discovery.Nodes that got the original REQUEST ROUTE packed but were not on the reverse path (B, C, E, F, and H in this example) discard the reverse route table entry when the associated timer expires.

    Veton Kpuska

  • *Veton Kpuska*Route MaintenanceIn Ad-hoc networks the nodes can move or can be switched off.For example if G is switched off, A will need to deal with it because the route that it was using (ADGI) is no longer valid.Idea: each node broadcasts a Hello message periodically. Each neighbor is expected to respond to it. For the cases that there is no response the information is purged for the routes that use corresponding node.List of Active Neighbors for a destination: For each possible destination, each node, N, keeps track of its neighbors that have fed it a packed for that destination during the last T seconds.A node N does this by having a routing table keyed by destination containing: Outgoing node to use to reach that destination,Hop count to the destinationMost recent destination sequence number, andThe list of active neighbors for that destination.

    Veton Kpuska

  • *Veton Kpuska*Example of a Routing Table Ds routing table before G goes downGraph after G has gone downABCDGEFHI

    Dest.Next hopDistanceActive NeighborsOther fieldsAA1F,GBB1F,GCB2GEG2FF1A,BGG1A,BHF2A,BIG2A,B

    Veton Kpuska

  • *Veton Kpuska*Route Maintenance (cont)When any of Ns neighbors becomes unreachable, it checks its routing table to see which destinations have routes using this node. For each of these routes, the active neighbors are informed that their route via N is now invalid and must be purged from their routing tables.The active neighbors nodes propagate this information to their active neighbors, and so on recursively, until all routes depending on the unavailable node are purged from all routing tables.

    Veton Kpuska

  • *Veton Kpuska*Congestion Control AlgorithmsThe situation when to many packets are present in subnet it is called congestion.

    Veton Kpuska

    Congestion Chart

    000

    0.0951625820.0951625820.1

    0.18126924690.18126924690.2

    0.25918177930.25918177930.3

    0.3296799540.3296799540.4

    0.39346934030.39346934030.5

    0.45118836390.45118836390.6

    0.50341469620.50341469620.7

    0.55067103590.55067103590.8

    0.59343034030.59343034030.9

    0.63212055880.63212055881

    0.66712891630.64712891631

    0.69880578810.65880578811

    0.7274682070.6674682071

    0.75340303610.67340303611

    0.77686983990.67686983991

    0.7981034820.6781034821

    0.81731647590.67731647591

    0.83470111180.67470111181

    0.85043138080.67043138081

    0.86466471680.66466471681

    0.87754357170.65254357171

    0.88919684160.63919684161

    0.89974115630.62474115631

    0.90928204670.60928204671

    0.91791500140.56791500141

    0.92572642180.52572642181

    0.93279448730.43279448731

    0.93918993740.33918993741

    0.94497677990.24497677991

    0.95021293160.15021293161

    Maximum Carrying capacity of subnet

    Desirable Performance

    Congested Performance

    Ideal

    Number of Packets in Mil.

    Packets Delivered [%]

    Congestion Traffic Performance Chart as functino of Number of Packets Sent

    Data

    00000

    10.09516258200.0951625820.1

    20.181269246900.18126924690.2

    30.259181779300.25918177930.3

    40.32967995400.3296799540.4

    50.393469340300.39346934030.5

    60.451188363900.45118836390.6

    70.503414696200.50341469620.7

    80.550671035900.55067103590.8

    90.593430340300.59343034030.9

    100.632120558800.63212055881

    110.66712891630.020.64712891631

    120.69880578810.040.65880578811

    130.7274682070.060.6674682071

    140.75340303610.080.67340303611

    150.77686983990.10.67686983991

    160.7981034820.120.6781034821

    170.81731647590.140.67731647591

    180.83470111180.160.67470111181

    190.85043138080.180.67043138081

    200.86466471680.20.66466471681

    210.87754357170.2250.65254357171

    220.88919684160.250.63919684161

    230.89974115630.2750.62474115631

    240.90928204670.30.60928204671

    250.91791500140.350.56791500141

    260.92572642180.40.52572642181

    270.93279448730.50.43279448731

    280.93918993740.60.33918993741

    290.94497677990.70.24497677991

    300.95021293160.80.15021293161

    Sheet2

    Sheet3

  • Approaches to Congestion ControlTimescales of approaches to congestion control

    Veton Kpuska

  • Traffic-Aware RoutingA network in which the East and West parts are connected by two links.

    Veton Kpuska

  • *Veton Kpuska*Congestion FactorsStreams of inputs packets arriving from multiple lines (3-4 or more) needing the same output line => queue buildup.Adding more memory may help to a point but a study by Nagle suggest that increasing memory to to accommodate larger queues congestions gets worse not better due to time required to get to the front of the queue (timed out).

    Slow Processors:Queue build up due to routers slow CPUs at performing bookkeeping task:Queueing buffers, Updating tables, etc.

    Low bandwidth lines.

    Typically the problem is that upgrading one part of the system shifts the bottleneck to the other someplace else. The real problem frequently is a mismatch parts of the system. The problem will persist until all components of the system are in balance.

    Veton Kpuska

  • *Veton Kpuska*Congestion Control vs. Flow ControlCongestion Control has to due with making sure the subnets are able to carry the offered traffic. Thus it is a global issue involving the behavior of all the hosts, all the routers, the store-and forwarding processing within the routers, and all the other factors that tend to diminish the carrying capacity of the subnet.Flow Control relates to point-to-point traffic between a given sender a given receiver. Its job is to make sure that a fast sender cannot continually transmit data faster than the receiver is able to absorb it.It frequently involves some direct feedback from the receiver to the sender to tell the sender how things are doing at the other end.

    Veton Kpuska

  • *Veton Kpuska*Congestion Control vs. Flow ControlExampleFlow Control Problem: Consider a fiber optic network with a capacity of 1000 Gbps on which a supercomputer is trying to transfer a file to a personal computer at 1 Gbps. Although there is not congestion the supercomputer has to frequently stop in order to allow PC to catch up.Congestion Control Problem: Consider a store-and-forward network with 1 Mbps lines and 1000 large computers, half of which are trying to transfer files at 100 kbps to the other half creating a traffic of 500x100 kbps = 50000 kbps = 50 Mbps. The problem here is that this traffic exceeds the capacity of what the network can handle.

    Veton Kpuska

  • *Veton Kpuska*General Principles of Congestion ControlAnalogy with Control Theory:Open-loop, andClosed-loop approach.

    Open-loop approachProblem is solved at the design cycleOnce the system is running midcourse correction are NOT made.Tools for doing open-loop control:Deciding when to accept new traffic,Deciding when to disregard packets and which ones.Making scheduling decision at various points in the network.Note that all those decisions are made without regard to the current state of the network.

    Veton Kpuska

  • *Veton Kpuska*General Principles of Congestion ControlClosed-loop approachIt is based on the principle of feedback-loop. The approach has three parts when applied to congestion control:Monitor the system to detect when and where congestion occurs,Pass this information tot places where action can be takenAdjust system operation to correct the problem.

    Veton Kpuska

  • *Veton Kpuska*General Principles of Congestion ControlMonitoring - Metrics to be used to monitor subnet congestion:Percentage of all packets disregarded for lack of buffer space.Average queue lengthNumber of packets that time out and are retransmitted,Average packet delayStandard deviation of packed delay.

    Transferring congestion informationInformation send to the source(s) of the traffic. Undesirable because extra traffic is initiated when opposite is needed.Another approach is to reserve a bit field that can be set when congestion gets above some level of threshold.Routers/Hosts send periodically probe packets out to explicitly ask about congestion. This information can then be used to route traffic around problem areas.In general in all feedback schemes, the hope is that knowledge of congestion will cause the hosts to take appropriate action to reduce the congestion. Time constant in any adjustment scheme is critical and non-trivial problem:To fast adjustment is responsive but can lead to oscillations.To slow adjustment is response time is sluggish and of no real value.

    Veton Kpuska

  • *Veton Kpuska*General Principles of Congestion ControlThe presence of a congestion means that the load is (temporarily) greater than the resources (in part of the system) can handle.Increase Resources, and/or Decrease the Load.

    Veton Kpuska

  • *Veton Kpuska*General Principles of Congestion ControlIncrease of Resources:Use dial-up telephone lines to temporarily increase the bandwidth between certain points.On satellite systems increasing transmission power often gives higher bandwidth.Splitting traffic over multiple routes (instead of using the best one) may effectively the bandwidth.Use of spare routers that are normally used as backups to give more capacity.

    Veton Kpuska

  • *Veton Kpuska*General Principles of Congestion ControlDecrease the LoadIt is not always possible to increase capacity of the subsystem. Thus the only other way to reduce congestion is to decrease the load.Denying service to some users (AOL in early days),Degrading service to some or all users, Having users schedule their demands in more predictable way.

    Veton Kpuska

  • *Veton Kpuska*Congestion Prevention PoliciesOpen-loop ApproachOpen-loop system designed to minimize congestion in the first place rather then reacting after it happened.Try to achieve this goal at various levels/layers:

    Data Link Layer:Retransmission Policy:Sender with quick time out and go-back-n retransmitting packets vs.Selective repeat with slower time out.Out-of-order catching policyAcknowledgment policyFlow control policy

    Veton Kpuska

  • *Veton Kpuska*Congestion Prevention PoliciesOpen-loop ApproachNetwork Layer:Virtual circuit versus datagram inside the subnet:Many congestion control algorithms work only with virtual circuit subnets.Packet queueing and service policy:One queue per input line or output line or both.Processing the queue:Round-robin Priority based queue processing.Packet discard policyBad policy can make the problem worse.Routing algorithmSpreading the traffic over all the lines can help, vs.Directing the traffic on the already congested line.Packet lifetime management Deals with issue that determines how long a packet may live before it is disregarded. To long a life time lost packets may clog up the works for a long time.To short on the other hand packets may time out before even given a chance to reach the destination, thus inducing retransmission.

    Veton Kpuska

  • *Veton Kpuska*Congestion Prevention PoliciesOpen-loop ApproachTransmission Layer same issues like in Data Link Layer with one addition determining the time out is harder because the transit time across the network is less predictable than the transit time over a wire between two routers.Retransmission Policy:Out-of-order catching policyAcknowledgment policyFlow control policyTime out determination

    Veton Kpuska

  • *Veton Kpuska*Congestion Prevention Policiesin Virtual-Circuit SubnetsAdmission Control:Simple algorithm once congestion has been signaled, no more virtual circuits are set up until the problem had gone away.Attempts to setup new transport layer connections will fail.Alternate Approach to Admission Control:Allow new virtual-circuits but carefully route all new ones around the problem area,

    Veton Kpuska

  • *Veton Kpuska*Alternate Approach to Admission Control Examplea)ABb)New Virtual-Circuit (a) A congested network. (b) The portion of the network that is not congested. A virtual circuit from A to B is also shown.

    Veton Kpuska

  • Traffic Throttling (2)Explicit congestion notification

    Veton Kpuska

  • Load Shedding (1)A choke packet that affects only the source..

    Veton Kpuska

  • Load Shedding (2)A choke packet that affects each hop it passes through.

    Veton Kpuska

  • *Veton Kpuska*Negotiated Approach to Congestion ControlAgreement is negotiated between the host and subnet when a virtual circuit is set-up.Agreement specifies:Volume and shape of the traffic,Quality of service requires, etc. Subnet guarantees the connection since it will make all necessary resource available during the set. Resource typically include:Table and buffer space in the routers, and bandwidth on the lines.Agreement can be done All the time as part of standard operating procedure (wastes resources), orOnly when the subnet is congested.

    Veton Kpuska

  • End*

    Veton Kpuska

    Computer Networks 2Computer Networks 2*Veton Kpuska*Veton Kpuska