Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 5 Network Layer.

Similar presentations


Presentation on theme: "Chapter 5 Network Layer."— Presentation transcript:

1 Chapter 5 Network Layer

2 Network Layer Functions: connecting different
application transport network data link physical Functions: Routing issues determine “good” path (sequence of routers) thru network from source to dest. Congestion (Not Contention!) More packets enter an area than can be processed Internetworking connecting different network technologies together Network layer protocols in every host, router network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical application transport network data link physical

3 Network Layer Design Issues
Store-and-forward packet switching Services provided to transport layer Implementation of connectionless service Implementation of connection-oriented service Comparison of virtual-circuit and datagram networks

4 Network layer design issues
Store-and-Forward packet switching After each reception checksum is done in router and a new packet is transmitted to the next router. 1

5 Network layer design issues
Services provided to transport layer Independent of subnet technology Transport layer shielded from number, type, and topology of subnets Uniform network address numbering Even across LANs and WANs

6 Network layer design issues
Two basic kind of services Connectionless (routers only send and receive packets) Packets also called datagram This kind of network is also called datagram subnet Connection oriented (error control and flow control is done end to end) Virtual circuit should set up before sending packets This kind of network is also called virtual circuit subnet

7 Connectionless: Datagram
No call setup at network layer Packets forwarded using destination host address packets between same source-dest. pair may take different paths Use in Internet application transport network data link physical 2. Receive Data application transport network data link physical 1. Send Data

8 Connectionless: Datagram
Routing within a diagram subnet: Store-and-Forward packet Subnet The table of router A is changed because of some reasons! Management and update this tables for routing = Routing algorithm Routing tables

9 Connection Oriented-Virtual Circuits
Call setup, do for each call before data can flow Each packet carries VC identifier Used in ATM, frame-relay, X.25 application transport network data link physical 6. Receive data 3. Accept call 2. Incoming call application transport network data link physical 5. Data flow begins 4. Call connected 1. Initiate call

10 Virtual Circuits Routing within a virtual-circuit subnet:

11 Comparison of Virtual-Circuit and Datagram Subnets

12 Routing Algorithms The network layer is responsible for routing packets from the source to destination. The routing algorithm is the piece of software that decides where a packet goes next (e.g., which output line, or which node on a broadcast channel). For connectionless networks, the routing decision is made for each datagram. For connection-oriented networks, the decision is made once, at circuit setup time. The routing algorithm must deal with the following issues: Correctness, simplicity, stability, fairness and optimality Minimizing mean packet delay or maximizing total network throughput Routing is different from Forwarding!: Forwarding: Select the output path using routing table Routing: Management and updating the routing tables

13 Desirable properties of the routing algorithms:
Correctness: Simplicity: for efficiency Robustness: must be able to sustain the changes in the networks (cannot just rely on reboot) Stability: should converge to equilibrium Fairness: every one gets to send Optimality: (Selection of Best Route)as efficient as possible

14 Conflict between fairness and optimality.
Routing Algorithms Conflict between fairness and optimality. If traffic flows between A and A’, B and B’, and C and C’, the utilization of the network will be good, but flow between X and X’ will be severely restricted. Fairness must often be imposed at the expense of overall utilization.

15 Optimality Principle Optimality principle: This means:
If router J is on the optimal path from router I to router K, then the optimal path from J to K also falls along the same route. This means: Given the final destination, routers only need to know the optimal route to the next router. Construct a sink tree with the destination to be root. The goal of all routing algorithms is to discover and use the sink tree for all routers. Since it is a tree, there is no loops. There would be different sink trees for each final destination.

16 The Optimality Principle
(a) A subnet. (b) A sink tree for router B.

17 Routing There are two types:
Static (Non-Adaptive) routes never update or update slowly over time Examples: Dijkstra, Flooding algorithm Dynamic (Adaptive) routes update more quickly use dynamic information of current topology such as load, delay, … Examples: Distance Vector, Link State Routing From another view: Global: all routers have complete topology, link cost info Decentralized: router knows physically-connected neighbors

