Top Banner
The Network Layer Chapter 5
109

Lecture 9 network layer

May 06, 2015

Download

Education

Hemang Kothari
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture 9   network layer

The Network Layer

Chapter 5

Page 2: Lecture 9   network layer

Motivation

Page 3: Lecture 9   network layer

Network Layer Design Isues

• Store-and-Forward Packet Switching• Services Provided to the Transport Layer• Implementation of Connectionless Service• Implementation of Connection-Oriented Service• Comparison of Virtual-Circuit and Datagram Subnets

Page 4: Lecture 9   network layer

Store-and-Forward Packet Switching

The environment of the network layer protocols.

fig 5-1

Page 5: Lecture 9   network layer

Implementation of Connectionless Service

Routing within a diagram subnet.

Page 6: Lecture 9   network layer

Implementation of Connection-Oriented Service

Routing within a virtual-circuit subnet.

Page 7: Lecture 9   network layer

Comparison of Virtual-Circuit and Datagram Subnets

5-4

Page 8: Lecture 9   network layer

Types of Routing Algorithms

a) Non adaptive (static)– Do not use measurements of current conditions

– Static routes are downloaded at boot time

b) Adaptive Algorithms– Change routes dynamically

• Gather information at runtime– locally

– from adjacent routers

– from all other routers

• Change routes– Every delta T seconds

– When load changes

– When topology changes

Page 9: Lecture 9   network layer

Routing Algorithms

• The Optimality Principle• 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

Page 10: Lecture 9   network layer

Routing Algorithms (2)

Conflict between fairness and optimality.

Page 11: Lecture 9   network layer

Optimality Principle

• General statement about optimal routes (topology, routing algorithm independent).

• If router J is on optimal path between I and K, then the optimal path from J to K also falls along the same route.

• Corollary:– Set of optimal routes from all sources to destination

form a tree rooted at destination.

– Sink tree.

Page 12: Lecture 9   network layer

The Optimality Principle

(a) A subnet. (b) A sink tree for router B.

Page 13: Lecture 9   network layer

Shortest Path Routing

The first 5 steps used in computing the shortest path from A to D. The arrows indicate the working node.

Page 14: Lecture 9   network layer

Flooding

• Every incoming packet forwarded on every outgoing link except the one it arrived on.

• Problem: duplicates.• Constraining the flood:

– Hop count.

– Keep track of packets that have been flooded.

• Robust, shortest delay (picks shortest path as one of the paths).

Page 15: Lecture 9   network layer

Flooding Example

Page 16: Lecture 9   network layer

a) Brute force routing– Every incoming packet is sent on every outgoing line

– Always finds the shortest path quickly

– Also finds many long paths

– Time to live is set to size of subnet

b) Selective Flooding– Flood only in the direction of the destination

c) Practical in a few settings– Military Applications

– Distributed Databases

– Metric for comparison

Flooding (a nonadaptive routing algorithm)

Page 17: Lecture 9   network layer

Dynamic Routing Algorithm

a) Distance vector routing.

b) Link state routing.

1. Dynamic algorithm reacts based on current situation of network.

2. It involves sharing of information.

3. Global sharing Vs. Local sharing.

Page 18: Lecture 9   network layer

Problem - Internet

Page 19: Lecture 9   network layer

Distance Vector Routing - Concept

Page 20: Lecture 9   network layer

Distance Vector Routing - Table

Page 21: Lecture 9   network layer

DVR – Table Distribution

Page 22: Lecture 9   network layer

Updating Routing Table - A

Page 23: Lecture 9   network layer

Final Routing Table

Page 24: Lecture 9   network layer

Ex - Distance Vector Routing

(a) A subnet. (b) Input from A, I, H, K, and the new routing table for J.

Page 25: Lecture 9   network layer

Update Mechanism

a) Periodic Updates: Updates to the routing tables are sent at the end of a certain time period. A typical value is 90 seconds.

b) Triggered Updates: If a metric changes on a link, a router immediately sends out an update without waiting for the end of the update period.

