Midterm Review 15-441: Recitation 7 By: TAs determined to make sure

advertisement
1
Midterm Review
15-441: Recitation 7
By: TAs determined to make sure
you ace the midterm
2
Outline
• Networking basics
• Network architecture
▫ Layered model
▫ Internet design
• Switching, bridging, and routing
3
Network Basics – Extremely important
• Bandwidth: link transmission rate (bits/s)
▫ increase/decrease in delay  no affect
• Throughput: successful information xferred
over time (bits/s)
▫ affected by latency and loss rate
▫ 1MB transferred in 200ms?
▫ 1MB/(200ms/1s) = 1MB/.2s = 5MB/s
• Round Trip Time (RTT)
4
Networking Basics – Example
• Calculate throughput on 1.5Mbps link:
▫
▫
▫
▫
Transfer of 1000KB file
RTT of 100ms
a packet size of 1KByte
initial 2RTT of handshaking
• Fix units first!
▫ RTT=0.1s, FILE = 1000*1024*8 = 8192000 bits
•
•
•
•
T = Thandshake + Tpropagation + Ttransmission
T = (2*RTT) + (0.5*RTT) + (data/bandwidth)
T = (2*0.1s) + (0.5*0.1s) + (8192000/(1.5*10^6/s))
T = 5.711s
5
Networking and Protocols
• What is a protocol? (think IRC!)
▫ A convention consisting of a set of rules and
syntax for synchronization of communication
▫ e.g., client: NICK+USER, server: MOTD
• Why we need protocols: heterogeniety
▫ Many applications and implementations
▫ OS: Linux, Windows, MacOS
▫ Applications: IE, Firefox, Opera, Safari
6
Layered Architecture in Networking
• Why do we have a layered architecture?
▫ break down complexity of the system
▫ allows development at each layer without knowing
details of the next
Web, E-Mail, IRC, Telnet
Data transformations
Managing logical connections
End-to-end Reliability
Switching
Routing
Flow
Framing
BITS
BITS
7
Philosophy of the Internet
• “End-to-end argument”: greatest impact on
the design of the Internet
• Fundamental goal: effective interconnection
• Functionality: does everyone need it? E2EA:
▫ Everyone needs it: put it in the core
▫ Optional functionality: implement at the hosts
• What would E2EA say about:
▫ packet forwarding, security, reliability
8
Internet Design: Today
• Reliability: end to end (e.g., TCP)
• Management: completely decentralized
• Cost: inexpensive… Internet infrastructure cost less
than typical enterprise networks
• Attachment: host connection automatic
• Accountability: what accountability? ;)
▫ Leads to major security issues
▫ More of a push towards security in core
9
Physical Layer
• Why do we care? It affects us!
10
Physical Layer: Signal to Bits
• Fundamental of communications: sine wave
▫ S(t) = A * sin(2π f t + Θ)
• Modulation: varying a periodic waveform (e.g.,
sine wave) in order to convey a message (e.g., bit)
▫ Amplitude, frequency, and phase
MODEM: modulator + demodulator
11
The Nyquist Limit
• First, bandwidth: width of a frequency range
▫ e.g.,: 300MHz to 400MHz = 100MHz bandwidth
• A noiseless channel of width H can at most
transmit a binary signal at 2H
▫ e.g., 3000Hz channel, at most 6000bps
▫ Assumes binary amplitude encoding
12
Capacity of a Noisy Channel
• Shannon’s Theorem: C = B * log2(1+S/N)
▫ C = maximum channel capacity(bps)
▫ B = channel bandwidth (Hz)
▫ S/N = signal-to-noise ratio: 10*log(S/N)
• For example, homework 1:
▫ B = 1000Hz, S = 500, N = 10
▫ C = 1000Hz * log2(1+500/10)
▫ C = 5672bps (NOT Hz)
13
Multiplexing the Channel
• Want to support multiple users, but the medium is
shared
▫ Time division: me, you, me, you, me, etc…
Time
▫ Frequency division: me(100-200Hz), you(200-300Hz)
Frequency
14
Encodings
• NRZ: 1->high, 0->low
▫ Problem: long seq.
• NRZI: 1->transition
▫ Problem: long 0’s
• Manchester:
▫ 0: positive transition
▫ 1: negative transition
15
4B/5B Encoding
• Data coded as symbols, 4 bits uses 5 bits
▫ uses NRI to encode 5 bits
▫ pre-determined in dictionary
• Key properties:
▫ each valid symbol: at least two 1s
▫ dense transitions
 better for clock synchronization
