0% found this document useful (0 votes)
5 views

Lec02 Layering

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

Lec02 Layering

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

Network 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?

dealing with complex systems:


▪ explicit structure allows identification, relationship of
complex system’s pieces
• layered reference model for discussion
▪ modularization eases maintenance, updating of system
• change in layer's service implementation: transparent to rest of
system
• e.g., change in gate procedure doesn’t affect rest of system
▪ layering considered harmful?
▪ layering in other complex systems?
Example: organization of air travel

ticket (purchase) ticketing service ticket (complain)


baggage (check) baggage service baggage (claim)
gates (load) gate service gates (unload)
runway takeoff runway service runway landing
airplane routing routing routing
airplane service airplane routing

layers: each layer implements a service Q: describe in words


▪ via its own internal-layer actions the service provided
in each layer above
▪ relying on services provided by layer below
Internet protocol stack

▪ application: supporting network applications


• IMAP, SMTP, HTTP
application
▪ transport: process-process data transfer
• TCP, UDP transport
▪ network: routing of datagrams from source network
to destination
• IP, routing protocols link
▪ link: data transfer between neighboring
network elements physical
• Ethernet, 802.11 (WiFi), PPP
▪ physical: bits “on the wire”
Network Layering –
Starting from the Bottom Up
• Two hosts want to communicate with each other
• First, how do I send a “bit” from host A to host B?

“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

• How would you encode a “1” and a “0”?


- Amplitude, duration (telegraph & Morse code), tone, etc.
• Physical Layer, also called Layer 1, encodes & decodes a
digital bit from its analog form
- Modem has advanced DSP to achieve even 56 kbps
7
Layer 2: The Data Link Layer
• Next Problem: How do I send a message from
Host A to Host B?

1011000…?
Host A Host B

• Data Link Layer, also called Layer 2, ensures


that host B can decode a digital message from a
stream of bits sent by host A
8
The Data Link Layer (cont.)
• A Data Link Layer Protocol implements:
- Delimiting/framing of a message
- Fragmenting of a long message
- Retransmission of a lost message
- …

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…

1011000 Host A Host B 1011000

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

• A shared medium connects A, B, and C


- Ethernet – copper wire
- WiFi, 802.11 – wireless
• Problems to solve – collisions ! In MAC layer 12
Layer 3: The Network Layer
• The Network layer is responsible for routing a
message across an interconnected mesh of hosts

Host C
Host A Host B

Host F

Host E
Host D

• Network often represented as a “cloud”


• Routers have specialized hardware & OS’s, but
initially were just computer hosts 13
Internet: Communication Across a
Network of Networks
• The Internet is a network of heterogeneous networks
Network
C
Host A Network
B
Host F

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

• Packets may be lost due to congestion/overflow of


shared buffers, router failure, misconfigured routing,
bad link, etc. 15
Internet Transport Layers: TCP and UDP
• The Transmission Control Protocol, or TCP is a
reliable Transport Layer protocol above IP
– Reliable delivery
– In-order or stream delivery
• The User Datagram Protocol, or UDP is an
unreliable protocol above IP
– Unreliable packet delivery
– Out-of-order packet delivery
• Why would you ever want unreliable out-of-order
delivery?
– When speed is more important than 100% reliability,
e.g., real-time audio/video
16
Layer 5: The Internet Application Layer
• Given reliable in-order delivery by TCP, the Internet
application-level protocols above TCP include:
– HTTP : Hypertext Transport Protocol
– SMTP : Simple Mail Transfer Protocol
– FTP: File Transfer Protocol
– NNTP: Network News Transfer Protocol
– …

• The Open Systems Interconnection (OSI) model


expands its Application Layer into 3 sub-layers:
Application, Presentation, and Session
17
Encapsulation
source
message M application
segment Ht M transport
datagram Hn Ht M network
frame Hl Hn Ht M link
physical
link
physical

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

dnodal = dproc + dqueue + dtrans + dprop

dproc: nodal processing dqueue: queueing delay


▪ check bit errors ▪ time waiting at output link for
▪ determine output link transmission
▪ typically < msec ▪ depends on congestion level of router
Packet delay: four sources
transmission
A propagation

B
nodal
processing queueing

dnodal = dproc + dqueue + dtrans + dprop

dtrans: transmission delay: dprop: propagation delay:


▪ L: packet length (bits) ▪ d: length of physical link
▪ R: link transmission rate (bps) ▪ s: propagation speed (~2x10 8 m/sec)
▪ dtrans = L/R ▪ dprop = d/s
dtrans and dprop
very different
Caravan analogy

100 km 100 km

ten-car caravan toll booth toll booth


(aka 10-bit packet) (aka router)

▪ cars “propagate” at 100 km/hr ▪ time to “push” entire caravan


▪ toll booth takes 12 sec to service through toll booth onto
car (bit transmission time) highway = 12*10 = 120 sec
▪ car ~ bit; caravan ~ packet ▪ time for last car to propagate
from 1st to 2nd toll both:
▪ Q: How long until caravan is 100km/(100km/hr) = 1 hr
lined up before 2nd toll booth?
▪ A: 62 minutes
Caravan analogy

100 km 100 km

ten-car caravan toll booth toll booth


(aka 10-bit packet) (aka router)

▪ suppose cars now “propagate” at 1000 km/hr


▪ and suppose toll booth now takes one min to service a car
▪ Q: Will cars arrive to 2nd booth before all cars serviced at first booth?
A: Yes! after 7 min, first car arrives at second booth; three cars still at
first booth
Packet queueing delay (revisited)

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

▪ La/R > 1: more “work” arriving is


more than can be serviced - average
delay infinite!
La/R -> 1
Packet loss

▪ queue (aka buffer) preceding link in buffer has finite capacity


▪ packet arriving to full queue dropped (aka lost)
▪ lost packet may be retransmitted by previous node, by source end
system, or not at all
buffer
(waiting area) packet being transmitted
A

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 < Rc What is average end-end throughput?

Rs bits/sec Rc bits/sec

Rs > Rc What is average end-end throughput?

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

10 connections (fairly) share


backbone bottleneck link R bits/sec
Bandwidth Delay Product (BDP) of a Link

• Bandwidth*delay product indicates how many


bits (or packets) can be fit into a given link
– D: Propagation delay
– B: Bit rate or bandwidth of the link
– BDP = B * D
• Assuming a roundtrip time of 2D
– BDP = B * 2D
• Assuming only one way delay
– BDP = B * D
30
Sample Bandwidth Delay Products

Link Type Bandwidth Distance RTT Delay x BW


(Typical) (Typical)

Dial-up 56 Kbps 10 km 87 μs 5 bits

Wireless LAN 54 Mbps 50 m 33 μs 1.8 kbits

Satellite 45 Mbps 35000 km 230 ms 10 Mb

Cross-country 10 Gbps 4000 km 40 ms 400 Mb


fiber

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

(8*1024*1024*0.125)/(1024*8) = 128 pkts

32

You might also like