Computer Network Network Layer
Computer Network Network Layer
Design Issues
Routing Algorithms
Congestion Control
Internetworking
Example Network Layer Protocols
datagrams
each packet sent is routed independently
of its predecessors
for connection-oriented and connectionless
services
Computer Networks Fall 2002 Page 4
Datagram Vs. Virtual Circuit
Application: K L
Concurrent updates of all distributed databases
Always choose the shortest path
A
C
A 1 A
D
C 1 C
E D 2 C
E 2 A
F G F 2 A
G 3 A
queue length
Drawback
Count-to-infinity problem
it reacts rapidly to good news, but leisurely
to bad news.
Computer Networks Fall 2002 Page 23
Count-to-Infinity Problem
A B C D E A B C D E
Initially 1 2 3 4
1 After 1 exchange 3 2 3 4
1 2 After 2 exchanges 3 4 3 4
1 2 3 After 3 exchanges 5 4 5 4
1 2 3 4 After 4 exchanges 5 6 5 6
After 5 exchanges 7 6 7 6
down initially and After 6 exchanges 7 8 7 8
come up later alive initially and
down later
Good News Bad News
Computer Networks Fall 2002 Page 24
Split Horizon Hack
Try to solve the count-to-infinity problem
the distance to X is not reported on the line
that packets for X are sent on (actually, it is
reported as infinity)
In many cases, the bad news propagates one
hop per exchange
infinity 2
A infinity B 1 C
Computer Networks Fall 2002 Page 25
B thinks it can reach D through
A with a cost of 2
2
Infinity infinity
(a) (b)
M
I J
K L
Foreign
Foreign
mobile node,
received at the tunnel foreign agent, and
Packet sent
Computer Networks Fall 2002 Page 59
Congestion Control
goal
make sure the subnet is able to carry the
offered traffic
Congestion causes
bursty data
insufficient memory
slow processor
low-bandwidth line
1 Mbps 1000
Congestion
Control 100 Kbps
1000
Routing algorithm
Load sharing
packets unregulated
flow
interface
implementing The bucket
Water drips holds
out of the
the leaky
hole at a bucket packets.
constant rate. algorithm regulated
flow
Network
1 2 3
Choke
Heavy
flow
6 5 4
7
Flow is reduced.
Computer Networks Fall 2002 Page 76
Hop-by-Hop Choke Packets
1 2 3
Choke
Heavy
flow
To provide quick
relief at the point
of congestion at 5 4
the price of using
up more buffers
upstream. Flow is reduced.
Priority Control
3 4 5 3 4 5 3 4 5
Receivers
Computer Networks Fall 2002 Page 82
Bandwidth Reservation
Senders Senders Senders
1 2 1 2 1 2
3 4 5 3 4 5 3 4 5
Receivers Receivers
Computer Networks Fall 2002 Page 83
RSVP (Resource reSerVation
Protocol)
When making a reservation, a receiver
can (optionally) specify one or more
sources that it wants to receive from.
It can also specify whether these
choices are fixed for the duration of the
reservation, or whether the receiver
wants to keep open the option of
changing sources later.
Computer Networks Fall 2002 Page 84
RSVP (Resource reSerVation
Protocol)
Two receivers are only set up to share a
path if they both agree not to change
sources later on.
Once a receiver has reserved bandwidth,
it can switch to another source and
keep that portion of the existing path
that is valid for the new source.
R X.25
B R
SNA
Presentation Protocol
6 Presentation Presentation PPDU
Session Protocol
5 Session Session SPDU
Transport Protocol
4 Transport Transport TPDU
Internal Subnet Protocol
3 Network Network Network Network Packet
Repeater, Hub
Bridge
(Multi-protocol) Router, Layer 3 Switch
Layer 4 Switch
Gateway with interfaces of distinct layer
protocols
Bridge/Router (or called B-Router)
Computer Networks Fall 2002 Page 89
How Networks Differ
Service offered
Connection-oriented versus Connectionless
Protocol
IP, IPX, CLNP, AppleTalk, DECnet, etc.
Addressing
Flat (802) versus hierarchical (IP, PDN, PSTN,
ISDN, etc.)
Multicasting/Broadcasting
Present or absent
Packet size
Every network has its own maximum
Quality of service
Present or absent
Error handling
Reliable, ordered, and unordered delivery
Flow control
Sliding window, rate control, others, or none
OSI
M Host
M
2
1 M
M
M
M
2
R R
G2 G4
G1 fragments reassembles G3 fragments reassembles
a large packet the fragments again again
(a)
Packet
G1 G2 G3 G4
(b)
27 0 1 A B C D E F G H I J
Header
(a)
27 0 0 A B C D E F G H 27 8 1 I J
Header Header
(b)
27 0 0 A B C D E 27 5 0 F G H 27 8 1 I J
Outside
Packet Packet
Inside
Application
Filtering Gateway Filtering
Router Router
Source address
Destination address
Network 11 11 Broadcast on a
distant network
Problem
Immense administrative overhead
Every time a new network is installed the system
administrator has to contact NIC to get a new network
number.
Then this number must be announced worldwide.
Solution: To minimize network numbers by
sharing one network number among multiple
physical networks
Subnet mask 11 11 11 11 00 00
IP header
Type Code Checksum
Identifier Sequence number
Optional data
Computer Networks Fall 2002 Page 121
The Address Resolution Protocol
(ARP RFC 826)
To map an IP address onto data link layer
address, such as Ethernet.
An IP host runs the ARP protocol to inquiry
the unknown data link layer address of a
destination IP address before a datagram is
sent.
The ARP of a host may maintain a cache to
record known IP address and DLL address
pairs.
A machine may broadcast its own mapping
when it boots by using ARP.
Computer Networks Fall 2002 Page 122
Example: ARP
B C Information F receives
D
A from its neighbors about D
Hardware Multicast
Response
Multicast
router
1, 2
1, 3 3
register
Packet for He is here care-of-address
mobile host
(tunneling)
care-of-address Packet for
mobile host
ARP Query
Packet for
mobile host ARP Response
Packet for (tunneling)
mobile host
192.0.0.0 223.255.255.255
Source address
(16 bytes)
Destination address
(16 bytes)
Version: 6
Priority
0~7: for transmission possibly slowed down in
case of congestion
8~15: for real time traffic with constant sending
rate
suggestion
1: news
4: FTP
6: Telnet