400 likes | 520 Views
Midterm Review. 15-441: Recitation 7 By: TAs determined to make sure you ace the midterm. Outline. Networking basics Network architecture Layered model Internet design Switching, bridging, and routing. Network Basics – Extremely important.
E N D
Midterm Review 15-441: Recitation 7 By: TAs determined to make sure you ace the midterm
Outline • Networking basics • Network architecture • Layered model • Internet design • Switching, bridging, and routing
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)
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
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
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
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
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
Physical Layer • Why do we care? It affects us!
Physical Layer: Signal to Bits • Fundamentalof 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
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
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)
Multiplexing the Channel • Want to support multiple users, but the medium is shared • Time division: me, you, me, you, me, etc… • Frequency division: me(100-200Hz), you(200-300Hz) Time Frequency
Encodings • NRZ: 1->high, 0->low • Problem: long seq. • NRZI: 1->transition • Problem: long 0’s • Manchester: • 0: positive transition • 1: negative transition
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
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!
Ethernet • Goal: connect computers to form LAN • Defines PHY, data link, MAC, and addressing
The Early Days of Ethernet Multiple machines sharing non-duplex medium… … implications? Think: MAC layer
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 Latency Minimum_pkt_size = latency*bandwidth 2* 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
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)
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)
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)
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
email WWW phone... SMTP HTTP RTP... TCP UDP… IP ethernet PPP… CSMA async sonet... copper fiber radio... 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
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
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 ?
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
Internet Corporation X Network Address Translation Firewall has valid IP address W: Workstation S: Server Machine 243.4.4.4 NAT 198.2.4.5:80 10.2.2.2:1000 S W • Client 10.2.2.2 wants to connect to server 198.2.4.5:80 • OS assigns ephemeral port (1000) • Connection request intercepted byfirewall • Maps client to port of firewall (5000) • Creates NAT table entry • Relabels address and port of packets crossing the boundary
Tunneling IP1 • 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, .. IP2 Data IP1 IP2
Distance-Vector Routing Protocol z • Update(x,y,z) 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 E C d(z,y) 1 3 c(x,z) F 1 2 6 y x 1 3 D 4 d(x,y) A B
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
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 2 5 Current Path Costs 0 3 Dijkstra’s Algorithm E C 3 1 F 2 2 6 1 Source Node D 3 A 3 B Done Unseen Horizon
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 IGP AS 4 Tier 3 AS 5 Tier 2 EGP IGP Tier 2 Customer EGP EGP Provider AS 1 AS 2 IGP Tier 1 Tier 1
Transit vs Peering Transit ($$ 1/2) Transit ($$$) ISP P ISP Y Transit ($) Transit ($$$) Transit ($$$) ISP Z Peering ISP X Valley-free routing Transit ($$) Transit ($$) Transit ($$)
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
Recursive query: Server goes out and searches for more info (recursive) Only returns final answer or “not found” Iterative query: Server responds with as much as it knows (iterative) “I don’t know this name, but ask this server” Workload impact on choice? Local server typically does recursive Root/distant server does iterative local name server dns.eurecom.fr intermediate name server dns.umass.edu Domain Name System (DNS) root name server 2 iterated query 3 4 7 5 6 authoritative name server dns.cs.umass.edu 1 8 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
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