1 1 EE 122: Midterm Review Ion Stoica TAs: Junda Liu, DK Moon, David Zats http://inst.eecs.berkeley.edu/~ee122/fa09 (Materials with thanks to Vern Paxson, Jennifer Rexford, and colleagues at UC Berkeley) 2 Announcements Midterm Information Date: 19 October 2008 Time: 4:00 PM to 5:30 PM Closed book, open 8.5” x 11” crib sheet (both sides) No Blue Books; all answers on exam sheets we hand out No calculators, PDAs, cell phones with cameras, etc. Please use PENCIL and bring ERASER Ion, one additional office hour on Monday: 1-3pm 3 Overview Layering and e2e Argument Little Theorem Packet delays IP Forwarding and Addressing Stop-and-Wait and Sliding Window Bit encoding CSMA/CD & Ethernet & Ethernet 4 Layering: The Problem Re-implement every application for every technology? No! But how does the Internet architecture avoid this? Telnet FTP NFS Packet radio Coaxial cable Fiber optic Application Transmission Media HTTP
17
Embed
EE 122: Midterm Review - University of California, Berkeleyinst.eecs.berkeley.edu/.../fa09/notes/14-MidtermReviewx4.pdf4 13 Little’s Theorem Assume a system (e.g., router, network,
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
1
EE 122: Midterm Review Ion Stoica
TAs: Junda Liu, DK Moon, David Zats
http://inst.eecs.berkeley.edu/~ee122/fa09 (Materials with thanks to Vern Paxson, Jennifer Rexford,
and colleagues at UC Berkeley) 2
Announcements
Midterm Information Date: 19 October 2008 Time: 4:00 PM to 5:30 PM Closed book, open 8.5” x 11” crib sheet (both sides) No Blue Books; all answers on exam sheets we hand
out No calculators, PDAs, cell phones with cameras, etc. Please use PENCIL and bring ERASER
Ion, one additional office hour on Monday: 1-3pm
3
Overview
Layering and e2e Argument Little Theorem Packet delays IP Forwarding and Addressing Stop-and-Wait and Sliding Window Bit encoding CSMA/CD & Ethernet & Ethernet
4
Layering: The Problem
Re-implement every application for every technology?
No! But how does the Internet architecture avoid this?
Telnet FTP NFS
Packet radio
Coaxial cable
Fiber optic
Application
Transmission Media
HTTP
2
5
Layering: Solution Introduce an intermediate layer that provides a single
abstraction for various network technologies New application just need to be written for intermediate layer New transmission media just need to provide abstraction of
intermediate layer
SMTP SSH NFS
Packet radio
Coaxial cable
Fiber optic
Application
Transmission Media
HTTP
Intermediate layer
6
Layering
Layering is a particular form of modularization
System is broken into a vertical hierarchy of logically distinct entities (layers)
Service provided by one layer is based solely on the service provided by layer below
Rigid structure: easy reuse, performance suffers
7
Layering: Internet Universal Internet layer: Internet has only IP at the Internet layer Many options for modules above IP Many options for modules below IP
Internet
Net access/ Physical
Transport
Application
IP
LAN Packet radio
TCP UDP
Telnet FTP DNS
8
Hourglass
3
9
Implications of Hourglass
Single Internet layer module: Allows networks to interoperate
Any network technology that supports IP can exchange packets
Allows applications to function on all networks Applications that can run on IP can use any network
Simultaneous developments above and below IP
10
E2E Arguments: Where to Place Functionality?
Most influential paper about placing functionality is “End-to-End Arguments in System Design” by Saltzer, Reed, and Clark
“Sacred Text” of the Internet Endless disputes about what it means Everyone cites it as supporting their position
11
E2E Arguments: Moderate Interpretation
Think twice before implementing functionality in the network
If hosts can implement functionality correctly, implement it a lower layer only as a performance enhancement
But do so only if it does not impose burden on applications that do not require that functionality
12
Overview
Layering and e2e Argument Little Theorem Packet delays IP Forwarding and Addressing Stop-and-Wait and Sliding Window Bit encoding CSMA/CD & Ethernet
4
13
Little’s Theorem Assume a system (e.g., router, network, checkout line
in a supermarket) at which packets arrive at rate a(t) Let d(i) be the delay or service time of packet i , i.e.,
time packet i spends in the system What is the average number of packets in the
system?
system a(t) – arrival rate
d(i) = delay of packet i
Intuition: Assume arrival rate is a = 1 packet per second and the delay of
each packet is s = 4 seconds What is the average number of packets in the system?
14
Example
Arrival rate = 1; delay = 4
Time = 0
15
Example
Arrival rate = 1; delay = 4
Time = 1
delay = 1
16
Example
Arrival rate = 1; delay = 4
Time = 2
delay = 1
delay = 2
5
17
Example
Arrival rate = 1; delay = 4
Time = 3
delay = 2
delay = 3
delay = 1
18
Example
Arrival rate = 1; delay = 4
Time = 4
delay = 3
delay = 4
delay = 2
delay = 1
19
Example
Arrival rate = 1; delay = 4
Time = 4
delay = 3
delay = 2
delay = 1
Q: What is the average number of packets in system?
A: number_of_packets_in_system = avg_arrival_rate x avg_delay 20
Overview
Layering and e2e Argument Little Theorem Packet Delays IP Forwarding and Addressing Stop-and-Wait and Sliding Window Bit encoding CSMA/CD & Ethernet
6
21
Definitions Link bandwidth (capacity): maximum rate (in bps) at
which the sender can send data along the link Propagation delay: time it takes the signal to travel from
source to destination Packet transmission time: time it takes the sender to
transmit all bits of the packet Queuing delay: time the packet need to wait before being
transmitted because the queue was not empty when it arrived
Processing Time: time it takes a router/switch to process the packet header, manage memory, etc
22
Sending One Packet R bits per second (bps)
T seconds
P bits
Bandwidth: R bps Propagation delay: T sec
time
Transmission time = P/R T
Propagation delay =T = Length/speed
1m/speed = 3.3 usec in free space 4 usec in copper 5 usec in fiber
23
Queueing The queue has Q bits when packet arrives packet
has to wait for the queue to drain before being transmitted
P bits
time
P/R T
Q bits
Queueing delay = Q/R
Capacity = R bps Propagation delay = T sec
24
Packet 1
Packet 1
Store & Forward
Packet 1 Queuing & processing delay of Packet 1 at Node 2
Host 1 Host 2 Node 1 Node 2
propagation delay between Host 1 and Node 1
transmission time of Packet 1 at Host 1
7
25
Store & Forward: Various Capacities Example
A packet is stored (enqueued) before being forwarded (sent)
Sender Receiver
10 Mbps 5 Mbps 100 Mbps 10 Mbps
time 26
Store & Forward: Multiple Packet Example
Sender Receiver
10 Mbps 5 Mbps 100 Mbps 10 Mbps
time
27
Overview
Layering and e2e Argument Little Theorem Packet Delays IP Forwarding and Addressing Stop-and-Wait and Sliding Window Bit encoding
28
Packet Forwarding Store a mapping between IP addresses and output
interfaces Forward an incoming packet based on its destination address
… …
3 1.2.3.6 1 1.2.3.5
1
2 1.2.3.5
1.2.3.4
1.2.3.4 2
8
29
Scalability Challenge Suppose hosts had arbitrary addresses
Then every router would need a lot of information …to know how to direct packets toward the host
host! host! host!
LAN 1!
...! host! host! host!
LAN 2!
...!
router! router! router!WAN! WAN!
1.2.3.4 5.6.7.8 2.4.6.8 1.2.3.5 5.6.7.9 2.4.6.9
1.2.3.4
1.2.3.5
forwarding table! 30
Solution: Hierarchical Addressing (IP Prefixes)
Divided into network (left) & host portions (right) 12.34.158.0/24 is a 24-bit prefix with 29 addresses
Terminology: “Slash 24”
00001100 00100010 10011110 00000101
Network (24 bits) Host (8 bits)
12 34 158 5
31
Scalability Improved Number related hosts from a common subnet
1.2.3.0/24 on the left LAN 5.6.7.0/24 on the right LAN
• 1 Gbps * 100 msec = 100 Mb = 12.5 MB • Note: large window = many packets in flight
54
Overview
Layering and e2e Argument Little Theorem Packet Delays IP Forwarding and Addressing Stop-and-Wait and Sliding Window Bit encoding CSMA/CD & Ethernet
55
Encoding
Signals propagate over physical links How do we represent the bits? Physical layer issue
Simplify some electrical engineering details Assume two discrete signals, high and low E.g., could correspond to two different voltages
Basic approach High for a 1, low for a 0 How hard can it be?
Sender & receiver agree: what’s “high”, what’s “low” And: when to read the signal
56
Non-Return to Zero (NRZ) 1 → high signal; 0 → low signal
(Actual signals are of course not so sharp) How does receiver know where one bit stops and another
begins? 0 0 1 0 1 0 1 1 0
NRZ (non-return to zero)
Clock
Receiver reads the signal on the clock’s leading edge
Sender begins to transmit signal on clock’s falling edge
15
57
Clock Coordination How do the sender and receiver agree on the running
of the clock? Problem: without explicit synchronization, receiver’s
clock can drift with respect to sender’s 0 0 1 0 1 0 1 1 0
NRZ
Clock 58
Clock Recovery
To avoid clock drift, we use the signal itself to coordinate
Whenever see a transition (0 → 1 or 1 → 0) we know that corresponds to sender clock’s trailing edge So pull our clock in phase towards it
Problem with NRZ: long strings of 0s or 1s Quite common No transitions from low-to-high, or high-to-low Clock recovery fails and receiver’s clock begins to drift
59
Non-Return to Zero Inverted (NRZI) 1 → make transition; 0 → stay at same level Fixes previous problem for long sequences of 1’s But not for 0’s
0 0 1 0 1 0 1 1 0
Clock (read on
falling edge)
NRZI (non-return to zero
inverted)
60
Manchester Encoding 1 → high-to-low transition; 0 → low-to-high
transition Addresses clock recovery problems But: physical signaling must be twice as fast
To support 2 transitions/cycle ⇒ Efficiency of 50% 0 0 1 0 1 0 1 1 0
Clock (read on each
rising edge)
Manchester
16
61
4-bit/5-bit (100Mb/s Ethernet) Goal: address inefficiency of Manchester encoding, while
avoiding long periods of no transition Solution:
Use 5 bits to encode every sequence of four bits such that No 5 bit code has more than one leading 0 or two trailing 0’s
Use NRZI to then encode the 5 bit codes Efficiency is 80%
Date: 19 October 2008 Time: 4:00 PM to 5:30 PM Closed book, open 8.5” x 11” crib sheet (both sides) No Blue Books; all answers on exam sheets we hand out No calculators, PDAs, cell phones with cameras, etc. Please use PENCIL and bring ERASER