network layer -routing

83
NETWORK LAYER: DELIVERY, FORWARDING, AND ROUTING Sujata Pathak, KJSCE

Upload: rohan-bhattad

Post on 01-Feb-2016

15 views

Category:

Documents


0 download

DESCRIPTION

learn about the routing in the network layer

TRANSCRIPT

Page 1: Network Layer -Routing

NETWORK LAYER: DELIVERY, FORWARDING, AND ROUTING

Sujata Pathak, KJSCE

Page 2: Network Layer -Routing

DELIVERY

The network layer supervises the handling of the

packets by the underlying physical networks. We define

this handling as the delivery of a packet.

Direct Versus Indirect Delivery

Topics discussed in this section:

Page 3: Network Layer -Routing

Figure Direct and indirect delivery

Page 4: Network Layer -Routing

FORWARDING

Forwarding means to place the packet in its route to its

destination. Forwarding requires a host or a router to

have a routing table. When a host has a packet to send

or when a router has received a packet to be forwarded,

it looks at this table to find the route to the final

destination.

Forwarding Techniques

Forwarding Process

Routing Table

Topics discussed in this section:

Page 5: Network Layer -Routing

Figure Route method versus next-hop method

Page 6: Network Layer -Routing

Figure Host-specific versus network-specific method

Page 7: Network Layer -Routing

Figure Default method

Page 8: Network Layer -Routing

Figure Simplified forwarding module in classless address

Page 9: Network Layer -Routing

In classless addressing, we need at least four columns in a routing table.

Note

Page 10: Network Layer -Routing

Make a routing table for router R1, using the configuration

in Figure 22.6.

Example 22.1

Solution

Table 22.1 shows the corresponding table.

Page 11: Network Layer -Routing

Figure 22.6 Configuration for Example 22.1

Page 12: Network Layer -Routing

Table 22.1 Routing table for router R1 in Figure 22.6

Page 13: Network Layer -Routing

Show the forwarding process if a packet arrives at R1 in

Figure 22.6 with the destination address 180.70.65.140.

Example 22.2

Solution

The router performs the following steps:

1. The first mask (/26) is applied to the destination address.

The result is 180.70.65.128, which does not match the

corresponding network address.

2. The second mask (/25) is applied to the destination

address. The result is 180.70.65.128, which matches the

corresponding network address. The next-hop address

and the interface number m0 are passed to ARP for

further processing.

Page 14: Network Layer -Routing

Show the forwarding process if a packet arrives at R1 in

Figure 22.6 with the destination address 201.4.22.35.

Example 22.3

Solution

The router performs the following steps:

1. The first mask (/26) is applied to the destination

address. The result is 201.4.22.0, which does not

match the corresponding network address.

2. The second mask (/25) is applied to the destination

address. The result is 201.4.22.0, which does not match

the corresponding network address (row 2).

Page 15: Network Layer -Routing

Example 22.3 (continued)

3. The third mask (/24) is applied to the destination

address. The result is 201.4.22.0, which matches the

corresponding network address. The destination

address of the packet and the interface number m3 are

passed to ARP.

Page 16: Network Layer -Routing

Show the forwarding process if a packet arrives at R1 in

Figure 22.6 with the destination address 18.24.32.78.

Example 22.4

Solution

This time all masks are applied, one by one, to the

destination address, but no matching network address is

found. When it reaches the end of the table, the module

gives the next-hop address 180.70.65.200 and interface

number m2 to ARP. This is probably an outgoing package

that needs to be sent, via the default router, to someplace

else in the Internet.

Page 17: Network Layer -Routing

Figure 22.7 Address aggregation

Page 18: Network Layer -Routing

Figure 22.8 Longest mask matching

Page 19: Network Layer -Routing

As an example of hierarchical routing, let us consider

Figure 22.9. A regional ISP is granted 16,384 addresses

starting from 120.14.64.0. The regional ISP has decided to

divide this block into four subblocks, each with 4096

addresses. Three of these subblocks are assigned to three

local ISPs; the second subblock is reserved for future use.

Note that the mask for each block is /20 because the

original block with mask /18 is divided into 4 blocks.

Example 22.5

The first local ISP has divided its assigned subblock into 8

smaller blocks and assigned each to a small ISP. Each

small ISP provides services to 128 households, each using

four addresses.

Page 20: Network Layer -Routing

The second local ISP has divided its block into 4 blocks

and has assigned the addresses to four large organizations.

Example 22.5 (continued)

There is a sense of hierarchy in this configuration. All

routers in the Internet send a packet with destination

address 120.14.64.0 to 120.14.127.255 to the regional ISP.

