Sei sulla pagina 1di 186

14033103-4 Computer Networks

Review

Dr. Ammar Jaafar


ayjaafar@uqu.edu.sa
DATA COMMUNICATIONS

Data communications are the exchange of data between


two devices via some form of transmission medium such as
a wire cable.
Five components of data communication

Message: is the data or information to be communicated. It may consist of text, number, pictures, sound, video
or any a combination of these.
Sender: is a device that sends message. it is also called source or transmitter.
Receiver: is a device that receives message. It is also called sink. The receiver can be computer, printer or
another computer related device.
Medium: is the physical path that connects sender and receiver. It is used to transmit data. The medium can be a
copper wire, a fiber optic cable, microwaves etc. it is also called communication channel.
Network protocols: are formal standards and policies comprised of rules, procedures and formats that define
communication between two or more devices over a network.
Data flow (simplex, half-duplex, and full-duplex)
NETWORKS

A network is a set of devices (often referred to as nodes)


connected by communication links. A node can be a
computer, printer, or any other device capable of sending
and/or receiving data generated by other nodes on the
network.

1.5
Types of connections: point-to-point and multipoint
THE INTERNET

The Internet has revolutionized many aspects of our daily


lives.
It has affected the way we do business as well as the way
we spend our leisure time.
The Internet is a communication system that has brought a
wealth of information to our fingertips and organized it for
our use.

1.7
Hierarchical organization of the Internet
Part 2
Network Models
LAYERED TASKS

We use the concept of layers in our daily life. As an


example, let us consider two friends who communicate
through postal mail. The process of sending a letter to a
friend would be complex if there were no services
available from the post office.

2.10
Tasks involved in sending a letter
Seven layers of the OSI model
An exchange using the OSI model

2.13
Physical layer

The physical layer is responsible for movements of


individual bits from one hop (node) to the next.
Data link layer

The data link layer is responsible for moving


frames from one hop (node) to the next.
Hop-to-hop delivery
Network layer

The network layer is responsible for the


delivery of individual packets from
the source host to the destination host.
Source-to-destination delivery
Transport layer

The transport layer is responsible for the delivery


of a message from one process to another.
Session layer

The session layer is responsible for dialog


control and synchronization.
Presentation layer

The presentation layer is responsible for translation,


compression, and encryption.
Application layer

The application layer is responsible for


providing services to the user.
Summary of layers
The interaction between layers in the OSI model
TCP/IP PROTOCOL SUITE
The layers in the TCP/IP protocol suite do not exactly
match those in the OSI model. The original TCP/IP protocol
suite was defined as having four layers: host-to-network,
internet, transport, and application. However, when
TCP/IP is compared to OSI, we can say that the TCP/IP
protocol suite is made of five layers: physical, data link,
network, transport, and application.
TCP/IP and OSI model
ADDRESSING

Four levels of addresses are used in an internet employing


the TCP/IP protocols: physical, logical, port, and specific.

Physical Adresses
Logical Adresses
Port Addresses
Addresses in TCP/IP
Relationship of layers and addresses in TCP/IP
Link layer services
•framing, link access:
• encapsulate datagram into frame, adding
header, trailer
• channel access if shared medium
• “MAC” addresses used in frame headers to
identify source, dest
• different from IP address!
•reliable delivery between adjacent nodes
• we learned how to do this already
• seldom used on low bit-error link (fiber,
some twisted pair)
• wireless links: high error rates
• Q: why both link-level and end-end
reliability?

Link Layer 5-1


Link layer services
(more)
v flow control:
§ pacing between adjacent sending and receiving
nodes
v error detection:
§ errors caused by signal attenuation, noise.
§ receiver detects presence of errors:
• signals sender for retransmission or drops frame
v error correction:
§ receiver identifies and corrects bit error(s) without
resorting to retransmission
v half-duplex and full-duplex
§ with half duplex, nodes at both ends of link can
transmit, but not at same time

Link Layer 5-2


Multiple access protocols
v single shared broadcast channel
v two or more simultaneous transmissions by nodes:
interference
§ collision if node receives two or more signals at
the same time

multiple access protocol


v distributed algorithm that determines how nodes
share channel, i.e., determine when node can
transmit
v communication about channel sharing must use
channel itself!
§ no out-of-band channel for coordination

Link Layer 5-3


An ideal multiple access protocol
given: broadcast channel of rate R bps
desiderata:
1. when one node wants to transmit, it can send
at rate R.
2. when M nodes want to transmit, each can
send at average rate R/M
3. fully decentralized:
• no special node to coordinate transmissions
• no synchronization of clocks, slots
4. simple

Link Layer 5-4


MAC addresses and ARP
•32-bit IP address:
• network-layer address for interface
• used for layer 3 (network layer) forwarding
•MAC (or LAN or physical or Ethernet)
address:
• function: used ‘locally” to get frame from one
interface to another physically-connected
interface (same network, in IP-addressing
sense)
• 48 bit MAC address (for most LANs) burned in
NIC ROM, also sometimes software settable
• e.g.: 1A-2F-BB-76-09-AD
hexadecimal (base 16) notation
(each “number” represents 4 bits)

Link Layer 5-5


Ethernet switch
•link-layer device: takes an active role
•store, forward Ethernet frames
•examine incoming frame’s MAC
address, selectively forward frame to
one-or-more outgoing links when frame
is to be forwarded on segment, uses
CSMA/CD to access segment
•transparent
•hosts are unaware of presence of
switches
•plug-and-play, self-learning
•switches do not need to be configured

Link Layer 5-6


Switches vs.
routers applicatio
both are store-and- n
forward: datagramtransport
§ routers: network-layer frame network
devices (examine link link frame
network-layer headers) physical physical
§ switches: link-layer
devices (examine link- switch
layer headers)
both have forwarding network datagram
tables:
link frame
§ routers: compute tables physical
using routing algorithms,
IP addresses
applicatio
§ switches: learn
forwarding table using n
flooding, learning, MAC transport
addresses
network
link
physical
Link Layer 5-7
Link layer, LANs: outline
6.1 introduction, services 6.5 link virtualization:
6.2 error detection, MPLS
correction 6.6 data center
6.3 multiple access networking
protocols 6.7 a day in the life of a
6.4 LANs web request
• addressing, ARP
• Ethernet
• switches
• VLANS

Link Layer and LANs 6-1


Link layer, LANs: outline
6.1 introduction, services 6.5 link virtualization:
6.2 error detection, MPLS
correction 6.6 data center
6.3 multiple access networking
protocols 6.7 a day in the life of a
6.4 LANs web request
• addressing, ARP
• Ethernet
• switches
• VLANS

Link Layer and LANs 6-2


Error detection
The idea is to add redundant information to the frame that can be used to
verify the its content

The extreme case is to transmit two copies of the data

Link Layer and LANs 6-3


Error detection
The idea is to add redundant information to the frame that can be used to
verify the its content

The extreme case is to transmit two copies of the data

If both copies are identical, then there


was no error, otherwise there was an
error in the transmission

Clearly not practical, and any error that


modifies the same bit on both strings will
not be detected

Link Layer and LANs 6-4


Error detection
The goal then is to provide error detection using up to “k” redundant bits
for an n-bit message (hopefully with k << n).

Link Layer and LANs 6-5


Error detection
EDC= Error Detection and Correction bits (redundancy)
D = Data protected by error checking, may include header fields

• Error detection not 100% reliable!


