connecting networks © prof. aiman hanna department of computer science concordia university...

58
Connecting Networks Connecting Networks © Prof. Aiman Hanna © Prof. Aiman Hanna Department of Computer Science Department of Computer Science Concordia University Concordia University Montreal, Canada Montreal, Canada

Upload: kylan-prime

Post on 14-Dec-2015

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

Connecting NetworksConnecting Networks

© Prof. Aiman Hanna© Prof. Aiman HannaDepartment of Computer Science Department of Computer Science

Concordia University Concordia University Montreal, CanadaMontreal, Canada

Page 2: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

22

CC onnecting Networks onnecting Networks The larger the number of devices in a single LAN, the The larger the number of devices in a single LAN, the

higher the chances that the LAN performance degrades higher the chances that the LAN performance degrades

One possible solution is to separate devices into One possible solution is to separate devices into multiple LANsmultiple LANs

Yet, these devices must still be able to communicateYet, these devices must still be able to communicate

Consequently, new protocols must be developed to Consequently, new protocols must be developed to cross over LAN boundaries cross over LAN boundaries

Page 3: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

33

CC onnecting Networksonnecting Networks

Figure 10.1 – Interconnecting Networks

Page 4: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

44

CC onnecting Networksonnecting Networks

Figure 10.2 – OSI Connections

Page 5: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

55

CC onnecting Networks onnecting Networks Protocol convertersProtocol converters are used to connect different are used to connect different

networksnetworks

The most common protocol converters exist at layers 1, The most common protocol converters exist at layers 1, 2 & 32 & 3

At layer 1: At layer 1: hubshubs, , repeatersrepeaters At layer 2: At layer 2: bridgesbridges, , switchesswitches, …, … At layer 3: At layer 3: routersrouters

Page 6: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

66

LL ayer 1 Connections ayer 1 Connections RepeatersRepeaters Operate at the physical layer (layer 1) Operate at the physical layer (layer 1)

Connect LANs that are using the same protocol and Connect LANs that are using the same protocol and frame formatframe format

Main function is to just regenerate signals then send Main function is to just regenerate signals then send them again, hence extend the distance covered by a them again, hence extend the distance covered by a LAN protocol LAN protocol

Page 7: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

77

LL ayer 1 Connections ayer 1 Connections RepeatersRepeaters

Figure 10.3 – LANs Connected with a Repeater

Page 8: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

88

LL ayer 1 Connections ayer 1 Connections HubsHubs Sometimes called multi-port repeaters Sometimes called multi-port repeaters

The main difference between a hub and repeater is that The main difference between a hub and repeater is that a hub has multiple ports, hence many devices can a hub has multiple ports, hence many devices can directly be connected to it directly be connected to it

All devices connected to a hub are still in the same All devices connected to a hub are still in the same collision domain collision domain

The more the devices connected to hubs, the more the The more the devices connected to hubs, the more the chances that the network performance will degrade chances that the network performance will degrade

Page 9: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

99

LL ayer 1 Connections ayer 1 Connections HubsHubs

Figure 10.4 – Making Connections Using Hubs

Page 10: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

1010

LL ayer 2 Connections ayer 2 Connections Bridges Bridges A bridge connects two LANs A bridge connects two LANs

Operate at layer 2; so they are capable of:Operate at layer 2; so they are capable of:• Making decision about when to forward any frame they Making decision about when to forward any frame they

received received

• Performing data link function such as error detection, frame Performing data link function such as error detection, frame formatting, frame routing, …etc.formatting, frame routing, …etc.

A bridge examines an incoming frame and route it to A bridge examines an incoming frame and route it to its LAN only if it is destined to a device in that LANits LAN only if it is destined to a device in that LAN

Page 11: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

1111

LL ayer 1 Connections ayer 1 Connections BridgesBridges

Figure 10.5 – LANs Connected with a Bridge

Page 12: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

1212

LL ayer 2 Connections ayer 2 Connections Bridging different types of LANs Bridging different types of LANs A bridge may connects two LANs of different typesA bridge may connects two LANs of different types

This is more difficult however since many issues must This is more difficult however since many issues must be considered:be considered:• What if the two LANs operate on different speedWhat if the two LANs operate on different speed

