Transcript Lecture 20

ICOM 6115 – Computer Networks
and the WWW
Manuel Rodriguez-Martinez, Ph.D.
Lecture 20
ICOM 6115
©Manuel Rodriguez-Martinez
Lecture Objectives
• Mathematical background on Graph
Theory
– Basic Definitions
– Representations
– Fundamental Algorithms
• Introduction to Global Internetworking
– Layer 3 – The Network Layer
– IP Protocol
ICOM 6115
©Manuel Rodriguez-Martinez
Directed Graph
• Directed Graph G consists of
– a set of vertices V
– a set of edges E
– Formally, G = (V,E)
• Vertices are used to represent some object
– Like nodes in a tree
• Edges represent a connection between pairs of
vertices
– e = (v1, v2)
• we say v1 is adjacent to v2
• e is an ordered pair
ICOM 6115
©Manuel Rodriguez-Martinez
Example Directed Graphs
G=(V,E)
Ron
Apu
Jil
Mel
• V = {Jil, Mel, Ron, Apu}
• E = {(Jil, Mel), (Mel, Apu), (Jil,Ron), (Ron,
Jil), (Mel, Ron), (Ron, Apu)}
ICOM 6115
©Manuel Rodriguez-Martinez
Path and Cycles
• A path is a sequence of vertices v1, v2, v3,
…, vn, such that vi is adjacent to vi + 1
– (v1,v2), (v2, v3), …(v(n-1), vn)
• Simple path: v1, v2, …, vn
– Where v1 and vn are distinct
• Cycle: v1, v2, …, vn
– Where v1 and vn are the same
• Path Length
– number of edges on the path
ICOM 6115
©Manuel Rodriguez-Martinez
Example Directed Graph
G=(V,E)
Ron
Apu
Jil
Mel
• Example Path
– P1: Jil, Ron, Apu; P2: Mel, Ron, Jil, Ron
– P1: length = 2; P2: length = 3
• Cycle
– C1: Jil, Ron, Jil; C2: Mel, Ron, Jil, Mel
ICOM 6115
©Manuel Rodriguez-Martinez
Undirected Graph
• Undirected Graph G consists of
– a set of vertices V
– a set of edges E
– Formally, G = (V,E)
• Vertices are node used to represent some object
– Like in tree
• Edges represent a connection between pairs of
vertices
– e = (v1, v2)
• we say v1 is adjacent to v2 and vice-versa
• e is not ordered pair, e = (v1,v2) = (v2,v1)
ICOM 6115
©Manuel Rodriguez-Martinez
Example Undirected Graphs
G=(V,E)
Ron
Apu
Jil
Mel
• V = {Jil, Mel, Ron, Apu}
• E = {(Jil, Mel), (Mel, Apu), (Jil,Ron), (Ron,
Jil), (Mel, Ron), (Ron, Apu)}
ICOM 6115
©Manuel Rodriguez-Martinez
Labels and Weights
• Labels
– Information associated with vertices or edges
• Weight
– Often used to denote the label of edges
– Most often, weight are numbers
• Cost function
– Establish a mapping between the labels of
edges and/or nodes and a numeric value
ICOM 6115
©Manuel Rodriguez-Martinez
Example of Cost: Distance between cities
NY
G=(V,E)
10
20
100
DC
90
SJU
110
LA
Shortest Path Between:
SJ U and DC: 30
NY and LA: 100
LA and SJU: 120
ICOM 6115
©Manuel Rodriguez-Martinez
Minimum-Cost Spanning Tree
NY
G=(V,E)
10
20
100
DC
90
SJU
110
LA
• Spanning Tree
– Tree that connects all nodes in the graph
• Minimum-Cost Spanning Tree (MST)
– Graph might have several spanning tree
– MST is the one that has minimal cost amongst all spanning trees
ICOM 6115
©Manuel Rodriguez-Martinez
Internetworking
• What is this?
– Process of connecting independent LANs into
a larger network
• Again: Independent LANs
– Each LAN might have a different Layer 2
• Ethernet
• Token Ring
• 802.11b
• What Layer takes care of this service?
– Network Layer (Layer 3)
ICOM 6115
©Manuel Rodriguez-Martinez
Example internetwork
H1
H2 Network 1 (Ethernet)
H7
R4
Network 5
(Point-to-Point)
Network 4 (Ethernet)
R1
Network 3
(FDDI)
R3
H3
H4
H6
H5
ICOM 6115
R2
Network 2
(802.11b)
©Manuel Rodriguez-Martinez
H8
Layer 3: Store-and-Forward Service
ICOM 6115
©Manuel Rodriguez-Martinez