You are on page 1of 73

Data Communication and

Networking
M.Eng. Dang Ngoc Hanh
hanhdn@hcmut.edu.vn
Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

Content
Chapter 5: Telecom Networks
802.x standard
Ethernet, Token Pass, Token Ring
IP Addressing: Classless and VLSM
Network devices
Switching and Routing

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

Local Area Network


A local area network (LAN) is a computer network that
interconnects computers in a limited area such as a home,
school, computer laboratory, or office building using network
media
Medium:
Coaxial cable
Twisted-pair line

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

Wide Area Network


A wide area network (WAN) is a network that covers a broad
area (i.e., any telecommunications network that links across
metropolitan, regional, or national boundaries) using private
or public network transports

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

Physical Topology
Bus

Ring

Star

Telecomm. Dept.
Faculty of EEE

Extended Star

Hierarchical

Mesh

DCN-2013
HCMUT

Project 802
IEEE 802 refers to a family of IEEE standards dealing with local
area networks and metropolitan area networks
The services and protocols specified in IEEE 802 map to the
lower two layers (Data Link and Physical) of the seven-layer
OSI networking reference model. In fact, IEEE 802 splits the
OSI Data Link Layer into two sub-layers named Logical Link
Control (LLC) and Media Access Control (MAC), so that the
layers can be listed like this:

Data link layer


LLC Sublayer:
MAC Sublayer

Physical layer
Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

Project 802
Modules in Project 802
LLC: based on HDLC protocol
Multiplexing protocols
transmitted over the MAC
layer (when transmitting) and
decoding them (when
receiving).
Providing node-to-node flow
and error control
MAC: provides addressing and
channel access control
mechanisms that make it possible
for several terminals or network
nodes to communicate within a
multiple access network that
incorporates a shared medium
Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

LLC Frame formats


LLC PDU:
DSAP: Destination
Service Access Point
SSAP: Source Service
Access Point

Control field:
HDLC format

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

Ethernet
Topology: bus, star, ring
Media Access Control: Deterministic, Non-deterministic
Addressing:
Every computer has a unique way of identifying itself :
MAC address or physical address.
The physical address is located on the Network Interface
Card (NIC).
MAC addresses have no structure, and are considered flat
address spaces. MAC addresses are sometimes referred to
as burned-in addresses (BIAs) because they are burned
into read-only memory (ROM) and are copied into
random-access memory (RAM) when the NIC initializes.
0000.0c12.3456 or 00-00-0c-12-34-56
If MAC is all bits 1: broadcast address
Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

IEEE 802.3: frame format


Preamble: 10101010 (7 bytes)
The Start Frame field (10101011) tells other devices on the network that a
frame is coming down the wire.
The Address field stores the source and destination MAC addresses.
Source address is unicast, Destination address can be unicast, multicast or broadcast

The Type/Length field is an optional field


Exact length of frame, or Layer 3 protocol making the sending request, or Not used

The Data field is the actual information being sent by the upper layer
protocols. Therefore, it will be all upper layer data.
CRC: 4 bytes, error checking

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

10

Ethernet: 802.3

10Base-2:
10Base-5:
10Base-T:
10Base-F:
100Base-TX:
100Base-T4:
100Base-FX:
1000Base-T:

Telecomm. Dept.
Faculty of EEE

50 Thin cable, 185m.


50 Thick cable, 500m.
100 UTP cable, 100m.
Fiber optic cable, 1000m.
100 UTP/STP cable, 100m.
100 UTP (4p) cable, 100m.
Fiber optic cable, 400m.
100 UTP/STP cable, 100m.

DCN-2013
HCMUT

11

Ethernet: 10BASE-5
NIC: Network Interface Card
MAU: Medium Attachment Unit
Thick Ethernet (thicknet)
50 Thick cable, 500m

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

12

Ethernet: 10BASE-2
Thin Ethernet
50 Thin cable, 185m.

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

13

Ethernet: 10BASE-T
Twisted-pair cable
100 UTP cable, 100m.
Data rate: 10 Mbps

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

14

Ethernet Operation
Specified by the technology
being used.
Determine who can transmit
and when.
Two types:
Deterministic: Lets take
turns.
Token-Ring, FDDI.