• How about bridges delay; will they cost any further problemsHow about bridges delay; will they cost any further problems

• What if the frame formats of the two network are different What if the frame formats of the two network are different

Page 13: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

1313

LL ayer 2 Connections ayer 2 Connections Bridges - RoutingBridges - Routing How would a bridge know that a specific device in its LANHow would a bridge know that a specific device in its LAN

Worst, what if the device is not in the bridge's LAN but the Worst, what if the device is not in the bridge's LAN but the frame must be passed by the bridge to another in order to deliver frame must be passed by the bridge to another in order to deliver the frame the frame

What if a device is initially served (either directly or indirectly) What if a device is initially served (either directly or indirectly) by a bridge but then the device is moved by a bridge but then the device is moved

The process of deciding which frames to accept/forward and The process of deciding which frames to accept/forward and where to forward them is called where to forward them is called bridge routingbridge routing

Page 14: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

1414

LL ayer 2 Connections ayer 2 Connections Bridges – Routing TablesBridges – Routing Tables Routing decision are made based on a Routing decision are made based on a routing tablerouting table Each bridge has a routing table for each LAN it connects toEach bridge has a routing table for each LAN it connects to

Figure 10.6 – Routing Tables for

Bridges in Figure 10.5

Page 15: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

1515

LL ayer 2 Connections ayer 2 Connections Bridges – Routing TablesBridges – Routing Tables How does a bridge defines it routing table? How does a bridge defines it routing table?

Fixed routingFixed routing: program the bridge with each device address and the LAN to : program the bridge with each device address and the LAN to which a frame forward to that device should be forwarded to which a frame forward to that device should be forwarded to

Fixed routing however is not that feasible in reality since changes are always Fixed routing however is not that feasible in reality since changes are always possible (remove device, add device, ..etc) possible (remove device, add device, ..etc)

To accommodate more dynamic environment either:To accommodate more dynamic environment either:• Keep in changing the routing table whenever a change is done, orKeep in changing the routing table whenever a change is done, or

• Determine some way for the bridges to update their routing tables automatically Determine some way for the bridges to update their routing tables automatically

The first alternative is not that viable in a more dynamic environment The first alternative is not that viable in a more dynamic environment Bridges that are capable of creating and updating their routing tables Bridges that are capable of creating and updating their routing tables

automatically are referred to as automatically are referred to as transparent bridgestransparent bridges

Page 16: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

1616

LL ayer 2 Connections ayer 2 Connections Bridges - Transparent BridgesBridges - Transparent Bridges Bridge that are capable of creating and updating their routing Bridge that are capable of creating and updating their routing

tables tables

Once plugged, they can immediately work regardless of the Once plugged, they can immediately work regardless of the topology or device locationstopology or device locations

Determine location of devices automatically then create/update Determine location of devices automatically then create/update the routing tables the routing tables

If devices move, the tables are also automatically updated (by If devices move, the tables are also automatically updated (by the bridges) the bridges)

The capability to update routing tables automatically is referred The capability to update routing tables automatically is referred to as to as route learningroute learning or or address learning address learning

Page 17: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

1717

LL ayer 2 Connections ayer 2 Connections Bridges – Route Learning Bridges – Route Learning Bridge creates routing table by observing traffic Bridge creates routing table by observing traffic

When a frame is received, the bridge can know two things: When a frame is received, the bridge can know two things: • Address of device Address of device

• The LAN from which the frame came fromThe LAN from which the frame came from

The bridge then examines its routing table to confirm that this The bridge then examines its routing table to confirm that this information matches the table entries for that deviceinformation matches the table entries for that device

If not, the bridge updates the routing table to match the latest If not, the bridge updates the routing table to match the latest configuration configuration

Page 18: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

1818

LL ayer 2 Connections ayer 2 Connections Bridges – Route Learning Bridges – Route Learning Example:Example: Device D moved from L4 to L1Device D moved from L4 to L1

Figure 10.6 – OLD Routing Table of B1 before moving D

from L4 to L1

Modified version of Figure 10.5 D moved from L4 to L1

Page 19: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

1919

LL ayer 2 Connections ayer 2 Connections Bridges – Route Learning Bridges – Route Learning