c) Full Routing Table Update: Most distance vector routing protocol send their neighbors the entire routing table (not only entries which change).

d) Route invalidation timers: Routing table entries are invalid if they are not refreshed. A typical value is to invalidate an entry if no update is received after 3-6 update periods.

Page 26: Lecture 9   network layer

Problem – Count to Infinity

A's Routing Table B's Routing Table

C

to costvia(next hop)

2B C

to costvia(next hop)

1C

now link B-C goes down

C 2 C oo

C oo-C 2B

C oo C 3

C 3AC oo-

C 4 C oo

C oo-C 4B

AA BB CC1 1

Page 27: Lecture 9   network layer

Count to Infinity

a) The reason for the count-to-infinity problem is that each node only has a “next-hop-view”

b) For example, in the first step, A did not realize that its route (with cost 2) to C went through node B

c) How can the Count-to-Infinity problem be solved?

Page 28: Lecture 9   network layer

Solution

a) Solution 1: Always advertise the entire path in an update message (Path vectors) If routing tables are large, the routing messages require substantial bandwidth . BGP uses this solution

b) Solution 2: Never advertise the cost to a neighbor if this neighbor is the next hop on the current path (Split Horizon)

– Example: A would not send the first routing update to B, since B is the next hop on A’s current route to C

– Split Horizon does not solve count-to-infinity in all cases!

Page 29: Lecture 9   network layer

Link State Routing - Concept

Page 30: Lecture 9   network layer

Link State Routing

Each router must do the following:

1. Discover its neighbors, learn their network address.

2. Measure the delay or cost to each of its neighbors.

3. Construct a packet telling all it has just learned.

4. Send this packet to all other routers.

5. Compute the shortest path to every other router.

Page 31: Lecture 9   network layer

Learning about the Neighbors

(a) Nine routers and a LAN. (b) A graph model of (a).

A router knows its network interfaces just sends a HELLO packet on each point-to-point link, and the router at the other end must reply telling who it is with its unique network address

Page 32: Lecture 9   network layer

Measuring Line Cost

• Simple, send an ECHO packet to the neighbor, measure the round-trip delay and divide it by two, and this will give a reasonable estimate of the actual delay

Page 33: Lecture 9   network layer

Building Link State Packets

(a) A subnet. (b) The link state packets for this subnet.

Page 34: Lecture 9   network layer

Distributing the Link State Packets

The packet buffer for router B in the previous slide (Fig. 5-13).

• Each router maintains list of (source, seq.number) pairs they saw. When a LSP arrives, it is checked against the list.• If it is new, it is forwarded on all lines except the one it arrived on; if it is a duplicate, it is discarded. • To safeguard against old data, link down etc., age is decremented once a second and every time it is forwarded by a router. When the age reaches zero, the LSP is discarded

Page 35: Lecture 9   network layer

Hierarchical Routing

Hierarchical routing.

Page 36: Lecture 9   network layer

Broadcast Routing

a) Sending a packet to every destinations simultaneously is called broadcasting, and various ways are:

b) Send an individual packet addressed to each destination, not really a good idea

c) Use flooding, provided that the flood can effectively be kept in check

d) Build a sink tree rooted at source, and use it in routing (This sink tree is also a spanning tree, as every nodes are on it) If this can be done, it is great but if not, how to do it approximately?

Page 37: Lecture 9   network layer

Million Dollar Questiona) What is the difference between flooding & broadcasting ?

Flooding refers to the specific multiplicative process of delivering the PDU. 

Broadcasting/multicasting refers to the process of originating these PDUs by their sender.

Page 38: Lecture 9   network layer

Broadcast Routing

Reverse path forwarding. (a) A subnet. (b) a Sink tree. (c) The tree built by reverse path forwarding.

Page 39: Lecture 9   network layer

Reverse Path Forwarding

a) Assume normally when router A forwards packet to router B, it uses outgoing link that lies on sink tree rooted at B. This algorithm is remarkably simple:

b) When a broadcast packet arrives, router checks to see if the packet arrived on the line that is normally used for sending packets to the source of broadcast. If so, there is an excellent chance that the best route was used and this is the first copy to arrive at the router.

c) The router then forwards the packet onto all lines except the one it arrived on. If, however, the broadcast packet arrived on a line other than the preferred one for reaching the source, the packet is discarded as a likely duplicate

Page 40: Lecture 9   network layer

a) For comparison (b) has source router I at the root of a sink tree.

b) All routers would normally send packets to the source router along the sink tree using the optimal path (e.g. I-B would follow I-F-D-C-B).

c) Using reverse path forwarding the path may differ from the sink tree, on receiving a broadcast packet from the source router on the usual channel, each router would forward packet on all channels except the one received under the assumption the receiving channel was optimal.

d) In this case was simply the reverse of the sink tree path normally used for sending to the packet source.

e) In diagram (c) H sends a packet to K but K expects to receive packets from M so the packet is discarded rather than forwarded.

f) The optimal case using the sink tree requires a maximum of 4 hops maximum (I-N-M-K-L) and 14 total packets.

g) Using reverse path forwarding requires a maximum of 5 hops (4 for I-N-M-K-L plus 1 to B) and 23 total packets with the extra, duplicate packets sent to the leaf nodes.

Page 41: Lecture 9   network layer

Multicast Routing

(a) A network. (b) A spanning tree for the leftmost router. (c) A multicast tree for group 1. (d) A multicast tree for group 2.

Page 42: Lecture 9   network layer

Routing for Mobile Hosts

A WAN to which LANs, MANs, and wireless cells are attached.

Page 43: Lecture 9   network layer

Routing for Mobile Hosts (2)

Packet routing for mobile users.

Page 44: Lecture 9   network layer

Routing in Ad Hoc Networks

Possibilities when the routers are mobile:

1. Military vehicles on battlefield.– No infrastructure.

2. A fleet of ships at sea.– All moving all the time

3. Emergency works at earthquake .– The infrastructure destroyed.

4. A gathering of people with notebook computers.– In an area lacking 802.11.

Page 45: Lecture 9   network layer

Route Discovery

a) (a) Range of A's broadcast.

b) (b) After B and D have received A's broadcast.

c) (c) After C, F, and G have received A's broadcast.

d) (d) After E, H, and I have received A's broadcast.

Shaded nodes are new recipients. Arrows show possible reverse routes.

Page 46: Lecture 9   network layer
Page 47: Lecture 9   network layer

Flow Vs. Congestion Control

Flow control: a network with a capacity of 1000 gigabits/sec on which a supercomputer is trying to transfer a file to a personal computer at 1Gbps. Although there is no congestion (the network itself is not in trouble), flow control is needed to force the supercomputer to stop frequently to give the personal computer a chance to breathe.

Congestion Control: At the other extreme, 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. Here the problem is not that of fast senders overpowering slow receivers, but simply that the total offered traffic exceeds what the network can handle.

Page 48: Lecture 9   network layer

Congestion Control

a) When one part of the subnet (e.g. one or more routers in an area) becomes overloaded, congestion results.

b) Because routers are receiving packets faster than they can forward them, one of two things must happen:

– The subnet must prevent additional packets from entering the congested region until those already present can be processed.

– The congested routers can discard queued packets to make room for those that are arriving.

c) Busty Traffic, Slow Processor, Insufficient Memory, Less Bandwidth

Page 49: Lecture 9   network layer

Congestion Control Algorithms

• General Principles of Congestion Control

• Congestion Prevention Policies

• Congestion Control in Virtual-Circuit Subnets

• Congestion Control in Datagram Subnets

• Load Shedding

• Jitter Control

Page 50: Lecture 9   network layer

Congestion

When too much traffic is offered, congestion sets in and performance degrades sharply.

Page 51: Lecture 9   network layer

General Principles of Congestion Control

1. Monitor the system .

– detect when and where congestion occurs.

2. Pass information to where action can be taken.

3. Adjust system operation to correct the problem.

Page 52: Lecture 9   network layer

