Chapter 4: Network Layer Chapter 4: Network Layer
Chapter goals: 4. 1 Introduction 4.5 Routing algorithms
4.2 Virtual circuit and Link state
understand principles behind network layer
datagram networks Distance Vector
services:
Hierarchical routing
4.3 What’s inside a
network layer service models
router 4.6 Routing in the
forwarding versus routing
4.4 IP: Internet
Internet
how a router works
RIP
routing (path selection)
Protocol
OSPF
Datagram format
dealing with scale
BGP
IPv4 addressing
advanced topics: IPv6, mobility 4.7 Broadcast and
ICMP
instantiation, implementation in the Internet IPv6 multicast routing
Network Layer 4-1 Network Layer 4-2
Network layer Two Key Network-Layer Functions
transport segment from application
transport
sending to receiving host network
forwarding: move analogy:
data link
physical
on sending side network network
encapsulates segments
network
data link
physical
data link
physical packets from router’s
routing: process of
data link
into datagrams
physical network network
data link input to appropriate
planning trip from
data link
router output
physical physical
on rcving side, delivers
segments to transport
network
data link
network
data link source to dest
routing: determine
physical physical
network
layer data link
physical
application
route taken by forwarding: process
network layer protocols
of getting through
network transport
packets from source
data link network
in every host, router
network
physical data link
network data link
single interchange
physical
data link physical
router examines header
physical
to dest.
fields in all IP datagrams
routing algorithms
passing through it
Network Layer 4-3 Network Layer 4-4
1
Interplay between routing and forwarding
Network service model
routing algorithm
Q: What service model for “channel” transporting
datagrams from sender to receiver?
local forwarding table
Example services for a
header value output link
0100 3 Example services for
0101
0111
2
2 individual datagrams: flow of datagrams:
guaranteed delivery in-order datagram
1001 1
guaranteed delivery delivery
value in arriving
packet’s header with less than 40 msec guaranteed minimum
0111 1 delay bandwidth to flow
3 2 restrictions on
changes in inter-
packet spacing
Network Layer 4-5 Network Layer 4-6
Network layer service models: Chapter 4: Network Layer
Guarantees ?
Network Service Congestion 4. 1 Introduction 4.5 Routing algorithms
Architecture Model Bandwidth Loss Order Timing feedback
4.2 Virtual circuit and Link state
Internet best effort none no no no no (inferred datagram networks Distance Vector
Hierarchical routing
4.3 What’s inside a
via loss)
4.6 Routing in the
ATM CBR constant yes yes yes no
rate congestion router
ATM VBR guaranteed yes yes yes no 4.4 IP: Internet
Internet
RIP
rate congestion Protocol
ATM ABR guaranteed no yes no yes OSPF
minimum Datagram format
BGP
ATM UBR none no yes no no IPv4 addressing
ICMP 4.7 Broadcast and
IPv6 multicast routing
Network Layer 4-7 Network Layer 4-8
2
Network layer connection and
connection-less service Virtual circuits
datagram network provides network-layer “source-to-dest path behaves much like telephone
circuit”
connectionless service performance-wise
VC network provides network-layer network actions along source-to-dest path
connection service
analogous to the transport-layer services, call setup, teardown for each call before data can flow
each packet carries VC identifier (not destination host
but: address)
service:host-to-host every router on source-dest path maintains “state” for
no choice: network provides one or the other each passing connection
link, router resources (bandwidth, buffers) may be
implementation: in network core
allocated to VC (dedicated resources = predictable service)
Network Layer 4-9 Network Layer 4-10
VC implementation Forwarding table VC number
12 22 32
a VC consists of: 1
2
3
1. path from source to destination
2. VC numbers, one number for each link along Forwarding table in interface
number
path northwest router:
3. entries in forwarding tables in routers along Incoming interface Incoming VC # Outgoing interface Outgoing VC #
path 1 12 3 22
2 63 1 18
packet belonging to VC carries VC number 3 7 2 17
(rather than dest address) 1 97 3 87
… … … …
VC number can be changed on each link.
New VC number comes from forwarding table
Routers maintain connection state information!
Network Layer 4-11 Network Layer 4-12
3
Virtual circuits: signaling protocols Datagram networks
no call setup at network layer
routers: no state about end-to-end connections
used to setup, maintain teardown VC
no network-level concept of “connection”
used in ATM, frame-relay, X.25
packets forwarded using destination host address
not used in today’s Internet packets between same source-dest pair may take
different paths
application
6. Receive data application
transport 5. Data flow begins application
3. Accept call transport application
network 4. Call connected transport
2. incoming call network transport
data link 1. Initiate call network
physical
data link data link 1. Send data 2. Receive data network
physical data link
physical
physical
Network Layer 4-13 Network Layer 4-14
4 billion
Forwarding table possible entries Longest prefix matching
Destination Address Range Link Interface Prefix Match Link Interface
11001000 00010111 00010 0
11001000 00010111 00010000 00000000 11001000 00010111 00011000 1
through 0 11001000 00010111 00011 2
11001000 00010111 00010111 11111111 otherwise 3
11001000 00010111 00011000 00000000
through 1 Examples
11001000 00010111 00011000 11111111 Which interface?
DA: 11001000 00010111 00010110 10100001
11001000 00010111 00011001 00000000
through 2 DA: 11001000 00010111 00011000 10101010 Which interface?
11001000 00010111 00011111 11111111
otherwise 3
Network Layer 4-15 Network Layer 4-16
4
Datagram or VC network: why? Chapter 4: Network Layer
Internet (datagram) ATM (VC) 4. 1 Introduction 4.5 Routing algorithms
data exchange among evolved from telephony 4.2 Virtual circuit and Link state
computers
human conversation: datagram networks Distance Vector
“elastic” service, no strict
strict timing, reliability Hierarchical routing
4.3 What’s inside a
timing req.
requirements
“smart” end systems router 4.6 Routing in the
need for guaranteed
(computers)
service 4.4 IP: Internet
Internet
can adapt, perform RIP
“dumb” end systems Protocol
control, error recovery OSPF
telephones Datagram format
simple inside network, BGP
complexity inside IPv4 addressing
complexity at “edge”
network ICMP 4.7 Broadcast and
many link types
IPv6 multicast routing
different characteristics
uniform service difficult
Network Layer 4-17 Network Layer 4-18
Router Router Architecture Overview
Two key router functions:
run routing algorithms/protocol (RIP, OSPF, BGP)
forwarding datagrams from incoming to outgoing link
Photo courtesy Newstream.com
Network Layer 4-19 Network Layer 4-20
5
Input Port Functions Three types of switching fabrics
Physical layer:
bit-level reception
Data link layer: Decentralized switching:
e.g., Ethernet given datagram dest., lookup output port
see chapter 5 using forwarding table in input port
memory
goal: complete input port processing at
‘line speed’
queuing: if datagrams arrive faster than
forwarding rate into switch fabric
Network Layer 4-21 Network Layer 4-22
Switching Via Memory
First generation routers: Switching Via a Bus
traditional computers with switching under direct
control of CPU
packet copied to system’s memory
datagram from input port memory
speed limited by memory bandwidth (2 bus
to output port memory via a shared
crossings per datagram)
bus
Memory
bus contention: switching speed
Input Output
Port Port
limited by bus bandwidth
1 Gbps bus, Cisco 1900: sufficient
speed for access and enterprise
System Bus
routers (not regional or backbone)
Network Layer 4-23 Network Layer 4-24
6
Switching Via An Interconnection Output Ports
Network
overcome bus bandwidth limitations
Banyan networks, other interconnection nets
initially developed to connect processors in
multiprocessor
Advanced design: fragmenting datagram into fixed
length cells, switch cells through the fabric.
Buffering required when datagrams arrive from
Cisco 12000: switches Gbps through the
fabric faster than the transmission rate
interconnection network
Scheduling discipline chooses among queued
datagrams for transmission
Network Layer 4-25 Network Layer 4-26
Output port queueing How much buffering?
RFC 3439 rule of thumb: average buffering
equal to “typical” RTT (say 250 msec) times
link capacity C
e.g., C = 10 Gps link: 2.5 Gbit buffer
Recent recommendation: with N flows,
buffering equal to RTT. C
N
buffering when arrival rate via switch exceeds
output line speed
queueing (delay) and loss due to output port
buffer overflow!
Network Layer 4-27 Network Layer 4-28
7
Input Port Queuing
Fabric slower than input ports combined -> queueing
may occur at input queues
Head-of-the-Line (HOL) blocking: queued datagram
at front of queue prevents others in queue from
moving forward
queueing delay and loss due to input buffer overflow!
Network Layer 4-29