• protocol may miss some errors, but rarely
• larger EDC field yields better detection and correction

otherwise

Link Layer and LANs 6-6


Parity checking
single bit parity: two-dimensional bit parity:
§ detect single bit § detect and correct single bit errors
errors

0 0

* Check out the online interactive exercises for more


examples: http://gaia.cs.umass.edu/kurose_ross/interactive/ Link Layer and LANs 6-7
Data Link Layer 5-8
Data Link Layer 5-9
Internet checksum
goal: detect errors (e.g., flipped bits) in transmitted packet
(note: used at transport layer only)

sender: receiver:
§ treat segment contents § compute checksum of
as sequence of 16-bit received segment
integers § check if computed
§ checksum: addition (1 s checksum equals checksum
complement sum) of field value:
segment contents • NO - error detected
§ sender puts checksum • YES - no error detected.
value into UDP But maybe errors
checksum field nonetheless?

Link Layer and LANs 6-10


Internet checksum
• Break the sequence in to 16-bit
words
• Add the 16-bit values up. Each
time a carry- out (17th bit) is
produced, swing that bit around
and add it back into the LSb
(one’s digit).
• Once the sum is completed,
invert all bits (one’s
complement) of the result to
obtain the checksum

6-11
Internet checksum
IPv4 Header Checksum Example

6-12
Internet checksum
IPv4 Header Checksum Example

6-13
Internet checksum
IPv4 Header Checksum Example

Final Step is to take the one’s


complement of the sum:

6-14
Cyclic redundancy check
§ more powerful error-detection coding
§ view data bits, D, as a binary number
§ choose r+1 bit pattern (generator), G
§ goal: choose r CRC bits, R, such that
• <D,R> exactly divisible by G (modulo 2)
• receiver knows G, divides <D,R> by G. If non-zero remainder:
error detected!
• can detect all burst errors less than r+1 bits
§ widely used in practice (Ethernet, 802.11 WiFi, ATM)

Link Layer and LANs 6-15


CRC example
want:
D.2r XOR R = nG
equivalently:
D.2r = nG XOR R
equivalently:
if we divide D.2r by
G, want remainder R
to satisfy:

D.2r
R = remainder[ ]
G

* Check out the online interactive exercises for more


examples: http://gaia.cs.umass.edu/kurose_ross/interactive/ Link Layer and LANs 6-16
CRC example
Data = (111011110001)
Generator = 11001

Generator Polynomial = x4 + x3 +1
Chapter 5
Network Layer:
The Control Plane

A note on the use of these Powerpoint slides:


We re making these slides freely available to all (faculty, students, readers).
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.
They obviously represent a lot of work on our part. In return for use, we only
ask the following: Computer
§ 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!)
Networking: A Top
§ If you post any slides on a www site, that you note that they are adapted
from (or perhaps identical to) our slides, and note our copyright of this Down Approach
material.
7th Edition, Global Edition
Thanks and enjoy! JFK/KWR
Jim Kurose, Keith Ross
All material copyright 1996-2016 Pearson
J.F Kurose and K.W. Ross, All Rights Reserved April 2016
Network Layer: Control Plane 5-1
Chapter 5: network layer control plane
chapter goals: understand principles behind network
control plane
§ traditional routing algorithms
§ SDN controlllers
§ Internet Control Message Protocol
§ network management

and their instantiation, implementation in the Internet:


§ OSPF, BGP, OpenFlow, ODL and ONOS
controllers, ICMP, SNMP

Network Layer: Control Plane 5-2


Chapter 5: outline
5.1 introduction 5.5 The SDN control plane
5.2 routing protocols 5.6 ICMP: The Internet
§ link state Control Message
§ distance vector Protocol
5.3 intra-AS routing in the 5.7 Network management
Internet: OSPF and SNMP
5.4 routing among the ISPs:
BGP

Network Layer: Control Plane 5-3


Network-layer functions
Recall: two network-layer functions:
§ forwarding: move packets
from router s input to data plane
appropriate router output
§ routing: determine route
taken by packets from source control plane
to destination

Two approaches to structuring network control plane:


§ per-router control (traditional)
§ logically centralized control (software defined networking)

Network Layer: Control Plane 5-4


Per-router control plane
Individual routing algorithm components in each and every
router interact with each other in control plane to compute
forwarding tables

4.1 • OVERVIEW OF NETWORK LAYER 309

Routing
Algorithm
Routing algorithm control
Control plane plane
Data plane

Local forwarding
table
data
header output
plane
0100 3
0110 2
0111 2
1001 1

Values in arriving
packet’s header
1
1101

2
3

Network Layer: Control Plane 5-5


Figure 4.2 ♦ Routing algorithms determine values in forward tables
Logically centralized control plane
A distinct (typically remote) controller interacts with local
control agents (CAs) in routers to compute forwarding tables

Remote Controller

control
plane

data
plane

CA
CA CA CA CA

Network Layer: Control Plane 5-6


Chapter 5: outline
5.1 introduction 5.5 The SDN control plane
5.2 routing protocols 5.6 ICMP: The Internet
§ link state Control Message
§ distance vector Protocol
5.3 intra-AS routing in the 5.7 Network management
Internet: OSPF and SNMP
5.4 routing among the ISPs:
BGP

Network Layer: Control Plane 5-7


Routing protocols
Routing protocol goal: determine “good” paths
(equivalently, routes), from sending hosts to
receiving host, through network of routers
§ path: sequence of routers packets will traverse
in going from given initial source host to given
final destination host
§ “good”: least “cost”, “fastest”, “least
congested”
§ routing: a “top-10” networking challenge!

Network Layer: Control Plane 5-8


Graph abstraction of the network
5

v 3 w
2 5
u 2 1 z
3
1 2
x 1
y
graph: G = (N,E)

N = set of routers = { u, v, w, x, y, z }

E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }

aside: graph abstraction is useful in other network contexts, e.g.,


P2P, where N is set of peers and E is set of TCP connections

Network Layer: Control Plane 5-9


Graph abstraction: costs
5
c(x,x ) = cost of link (x,x )
3 e.g., c(w,z) = 5
v w
2 5
u cost could always be 1, or
2
3
1 z inversely related to bandwidth,
1 2 or inversely related to
x 1
y
congestion

cost of path (x1, x2, x3,…, xp) = c(x1,x2) + c(x2,x3) + … + c(xp-1,xp)

key question: what is the least-cost path between u and z ?


routing algorithm: algorithm that finds that least cost path

Network Layer: Control Plane 5-10


Routing algorithm classification
Q: global or decentralized Q: static or dynamic?
information?
static:
global:
§ routes change slowly over
§ all routers have complete time
topology, link cost info
dynamic:
§ link state algorithms
§ routes change more
decentralized: quickly
§ router knows physically- • periodic update
connected neighbors, link
costs to neighbors • in response to link
cost changes
§ iterative process of
computation, exchange of
info with neighbors
§ distance vector algorithms
Network Layer: Control Plane 5-11
Chapter 5: outline
5.1 introduction 5.5 The SDN control plane
5.2 routing protocols 5.6 ICMP: The Internet
§ link state Control Message
§ distance vector Protocol
5.3 intra-AS routing in the 5.7 Network management
Internet: OSPF and SNMP
5.4 routing among the ISPs:
BGP

Network Layer: Control Plane 5-12


