Professional Documents
Culture Documents
Network layer
Chapter 4: Network Layer
transport segment from application
transport
Link state
on sending side network network
4.2 Virtual circuit and network
data link data link
Distance Vector
encapsulates segments data link
physical physical
Hierarchical routing
into datagrams data link data link
routing algorithms
12 22 32
a VC consists of: 1
2
3
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-13 Network Layer 4-14
Datagram networks
Virtual circuits: signaling protocols
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
transport 5. Data flow begins 6. Receive data application application
transport application
network 4. Call connected 3. Accept call transport
network transport
data link 1. Initiate call 2. incoming call network
data link network
physical data link 1. Send data 2. Receive data
physical data link
physical
physical
otherwise 3
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
System Bus
223.1.1.1
IP address:
223.1.2.1
Recipe
subnet part (high
223.1.1.2
order bits) To determine the
223.1.1.4 223.1.2.9
host part (low order subnets, detach each
bits) 223.1.1.3 223.1.3.27
223.1.2.2 interface from its
What’s a subnet ? host or router,
subnet creating islands of
device interfaces with
same subnet part of IP 223.1.3.1 223.1.3.2 isolated networks.
address Each isolated network
can physically reach is called a subnet. 223.1.3.0/24
each other without
intervening router network consisting of 3 subnets Subnet mask: /24
223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.0
Q: How does a host get IP address? Goal: allow host to dynamically obtain its IP address
from network server when it joins network
Can renew its lease on address in use
hard-coded by system admin in a file Allows reuse of addresses (only hold address while connected
an “on”)
Windows: control-panel->network->configuration-
Support for mobile users who want to join network (more
>tcp/ip->properties
shortly)
UNIX: /etc/rc.config
DHCP overview:
DHCP: Dynamic Host Configuration Protocol:
host broadcasts “DHCP discover” msg
dynamically get address from as server
DHCP server responds with “DHCP offer” msg
“plug-and-play”
host requests IP address: “DHCP request” msg
DHCP server sends address: “DHCP ack” msg
Network Layer 4-43 Network Layer 4-44
DHCP client-server scenario
DHCP client-server scenario DHCP server: 223.1.2.5 DHCP discover
arriving
client
src : 0.0.0.0, 68
dest.: 255.255.255.255,67
yiaddr: 0.0.0.0
transaction ID: 654
A DHCP 223.1.2.1
223.1.1.1 DHCP offer
server
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
223.1.1.2 yiaddrr: 223.1.2.4
223.1.1.4 223.1.2.9 transaction ID: 654
Lifetime: 3600 secs
B DHCP request
223.1.2.2 arriving DHCP
223.1.1.3 223.1.3.27 E client needs
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
address in this yiaddrr: 223.1.2.4
223.1.3.1 223.1.3.2 transaction ID: 655
network time 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
rest of local network Motivation: local network uses just one IP address as
Internet (e.g., home network) far as outside world is concerned:
10.0.0/24 10.0.0.1
range of addresses not needed from ISP: just one IP
10.0.0.4 address for all devices
10.0.0.2
138.76.29.7 can change addresses of devices in local network
without notifying outside world
10.0.0.3
can change ISP without changing addresses of
All datagrams leaving local Datagrams with source or devices in local network
network have same single source destination in this network
devices inside local net not explicitly addressable,
NAT IP address: 138.76.29.7, have 10.0.0/24 address for
different source port numbers source, destination (as usual) visible by outside world (a security plus).
Options: allowed, but outside of header, How will the network operate with mixed IPv4 and
Tunneling Tunneling
A B E F A B E F
Logical view: tunnel Logical view: tunnel
A B E F A B C D E F
Physical view: Physical view:
IPv6 IPv6 IPv4 IPv4 IPv6 IPv6 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-67 Network Layer 4-68
Interplay between routing, forwarding
Chapter 4: Network Layer
4. 1 Introduction 4.5 Routing algorithms routing algorithm
Example: P2P, where N is set of peers and E is set of TCP connections Routing algorithm: algorithm that finds least-cost path
from
from
by: y ∞∞ ∞ y 2 0 1
wait for (change in local link z ∞∞ ∞ z 7 1 0
local link cost change
node y table
DV update message from cost or msg from neighbor) cost to
neighbor x y z y
2 1
Distributed: x ∞ ∞ ∞
recompute estimates x z
from
y 2 0 1 7
each node notifies
z ∞∞ ∞
neighbors only when its DV
node z table
changes if DV to any dest has cost to
neighbors then notify x y z
changed, notify neighbors
their neighbors if
x ∞∞ ∞
necessary
from
y ∞∞ ∞
z 71 0
time
Network Layer 4-85 Network Layer 4-86
from
from
y ∞∞ ∞ y 2 0 1 y 2 0 1 4 1
z ∞∞ ∞ z 7 1 0 updates routing info, recalculates
z 3 1 0 x z
node y table distance vector 50
cost to cost to cost to if DV changes, notify neighbors
x y z x y z x y z y
2 1
x ∞ ∞ ∞ x 0 2 7 x 0 2 3 At time t0, y detects the link-cost change, updates its DV,
x z
from
from
from
from
from
y ∞∞ ∞ y 2 0 1 y 2 0 1 message to z.
z 71 0 z 3 1 0 z 3 1 0
time
Network Layer 4-87 Network Layer 4-88
Distance Vector: link cost changes Comparison of LS and DV algorithms
x
3c
3a 2c 3c
3b 2a 3a 2c
AS3 2b 3b 2a
1c AS2
AS3 2b
1c AS2
1a 1b
1d AS1 1a 1b AS1
1d
Network Layer 4-95 Network Layer 4-96
Example: Choosing among multiple ASes Example: Choosing among multiple ASes
now suppose AS1 learns from inter-AS protocol that now suppose AS1 learns from inter-AS protocol that
subnet x is reachable from AS3 and from AS2. subnet x is reachable from AS3 and from AS2.
to configure forwarding table, router 1d must to configure forwarding table, router 1d must
determine towards which gateway it should forward determine towards which gateway it should forward
packets for dest x. packets for dest x.
this is also job of inter-AS routing protocol! this is also job of inter-AS routing protocol!
hot potato routing: send packet towards closest of
two routers.
x
3c Determine from
3a 2c Learn from inter-AS
Use routing info
Hot potato routing:
3b 2a from intra-AS forwarding table the
AS3 2b protocol that subnet
protocol to determine
Choose the gateway interface I that leads
1c AS2 x is reachable via
costs of least-cost
that has the to least-cost gateway.
multiple gateways smallest least cost
1a 1b paths to each Enter (x,I) in
1d AS1 of the gateways forwarding table
4. 1 Introduction 4.5 Routing algorithms also known as Interior Gateway Protocols (IGP)
4.2 Virtual circuit and Link state most common Intra-AS routing protocols:
datagram networks Distance Vector
spanning tree G G
No redundant packets received by any node (a) Broadcast initiated at A (b) Broadcast initiated at D
Dense: Sparse:
group members # networks with group
physical topology logical topology
densely packed, in members small wrt #
mcast datagram encapsulated inside “normal” (non-multicast-
“close” proximity. interconnected networks
addressed) datagram bandwidth more group members “widely
normal IP datagram sent thru “tunnel” via regular IP unicast to plentiful dispersed”
receiving mcast router bandwidth not plentiful
receiving mcast router unencapsulates to get mcast datagram
Consequences of Sparse-Dense Dichotomy: PIM- Dense Mode
Dense Sparse: flood-and-prune RPF, similar to DVMRP but
group membership by no membership until underlying unicast protocol provides RPF info
routers assumed until routers explicitly join for incoming datagram
routers explicitly prune receiver- driven
less complicated (less efficient) downstream
data-driven construction construction of mcast flood than DVMRP reduces reliance on
on mcast tree (e.g., RPF) tree (e.g., center-based) underlying routing algorithm
bandwidth and non- bandwidth and non-group-
has protocol mechanism for router to detect it
group-router processing router processing
is a leaf-node router
profligate conservative