0% found this document useful (0 votes)
16 views81 pages

6 - Network Layer - Single File

Uploaded by

muproductions002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views81 pages

6 - Network Layer - Single File

Uploaded by

muproductions002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 81

Network Layer

Computer Networking: A Top Down Approach Featuring the Internet,


2nd edition.
Jim Kurose, Keith Ross

Network Layer 4-1


Network Layer
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 IPv6

Network Layer 4-2


Network layer functions
 transport packet from applicatio

sending to receiving hosts n


transport
network
 network layer protocols in data link
network
data link
network network
physical
every host, router data link
physical
physical data link
physical
network
three important functions: data link
physical network
 path determination: route data link
physical
taken by packets from network
source to dest. Routing network
data link
data link
physical
algorithms physical
network
 forwarding: move packets data link applicatio
n
physical
from router’s input to transport
network
appropriate router output data link
physical
 call setup: some network
architectures require router
call setup along path before
data flows Network Layer 4-3
Network service model
Q: What service model
for “channel”
The most important
transporting packets abstraction provided
from sender to by network layer:
receiver?
 guaranteed bandwidth?

? ?
virtual circuit
service abstraction

 preservation of inter- or

?
packet timing (no jitter)? datagram?
 loss-free delivery?
 in-order delivery?
 congestion feedback to
sender?

Network Layer 4-4


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
 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.

Network Layer 4-5


Chapter 4 roadmap
4.1 Introduction and Network Service Models
4.2 Routing Principles
 Link state routing
 Distance vector routing
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-10


Routing
Routing protocol
Goal: determine “good” 5
path 3
(sequence of routers) thru B C 5
2
network from source to A 2
3
1 F
dest.
Graph abstraction for 1 2
routing algorithms: D E
1
 graph nodes are
routers  “good” path:
 graph edges are  typically means

physical links minimum cost path


 other def’s possible
 link cost: delay, $
cost, or congestion
level
Network Layer 4-11
Routing Algorithm classification
Global or decentralized Static or dynamic?
information?
Static:
Global:
 all routers have complete  routes change slowly
topology, link cost info over time
 “link state” algorithms
Dynamic:
Decentralized:
 router knows physically-
 routes change more
connected neighbors, link quickly
costs to neighbors  periodic update
 iterative process of
computation, exchange of  in response to link
info with neighbors cost changes
 “distance vector” algorithms

Network Layer 4-12


A Link-State Routing Algorithm

Dijkstra’s algorithm Notation:


 net topology, link costs  c(i,j): link cost from node
known to all nodes i to j. cost infinite if not
 accomplished via “link
direct neighbors
state broadcast”
 D(v): current value of
 all nodes have same
info cost of path from source
 computes least cost paths
to dest. V
from one node (‘source”)  p(v): predecessor node
to all other nodes along path from source
 gives routing table for to v, that is next v
that node  N: set of nodes whose
 iterative: after k iterations,
least cost path
know least cost path to k definitively known
dest.’s
Network Layer 4-13
Dijsktra’s Algorithm
1 Initialization:
2 N = {A}
3 for all nodes v
4 if v adjacent to A
5 then D(v) = c(A,v)
6 else D(v) = infinity
7
8 Loop
9 find w not in N such that D(w) is a minimum
10 add w to N
11 update D(v) for all v adjacent to w and not in N:
12 D(v) = min( D(v), D(w) + c(w,v) )
13 /* new cost to v is either old cost to v or known
14 shortest path cost to w plus cost from w to v */
15 until all nodes in N

Network Layer 4-14


Dijkstra’s algorithm: example
Step start N D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) D(F),p(F)
0 A 2,A 5,A 1,A infinity infinity
1 AD 2,A 4,D 2,D infinity
2 ADE 2,A 3,E 4,E
3 ADEB 3,E 4,E
4 ADEBC 4,E
5 ADEBCF

5
3
B C 5
2
A 2 1 F
3
1 2
D E
1

Network Layer 4-15