A link-state routing algorithm
Dijkstra s algorithm notation:
§ net topology, link costs § c(x,y): link cost from
known to all nodes node x to y; = ∞ if not
• accomplished via link state direct neighbors
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 to
• gives forwarding table for v
that node § N': set of nodes whose
§ iterative: after k least cost path definitively
iterations, know least cost known
path to k dest. s
Network Layer: Control Plane 5-13
Dijsktra s algorithm
1 Initialization:
2 N' = {u}
3 for all nodes v
4 if v adjacent to u
5 then D(v) = c(u,v)
6 else D(v) = ∞
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: Control Plane 5-14


Dijkstra s algorithm: example
D(v) D(w) D(x) D(y) D(z)
Step N' p(v) p(w) p(x) p(y) p(z)
0 u 7,u 3,u 5,u ∞ ∞
1 uw 6,w 5,u 11,w ∞
2 uwx 6,w 11,w 14,x
3 uwxv 10,v 14,x
4 uwxvy 12,y
5 uwxvyz x
9

notes: 5
4
7
v construct shortest path tree by
8
tracing predecessor nodes
ties can exist (can be broken 3 w z
v u y
arbitrarily) 2
3
7 4
v
Network Layer: Control Plane 5-15
Dijkstra s algorithm: another example
Step N' D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) D(z),p(z)
0 u 2,u 5,u 1,u ∞ ∞
1 ux 2,u 4,x 2,x ∞
2 uxy 2,u 3,y 4,y
3 uxyv 3,y 4,y
4 uxyvw 4,y
5 uxyvwz
5
3
v w
2 5
u 2 1 z
3
1 2
x 1
y

* Check out the online interactive exercises for more


examples: http://gaia.cs.umass.edu/kurose_ross/interactive/ Network Layer: Control Plane 5-16
Dijkstra s algorithm: example (2)
resulting shortest-path tree from u:

v w
u z
x y

resulting forwarding table in u:


destination link
v (u,v)
x (u,x)
y (u,x)
w (u,x)
z (u,x)
Network Layer: Control Plane 5-17
Dijkstra s algorithm, discussion
algorithm complexity: n nodes
§ each iteration: need to check all nodes, w, not in N
§ n(n+1)/2 comparisons: O(n2)
§ more efficient implementations possible: O(nlogn)
oscillations possible:
§ e.g., support link cost equals amount of carried traffic:

1
A 1+e A A A
2+e 0 0 2+e 2+e 0
D 0 0 B D 1+e 1 B D B D 1+e 1 B
0 0
0 e 0 0
1
C C 0 1
C 1+e C 0
1
e
given these costs, given these costs, given these costs,
initially find new routing…. find new routing…. find new routing….
resulting in new costs resulting in new costs resulting in new costs
Network Layer: Control Plane 5-18
Chapter 5: outline
5.1 introduction 5.5 The SDN control plane
5.2 routing protocols 5.6 ICMP: The Internet
§ link state Control Message
§ distance vector Protocol
5.3 intra-AS routing in the 5.7 Network management
Internet: OSPF and SNMP
5.4 routing among the ISPs:
BGP

Network Layer: Control Plane 5-19


Distance vector algorithm
Bellman-Ford equation (dynamic programming)

let
dx(y) := cost of least-cost path from x to y
then
dx(y) = min
v
{c(x,v) + dv(y) }

cost from neighbor v to destination y


cost to neighbor v

min taken over all neighbors v of x


Network Layer: Control Plane 5-20
Bellman-Ford example
5
3
clearly, dv(z) = 5, dx(z) = 3, dw(z) = 3
v w
2 5
u 2 1 z B-F equation says:
3
1 2 du(z) = min { c(u,v) + dv(z),
x y
1 c(u,x) + dx(z),
c(u,w) + dw(z) }
= min {2 + 5,
1 + 3,
5 + 3} = 4
node achieving minimum is next
hop in shortest path, used in forwarding table

Network Layer: Control Plane 5-21


Distance vector algorithm
§ Dx(y) = estimate of least cost from x to y
• x maintains distance vector Dx = [Dx(y): y є N ]
§ node x:
• knows cost to each neighbor v: c(x,v)
• maintains its neighbors distance vectors. For
each neighbor v, x maintains
Dv = [Dv(y): y є N ]

Network Layer: Control Plane 5-22


Distance vector algorithm
key idea:
§ from time-to-time, each node sends its own
distance vector estimate to neighbors
§ when x receives new DV estimate from neighbor,
it updates its own DV using B-F equation:
Dx(y) ← minv{c(x,v) + Dv(y)} for each node y ∊ N

v under minor, natural conditions, the estimate Dx(y)


converge to the actual least cost dx(y)

Network Layer: Control Plane 5-23


Distance vector algorithm
iterative, asynchronous: each node:
each local iteration
caused by:
§ local link cost change wait for (change in local link
cost or msg from neighbor)
§ DV update message from
neighbor
distributed: recompute estimates
§ each node notifies
neighbors only when its
DV changes if DV to any dest has
• neighbors then notify their changed, notify neighbors
neighbors if necessary

Network Layer: Control Plane 5-24


Dx(z) = min{c(x,y) +
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)}
= min{2+0 , 7+1} = 2 Dy(z), c(x,z) + Dz(z)}
= min{2+1 , 7+0} = 3
node x cost to cost to
table x y z x y z
x 0 2 7 x 0 2 3

from
from

y ∞∞ ∞ y 2 0 1
z ∞∞ ∞ z 7 1 0

node y cost to
table x y z y
2 1
x ∞ ∞ ∞
x z
from

y 2 0 1 7
z ∞∞ ∞

node z cost to
table x y z
x ∞∞ ∞
from

y ∞∞ ∞
z 7 1 0
time
Network Layer: Control Plane 5-25
Dx(z) = min{c(x,y) +
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)}
= min{2+0 , 7+1} = 2 Dy(z), c(x,z) + Dz(z)}
= min{2+1 , 7+0} = 3
node x cost to cost to cost to
table x y z x y z x y z
x 0 2 7 x 0 2 3 x 0 2 3

from
from

y ∞∞ ∞ y 2 0 1 y 2 0 1

from
z ∞∞ ∞ z 7 1 0 z 3 1 0
node y cost to cost to cost to
table x y z x y z x y z y
2 1
x ∞ ∞ ∞ x 0 2 7 x 0 2 3 x z
from

y 2 0 1 y 2 0 1 7
from

y 2 0 1

from
z ∞∞ ∞ z 7 1 0 z 3 1 0

node z cost to cost to cost to


table x y z x y z x y z

x ∞∞ ∞ x 0 2 7 x 0 2 3
from

from

y 2 0 1 y 2 0 1
from

y ∞∞ ∞
z 7 1 0 z 3 1 0 z 3 1 0
time
Network Layer: Control Plane 5-26
Distance vector: link cost changes
link cost changes: 1
v node detects local link cost change 4
y
1
v updates routing info, recalculates x z
distance vector 50
v if DV changes, notify neighbors

good t0 : y detects link-cost change, updates its DV, informs its


news neighbors.
travels t1 : z receives update from y, updates its table, computes new
fast least cost to x , sends its neighbors its DV.

t2 : y receives z s update, updates its distance table. y s least costs


do not change, so y does not send a message to z.

* Check out the online interactive exercises for more


