Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Router

Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

Chapter 4

Network Layer

A note on the use of these ppt slides:


We’re making these slides freely available to all (faculty, students, readers).
Computer
They’re in PowerPoint form so you see the animations; and can add, modify,
and delete slides (including this one) and slide content to suit your needs.
Networking: A
They obviously represent a lot of work on our part. In return for use, we only
ask the following:
Top Down
❖ If you use these slides (e.g., in a class) that you mention their source (after
all, we’d like people to use our book!)
Approach
❖ If you post any slides on a www site, that you note that they are adapted
6th edition
from (or perhaps identical to) our slides, and note our copyright of this Jim Kurose, Keith Ross
material.
Addison-Wesley
Thanks and enjoy! JFK/KWR March 2012
All material copyright 1996-2013
J.F Kurose and K.W. Ross, All Rights Reserved

Network Layer 4-1


Chapter 4: network layer
chapter goals:
❖ understand principles behind network layer
services:
▪ network layer service models
▪ forwarding versus routing
▪ how a router works
▪ routing (path selection)
▪ broadcast, multicast
❖ instantiation, implementation in the Internet

Network Layer 4-2


Chapter 4: outline
4.1 introduction 4.5 routing algorithms
4.2 virtual circuit and ▪ link state
datagram networks ▪ distance vector
4.3 what’s inside a router ▪ hierarchical routing
4.4 IP: Internet Protocol 4.6 routing in the Internet
▪ datagram format ▪ RIP
▪ IPv4 addressing ▪ OSPF
▪ ICMP ▪ BGP
▪ IPv6 4.7 broadcast and multicast
routing

Network Layer 4-3


Network layer
application

❖ transport segment from transport


network
data link
sending to receiving host physical
network network

❖ on sending side data link data link


network physical
physical
data link

encapsulates segments physical network


data link
network
data link

into datagrams physical physical

❖ on receiving side, delivers network network


data link data link
physical physical
segments to transport network
data link

layer physical
application
network transport
❖ network layer protocols in network
data link
physical
network
data link
network
data link

every host, router data link


physical
physical physical

❖ router examines header


fields in all IP datagrams
passing through it
Network Layer 4-4
Two key network-layer functions
❖ forwarding: move analogy:
packets from router’s
input to appropriate ❖ routing: process of
router output planning trip from source
to dest
❖ routing: determine route
taken by packets from ❖ forwarding: process of
source to dest. getting through single
interchange
▪ routing algorithms

Network Layer 4-5


Interplay between routing and forwarding

routing algorithm routing algorithm determines


end-end-path through network

local forwarding table forwarding table determines


header value output link local forwarding at this router
0100 3
0101 2
0111 2
1001 1

value in arriving
packet’s header
0111 1

3 2

Network Layer 4-6


Connection setup
❖ 3rd important function in some network
architectures:
▪ ATM, frame relay, X.25
❖ before datagrams flow, two end hosts and intervening
routers establish virtual connection
▪ routers get involved
❖ network vs transport layer connection service:
▪ network: between two hosts (may also involve intervening
routers in case of VCs)
▪ transport: between two processes

Network Layer 4-7


Network service model
Q: What service model for “channel” transporting
datagrams from sender to receiver?
example services for example services for a
individual datagrams: flow of datagrams:
❖ guaranteed delivery ❖ in-order datagram delivery
❖ guaranteed delivery with ❖ guaranteed minimum
less than 40 msec delay bandwidth to flow
❖ restrictions on changes in
inter-packet spacing

Network Layer 4-8


Network layer service models:
Guarantees ?
Network Service Congestion
Architecture Model Bandwidth Loss Order Timing feedback

Internet best effort none no no no no (inferred


via loss)
ATM CBR constant yes yes yes no
rate congestion
ATM VBR guaranteed yes yes yes no
rate congestion
ATM ABR guaranteed no yes no yes
minimum
ATM UBR none no yes no no

Network Layer 4-9