18 Routing Algorithms Shortest Path Routing (Dijkstra’s) Flooding
Distance Vector Routing Link State routing Hierarchical routing Broadcast routing Multicast routing Routing for mobile hosts Routing in Ad Hoc Networks

19 Dijkstra Algorithm Net topology, link costs known to all nodes
Non-Adaptive Algorithm Net topology, link costs known to all nodes Global algorithm Cost of a link is a function of : Number of Hops, Distance, Average traffic, Delay, … Computes least cost paths (Minimum path) from one node (‘source”) to all other nodes gives routing table for that node Iterative: after k iterations, know least cost path to k dest.’s

20 The shortest path from A to D is: ABEFHD
Next steps? Figure. The first five steps used in computing the shortest path from A to D. The arrows indicate the working node. The shortest path from A to D is: ABEFHD

21

22 Example Find the Shortest path from s to y using dijsktra algorithm for the following graph. Solution

23 Dijkstra Animation

24 Flooding Algorithm P flooding P P P
Transmit a copy of each packet it receives on every one of its transmission links flooding P P P How to reduce looping even further: 1. hop count 2. time stamp Using Hop Counter: Hop count is number of nodes that a packet may have to pass through on the way to its destination. Each router decrements a hop count contained in the packet header. Whenever the hop count decrements to zero, the router discards the packet

25 Flooding How to Keep track of which packet have been flood
Add a sequence number to each packet's header. Each router maintains a private sequence number. When it sends a new packet, it copies the sequence number into the packet, and increments its private sequence number. Keeps track of the highest sequence number seen from S. Whenever it receives a packet from S containing a sequence number lower than the one stored in its table, it discards the packet. Otherwise, it updates the entry for S and forwards the packet on

26 Selective Flooding Another variation of flooding is Selective Flooding: Don’t send incoming packets to ALL output lines Just forward on that lines which are going approximately in right direction Flooding is not practical in most applications, but it does have some uses Uses: In military applications, the network must remain robust in the face of (extreme) hostility Sending routing updates, because updates can't rely on the correctness of a router's routing table. Theoretical-chooses all possible paths, so it chooses the shortest one

27 Distance Vector Routing
Adaptive Algorithm Distance Vector Routing Each router maintains a table (vector) giving the best known distance to a destination and the line to use for sending there. Tables are updated by exchanging information with neighbors. Each router knows the distance (cost) of reaching its neighbors (e.g. send echo requests). Routers periodically exchange routing tables with each of their neighbors. The distance vector routing algorithm is sometimes called by other names, most commonly Bellman-Ford routing algorithm and the Ford-Fulkerson algorithm. This algorithm was used in the original ARPANET

28 Distance Vector Routing
Distance table for J DJ (G,?)= c(J,H)+minw{DH(G,w)}= 6+12=18 A subnet. Input from A, I, H, K, and the new routing table for J. Suppose that J has measured its delay to its neighbors, A, I, H, and K as 8, 10,12,6 msec respectively.

29 Count –to-infinity Problem
Convergence is slow! Good news travels quickly, bad news travels slowly (count-to-infinity) problem Example: Propagation of good news Initially A is down and all other routers know this When A comes up, the other routers learn about it via the vector exchanges There is no path to A Table for dest.=A In a subnet with longest subnet path=N, after N exchanges everyone will know

30 Count-to-Infinity Problem
Example: Propagation of bad news The count-to-infinity problem A goes down after initially After this A goes down B thinks that there is a path to A thru C but C itself go to A via B! Counting will continuous to infinity