examples: http://gaia.cs.umass.edu/kurose_ross/interactive/ Network Layer: Control Plane 5-27
Distance vector: link cost changes
link cost changes: 60
v node detects local link cost change 4
y
1
v bad news travels slow - count to x z
infinity problem! 50
v 44 iterations before algorithm
stabilizes: see text
poisoned reverse:
v If Z routes through Y to get to X :
§ Z tells Y its (Z s) distance to X is infinite (so Y won t route
to X via Z)
v will this completely solve count to infinity problem?

Network Layer: Control Plane 5-28


Comparison of LS and DV algorithms
message complexity robustness: what happens if
§ LS: with n nodes, E links, O(nE) router malfunctions?
msgs sent LS:
§ DV: exchange between neighbors • node can advertise incorrect
only link cost
• convergence time varies • each node computes only its
own table
speed of convergence DV:
§ LS: O(n2) algorithm requires
O(nE) msgs • DV node can advertise
incorrect path cost
• may have oscillations
• each node s table used by
§ DV: convergence time varies others
• may be routing loops • error propagate thru
• count-to-infinity problem network

Network Layer: Control Plane 5-29


Chapter 5: outline
5.1 introduction 5.5 The SDN control plane
5.2 routing protocols 5.6 ICMP: The Internet
§ link state Control Message
§ distance vector Protocol
5.3 intra-AS routing in the 5.7 Network management
Internet: OSPF and SNMP
5.4 routing among the ISPs:
BGP

Network Layer: Control Plane 5-30


Chapter 5
Network Layer:
The Control Plane

A note on the use of these Powerpoint slides:


We re making these slides freely available to all (faculty, students, readers).
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.
They obviously represent a lot of work on our part. In return for use, we only
ask the following: Computer
§ 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!)
Networking: A Top
§ If you post any slides on a www site, that you note that they are adapted
from (or perhaps identical to) our slides, and note our copyright of this Down Approach
material.
7th Edition, Global Edition
Thanks and enjoy! JFK/KWR
Jim Kurose, Keith Ross
All material copyright 1996-2016 Pearson
J.F Kurose and K.W. Ross, All Rights Reserved April 2016
Network Layer: Control Plane 5-1
Chapter 5: network layer control plane
chapter goals: understand principles behind network
control plane
§ traditional routing algorithms
§ SDN controlllers
§ Internet Control Message Protocol
§ network management

and their instantiation, implementation in the Internet:


§ OSPF, BGP, OpenFlow, ODL and ONOS
controllers, ICMP, SNMP

Network Layer: Control Plane 5-2


Chapter 5: outline
5.1 introduction 5.5 The SDN control plane
5.2 routing protocols 5.6 ICMP: The Internet
§ link state Control Message
§ distance vector Protocol
5.3 intra-AS routing in the 5.7 Network management
Internet: OSPF and SNMP
5.4 routing among the ISPs:
BGP

Network Layer: Control Plane 5-3


Network-layer functions
Recall: two network-layer functions:
§ forwarding: move packets
from router s input to data plane
appropriate router output
§ routing: determine route
taken by packets from source control plane
to destination

Two approaches to structuring network control plane:


§ per-router control (traditional)
§ logically centralized control (software defined networking)

Network Layer: Control Plane 5-4


Per-router control plane
Individual routing algorithm components in each and every
router interact with each other in control plane to compute
forwarding tables

4.1 • OVERVIEW OF NETWORK LAYER 309

Routing
Algorithm
Routing algorithm control
Control plane plane
Data plane

Local forwarding
table
data
header output
plane
0100 3
0110 2
0111 2
1001 1

Values in arriving
packet’s header
1
1101

2
3

Network Layer: Control Plane 5-5


Figure 4.2 ♦ Routing algorithms determine values in forward tables
Logically centralized control plane
A distinct (typically remote) controller interacts with local
control agents (CAs) in routers to compute forwarding tables

Remote Controller

control
plane

data
plane

CA
CA CA CA CA

Network Layer: Control Plane 5-6


The Network Layer

Network Layer: Control Plane 5-7


Forwarding and Routing

Forwarding refers to the router-local action of transferring a packet from an


input link interface to the appropriate output link interface.

Network Layer: Control Plane 5-8


Forwarding and Routing

Routing refers to the network-wide process that determines the end-to-end


paths that packets take from source to destination.

Network Layer: Control Plane 5-9


The Network Service Model
• Guaranteed delivery. This service guarantees that the packet will eventually
arrive at its destination.

• Guaranteed delivery with bounded delay. This service not only guarantees delivery
of the packet, but delivery within a specified host-to-host delay bound (for
example, within 100 msec).

• In-order packet delivery. This service guarantees that packets arrive at the destination
in the order that they were sent.

• Guaranteed minimal bandwidth. This network-layer service emulates the behavior


of a transmission link of a specified bit rate (for example, 1 Mbps) between sending
and receiving hosts. As long as the sending host transmits bits (as part of packets)
at a rate below the specified bit rate, then no packet is lost and each

Network Layer: Control Plane 5-


10
Virtual Circuit and Datagram Networks

Network layer can provide:

§ Connectionless service between two hosts ( Datagram Networks )

§ Connection service between two hosts ( Virtual Circuit Networks )

Network Layer: Control Plane 5-


11
Virtual Circuit Networks

VC consist of:
§ A path ( series of links and routers)
§ VC number for each link
§ Entries in the forwarding table

Network Layer: Control Plane 5-


12
Virtual Circuit Networks

VC Phases:
§ VC Setup
§ Data Transfer
§ VC Teardown

Network Layer: Control Plane 5-


13
Virtual Circuit Networks

Network Layer: Control Plane 5-


14
Datagram Networks

To send a packet:
§ Stamp the packet with the destination address
§ Pops the packet on the network

Network Layer: Control Plane 5-


15
Datagram Networks
Destination Address: 11001000 00010111 00010110 10100001

Network Layer: Control Plane 5-


16
Datagram Networks
Destination Address: 11001000 00010111 00011000 10101010

Longest Prefix Matching Rules:


Find the longest matching entry in the table and forwards the packet to the link
interface associated with the longest prefix match.

Network Layer: Control Plane 5-


17
Chapter 5: outline
5.1 introduction 5.5 The SDN control plane
5.2 routing protocols 5.6 ICMP: The Internet
§ link state Control Message
§ distance vector Protocol
5.3 intra-AS routing in the 5.7 Network management
Internet: OSPF and SNMP
5.4 routing among the ISPs:
BGP

Network Layer: Control Plane 5-


18
Chapter 4: outline
4.1 Overview of Network 4.4 Generalized Forward and
layer SDN
• data plane • match
• control plane • action
4.2 What s inside a router • OpenFlow examples
4.3 IP: Internet Protocol of match-plus-action in
• datagram format action
• fragmentation
• IPv4 addressing
• network address
translation
• IPv6

Network Layer: Data Plane 4-1


Network layer
application
§ transport segment from transport
network

sending to receiving host data link


physical
network network

§ on sending side network


data link
data link
physical
data link
physical

encapsulates segments physical network


data link
network
data link

into datagrams physical physical

§ on receiving side, delivers network


data link
network
data link

segments to transport
physical physical
network
data link

layer network
physical
application
transport
§ network layer protocols network
data link
physical
network
data link
network
data link

in every host, router data link


physical
physical physical

§ router examines header


fields in all IP datagrams
passing through it
Network Layer: Data Plane 4-2
Two key network-layer functions

network-layer functions: analogy: taking a trip


§forwarding: move packets § forwarding: process of
from router s input to getting through single
appropriate router output interchange
§routing: determine route
taken by packets from § routing: process of
source to destination planning trip from source
• routing algorithms to destination