Non-deterministic: First come,


first serve.
Ethernet : CSMA/CD.
Carrier Sense Multiple Access with Collision
Detection (CSMA/CD).
Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

15

Three common layer 2 technologies


Ethernet: logical
broadcast topology
Token Ring: logical
token ring topology
FDDI: logical token ring
topology
Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

16

Ethernet MAC
Ethernet is a shared-media broadcast
technology. The access method CSMA/CD
used in Ethernet performs three functions:
Transmitting and receiving data packets
Decoding data packets and checking them for
valid addresses before passing them to the upper
layers of the OSI model
Detecting errors within data packets or on the
network

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

17

CSMA/CD Process

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

18

Fast Ethernet
Speed: 100 Mbps
Distance: <250m
Backward compatible with Ethernet
10 Mbps
Uses Twisted-pair or Fiber

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

19

Gigabit Ethernet
>1 Gbps
Using Fiber optic
Deployed as backbone
network, connecting Fast
Ethernet networks

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

20

Token Ring
Token ring LAN technology was a
protocol which resided at the data link
layer (DLL) of the OSI model. It used a
special three-byte frame called a token
that travels around the ring. Tokenpossession grants the possessor
permission to transmit on the medium.
Token ring frames travel completely
around the loop.
Initially used only in IBM computers, it
was eventually standardized with
protocol IEEE 802.5.
Physical ring topology
Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

21

Token Ring
The data transmission process goes as follows:
Empty information frames are continuously circulated
on the ring.
When a computer has a message to send, it seizes the
token. The computer will then be able to send the
frame.
The frame is then examined by each successive
workstation. The workstation that identifies itself to
be the destination for the message copies it from the
frame and changes the token back to 0.
When the frame gets back to the originator, it sees
that the token has been changed to 0 and that the
message has been copied and received. It removes
the message from the frame.
The frame continues to circulate as an "empty"
frame, ready to be taken by a workstation when it has
a message to send.

Issues:
Who generates token?
If the node keeping token is dead, what happens?
Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

22

Token Bus
Also use token as Token Ring
Physical Bus topology
Token bus was standardized by IEEE standard 802.4. It is
mainly used for industrial applications
Due to difficulties handling device failures and adding new
stations to a network, token bus gained a reputation for being
unreliable and difficult to upgrade

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

23

IP Addressing: IPv4
An IPv4 address is 32 bits
long.
The IPv4 addresses are
unique and universal.
Network address + Host
address: Hierarchical
Addressing Schemes.

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

24

Classful IP addressing
In classful addressing, the address space is divided into five
classes: A, B, C, D, and E.
In classful addressing, a large part of the available addresses
were wasted.

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

25

Classful IP addressing
Network Bits:

Provided by Internet
Network Information
Center
Define the network
the remote device
wants to connect to
All bits are 0: no use
Defined by subnetmask

Host Bits:

Managed by Network
Administrator
Define the device
address in the
network that the
remote device wants
to connect to
All bits are 1:
broadcast address
Telecomm. Dept.
Faculty of EEE

Class C Network address: 192.168.10.100/255.255.255.0 (or /24)


IP Addr

11000000.
N

101010000.
N

00001010.
N

01100100
H

AND operation
Default
subnet
Mask
Network
addr

11111111.

11000000.

11111111.

11111111.

00000000

101010000.

00001010.

00000000

DCN-2013
HCMUT

26

Classful IP addressing
In classful addressing, a large part of the available addresses
were wasted.

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

27

Classful IP addressing: Example


Find the class of each address.
a. 00000001 00001011 00001011 11101111
b. 11000001 10000011 00011011 11111111
c. 14.23.120.8
d. 252.5.15.111

Solution
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class C
address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

28

Subnetting
Network administrators sometimes need to divide
networks, especially large ones, into smaller
networks:
Reduce the size of a broadcast domain.
Improve network security.
Implement the hierarchical managements.

So we need more network addresses for your


network. But I want the outside networks see our
network as a single network.

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

29

Subnetting
Non-subnetted
network

Subnetted network into


separate smaller
networks

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

30

