Tdts21 Ip v00
Tdts21 Ip v00
Tdts21 Ip v00
Networking
Lecture 7: IP and Intra Domain
Routing
AS-1
AS-3
Interior
Routers
AS-2
BGP
Routers
Why Do We Need ASs?
4
Routing algorithms are not efficient enough to execute
on the entire Internet topology
Different organizations
• Easier may use
to compute routes different routing
policies
• Greater flexibility
Allows organizations to hide their internal network
• More autonomy/independence
structure
Allows organizations to choose how to route across
each other (BGP)
5
How to find a good path?
6
Routing on a Graph
7
Assume
A network with N nodes
Each node only knows 5
Its immediate neighbors
3
The cost to reach each neighbor B C 5
2
How does each node learn the 2 1
A 3 F
shortest path to every other
node? 1 D E 2
1
9
Intra-domain Routing Protocols
10
Distance vector
Routing Information Protocol (RIP), based on Bellman-Ford
Routers periodically exchange reachability information with
neighbors
Link state
Open Shortest Path First (OSPF), based on Dijkstra
Each network periodically floods immediate reachability
information to all other routers
Per router local computation to determine full routes
10
Distance Vector Routing
11
What is a distance vector?
Current best known cost to reach a destination
Idea: exchange vectors among neighbors to learn about
lowest cost paths
Destination Cost No entry for C
• Which is best?
n = number of nodes in the graph
d = degree of a given node
• In practice,k it= number
depends.
of rounds
OSPF IS-IS
Organized around overlapping Organized as a 2-level
areas hierarchy
Area 0 is the core network Level 2 is the backbone
Level 1-2
Level 1
Level 2
Area 1 Area 2
Area 0
Area 4
Area 3
16
Possible Addressing Schemes
17
Flat
e.g. each host is identified by a 48-bit MAC address
Router needs an entry for every host in the world
Too big
Too hard to maintain (hosts come and go all the time)
Too slow (more later)
Hierarchy
Addresses broken down into segments
Each segment has a different level of specificity
Example: Telephone Numbers
18
1-617-373-1234
3278
Very General
West Village
West Village G
H
Room1234
Room 256
From www.cidr-report.org
CIDR has kept IP routing table sizes in check
Currently ~500,000 entries for a complete IP routing table
Only required by backbone routers
We had a special day this summer!
23
512K day – August 12, 2014
Default threshold size for IPv4 route data in older Cisco
routers 512K routes
Some routers failed over to slower memory
RAM vs. CAM (content addressable memory)
Some routes dropped
Cisco issues update in May anticipating this issue
Reallocated some IPv6 space for IPv4 routes
http://cacm.acm.org/news/178293-internet-routing-failures-bring-
architecture-changes-back-to-the-table/fulltext
How Do You Get IPs?
24
IP address ranges controlled by IANA
2001:0db8:0000:0000:0000:ff00:0042:8329
2001:0db8:0:0:0:ff00:42:8329
2001:0db8::ff00:42:8329
IPv4 Header
27
IP Datagrams are like a letter
Totally self-contained
Include all necessary addressing information
No advanced setup of connections or circuits
0 4 8 12 16 19 24 31
Version HLen DSCP/ECN Datagram Length
Identifier Flags Offset
TTL Protocol Checksum
Source IP Address
Destination IP Address
Options (if any, usually not)
Data
IPv4 Header
28
IP Datagrams are like a letter
Totally self-contained
Include all necessary addressing information
No advanced setup of connections or circuits
0 4 8 12 16 19 24 31
Version HLen DSCP/ECN Datagram Length
Identifier Flags Offset
TTL Protocol Checksum
Source IP Address
Destination IP Address
Options (if any, usually not)
Data
IPv6 Header
29
Double the size of IPv4 (320 bits vs. 160 bits)
0 4 8 12 16 19 24 31
Version DSCP/ECN Flow Label
Datagram Length Next Header Hop Limit
Version Same
= 6 as IPv4 Groups
Same as IPv4 Same as into Same as TTL in
packets
Source IP Address
Protocol in for
flows, used IPv4
IPv4QoS
Destination IP Address
Deployment Challenges
30
A B C D E F
Physical view:
IPv6 IPv6 IPv4 IPv4 IPv6 IPv6
data data
A-to-B: E-to-F:
B-to-C: B-to-C:
IPv6 IPv6
IPv6 inside IPv6 inside
IPv4 IPv4
34
35
More slides …
36
37
Differences from IPv4 Header
38
Several header fields are missing in IPv6
Header length – rolled into Next Header field
Checksum – was useless, so why keep it
Identifier, Flags, Offset
IPv6 routers do not support fragmentation
Hosts are expected to use path MTU discovery
Dest: 2002:104F:0800::
Dest: 16.79.8.0
IPv4
Internet
IPv4
Internet
IPv4 – 192.88.99.1
IPv6 – 2002:: /16
IPv4 – 207.46.192.0
IPv6 – 2002:CF2E:C000::
IPv6
Many ISPs Internet
provide 6to4
relay routers
IPv6 – 1893:92:13:99::
Routing from Native IPv6 to 6to4
46
IPv4
Internet
IPv4 – 192.88.99.1
IPv6 – 2002:: /16
IPv4 – 207.46.192.0
IPv6 – 2002:CF2E:C000::
Dest: 207.46.192.0
IPv6
Use normal IPv6 Dest: 2002:CF2E:C000::
Internet
routing to reach a
6to4 relay router
IPv6 – 1893:92:13:99::
Problems with 6to4
47
Uniformity
Not all ISPs have deployed 6to4 relays
Quality of service
Third-party 6to4 relays are available
…but, they may be overloaded or unreliable
Reachability
6to4 doesn’t work if you are behind a NAT
Possible solutions
IPv6 Rapid Deployment (6rd)
Each ISP sets up relays for its customers
Does not leverage the 2002:: address space
Teredo
Tunnels IPv6 packets through UDP/IPv4 tunnels
Network Layer, Control Plane
48
Function:
Set up routes within a single network
Key challenges:
Data Plane
Distributing and updating routes
Convergence time
Application Avoiding loops
Transport
Network RIP OSPF BGP Control Plane
Data Link
Physical
Internet Routing
49
AS-1
AS-3
Interior
Routers
AS-2
BGP
Routers
Why Do We Need ASs?
51
Routing algorithms are not efficient enough to execute
on the entire Internet topology
Different organizations
• Easier may use
to compute routes different routing
policies
• Greater flexibility
Allows organizations to hide their internal network
• More autonomy/independence
structure
Allows organizations to choose how to route across
each other (BGP)
Routing on a Graph
52
Assume
A network with N nodes
Each node only knows 5
Its immediate neighbors
3
The cost to reach each neighbor B C 5
2
How does each node learn the 2 1
A 3 F
shortest path to every other
node? 1 D E 2
1
Intra-domain Routing Protocols
54
Distance vector
Routing Information Protocol (RIP), based on Bellman-Ford
Routers periodically exchange reachability information with
neighbors
Link state
Open Shortest Path First (OSPF), based on Dijkstra
Each network periodically floods immediate reachability
information to all other routers
Per router local computation to determine full routes
54
55 Outline
1. Initialization:
2. for all neighbors V do Node C Node D
3. if V adjacent to A Dest. Cost Next Dest. Cost Next
4. D(A, V) = c(A,V); A 7 A A ∞
5. else
6. D(A, V) = ∞; B 1 B B 3 B
… D 1 D C 1 C
Distance Vector: 1st Iteration
59
Node A Node B
3 Dest. Cost Next Dest. Cost Next
B D
2 1 B 2 B A 2 A
1 C 73 CB C 1 C
A 7 C ∞58
D C
B D 32 D
C
…
7. loop:
…
12. else if (update D(V, Y) received from V)
13. for all destinations Y do
14. D(A,C) = min(D(A,C), D(A,B)+D(B,C))
if (destination Y through V) Node D
Node C
15.
16. else
= min(7,
Dest. 2Cost
D(A,Y) = D(A,V) + D(V, Y);
D(A,D) = min(D(A,D), + 1) =3
D(A,B)+D(B,D))
D(A,C)+D(C,D))
Next Dest. Cost Next
17. D(A, Y) = ∞4
min(D(A, Y), = min(8,
min(∞,
A 2773 + 3)
1)AB= 58 A B
D(A, V) + D(V, Y)); B 1 B B 3 B
18. if (there is a new min. for dest. Y) D 1 D C 1 C
19. send D(A, Y) to all neighbors
20. forever
Distance Vector: End of 3rd Iteration
60
Node A Node B
3 Dest. Cost Next Dest. Cost Next
B D
2 1 B 2 B A 2 A
1 C 3 B C 1 C
A 7 C 4
D B D 2 C
…
7. loop:
…
12. • Nothing changes, algorithm terminates
else if (update D(V, Y) received from V)
13. for all destinations Y do
14. • Until something changes…
if (destination Y through V)
Node C Node D
15. D(A,Y) = D(A,V) + D(V, Y);
16. else Dest. Cost Next Dest. Cost Next
17. D(A, Y) = A 3 B A 4 C
min(D(A, Y),
D(A, V) + D(V, Y)); B 1 B B 2 C
18. if (there is a new min. for dest. Y) D 1 D C 1 C
19. send D(A, Y) to all neighbors
20. forever
7. loop:
8. wait (link cost update or update message)
9. if (c(A,V) changes by d)
10. for all destinations Y through V do
61
11. D(A,Y) = D(A,Y) + d B
12. else if (update D(V, Y) received from V) 4
1 1
13. for all destinations Y do
14. if (destination Y through V)
15. D(A,Y) = D(A,V) + D(V, Y); A 50 C
16. else
17. D(A, Y) = min(D(A, Y), D(A, V) + D(V, Y));
18.
Link Cost Changes,
if (there is a new minimum for destination Y)
Algorithm
19. Good news travels fast
send D(A, Y) to all neighbors
20. Algorithm Starts
forever Terminates
D C N D C N D C N D C N
Node B A 4 A A 1 A A 1 A A 1 A
C 1 B C 1 B C 1 B C 1 B
D C N D C N D C N D C N
Node C A 5 B A 5 B A 2 B A 2 B
B 1 B B 1 B B 1 B B 1 B
Time
Count to Infinity Problem
62
D C N D C N D C N D C N
Node C A 5 B A 5 B A 7 B A 7 B
B 1 B B 1 B B 1 B B 1 B
Time
Poisoned Reverse
63
If C routes through B to get to A
B
C tells B that D(C, A) = ∞ 4
60 1
Thus, B won’t route to A via C
Does this completely solve this count A to50 C
infinity problem?
D C N D C N NO D C N D C N
Node B A 4 A A 60 A A 60 A A 51 C
Multipath
C 1 B loops C can
1 B still trigger
C 1 B the issue
C 1 B
D C N D C N D C N D C N
Node C A 5 B A 5 B A 50 A A 50 A
B 1 B B 1 B B 1 B B 1 B
Time
64 Outline
OSPF IS-IS
Favored by companies, Favored by ISPs
datacenters
More optional features
Less “chatty”
Less network overhead
Supports more devices
Not tied to IP
Built on top of IPv4 Works with IPv4 or IPv6
LSAs are sent via IPv4
OSPFv3 needed for IPv6
Different Organizational Structure
69
OSPF IS-IS
Organized around overlapping Organized as a 2-level
areas hierarchy
Area 0 is the core network Level 2 is the backbone
Level 1-2
Level 1
Level 2
Area 1 Area 2
Area 0
Area 4
Area 3
Link State vs. Distance Vector
70
• Which is best?
n = number of nodes in the graph
d = degree of a given node
• In practice,k it= number
depends.
of rounds