Network Layer: Data Plane 4-3


Network layer: data plane, control plane

Data plane Control plane


§ local, per-router function § network-wide logic
§ determines how datagram § determines how datagram is
arriving on router input routed among routers along
port is forwarded to end-end path from source host
router output port to destination host
§ forwarding function § two control-plane approaches:
• traditional routing algorithms:
values in arriving
packet header implemented in routers
1
• software-defined networking
0111
2
(SDN): implemented in
3
(remote) servers

Network Layer: Data Plane 4-4


Per-router control plane
Individual routing algorithm components in each and every
router interact in the control plane

4.1 • OVERVIEW OF NETWORK LAYER 309

Routing
Algorithm
Routing algorithm control
Control plane plane
Data plane

Local forwarding
table
data
header output
plane
0100 3
0110 2
0111 2
1001 1

Values in arriving
values in arriving
packet’s header
1
packet header 1101

2
3
0111 1
2
3

Figure 4.2 ♦ Routing algorithms determine values in forward tables


Network Layer: Control Plane 5-5
tables. In this example, a routing algorithm runs in each and every router and both
forwarding and routing functions are contained within a router. As we’ll see in Sec-
tions 5.3 and 5.4, the routing algorithm function in one router communicates with
Network service model
Q: What service model for channel transporting
datagrams from sender to receiver?
example services for example services for a flow
individual datagrams: of datagrams:
§ guaranteed delivery § in-order datagram
§ guaranteed delivery with delivery
less than 40 msec delay § guaranteed minimum
bandwidth to flow
§ restrictions on changes in
inter-packet spacing

Network Layer: Data Plane 4-6


Destination-based forwarding
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


2
through
11001000 00010111 00011111 11111111

otherwise 3

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


Network Layer: Data Plane 4-7
Longest prefix matching
longest prefix matching
when looking for forwarding table entry for given
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: Data Plane 4-8
Longest prefix matching
§ we’ll see why longest prefix matching is used
shortly, when we study addressing
§ longest prefix matching: often performed using
ternary content addressable memories (TCAMs)
• content addressable: present address to TCAM: retrieve
address in one clock cycle, regardless of table size
• Cisco Catalyst: can up ~1M routing table entries in
TCAM

Network Layer: Data Plane 4-9


The Internet network layer
host, router network layer functions:

transport layer: TCP, UDP

routing protocols IP protocol


• path selection • addressing conventions
• RIP, OSPF, BGP • datagram format
network • packet handling conventions
layer forwarding
table
ICMP protocol
• error reporting
• router
signaling
link layer

physical layer

Network Layer: Data Plane 4-10


IP datagram format
IP protocol version
number 32 bits total datagram
header length head. type of length (bytes)
(bytes) ver length
len service for
type of data fragment fragmentation/
16-bit identifier flgs
offset reassembly
max number time to upper header
remaining hops live layer checksum
(decremented at
each router) 32 bit source IP address

upper layer protocol 32 bit destination IP address


to deliver payload to e.g. timestamp,
options (if any)
record route
how much overhead? data taken, specify
(variable length, list of routers
v 20 bytes of TCP
typically a TCP to visit.
v 20 bytes of IP
or UDP segment)
v = 40 bytes + app
layer overhead

Network Layer: Data Plane 4-11


IP fragmentation, reassembly
§ network links have MTU
(max.transfer size) -
largest possible link-level fragmentation:


frame in: one large datagram
• different link types, out: 3 smaller datagrams
different MTUs
§ large IP datagram divided
( fragmented ) within net reassembly
• one datagram becomes
several datagrams
• reassembled only at …
final destination
• IP header bits used to
identify, order related
fragments
Network Layer: Data Plane 4-12
IP fragmentation, reassembly
length ID fragflag offset
example: =4000 =x =0 =0
v 4000 byte datagram
one large datagram becomes
v MTU = 1500 bytes
several smaller datagrams

1480 bytes in length ID fragflag offset


data field =1500 =x =1 =0

offset = length ID fragflag offset


1480/8 =1500 =x =1 =185

length ID fragflag offset


=1040 =x =0 =370

Network Layer: Data Plane 4-13


IP addressing: introduction
223.1.1.1
§ IP address: 32-bit 223.1.2.1
identifier for host, router
interface 223.1.1.2
223.1.1.4 223.1.2.9
§ interface: connection
between host/router and 223.1.3.27
physical link 223.1.1.3
223.1.2.2
• router s typically have
multiple interfaces
• host typically has one or
223.1.3.1 223.1.3.2
two interfaces (e.g., wired
Ethernet, wireless 802.11)
§ IP addresses associated
with each interface 223.1.1.1 = 11011111 00000001 00000001 00000001

223 1 1 1

Network Layer: Data Plane 4-14


IP addressing: introduction
§ IP address: 32-bit identifier for host, router interface
§ interface: connection between host/router and physical link

4-15
IP addressing: introduction
§ What is an IPv4 Address?
• Is a logical network address that identifies a particular host
• Configured and is unique on the network for
communications
• Is associated with a network interface card

4-16
IP addressing: introduction
223.1.1.1
Q: how are interfaces 223.1.2.1
actually connected?
A: we’ll learn about that 223.1.1.2
223.1.1.4 223.1.2.9

in chapter 5, 6.
223.1.3.27
223.1.1.3
223.1.2.2

A: wired Ethernet interfaces


connected by Ethernet switches
223.1.3.1 223.1.3.2

For now: don’t need to worry


about how one interface is
connected to another (with no
A: wireless WiFi interfaces
intervening router)
connected by WiFi base station

Network Layer: Data Plane 4-17


IP addressing: introduction
§ Networks and Hosts
• Logical 32-bit IPv4 address is hierarchical and is made up of
two parts
• Network
• Host
Subnets
§ IP address: 223.1.1.1
• subnet part - high order
bits 223.1.1.2 223.1.2.1
223.1.1.4 223.1.2.9
• host part - low order
bits 223.1.2.2
223.1.1.3 223.1.3.27
§ what s a subnet ?
• device interfaces with subnet
same subnet part of IP
223.1.3.2
address 223.1.3.1

• can physically reach


each other without
intervening router network consisting of 3 subnets

Network Layer: Data Plane 4-19


Subnets
223.1.1.0/24
223.1.2.0/24
recipe 223.1.1.1

§ to determine the 223.1.1.2 223.1.2.1


subnets, detach each 223.1.1.4 223.1.2.9

interface from its host 223.1.2.2


or router, creating 223.1.1.3 223.1.3.27

islands of isolated subnet


networks
223.1.3.2
§ each isolated network 223.1.3.1

is called a subnet
223.1.3.0/24

subnet mask: /24


Network Layer: Data Plane 4-20
Subnets 223.1.1.2

how many? 223.1.1.1 223.1.1.4

223.1.1.3

223.1.9.2 223.1.7.0

223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.0

223.1.2.6 223.1.3.27

223.1.2.1 223.1.2.2 223.1.3.1 223.1.3.2

Network Layer: Data Plane 4-21


Subnets
§ Are You on My Network?
• When a host sends a packet, it compares its subnet mask to
its own IPv4 address and the destination IPv4 address.
§ Subnet Masks
• Common subnet masks: 255.0.0.0 (8-bits), 255.255.0.0 (16
bits) and 255.255.255.0 (24 bits).
• Number of hosts: 2x - 2
Types of IPv4 Addresses