Dijkstra’s algorithm, discussion
Oscillations possible:
 e.g., link cost = amount of carried traffic

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

Network Layer 4-17


Distance Table: example

1 cost to destination via


B C E
7 D () A B D
A 8 2
1 A 1 14 5
E D
2
B 7 8 5

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

Distance table Routing table

Network Layer 4-19


Distance Vector Routing: overview
Iterative, asynchronous: Each node:
each local iteration
caused by:
 local link cost change wait for (change in local link
 message from neighbor: cost of msg from neighbor)
its least cost path change
from neighbor
Distributed: recompute distance table
 each node notifies
neighbors only when its
least cost path to any if least cost path to any dest
destination changes has changed, notify
 neighbors then notify neighbors
their neighbors if
necessary

Network Layer 4-20


Distance Vector Algorithm: example

Y
2 1
X Z
7

Network Layer 4-23


Distance Vector Algorithm: example

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

Network Layer 4-24


Distance Vector: link cost changes
Link cost changes:
 node detects local link cost 1
Y
change 4 1
 updates distance table (line 15) X Z
50
 if cost change in least cost path,
notify neighbors (lines 23,24)
algorithm
terminates
“good
news
travels
fast”

Network Layer 4-25


Distance Vector: link cost changes

Link cost changes: 60


 good news travels fast Y
4 1
 bad news travels slow -
“count to infinity” problem! X Z
50

algorithm
continues
on!

Network Layer 4-26


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-29


Hierarchical Routing
Our routing study thus far - idealization
 all routers identical
 network “flat”
… not true in practice

scale: with 200 million administrative


destinations: autonomy
 can’t store all dest’s in  internet = network of
routing tables! networks
 routing table exchange  each network admin may
would swamp links! want to control routing in
its own network

Network Layer 4-30


Hierarchical Routing
 aggregate routers gateway routers
into regions,  special routers in AS
“autonomous  run intra-AS routing
systems” (AS) protocol with all other
 routers in same AS routers in AS
 also responsible for
run same routing
routing to destinations
protocol outside AS
 “intra-AS” routing  run inter-AS routing
protocol protocol with other
 routers in different AS gateway routers
can run different intra-
AS routing protocol

Network Layer 4-31


Intra-AS and Inter-AS routing
C.b Gateways:
B.a
•perform inter-AS
A.a routing amongst
b A.c c themselves
a C a
b •perform intra-AS
a B
routers with
d c other routers in
A b
their AS

network layer
inter-AS, intra-AS link layer
routing in
gateway A.c physical layer

Network Layer 4-32


Intra-AS and Inter-AS routing
Inter-AS
C.b routing
between B.a
A.a A and B Host
b A.c c h2
a C a
b
a B
Host d c Intra-AS routing
h1 b
A within AS B
Intra-AS routing
within AS A

 We’ll examine specific inter-AS and intra-AS


Internet routing protocols shortly

Network Layer 4-33


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.4.1 IPv4 addressing
 4.4.2 Moving a datagram from source to destination
 4.4.3 Datagram format
 4.4.4 IP fragmentation
 4.4.5 ICMP: Internet Control Message Protocol
 4.4.6 DHCP: Dynamic Host Configuration Protocol
 4.4.7 NAT: Network Address Translation
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-34
The Internet Network layer
Host, router network layer functions:

Transport layer: TCP, UDP

Routing protocols IP protocol


•addressing conventions
•path selection
•datagram format
•RIP, OSPF, BGP
Network •packet handling conventions

layer forwarding
ICMP protocol
table •error reporting
•router
“signaling”
Link layer

physical layer

Network Layer 4-35


IPv4
 IP address is a 32-bit value, that means that there are
four billion different IP address possibilities.
 IP addresses are hierarchical addresses.
 Every IP address has two parts. These are known as the
network number and the host number.
Range
Rangeofof
Number
Number Number
NumberofofHosts
Hosts Network
NetworkIDsIDs
of
ofNetworks
Networks per
perNetwork
Network (First Octet)
(First Octet)

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.