Congestion Prevention Policies

Policies that affect congestion.

5-26

Page 53: Lecture 9   network layer

Solution

a) Congestion Control is concerned with efficiently using a network at high load.

b) Several techniques can be employed. These include:– Warning bit– Choke packets– Load shedding– Random early discard– Traffic shaping

c) The first 3 deal with congestion detection and recovery. The last 2 deal with congestion avoidance.

Page 54: Lecture 9   network layer

54

Warning Bit

a) A special bit in the packet header is set by the router to warn the source when congestion is detected.

b) The bit is copied and piggy-backed on the ACK and sent to the sender.

c) The sender monitors the number of ACK packets it receives with the warning bit set and adjusts its transmission rate accordingly.

Page 55: Lecture 9   network layer

Choke Packets

a) A more direct way of telling the source to slow down.b) A choke packet is a control packet generated at a

congested node and transmitted to restrict traffic flow.c) The source, on receiving the choke packet must reduce

its transmission rate by a certain percentage.d) An example of a choke packet is the ICMP Source

Quench Packet.

Page 56: Lecture 9   network layer

Hop-by-Hop Choke Packets

(a) A choke packet that affects only the source.

(b) A choke packet that affects each hop it passes through.

Page 57: Lecture 9   network layer

57

Hop-by-Hop Choke Packets

a) Over long distances or at high speeds choke packets are not very effective.

b) A more efficient method is to send to choke packets hop-by-hop.

c) This requires each hop to reduce its transmission even before the choke packet arrive at the source.

Page 58: Lecture 9   network layer

Load Shedding

a) When buffers become full, routers simply discard packets.

b) Which packet is chosen to be the victim depends on the application and on the error strategy used in the data link layer.

c) For a file transfer, for, e.g. cannot discard older packets since this will cause a gap in the received data.

d) For real-time voice or video it is probably better to throw away old data and keep new packets.

e) Get the application to mark packets with discard priority.

Page 59: Lecture 9   network layer

Random Early Discard (RED)

a) This is a proactive approach in which the router discards one or more packets before the buffer becomes completely full.

b) Each time a packet arrives, the RED algorithm computes the average queue length, avg.

c) If avg is lower than some lower threshold, congestion is assumed to be minimal or non-existent and the packet is queued.

d) If avg is greater than some upper threshold, congestion is assumed to be serious and the packet is discarded.

e) If avg is between the two thresholds, this might indicate the onset of congestion. The probability of congestion is then calculated.

Page 60: Lecture 9   network layer

Congestion Control in Virtual-Circuit Subnets

(a) A congested subnet. (b) A redrawn subnet, eliminates congestion and a virtual circuit from A to B.

Page 61: Lecture 9   network layer

Jitter Control

(a) High jitter. (b) Low jitter.

Page 62: Lecture 9   network layer

The IP Protocol

The IPv4 (Internet Protocol) header.

Page 63: Lecture 9   network layer

The IP Protocol (2)

Some of the IP options.

5-54

Page 64: Lecture 9   network layer

IP Addresses

IP address formats.

Page 65: Lecture 9   network layer

IP Addresses (2)

Special IP addresses.

Page 66: Lecture 9   network layer

Subnets

A campus network consisting of LANs for various departments.

Page 67: Lecture 9   network layer

Subnets (2)

A class B network subnetted into 64 subnets.

Page 68: Lecture 9   network layer

Review – Subnettinga) A network on the Internet has a subnet mask of 255.255.240.0.

What is the maximum number of hosts it can handle?

b) A network on the Internet has a subnet mask of 255.255.224.0. What is the maximum number of hosts it can handle?

Page 69: Lecture 9   network layer

Complex Problem

a) A large number of consecutive IP address are available starting at 198.16.0.0.

b) Suppose that four organizations, A, B, C, and D, request 4000, 2000, 4000, and 8000 addresses, respectively, and in that order.

c) For each of these, give:

– the first IP address assigned– the last IP address assigned– the mask in the w.x.y.z/s notation.

Page 70: Lecture 9   network layer