The third local ISP has divided its block into 16 blocks and

assigned each block to a small organization. Each small

organization has 256 addresses, and the mask is /24.

Page 21: Network Layer -Routing

HIERARCHICAL ROUTING

Page 22: Network Layer -Routing

Hierarchical Routing

• Addresses the growth of routing tables

• Routers are divided into regions

• Routers know the routes for their own regions only

• Works like telephone routing

• Possible hierarchy – city, state, country, continent

• Optimal number of levels for an N router subnet is lnN

Page 23: Network Layer -Routing

Hierarchical Routing

Page 24: Network Layer -Routing

Figure Hierarchical routing with ISPs

Page 25: Network Layer -Routing

Figure Common fields in a routing table

Page 26: Network Layer -Routing

One utility that can be used to find the contents of a routing

table for a host or router is netstat in UNIX or LINUX. The

next slide shows the list of the contents of a default server.

We have used two options, r and n. The option r indicates

that we are interested in the routing table, and the option n

indicates that we are looking for numeric addresses. Note

that this is a routing table for a host, not a router. Although

we discussed the routing table for a router throughout the

chapter, a host also needs a routing table.

Example 22.6

Page 27: Network Layer -Routing

Example 22.6 (continued)

The destination column here defines the network address.

The term gateway used by UNIX is synonymous with router.

This column actually defines the address of the next hop. The

value 0.0.0.0 shows that the delivery is direct. The last entry

has a flag of G, which means that the destination can be

reached through a router (default router). The Iface defines

the interface.

Page 28: Network Layer -Routing

Example 22.6 (continued)

More information about the IP address and physical address

of the server can be found by using the ifconfig command on

the given interface (eth0).

Page 29: Network Layer -Routing

Figure Configuration of the server for Example 22.6

Page 30: Network Layer -Routing

UNICAST ROUTING PROTOCOLS

A routing table can be either static or dynamic. A static

table is one with manual entries. A dynamic table is one

that is updated automatically when there is a change

somewhere in the Internet. A routing protocol is a

combination of rules and procedures that lets routers in

the Internet inform each other of changes.

Optimization

Intra- and Interdomain Routing

Distance Vector Routing and RIP

Link State Routing and OSPF

Path Vector Routing and BGP

Topics discussed in this section:

Page 31: Network Layer -Routing

Figure Autonomous systems

Page 32: Network Layer -Routing

Figure Popular routing protocols

Page 33: Network Layer -Routing

Distance Vector Routing Bellman Ford Algorithm

Page 34: Network Layer -Routing

Distance Vector Algorithm [Bellman Ford ]

1. A router transmits its distance vector to each of its neighbors in a routing packet.

2. Each router receives and saves the most recently received distance vector from each of its neighbors.

3. A router recalculates its distance vector when: a. It receives a distance vector from a neighbor containing

different information than before. b. It discovers that a link to a neighbor has gone down (i.e., a

topology change).

The DV calculation is based on minimizing the cost to each destination.

Page 35: Network Layer -Routing

Distance Vector Routing

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

Page 36: Network Layer -Routing

Figure Distance vector routing tables

Page 37: Network Layer -Routing

Figure Initialization of tables in distance vector routing

Page 38: Network Layer -Routing

In distance vector routing, each node shares its routing table with its immediate neighbors periodically and when there is a change.

Note

Page 39: Network Layer -Routing

Figure Updating in distance vector routing

Page 40: Network Layer -Routing

Figure Two-node instability

Page 41: Network Layer -Routing

Figure Three-node instability

Page 42: Network Layer -Routing

Figure Example of a domain using RIP

Page 43: Network Layer -Routing

Link State Routing

Page 44: Network Layer -Routing

Figure Types of links

Page 45: Network Layer -Routing

Figure Point-to-point link

Page 46: Network Layer -Routing

Figure Transient link

Page 47: Network Layer -Routing

Figure Stub link

Page 48: Network Layer -Routing

Figure Example of an AS and its graphical representation in OSPF

Page 49: Network Layer -Routing

Link State Algorithm 1. Each router is responsible for meeting its neighbors

and learning their names.

2. Each router constructs a link state packet (LSP) which consists of a list of names and cost to reach each of its neighbors.

3. The LSP is transmitted to ALL other routers. Each router stores the most recently generated LSP from each other router.

4. Each router uses complete information on the network topology to compute the shortest path route to each destination node.

Page 50: Network Layer -Routing

• Five Steps

1.) Discover your neighbors and learn their addresses.

2.) Measure the cost (delay) to each neighbor.