Rules for Subnetting: 3-Rule Approach


 Determine the subnet mask required
 Determine the Network IDs
 Determine the Host IDs
Defining a Subnet Mask
11 Convert the Number of Segments to Binary
22 Count the Number of Required Bits
33 Convert the Required Number of Bits to Decimal
(High Order)
Example of Class B Address
Number
Number of
of Subnets
Subnets 6
Binary
Binary Value
Value 0 0 0 0 0 1 1 0 (3 Bits)

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).

If z bits remain to be used for the host


ID, then the maximum number of
hosts is 2z –2 (because host & subnet
values cannot be all 0’s or 1’s).
Defining Subnet IDs

255 255 224 0


11
11111111 11111111 11100000 00000000

1. Using the same number of


bits as are used for the 00000000 = 0
subnet mask, list all 00100000 = 32
possible combinations. 01000000 = 64
01100000 = 96
2. Cross out values that use 10000000 = 128
all 0’s or 1’s. 10100000 = 160
11000000 = 192
3. Convert to decimal the 11100000 = 224
subnet ID bits for each
subnet. 22 33
Defining Host IDs for a Subnet
Subnet
SubnetIDs
IDs Host
HostID
IDRange
Range

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

 Each Subnet ID Indicates the Beginning Value in a


Range
 The Ending Value Is One Less Than the Beginning
Value of the Next Subnet ID
How many bits can be borrowed from the host
number in class "B" and class "C" networks to
create subnets?

 Because there are only two octets in the


host field of a class "B” network, up to
fourteen bits can be borrowed to create
subnetworks.
 A class "C" network has only one octet
in the host field. Therefore, only up to
six bits can be borrowed in class "C”
networks to create subnetworks.
 If 197.15.22.160 is converted to binary
format, it becomes
110001010.00001111.00010110.
10100000.
 What information can be obtained from
the above binary address?
 The first three bits in the last octet, 101,
indicate that this is the sixth
subnetwork. As before the remaining
bits are all binary 0s. This means that
the IP address197.15.22.160 must be
one that is reserved for a subnetwork
address.
How does the router handle IP
addresses and subnet masks? 00000000 = 000000000 = 0
00100000
00100000==32
32
 Source IP = 197.15.22.44 01000000
01000000==64
64
 Destination IP = 156.10.98.5 01100000
01100000==96
96
10000000
10000000==128
128
 (Dest. Router Address: 156.10.0.0) 10100000
10100000==160
160
 Subnet mask = 255.255.224.0 11000000
11000000==192
192
11100000
11100000==224
224
Subnet Id’s

Destination IP 10011100 11111010 01100010 00000101


Subnet Mask 11111111 11111111 11100000 00000000
BOOLEAN AND
10011100 11111010 01100000 00000101
Subnet ID
156 . 10 . 96 . 0
IP addressing: CIDR
 Classful addressing:
 inefficient use of address space, address space
exhaustion
 e.g., class B net allocated enough addresses for 65K
hosts, even if only 2K hosts in that network
 CIDR: Classless InterDomain Routing
 network portion of address of arbitrary length
 address format: a.b.c.d/x, where x is # bits in network
portion of address
network host
part part
11001000 00010111 00010000 00000000
200.23.16.0/23
Network Layer 4-48
IP addresses: how to get one?
Q: How does network get network part of IP
addr?
A: gets allocated portion of its provider ISP’s
address space

ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20

Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23


Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23
Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23
... ….. …. ….
Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23

Network Layer 4-49


Hierarchical addressing: route
aggregation
Hierarchical addressing allows efficient advertisement of routing
information:

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”

Network Layer 4-50


IP addressing: the last word...

Q: How does an ISP get block of


addresses?
A: ICANN: Internet Corporation for Assigned
Names and Numbers
 allocates addresses
 manages DNS
 assigns domain names, resolves disputes

Network Layer 4-51


