Midterm Review 15-441: Recitation 7 By: TAs determined to make sure you ace the midterm.
Download ReportTranscript Midterm Review 15-441: Recitation 7 By: TAs determined to make sure you ace the midterm.
Midterm Review
15-441: Recitation 7 By: TAs determined to make sure you ace the midterm 1
Outline
• Networking basics • Network architecture ▫ Layered model ▫ Internet design • Switching, bridging, and routing 2
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)
3
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 = T handshake + T propagation + T transmission 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
4
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 5
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 BITS Framing BITS 6
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 7
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 8
Physical Layer
• Why do we care? It affects us!
9
Physical Layer: Signal to Bits
• Fundamental of communications: sine wave ▫ S(t) = A * sin(2π f t + Θ) 10 • 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
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 11
Capacity of a Noisy Channel
• Shannon’s Theorem: C = B * log 2 (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 * log 2 (1+500/10) ▫ C = 5672bps (NOT Hz) 12
Multiplexing the Channel
• Want to support multiple users, but the medium is shared ▫ Time division: me, you, me, you, me, etc… 13 Time ▫ Frequency division: me(100-200Hz), you(200-300Hz) Frequency
Encodings
• NRZ: 1->high, 0->low ▫ Problem: long seq.
• NRZI: 1->transition ▫ Problem: long 0’s • Manchester: ▫ 0: positive transition ▫ 1: negative transition 14
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 15
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!
16
Ethernet
• Goal: connect computers to form LAN ▫ Defines PHY, data link, MAC, and addressing 17
The Early Days of Ethernet
18
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?
Ethernet: Collision Detection
Bandwidth
20
Propagation delay * wire length
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 21
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) 22
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) 23
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) 24
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
25
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...
26
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 27
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 ?
28
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: 2 32-20 = 4,094
/27
29
Network Address Translation
W: Workstation S: Server Machine W Firewall has valid IP address Corporation X 10.2.2.2:1000 NAT 243.4.4.4
Internet 198.2.4.5:80 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 ▫ Maps client to port of firewall (5000) ▫ Creates NAT table entry Int Addr 10.2.2.2
Int Port 1000 ▫ Relabels address and port of packets crossing the boundary NAT Port 5000 30
Tunneling
• • • Force a packet to go to a specific point in the network.
▫ Path taken is different from the regular routing Achieved by adding an extra IP header to the packet with a new destination address.
▫ 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 IP1 IP2
31
32
Distance-Vector Routing Protocol
c(x,z)
•
x z d(z,y) d(x,y) y 2 A E 6 3 4 F 1 B 1 C 3 1 D
Initial Table for A Dest Cost Next Hop A B C D 0 4 2 6 A B – – E F E Update(x,y,z) d c(x,z) + d(z,y) if d < d(x,y) F # Cost of path from x to y with first hop z # Found better path else return d,z # Updated cost / next hop return d(x,y), nexthop(x,y) # Existing cost / next hop
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 33
Dijkstra’s Algorithm
2 E 3 1 C 5 Current Path Costs 2 F 2 6 Source Node 0 1 3
3 3 D A Done 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
B Unseen
• • Label ▫ d(v) = path cost from s to v Path ▫ Keep track of last link in path 34
A Logical View of the Internet
• • • Tier 1 ISP • “Default-free” with global reachability info Tier 2 ISP • Regional or country-wide Tier 3 ISP • Local
AS 4
IGP Tier 3 EGP IGP Tier 2 EGP
AS 1
IGP Tier 1 Customer Provider Tier 2 EGP Tier 1
AS 5 AS 2
35
Transit vs Peering
Transit ($$$) ISP Z Transit ($$) Transit ($$ 1/2) Peering Transit ($$) ISP P Transit ($$$) ISP Y Transit ($) Transit ($$$) ISP X
Valley-free routing
Transit ($$) 36
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 37
38
Domain Name System (DNS)
• • Recursive query: Server goes out and searches for more info (recursive) Only returns final answer or “not found” 3 root name server 2 iterated query • • Iterative query: Server responds with as much as it knows (iterative) “I don’t know this name, but ask this server” local name server
dns.eurecom.fr
4 7 intermediate name server
dns.umass.edu
5 Workload impact on choice?
• Local server typically does recursive • Root/distant server does iterative 1 8 6 authoritative name server
dns.cs.umass.edu
requesting host
surf.eurecom.fr
gaia.cs.umass.edu
The Good / Bad News
• Midterm is next Thursday! (good news!) • Checkpoint 1 due Monday! (bad news) • What’s left ▫ Router Design 39
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 40