Chapter 4: outline
4.1 introduction 4.5 routing algorithms
4.2 virtual circuit and ▪ link state
datagram networks ▪ distance vector
4.3 what’s inside a router ▪ hierarchical routing
4.4 IP: Internet Protocol 4.6 routing in the Internet
▪ datagram format ▪ RIP
▪ IPv4 addressing ▪ OSPF
▪ ICMP ▪ BGP
▪ IPv6 4.7 broadcast and multicast
routing

Network Layer 4-10


Connection, connection-less service
❖ datagram network provides network-layer
connectionless service
❖ virtual-circuit network provides network-layer
connection service
❖ analogous to TCP/UDP connecton-oriented /
connectionless transport-layer services, but:
▪ service: host-to-host
▪ no choice: network provides one or the other
▪ implementation: in network core

Network Layer 4-11


Virtual circuits
“source-to-dest path behaves much like telephone
circuit”
▪ performance-wise
▪ network actions along source-to-dest path

❖ 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)
Network Layer 4-12
VC implementation
a VC consists of:
1. path from source to destination
2. VC numbers, one number for each link along path
3. entries in forwarding tables in routers along path
❖ packet belonging to VC carries VC number
(rather than dest address)
❖ VC number can be changed on each link.
▪ new VC number comes from forwarding table

Network Layer 4-13


VC forwarding table
12 22 32

1 3
2
VC number
interface
forwarding table number
in
northwest
Incoming interface
router: Incoming VC # Outgoing interface Outgoing VC #

1 12 3 22
2 63 1 18
3 7 2 17
1 97 3 87
… … … …

VC routers maintain connection state


information! Network Layer 4-14
Virtual circuits: signaling protocols
❖ used to setup, maintain teardown VC
❖ used in ATM, frame-relay, X.25
❖ not used in today’s Internet

application application
5. data flow begins 6. receive data
transport transport
network 4. call connected 3. accept call
1. initiate call network
data link 2. incoming call
data link
physical physical

Network Layer 4-15


Datagram networks
❖ no call setup at network layer
❖ routers: no state about end-to-end connections
▪ no network-level concept of “connection”
❖ packets forwarded using destination host address

application application
transport transport
network 1. send datagrams 2. receive datagrams network
data link data link
physical physical

Network Layer 4-16


Datagram forwarding table
4 billion IP addresses, so
routing algorithm
rather than list individual
destination address
local forwarding table
list range of addresses
dest address output link (aggregate table entries)
address-range 1 3
address-range 2 2
address-range 3 2
address-range 4 1

IP destination address in
arriving packet’s header
1
3 2

Network Layer 4-17


Datagram forwarding table
Destination Address Range Link Interface

11001000 00010111 00010000 00000000


through 0
11001000 00010111 00010111 11111111

11001000 00010111 00011000 00000000


through 1
11001000 00010111 00011000 11111111

11001000 00010111 00011001 00000000


through 2
11001000 00010111 00011111 11111111

otherwise 3

Q: but what happens if ranges don’t divide up so nicely?


Network Layer 4-18
Longest prefix matching
longest prefix
when looking for forwarding table entry for given
matching
destination address, use longest address prefix that
matches destination address.

Destination Address Range Link interface

11001000 00010111 00010*** ********* 0

11001000 00010111 00011000 ********* 1

11001000 00010111 00011*** ********* 2

otherwise 3

examples:
DA: 11001000 00010111 00010110 10100001 which interface?
DA: 11001000 00010111 00011000 10101010 which interface?
Network Layer 4-19
Datagram or VC network: why?
Internet (datagram) ATM (VC)
❖ data exchange among ❖ evolved from telephony
computers ❖ human conversation:
▪ “elastic” service, no strict ▪ strict timing, reliability
requirements
timing req.
▪ need for guaranteed service
❖ many link types ❖ “dumb” end systems
▪ different characteristics ▪ telephones
▪ uniform service difficult ▪ complexity inside
❖ “smart” end systems network
(computers)
▪ can adapt, perform control,
error recovery
▪ simple inside network,
complexity at “edge”

Network Layer 4-20


