Lec02 Layering
Lec02 Layering
Note: The slides are adapted from the materials from Prof. Richard Han at CU Boulder and Profs. Jennifer Rexford and Mike Freedman at Princeton University,
and the networking book (Computer Networking: A Top Down Approach) from Kurose and Ross.
Network layering at a glance
2
Why layering?
“1” or
“0” ?
Host A Host B
6
Layer 1: The Physical Layer
• Solution: Host A encodes the bit into an analog signal.
Host B decodes the analog signal into a received bit.
“1” or “0”
over wire
Host A Host B
1011000…?
Host A Host B
1011000
Host A Host B
9
Defining a Protocol
• A protocol is an agreement between two parties or
endpoints as to how information is to be transmitted
• A protocol implements this agreement via:
– A Header
– How each endpoint responds to control info in the
header (external input)
1011000
Host A Host B
10
How Physical and Data-Link Layers
Interact…
Layer 2 Layer 2
1011000 1011000
Layer 1 Layer 1
1011000
11
Layer 2: Communication Across a
Shared Link (Broadcast Network)
1011000
LAN
Host A Host B
Host C
Host C
Host A Host B
Host F
Host E
Host D
Network
Network E
D
• The Internet Protocol, or IP, is an example of a
Network Layer protocol
• IP routers at entry/exit to cloud (& possibly within
cloud) 14
Layer 4: The Transport Layer
• The Transport Layer offers end-to-end delivery of
packets across a network
Network
C
Host A Network
B
Host F
Network
Network E
D
switch
destination H n Ht M network
M application Hl H n H t M link Hn Ht M
Ht M transport physical
H n Ht M network
Hl H n H t M link router
physical
Performance
19
How do packet loss and delay occur?
packets queue in router buffers
▪packets queue, wait for turn
▪ arrival rate to link (temporarily) exceeds output link
capacity: packet loss
packet being transmitted (transmission delay)
B
packets in buffers (queueing delay)
free (available) buffers: arriving packets
dropped (loss) if no free buffers
Packet delay: four sources
transmission
A propagation
B
nodal
processing queueing
B
nodal
processing queueing
100 km 100 km
100 km 100 km
average queueing
delay
▪ R: link bandwidth (bps)
▪ L: packet length (bits)
▪ a: average packet arrival rate
traffic intensity = La/R 1
▪ La/R ~ 0: avg. queueing delay small
▪ La/R -> 1: avg. queueing delay large La/R ~ 0
B
packet arriving to
full buffer is lost
Throughput
▪ throughput: rate (bits/time unit) at which bits are being sent from
sender to receiver
• instantaneous: rate at given point in time
• average: rate over longer period of time
link
pipecapacity
that can carry linkthat
pipe capacity
can carry
Rsfluid
bits/sec
at rate Rfluid
c bits/sec
at rate
server sends bits
server, with
(fluid) (Rs bits/sec) (Rc bits/sec)
fileinto
of Fpipe
bits
to send to client
Throughput
Rs bits/sec Rc bits/sec
Rs bits/sec Rc bits/sec
bottleneck link
link on end-end path that constrains end-end throughput
Throughput: network scenario
▪ per-connection end-
Rs end throughput:
Rs Rs min(Rc,Rs,R/10)
▪ in practice: Rc or Rs is
R often bottleneck
Rc Rc
Rc
31
BDP Q/A
• What is the maximum number of packets in flight
on the link with following characteristics:
One-way propagation delay between A and B is 125ms
A
Packet size: 1024 bytes
Bandwidth: 8Mbps
32