6 - Network Layer - Single File
6 - Network Layer - Single File
? ?
virtual circuit
service abstraction
preservation of inter- or
?
packet timing (no jitter)? datagram?
loss-free delivery?
in-order delivery?
congestion feedback to
sender?
call setup, teardown for each call before data can flow
each packet carries VC identifier
every router on source-dest path maintains “state” for each
passing connection
transport-layer connection only involved two end systems
link, router resources (bandwidth, buffers) may be allocated to VC
to get circuit-like perf.
5
3
B C 5
2
A 2 1 F
3
1 2
D E
1
A
1 1+e 2+e A 0 0 A
2+e 2+e A 0
D B D 1+e1 B D
0 0 0 0 B D 1+e1 B
0 e 0 0 1 1+e 0 e
1
C C C C
1
e
… recompute … recompute … recompute
initially
routing
Network Layer 4-16
Distance Vector Routing Algorithm
iterative:
continues until no
Distance Table data structure
each node has its own
nodes exchange info.
row for each possible destination
self-terminating: no
column for each directly-
“signal” to stop
attached neighbor to node
asynchronous: example: in node X, for dest. Y
nodes need not
via neighbor Z:
exchange info/iterate
in lock step!
distributed: distance from X to
each node X = Y, via Z as next hop
communicates only D (Y,Z)
Z
with directly-attached = c(X,Z) + minw{D (Y,w)}
neighbors
destination
E D
D (C,D) = c(E,D) + minw {D (C,w)}
= 2+2 = 4 C 6 9 4
E D
D (A,D) = c(E,D) + min {D (A,w)}
w D 4 11 2
= 2+3 = 5 loop!
E B
D (A,B) = c(E,B) + minw{D (A,w)}
= 8+6 = 14
loop!
Network Layer 4-18
Distance table gives routing
table
cost to destination via
E Outgoing link
D () A B D to use, cost
A 1 14 5 A A,1
B 7 8 5 B D,5
destination
destination
C 6 9 4 C D,4
D 4 11 2 D D,4
Y
2 1
X Z
7
Y
2 1
X Z X Z
7 D (Y,Z) = c(X,Z) + minw{D (Y,w)}
= 7+1 = 8
X Y
D (Z,Y) = c(X,Y) + minw {D (Z,w)}
= 2+1 = 3
algorithm
continues
on!
network layer
inter-AS, intra-AS link layer
routing in
gateway A.c physical layer
layer forwarding
ICMP protocol
table •error reporting
•router
“signaling”
Link layer
physical layer
Class
Class AA 126
126 16,777,214
16,777,214 11 –– 126
126
Class
Class BB 16,384
16,384 65,534
65,534 128
128 –– 191
191
Class
Class CC 2,097,152
2,097,152 254
254 192
192 –– 223
223
Subnets
Subnetting is used to break the network into
smaller more efficient subnets to prevent
excessive rates of Ethernet packet collision in
a large network
Subnetting hides the internal network
organization to external routers and thus
simplifies routing.
Subnetting allows address administration to be
decentralized
For instance, an administrator could assign a
subnet to a department, which would then be
responsible for their own network
management.
REMINDER: What IP
addresses are reserved
By convention, in IP addressing schemes, any
IP address that ends in all binary zeroes is
reserved for the network address.
Thus, in a class "A" network, 113.0.0.0 would
be the IP address of that network. Routers use
a network's IP address when forwarding data
on the Internet.
By convention, in IP addressing schemes, any
IP address that ends in all binary ones is
reserved for the network broadcast.
For example 113.255.255.255
What is included in a subnet
address?
network
Subnet addresses include a
number, a subnet number within
the network, and a host number
within the subnet.
4+2 = 6
Convert
Convert to
to Decimal
Decimal 11111111 11111111 11100000 00000000
Subnet
Subnet Mask
Mask 255 . 255 . 224 . 0
Conversion Tables
If x bits are used for the subnet mask,
then that subnet mask can support up
to 2x –2 subnets (because host &
subnet values cannot be all 0’s or 1’s).
00000000
00000000==00 Invalid
Invalid
00100000
00100000==32
32 x.y.32.1
x.y.32.1 –– x.y.63.254
x.y.63.254
01000000
01000000==64
64 x.y.64.1
x.y.64.1 –– x.y.95.254
x.y.95.254
01100000
01100000==96
96 x.y.96.1
x.y.96.1 –– x.y.127.254
x.y.127.254
10000000
10000000==128
128 x.y.128.1
x.y.128.1–– x.y.159.254
x.y.159.254
10100000
10100000==160
160 x.y.160.1
x.y.160.1–– x.y.191.254
x.y.191.254
11000000
11000000==192
192 x.y.192.1
x.y.192.1–– x.y.223.254
x.y.223.254
11100000
11100000==224
224 Invalid
Invalid
Organization 0
200.23.16.0/23
Organization 1
“Send me anything
200.23.18.0/23 with addresses
Organization 2 beginning
200.23.20.0/23 . ISP 200.23.16.0/20”
.
. . Internet
.
Organization 7 .
200.23.30.0/23
“Send me anything
ISP
with addresses
beginning
199.31.0.0/16”
A DHCP 223.1.2.1
223.1.1.1
server
223.1.1.2
223.1.1.4 223.1.2.9
B
223.1.2.2 arriving DHCP
223.1.1.3 223.1.3.27 E client needs
address in this
223.1.3.1 223.1.3.2
network
DHCP offer
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
addrr: 223.1.2.4
transaction ID: 654
Lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
addrr: 223.1.2.4
transaction ID: 655
time Lifetime: 3600 secs
DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
addrr: 223.1.2.4
transaction ID: 655
Lifetime: 3600 secs
10.0.0.4
10.0.0.2
138.76.29.7
10.0.0.3
C
Destination Network Next Router Num. of hops
to dest.
w A 2
y B 2
z B 7
x -- 1
…. …. ....
Routing table in D
C
Destination Network Next Router Num. of hops
to dest.
w A 2
y B 2
z BA 75
x -- 1
…. Routing….
table in D ....
Network Layer 4-68
RIP: Link Failure and Recovery
If no advertisement heard after 180 sec -->
neighbor/link declared dead
routes via neighbor invalidated
new advertisements sent to neighbors
neighbors in turn send out new advertisements
(if tables changed)
link failure info quickly propagates to entire net
infinite distance = 16 hops
Policy:
Inter-AS: admin wants control over how its traffic
routed, who routes through its net.
Intra-AS: single admin, so no policy decisions
needed
Scale:
hierarchical routing saves table size, reduced
update traffic
Performance:
Intra-AS: can focus on performance
Inter-AS: policy may dominate over performance
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
Network Layer 4-84
Chapter 4 roadmap
4.1 Introduction and Network Service
Models
4.2 Routing Principles
4.3 Hierarchical Routing
4.4 The Internet (IP) Protocol
4.5 Routing in the Internet
4.6 What’s Inside a Router?
4.7 IPv6
4.8 Multicast Routing
4.9 Mobility
Network Layer 4-85
Reverse Path Forwarding
S: source LEGEND