Subnetting
To create a subnet address, a network administrator borrows bits from
the original host portion and designates them as the subnet field.
Borrows bits is always the leftmost host bit, the one closest to the last
network octet.
Subnet addresses include the Class A, Class B, or Class C network portion,
plus a subnet field and a host field.
Subnet addresses are assigned locally, usually by a network administrator.
How many bits can we borrow?
All of subnet bits are:
0 : reserved for network address.
1 : reserved for broadcast address.

The minimum bits you can borrow is: 2 bits.


The maximum bits you can borrow is:
A: 22 bits ~ 222 - 2 = 4.194.302 subnets.
B: 14 bits ~ 214 - 2 = 16.382 subnets.
C: 06 bits ~ 206 - 2 =
62 subnets.

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

31

Subnetting Example
Given network 172.16.0.0: We need 6 usable subnets and up
to 8100 hosts on each subnet.
Define class: class B, 255.255.0.0
6 usable subnets: borrow 3 bits
Determine the subnets from 3 borrowed bits from the host
portion (last 2 bytes):
0 subnet:
1st subnet:
2nd subnet:
3rd subnet:
4th subnet:
5th subnet:
6th subnet:
subnet:
Telecomm. Dept.
Faculty of EEE

.00000000.00000000
.00100000.00000000(32=25)
.01000000.00000000
.0110000.00000000
.10000000.00000000
.10100000.00000000
.11000000.00000000(6x25)
.11100000.00000000
DCN-2013
HCMUT

32

Subnetting Example
No

Sub-network
address

Possible host address

Broadcast
address

Use
?

172.16.0.0

.0.1 .31.254

.31.255

172.16.32.0

.32.1 .63.254

.63.255

172.16.64.0

.64.1 .95.254

.95.255

172.16.96.0

.96.1 .127.254

.127.255

172.16.128.0

.128.1 .159.254

.159.255

172.16.160.0

.160.1 .191.254

.191.255

172.16.192.0

.192.1 .223.254

.223.255

172.16.224.0

.224.1 .255.254

.255.255

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

33

Subnetting
Addresses are loose by subnetting.
Network administrator must strike a balance
between the number of subnets required, the hosts
per subnet that is acceptable, and the resulting
waste of addresses.

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

34

IP Address Problems
In the 1990, two problems became apparent
IP addresses were being exhausted
IP routing tables were growing very large

IP Address Exhaustion

Class A, B, and C address structure inefficient


Class B too large for most organizations, but future proof
Class C too small
Rate of class B allocation implied exhaustion by 1994

IP routing table size


Growth in number of networks in Internet reflected in # of table entries
From 1991 to 1995, routing tables doubled in size every 10 months
Stress on router processing power and memory allocation

Short-term solution:
Classless Interdomain Routing (CIDR), RFC 1518
New allocation policy (RFC 2050)
Private IP Addresses set aside for intranets

Long-term solution: IPv6 with much bigger address space


Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

35

Supernetting
Summarize a contiguous group of class C addresses
using variable-length mask
Example: 150.158.16.0/20
IP Address (150.158.16.0) & mask length (20)
IP add = 10010110 10011110 00010000 00000000
Mask = 11111111 11111111 11110000 00000000
Contains 16 Class C blocks:
From 10010110 10011110 00010000 00000000
i.e. 150.158.16.0
Up to 10010110 10011110 00011111 00000000
i.e. 150.158.31.0
Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

36

Summarizing Within an Octet

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

37

Subnetting Example 1
For example, consider a relatively small company with a Class C
network, 201.45.222.0/24. They have six subnetworks in their
network. The first four subnets (S1, S2, S3 and S4) are relatively
small, containing only 10 hosts each. However, one of them (S5) is
for their production floor and has 50 hosts, and the last (S6) is their
development and engineering group, which has 100 hosts.
The total number of hosts needed is thus 196. Without subnetting,
we have enough hosts in our Class C network to handle them all.
However, when we try to subnet, we have a big problem. In order
to have six subnets we need to use 3 bits for the subnet ID. This
leaves only 5 bits for the host ID, which means every subnet has the
identical capacity of 30 hosts. This is enough for the smaller subnets
but not enough for the larger ones. The only solution with
conventional subnetting, other than shuffling the physical subnets,
is to get another Class C block for the two big subnets and use the
original for the four small ones. But this is expensive, and means
wasting hundreds of IP addresses!
Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