31 Link State Routing Each router must do the following:
 Discover its neighbors, learn their network address. Sends ‘hello' message on booting.  Measure the delay or cost to each of its neighbors. Delay= (Send ‘Echo’ message + Receive its reply)/2  Construct a packet telling all it has just learned. Construct Link State (LS) packet, it contains: Source Add., Seq. No., Age No., List of neighbors + their delay  Send this packet to all other routers. Forwards link state packets to all other routers using Flooding algorithm.  Compute the shortest path to every other router. Each router uses an Dijkstra algorithm to calculate shortest paths based on the current values in its database. Adaptive Algorithm

32 Link State Routing Link state routing is based on the assumption that, although the global knowledge about the topology is not clear, each node has partial knowledge: it knows the state (type, condition, and cost) of its links In other words, the whole topology can be compiled from the partial knowledge of each node

33 Creation of Link State Packet (LSP)
A link state packet (LSP) can carry a large amount of information such as the node identity, the list of links, a sequence number, and age Node identity and the list of links are needed to make the topology Sequence number facilitates flooding and distinguishes new LSPs from old ones Age prevents old LSPs from remaining in the domain for a long time

34 Link State Routing The link state packets for this subnet.

35 Hierarchical Routing As a network becomes larger, the amount of information that must be propagated increases, and the routing calculation becomes increasingly expensive. (Increase the memory amount and calculation) Hierarchical routing: Divide the network into regions, with a router only knowing the details of how to route to other routers in its region. Hides information from far-away nodes, reducing the amount of information a given router needs to perform routing Router don’t know about the internal topology of other regions. Gateway is a router that knows about other regions

36 Hierarchical Routing Advantage: Disadvantage:
Scaling. Each router needs less information In Ex. Distance table reduce from 17 entries to 7 Disadvantage: Sub optimal routes. The average path length increases Optimal path for 1A to 5C is thru region 2 while in hierarchical is thru region 3

37 Broadcast routing Send message to all other hosts: Poor methods:
Update distributed database Distribute weather reports Distribute live radio/TV programs Poor methods: Send a distinct packet to each destination List of addresses needed High usage of bandwidth Flooding Too many packets Multi-destination routing Each packet contains a list of destination On each line a single packet

38 Broadcast routing Best method: use sink tree
Broadcast source = root of sink tree Forwarding on sink tree lines Excellent use of bandwidth Source tree must be known at each intermediate node Best method: use sink tree Which sink tree? How many sink trees?

39 Broadcast routing Sink tree approximation: reverse path forwarding
if a packet arrives on line used for traffic to source of broadcast then forward packet on all lines, except the one it arrived on else discard packet

40 Routing Algorithms Properties Shortest Path Routing Flooding
Distance Vector Routing Link State routing Hierarchical routing Broadcast routing Multicast routing Routing for mobile hosts Routing in Ad Hoc Networks

41 Multicast routing Send a message to a well-defined group
Large in size Small compared to network as a whole Group management Create and destroy groups Process can leave and join a group algorithm How will routers know about groups?

42 Multicast routing Algorithm Pruning: Source computes spanning tree
Remove lines that do not lead to hosts of group ( = pruning) Pruning: Link state routing Each router knows full topology Distance vector routing Reverse path forwarding + PRUNE messages to remove arcs

43 Multicast routing Pruning: source Link state routing
Each router knows full topology Distance vector routing Reverse path forwarding + PRUNE messages to remove arcs

44 Routing Algorithms Shortest Path Routing Flooding
Distance Vector Routing Link State routing Hierarchical routing Broadcast routing Multicast routing Routing for mobile hosts Routing in Ad Hoc Networks

45 Routing for Mobile Hosts
4. Network Layer - routing February 2006 Routing for Mobile Hosts Model of world: WAN + LANs, wireless cells Migratory users Roaming users Move from time to time Use network when connected Compute on the run Maintain connections as they move around Computer Networks

46 Routing for Mobile Hosts
Foreign agent: keeps track of users: who are currently visiting the area Home agent: keeps track of users whose home is in the area who are currently visiting another area Permanent home location Permanent home address