IPv4 Address Classes and Default Subnet


Masks
§ Classful Addressing
• Class A (0.0.0.0/8 to 127.0.0.0/8) supports extremely large
networks.
• Class B (128.0.0.0 /16 – 191.255.0.0 /16) supports the needs of
moderate to large size networks.
• Class C (192.0.0.0 /24 – 223.255.255.0 /24) supports small
networks with a maximum of 254 hosts.
§ Classless Addressing
• IPv4 addresses allocated on
any address bit boundary
• Delays the depletion and
exhaustion of IPv4 addresses
• Classless Inter-Domain
Routing (CIDR)
Types of IPv4 Addresses

Public and Private IP Addresses


§ Private IPv4 Addressing

§ Using Private IPv4 Addresses


• Does not connect directly to the Internet
• Visible on local network only
• Loopback address:
127.0.0.0 network
Types of IPv4 Addresses

Unicast, Broadcast and Multicast


Addresses
§ A Message for Me
• Unique destination
MAC
and IP addresses

§ Something for Everyone


• Broadcast MAC and IP address:
o MAC address: FFFF:FFFF:FFFF
o Host portion of IP Address is all 1s
Types of IPv4 Addresses
Unicast, Broadcast and Multicast Addresses (Cont.)
§ Just for this Group
• A single packet is sent to a selected set of hosts in the
multicast group
• Reserved IPv4 address
• Reserved multicast range: 224.0.0.0 to 239.255.255.255
• Reserved multicast range on local network: 224.0.0.0 to 224.0.0.255
IP addressing: CIDR
CIDR: Classless InterDomain Routing
• subnet portion of address of arbitrary length
• address format: a.b.c.d/x, where x is # bits in
subnet portion of address

subnet host
part part
11001000 00010111 00010000 00000000
200.23.16.0/23

Network Layer: Data Plane 4-27


IP addresses: how to get one?
Q: How does a host get IP address?

§ hard-coded by system admin in a file


• Windows: control-panel->network->configuration-
>tcp/ip->properties
• UNIX: /etc/rc.config
§ DHCP: Dynamic Host Configuration Protocol:
dynamically get address from as server
• plug-and-play

Network Layer: Data Plane 4-28


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 on address in use
• allows reuse of addresses (only hold address while
connected/ on )
• support for mobile users who want to join network (more
shortly)
DHCP overview:
• host broadcasts DHCP discover msg [optional]
• DHCP server responds with DHCP offer msg [optional]
• host requests IP address: DHCP request msg
• DHCP server sends address: DHCP ack msg

Network Layer: Data Plane 4-29


DHCP client-server scenario

DHCP
223.1.1.0/24
server
223.1.1.1 223.1.2.1

223.1.1.2 arriving DHCP


223.1.1.4 223.1.2.9
client needs
address in this
223.1.3.27
223.1.2.2 network
223.1.1.3

223.1.2.0/24

223.1.3.1 223.1.3.2

223.1.3.0/24

Network Layer: Data Plane 4-30


DHCP client-server scenario
DHCP server: 223.1.2.5 DHCP discover arriving
client
src : 0.0.0.0, 68
Broadcast: is there a
dest.: 255.255.255.255,67
DHCPyiaddr:
server 0.0.0.0
out there?
transaction ID: 654

DHCP offer
src: 223.1.2.5, 67
Broadcast: I’m a DHCP
dest: 255.255.255.255, 68
server!
yiaddrr:Here’s an IP
223.1.2.4
transaction ID:
address you can use654
lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
Broadcast: OK. I’ll take
yiaddrr: 223.1.2.4
that IP address!
transaction ID: 655
lifetime: 3600 secs

DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255,
Broadcast: 68
OK. You’ve
yiaddrr: 223.1.2.4
got that IPID:
transaction address!
655
lifetime: 3600 secs

Network Layer: Data Plane 4-31


DHCP: more than IP addresses
DHCP can return more than just allocated IP
address on subnet:
• address of first-hop router for client
• name and IP address of DNS sever
• network mask (indicating network versus host portion
of address)

Network Layer: Data Plane 4-32


DHCP: example
DHCP DHCP § connecting laptop needs
DHCP UDP its IP address, addr of
DHCP IP
DHCP Eth
first-hop router, addr of
Phy DNS server: use DHCP
DHCP
§ DHCP request encapsulated
in UDP, encapsulated in IP,
DHCP DHCP 168.1.1.1 encapsulated in 802.1
DHCP UDP Ethernet
DHCP IP
DHCP Eth router with DHCP
§ Ethernet frame broadcast
Phy server built into (dest: FFFFFFFFFFFF) on LAN,
router received at router running
DHCP server
§ Ethernet demuxed to IP
demuxed, UDP demuxed to
DHCP

Network Layer: Data Plane 4-33


DHCP: example
DHCP DHCP § DCP server formulates
DHCP UDP DHCP ACK containing
DHCP IP client s IP address, IP
DHCP Eth address of first-hop
Phy router for client, name &
IP address of DNS server
§ encapsulation of DHCP
DHCP DHCP server, frame forwarded
DHCP UDP to client, demuxing up to
DHCP IP DHCP at client
DHCP Eth router with DHCP
DHCP
Phy server built into § client now knows its IP
router address, name and IP
address of DSN server, IP
address of its first-hop
router

Network Layer: Data Plane 4-34


IP addresses: how to get one?
Q: how does network get subnet 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: Data Plane 4-35


Subnetting Example

5-1
Cont: Subnetting Example

Network Layer 4-2


Cont: Subnetting Example

Network Layer 4-3


Cont: Subnetting Example

Network Layer 4-4


Routing protocols
Routing protocol goal: determine “good” paths
(equivalently, routes), from sending hosts to
receiving host, through network of routers
§ path: sequence of routers packets will traverse
in going from given initial source host to given
final destination host
§ “good”: least “cost”, “fastest”, “least
congested”
§ routing: a “top-10” networking challenge!

Network Layer: Control Plane 5-5


Graph abstraction of the network
5

v 3 w
2 5
u 2 1 z
3
1 2
x 1
y
graph: G = (N,E)

N = set of routers = { u, v, w, x, y, z }

E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }

aside: graph abstraction is useful in other network contexts, e.g.,


P2P, where N is set of peers and E is set of TCP connections

Network Layer: Control Plane 5-6


Graph abstraction: costs
5
c(x,x ) = cost of link (x,x )
3 e.g., c(w,z) = 5
v w
2 5
u cost could always be 1, or
2
3
1 z inversely related to bandwidth,
1 2 or inversely related to
x 1
y
congestion

cost of path (x1, x2, x3,…, xp) = c(x1,x2) + c(x2,x3) + … + c(xp-1,xp)

key question: what is the least-cost path between u and z ?


routing algorithm: algorithm that finds that least cost path

Network Layer: Control Plane 5-7


Routing algorithm classification
Q: global or decentralized Q: static or dynamic?
information?
static:
global:
§ routes change slowly over
§ all routers have complete time
topology, link cost info
dynamic:
§ link state algorithms
§ routes change more
decentralized: quickly
§ router knows physically- • periodic update
connected neighbors, link
costs to neighbors • in response to link
cost changes
§ iterative process of
computation, exchange of
info with neighbors
§ distance vector algorithms
Network Layer: Control Plane 5-8
Distance vector algorithm
Bellman-Ford equation (dynamic programming)