38

Subnetting Example 2
For example, consider the subnet address
172.16.32.0/20 and a network needing ten host
addresses.
With this subnet address, there are over 4000 (212
2 = 4094) host addresses, most of which will be
wasted.

Need Variable Length Subnet Mask (VLSM)

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

39

VLSM Example
Given the Class C network of 204.15.5.0/24,
subnet the network in order to create the
network in the figure below, with the host
requirements shown:
NetA: 14 hosts
NetB: 28 hosts
NetC: 2 hosts
NetD: 7 hosts
NetE: 28 hosts

Solution?
Classfull subneting?
VLSM?
What do we benefit when using VLSM?
Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

40

VLSM Example
Solution: Classful subnetting
netA: 204.15.5.32/27
netB: 204.15.5.64/27
netC: 204.15.5.96/27
netD: 204.15.5.128/27
netE: 204.15.5.160/27

host address range 33 to 62


host address range 65 to 94
host address range 97 to 126
host address range 129 to 158
host address range 161 to 190

Solution: VSLM
netA: requires a /28 (255.255.255.240) mask to support 14 hosts
netB: requires a /27 (255.255.255.224) mask to support 28 hosts
netC: requires a /30 (255.255.255.252) mask to support 2 hosts
netD*: requires a /28 (255.255.255.240) mask to support 7 hosts
netE: requires a /27 (255.255.255.224) mask to support 28 hosts
* a /29 (255.255.255.248) would only allow 6 usable host addresses
therefore netD requires a /28 mask
Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

41

VLSM Example
Solution: VSLM assign the largest first
netB: 204.15.5.0/27 host address range 1 to 30
netE: 204.15.5.32/27 host address range 33 to 62
netA: 204.15.5.64/28 host address range 65 to 78
netD: 204.15.5.80/28 host address range 81 to 94
netC: 204.15.5.96/30 host address range 97 to 98

NetB: 28 hosts (using a block of 32)