47 Routing for Mobile Hosts
How does it work? Registration procedure with foreign agents Sending packets Leaving an area Registration procedure with foreign agent Announcing existence of foreign agent Broadcast by foreign agent Broadcast query by arriving mobile user Mobile user gives to foreign agent Home address Current data link address Security information Foreign agent contacts home agent of user

48 Routing for Mobile Hosts
Registration procedure with foreign agent (cont.) Announcing existence of foreign agent Mobile user gives to foreign agent Foreign agent contacts home agent of user Identity of user Security info Network address of foreign agent Home agent Checks security info Sends ack to foreign agent Foreign agent Stores state Informs mobile user

49 Routing for Mobile Hosts
Sending a packet to a mobile user Home address is used  packet routed to home LAN Packet intercepted by home agent Packet forwarded to the foreign agent Encapsulation – tunneling Foreign agent forwards packet to mobile user Sender is given address of foreign agent Encapsulation – tunneling used

50 Routing for Mobile Hosts
4. Network Layer - routing February 2006 Routing for Mobile Hosts Home agent Foreign agent Computer Networks

51 Routing for Mobile Hosts
Leaving an area Announced by user  deregistration Automatic detection by foreign agent Various different schemes: Protocol carried out by routers or hosts Routers along the way intercept and redirect traffic Modify original packet instead of encapsulation

52 Routing Algorithms Properties Shortest Path Routing Flooding
Distance Vector Routing Link State routing Hierarchical routing Broadcast routing Multicast routing Routing for mobile hosts Routing in Ad Hoc Networks

53 Routing in Ad Hoc Networks
Networks of nodes that just happen to be near each other are called ad hoc networks or MANETs (Mobile Ad hoc NETworks). Ad Hoc Network = routers are mobile No fixed topologies No fixed or known neighbors Valid paths can disappear at any time Node = router + host Routing quite different from routing in wired networks Examples Military vehicles on a battlefield Fleet of ships at see People with notebooks (lacking ) AODV = Ad hoc On-demand distance vector routing On-demand: route computed when needed Distance vector for mobile world Taking into account limited bandwidth + low battery life

54 Routing in Ad Hoc Networks
Graph presentation Node Arc = nodes connected can communicate directly by radio Routing table: Line for known routes Can be valid or invalid A wants to send a packet To H: forward to D To I: start route discovery broadcasting a route request packet

55 Routing in Ad Hoc Networks
(a) Range of A's broadcast. (b) After B and D have received A's broadcast. (c) After C, F, and G have received A's broadcast. (d) After E, H, and I have received A's broadcast. Shaded nodes are new recipients. Arrows show possible reverse routes.

56 Routing in Ad Hoc Networks
Route request packet: Source & destination address: e.g. IP address Request ID: local counter incremented for each new route request packet broadcasted allows to discard duplicate requests at other nodes Source sequence # counter to distinguish old routes to destination from new ones Destination sequence # most recent sequence counter of destination seen by source

57 Routing in Ad Hoc Networks
Processing a route request packet duplicate request? Yes: discard Fresh route to destination known? Fresh = local destination sequence # >= destination sequence # in request Yes: send route reply packet No fresh route to destination is known! Store info from route request in reverse route table; to enable the forwarding of route reply packets Increment hop count Rebroadcast route request

58 Routing in Ad Hoc Networks
Route reply packet Returned by Intermediate node knowing a fresh route Destination node Destination sequence# Number known by sender of reply packet Hop count Set to length of path known by sender of reply packet For destination = 0

59 Routing in Ad Hoc Networks
Route maintenance Detect that neighbors are not reachable anymore Broadcast Hello packet periodically Failure to send packet Cleanup routing table Additional field in routing table: active neighbor Nodes that have offered path to destination in recent past

60 Routing in Ad Hoc Networks
Route maintenance Routing table of D G Node G goes down!

61 Routing in Ad Hoc Networks
Route maintenance New routing table of D: Delete routes with G as next hop Delete G as active neigbor


Download ppt "Chapter 5 Network Layer."

Similar presentations


Ads by Google