Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing...

58
Computer S y stems (159.253) ~ 1 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing ime Division Multiplexing. One time slot/sender SLOT 1 SLOT 2 SLOT 3 SLOT 4 SLOT 5 Periodic SYNC slots maintain synchronisation Multiplexing Frequency Division Multiplexing Different frequency for each station (like full-duplex FSK) ADSL divides phoneline bandwidth using FDM: allocates channels according to conditions hi hi? TRADITIONAL MULTIPLEXING TECHNIQUES

Transcript of Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing...

Page 1: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 1 ~Data Communications: © P.Lyons 2004

Traditional Multiplexing

Time Division Multiplexing.One time slot/senderSLOT1 SLOT2 SLOT3 SLOT4 SLOT5

Periodic SYNC slots maintain synchronisation

Multiplexing

Frequency Division MultiplexingDifferent frequency for each station (like full-duplex FSK)ADSL divides phoneline bandwidth using FDM:

allocates channels according to conditions

hi hi?

TRADITIONAL MULTIPLEXING TECHNIQUES

Page 2: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 2 ~Data Communications: © P.Lyons 2004

Statistical MultiplexingSTATISTICAL MULTIPLEXING

Multiplexing

FDM & TDM maintains sender-receiver correspondence by synch pulses must always allocate same fraction of bandwidth for each channelwastes bandwidth when sender has no data

Stat-mux includes id #s of sender and receiver with datano need to maintain synchronisationdelivery relies on receiver’s id100% of bandwidth available for data (less id overhead)

To benefit from this, sender links need to be high bandwithIncoming data can overrun statmuxNeed buffers to smooth out peaksStatmux “chokes” sender, or discards data packets when buffer fills

Page 3: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 3 ~Data Communications: © P.Lyons 2004

Networks

CLASSIFICATION

Networks

Wide area networks

Local area networks

ATM

“The” Internet

Ethernet

WiFi

Twisted pair

Token ring

Network Classification

Page 4: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 4 ~Data Communications: © P.Lyons 2004

The Internet

Uses self-contained packets (datagrams - cf. telegrams)travel independently through networklike letters in postal system but called datagrams - cf. telegrams.

Networks

THE INTERNET

More robust than connection-oriented networksIf a node fails then subsequent packets will still get through.

Original connectionless system developed into TCP/IPnow forms the basis of the internet.

Tanenbaum 3rd edition: 412-423, 521-542

Page 5: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 5 ~Data Communications: © P.Lyons 2004

The Internet ProtocolsNetworks

THE INTERNET

One protocol for delivering datagrams to a destinationIP - the Internet ProtocolUnreliable: discards, reorders, duplicates datagrams

PROTOCOLS

Several alternative protocols for mapping between messages and datagramsTCP - the Transmission Control ProtocolUsed for messages that are spread across multiple datagramsCombines IP and ARQ techniques to provide reliable, sequenced data delivery

UDP - the User Datagram ProtocolSends single packets across the networkPackets sink or swim; no enhanced reliability

others

Page 6: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 6 ~Data Communications: © P.Lyons 2004

Just a delivery mechanism

Specifically designed for internetworksTransport layer (TCP) generates up to 64KB datagrams Usually ≈ 1500 bytes

Subnets can handle different sized datagrams Fragmentation may be necessary at subnet boundariesIP provides unambiguous reassembly Fragments identifiable by byte indexing

Networks

IP IP

Page 7: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 7 ~Data Communications: © P.Lyons 2004

Header

Networks

IP DATAGRAMS

4 bytes

5 blocks

VersionAllows different versions of IP to run simultaneously: the internet is big

Options

Fixed part: 20 bytesOptions: variable

Fixed part

version

IP Datagrams

Page 8: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 8 ~Data Communications: © P.Lyons 2004

Header

Networks

IP DATAGRAMS

IHL (IP Header Length)Header has 5 to 15 32-bit words (20 – 60 bytes)So options field is 0-40 bytes

Options

Fixed part: 20 bytesOptions: variable

version IHL