Solutiona) All the requests are rounded up to a power of two.

b) The starting address, ending address, and mask are as follows:

• A: 198.16.0.0 – 198.16.15.255 written as 198.16.0.0/20

• B: 198.16.16.0 – 198.16.23.255 written as 198.16.16.0/21

• C: 198.16.32.0 – 198.16.47.255 written as 198.16.32.0/20

• D: 198.16.64.0 – 198.16.96.255 written as 198.16.64.0/19

Page 71: Lecture 9   network layer

Explanation198.16.16.0 – 198.16.23.255 written as 198.16.16.0/21

Total no. of host we require 2000 that means 2000 / 256 = 8 block

198.16.00010 _3 bit host part_ . 8 bit host part (Total 11 Bit) (256)

Over here I can not use 1

because of A solution

00010001. (256)

00010010. (256)

00010011. (256)

00010100. (256)

00010101. (256)

00010110. (256)

00010111. (256)

16 + 4 +2 +1 = 23

Page 72: Lecture 9   network layer

Addresses with and without Subnetting

Page 73: Lecture 9   network layer

Masking

Page 74: Lecture 9   network layer

Quality of Service

• Requirements• Techniques for Achieving Good Quality of Service• Integrated Services• Differentiated Services• Label Switching and MPLS

Page 75: Lecture 9   network layer

Requirements

How stringent the quality-of-service requirements are.

5-30

Page 76: Lecture 9   network layer

Buffering

Smoothing the output stream by buffering packets.

Page 77: Lecture 9   network layer

The Leaky Bucket Algorithm

(a) A leaky bucket with water. (b) a leaky bucket with packets.

Page 78: Lecture 9   network layer

The Token Bucket Algorithm

(a) Before. (b) After.

5-34

Page 79: Lecture 9   network layer

The Leaky Bucket

Algorithm

(a) Input to a leaky bucket. (b) Output from a leaky bucket. Output from a token bucket with capacities of (c) 250 KB, (d) 500 KB, (e) 750 KB, (f) Output from a 500KB token bucket feeding a 10-MB/sec leaky bucket.

Page 80: Lecture 9   network layer

Token Bucket Examplea) Consider a token bucket with token arrival rate of ρ bytes/sec and a token credit

capacity of W bytes. The data rate is M bytes/sec. Let S be the duration of the maximum output burst rate from the full token-bucket.

(a) Carefully derive an expression for S.

(b) What is S if ρ = 16 Mbps and W = 500 KB and if a burst arrives over a channel with data rate 200 Mbps and lasts 40 msec?

b) Total amount of data in burst = MS. This corresponds to not only the token capacity of the bucket, W, but the extra tokens that arrive during the burst, ρS. Thus: W + ρS = MS, and hence S = W/(M - ρ).

c) S = 500x1024/(25x106 - 2x106 ) = 22.3 msec. There is a 25 MB/s output burst of 22.3 msec after the onset of the incoming burst of data.

Page 81: Lecture 9   network layer

Admission Control

An example of flow specification.

5-34

Page 82: Lecture 9   network layer

Packet Scheduling

(a) A router with five packets queued for line O.(b) Finishing times for the five packets.

Page 83: Lecture 9   network layer

RSVP-The ReSerVation Protocol

(a) A network, (b) The multicast spanning tree for host 1. (c) The multicast spanning tree for host 2.

Page 84: Lecture 9   network layer

RSVP-The ReSerVation Protocol (2)

(a) Host 3 requests a channel to host 1. (b) Host 3 then requests a second channel, to host 2. (c) Host 5 requests a channel to host 1.

Page 85: Lecture 9   network layer

Expedited Forwarding

Expedited packets experience a traffic-free network.

Page 86: Lecture 9   network layer

Assured Forwarding

A possible implementation of the data flow for assured forwarding.

Page 87: Lecture 9   network layer

Label Switching and MPLS

Transmitting a TCP segment using IP, MPLS, and PPP.

Page 88: Lecture 9   network layer

Internetworking