IP datagram format
IP protocol version 32 bits
number total datagram
header length type of length (bytes)
ver head. length
(bytes) len service for
“type” of data fragment fragmentation/
16-bit identifier flgs
offset reassembly
max number time to upper Internet
remaining hops live layer checksum
(decremented at
32 bit source IP address
each router)
32 bit destination IP address
upper layer protocol
to deliver payload to Options (if any) E.g. timestamp,
record route
how much overhead data taken, specify
with TCP? (variable length, list of routers
 20 bytes of TCP typically a TCP to visit.
 20 bytes of IP or UDP segment)
 = 40 bytes + app
layer overhead
Network Layer 4-52
IP Fragmentation & Reassembly
 network links have MTU
(max.transfer size) - largest
possible link-level frame.
 different link types,
fragmentation:
different MTUs in: one large datagram
 large IP datagram divided out: 3 smaller datagrams
(“fragmented”) within net
 one datagram becomes
several datagrams
reassembly
 “reassembled” only at
final destination
 IP header bits used to
identify, order related
fragments

Network Layer 4-53


IP Fragmentation and
Reassembly
Example length ID fragflag offset
 4000 byte datagram =4000 =x =0 =0
 MTU = 1500 bytes
One large datagram becomes
 1st fragment: 1480B in several smaller datagrams
the data field of the IP
datagram
 2nd fragment: 1480B in the length ID fragflag offset
data field of the IP =1500 =x =1 =0
datagram
 3rd fragment: 1020B in the
length ID fragflag offset
data field of the IP
datagram (3980 – 1480 - =1500 =x =1 =1480
1480)
length ID fragflag offset
=1040 =x =0 =2960

Network Layer 4-54


ICMP: Internet Control Message
Protocol
 used by hosts, routers,
gateways to communication Type Code description
network-level information 0 0 echo reply (ping)
3 0 dest. network unreachable
 error reporting:
3 1 dest host unreachable
unreachable host, 3 2 dest protocol unreachable
network, port, protocol 3 3 dest port unreachable
 echo request/reply (used
3 6 dest network unknown
by ping) 3 7 dest host unknown
 network-layer “above” IP: 4 0 source quench (congestion
 ICMP msgs carried in IP control - not used)
datagrams 8 0 echo request (ping)
 ICMP message: type, code 9 0 route advertisement
10 0 router discovery
plus first 8 bytes of IP
11 0 TTL expired
datagram causing error
12 0 bad IP header

Network Layer 4-55