IP Datagrams

Page 9: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 9 ~Data Communications: © P.Lyons 2004

Header

Networks

IP DATAGRAMS

Service type specifies QOS (Quality of Service)3 bits for precedence (0 normal, 7 network control packet)1 bit each for delay1 bit each for throughput1 bit each for reliability

Options

Fixed part: 20 bytesOptions: variable

version IHL Service type

Sender sets 1 of these bits; generally ignored!

IP Datagrams

Page 10: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 10 ~Data Communications: © P.Lyons 2004

Header

Networks

IP DATAGRAMS

Total LengthDatagram size 20-65536 bytesToo small for efficient use of very high speed networks

Options

Fixed part: 20 bytesOptions: variable

version IHL Service type Total length

IP Datagrams

Page 11: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 11 ~Data Communications: © P.Lyons 2004

Header

Networks

IP DATAGRAMS

IdentificationUnique to a datagram and its fragments

Options

Fixed part: 20 bytesOptions: variable

version IHL Service type Total length

identification

IP Datagrams

Page 12: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 12 ~Data Communications: © P.Lyons 2004

Header

Networks

IP DATAGRAMS

DFDon’t fragment (because receiver is unable to reassemble)

Options

Fixed part: 20 bytesOptions: variable

version IHL Service type Total length

identification D F

IP Datagrams

Page 13: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 13 ~Data Communications: © P.Lyons 2004

Header

Networks

MFMore Fragements (of the current datagram after this one)Set in all fragments of an original datagram except the last

Options

Fixed part: 20 bytesOptions: variable

version IHL Service type Total length

identification D F

M F Fragment offset

Fragment Offset: Location of 1st byte of fragment within original datagram Min fragment size is 8 bytes; location is actually byte index mod 8

IP DATAGRAMSIP Datagrams

Page 14: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 14 ~Data Communications: © P.Lyons 2004

Header

Networks

TTL (Time To Live)Theoretically units = seconds, In practice, decremented by 1 at each hop

Options

Fixed part: 20 bytesOptions: variable

version IHL Service type Total length

identification D F

M F Fragment offset

TTL

IP DATAGRAMSIP Datagrams

Page 15: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 15 ~Data Communications: © P.Lyons 2004

Header

Networks

ProtocolProtocol that should handle the packet in the receiving stationTCP, UDP, TPO-4, etc

Options

Fixed part: 20 bytesOptions: variable

version IHL Service type Total length

identification D F

M F Fragment offset

TTL Protocol

IP DATAGRAMSIP Datagrams

Page 16: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 16 ~Data Communications: © P.Lyons 2004

Header

Networks

Header ChecksumDetects corruption in routers

Options

Fixed part: 20 bytesOptions: variable

version IHL Service type Total length

identification D F

M F Fragment offset

TTL Protocol Header checksum

IP DATAGRAMSIP Datagrams

Page 17: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 17 ~Data Communications: © P.Lyons 2004

Header

Networks

Source Address & Destination Address4-byte IP addresses (see later)

Options

Fixed part: 20 bytesOptions: variable

version IHL Service type Total length

identification D F

M F Fragment offset

TTL Protocol Header checksum

Source address

Destination address

IP DATAGRAMSIP Datagrams

Page 18: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 18 ~Data Communications: © P.Lyons 2004

Header

Networks

OptionsSecurity: if set, packet should avoid doubtful routes; not heededStrict source routing; defeats corrupt routing tables; allows route timing measurementsLoose source routing; route must include specified routers. For routing round enemiesRecord route; when routing thought to be incorrectTimestamp; as previous, including timestamp; also for debugging routing algorithms

Options

Fixed part: 20 bytesOptions: variable

version IHL Service type Total length

identification D F

M F Fragment offset

TTL Protocol Header checksum

Source address

Destination address

IP DATAGRAMSIP Datagrams

Page 19: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 19 ~Data Communications: © P.Lyons 2004

4-Byte IP AddressNetworks

4-BYTE IP ADDRESS (*.*.*.*)

192 -

223

224 -