let
dx(y) := cost of least-cost path from x to y
then
dx(y) = min
v
{c(x,v) + dv(y) }

cost from neighbor v to destination y


cost to neighbor v

min taken over all neighbors v of x


Network Layer: Control Plane 5-9
Bellman-Ford example
5
3
clearly, dv(z) = 5, dx(z) = 3, dw(z) = 3
v w
2 5
u 2 1 z B-F equation says:
3
1 2 du(z) = min { c(u,v) + dv(z),
x y
1 c(u,x) + dx(z),
c(u,w) + dw(z) }
= min {2 + 5,
1 + 3,
5 + 3} = 4
node achieving minimum is next
hop in shortest path, used in forwarding table

Network Layer: Control Plane 5-10


Distance vector algorithm
§ Dx(y) = estimate of least cost from x to y
• x maintains distance vector Dx = [Dx(y): y є N ]
§ node x:
• knows cost to each neighbor v: c(x,v)
• maintains its neighbors distance vectors. For
each neighbor v, x maintains
Dv = [Dv(y): y є N ]

Network Layer: Control Plane 5-11


Distance vector algorithm
key idea:
§ from time-to-time, each node sends its own
distance vector estimate to neighbors
§ when x receives new DV estimate from neighbor,
it updates its own DV using B-F equation:
Dx(y) ← minv{c(x,v) + Dv(y)} for each node y ∊ N

v under minor, natural conditions, the estimate Dx(y)


converge to the actual least cost dx(y)

Network Layer: Control Plane 5-12


Distance vector algorithm
iterative, asynchronous: each node:
each local iteration
caused by:
§ local link cost change wait for (change in local link
cost or msg from neighbor)
§ DV update message from
neighbor
distributed: recompute estimates
§ each node notifies
neighbors only when its
DV changes if DV to any dest has
• neighbors then notify their changed, notify neighbors
neighbors if necessary

Network Layer: Control Plane 5-13


Network Layer 4-14
Network Layer 4-15
Network Layer 4-16
Network Layer 4-17
4-18
Distance vector: link cost changes
link cost changes: 1
v node detects local link cost change 4
y
1
v updates routing info, recalculates x z
distance vector 50
v if DV changes, notify neighbors

good t0 : y detects link-cost change, updates its DV, informs its


news neighbors.
travels t1 : z receives update from y, updates its table, computes new
fast least cost to x , sends its neighbors its DV.

t2 : y receives z s update, updates its distance table. y s least costs


do not change, so y does not send a message to z.

* Check out the online interactive exercises for more


examples: http://gaia.cs.umass.edu/kurose_ross/interactive/ Network Layer: Control Plane 5-19
Distance vector: link cost changes
link cost changes: 60
v node detects local link cost change 4
y
1
v bad news travels slow - count to x z
infinity problem! 50
v 44 iterations before algorithm
stabilizes: see text
poisoned reverse:
v If Z routes through Y to get to X :
§ Z tells Y its (Z s) distance to X is infinite (so Y won t route
to X via Z)
v will this completely solve count to infinity problem?

Network Layer: Control Plane 5-20


Distance vector: link cost changes

Network Layer: Control Plane 5-21


Distance vector: link cost changes

Network Layer: Control Plane 5-22


Chapter 5: outline
5.1 introduction 5.5 The SDN control plane
5.2 routing protocols 5.6 ICMP: The Internet
§ link state Control Message
§ distance vector Protocol
5.3 intra-AS routing in the 5.7 Network management
Internet: OSPF and SNMP
5.4 routing among the ISPs:
BGP

Network Layer: Control Plane 5-23


A link-state routing algorithm
Dijkstra s algorithm notation:
§ net topology, link costs § c(x,y): link cost from
known to all nodes node x to y; = ∞ if not
• accomplished via link state direct neighbors
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 to
• gives forwarding table for v
that node § N': set of nodes whose
§ iterative: after k least cost path definitively
iterations, know least cost known
path to k dest. s
Network Layer: Control Plane 5-24
Dijsktra s algorithm
1 Initialization:
2 N' = {u}
3 for all nodes v
4 if v adjacent to u
5 then D(v) = c(u,v)
6 else D(v) = ∞
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: Control Plane 5-25


Dijkstra s algorithm: example
D(v) D(w) D(x) D(y) D(z)
Step N' p(v) p(w) p(x) p(y) p(z)
0 u 7,u 3,u 5,u ∞ ∞
1 uw 6,w 5,u 11,w ∞
2 uwx 6,w 11,w 14,x
3 uwxv 10,v 14,x
4 uwxvy 12,y
5 uwxvyz x
9

notes: 5
4
7
v construct shortest path tree by
8
tracing predecessor nodes
ties can exist (can be broken 3 w z
v u y
arbitrarily) 2
3
7 4
v
Network Layer: Control Plane 5-26
Shortest Path Routing
Internet Control Message Protocol (ICMP)

§ Defines a collection of error messages that are sent back


to the source host whenever a router or host is unable to
process an IP datagram successfully
• Destination host unreachable due to link /node failure
• Reassembly process failed
• TTL had reached 0 (so datagrams don't cycle forever)
• IP header checksum failed

§ ICMP-Redirect
• From router to a source host
• With a better route information
ICMP always reports error messages to the original source.

21.29
Important points about ICMP error messages:
No ICMP error message will be generated in
response to a datagram carrying an ICMP error
message.
No ICMP error message will be generated for a
fragmented datagram that is not the first fragment.
No ICMP error message will be generated for a
datagram having a multicast address.
No ICMP error message will be generated for a
datagram having a special address such as
127.0.0.0 or 0.0.0.0.

Network Layer 4-30


Figure 21.9 Error-reporting messages

Network Layer 4-31


21.16
Application Layer

A note on the use of these Powerpoint slides:


We re making these slides freely available to all (faculty, students, readers).
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.
They obviously represent a lot of work on our part. In return for use, we only
ask the following: Computer
§ 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!) Networking: A Top
§ If you post any slides on a www site, that you note that they are adapted
from (or perhaps identical to) our slides, and note our copyright of this Down Approach
material.
7th Edition, Global Edition
Thanks and enjoy! JFK/KWR Jim Kurose, Keith Ross
Pearson
All material copyright 1996-2016
April 2016
J.F Kurose and K.W. Ross, All Rights Reserved
Application Layer 2-32
What transport service does an app need?
data integrity throughput
§ some apps (e.g., file transfer, § some apps (e.g.,
web transactions) require multimedia) require
100% reliable data transfer minimum amount of
§ other apps (e.g., audio) can throughput to be
tolerate some loss effective
§ other apps ( elastic apps )
timing make use of whatever
§ some apps (e.g., Internet throughput they get
telephony, interactive security
games) require low delay § encryption, data integrity,
to be effective …

Application Layer 2-33


Transport service requirements: common apps

application data loss throughput time sensitive

file transfer no loss elastic no


e-mail no loss elastic no
Web documents no loss elastic no
real-time audio/video loss-tolerant audio: 5kbps-1Mbps yes, 100 s
video:10kbps-5Mbps msec
stored audio/video loss-tolerant same as above
interactive games loss-tolerant few kbps up yes, few secs
text messaging no loss elastic yes, 100 s
msec
yes and no

Application Layer 2-34


