Beruflich Dokumente
Kultur Dokumente
Network Layer
Chapter goals:
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
ICMP
IPv6
forwarding: move
packets from
routers input to
appropriate router
output
routing: determine
route taken by
packets from source
to destination
Network Layer
of getting through
single interchange
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
t
k
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
t
k
data link
physical
network
data link
physical
application
transport
network
data link
physical
routing algorithm
forwarding: process
network
data link
physical
analogy:
routing: process of
application
transport
network
data link
physical
3
2
2
1
value in arriving
packets header
0111
1
3 2
routing algorithms
Connection Setup
Service
Model
Guarantees ?
Congestion
Bandwidth Loss Order Timing feedback
ATM
CBR
ATM
VBR
ATM
ABR
ATM
UBR
constant
rate
guaranteed
rate
guaranteed
minimum
none
no
no
no
yes
yes
yes
yes
yes
yes
no
yes
no
no (inferred
via loss)
no
congestion
no
congestion
yes
no
yes
no
no
connectionless service
service: host-to-host
no choice: network provides one or the other
implementation: in network core
Datagram format
IPv4 addressing
ICMP
IPv6
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Call setup, teardown for each call before data can flow
Each packet carries VC identifier (not destination host
address)
Every router on source-dest path maintains state for
each passing connection
Link, router resources (bandwidth, buffers) may be
allocated to VC (dedicated resources = predictable service)
Forwarding Table
VC Implementation
VC number
A VC consists of:
(Forwarding table in
northwest router)
I
Incoming
i interface
i
f
interface
number
Incoming
I
i VC #
Outgoing
O
i interface
i
f
application
transport 5. Data flow begins
network 4. Call connected
data link 1. Initiate call
physical
12
63
7
97
Outgoing
O
i VC #
32
1
2
3
1
22
12
3
1
2
3
22
18
17
87
Datagram Networks
application
transport
network 1. Send data
data link
physical
application
transport
data link
physical
Network Layer
Forwarding Table
4 billion
possible entries
Link Interface
4-16
Link Interface
0
1
2
3
Examples
DA: 11001000 00010111 00010110 10100001
Which interface?
Which interface?
ATM (VC)
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
ICMP
IPv6
Decentralized switching:
Output Ports
RTT .C
N
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
ICMP
IPv6
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
ICMP
IPv6
Network
N
t
k
Layer
IP protocol
addressing conventions
datagram format
packet handling conventions
Routing protocols
path selection
RIP
RIP, OSPF
OSPF, BGP
forwarding
table
RIP
OSPF
BGP
ICMP protocol
error reporting
router signaling
Link layer
Physical layer
IP Datagram Format
IP protocol version
number
header length
(bytes)
type of data
max number
remaining hops
(decremented at
each router)
32 bits
ver
head.
len
type of
service
16-bit identifier
time to
live
total datagram
length (bytes)
length
fragment
offset
flgs
upper
layer
for
fragmentation/
reassembly
header
checksum
E.g. timestamp,
record route
taken, specify
list of routers
to visit.
fragmentation:
in: one large datagram
out: 3 smaller
datagrams
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
ICMP
IPv6
IP address:
subnet part (high
order bits)
host part (low order
bits)
Whatss a subnet ?
What
length
=4000
223.1.2.1
223.1.1.2
223.1.1.4
223.1.1.3
223.1.2.9
223.1.3.27
223.1.2.2
subnet
223.1.3.1
IP address: 32-bit
identifier for host,
router interface
Interface: connection
between host/router
and physical link
223.1.3.2
offset
=0
length
=1500
ID
=x
fragflag
=1
offset
=0
length
=1500
ID
=x
fragflag
=1
offset
=185
length
=1040
ID
=x
fragflag
=0
offset
=370
223.1.1.1
223.1.2.1
223.1.1.2
223.1.1.4
223.1.1.3
223.1.2.9
223.1.2.2
223.1.3.27
223.1.3.2
223.1.3.1
Subnets
223.1.1.1
fragflag
=0
IP Addressing: Introduction
ID
=x
offset =
1480/8
Subnets
Example
4000 byte datagram
MTU = 1500 bytes
1480 bytes in
data field
reassembly
Recipe
To determine subnets,
detach each interface
from its host or
router,, creating
g
islands of isolated
networks
Each isolated network
is called a subnet
223
223.1.1.0/24
223.1.2.0/24
223.1.3.0/24
Subnets
223.1.1.2
How many?
223.1.1.1
IP addressing: CIDR
223.1.1.4
223.1.1.3
223.1.9.1
223.1.7.1
223.1.8.1
223.1.8.0
223.1.2.6
223.1.2.1
223.1.7.0
223.1.9.2
223.1.3.1
host
part
subnet
part
223.1.3.27
223.1.2.2
223.1.3.2
200.23.16.0/23
Windows:
control-panelnetworkconfigurationTCP/IPproperties
UNIX:
/etc/rc.config
plug-and-play
(next slide)
DHCP overview:
DHCP discover
arriving
client
src : 0.0.0.0, 68
dest.: 255.255.255.255,67
yiaddr: 0.0.0.0
transaction ID: 654
223.1.2.1
DHCP
server
223.1.1.1
223.1.1.2
223.1.1.4
DHCP offer
223.1.2.2
223.1.1.3
223.1.3.1
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 654
Lifetime: 3600 secs
223.1.2.9
223.1.3.27
223.1.3.2
arriving DHCP
client needs
address in this
network
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
Network Layer
DHCP: Example
DHCP
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
UDP
IP
Eth
Phy
168.1.1.1
168 1 1 1
router
(runs DHCP)
Ethernet demuxed to IP
DHCP: Example
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
Encapsulation of DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
UDP
IP
Eth
Phy
router
(runs DHCP)
DHCP: Wireshark
Output (home LAN)
allocates
ll
t addresses
dd
manages DNS
assigns domain names, resolves disputes
reply
request
local network
(e.g., home network)
10.0.0/24
10.0.0.1
10.0.0.4
10.0.0.2
138.76.29.7
10.0.0.3
2: NAT router
changes datagram
source addr from
10.0.0.1, 3345 to
138.76.29.7, 5001,
updates table
1: host 10.0.0.1
sends datagram to
128.119.40.186, 80
NAT is controversial:
S: 10.0.0.1, 3345
D: 128.119.40.186, 80
10.0.0.1
1
2
S: 138.76.29.7, 5001
D: 128.119.40.186, 80
10.0.0.4
10.0.0.2
138.76.29.7
S: 128.119.40.186, 80
D: 138.76.29.7, 5001
3: Reply arrives
dest. address:
138.76.29.7, 5001
S: 128.119.40.186, 80
D: 10.0.0.1, 3345
4: NAT router
changes datagram
dest addr from
138.76.29.7, 5001 to 10.0.0.1, 3345
10.0.0.3
Solution 1: statically
configure NAT to forward
incoming connection requests
at given port to server
e.g. (123.76.29.7, port 2500)
always forwarded to 10.0.0.1
port 25000
But must be done ahead of
time!
138.76.29.7
10.0.0.1
10.0.0.4
NAT
router
10.0.0.1
IGD
10.0.0.4
138.76.29.7
NAT
router
2. connection to
relay initiated
by client
1. connection to
relay initiated
by NATted host
3. relaying
established
Client
138.76.29.7
10.0.0.1
NAT
router
Type
0
3
3
3
3
3
3
4
Code
0
0
1
2
3
6
7
0
8
9
10
11
12
0
0
0
0
0
description
echo reply (ping)
dest. network unreachable
dest host unreachable
dest protocol unreachable
dest p
port unreachable
dest network unknown
dest host unknown
source quench (congestion
control - not used)
echo request (ping)
route advertisement
router discovery
TTL expired
bad IP header
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
ICMP
IPv6
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
ICMP
IPv6
Stopping criterion
UDP segment eventually
arrives at destination host
Destination returns ICMP
host unreachable packet
(type 3, code 3)
When source gets this
ICMP, stops
IPv6
Additional motivation:
10
IPv6 Header
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
ICMP
IPv6
3
2
2
1
value in arriving
packets header
0111
3 2
Network Layer
Graph Abstraction
v
5
z
u
y
Graph: G = (N,E)
N = set of routers = {u, v, w, x, y, z}
E = set of links ={(u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z)}
Remark: Graph abstraction is useful in other network
contexts
Example: P2P, where N is set of peers and E is set of
TCP connections
4-64
2
1
3
1
5
z
1
y
11
Static or dynamic?
Static:
Routes change slowly over
time
Dynamic:
Routes change more quickly
Periodic update
In response to link cost
changes
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
ICMP
IPv6
2
1
3 w
2
x
3 1
y
1
5
z
2
z
destination
v
x
y
w
z
link
(u,v)
(u,x)
(u,x)
(u,x)
(u,x)
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
ICMP
IPv6
12
Bellman-Ford Example
c(x,v)
Distributed:
Each node:
wait for (change in local link
cost or msg from neighbor)
5
z
When
Wh n a node
n d x receives
i sn
new DV estimate
stim t
1
4
x
50
1
z
recompute estimates
if DV to any dest has
changed, notify neighbors
Dx = [Dx(y): y N ]
distance vectors
2
1
Then
Neighbors of u:
dv(z) = 5, dx(z) = 3, dw(z) = 3
good
news
travels
fast
At time t1, Z receives the update from Y and updates its table.
It computes a new least cost to X and sends its neighbors its DV.
At time t2, Y receives Zs update and updates its distance table.
Ys least costs do not change and hence Y does not send any
message to Z.
13
50
Poisoned reverse:
If Z routes through Y to
get to X :
Message complexity
60
y
4
1
x
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
ICMP
IPv6
Gateway router
Direct link to router in
another AS
Hierarchical Routing
Our routing study thus far - idealization
all routers identical
network flat
not true in practice
Scale: with 200 million
destinations:
Administrative autonomy
Hierarchical Routing
DV:
Link state
Distance Vector
Hierarchical routing
RIP
OSPF
BGP
LS:
Speed of Convergence
internet = network of
networks
Each network admin may
want to control routing in its
own network
Interconnected ASes
3c
3b
3a
AS3
2a
1c
1a
1dd
1b
Intra-AS
Routing
algorithm
2c
2b
AS2
AS1
Inter-AS
Routing
algorithm
Forwarding
table
Forwarding table
configured by both
intra- and inter-AS
routing algorithm
intra-AS sets entries
for internal dests
inter-AS & intra-AS
sets entries for
external dests
14
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
ICMP
IPv6
Intra-AS Routing
RIP
OSPF
BGP
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
ICMP
IPv6
RIP
OSPF
BGP
w
x
y
RIP: Example
RIP Advertisements
z
w
x
A
y
D
C
Destination Network
w
y
z
x
.
Next Router
A
B
B
--
2
2
7
1
....
Routing/Forwarding table in D
15
RIP: Example
Dest
w
x
z
.
Next hops
- 1
- 1
C 4
...
Advertisement
from A to D
z
x
C
Destination Network
Next Router
w
y
z
x
A
B
BA
--
2
2
75
1
....
forwarding
table
routed
forwarding
table
Transprt
(UDP)
network
(IP)
link
physical
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
ICMP
IPv6
16
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
ICMP
IPv6
Link state
Distance Vector
Hierarchical routing
BGP Basics
eBGP session
3c
eBGP session
iBGP session
3a
3b
AS3
1a
AS1
2a
1c
1d
3c
2c
2b
AS2
1a
AS1
1b
iBGP session
3a
3b
AS3
2c
2a
1c
1d
2b
AS2
1b
17
BGP messages
Policy:
Scale:
4. 1 Introduction
4.2 Virtual circuit and
datagram networks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
ICMP
IPv6
18