239

240 -

247

1 0

1 0

1 0111

11

1

01 -

127

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

hostnetworkClassA

1128

- 191

00 -

255

0 -

255

0 -

255B

C

D

E

multicast

reserved

126 networks with 16 million hosts

16K networks with 64K hosts

2 million networks with 254 hosts

unique world-wide address of individual host

Page 20: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 20 ~Data Communications: © P.Lyons 2004

4-Byte IP AddressNetworks

4-BYTE IP ADDRESS (*.*.*.*)

192 -

223

224 -

239

240 -

247

1 0

1 0

1 0111

11

1

01 -

127

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

hostnetworkClassA

1128

- 191

00 -

255

0 -

255

0 -

255B

C

D

E

multicast

reserved

126 networks with 16 million hosts

16K networks with 64K hosts

2 million networks with 254 hosts

unique world-wide address of individual host

Page 21: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 21 ~Data Communications: © P.Lyons 2004

4-Byte IP AddressNetworks

192 -

223

224 -

239

240 -

247

1 0

1 0

1 0111

11

1

01 -

127

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

hostnetworkClassA

1128

- 191

00 -

255

0 -

255

0 -

255B

C

D

E

multicast

reserved

126 networks with 16 million hosts

16K networks with 64K hosts

2 million networks with 254 hosts

unique world-wide address of individual host4-BYTE IP ADDRESS (*.*.*.*)

Page 22: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 22 ~Data Communications: © P.Lyons 2004

4-Byte IP AddressNetworks

192 -

223

224 -

239

240 -

247

1 0

1 0

1 0111

11

1

01 -

127

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

hostnetworkClassA

1128

- 191

00 -

255

0 -

255

0 -

255B

C

D

E

multicast

reserved

126 networks with 16 million hosts

16K networks with 64K hosts

2 million networks with 254 hosts

unique world-wide address of individual host4-BYTE IP ADDRESS (*.*.*.*)

Page 23: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 23 ~Data Communications: © P.Lyons 2004

4-Byte IP AddressNetworks

192 -

223

224 -

239

240 -

247

1 0

1 0

1 0111

11

1

01 -

127

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

0 -

255

hostnetworkClassA

1128

- 191

00 -

255

0 -

255

0 -

255B

C

D

E

multicast

reserved

126 networks with 16 million hosts

16K networks with 64K hosts

2 million networks with 254 hosts

unique world-wide address of individual host4-BYTE IP ADDRESS (*.*.*.*)

Page 24: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 24 ~Data Communications: © P.Lyons 2004

IP special addresses

Net host 0 0 used by an IP host when booting 0 x host x on local network all 1s, all 1s broadcast on local network x all 1s broadcast to distant network

127.x.y.z deliver packet to own TSAP

Networks

IP SPECIAL ADDRESSES

Page 25: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 25 ~Data Communications: © P.Lyons 2004

CIDRNetworks

CIDR

Class-based address allocation inefficientAddress blocks match organisations’ requirements poorlyRouting tables too big – max size 60000 networks

SolutionMake network field variable in sizeAllocate networks hierarchically

*.*.*.* /15

*.*.*.* /19*.*.*.* /22*.*.*.* /27

*.*.*.* /22*.*.*.* /28

Major ISP with 215 networksBackbone routing

Small ISPsLarge organisations

Local routing Individual organisations

Page 26: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 26 ~Data Communications: © P.Lyons 2004

Reliable end-to-end communication over unreliable internetwork Subnets may be incompatibleIP delivery is neither reliable, nor in-order

Networks

TCP

TCP must compensate At sender

TCP entity generates ≤ 64Kbyte datagrams from applicationsAt receiver

TCP entity generates byte stream for applications from datagrams

TCP

Page 27: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 27 ~Data Communications: © P.Lyons 2004

Applications using TCP communicate via socketsTo the application, sockets behave like files Use read & write to input and output information via the comms link

Networks

SOCKETSSockets

Page 28: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 28 ~Data Communications: © P.Lyons 2004

TCP characteristics

