Professional Documents
Culture Documents
Chapter 05
(version June 6, 2007)
01 Introduction
02 Physical Layer
03 Data Link Layer
04 MAC Sublayer
05 Network Layer
06 Transport Layer
07 Application Layer
08 Network Security
00 – 1 /
Network Layer
Main service: Provide facilities for getting data from
a source to a destination ⇒ routing.
B B
A A C
C
D E D E
G J G J
F F
I I
H N H N
L L
K K
M O M O
(a) (b)
B 7 C B (2, A) C (∞, −)
2 3
2 3
E 2 F E (∞, −)
A D A F (∞, −) D (∞, −)
1 2
6 4 2
G H G (6, A) H (∞, −)
(a) (b)
E (4, B) E (4, B)
A F (∞, −) D (∞,−) A F (6, E) D (∞,1)
E (4, B) E (4, B)
A F (6, E) D (∞,−) A F (6,E) D (∞,−)
Example:
Neighbor: R 1 R2 R3
Link cost: 12 8 5
Advertised: 28 25 39
Total: 40 33 44
New estimated
Router delay from J
A B C D To A I H K Line
A 0 24 20 21 8 A
B 12 36 31 28 20 A
C 25 18 19 36 28 I
F G D 40 27 8 24 20 H
E H
E 14 7 30 22 17 I
F 23 20 19 40 30 I
G 18 31 6 31 18 H
H 17 20 0 19 12 H
I J K L
I 21 0 14 22 10 I
J 9 11 7 10 0 −
K 24 22 22 0 6 K
L 29 33 9 9 15 K
JA JI JH JK
delay delay delay delay New
is is is is routing
8 10 12 6 table
for J
Vectors received from
J's four neighbors
(a) (b)
A B C D E A B C D E
• • • • Initially 1 2 3 4 Initially
1 • • • After 1 exchange 3 2 3 4 After 1 exchange
1 2 • • After 2 exchanges 3 4 3 4 After 2 exchanges
1 2 3 •After 3 exchanges 5 4 5 4 After 3 exchanges
1 2 3 4 After 4 exchanges 5 6 5 6 After 4 exchanges
7 6 7 6 After 5 exchanges
7 8 7 8 After 6 exchanges
..
.
• • • •
(a) (b)
• Find out who its neighbors are and get their net-
work addresses.
• Do a Dijkstra.
CONS: You may redirect traffic in such a way that the al-
ternative route becomes overloaded. Example:
advise everyone to take the train, causing the trains
to become overloaded, while the access path to
the highway is now underloaded (and thus form-
ing a better alternative).
3A 4A 5B 5C 3A 1C 3
5A 3B 1C 2
3B 4B 4C 5D 4A 1C 3
5E
4B 1C 4
Region 3 Region 4 Region 5
4C 1C 4
5A 1C 4
5B 1C 5
5C 1B 5
5D 1C 6
5E 1C 5
(a) (b) (c)
B C B C I
A D A D
F E F F H J N
E
I G I G
A D E K G O M O
J
H N H L J
L N E C G D N K
O O
K K H B L H
M M
L B
2 1 2 1
1, 2 1, 2
1, 2
1, 2
2
2 2 2
1
1
1
1
(a) (b)
1 2
1 2 2 2
1
1
(c) (d)
Wireless
cell Home
agent
Foreign
agent
Foreign LAN
WAN
MAN
Range of
A's broadcast
A B A B A B A B
C C C C
D D D D
E E E E
F F F F
G G G G
H I H I H I H I
Desirable
Congested
Packets sent
Congestion A
A
B
B
Virtual
circuit
Congestion
(a) (b)
• Overprovisioning
• Resource reservation
• Admission control
• Packet scheduling
Fraction of packets
High jitter
Low jitter
Time in buffer
Packet removed from buffer 1 2 3 4 5 6 7 8
Gap in playback
0 5 10 15 20
Time (sec)
Faucet
Host
computer
Packet
Unregulated
flow
Leaky
bucket The bucket
Water Interface holds
containing packets
a leaky bucket
Regulated
flow
Water drips out of the
hole at a constant rate
Network
(a) (b)
Host Host
computer computer
One token
is added The bucket
to the bucket holds
every ∆T tokens
Networks Networks
(a) (b)
(b)
2 MB/sec for 500 msec
B 2 7 12 16 B 16
C 3 8 O D 17
D 4 9 13 17 E 18
E 5 10 14 18 A 20
(a) (b)
Ingress Output
router line
Shaper/ 2
Packets Classifier Marker
dropper 3
4
Four
priority
classes
Class Queued packet
Headers
Bits 20 3 1 8
Label QoS S TTL
SNA
Multiprotocol
router
1
M M ATM Router
X. 25
OSI
M
M 2
Host
End-to-end concatenated
virtual circuits
1
M M
M
M
2
Multiprotocol
Host
router
Multiprotocol Tunnel
Ethernet in Paris router Ethernet in London
WAN
1 2
Header
IP IP IP
Ethernet frame Ethernet frame
IP packet inside payload
field of the WAN packet
Network 1 Network 2
Packet
G1 G2 G3 G4
G2 G4
G1 fragments reassembles G3 fragments reassembles
a large packet the fragments again again
(a)
Packet
G1 G2 G3 G4
(b)
Packet End of
number packet bit 1 byte
27 0 1 A B C D E F G H I J
Header
(a)
27 0 0 A B C D E F G H 27 8 1 I J
Header Header
(b)
27 0 0 A B C D E 27 5 0 F G H 27 8 1 I J
Regional
C IP router
network
National
network
SNA
network
Tunnel
D Host
B
A 1 2
IP Ethernet IP Ethernet
LAN IP token ring LAN LAN
Source address
Destination address
Range of host
Class addresses
1.0.0.0 to
A 0 Network Host 127.255.255.255
128.0.0.0 to
B 10 Network Host
191.255.255.255
192.0.0.0 to
C 110 Network Host 223.255.255.255
224.0.0.0 to
D 1110 Multicast address 239.255.255.255
240.0.0.0 to
E 1111 Reserved for future use 255.255.255.255
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 This host
Broadcast on the
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
local network
Broadcast on a
Network 1111 ... 1111
distant network
32 Bits
√
(194.24.17.4&&255.255.248.0) 6= 194.24.0.0 √
(194.24.17.4&&255.255.252.0) 6= 194.24.8.0
(194.24.17.4&&255.255.240.0) = 194.24.16.0 OK
Company 5
router 6
PC NAT Leased ISP's
7 box/firewall line router
Server
Boundary of company premises
Newly-booted
host looking for DHCP Other DHCP
its IP address relay networks Router server
WAN 2
A B C D E F
I J
LAN 1 H
LAN 2
G
WAN 3
(a)
W1
10 12
A B C 4 D 6 8 W2 16 F
E
2 3 4
13
I 3 J
3 H
2 1 L2 2
17 12
G
L1 W3
(b)
Area
AS 3 AS 4 Area
border
router
B C
D
A Information F receives
from its neighbors about D
G
From B: "I use BCD"
F From G: "I use GCD"
H From I: "I use IFGCD"
From E: "I use EFGCD"
E
I J
(a) (b)
Source address
(16 bytes)
Destination address
(16 bytes)
Ext. header
Description
Hop–by–hop options Information for routers (eg. RSVP)
Routing Full or partial route to follow
Fragmentation Management of datagram fragments
Authentication Verification of the sender’s identity
Encrypted payload Info on the encrypted contents
Destination options Add. info for destination (eg. Mobile IP)
Informational messages:
• Router-related messages
• Mobility-management messages
• Dual-stack techniques
• Tunneling techniques
3 13 32 16
001 0x0002 IPv4 gateway addr network ID
host ID
Dual-stack gateway
Internet (IPv4)
IPv6 IPv6