▫ downside: requires overhead
▫ 100Mbps requires ___MHz
16
Datalink Layer
• Datalink layer responsibilities:
▫
▫
▫
▫
framing (e.g., bits into a datagram)
media access (e.g., who transmits when)
error control (detection and correction)
flow control (e.g., sender doesn’t overflow receiver)
• Framing: where are the useful bits?
▫ detect using special bit sequences (preamble)
▫ E.g., 101110110111010…  here comes a packet!
17
Ethernet
• Goal: connect computers to form LAN
▫ Defines PHY, data link, MAC, and addressing
18
The Early Days of Ethernet
Multiple machines sharing non-duplex medium…
… implications? Think: MAC layer
19
Ethernet: early MAC layer
• Key Fact: only 1 node can transmit at a time
▫ otherwise: collision, both packets lost
Random…
… why?
20
Ethernet: Collision Detection
Bandwidth
Minimum_pkt_size = 2*latency*bandwidth
Propagation delay * wire length
21
Building Larger LANs: Bridging
• Extend reach of single shared medium
▫ Copy data frames between the segments
▫ Reduced collision domain
• Problem of loops
▫ Solution: spanning tree
22
Spanning Tree Algorithm
• What port to forward?
▫ Select lowest ID: root
▫ (ID, ROOT, ROOT-HOPS)
• First round:
▫
▫
▫
▫
B5: (B5, B5, 0)
B7: (B7, B7, 0)
B3: (B3, B3, 0)
B2: (B2, B2, 0)
23
Spanning Tree Algorithm
• What port to forward?
▫ Select lowest ID: root
▫ (ID, ROOT, ROOT-HOPS)
• Second round:
▫
▫
▫
▫
B5: (B5, B1, 1)
B7: (B7, B1, 1)
B3: (B3, B2, 1)
B2: (B2, B1, 1)
24
Spanning Tree Algorithm
• What port to forward?
▫ Select lowest ID: root
▫ (ID, ROOT, ROOT-HOPS)
• Third round:
▫
▫
▫
▫
B5: (B5, B1, 1)
B7: (B7, B1, 1)
B3: (B3, B1, 2)
B2: (B2, B1, 1)
25
Spanning Tree Algorithm
Disabled since through
B5 is shorter to B1
Disabled since through
through B2 is shorter than
through B3
Although same hop count
through B5 and B7, B5
has lower number
26
Internet Protocol (IP)
• Hour Glass Model
• Create abstraction layer that
hides underlying technology
from network application
software
• Make as minimal as possible
• Allows range of current & future
technologies
• Can support many different types
of applications
email WWW phone...
SMTP HTTP RTP...
TCP UDP…
IP
ethernet PPP…
CSMA async sonet...
copper fiber radio...
27
IP Addressing
• 1974: “identifier field permits up to 65536
distinct [hosts] … this size seems sufficient
for the foreseeable future”
• 2009: AMD estimated 1.5 billion.
▫ aka: 65536 vs 1500000000
• Final decision: 32-bit address (~4.2 billion)
▫ the end is near 
▫ although 1.5 billion active: many addresses unused
28
Classful-Internet Architecture
• IP addresses: A.B.C.D (e.g., 14.2.10.32)
▫ Class A: 14.X.X.X
▫ Class B: 14.2.X.X
▫ Class C: 14.2.10.X
• How many addresses in Class A?
▫ 24 dynamic bits: 2^24 addresses
▫ addresses != hosts supported
▫ 2 unusable addresses:
 one unreachable -> 14.0.0.0
 one ______  14.255.255.255 ?