NetE: 28 hosts (using a block of 32)
NetA: 14 hosts (using a block of (16)
NetD: 7 hosts (using a block of (16)
NetC: 2 hosts (using a block of 4)
Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

42

A Working VLSM Example


Subnetting without VLSM:
8 networks
What is the reason?

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

43

A Working VLSM Example


VLSM solution

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

44

A Working VLSM Example

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

45

A Working VLSM Example

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

46

Summarizing Within an Octet


Route summary: reduce routing traffic

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

47

Network Devices
Hub/Repeater
Switch/Bridge
Router/3-layer switch
Gateway

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

48

Network Devices
Hub/Repeater
Propagate signals from
one port to others
Layer 1 devices: connects
segments of a LAN.
Extending a network with
a repeater or a hub,
results in a larger
collision domain.
Collision Domains are the
area where collisions occur.
All of layer 1
interconnections are part of
the collision domain.

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

49

Network Devices
Switch
A multi port bridge
Support full duplex
Hardware switching
Dynamically builds and
maintains a ContentAddressable Memory
(CAM) table
Segmenting Collision
Domain
Can not prevent layer 2
broadcast domain

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

50

Network Devices
Router:
Layer 3 device
Routing packets to
destination based on
destination IP address
Running routing
protocol
Split layer 2 broadcast
domain

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

51

Network Devices
Gateway:
Operate at Application layer in OSI model
Convert data between networks with different protocols

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

52

Switching
link-layer device: smarter
than hubs, take active role

store, forward Ethernet


frames
examine incoming frames
MAC address, selectively
forward frame to one-ormore outgoing links when
frame is to be forwarded on
segment, uses CSMA/CD to
access segment

transparent

hosts are unaware of


presence of switches

plug-and-play, selflearning

switches do not need to be


configured
Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

53

Switching
allows multiple simultaneous
transmissions
hosts have dedicated, direct
connection to switch
switches buffer packets
Ethernet protocol used on each
incoming link, but no collisions;
full duplex
each link is its own collision
domain

switching: A-to-A and B-to-B


simultaneously, without
collisions

A
C

1
5

C
B

switch with six interfaces


(1,2,3,4,5,6)

not possible with dumb hub


Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

54

Switching
Q: how does switch know that
A reachable via interface 4, B
reachable via interface 5?
A: each switch has a switch
table, each entry:

A
C

(MAC address of host, interface to


reach host, time stamp)

looks like a routing table!


Q: how are entries created,
maintained in switch table?
something like a routing protocol?

Telecomm. Dept.
Faculty of EEE

1
5

C
B

switch with six interfaces


(1,2,3,4,5,6)

DCN-2013
HCMUT

55

Switch: self-learning
switch learns which hosts
can be reached through
which interfaces

A A A
C

when frame received,


switch learns location of
sender: incoming LAN
segment
records sender/location pair
in switch table

Telecomm. Dept.
Faculty of EEE

1
5

B
MAC addr interface TTL

Source: A
Dest: A

60

Switch table
(initially empty)
DCN-2013
HCMUT

56

Self-learning, forwarding: example


frame destination
unknown: flood
destination A location
known: selective send
How does self-learning
work if switches can be
connected together?

A A A
B

A6A

A A
MAC addr interface TTL

A
A

Telecomm. Dept.
Faculty of EEE

1
4

60
60

Source: A
Dest: A

Switch table
(initially empty)
DCN-2013
HCMUT

57

Loop problem in learning MAC addresses

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

58

Routing
Router receives packets and
forwards them to the
destination (based on
destination IP)
How does router work?
Check the header of IP
packet
Look up the routing table
Determine the output port
Forward the packet to the
output port

Control Plane

Forwarding
Table

Next Hop + Port

Routing
Packets

Output
Packets
Packet
Classification

Queuing and
Schedule rules

Output
Queue

Input
Packets
Header

payload
User Plane

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

59

Routing
Each router needs running a routing protocol to
update the its routing table
Delay of packets
Queuing delay
Processing delay
Propagation delay

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

60

Routing Protocols: Classification


Global or decentralized information?
Global:
all routers have complete topology, link cost info
link state algorithms
Decentralized:
router knows physically-connected neighbors, link costs to neighbors
iterative process of computation, exchange of info with neighbors
distance vector algorithms
Static or dynamic?
Static:
routes change slowly over time
Dynamic:
routes change more quickly
periodic update
in response to link cost changes

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

61

Routing Algorithms: Link State


Dijkstras algorithm
net topology, link costs
known to all nodes
accomplished via link state
broadcast
all nodes have same info

computes least cost paths


from one node (source) to
all other nodes
gives forwarding table for that
node

Notation:
c(x,y): link cost from node x
to y; = if not direct
neighbors

D(v): current value of cost of


path from source to dest. v

p(v): predecessor node along


path from source to v

N': set of nodes whose least


cost path definitively known

iterative: after k iterations,


know least cost path to k
dest.s
Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

62

Dijkstras algorithm: example


Step
0
1
2
3
4
5

N'
u
u,x
u,x,y
u,x,y,v
u,x,y,v,w
u,x,y,v,w,z

D(v),p(v) D(w),p(w)
2,u
5,u
2,u
4,x
2,u
3,y
3,y

D(x),p(x)
1,u

D(y),p(y)

2,x

D(z),p(z)

4,y
4,y
4,y
5

2
1

Telecomm. Dept.
Faculty of EEE

w
3

DCN-2013
HCMUT

63

Dijkstras algorithm: example


Resulting shortest-path tree from u:
v

z
x

Resulting forwarding table in u:


destination

link

v
x

(u,v)
(u,x)

(u,x)

(u,x)

(u,x)

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

64

Dijkstras algorithm, discussion


Algorithm complexity: n nodes
each iteration: need to check all nodes, w, not in N
n(n+1)/2 comparisons: O(n2)
more efficient implementations possible: O(nlogn)

Oscillations possible:
e.g., link cost = amount of carried traffic
1

D
0
1

A
0 0

1+e

B
e

2+e

D
0

initially
Telecomm. Dept.
Faculty of EEE

A
1+e 1

B
0

recompute
routing

D
1

A
0 0

2+e

B
1+e

recompute

2+e

D
0

A
1+e 1

B
e

recompute
DCN-2013
HCMUT

65

Distance Vector Algorithm


Bellman-Ford Equation (dynamic programming)
Define:

dx(y) := cost of least-cost path from x to y


Then

dx(y) = min {c(x,v) + dv(y) }


where min is taken over all neighbors v of x

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

66

Bellman-Ford example
Clearly, dv(z) = 5, dx(z) = 3, dw(z) = 3

5
2

v
2

w
3

B-F equation says:

du(z) = min { c(u,v) + dv(z),


c(u,x) + dx(z),
c(u,w) + dw(z) }
= min {2 + 5,
1 + 3,
5 + 3} = 4

Node that achieves minimum is next


hop in shortest path forwarding table
Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

67

Distance Vector Algorithm


Dx(y) = estimate of least cost from x to y
Node x knows cost to each neighbor v:
c(x,v)
Node x maintains distance vector
Dx = [Dx(y): y N ]

Node x also maintains its neighbors distance vectors


For each neighbor v, x maintains
Dv = [Dv(y): y N ]

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

68

Distance Vector Algorithm


Basic idea:
From time-to-time, each node sends its own distance
vector estimate to neighbors
Asynchronous
When a node x receives new DV estimate from neighbor, it
updates its own DV using B-F equation:
Dx(y) minv{c(x,v) + Dv(y)} for each node y N
Under minor, natural conditions, the estimate Dx(y)
converge to the actual least cost dx(y)

Telecomm. Dept.
Faculty of EEE

DCN-2013
HCMUT

69

Distance Vector Algorithm


Iterative, asynchronous: each
local iteration caused by:
local link cost change
DV update message from
neighbor

Each node:
wait for (change in local link
cost or msg from neighbor)

Distributed:
each node notifies neighbors

only when its DV changes

neighbors then notify their


neighbors if necessary

Telecomm. Dept.
Faculty of EEE

recompute estimates
if DV to any dest has changed,
notify neighbors

DCN-2013
HCMUT

70

Dx(z) = min{c(x,y) +
Dy(z), c(x,z) + Dz(z)}
= min{2+1 , 7+0} = 3

Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)}