full-duplex

Networks

TCP CHARACTERISTICS

point-to-point no multicasting or broadcasting

byte streammessage boundaries are not preservedreceiver must detect boundaries for itself

Page 29: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 29 ~Data Communications: © P.Lyons 2004

Fragmentation in TCP works at the byte levelEach byte has 32-bit seq no

not included with the byteseq no of first byte in PDU included with PDU

Networks

TCP PROTOCOL

TCP entities exchange segments20-byte fixed header≥0-bytes extension≥0 data bytes

TCP protocol

Page 30: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 30 ~Data Communications: © P.Lyons 2004

Sliding window acknowledgement schemebyte sequence numbers allow for inconsistent fragmentation

Networks

TCP PROTOCOL

TCP determines amount of data in payloadTCP segment must fit within 64Kbyte IP payloadwithin subnet’s MTU (maximum transfer unit)

usually < 5000 bytesmay be fragmented when reaches subnet with smaller MTU

TCP protocol

Page 31: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 31 ~Data Communications: © P.Lyons 2004

Considerations:Network topology changesShould we minimise packet delay or maximise throughput?Try to achieve both by minimising Source-Destination hop countMaximise throughput by giving Channel A 100% of bandwidth? Not fair to channel B

Network Routing

THE PROBLEM

Which o/p port leads to ultimate destination?

Network Routing

Page 32: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 32 ~Data Communications: © P.Lyons 2004

Routing tables held in RCC (Routing Control Centre)IMPs send data to RCC at intervalsQueue lengths, traffic intensity, operating neighboursRCC computes & distributes optimum routes for entire subnet

Network Routing

CENTRALISED ROUTING

CharacteristicsAdaptive good routing decisions possiblelow processing overhead on other nodesfrequent (slow) updates necesssarylosing even 1 link can be disastroustables differ through networkdistributing routing tables is heavy load

Centralised Routing

Page 33: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 33 ~Data Communications: © P.Lyons 2004

Distance Vector Algorithm

Each routing location maintains a routing table (destination, port, estimated cost) for all destinations

Network Routing

THE DISTANCE VECTOR ALGORITHM

Distributed version of Bellman-Ford

RoutersRegularly check costs to immediate neighboursShare their routing tablesRegenerate tables using lowest cost routes

What’s the best route to N, the new node?

N

Bellman? Ford?

Page 34: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 34 ~Data Communications: © P.Lyons 2004

Distance Vector Algorithm

Each routing location maintains a routing table (destination, port, estimated cost) for all destinations

Network Routing

THE DISTANCE VECTOR ALGORITHM

Distributed version of Bellman-Ford

RoutersRegularly check costs to immediate neighboursShare their routing tablesRegenerate tables using lowest cost routes

N:1

NN:0

What’s the best route to N, the new node?

Bellman? Ford?

Page 35: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 35 ~Data Communications: © P.Lyons 2004

Distance Vector Algorithm

Each routing location maintains a routing table (destination, port, estimated cost) for all destinations

Network Routing

THE DISTANCE VECTOR ALGORITHM

Distributed version of Bellman-Ford

RoutersRegularly check costs to immediate neighboursShare their routing tablesRegenerate tables using lowest cost routes

N:1

NN:1

N:1

N:2

N:2N:1

N:0

What’s the best route to N, the new node?

Bellman? Ford?

Page 36: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 36 ~Data Communications: © P.Lyons 2004

Distance Vector Algorithm

Each routing location maintains a routing table (destination, port, estimated cost) for all destinations

Network Routing

THE DISTANCE VECTOR ALGORITHM

Distributed version of Bellman-Ford

RoutersRegularly check costs to immediate neighboursShare their routing tablesRegenerate tables using lowest cost routes

N:1

NN:2

N:2

N:3

N:2

N:2

N:1

N:1

N:2

N:2

N:1

N:0

What’s the best route to N, the new node?

Bellman? Ford?

Page 37: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 37 ~Data Communications: © P.Lyons 2004

Distance Vector Algorithm