DHCP: Dynamic Host Configuration
Protocol
Goal: allow host to dynamically obtain its IP address from
network server when it joins network
Can renew its lease(CONTRACT) on address in use
Allows reuse of addresses (only hold address while connected an “on”
Support for mobile users who want to join network (more shortly)
DHCP overview:
 host broadcasts “DHCP discover” msg
 DHCP server responds with “DHCP offer” msg
 host requests IP address: “DHCP request” msg
 DHCP server sends address: “DHCP ack” msg

Network Layer 4-56


DHCP client-server scenario

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

Network Layer 4-57


DHCP client-server scenario
DHCP server: 223.1.2.5 arriving
DHCP discover
client
src : 0.0.0.0, 68
dest.: 255.255.255.255,67
addr: 0.0.0.0
transaction ID: 654

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

Network Layer 4-58


NAT: Network Address Translation

rest of local network


Internet (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

All datagrams leaving local Datagrams with source or


network have same single source destination in this network
NAT IP address: 138.76.29.7, have 10.0.0/24 address for
different source port numbers source, destination (as usual)

Network Layer 4-59


NAT: Network Address
Translation
 Motivation: local network uses just one IP address
as far as outside word is concerned:
 no need to be allocated range of addresses from
ISP: - just one IP address is used for all devices
 can change addresses of devices in local network
without notifying outside world
 can change ISP without changing addresses of
devices in local network
 devices inside local net not explicitly
addressable, visible by outside world (a security
plus).

Network Layer 4-60


NAT: Network Address
Translation
Implementation: NAT router must:

 outgoing datagrams: replace (source IP address, port


#) of every outgoing datagram to (NAT IP address,
new port #)
. . . remote clients/servers will respond using (NAT IP
address, new port #) as destination addr.
 remember (in NAT translation table) every (source IP
address, port #) to (NAT IP address, new port #)
translation pair
 incoming datagrams: replace (NAT IP address, new
port #) in dest fields of every incoming datagram with
corresponding (source IP address, port #) stored in
NAT table

Network Layer 4-61


NAT: Network Address Translation
NAT translation table
2: NAT router 1: host 10.0.0.1
WAN side addr LAN side addr
changes datagram sends datagram to
138.76.29.7, 5001 10.0.0.1, 3345 128.119.40, 80
source addr from
…… ……
10.0.0.1, 3345 to
138.76.29.7, 5001, S: 10.0.0.1, 3345
updates table D: 128.119.40.186,
80 10.0.0.1
1
S: 138.76.29.7,
2 5001 10.0.0.4
D: 128.119.40.186, 10.0.0.2
80
138.76.29.7 S: 128.119.40.186,
80 4
S: 128.119.40.186,
80 3 D: 10.0.0.1, 3345
10.0.0.3
D: 138.76.29.7, 4: NAT router
3: Reply
5001 arrives changes datagram
dest. address: dest addr from
138.76.29.7, 5001 138.76.29.7, 5001 to 10.0.0.1, 3345

Network Layer 4-62


NAT: Network Address Translation

 16-bit port-number field:


 60,000 simultaneous connections with a
single LAN-side address!
 NAT is controversial:
 routers should only process up to layer 3
 violates end-to-end argument
• NAT possibility must be taken into account by app
designers, eg, P2P applications
 address shortage should instead be solved
by IPv6

Network Layer 4-63


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.5.1 Intra-AS routing: RIP and OSPF
 4.5.2 Inter-AS routing: BGP

4.6 What’s Inside a Router?


4.7 IPv6
4.8 Multicast Routing
4.9 Mobility
Network Layer 4-64
Intra-AS Routing
 Also known as Interior Gateway Protocols (IGP)
 Most common Intra-AS routing protocols:

 RIP: Routing Information Protocol

 OSPF: Open Shortest Path First

 IGRP: Interior Gateway Routing Protocol


(Cisco proprietary)

Network Layer 4-65


RIP ( Routing Information Protocol)
 Distance vector algorithm
 Distance metric: # of hops (max = 15 hops)
 Distance vectors: exchanged among neighbors
every 30 sec via Response Message (also called
advertisement)
 Each advertisement: list of up to 25 destination
nets within AS

Network Layer 4-66


RIP: Example
z
w x y
A D B

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

Network Layer 4-67


RIP: Example
Dest Next hops
w - - Advertisement
x - - from A to D
z C 4
…. … ...
z
w x y
A D B

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

Network Layer 4-69


RIP Table example (continued)
Router: giroflee.eurocom.fr (netstat -rn)
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
127.0.0.1 127.0.0.1 UH 0 26492 lo0
192.168.2. 192.168.2.5 U 2 13 fa0
193.55.114. 193.55.114.6 U 3 58503 le0
192.168.3. 192.168.3.5 U 2 25 qaa0
default 193.55.114.129 UG 0 143454

 Three attached class C networks (LANs)


 Router only knows routes to attached LANs
 Default router used to “go up”
 Loopback interface (for debugging)

Network Layer 4-71


OSPF (Open Shortest Path First)
 “open”: publicly available
 Uses Link State algorithm
 LS packet dissemination
 Topology map at each node
 Route computation using Dijkstra’s algorithm

 OSPF advertisement carries one entry per


neighbor router
 Advertisements disseminated(SPREAD) to entire AS
(via flooding)
 Carried in OSPF messages directly over IP (rather than
TCP or UDP)

Network Layer 4-72


OSPF “advanced” features (not in
RIP)
 Security: all OSPF messages authenticated (to
prevent malicious intrusion)
 Multiple same-cost paths allowed (only one path
in RIP)
 For each link, multiple cost metrics for different
TOS (e.g., satellite link cost set “low” for best
effort; high for real time)
 Integrated uni- and multicast support:
 Multicast OSPF (MOSPF) uses same topology
data base as OSPF
 Hierarchical OSPF in large domains.
Network Layer 4-73
Hierarchical OSPF

Network Layer 4-74


Hierarchical OSPF
 Two-level hierarchy: local area, backbone.
 Link-state advertisements only in area
 each nodes has detailed area topology; only know
direction (shortest path) to nets in other areas.
 Area border routers: “summarize” distances to
nets in own area, advertise to other Area Border
routers.
 Backbone routers: run OSPF routing limited to
backbone.
 Boundary routers: connect to other AS’s.

Network Layer 4-75


Why different Intra- and Inter-AS routing ?

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

Network Layer 4-76


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-77
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-78
IPv6
 Initial motivation: 32-bit address space
completely allocated by 2008.
 Additional motivation:
 header format helps speed
processing/forwarding
 header changes to facilitate QoS
 new “anycast” address: route to “best” of
several replicated servers
 IPv6 datagram format:
 fixed-length 40 byte header
 no fragmentation allowed

Network Layer 4-79


IPv6 Header (Cont)
Priority: identify priority among datagrams in flow
Flow Label: identify datagrams in same “flow.”
(concept of“flow” not well defined).
Next header: identify upper layer protocol for data

Network Layer 4-80


Other Changes from IPv4
 Checksum: removed entirely to reduce
processing time at each hop
 Options: allowed, but outside of header,
indicated by “Next Header” field
 ICMPv6: new version of ICMP
 additional message types, e.g. “Packet Too
Big”
 multicast group management functions

Network Layer 4-81


Transition From IPv4 To IPv6
 Not all routers can be upgraded
simultaneous
 no“flag days”
 How will the network operate with mixed IPv4
and IPv6 routers?
 Two proposed approaches:
 Dual Stack: some routers with dual stack (v6,
v4) can “translate” between formats
 Tunneling: IPv6 carried as payload in IPv4
datagram among IPv4 routers

Network Layer 4-82


Dual Stack Approach
A B C D E F

IPv6 IPv6 IPv4 IPv4 IPv6 IPv6

Flow: X Src:A Src:A Flow: ??


Src: A Dest: F Dest: F Src: A
Dest: F Dest: F

data data data data

A-to-B: B-to-C: B-to-C: B-to-C:


IPv6 IPv4 IPv4 IPv6

Network Layer 4-83


Tunneling
A B E F
Logical view: tunnel

IPv6 IPv6 IPv6 IPv6

A B C D E F
Physical view:
IPv6 IPv6 IPv4 IPv4 IPv6 IPv6

Flow: X Src:B Src:B Flow: X


Src: A Dest: E Dest: E Src: A
Dest: F Dest: F
Flow: X Flow: X
Src: A Src: A
data Dest: F Dest: F data

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

 rely on router’s knowledge of unicast


shortest path from it to sender
 each router has simple forwarding behavior:

if (mcast datagram received on incoming link


on shortest path back to center)
then flood datagram onto all outgoing links
else ignore datagram
Reverse Path Forwarding:
example
S: source
LEGEND
R1
R4 router with attached
group member
R2
router with no attached
R5 group member
R3 datagram will be
R6 R7 forwarded
datagram will not be
forwarded

• result is a source-specific reverse SPT


– may be a bad choice with asymmetric links
Reverse Path Forwarding:
pruning
 forwarding tree contains subtrees with no mcast
group members
 no need to forward datagrams down subtree
 “prune” msgs sent upstream by router with
no downstream group members

S: source LEGEND

R1 router with attached


R4
group member

R2 router with no attached


P group member
P
R5 prune message
R3 P links with multicast
R6 R7 forwarding
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-90
Network Layer: summary
What we’ve covered:
 network layer services
 routing principles: link state
and distance vector
 hierarchical routing
 IP
 Internet routing protocols RIP,
OSPF, BGP Next stop:
 what’s inside a router? the Data
 IPv6 link layer!
 mobility

Network Layer 4-91

You might also like