Chapter 4: outline
4.1 introduction 4.5 routing algorithms
4.2 virtual circuit and ▪ link state
datagram networks ▪ distance vector
4.3 what’s inside a router ▪ hierarchical routing
4.4 IP: Internet Protocol 4.6 routing in the Internet
▪ datagram format ▪ RIP
▪ IPv4 addressing ▪ OSPF
▪ ICMP ▪ BGP
▪ IPv6 4.7 broadcast and multicast
routing

Network Layer 4-21


Router architecture overview
two key router functions:
❖ run routing algorithms/protocol (RIP, OSPF, BGP)
❖ forwarding datagrams from incoming to outgoing link

forwarding tables computed, routing


pushed to input ports routing, management
processor
control plane (software)

forwarding data
plane (hardware)

high-seed
switching
fabric

router input ports router output ports


Network Layer 4-22
Input port functions
link lookup,
layer forwarding
line protocol switch
termination (receive fabric
) queueing

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 (“match plus action”)
❖ goal: complete input port processing at ‘line
speed’
❖ queuing: if datagrams arrive faster than
forwarding rate into switch fabric
Network Layer 4-23
Switching fabrics
❖ transfer packet from input buffer to appropriate
output buffer
❖ switching rate: rate at which packets can be
transfer from inputs to outputs
▪ often measured as multiple of input/output line rate
▪ N inputs: switching rate N times line rate desirable
❖ three types of switching fabrics

memory

memory bus crossbar

Network Layer 4-24


Switching via memory
first generation routers:
❖ traditional computers with switching under direct control
of CPU
❖ packet copied to system’s memory
❖ speed limited by memory bandwidth (2 bus crossings per
datagram)

input output
port memory port
(e.g., (e.g.,
Ethernet) Ethernet)

system bus

Network Layer 4-25


Switching via a bus
❖ datagram from input port memory
to output port memory via a
shared bus
❖ bus contention: switching speed
limited by bus bandwidth
❖ 32 Gbps bus, Cisco 5600: sufficient bus
speed for access and enterprise
routers

Network Layer 4-26


Switching via interconnection network
❖ overcome bus bandwidth limitations
❖ banyan networks, crossbar, other
interconnection nets initially
developed to connect processors in
multiprocessor
❖ advanced design: fragmenting
datagram into fixed length cells, crossbar
switch cells through the fabric.
❖ Cisco 12000: switches 60 Gbps
through the interconnection network

Network Layer 4-27


Output ports

datagram
switch buffer link
fabric layer line
protocol termination
queueing (send)

❖ buffering required when datagrams


Datagram (packets)arrive
can be lost
from fabric faster than the
due to transmission
congestion, lack of buffers
rate
❖ scheduling discipline
Priority chooses
schedulingamong
– who gets best
queued datagrams for transmission
performance, network neutrality
Network Layer 4-28
Output port queueing

switch
switch
fabric
fabric

at t, packets more one packet time later


from input to output

❖ buffering when arrival rate via switch exceeds


output line speed
❖ queueing (delay) and loss due to output port
buffer overflow!
Network Layer 4-29
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 Gpbs link: 2.5 Gbit buffer
❖ recent recommendation: with N flows, buffering
equal to
RTT . C
N

Network Layer 4-30


Input port queuing
❖ fabric slower than input ports combined -> queueing may
occur at input queues
▪ queueing delay and loss due to input buffer overflow!
❖ Head-of-the-Line (HOL) blocking: queued datagram at front
of queue prevents others in queue from moving forward

switch switch
fabric fabric

output port contention: one packet time later:


only one red datagram can be green packet
transferred. experiences HOL
lower red packet is blocked blocking

Network Layer 4-31


Chapter 4: outline
4.1 introduction 4.5 routing algorithms
4.2 virtual circuit and ▪ link state
datagram networks ▪ distance vector
4.3 what’s inside a router ▪ hierarchical routing
4.4 IP: Internet Protocol 4.6 routing in the Internet
▪ datagram format ▪ RIP
▪ IPv4 addressing ▪ OSPF
▪ ICMP ▪ BGP
▪ IPv6 4.7 broadcast and multicast
routing

Network Layer 4-32

You might also like