Example (continues…):Example (continues…):

After moving, device D sent a frame to EAfter moving, device D sent a frame to E

Table 10.1 – Updated Routing Table for B1 in Figure 10.5

Page 20: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

2020

LL ayer 2 Connections ayer 2 Connections Bridges – Route Learning Bridges – Route Learning

Questions:Questions: What if D never sent a frame?What if D never sent a frame?What about tables for L3 & L4; there are not updated!What about tables for L3 & L4; there are not updated!

Another question:Another question: What happens at startup when all tables are What happens at startup when all tables are empty? empty?

Page 21: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

2121

LL ayer 2 Connections ayer 2 Connections Bridges – Route Learning Bridges – Route Learning Each bridge maintains a timer; once this timer expires, Each bridge maintains a timer; once this timer expires,

it purges its routing tableit purges its routing table

This action makes the devices inaccessible This action makes the devices inaccessible

However, once a bridge receives a frame for a device However, once a bridge receives a frame for a device that has no entry in the routing table, it uses a that has no entry in the routing table, it uses a flooding flooding algorithmalgorithm

The bridge sends the frame to every LAN in which it is The bridge sends the frame to every LAN in which it is connected, except the LAN where the frame came fromconnected, except the LAN where the frame came from

Page 22: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

2222

LL ayer 2 Connections ayer 2 Connections Bridges – Frame Propagation Bridges – Frame Propagation Depending on the topology used, route learning may misbehave Depending on the topology used, route learning may misbehave

Figure 10.7 – Two Bridges Connecting Two LANs

Page 23: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

2323

LL ayer 2 Connections ayer 2 Connections Bridges – Frame Propagation Bridges – Frame Propagation Other topologies with no multiple bridges in between may also cause frame Other topologies with no multiple bridges in between may also cause frame

propagation problems propagation problems

Figure 10.8 – Multiple LANs with Loops

Page 24: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

2424

LL ayer 2 Connections ayer 2 Connections Bridges – Spanning Tree AlgorithmBridges – Spanning Tree Algorithm One solution to the frame propagation problem is to eliminate One solution to the frame propagation problem is to eliminate

loopsloops

Keep the bridges connected but prevent them from forwarding Keep the bridges connected but prevent them from forwarding framesframes

The bridges are still connected just in case they are needed as The bridges are still connected just in case they are needed as backup if the functional bridge fails backup if the functional bridge fails

To achieve needed transparency, the bridges must be capable of To achieve needed transparency, the bridges must be capable of automatically determining which ones are used for backup and automatically determining which ones are used for backup and which ones should connect when failure occurswhich ones should connect when failure occurs

To achieve that, bridges can execute a spanning tree algorithm To achieve that, bridges can execute a spanning tree algorithm

Page 25: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

2525

LL ayer 2 Connections ayer 2 Connections Bridges – Spanning Tree Algorithm Bridges – Spanning Tree Algorithm For the algorithm to work, a cost is associated with each Bridge-to-LAN portFor the algorithm to work, a cost is associated with each Bridge-to-LAN port

Figure 10.8 – Multiple LANs with Loops

Page 26: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

2626

LL ayer 2 Connections ayer 2 Connections Bridges – Spanning Tree Algorithm Bridges – Spanning Tree Algorithm Graphically represent the topology Graphically represent the topology

Figure 10.9 – Graph Representation of the LAN in Figure 10.8

Page 27: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

2727

