Beruflich Dokumente
Kultur Dokumente
Layer
Raj Jain
Washington University in Saint Louis
Saint Louis, MO 63130
Jain@wustl.edu
Audio/Video recordings of this lecture are available on-line at:
http://www.cse.wustl.edu/~jain/cse473-11/
Washington University in St. Louis
CSE473S
4-1
Overview
1.
2.
3.
4.
CSE473S
4-2
Overview
1.
2.
3.
4.
5.
CSE473S
4-3
TCP
IPv4
Ethernet
Coax
ICMP
UDP
IPv6
Point-to-Point
Fiber
Wi-Fi
Wireless
CSE473S
4-4
126.23.45.67
Prefix
126.23.45.67/32
128.272.15/24
128.272/16
125.200.1.1
125.200.1.2
Next Router
125.200.1.1
125.200.1.2
125.200.1.1
128.272.15.2
Interface
1
2
1
Optional Homework: R3
Washington University in St. Louis
CSE473S
4-5
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 16 eb 05 af c0 ...... Intel(R) WiFi Link 5350 - Packet Scheduler Miniport
0x3 ...00 1f 16 15 7c 41 ...... Intel(R) 82567LM Gigabit Network Connection - Packet Scheduler Miniport
0x40005 ...00 05 9a 3c 78 00 ...... Cisco Systems VPN Adapter - Packet Scheduler Miniport
===========================================================================
===========================================================================
Active Routes:
Network Destination
Netmask
Gateway
Interface Metric
0.0.0.0
0.0.0.0
192.168.0.1
192.168.0.108
10
0.0.0.0
0.0.0.0
192.168.0.1
192.168.0.106
10
127.0.0.0
255.0.0.0
127.0.0.1
127.0.0.1
1
169.254.0.0
255.255.0.0
192.168.0.106
192.168.0.106
20
192.168.0.0
255.255.255.0
192.168.0.106
192.168.0.106
10
192.168.0.0
255.255.255.0
192.168.0.108
192.168.0.108
10
192.168.0.106 255.255.255.255
127.0.0.1
127.0.0.1
10
192.168.0.108 255.255.255.255
127.0.0.1
127.0.0.1
10
192.168.0.255 255.255.255.255
192.168.0.106
192.168.0.106
10
192.168.0.255 255.255.255.255
192.168.0.108
192.168.0.108
10
224.0.0.0
240.0.0.0
192.168.0.106
192.168.0.106
10
224.0.0.0
240.0.0.0
192.168.0.108
192.168.0.108
10
255.255.255.255 255.255.255.255
192.168.0.106
192.168.0.106
1
255.255.255.255 255.255.255.255
192.168.0.106
40005
1
255.255.255.255 255.255.255.255
192.168.0.108
192.168.0.108
1
Default Gateway:
192.168.0.1
===========================================================================
Persistent Routes:
None
CSE473S
4-6
Homework 4A
Use Route Help (or man route) to learn the route command
Ping www.google.com to find its address
Make sure that you are connected via wired Ethernet to Internet and that
wireless link is also available
Disable wireless. Run ipconfig (ifconfig on Mac) to find your available
links.
Print route table
Trace route to www.google.com using tracert
Enable Wireless. Run ipconfig to ensure that both wired and wireless links
are available.
Print Route table.
Modify routing table so that preferred path for www.google.com (just one
address) is via wireless interface
Print the new routing table
Trace route to www.google.com and verify
Note the command you used to modify the routing table and submit (one
line only).
CSE473S
4-7
Ideal Buffering
Source
Destination
Ack
CSE473S
4-15
Average Q
CSE473S
4-16
Head-of-Line Blocking
CSE473S
4-17
CSE473S
4-18
Overview
1.
2.
3.
4.
5.
6.
7.
8.
Forwarding Protocols
CSE473S
4-19
IP Datagram Format
IP protocol version
number
header length
(bytes)
type of data
max number
remaining hops
(decremented at
each router)
upper layer protocol
to deliver payload to
32 bits
ver head. type of
len service
length
fragment
16-bit identifier flgs
offset
upper
time to
header
layer
live
checksum
for
fragmentation/
reassembly
data
(variable length,
typically a TCP
or UDP segment)
total datagram
length (bytes)
CSE473S
4-20
E.g. timestamp,
record route
taken, specify
list of routers
to visit.
IP Fragmentation Fields
CSE473S
4-21
Example
4000 byte datagram
MTU = 1500 bytes
1480 bytes in
data field
offset =
1480/8
1480
Len=1500
20 1480
Len=1500
20 1020
CSE473S
4-22
1858
Len=1040
Len=4000
2011 Raj Jain
Homework 4B
CSE473S
4-23
IP Address Classes
0 Network
1
7
Class A:
Local
24
bits
10 Network
Local
2
14
16 bits
110
Network
Local
Class C:
3
21
8 bits
1110
Host Group (Multicast)
Class D:
4
28
bits
11110
Future use
Class E:
5
27
bits
Local = Subnet + Host (Variable length)
Class B:
Router
Washington University in St. Louis
Router
CSE473S
4-24
Subnet
IP Addressing
128.10
128.10
Router
Router
128.10.0.1 128.10.0.2
10.0.0.37
10.0.0.49
10
10
128.211
128.211
Router
Router
128.211.6.115
192.5.48.3
Router
Router
192.5.48
192.5.48
CSE473S
4-25
Subnetting
Network
Subnet 1
Washington University in St. Louis
Subnet 2
CSE473S
4-26
Subnet n
2011 Raj Jain
IP addressing: CIDR
subnet
part
CSE473S
4-27
Homework 4C
CSE473S
4-28
Forwarding an IP Datagram
Delivers datagrams to destination network (subnet)
Routers maintain a routing table of next hops
Next Hop field does not appear in the datagram
Net
Net 11
R1
R1
Table at R2:
Net
Net 22
R2
R2
Net
Net 33
R3
R3
Net
Net 44
4-29
Route Aggregation
200.23.16.0/23
Organization 2
200.23.20.0/23
Organization 7
.
.
.
.
.
.
Fly-By-Night-ISP
Send me anything
with addresses
beginning
200.23.16.0/20
Internet
200.23.30.0/23
ISPs-R-Us
Organization 1
200.23.18.0/23
CSE473S
4-30
Send me anything
with addresses
beginning 199.31.0.0/16
or 200.23.18.0/23
R16, R17
2011 Raj Jain
Private Addresses
Any organization can use these inside their network
Cant go on the internet. [RFC 1918]
10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
Private
Network
Network Public
Private
Internet
Address
Addresses
Addresses
Translator
CSE473S
4-31
192.168.0.3
128.252.73.216
Internet
NAT
192.168.0.4
192.168.0.5
CSE473S
4-32
CSE473S
4-33
DHCP
Dynamic Host Control Protocol
Allows hosts to get an IP address automatically from a
server
Do not need to program each host manually
Each allocation has a limited lease time
Can reuse a limited number of addresses
Hosts broadcast Is there a DHCP Server Here?
Sent to 255.255.255.255
DHCP servers respond
CSE473S
4-35
DHCP Example
DHCP server: 223.1.2.5
DHCP discover
src : 0.0.0.0, 68
dest.: 255.255.255.255,67
yiaddr: 0.0.0.0
transaction ID: 654
arriving
client
DHCP offer
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 654
Lifetime: 3600 secs
DHCP request
time
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
yiaddrr: 223.1.2.4
transaction ID: 655
Lifetime: 3600 secs
DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 655
Lifetime: 3600 secs
CSE473S
4-36
ICMP
Internet Control Message Protocol
Required companion to IP. Provides feedback from
the network.
ICMP: Used by IP to send error and control messages
ICMP uses IP to send its messages (Not UDP)
ICMP does not report errors on ICMP messages.
ICMP reports error only on the first fragment
CSE473S
4-37
8b
8b
16b
Var
Var
Type
0
3
4
5
8
11
12
13
14
15
16
17
18
CSE473S
4-38
Message
Echo reply
Destination unreachable
Source quench
Redirect
Echo request
Time exceeded
Parameter unintelligible
Time-stamp request
Time-stamp reply
Information request
Information reply
Address mask request
Address mask reply
2011 Raj Jain
ICMP Messages
CSE473S
4-39
3
12
10
9
25
25
30
61
54
79
66
60
ms
ms
ms
ms
ms
ms
ms
ms
ms
ms
ms
ms
1
10
8
7
22
22
28
57
52
160
57
58
ms
ms
ms
ms
ms
ms
ms
ms
ms
ms
ms
ms
1
9
8
7
22
22
28
58
51
67
68
58
ms
ms
ms
ms
ms
ms
ms
ms
ms
ms
ms
ms
192.168.0.1
bras4-l0.stlsmo.sbcglobal.net [151.164.182.113]
dist2-vlan60.stlsmo.sbcglobal.net [151.164.14.163]
151.164.93.224
151.164.93.49
151.164.251.226
209.85.254.128
72.14.236.26
209.85.254.226
209.85.254.237
64.233.175.14
qw-in-f147.google.com [74.125.93.147]
Trace complete.
CSE473S
4-40
IPv6
CSE473S
4-41
IPv6 Header
IPv6:
Version Priority
Flow Label
Payload Length
Next Header Hop Limit
Source Address
Destination Address
IPv4:
Version IHL Type of Service
Total Length
Identification
Flags Fragment Offset
Time to Live Protocol
Header Checksum
Source Address
Destination Address
Options
Padding
CSE473S
4-42
CSE473S
4-43
IPv6
S
IPv6
IPv6
IPv4
IPv4
tunnel
IPv6
IPv6
IPv6
IPv6
D
D
IPv6
CSE473S
4-44
CSE473S
4-45
Overview
1.
2.
3.
4.
Routing Algorithms
Graph abstraction
Distance Vector vs. Link State
Dijkstras Algorithm
Bellman-Ford Algorithm
CSE473S
4-46
Rooting or Routing
Rooting is what fans do at football games, what pigs
do for truffles under oak trees in the Vaucluse, and
what nursery workers intent on propagation do to
cuttings from plants.
Routing is how one creates a beveled edge on a table
top or sends a corps of infantrymen into full scale,
disorganized retreat
CSE473S
4-47
Routeing or Routing
Routeing: British
Routing: American
Since Oxford English Dictionary is much heavier than
any other dictionary of American English, British
English generally prevails in the documents produced
by ISO and CCITT; wherefore, most of the
international standards for routing standards use the
routeing spelling.
CSE473S
4-48
Graph abstraction
5
3
Graph: G = (N,E)
v
w
5
2
N = Set of routers
u
2
z
1
3
= { u, v, w, x, y, z }
1
2
x
y
E = Set of links
1
={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
Each link has a cost, e.g., c(w,z) = 5
Cost of path (x1, x2,, xp) = c(x1,x2) + c(x2,x3) + + c(xp-1,xp)
Routing Algorithms find the least cost path
We limit to Undirected graphs, i.e., cost is same in both
directions
CSE473S
4-49
Distance Vector:
5
Vector of distances to all nodes, e.g.,
3
v
w
u: {u:0, v:2, w:5, x:1, y:2, z:4}
2
u
2
1
Sent to neighbors, e.g.,
3
1
u will send to v, w, x
x
y
1
Large vectors to small # of nodes
Tell about the world to neighbors
Older method. Used in RIP.
Link State:
Vector of link cost to neighbors, e.g, u: {v:2, w:5, x:1}
Sent to all nodes, e.g., u will send to v, w, x, y, z
Small vectors to large # of nodes
Tell about the neighbors to the world
Newer method. Used in OSPF.
Washington University in St. Louis
CSE473S
4-50
z
2
Dijkstras Algorithm
Goal: Find the least cost paths from a given node to all other
nodes in the network
Notation:
c(i,j) = Link cost from i to j if i and j are connected
D(k) = Total path cost from s to k
N = Set of nodes so far for which the least cost path is known
Method:
Initialize: N={u}, D(v) = c(u,v) for all neighbors of u
Repeat until N includes all nodes:
Find node w N, whose D(w) is minimum
Add w to N
Update D(v) for each neighbor of w that is not in N
D(v) = min[D(v), D(w) + c(w,v)] for all v N
CSE473S
4-51
2
1
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)
2
2
2
Path
u-v
u-v
u-v
x
D(w)
5
4
3
3
w
3
Path
D(x) Path D(y) Path
u-w
1
u-x
u-x-w
2
u-x-y
u-x-y-w
u-x-y-w
CSE473S
4-52
D(z)
4
4
4
Path
u-x-y-z
u-x-y-z
u-x-y-z
Bellman-Ford Algorithm
Notation:
u = Source node
c(i,j) = link cost from i to j
h = Number of hops being considered
Du(n) = Cost of h-hop path from u to n
Method:
1. Initialize: Du(n) = for all n u; Du(u) = 0
2. For each node: Du(n) = minj [Du(j) +c(j,n)]
3. If any costs change, repeat step 2
CSE473S
4-53
x
y
z 7 1 0
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
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
cost to
x y z
cost to
x y z
cost to
x y z
x 0 2 7
y 2 0 1
z 3 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
from
from
x 0 2 7
y
z
node y table
cost to
x y z
from
from
node x table
cost to
x y z
CSE473S
4-54
time
y
7
Bellman-Ford Example 2
A.
5
0
u
2
1
C.
5
0
u
x
2
2
1
v
2
1
x
3 1
1 2
y
w
3
B.
0
u
5
10
z
0
u
CSE473S
4-55
D.
3 1
1 2 2
y
2
1
x
2
2
1
3 1
1 2
y
w
3
2
1
x
3 1
1 2 2
y
4
z
v
3
2
3
1
1
2
x
y
If cost changes
Recompute the costs to all neighbors
h
0
1
2
3
4
D(v)
2
2
2
2
Path
u-v
u-v
u-v
u-v
D(w)
5
4
3
3
Path
u-w
u-x-w
u-x-y-w
u-x-y-w
D(x)
1
1
1
1
Path
u-x
u-x
u-x
u-x
CSE473S
4-56
D(y)
2
2
2
Path
u-x-y
u-x-y
u-x-y
D(z)
10
4
4
Path
u-w-z
u-x-y-z
u-x-y-z
2011 Raj Jain
CSE473S
4-57
Homework 4E
Prepare the routing calculation table for node 1 in the
following network using (a) Dijkstras algorithm (b)
Bellman Ford Algorithm.
2
1
1
4
4
4
Washington University in St. Louis
CSE473S
4-58
Overview
Routing Protocols
CSE473S
4-59
Autonomous Systems
Subnet 1.2
R3
Subnet 1.2
R4
R6
R2
R5
Subnet 1.2
Subnet 1.2
R8
R1 Exterior
Subnet 1.2
Subnet 1.2
Fig
16.10
CSE473S
4-60
Interior
R7
Subnet 1.2
Routing Protocols
Interior Router Protocol (IRP): Used for passing
routing information among routers internal to an
autonomous system. Also known as IGP.
Examples: RIP, OSPF
Exterior Router Protocol (ERP): Used for passing
routing information among routers between
autonomous systems. Also known as EGP.
Examples: EGP, BGP, IDRP
Note: EGP is a class as well as an instance in that
class.
CSE473S
4-61
CSE473S
4-62
Shortcomings of RIP
Maximum network diameter = 15 hops
Cost is measured in hops
Only shortest routes. May not be the fastest route.
Entire tables are broadcast every 30 seconds.
Bandwidth intensive.
Uses UDP with 576-byte datagrams.
Need multiple datagrams.
300-entry table needs 12 datagrams.
An error in one routing table is propagated to all
routers
Slow convergence
CSE473S
4-63
R1
A
1 R1
A
A
16 R1
3 R2
5 R2
7 R2
15 R2
14 A
15
16 A
Washington University in St. Louis
R2
16 R2
CSE473S
4-64
2 R1
A
A
2 R1
4 R1
6 R1
16 R1
2011 Raj Jain
CSE473S
4-65
AS
Boundary
Router
Area
Border
Router
Area 1 Area 2
Router Types
Internal
Router
Backbone
Router
Internal Backup
Router
DR
Backbone
Router
Designated
Router
Area 4
Washington University in St. Louis
CSE473S
4-66
CSE473S
4-67
Metrics (Cost)
CSE473S
4-68
Metric
10,416
5208
1785
1562
65
48
10
1
2011 Raj Jain
CSE473S
4-69
CSE473S
4-70
AS2
iBGP
BGP Operations
BGP systems initially exchange entire routing tables.
Afterwards, only updates are exchanged.
BGP messages have the following information:
Origin of path information: RIP, OSPF,
AS_Path: List of ASs on the path to reach the dest
Next_Hop: IP address of the border router to be
used as the next hop to reach the dest
Unreachable: If a previously advertised route has
become unreachable
BGP speakers generate update messages to all peers
when it selects a new route or some route becomes
unreachable.
CSE473S
4-71
B
W
provider
network
customer
network:
C
Y
CSE473S
4-72
B
W
provider
network
customer
network:
C
Y
CSE473S
4-73
CSE473S
4-74
CSE473S
4-75
CSE473S
4-76
Link
Link
Link
Link Local IP addresses can be used on a link (point-to-point or
point-to-multipoint Ethernet) to communicate with other nodes
on that link
The datagrams with Link-Local source or destination addresses
will not be forwarded out of that link
Address range 169.254.1.0 through 169.254.254.255 is
reserved for link local IP address. This is 169.254.0.0/16 with
the first 255 and the last 255 addresses reserved for future use.
A node assigns a random address from this range and ARPs to
ensure that no one else has that address.
A set of nodes when directly connected can talk to each other
even when there is no DHCP server.
Ref: http://en.wikipedia.org/wiki/Link-local_address
CSE473S
4-77