Each routing location maintains a routing table (destination, port, estimated cost) for all destinations

Network Routing

THE DISTANCE VECTOR ALGORITHM

Distributed version of Bellman-Ford

RoutersRegularly check costs to immediate neighboursShare their routing tablesRegenerate tables using lowest cost routes

N:1

N N:3N:4

N:2

N:2

N:3N:2

N:2

N:1

N:1

N:2

N:1

N:0

N:2

N:3

N:3

What’s the best route to N, the new node?

Ford?Bellman?

Page 38: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 38 ~Data Communications: © P.Lyons 2004

Distance Vector Algorithm

Ford?Bellman?Each routing location maintains a routing table (destination, port, estimated cost) for all destinations

Network Routing

THE DISTANCE VECTOR ALGORITHM

Distributed version of Bellman-Ford

RoutersRegularly check costs to immediate neighboursShare their routing tablesRegenerate tables using lowest cost routes

N:1

N N:4

N:2

N:2

N:3

What’s the best route to N, the new node?

Page 39: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 39 ~Data Communications: © P.Lyons 2004

Distance Vector Algorithm

N:1N:3

Each routing location maintains a routing table (destination, port, estimated cost) for all destinations

Network Routing

THE DISTANCE VECTOR ALGORITHM

Distributed version of Bellman-Ford

RoutersRegularly check costs to immediate neighboursShare their routing tablesRegenerate tables using lowest cost routes

N N:4

N:2

N:2

N:3N:3

N:4

N:2

N:2

N:1

N:1

N:2

N:2

N:3

N:3

What’s the best route to N, the new node?

Bellman? Ford?

Page 40: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 40 ~Data Communications: © P.Lyons 2004

Distance Vector Algorithm

N:3

Each routing location maintains a routing table (destination, port, estimated cost) for all destinations

Network Routing

THE DISTANCE VECTOR ALGORITHM

Distributed version of Bellman-Ford

RoutersRegularly check costs to immediate neighboursShare their routing tablesRegenerate tables using lowest cost routes

N N:4

N:2

N:2

N:3N:3

N:4

N:2

N:2

N:3

N:3

N:2

N:2

N:3

N:3

N:4

N:4

What’s the best route to N, the new node?

Bellman? Ford?

Page 41: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 41 ~Data Communications: © P.Lyons 2004

Distance Vector Algorithm

N:5N:3

N:3N:5

N:4

N:4

Each routing location maintains a routing table (destination, port, estimated cost) for all destinations

Network Routing

Distributed version of Bellman-Ford

RoutersRegularly check costs to immediate neighboursShare their routing tablesRegenerate tables using lowest cost routes

N N:4N:3

N:4

N:4

N:4

N:3

N:3

N:4

N:4

N:3

N:3

What’s the best route to N, the new node?

Bellman? Ford?

THE DISTANCE VECTOR ALGORITHM

Page 42: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 42 ~Data Communications: © P.Lyons 2004

Distance Vector Algorithm

N:4

N:4

N:6

N:6

N:6

N:5N:5

N:4

Each routing location maintains a routing table (destination, port, estimated cost) for all destinations

Network Routing

THE DISTANCE VECTOR ALGORITHM

Distributed version of Bellman-Ford

RoutersRegularly check costs to immediate neighboursShare their routing tablesRegenerate tables using lowest cost routes

N N:5

N:4

N:4

N:4

N:5

N:5

N:4

N:4

N:5

N:5

What’s the best route to N, the new node?

Bellman? Ford?

Page 43: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 43 ~Data Communications: © P.Lyons 2004

Distance Vector Algorithm

N:6

N:6

N:6

N:5N:5

Each routing location maintains a routing table (destination, port, estimated cost) for all destinations

Network Routing

Distributed version of Bellman-Ford

RoutersRegularly check costs to immediate neighboursShare their routing tablesRegenerate tables using lowest cost routes

N N:5

N:6

N:6

N:6

N:5

N:5

N:6

N:6

N:5

N:5

N:7N:7

What’s the best route to N, the new node?