29
Classless-Internet Architecture
• Classful: helped with shortage of addresses
▫ Why?
• CIDR: fine-grained address blocks
▫ Class C too small: 254
▫ Class B too big: 65,534
▫ Assign /20: 232-20 = 4,094
/27
30
Network Address Translation
W: Workstation
S: Server Machine
Firewall has valid IP address
243.4.4.4
Corporation X
W
NAT
Internet 198.2.4.5:80
10.2.2.2:1000
S
• Client 10.2.2.2 wants to connect to server 198.2.4.5:80
▫ OS assigns ephemeral port (1000)
• Connection request intercepted by
firewall
Int Addr
Int Port
NAT Port
10.2.2.2
1000
5000
▫ Maps client to port of firewall (5000)
▫ Creates NAT table entry
▫ Relabels address and port of packets crossing the boundary
31
Tunneling
• Force a packet to go to a specific point
in the network.
IP1
▫ Path taken is different from the
regular routing
• Achieved by adding an extra IP header
to the packet with a new destination
address.
IP2
▫ Similar to putting a letter in another
envelope
▫ preferable to using IP source routing
option
• Used increasingly to deal with special
routing requirements or new features.
▫ Mobile IP,..
▫ Multicast, IPv6, research, ..
Data
IP1
IP2
32
Distance-Vector Routing Protocol
Initial Table for A
z
d(z,y)
E
c(x,z)
y
x
d(x,y)
2
A
1
3
1
6
1
Cost
Next
Hop
A
0
A
B
4
B
C

–
D

–
E
2
E
F
6
F
C
F
4
Dest
3
B
• Update(x,y,z)
D
d  c(x,z) + d(z,y)
# Cost of path from x to y with first hop z
if d < d(x,y)
# Found better path
return d,z
# Updated cost / next hop
else
return d(x,y), nexthop(x,y) # Existing cost / next hop
33
Link State Protocol Concept
• Every node gets complete copy of graph
▫ Every node “floods” network with data about its
outgoing links
• Every node computes routes to every other node
▫ Using single-source, shortest-path algorithm
• Process performed whenever needed
▫ When connections die / reappear
34
Dijkstra’s Algorithm
E
2
3
C
1
5
Current Path Costs
2
F
2

6
Source
Node
1
0
A
3
3
3
D

B
Done
Unseen
Horizon
• Node Sets
▫ Done
 Already have least cost path to it
▫ Horizon:
 Reachable in 1 hop from node in
Done
▫ Unseen:
 Cannot reach directly from node in
Done
• Label
▫ d(v) = path cost from s to v
• Path
▫ Keep track of last link in path
35
A Logical View of the Internet
•
Tier 1 ISP
• “Default-free” with global
reachability info
•
IGP
AS 4
Tier 3
Tier 2 ISP
IGP
Tier 2
Tier 3 ISP
• Local
Tier 2
EGP
• Regional or country-wide
•
AS 5
Customer
EGP
EGP
AS 1
IGP
Tier 1
Provider
AS 2
Tier 1
36
Transit vs Peering
Transit ($$ 1/2)
Transit ($$$)
ISP P
ISP Y
Transit ($)
Transit ($$$)
ISP Z
Transit ($$)
Transit ($$$)
Peering
Transit ($$)
ISP X
Valley-free
routing
Transit ($$)
37
BGP: Path Vector Protocol
• Each routing update carries the entire path
• Loops are detected as follows:
▫ When AS gets route, check if AS already in path
 If yes, reject route
 If no, add self and (possibly) advertise route further
• Advantage:
▫ Metrics are local - AS chooses path, protocol ensures
no loops
• BGP advertises to neighbors only those routes that it
uses
• BGP enforces policies by choosing paths from multiple
alternatives and controlling advertisement to other AS’s
38
Domain Name System (DNS)
Recursive query:
root name server
• Server goes out and
searches for more info
(recursive)
• Only returns final answer
or “not found”
2
iterated query
3
Iterative query:
• Server responds with as
much as it knows
(iterative)
• “I don’t know this name,
but ask this server”
4
7
local name server
dns.eurecom.fr
1
8
Workload impact on choice?
• Local server typically does
recursive
• Root/distant server does
iterative
requesting host
surf.eurecom.fr
intermediate name server
dns.umass.edu
5
6 authoritative name
server
dns.cs.umass.edu
gaia.cs.umass.edu
39
The Good / Bad News
• Midterm is next Thursday! (good news!)
• Checkpoint 1 due Monday! (bad news)
• What’s left
▫ Router Design
40
Suggestions
• Finish Checkpoint 1 ASAP and put it aside
• Come to us with questions, post to bboard
• We will post a sample midterm – go through it
Download