3.) Construct a packet containing all this information

4.) Send this packet to all other routers.

5.) Compute the shortest path to every other router.

Link State Routing (an adaptive routing algorithm)

Page 51: Network Layer -Routing

1.) Discovering Your Neighbors

• Send “Hello” packet on each point-to-point line. Destination node replies with its address.

Page 52: Network Layer -Routing

Learning about the Neighbors (1)

Nine routers and a broadcast LAN.

Page 53: Network Layer -Routing

Learning about the Neighbors (2)

A graph model of previous slide.

Page 54: Network Layer -Routing

2.) Measuring Line Cost

• Send an “ECHO” packet over the line.

• Destination is required to respond to “ECHO” packet immediately.

• Measure the time required for this operation.

• Question: Should we measure just the time it takes to transmit the packet, or should we include the time that the packet waits in the queue?

Page 55: Network Layer -Routing

Build Link State Packets

Page 56: Network Layer -Routing

Distributing the Link State Packets

• Use selective flooding

• Sequence numbers prevent duplicate packets from being propagated

• Lower sequence numbers are rejected as obsolete

Page 57: Network Layer -Routing

Computing the New Routes

• Dijkstra’s Shortest Path algorithm is used to determine the shortest path to each destination.

Page 58: Network Layer -Routing

Figure Concept of link state routing

Page 59: Network Layer -Routing

Figure 22.21 Link state knowledge

Page 60: Network Layer -Routing

DIJKSTRA’S ALGORITHM

Page 61: Network Layer -Routing

Figure Dijkstra algorithm

Page 62: Network Layer -Routing

Figure Example of formation of shortest path tree

Page 63: Network Layer -Routing

Table Routing table for node A

Page 64: Network Layer -Routing

Figure Initial routing tables in path vector routing

Page 65: Network Layer -Routing

Figure 22.31 Stabilized tables for three autonomous systems

Page 66: Network Layer -Routing

Figure 22.32 Internal and external BGP sessions

Page 67: Network Layer -Routing

Flooding

Page 68: Network Layer -Routing

• 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

• Selective Flooding – Flood only in the direction of the destination

• Practical in a few settings – Military Applications

– Distributed Databases

– Metric for comparison

Flooding (a nonadaptive routing algorithm)

Page 69: Network Layer -Routing

Congestion Control Algorithms (1)

• Approaches to congestion control

• Traffic-aware routing

• Admission control

• Traffic throttling

• Load shedding

Page 70: Network Layer -Routing

Congestion Control Algorithms (2)

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

Page 71: Network Layer -Routing

Approaches to Congestion Control

Timescales of approaches to congestion control

Page 72: Network Layer -Routing

Load Shedding (1)

A choke packet that affects only the source..

Page 73: Network Layer -Routing

Load Shedding (2)

A choke packet that affects each hop it passes through.

Page 74: Network Layer -Routing

Quality of Service

• Application requirements

• Traffic shaping

• Packet scheduling

• Admission control

• Integrated services

• Differentiated services

Page 75: Network Layer -Routing

Application Requirements (1)

How stringent the quality-of-service requirements are.

Page 76: Network Layer -Routing

Categories of QoS and Examples

1.Constant bit rate

• Telephony

2.Real-time variable bit rate

• Compressed videoconferencing

3.Non-real-time variable bit rate

• Watching a movie on demand

4.Available bit rate

• File transfer

Page 77: Network Layer -Routing

Traffic Shaping (1)

(a) Shaping packets. (b) A leaky bucket. (c) A token bucket

Page 78: Network Layer -Routing

Traffic Shaping (2)

(a) Traffic from a host. Output shaped by a token bucket of rate 200 Mbps and capacity (b) 9600 KB, (c) 0 KB.

Page 79: Network Layer -Routing

Traffic Shaping (3)

Token bucket level for shaping with rate 200 Mbps and capacity (d) 16000 KB, (e) 9600 KB, and (f) 0KB..

Page 80: Network Layer -Routing

Packet Scheduling (1)

Kinds of resources can potentially be

reserved for different flows:

1. Bandwidth.

2. Buffer space.

3. CPU cycles.

Page 81: Network Layer -Routing

Packet Scheduling (2)

Round-robin Fair Queuing

Page 82: Network Layer -Routing

Packet Scheduling (3)

(a)Weighted Fair Queueing.

(b)Finishing times for the packets.

Page 83: Network Layer -Routing

References

• A. S. Tanenbaum,”Computer Networks”, 4th edition, Prentice Hall

• B. F. Forouzan,”Data and Computer Communication”, Tata McGraw Hill.