Download ECE544 - WINLAB

Document related concepts

Internet protocol suite wikipedia , lookup

Point-to-Point Protocol over Ethernet wikipedia , lookup

Piggybacking (Internet access) wikipedia , lookup

AppleTalk wikipedia , lookup

Network tap wikipedia , lookup

Computer network wikipedia , lookup

Asynchronous Transfer Mode wikipedia , lookup

Backpressure routing wikipedia , lookup

Wake-on-LAN wikipedia , lookup

Multiprotocol Label Switching wikipedia , lookup

Airborne Networking wikipedia , lookup

List of wireless community networks by region wikipedia , lookup

Zero-configuration networking wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

CAN bus wikipedia , lookup

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

IEEE 1355 wikipedia , lookup

Dijkstra's algorithm wikipedia , lookup

Kademlia wikipedia , lookup

Everything2 wikipedia , lookup

IEEE 802.1aq wikipedia , lookup

Routing wikipedia , lookup

Routing in delay-tolerant networking wikipedia , lookup

Transcript
ECE544: Communication Networks-II
Spring 2009
H. Liu
Lecture 4
Includes teaching materials from D. Raychaudhuri, L. Peterson
Today’s Lecture
• IP basics
• Routing principles
– distance vector (RIP)
– link state (OSPF)
IP Basics
Best Effort Service Model
Global Addressing Scheme
ARP & DHCP
IP Internet
• A network of networks
– Heterogeneity: inter-connect a
collection of physical networks
with various technologies
(Ethernet, token-ring, …)
Network 1 (Ethernet)
H7
H2
H1
Network 4
(point-to-point)
R1
R2
H4
Network 3 (FDDI)
• Protocol Stack
H5
H6
H8
H1
Appl.
Appl.
TCP
R1
ETH
R2
IP
IP
ETH
R3
IP
FDDI
FDDI
IP
PPP
H8
H3
Network 2 (Ethernet)
– Scalability: Capable to grow to
many nodes (size doubled every
year)
• Hierarchical addressing and
routing
R3
PPP
TCP
IP
ETH
ETH
Service Model
• Connectionless (datagram-based)
• Best-effort delivery (unreliable service)
–
–
–
–
packets are lost
packets are delivered out of order
duplicate copies of a packet are delivered
packets can be delayed for a long time
• Keep router simple
Packet Format
• Packet format
0
4
Version
8
HLen
16
TOS
31
Length
Ident
TTL
19
Flags
Protocol
Offset
Checksum
SourceAddr
DestinationAddr
Options (variable)
Pad
(variable)
Data
•
•
•
•
•
HLen: the length of header in 32-bit word
Length: the length of the datagram, including header in bytes
TOS: or Differentiated Services (DS) field, 2-bit Explicit Congestion Notification
(ECN) + 6-bit Differentiated Services Code Point (DSCP)
Ident: identifier set by source, unique over some reasonable time period.
Checksum: only for header
Fragmentation and Reassembly
• Each network has some Maximum Transmission Unit
(MTU)
• Strategy
– fragment when necessary (MTU < Datagram) by
router
– try to avoid fragmentation at source host
– re-fragmentation is possible
– fragments are self-contained datagrams
– delay reassembly until destination host
– do not recover from lost fragments
• If one fragment is lost, the destination discards
other fragments of this datagram
– For ATM, frame is CS-PDU
Example
Start of header
Ident= x
0
Offset= 0
Rest of header
1400 data bytes
H1
R1
R2
R3
H8
Start of header
ETH IP (1400)
•
•
FDDI IP (1400)
PPP IP (512)
ETH IP (512)
PPP IP (512)
ETH IP (512)
Rest of header
PPP IP (376)
ETH IP (376)
512 data bytes
Ident= x
Flags:
1
Start of header
–
Reserved; must be zero.
–
Don't Fragment (DF): drop if datagram > MTU
Rest of header
–
More Fragments (MF): set to 1 if fragmented (except the last
fragment)
512 data bytes
Offset: measured in units of eight-byte blocks
–
fragmentation always happens on 8-byte boundaries
–
16-bit length (max 65,535)/8=>max possible offset value fit
in 13 bit offset filed
Offset= 0
Ident= x
1 Offset= 64
Start of header
Ident= x
0 Offset= 128
Rest of header
376 data bytes
Global Addresses
•
•
•
•
•
•
Properties
– globally unique
– hierarchical: network + host
A:
B:
Private addresses
– 10.0.0.0 - 10.255.255.255
– 172.16.0.0 - 172.31.255.255
– 192.168.0.0 - 192.168.255.255 C:
Multicast addresses (class D):
224.0.0.0 to 239.255.255.255
Router:
– Each interface has its own
address
Assigned by The Internet Assigned
Numbers Authority (IANA)
0
7
24
Network
Host
1 0
1 1 0
14
16
Network
Host
21
8
Network
Host
Datagram Forwarding
• Strategy
– every datagram contains destination’s address
– if directly connected to destination network, then forward to
node
• Compare the network part of the dest. address
– if not directly connected to destination network, then forward
to some router
– forwarding table maps network number into next hop
– each host has a default router
– each router maintains a forwarding table
• Example (R2)
Network Number
Next Hop
1
R3
2
R1
3
Interface 1
4
Interface 0
Address Translation
• Map IP addresses into physical hardware
addresses (e.g. Ethernet MAC address)
– destination host
– next hop router
• Techniques
– encode physical address in host part of IP address
– table-based
• Address Resolution Protocol (ARP)
–
–
–
–
table of IP to MAC address bindings
broadcast ARP query if IP address not in table
target machine responds with its physical address
table entries are discarded if not refreshed
0
8
ARP Details
16
Hardware type = 1
HLen = 48
PLen = 32
31
ProtocolT ype = 0x0800
Operation
SourceHardwareAddr (bytes 0 – 3)
SourceHardwareAddr (bytes 4 – 5) SourceProtocolAddr (bytes 0 – 1)
SourceProtocolAddr (bytes 2 – 3) TargetHardwareAddr (bytes 0 – 1)
TargetHardwareAddr (bytes 2 – 5)
TargetProtocolAddr (bytes 0 – 3)
•
•
Format
– HardwareType: type of physical network (e.g., Ethernet)
– ProtocolType: type of higher layer protocol (e.g., IP)
– HLEN & PLEN: length of physical and protocol addresses
– Operation: request or response
– Source/Target-Physical/Protocol addresses
Notes
– table entries timeout in about 10 minutes
– ARP request contains the source’s IP address and MAC address
• Target updates its ARP table with source’s IP-MAC address mapping
• Refresh the table entry for source’s IP-MAC address mapping if a node
already has an entry for the source
• Otherwise, do not refresh the table entries
•
ATM ARP
ATM ARP for mapping IP<->ATM addr
– medium is not a broadcast type unlike Ethernet
– requires servers which maintain ARP tables
• Configure each node with the ARP server’s ATM address
• Set up VC to the server
• Register the IP and ATM addresses with the server
• To send data to an IP address
– Obtain dest.’s IP-ATM address mapping from the server
– setup the ATM VC to the destination
– concept of multiple “logical IP subnets” (LIS)
• Divided a large ATM into a number of LISs connected by routers
10.0.0.2
H1
R
12.0.0.3
10.0.0.1
12.0.0.5
H2
LIS 10
LIS 12
ATM netw ork
Dynamic Host Control Protocol (DHCP)
• DHCP server per network for IP address assignment
• Static list of IP<->physical addr or dynamic binding from
common address pool
• Host boot-up via well-known broadcast address
255.255.255.255 to send DHCPDISCOVER
• DHCP server reply with assigned IP address, default router, etc.
• The IP address is “leased” to the host for some period of time
– Renew the lease periodically before expire
• DHCP “relay agent” can be used to avoid one server per
network
Dynamic Host Control Protocol (DHCP)
• DHCP packet format (runs over UDP)
Operation
HType
HLen
Unicast to server
Hops
Xid
Flag
Secs
Other networks
ciaddr
Broadcast
yiaddr
siaddr
giaddr
chaddr (16B)
....
Host
DHCP
relay
DHCP
server
Internet Control Message Protocol (ICMP)
•
Network utilities:
–
•
•
•
•
•
•
Ping utility is implemented using the ICMP "Echo request" and "Echo reply" messages
• Alive, delay measurement
Redirect (from router to source host)
– Host connected to a network with two or more routers
– One router finds it is better to use another router to reach a destination host
or network
Destination unreachable (protocol, port, or host)
TTL exceeded (so datagrams don’t cycle forever)
Checksum failed
Reassembly failed
Type
Code
checksum
Cannot fragment
ID
sequence
Routing Basics
Routing Problem
•
•
•
Routing Problem: How to find the lowest cost path between two nodes
– the process to build the routing and forwarding tables in each
router
Network as a Graph
– Each edge has a cost
– Path cost = the sum of the costs of all the edges that make up the
path.
Factors
– dynamic: link, node, topology, link cost changes
A
6
1
3
4
C
2
1
B
9
E
1
D
F
Two main approaches
• DV: Distance-vector protocols
• LS: Link state protocols
• Variations of above methods applied to:
– Intra-domain routing (small/med networks)
• RIP, OSPF
• Domain: an internetwork in which all the routers are
under the same administrative control (e.g. a single
internet service provider, an university)
– Inter-domain routing (large/global networks)
• BGP-4
Distance Vector Protocols
• Employed in the early Arpanet
• Each node constructs a vector containing the “distances” (costs)
to all other nodes
• Distributes the vector to its immediate neighbors.
– Information exchange
• vector of distances to destinations
• Distributed next hop computation
– Distributed Bellman-Ford Algorithm
• Assumption:
– Each node knows the cost of the link to each of its direct neighbor
• Can be configured or other means (e.g. measuring data rate, delay,
packet loss rate, and estimating according to a metric)
– Link down = infinite cost
Distance Vector
•
•
•
•
•
Each node maintains a set of triples
– (Destination, Cost, NextHop)
Exchange updates with directly connected neighbors
– periodically (on the order of several seconds) even nothing changes
• Let others know it is running
• Refresh the route
– whenever routing table changes (called triggered update)
• Detect link or node failure
– “Hello” message exchange between neighbors
– Does not receive the expected periodical routing updates for the
last few update cycles.
• Receive an update from another router that causes it to change its
routing table
Each update is a list of pairs:
– (Destination, Cost)
Update local table if receive a “better” route
– smaller cost
– came from next-hop
Refresh existing routes; delete if they time out
Distributed Bellman-Ford
Start Conditions:
Each router starts with a vector of distances
to all directly attached networks
Send step:
Each router advertises its current vector to all
neighboring routers.
Receive step:
Upon receiving vectors from each of its neighbors,
router computes its own distance to each neighbor.
Then, for every network X, router finds that neighbor
who is closer to X than any other neighbor.
Router updates its cost to X. After doing this
for all X, router goes to send step.
Example - initial distances
1
B
C
Info at
node
7
8
A
1
E
2
2
D
Distance to node
A
B
C
D
E
0
7
~
~
1
C
7
~
0
1
1
0
~
2
8
~
D
~
~
2
0
2
E
1
8
~
2
0
A
B
E receives D’s routes
1
B
C
Info at
node
7
8
A
1
E
2
2
D
Distance to node
A
B
C
D
E
0
7
~
~
1
C
7
~
0
1
1
0
~
2
8
~
D
~
~
2
0
2
E
1
8
~
2
0
A
B
E updates cost to C
1
B
C
Info at
node
7
8
A
1
E
2
2
D
Distance to node
A
B
C
D
E
0
7
~
~
1
C
7
~
0
1
1
0
~
2
8
~
D
~
~
2
0
2
E
1
8
4
2
0
A
B
A receives B’s routes
1
B
C
Info at
node
7
8
A
1
E
2
2
D
Distance to node
A
B
C
D
E
0
7
~
~
1
C
7
~
0
1
1
0
~
2
8
~
D
~
~
2
0
2
E
1
8
4
2
0
A
B
A updates cost to C
1
B
C
Info at
node
7
8
A
1
E
2
2
D
Distance to node
A
B
C
D
E
0
7
8
~
1
C
7
~
0
1
1
0
~
2
8
~
D
~
~
2
0
2
E
1
8
4
2
0
A
B
A receives E’s routes
1
B
C
Info at
node
7
8
A
1
E
2
2
D
Distance to node
A
B
C
D
E
0
7
8
~
1
C
7
~
0
1
1
0
~
2
8
~
D
~
~
2
0
2
E
1
8
4
2
0
A
B
A updates cost to C and D
1
B
C
Info at
node
7
8
A
1
E
2
2
D
Distance to node
A
B
C
D
E
0
7
5
3
1
C
7
~
0
1
1
0
~
2
8
~
D
~
~
2
0
2
E
1
8
4
2
0
A
B
Final distances
1
B
C
Info at
node
7
8
A
1
E
2
2
D
Distance to node
A
B
C
D
E
0
6
5
3
1
C
6
5
0
1
1
0
3
2
5
4
D
3
3
2
0
2
E
1
5
4
2
0
A
B
Final distances after link
failure
1
B
C
Info at
node
7
8
A
1
E
2
2
D
Distance to node
A
B
C
D
E
A
B
0
7
8
10
1
7
0
1
3
8
C
8
1
0
2
9
D
10 3
2
0
11
E
1
9
11
0
8
View from a node
1
B
E’s routing table
Next hop
C
7
8
A
1
E
2
2
D
dest
A
B
D
A
B
1
14
5
C
7
6
8
9
5
4
D
4
11
2
Distance Vector Example
2
R1
4
R2
R3
9
R5
1
4
R4
Info at
Node
R1
R2
R3
R4
R5
R1
R2
R3
R4
R5
0
4
-
4
0
2
4
-
2
0
1
9
4
1
0
-
9
0
DV Example (cont.)
2
R1
4
R2
R3
9
R5
1
4
R4
Info at
Node
R1
R2
R3
R4
R5
R1
R2
R3
R4
R5
0
4
6
8
-
4
0
2
3
11
6
2
0
1
9
8
3
1
0
10
11
9
10
0
DV Example (cont.)
2
R1
4
R2
R3
9
R5
1
4
R4
Info at
Node
R1
R2
R3
R4
R5
R1
R2
R3
R4
R5
0
4
6
7
15
4
0
2
3
11
6
2
0
1
9
7
3
1
0
10
15
11
9
10
0
DV Example – after link R2-R3 breaks
R3
R1
4
R2
9
R5
1
4
R4
Info at
Node
R1
R2
R3
R4
R5
R1
R2
R3
R4
R5
0
4
6
7
15
4
0
3
11
6
0
1
9
7
3
1
0
10
15
11
9
10
0
DV Example – after link R2-R3 breaks
R3
R1
4
R2
9
R5
1
4
R4
Info at
Node
R1
R2
R3
R4
R5
R1
R2
R3
R4
R5
0
4
-
4
0
4
14
0
1
9
4
1
0
10
14
9
10
0
DV Example – after link R2-R3 breaks
R3
R1
4
R2
9
R5
1
4
R4
Info at
Node
R1
R2
R3
R4
R5
R1
R2
R3
R4
R5
0
4
9
8
18
4
0
5
4
14
9
5
0
1
9
8
4
1
0
10
18
14
9
10
0
The bouncing effect
dest cost Next
hop
B
1
B
C
2
B
1
A
B
1
25
C
dest cost Next
hop
A
2
B
B
1
B
dest cost Next
hop
A
1
A
C
1
C
C sends routes to B
dest cost Next
hop
B
C
25
C
A
B
1
25
C
dest cost Next
hop
A
2
B
B
1
B
dest cost Next
hop
A
C
1
B
B updates distance to A
dest cost Next
hop
B
C
25
C
A
B
1
25
C
dest cost Next
hop
A
2
B
B
1
B
dest cost Next
hop
A
3
C
C
1
B
B sends routes to C
dest cost Next
hop
B
C
25
C
A
B
dest cost Next
hop
A
3
C
C
1
B
1
25
C
dest cost Next
hop
A
4
B
B
1
B
C sends routes to B
dest cost Next
hop
B
C
25
C
A
B
1
25
C
•
Count to infinity
dest cost Next
hop
A
5
C
C
1
B
dest cost Next
hop
A
4
B
B
1
B
How are these loops caused?
• Observation 1:
– B’s metric increases
• Observation 2:
– C picks B as next hop to A
– But, the implicit path from C to A includes
itself!
Avoiding the Bouncing Effect
• Select loop-free paths
• Use a relatively small number as infinity (partial solution)
– E.g. the max number of hops across a network < 16,
– pick 16 => infinity
• Bounds the time to count to infinity
• However, problem if the network grows to a point where
some nodes are separated by more than 16
• Each route advertisement carries entire path
– if a router sees itself in path, it rejects the route
• Split horizon:
– A node does not send the routes it learned from a neighbor
to that neighbor
• E.g. B has a route (E, 2, A), does not include (E, 2) in the
routing update to A
– Only work for routing loops involved in two nodes
• Split horizon with poison reverse
– B sends (E, infinity) to A, A will not use B to get to E.
– Once again, Only work for routing loops involved in two
nodes
Distance Vector in Practice
•
RIP and RIPv2
–
–
–
–
–
RIP is a UDP-based protocol
uses split-horizon/poison reverse
Cost: Hop count
The special address 0.0.0.0 is used to describe a default route.
RIP2: carry subnet information, support for variable length subnet masks
(VLSM), MD5 authentication
– RIPv2 multicasts routing updates to 224.0.0.9, as opposed to RIP which uses
broadcast
command
Version
address family identifier 1
Must be zero
Route Tag 1 (only for RIP2)
IPv4 address 1
Subnet Mask 1 (only for RIP2, zero for RIP1)
Next Hop 1 (only for RIP2, zero for RIP1)
Cost/Metric 1
address family identifier 2
More destinations
Route Tag 2
Link State Routing
• Assumptions: Each node knows
– The state of links to its neighbors
– The cost of each link
• Step 1: Each node broadcasts its link state
information to all other nodes
– Each node obtains the knowledge of all the links in
the network
• Step 2: Each node locally computes shortest
paths to all other nodes from the collected
link-state knowledge of the complete
network.
Link State Routing: Building
blocks
• Reliable broadcast mechanism
– Reliable Flooding
• All the nodes get a copy of link state info from all other
nodes
• Consistent network view
– sequence number in each link-state message
• Which link-state message is more recent.
– Acknowledgements and retransmissions
• Shortest path tree (SPT) algorithm
– Dijkstra’s algorithm
Link state packets (LSPs)
• Periodical updates: each node creates a Link state
packet (LSP) periodically, containing:
– Node ID
– List of neighbors and link cost
– Sequence number
• Increase by 1 for each new message
– Time to live (TTL)
• Triggered Updates: create a new LSP when the linkstate to one of its neighbors changes
– Periodic “Hello” packets for link and node failure detection
• Node outputs LSP on all its links
• New LSP flooded over the network
Reliable flooding
• When node i receives LSP generated by
node j:
– If LSP is the more recent LSP from j that i
has seen before (sequence # is larger), i
saves it in database and forwards a copy
on all links except link LSP was received
on.
– Otherwise, discard LSP.
SPT algorithm (Dijkstra)
• SPT = {s}, itself
• for all nodes n
– if n adjacent to s then D(n) = cost (s, n)
– else D(n) = infinity
• Loop
– find a node w not in SPT, where D(w) is min
– add w in SPT
– for all n adjacent to w and not in SPT
• D(n) = min (D(n), D(w) + L(w, n))
• until all nodes are in SPT
Link State Algorithm
Flooding:
1) Periodically distribute link-state
advertisement (LSA) to neighbors
2) Install received LSA in LS database
3) Re-distribute LSA to all neighbors
Path Computation
1) Use Dijkstra’s shortest path algorithm
to compute distances to all destinations
2) Install <destination, nexthop> pair in
forwarding table
Implementation of Dijkstra’s Algorithm (Method 1)
Forward search algorithm (an implementation of Dijkstra)
• Maintain two lists: Tentative, Confirmed
• Initialization: Confirmed ={ (s, cost=0, nexthop=-)}, itself
• Iterative:
– For a newly added node in Confirmed, called “Next”, select its LSP
• for each neighbor of “Next” , v, and v not in Confirmed,
– calculate the cost to v via “Next”
– D(v) = D(Next) + L(Next, v)
– If v is not inTentative, Add (v, D(v), Nexthop) to Tentative
– if v is in Tentative but D(v) = D(Next) + L(Next, v) <
currently listed cost, replace the current entry with (v,
D(v), Nexthop) in Tentative
• If Tentative is empty, stop
• Otherwise, move the lowest cost entry in Tentative to
Confirmed, go to step new entry process in Confirmed
Dijkstra/OSPF Method 1
2
R1
4
R2
R3
9
R5
1
4
R4
Step #
Confirmed
(R#, cost, next hop)
Tentative
(R#, cost, next hop)
1
(R1,0,-)
-
2
(R1,0,-)
(R2,4,R2)
3
(R1,0,-)
(R2,4,R2)
(R3,6,R2)
(R4,8,R2)
Dijkstra/OSPF Method 1
2
R1
4
R2
R3
9
R5
1
4
R4
Step #
Confirmed
Tentative
(R#, cost, next hop)
(R#, cost, next hop)
4
(R1,0,-)
(R2,4,R2)
(R3,6,R2)
(R4,8,R2)
(R4,7,R2)
(R5,15,R2)
5
(R1,0,-)
(R2,4,R2)
(R3,6,R2)
(R4,7,R2)
(R5,15,R2)
Dijkstra/OSPF Method 1
2
R1
4
R2
R3
9
R5
1
4
R4
Step #
6
Confirmed
Tentative
(R#, cost, next hop)
(R#, cost, next hop)
(R1,0,-)
(R2,4,R2)
(R3,6,R2)
(R4,7,R2)
(R5,15,R2)
Dijkstra
SPT
Method
2
5
B
2
A
2
1
D
B
step
0
SPT
A
3
1
C
3
1
C
E
D
5
F
2
E
F
D(b), P(b) D(c), P(c) D(d), P(d) D(e), P(e) D(f), P(f)
2, A
5, A
1, A
~
~
Dijkstra SPT Method 2
5
B
2
A
2
1
D
B
step
0
1
SPT
A
AD
3
1
C
3
1
C
E
D
5
F
2
E
F
D(b), P(b) D(c), P(c) D(d), P(d) D(e), P(e) D(f), P(f)
2, A
5, A
1, A
~
~
2, A
4, D
2, D
~
Dijkstra SPT Method 2
5
B
2
A
2
1
D
B
step
0
1
2
SPT
A
AD
ADE
3
1
C
3
1
C
E
D
5
F
2
E
F
D(b), P(b) D(c), P(c) D(d), P(d) D(e), P(e) D(f), P(f)
2, A
5, A
1, A
~
~
2, A
4, D
2, D
~
2, A
3, E
4, E
Dijkstra SPT Method 2
5
B
2
A
2
1
D
B
step
0
1
2
3
SPT
A
AD
ADE
ADEB
3
1
C
3
1
C
E
D
5
F
2
E
F
D(b), P(b) D(c), P(c) D(d), P(d) D(e), P(e) D(f), P(f)
2, A
5, A
1, A
~
~
2, A
4, D
2, D
~
2, A
3, E
4, E
3, E
4, E
Dijkstra SPT Method 2
5
B
2
A
2
1
D
B
step
0
1
2
3
4
SPT
A
AD
ADE
ADEB
ADEBC
3
1
C
3
1
C
E
D
5
F
2
E
F
D(b), P(b) D(c), P(c) D(d), P(d) D(e), P(e) D(f), P(f)
2, A
5, A
1, A
~
~
2, A
4, D
2, D
~
2, A
3, E
4, E
3, E
4, E
4, E
Dijkstra SPT Method 2
5
B
2
A
2
1
D
B
step
0
1
2
3
4
5
SPT
A
AD
ADE
ADEB
ADEBC
ADEBCF
3
1
C
3
1
C
E
D
5
F
2
E
F
D(b), P(b) D(c), P(c) D(d), P(d) D(e), P(e) D(f), P(f)
2, A
5, A
1, A
~
~
2, A
4, D
2, D
~
2, A
3, E
4, E
3, E
4, E
4, E
Link State in Practice
• OSPF (Open Shortest Path First
Protocol)
– most commonly used routing protocol in
the Internet
– support for authentication, addl hierarchy
(partition a domain into areas), load
balancing (multiple routes to the same
place)
OSPF Link-State Advertisement
LS Age
Options
Type=1
Link state ID
Advertising router
LS sequence number
LS checksum
0
Flags
Length
0
Number of links
Link ID
Link data
Link type
Num_TOS
Metric
Optional TOS information
More links
Link State Characteristics
• With consistent Link State Databases
(LSDBs), all nodes compute consistent loopfree paths
• Limited by Dijkstra computation overhead,
space requirements
• Can still have transient loops
B
1
Packet from C->A
may loop around BDC
A
1
3
5
C
2
D
OSPF Sequencing and Aging
• 32-bit sequence number field, does not wrap
• LSP’s compared on basis of sequence number
– To get most recent message
• LSP’s purged after about an hour
– To remove old link-state info from the network
• Synchronized expiration of LSPs
– expired LSP reflooded with age zero
– Tell other nodes to delete this LSP
• On startup, router need not wait
– can start with lowest sequence number
– will be informed if its own LSP is in network
Problem: Router Failure
• A failed router and comes up but does
not remember the last sequence number
it used before it crashed
• New LSPs may be ignored if they have
lower sequence number
One solution: LSP Aging
• Nodes periodically decrement age (TTL) of stored
LSPs
• LSPs expire when TTL reaches 0
– LSP is re-flooded once TTL = 0
• Rebooted router waits until all LSPs have expired
• Trade-off between frequency of LSPs periodic
updates (overhead) and router wait after reboot
Link Metrics
• Simplest: assign a cost of 1 to all links (static metric)
– Hop count, least cost path = the fewest hops
– good only if links are homogeneous
– not the case in the Internet
• Consider link data rate, delay, load, etc.
– Stability is important
– Load is more dynamic and hard to measure
• Examples
– Queue size
– Delay = (DepartTime – ArrivalTime) + TransmissionTime +
Latency
– Link Utilization
– 1/link_bandwidth
Routing metric v.s. link utilization
225
New metric (routing units)
9.6 Kbps satellite link
140
90
75
60
30
9.6 Kbps terrestrial link
56 Kbps satellite link
56 Kbps terrestrial link
0
25%
50%
75%
100%
Utilization
•
Cost = f(link utilization, link capacity, link latency), heuristic, from experiments
–
–
Smooth the variation of the metric with time
Compress the dynamic range of the metric
–
Account for the link type
•
•
Cost of highly loaded link never more than 3*cost when idle
Most expensive link is 7 * least expensive link
•
High-speed satellite link is more attractive than low-speed terrestrial link
Distance Vector vs. Link State
Distance Vector
• A node exchanges
routing info only with its
directly connected
neighbors
• Exchanged routing info:
distance to all nodes in
its routing table
(everything this node
has learned)
• Route computation:
Distributed BellmanFord
Link State
• A node floods its linkstate advertisement to
all the nodes in the
network
• Exchanged routing info:
the state of the links to
its directly connected
links
• Route computation:
Dijkstra’s algorithm
Layer 2 vs. Layer 3
• Layer 2 switching
– Based on MAC address
– Self configuring and
plug & play
– Transparent to
protocols above the
MAC layer
– Fast and inexpensive
– Flat
– Does not scale to
extremely large
networks
– Does not limit the
scope of broadcasts
• Layer 3 routing
– Based on IP address
– Must get IP address
(DHCP or manual assign)
– Easily connect LANs that
uses different link
protocols
(heterogeneous)
– Hierarchical addressing
– Scalable to large network
by subnet routing
– Broadcast limited only in
a subnet
Today’s Homework
• Peterson & Davie, Chap 4
-4.12
-4.13
-4.16
-4.21
Download and browse RIP and OSPF RFC’s
Due on Fri (2/27)
73