= min{2+0 , 7+1} = 2

node x table

from

x 0 2 7
y
z
node y table
cost to
x y z

cost to
x y z

from

cost to
x y z

x 0 2 3
y 2 0 1
z 7 1 0

x
y 2 0 1
z
node z table
cost to
x y z

from

from

x
y
z 7 1 0
Telecomm. Dept.
Faculty of EEE

Network Layer

time
DCN-2013
HCMUT

71

x
y
z 7 1 0
Telecomm. Dept.
Faculty of EEE

cost to
x y z

x 0 2 3
y 2 0 1
z 7 1 0

x 0 2 3
y 2 0 1
z 3 1 0

from

cost to
x y z

cost to
x y z

cost to
x y z

x 0 2 7
y 2 0 1
z 7 1 0

x 0 2 3
y 2 0 1
z 3 1 0

from

from

from

x
y 2 0 1
z
node z table
cost to
x y z

cost to
x y z

from

from

x 0 2 7
y
z
node y table
cost to
x y z

from

cost to
x y z

x 0 2 7
y 2 0 1
z 3 1 0

cost to
x y z

from

node x table

from

Dx(z) = min{c(x,y) +
Dy(z), c(x,z) + Dz(z)}
= min{2+1 , 7+0} = 3

Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)}


= min{2+0 , 7+1} = 2

x 0 2 3
y 2 0 1
z 3 1 0
time
DCN-2013
HCMUT

72

Distance Vector: link cost changes


Link cost changes:
node detects local link cost change
updates routing info, recalculates

distance vector
if DV changes, notify neighbors
good
news
travels
fast

Telecomm. Dept.
Faculty of EEE

1
4

50

At time t0, y detects the link-cost change, updates its DV,


and informs its neighbors.
At time t1, z receives the update from y and updates its table.
It computes a new least cost to x and sends its neighbors its DV.
At time t2, y receives zs update and updates its distance table.
ys least costs do not change and hence y does not send any
message to z.
DCN-2013
HCMUT

73

You might also like