Bellman? Ford?

THE DISTANCE VECTOR ALGORITHM

Page 44: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 44 ~Data Communications: © P.Lyons 2004

Distance Vector Algorithm

N:6N:8

N:8

N:6N:8

N:6

N:7N:7

Each routing location maintains a routing table (destination, port, estimated cost) for all destinations

Network Routing

Distributed version of Bellman-Ford

RoutersRegularly check costs to immediate neighboursShare their routing tablesRegenerate tables using lowest cost routes

N N:7

N:6

N:6

N:6

N:7

N:7

N:6

N:6

N:7

N:7

What’s the best route to N, the new node?

Bellman? Ford?

THE DISTANCE VECTOR ALGORITHM

Page 45: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 45 ~Data Communications: © P.Lyons 2004

Distance Vector Algorithm

N:9N:9

N:8

N:8

N:8

N:7N:7

Each routing location maintains a routing table (destination, port, estimated cost) for all destinations

Network Routing

Distributed version of Bellman-Ford

RoutersRegularly check costs to immediate neighboursShare their routing tablesRegenerate tables using lowest cost routes

N

What’s the best route to N, the new node?

Bellman? Ford?

THE DISTANCE VECTOR ALGORITHM

Page 46: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 46 ~Data Communications: © P.Lyons 2004

Distance Vector Algorithm

N:9N:9 N:8

N:8

N:8

Each routing location maintains a routing table (destination, port, estimated cost) for all destinations

Network Routing

Distributed version of Bellman-Ford

RoutersRegularly check costs to immediate neighboursShare their routing tablesRegenerate tables using lowest cost routes

N N:10

N:10

N:10

etc. etc. etc.

What’s the best route to N, the new node?

Bellman? Ford?

THE DISTANCE VECTOR ALGORITHM

Page 47: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 47 ~Data Communications: © P.Lyons 2004

Distance Vector Algorithm

N:10

N:10

N:10

N:9N:9

Each routing location maintains a routing table (destination, port, estimated cost) for all destinations

Network Routing

Distributed version of Bellman-Ford

RoutersRegularly check costs to immediate neighboursShare their routing tablesRegenerate tables using lowest cost routes

N The “count to infinity” problem

What’s the best route to N, the new node?

Bellman? Ford?

THE DISTANCE VECTOR ALGORITHM

Page 48: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 48 ~Data Communications: © P.Lyons 2004

Distance Vector Algorithm

NN:1

N:10

N:10

N:10

N:9N:9

Each routing location maintains a routing table (destination, port, estimated cost) for all destinations

Network Routing

Distributed version of Bellman-Ford

RoutersRegularly check costs to immediate neighboursShare their routing tablesRegenerate tables using lowest cost routes

N:0

N:9

N:10

N:10

N:10

N:9

N:9

N:10

N:9N:10

N:9

N:9

What’s the best route to N, the new node?

Bellman? Ford?

THE DISTANCE VECTOR ALGORITHM

Page 49: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 49 ~Data Communications: © P.Lyons 2004

Distance Vector Algorithm

N:3N:9

N:1N:10

N:10

N:10

N:9

Each routing location maintains a routing table (destination, port, estimated cost) for all destinations

Network Routing

Distributed version of Bellman-Ford

RoutersRegularly check costs to immediate neighboursShare their routing tablesRegenerate tables using lowest cost routes

What’s the best route to N, the new node?

NN:0

N:10

N:10

N:10

N:1

N:1

N:10

N:1N:10

N:9

N:9

N:2

N:2

N:4

Bellman? Ford?

THE DISTANCE VECTOR ALGORITHM

Page 50: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 50 ~Data Communications: © P.Lyons 2004

Dijsktra’s algorithmNetwork Routing

DIJKSTRA’S ALGORITHM

Routing table in each node records the port closest to “source”Send datagrams for “source” out this port

establishes a “sink tree” - tree of minimum paths - for each node in the networkmust be run for each node in the network

Algorithm starts building tree from the source noderepeatedly adds the leaf node with lowest (cumulative) cost

