Computer Networks

# Computer Networks

## Computer Networks

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
##### Presentation Transcript

1. Computer Networks Section1. Routing Algorithms and Network Layer Protocol Presenter: Shu-Ping Lin

2. Outline • Routing Algorithms • The Network Layer in The Internet

3. Outline • Routing Algorithms • The Network Layer in The Internet

4. Store-and-Forward Packet Switching

5. Routing Algorithm • Routing algorithm • Datagram • Virtual circuit • Differences between routing and forwarding • Routing versus forwarding

6. Routing Algorithm (cont’d) • Requirement of routing algorithm • Correctness and Simplicity • Robustness • Stability • Fairness • Optimality

7. Datagram Routing

8. Virtual-Circuit Routing

9. Comparison

10. Routing Algorithm (cont’d) • Nonadaptive (static routing) • Do not base routing decisions on measurement of the current traffic and topology. • The route used to get from node to node is computed in advance. • Adaptive (dynamic routing) • Change routing decisions to reflect changes in topology and traffic.

11. Optimality Principle • If router J is on the optimal path from router I to router K, the the optimal path from J to K also falls along the same route. • Sink tree • The set of optimal routes from all sources to a given destination • The goal of all routing algorithms is to discover and use the sink trees for all routers.

12. Sink Tree

13. Shortest Path Routing • Link metric • Dijkstra algorithm

14. Flooding • Every incoming packet is sent out on every outgoing link except the one it arrived on. • Termination of flooding process • Hop counter • Record of packet which has been flooded • Applications of flooding • Military application • Comparison

15. Distance Vector Routing • Each router maintains a table giving the best known distance to each destination and which line to be used. • Tables are updated by exchanging information with the neighbors. • Items in the table • Preferred outgoing line • Estimate of the distance to that distance

16. Distance Vector Routing (cont’d)

17. Distance Vector Routing (cont’d) • Converge to the correct answer, but do so slowly. • It reacts rapidly to good news, but leisurely to bad news. • The count-to-infinity problem

18. Count-to-Infinity Problem

19. Problem of DVR • Does not take line bandwidth into account. • Take too long to converge.

20. Link State Routing • Learning about the neighbors • Sending a special HELLO packet on each point-to-point line • Measuring line cost to each of its neighbors • Round-trip time • Traffic load • Line bandwidth

22. Link State Routing (cont’d) • Distributing the link state packets • Flooding is used to distribute the link state packet. • Each packet contains a sequence number that is incremented for each new packet sent. • Computing the new routes • Dijkstra’s algorithm can be run locally to construct the shortest path to all destinations.

23. Hierarchical Routing • As networks grow in size, the router routing tables grow proportionally. • Each router has responsible for its region and knows nothing about the internal structure of other router.

24. Hierarchical Routing (cont’d)

25. Hierarchical Routing (cont’d) • Penalty of increased path length • The optimal number of levels for an N router subnets is ln N.

26. Broadcasting Routing • The source simply send a distinct packet to each destination. • Waste bandwidth • Have to know complete list of all destinations • Flooding • Generate too many packets • Consume too much bandwidth

27. Broadcasting Routing (cont’d) • Multidestination routing • Each packet contains a list of destinations. • The destination set is partitioned among the output lines. • Using spanning tree • Routers must know which of its lines belong to the spanning tree in advance. • Copy an incoming packet onto all the spanning lines except the on it arrived on.

28. Broadcasting Routing (cont’d) • Reverse path forwarding • Router checks to see if the packet arrived on the line that is normally used for sending packets to the source of the broadcast.

29. Multicast Routing • Each router computes a spanning tree covering all other routers. • When a process sends a multicast packet to a group • Examining the spanning tree of this group • Removing all lines that do not lead to hosts that are members of group

30. Multicast Routing (cont’d)

31. Multicast Routing (cont’d) • Pruning spanning tree • Reverse path forwarding • Router with no hosts interested in a particular group sends a PRUNE message. • The subnet is recursively pruned.

32. Multicast Routing (cont’d) • Disadvantage of algorithm, suppose that network has n groups, each with an average of m members. • For each group, m pruned spanning trees must be stored • Total of mn trees • Core-based tree • A host wanting to multicast sends packets to the core, which does the multicast along the spanning tree.

33. Routing for Mobile Hosts

34. Routing for Mobile Hosts (cont’d) • Mobile host • Migratory hosts • Roaming hosts • All hosts are assumed to have a permanent home location that never changes. • Hosts also have a permanent home address that can be used to determine their home location.

35. Routing for Mobile Hosts (cont’d) • Each area has a home agent which keeps track of hosts whose home is in the area, but who are currently visiting another area. • Each area has foreign agent which keeps track of all mobile hosts visiting this area.

36. Routing for Mobile Hosts (cont’d) • Registration procedure • Foreign agent searching • Registration • Foreign agent contacts the mobile host’s home agent. • Verification of mobile host’s home agent • Acknowledgement from the mobile host’s home agent

37. Routing for Mobile Hosts (cont’d) • Tunneling • Encapsulate the original packet in the payload field of an outer packet and sends the latter to the foreign agent.

38. Routing for Mobile Hosts (cont’d)

39. Routing in Ad Hoc Networks • AODV (Ad hoc On-demand Distance Vector) • Distant relative of the Bellman-Ford distance vector algorithm • Considering the limited bandwidth and low battery life • On-demand algorithm

40. Routing in Ad Hoc Networks (cont’d) • AODV algorithm maintains a table at each node, keyed by destination and which neighbor to send packets in order to reach destination. • Route request packet

41. Routing in Ad Hoc Networks (cont’d) • When a route request packet arrives at a node • The (Source address, request ID) pair is looked up in a local history table too see if this request has already been seen and processed. • Receiver looks up the destination in its route table. • If receiver does not know a fresh route to the destination, it increments the Hop count field and rebroadcast the REQUEST packet.

42. Routing in Ad Hoc Networks (cont’d)

43. Routing in Ad Hoc Networks (cont’d) • Destination constructs a ROUTE REPLY packet which follows the reverse path to source. • Each intermediate node enters this packet into local routing table when • No route to destination is known. • Sequence number for destination in REPLY is greater than the value in the routing table. • Sequence number is equal but the new route is shorter.

44. Routing in Ad Hoc Networks (cont’d) • Problem of mobility • Route maintenance • Periodically, each node broadcasts a Hello message. • If no response is returned, router prune this link. • Active neighbor

45. Routing in Ad Hoc Networks (cont’d)

46. Routing in Ad Hoc Networks (cont’d) • Critical difference between AODV and DVR • Nodes do not send out periodic broadcasts containing their entire routing table.

47. Node Lookup in Peer-to-Peer Networks • One of p2p routing algorithm—Chord • Each user node has an IP address that can be hashed to an m-bit number call node identifier. • Successor (k) is the node identifier of the first actual node following k around the circle clockwise.

48. Node Lookup in Peer-to-Peer Networks (cont’d) • Finger table • Start field = k +2i (modulo 2m) • If key falls between k and successort (k), then the node holding information about key is successor (k). • Otherwise, the entry whose start field is the closest predecessor of key is tried.

49. Node Lookup in Peer-to-Peer Networks (cont’d)

50. Node Lookup in Peer-to-Peer Networks (cont’d) • Node r joining • New node r asks successor (r) for its predecessor. • Insert r in between successor and predecessor. • Successor should hand over those keys in the range predecessor (r)-r, which now belong to r. • Every node runs a background process that periodically recomputes each finger by calling successor.