• How Networks Differ

• How Networks Can Be Connected

• Concatenated Virtual Circuits

• Connectionless Internetworking

• Tunneling

• Internetwork Routing

• Fragmentation

Page 89: Lecture 9   network layer

How Networks Differ

Some of the many ways networks can differ.

5-43

Page 90: Lecture 9   network layer

How Networks Can Be Connected

(a) Two Ethernets connected by a switch. (b) Two Ethernets connected by routers.

Page 91: Lecture 9   network layer

Concatenated Virtual Circuits

Internetworking using concatenated virtual circuits.

Page 92: Lecture 9   network layer

Connectionless Internetworking

A connectionless internet.

Page 93: Lecture 9   network layer

Tunneling

Tunneling a packet from Paris to London.

Page 94: Lecture 9   network layer

Fragmentation

(a) Transparent fragmentation. (b) Nontransparent fragmentation.

Page 95: Lecture 9   network layer

Fragmentation (2)

Fragmentation when the elementary data size is 1 byte.(a) Original packet, containing 10 data bytes.(b) Fragments after passing through a network with maximum

packet size of 8 payload bytes plus header.(c) Fragments after passing through a size 5 gateway.

Page 96: Lecture 9   network layer

The Network Layer in the Internet

• The IP Protocol

• IP Addresses

• Internet Control Protocols

• OSPF – The Interior Gateway Routing Protocol

• BGP – The Exterior Gateway Routing Protocol

• Mobile IP

• IPv6

Page 97: Lecture 9   network layer

Internet Control Message Protocol

The principal ICMP message types.

5-61

Page 98: Lecture 9   network layer

Address Resolution Protocol

Page 99: Lecture 9   network layer

Internet Structurea) Federated network of Autonomous Systems

– Routers and links controlled by a single entity– Routing between ASes, and within an AS

1

2

3

4

5

67

Web clientWeb server

Page 100: Lecture 9   network layer

Two-Tiered Internet Routing System

a) Inter-domain routing: between ASes

– Routing policies based on business relationships

– No common metrics, and limited cooperation

– BGP: policy-based, path-vector routing protocol

b) Intra-domain routing: within an AS

– Shortest-path routing based on link metrics

– Routers all managed by a single institution

– OSPF and IS-IS: link-state routing protocol

– RIP and EIGRP: distance-vector routing protocol

Page 101: Lecture 9   network layer

Autonomous Systems (AS)

Ethernet

Router

Ethernet

Ethernet

RouterRouter

Ethernet

Ethernet

EthernetRouterRouter

Router

AutonomousSystem 2

AutonomousSystem 1

Page 102: Lecture 9   network layer

OSPF (1)

The relation between ASes, backbones, and areas in OSPF.

Page 103: Lecture 9   network layer

OSPF (2)

The five types of OSPF messeges.

5-66

Page 104: Lecture 9   network layer

BGP – The Exterior Gateway Routing Protocol

(a) A set of BGP routers. (b) Information sent to F.

Page 105: Lecture 9   network layer

Mobile IP

a) Mobile node moves to new location

b) Agent Advertisement by foreign agent

c) Registration of mobile node with home agent

d) Proxy by home agent for mobile node

e) Encapsulation of packets

f) Tunneling by home agent to mobile node via foreign agent

Page 106: Lecture 9   network layer
Page 107: Lecture 9   network layer

Description IPv6

a) The 20-bit Flow Label field in the IPv6 header may be used by a source to label sequences of packets for which it requests special handling by the IPv6 routers, such as non-default quality of service or "real-time" service. Hosts or routers that do not support the functions of the Flow Label field are required to set the field to zero when originating a packet, pass the field on unchanged when forwarding a packet, and ignore the field when receiving a packet.

a) The 8-bit Traffic Class field in the IPv6 header is available for use by originating nodes and/or forwarding routers to identify and distinguish between different classes or priorities of IPv6 packets.

Page 108: Lecture 9   network layer

Extension Headers

IPv6 extension headers.

5-69

Page 109: Lecture 9   network layer