LL ayer 2 Connections ayer 2 Connections Bridges – Spanning Tree Algorithm Bridges – Spanning Tree Algorithm Determine the Determine the root bridgeroot bridge and the and the root portroot port (that is the port corresponding (that is the port corresponding

to the cheapest path to the root bridge to the cheapest path to the root bridge

Figure 10.10 – Graph After Determining Root Ports

Page 28: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

2828

LL ayer 2 Connections ayer 2 Connections Bridges – Spanning Tree Algorithm Bridges – Spanning Tree Algorithm Determine the Determine the designated bridgedesignated bridge for each LAN; communication to that LAN goes through this for each LAN; communication to that LAN goes through this

bridge bridge Since only one bridge is selected as the designated bridge for any LAN, loops are eliminated Since only one bridge is selected as the designated bridge for any LAN, loops are eliminated

Figure 10.11 – Graph After Determining Designated Bridges

Page 29: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

2929

LL ayer 2 Connections ayer 2 Connections Bridges – Spanning Tree Algorithm Bridges – Spanning Tree Algorithm Once designated bridges are determined, they become the active bridges in the networkOnce designated bridges are determined, they become the active bridges in the network Other bridges are still connected but can only send/receive PDUs; they cannot forward framesOther bridges are still connected but can only send/receive PDUs; they cannot forward frames

Figure 10.12 – Network Topology Showing Active Bridge Connections

Page 30: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

3030

LL ayer 2 Connections ayer 2 Connections Bridges – Spanning Tree Algorithm Bridges – Spanning Tree Algorithm Each bridge maintains a timer, called a Each bridge maintains a timer, called a message age timer message age timer

Before that timer expires, the bridge must hear from the root bridge; the root Before that timer expires, the bridge must hear from the root bridge; the root bridge send periodic BPDUs for that bridge send periodic BPDUs for that

If the timer expires without getting any messages from the root, then this is If the timer expires without getting any messages from the root, then this is flagged as a root failure, and the process is initiated againflagged as a root failure, and the process is initiated again

Configuration BPDUs are also sent to indicate that the designated bridge is Configuration BPDUs are also sent to indicate that the designated bridge is still alive; if these BPDUs are not received, the affected bridges reinitiates still alive; if these BPDUs are not received, the affected bridges reinitiates the designated bridge selection process the designated bridge selection process

In either case, the bridges reconfigure the active topology dynamically In either case, the bridges reconfigure the active topology dynamically

Page 31: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

3131

LL ayer 2 Connections ayer 2 Connections Switches & Switched Ethernet Switches & Switched Ethernet Switches are similar to bridges, with one primary differenceSwitches are similar to bridges, with one primary difference

While a bridge can connect two LANs, a switch can connect multiple LANs While a bridge can connect two LANs, a switch can connect multiple LANs through portsthrough ports

Figure 10.13 – Connections Using Hubs & Switches

Page 32: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

3232

LL ayer 2 Connections ayer 2 Connections Switches & Switched Ethernet Switches & Switched Ethernet Although there may be many collision domains, a Although there may be many collision domains, a

single single broadcast domainbroadcast domain can be defined can be defined

The destination MAC address in an Ethernet frame can The destination MAC address in an Ethernet frame can specify either a device address or a broadcast addressspecify either a device address or a broadcast address

A broadcast frame is forwarded over all ports and A broadcast frame is forwarded over all ports and accepted by all devices accepted by all devices

Effectively, collision is now possible in a topology that Effectively, collision is now possible in a topology that uses hubs and switches (as in figure 10.13)uses hubs and switches (as in figure 10.13)

Page 33: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

3333

LL ayer 2 Connections ayer 2 Connections Switches & Switched Ethernet Switches & Switched Ethernet

A fully A fully Switched EthernetSwitched Ethernet topology solves this collision problem topology solves this collision problem

With Switched Ethernet, all hubs are replaced by switches With Switched Ethernet, all hubs are replaced by switches

Because switch ports lead to different collision domains, and each device is Because switch ports lead to different collision domains, and each device is connected to a separate port, there is no more collision anywhereconnected to a separate port, there is no more collision anywhere

Furthermore, if connection between the device and the switch operate in full-Furthermore, if connection between the device and the switch operate in full-duplex mode, there is no more need for CSMA/CDduplex mode, there is no more need for CSMA/CD

Each device is still capable of communicating with any other device, Each device is still capable of communicating with any other device, broadcast domain is also still there; there is just no more collision problems broadcast domain is also still there; there is just no more collision problems

Page 34: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

3434

LL ayer 2 Connections ayer 2 Connections Switches & Switched Ethernet Switches & Switched Ethernet Another advantage of Switched Ethernet is that the bit rate for ports can vary Another advantage of Switched Ethernet is that the bit rate for ports can vary

Figure 10.14 – Connections Using Only Switches

Page 35: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

3535

LL ayer 2 Connections ayer 2 Connections Switches & Switched Ethernet Switches & Switched Ethernet Multiple layers of switches are also possible Multiple layers of switches are also possible

Figure 10.15 – Private, Workgroup & Backbone Switches

Page 36: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

3636

LL ayer 3 Connections ayer 3 Connections LANs, as well as layer 1 & 2 connections, typically cover small geographic areas and LANs, as well as layer 1 & 2 connections, typically cover small geographic areas and

work over a simple topology, Bus, Ring, .. work over a simple topology, Bus, Ring, ..

On the other hand On the other hand Wide Area NetworksWide Area Networks, , WANsWANs, span the globe, span the globe

WANs however work over a more generalized topologies and require more WANs however work over a more generalized topologies and require more sophisticated techniques to perform what they are expected tosophisticated techniques to perform what they are expected to

Figure 10.18 – Generalized Network Topology

Page 37: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

3737

LL ayer 3 Connections ayer 3 Connections Routing Tables Routing Tables Similar to the ones that bridges/switches use, however these table do not Similar to the ones that bridges/switches use, however these table do not

normally specify the entire routenormally specify the entire route

Rather, they specify the next node in a route to a specified destination and Rather, they specify the next node in a route to a specified destination and the cost to get therethe cost to get there

Figure 10.19 –Network & Associated Connection Costs

Page 38: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

3838

LL ayer 3 Connections ayer 3 Connections Routing TablesRouting Tables

Figure 10.20 – Partial Routing Tables for A, B & E

Page 39: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

3939

LL ayer 3 Connections ayer 3 Connections Routing Tables Routing Tables Who defines the routing tables & how?Who defines the routing tables & how?

The process that defines the routing tables is called The process that defines the routing tables is called routing algorithmrouting algorithm

Four such algorithms are:Four such algorithms are:• Centralized RoutingCentralized Routing

• Distributed Routing Distributed Routing

• Static RoutingStatic Routing

• Adaptive Routing Adaptive Routing

Page 40: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

4040

LL ayer 3 Connections ayer 3 Connections Centralized RoutingCentralized Routing All interconnection information is generated and All interconnection information is generated and

maintained at a single central station maintained at a single central station

That station then broadcasts this information to all That station then broadcasts this information to all network nodes, so they can define their own routing network nodes, so they can define their own routing tables tables

One way to maintain the central information is through One way to maintain the central information is through routing matrixrouting matrix

Page 41: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

4141

LL ayer 3 Connections ayer 3 Connections Centralized RoutingCentralized Routing

Figure 10.21 – Routing Matrix for the Network in Figure 10.19

Page 42: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

4242

LL ayer 3 Connections ayer 3 Connections Distributed RoutingDistributed Routing No central control; each node must determine and maintain No central control; each node must determine and maintain

routing information independently routing information independently

This can be achieved by knowing the neighbors, cost to get to a This can be achieved by knowing the neighbors, cost to get to a neighbor and the cost from that neighbor to a destination neighbor and the cost from that neighbor to a destination

More complex than centralized since each node must More complex than centralized since each node must communicate with each of its neighbors instead of just one communicate with each of its neighbors instead of just one central station central station

The complexity is driven also by the fact that the devices have a The complexity is driven also by the fact that the devices have a very limited knowledge of the entire network very limited knowledge of the entire network

Page 43: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

4343

LL ayer 3 Connections ayer 3 Connections Static RoutingStatic Routing Once the node determines the routing table, it does not Once the node determines the routing table, it does not

change it change it

In other words, the initial cheapest path may not really In other words, the initial cheapest path may not really be the cheapest path after sometime, yet it is always be the cheapest path after sometime, yet it is always considered as the cheapest pathconsidered as the cheapest path

The assumption here is that the conditions that led to The assumption here is that the conditions that led to the initial definition of the tables do not changethe initial definition of the tables do not change

Sometimes, this is a reasonable assumption, when? Sometimes, this is a reasonable assumption, when?

Page 44: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

4444

LL ayer 3 Connections ayer 3 Connections Adaptive RoutingAdaptive Routing Allows the network to respond to changes and update Allows the network to respond to changes and update

its routing tables accordingly its routing tables accordingly

If the cost of the route to be used changed, then adapt If the cost of the route to be used changed, then adapt and use another routeand use another route

Could this lead to serious problems sometime?Could this lead to serious problems sometime?

In general, it is difficult to implement adaptive routing In general, it is difficult to implement adaptive routing efficiently, why? efficiently, why?

Page 45: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

4545

DD ijkstra’s Algorithm ijkstra’s Algorithm Sometimes called the Sometimes called the Shortest-path AlgorithmShortest-path Algorithm or or

Forward Search Algorithm Forward Search Algorithm

Centralized, static algorithm, however it can be made Centralized, static algorithm, however it can be made adaptive by executing it periodically adaptive by executing it periodically

A node executing this algorithm is required to know A node executing this algorithm is required to know the link costs among the nodes the link costs among the nodes

Each node executes this algorithm to determine the Each node executes this algorithm to determine the cheapest route to each network node cheapest route to each network node

Page 46: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

4646

DD ijkstra’s Algorithm ijkstra’s Algorithm Iterative procedure.Iterative procedure.

S: Set of nodes to which cheap route is known,S: Set of nodes to which cheap route is known,

W: Set of nodes direct connected to a node in S,W: Set of nodes direct connected to a node in S,

X: A node in W to where cheap path found.X: A node in W to where cheap path found.

Figure 10.24 – Adding Nodes to S

using Dijkstra’s Algorithm

Page 47: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

4747

DD ijkstra’s Algorithm ijkstra’s Algorithm

Figure 10.25 – Network and Associated Connection Costs

Page 48: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

4848

DD ijkstra’s Algorithm ijkstra’s Algorithm

SS WW XX BB CC DD EE FF BB CC DD EE FF

11 {A}{A} {B,C}{B,C} CC 22 11 ∞∞ ∞∞ ∞∞ AA AA -- -- --

22 {A, C}{A, C} {B,D,E,F}{B,D,E,F} BB 22 11 44 77 88 AA AA CC CC CC

33 {A,B,C}{A,B,C} {D,E,F}{D,E,F} DD 22 11 44 66 88 AA AA CC BB CC

44 {A,B,C,D}{A,B,C,D} {E,F}{E,F} EE 22 11 44 66 66 AA AA CC BB DD

55 {A,B,C,D,E}{A,B,C,D,E} {F}{F} FF 22 11 44 66 66 AA AA CC BB DD

Cost function Prior functionCost function Prior function

Values Defined by Dijkstra’s Algorithm for the Network in Figure 10.25

Page 49: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

4949

CC ongestion & Deadlock ongestion & Deadlock Congestion Congestion Excessive build-up of packets at one or more network Excessive build-up of packets at one or more network

nodesnodes

Reasons behind that include failed link, number of Reasons behind that include failed link, number of transmitted packets exceed network capacity, larger transmitted packets exceed network capacity, larger number of nodes than expected, …etc.number of nodes than expected, …etc.

Once congested, network suffers delays, possible Once congested, network suffers delays, possible retransmissions, incapability of a node to receive retransmissions, incapability of a node to receive quickly due to being busy sending (or attempting to quickly due to being busy sending (or attempting to send), …etc. send), …etc.

Page 50: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

5050

CC ongestion & Deadlock ongestion & Deadlock Congestion Congestion There are several ways to handle congestion:There are several ways to handle congestion:

• Packet elimination Packet elimination

• Flow controlFlow control

• Buffer allocation Buffer allocation

• Choke packets Choke packets

Page 51: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

5151

CC ongestion & Deadlock ongestion & Deadlock Congestion – Packet Elimination Congestion – Packet Elimination If excessive buildup of packets occur at a node, If excessive buildup of packets occur at a node,

eliminate some of themeliminate some of them

This reduces the network load but suffer loss of This reduces the network load but suffer loss of packetspackets

Eventually, the higher level protocol will handle this Eventually, the higher level protocol will handle this loss by retransmitting the packets, hoping for sure that loss by retransmitting the packets, hoping for sure that the congestion has subsided the congestion has subsided

Page 52: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

5252

CC ongestion & Deadlock ongestion & Deadlock Congestion – Flow Control Congestion – Flow Control Designed to control the number of packets sent, however it does Designed to control the number of packets sent, however it does

not really a congestion control approachnot really a congestion control approach

Flow control limits the number of packets between two points, Flow control limits the number of packets between two points, whereas congestion often involves packets coming into a node whereas congestion often involves packets coming into a node from many sources from many sources

One solution is to limit the number that can be sent by a node, One solution is to limit the number that can be sent by a node, so the total may not congest the network; this has a bad side so the total may not congest the network; this has a bad side effect however; what is it? effect however; what is it?

Let the nodes communicate with each others so that one reduces Let the nodes communicate with each others so that one reduces its traffic if total traffic is high; this won’t work either, why? its traffic if total traffic is high; this won’t work either, why?

Page 53: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

5353

CC ongestion & Deadlock ongestion & Deadlock Congestion – Buffer Allocation Congestion – Buffer Allocation Very suitable for virtual circuit connectionsVery suitable for virtual circuit connections

When the circuit is reserved, a specific amount of When the circuit is reserved, a specific amount of buffer is allocated to this communicationbuffer is allocated to this communication

Further requests for the same circuit will consume Further requests for the same circuit will consume other portions of the available buffersother portions of the available buffers

If there is no more buffers, requests to use that circuit If there is no more buffers, requests to use that circuit will be rejected and the higher level protocol must then will be rejected and the higher level protocol must then fins an alternative route fins an alternative route

Page 54: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

5454

CC ongestion & Deadlock ongestion & Deadlock Congestion – Choke PacketsCongestion – Choke Packets More dynamic way to handle congestion More dynamic way to handle congestion

Each node monitors the activity on its outgoing links and traces the utilization of the Each node monitors the activity on its outgoing links and traces the utilization of the links links

An increased utilization indicates higher risk of congestion An increased utilization indicates higher risk of congestion

If the utilization exceeds specific threshold, the node is put into a warning state If the utilization exceeds specific threshold, the node is put into a warning state

While in the warning state, if the node receives a packet for further forwarding, it will While in the warning state, if the node receives a packet for further forwarding, it will respond by sending special choke packet to the senderrespond by sending special choke packet to the sender

When the sender receives a choke packet, it knows that congestion risk is high and When the sender receives a choke packet, it knows that congestion risk is high and hence reduces the number of sent packets for a period of timehence reduces the number of sent packets for a period of time

If the time expires without receiving any further choke packets, the sender goes back If the time expires without receiving any further choke packets, the sender goes back to its normal transmission rate; otherwise, it reduces the number of sent packets even to its normal transmission rate; otherwise, it reduces the number of sent packets even furtherfurther

Page 55: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

5555

CC ongestion & Deadlock ongestion & Deadlock DeadlockDeadlock In the worst case, congestion can become so sever that nothing moves In the worst case, congestion can become so sever that nothing moves

Figure 10.33 – Store-and-Forward Deadlock

Page 56: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

5656

CC ongestion & Deadlock ongestion & Deadlock DeadlockDeadlock Deadlock is also possible due to other causes Deadlock is also possible due to other causes

Figure 10.34 – Reassembly Deadlock

Page 57: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

5757

CC ongestion & Deadlock ongestion & Deadlock DeadlockDeadlock One way to deal with store-and-forward deadlock is to do One way to deal with store-and-forward deadlock is to do

nothing until it happensnothing until it happens

Once occurred, try to handle it, possibly by dropping some Once occurred, try to handle it, possibly by dropping some packets to release buffer space packets to release buffer space

It might be better however to try to prevent deadlock, or at least It might be better however to try to prevent deadlock, or at least reduce the chances it occurs reduce the chances it occurs

One approach is to maintain the number of hops (intermediate One approach is to maintain the number of hops (intermediate nodes) that a packet can go through then allocate a buffer based nodes) that a packet can go through then allocate a buffer based on that number on that number

Page 58: Connecting Networks © Prof. Aiman Hanna Department of Computer Science Concordia University Montreal, Canada

5858

CC ongestion & Deadlock ongestion & Deadlock DeadlockDeadlock

Figure 10.35 – Storing Packets Depending on Hop Count