was originally designed to find optimum distribution path for informationOriginally root node was called the “source” of informationIn current use, interested in path to root node - “source” actually means destination

Page 51: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 51 ~Data Communications: © P.Lyons 2004

Dijsktra’s algorithmNetwork Routing

DIJKSTRA’S ALGORITHM

Find all candidates - Neighbours of current leaf nodes Root sends IdentifyCandidates message down the tree

Candidates send Cost message back up the tree

Add lowest cost candidate to treeEach node accepts lowest cost candidate, rejects others

222

111

Edsger W.

Dijkstra

Page 52: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 52 ~Data Communications: © P.Lyons 2004

Network Routing

Find all candidates - Neighbours of current leaf nodes Root sends IdentifyCandidates message down the tree

Candidates send Cost message back up the tree

Add lowest cost candidate to treeEach node accepts lowest cost candidate, rejects others

2

1

Edsger W.

Dijkstra

DIJKSTRA’S ALGORITHMDijsktra’s algorithm

Page 53: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 53 ~Data Communications: © P.Lyons 2004

Network Routing

22

1

4

3

4

Find all candidates - Neighbours of current leaf nodes Root sends IdentifyCandidates message down the tree

Candidates send Cost message back up the tree

Add lowest cost candidate to treeEach node accepts lowest cost candidate, rejects others

1

Edsger W.

Dijkstra

DIJKSTRA’S ALGORITHMDijsktra’s algorithm

Page 54: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 54 ~Data Communications: © P.Lyons 2004

Network Routing

22

1

1

4

3

4

Find all candidates - Neighbours of current leaf nodes Root sends IdentifyCandidates message down the tree

Candidates send Cost message back up the tree

Add lowest cost candidate to treeEach node accepts lowest cost candidate, rejects others

5

1

4

1 5

Edsger W.

Dijkstra

DIJKSTRA’S ALGORITHMDijsktra’s algorithm

Page 55: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 55 ~Data Communications: © P.Lyons 2004

Network Routing

2

1

4

3

4

Find all candidates - Neighbours of current leaf nodes Root sends IdentifyCandidates message down the tree

Candidates send Cost message back up the tree

Add lowest cost candidate to treeEach node accepts lowest cost candidate, rejects others

4

5

2 5

Edsger W.

Dijkstra

DIJKSTRA’S ALGORITHMDijsktra’s algorithm

Page 56: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 56 ~Data Communications: © P.Lyons 2004

4

4

Network Routing

2

1

4

3

4

Find all candidates - Neighbours of current leaf nodes Root sends IdentifyCandidates message down the tree

Candidates send Cost message back up the tree

Add lowest cost candidate to treeEach node accepts lowest cost candidate, rejects others

11

22

1

6

6

5 6

5

2

4

Edsger W.

Dijkstra

DIJKSTRA’S ALGORITHMDijsktra’s algorithm

Page 57: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 57 ~Data Communications: © P.Lyons 2004

4

4

Network Routing

2

1

4

3

4

Find all candidates - Neighbours of current leaf nodes Root sends IdentifyCandidates message down the tree

Candidates send Cost message back up the tree

Add lowest cost candidate to treeEach node accepts lowest cost candidate, rejects others

5

6

6

6

5

4

Edsger W.

Dijkstra

DIJKSTRA’S ALGORITHMDijsktra’s algorithm

Page 58: Computer S y stems (159.253) ~ 65 ~Data Communications: © P.L y ons 2004 Traditional Multiplexing Time Division Multiplexing. One time slot/sender SLOT.

Computer Systems (159.253) ~ 58 ~Data Communications: © P.Lyons 2004

2

2

4

4

Network Routing

2

1

4

3

4

Find all candidates - Neighbours of current leaf nodes Root sends IdentifyCandidates message down the tree

Candidates send Cost message back up the tree

Add lowest cost candidate to treeEach node accepts lowest cost candidate, rejects others

4

Edsger W.

Dijkstra

DIJKSTRA’S ALGORITHMDijsktra’s algorithm