Internet transport protocols services
TCP service: UDP service:
§ reliable transport between § unreliable data transfer
sending and receiving between sending and
process receiving process
§ flow control: sender won t § does not provide: reliability,
overwhelm receiver flow control, congestion
§ congestion control: throttle control, timing,
sender when network throughput guarantee,
overloaded security, or connection
§ does not provide: timing, setup,
minimum throughput
guarantee, security Q: why bother? Why is
§ connection-oriented: setup there a UDP?
required between client and
server processes
Application Layer 2-35
Internet apps: application, transport protocols

application underlying
application layer protocol transport protocol

e-mail SMTP [RFC 2821] TCP


remote terminal access Telnet [RFC 854] TCP
Web HTTP [RFC 2616] TCP
file transfer FTP [RFC 959] TCP
streaming multimedia HTTP (e.g., YouTube), TCP or UDP
RTP [RFC 1889]
Internet telephony SIP, RTP, proprietary
(e.g., Skype) TCP or UDP

Application Layer 2-36


Securing TCP

TCP & UDP SSL is at app layer


§ no encryption § apps use SSL libraries, that
§ cleartext passwds sent into talk to TCP
socket traverse Internet in SSL socket API
cleartext § cleartext passwords sent
SSL into socket traverse
§ provides encrypted TCP Internet encrypted
connection § see Chapter 8
§ data integrity
§ end-point authentication

Application Layer 2-37


Chapter 2: outline
2.1 principles of network 2.5 P2P applications
applications 2.6 video streaming and
2.2 Web and HTTP content distribution
2.3 electronic mail networks
• SMTP, POP3, IMAP 2.7 socket programming
2.4 DNS with UDP and TCP

Application Layer 2-38


Web and HTTP
First, a review…
§ web page consists of objects
§ object can be HTML file, JPEG image, Java applet,
audio file,…
§ web page consists of base HTML-file which
includes several referenced objects
§ each object is addressable by a URL, e.g.,
www.someschool.edu/someDept/pic.gif

host name path name

Application Layer 2-39


HTTP overview
HTTP: hypertext
transfer protocol
HT
§ Web s application layer TP
r eq
protocol PC running HT
ues
t
Firefox browser TP
§ client/server model r es
pon
se
• client: browser that
requests, receives, s t
(using HTTP protocol) r eq
ue
server
and displays Web HT
T P
p on
s e
running
objects T P r es Apache Web
• server: Web server HT server
sends (using HTTP
protocol) objects in iPhone running
response to requests Safari browser

Application Layer 2-40


HTTP overview (continued)
uses TCP: HTTP is stateless
§ client initiates TCP § server maintains no
connection (creates socket) information about
to server, port 80 past client requests
§ server accepts TCP
connection from client aside
§ HTTP messages protocols that maintain
(application-layer protocol state are complex!
messages) exchanged § past history (state) must be
between browser (HTTP maintained
client) and Web server § if server/client crashes, their
(HTTP server) views of state may be
inconsistent, must be
§ TCP connection closed reconciled

Application Layer 2-41


Electronic mail outgoing
message queue
user mailbox
Three major components: user
agent
§ user agents
§ mail servers mail
server
user
agent
§ simple mail transfer
protocol: SMTP SMTP mail user
server agent

User Agent SMTP


§ a.k.a. mail reader SMTP user
agent
§ composing, editing, reading mail
server
mail messages user
§ e.g., Outlook, Thunderbird, agent
iPhone mail client user
agent
§ outgoing, incoming
messages stored on server
Application Layer 2-42
Electronic mail: mail servers
mail servers: user
agent
§ mailbox contains incoming
messages for user mail user
server
§ message queue of outgoing agent

(to be sent) mail messages SMTP mail user


§ SMTP protocol between server agent
mail servers to send email SMTP
messages
SMTP user
• client: sending mail mail
agent
server server
user
• server : receiving mail agent
server
user
agent

Application Layer 2-43


Electronic Mail: SMTP [RFC 2821]
§ uses TCP to reliably transfer email message from
client to server, port 25
§ direct transfer: sending server to receiving
server
§ three phases of transfer
• handshaking (greeting)
• transfer of messages
• closure
§ command/response interaction (like HTTP)
• commands: ASCII text
• response: status code and phrase
§ messages must be in 7-bit ASCI
Application Layer 2-44
Scenario: Alice sends message to Bob
1) Alice uses UA to compose 4) SMTP client sends Alice s
message to message over the TCP
bob@someschool.edu connection
2) Alice s UA sends message 5) Bob s mail server places the
to her mail server; message message in Bob s mailbox
placed in message queue 6) Bob invokes his user agent
3) client side of SMTP opens to read message
TCP connection with Bob s
mail server

1 user mail user


mail agent
agent server server
2 3 6
4
5
Alice s mail server Bob s mail server
Application Layer 2-45
Mail access protocols
user
mail access user
SMTP SMTP protocol agent
agent
(e.g., POP,
IMAP)

sender s mail receiver s mail


server server

§ SMTP: delivery/storage to receiver s server


§ mail access protocol: retrieval from server
• POP: Post Office Protocol [RFC 1939]: authorization,
download
• IMAP: Internet Mail Access Protocol [RFC 1730]: more
features, including manipulation of stored messages on
server
• HTTP: gmail, Hotmail, Yahoo! Mail, etc.

Application Layer 2-46


DNS: domain name system
people: many identifiers: Domain Name System:
• SSN, name, passport # § distributed database
Internet hosts, routers: implemented in hierarchy of
• IP address (32 bit) - many name servers
used for addressing § application-layer protocol: hosts,
datagrams name servers communicate to
• name , e.g., resolve names (address/name
www.yahoo.com - translation)
used by humans • note: core Internet function,
Q: how to map between IP implemented as application-
layer protocol
address and name, and
vice versa ? • complexity at network s
edge

Application Layer 2-47


DNS: services, structure
DNS services why not centralize DNS?
§ hostname to IP address § single point of failure
translation § traffic volume
§ host aliasing § distant centralized database
• canonical, alias names § maintenance
§ mail server aliasing
§ load distribution A: doesn‘t scale!
• replicated Web
servers: many IP
addresses correspond
to one name

Application Layer 2-48


Application Layer
2-49

DNS: a distributed, hierarchical database


Root DNS Servers

… …

com DNS servers org DNS servers edu DNS servers

pbs.org poly.edu umass.edu


yahoo.com amazon.com
DNS servers DNS serversDNS servers
DNS servers DNS servers

client wants IP for www.amazon.com; 1st approximation:


§ client queries root server to find com DNS server
§ client queries .com DNS server to get amazon.com DNS server
§ client queries amazon.com DNS server to get IP address for
www.amazon.com
DNS: root name servers
§ contacted by local name server that can not resolve name
§ root name server:
• contacts authoritative name server if name mapping not known
• gets mapping
• returns mapping to local name server

c. Cogent, Herndon, VA (5 other sites)


d. U Maryland College Park, MD k. RIPE London (17 other sites)
h. ARL Aberdeen, MD
j. Verisign, Dulles VA (69 other sites ) i. Netnod, Stockholm (37 other sites)

e. NASA Mt View, CA m. WIDE Tokyo


f. Internet Software C. (5 other sites)
Palo Alto, CA (and 48 other
sites)

a. Verisign, Los Angeles CA


13 logical root name
(5 other sites)
b. USC-ISI Marina del Rey, CA
servers worldwide
l. ICANN Los Angeles, CA •each “server” replicated
(41 other sites)
g. US DoD Columbus, many times
OH (5 other sites)

Application Layer 2-50

Potrebbero piacerti anche