1 Computer Networks Lecture 24 Link Layer; Course Summary 12/05/2013.

Slides:



Advertisements
Similar presentations
Ethernet “dominant” LAN technology: cheap $20 for 100Mbs!
Advertisements

Review r Error Detection: CRC r Multiple access protocols m Slotted ALOHA m CSMA/CD r Homework 3 out r Project 3 out, link state only. Some slides are.
Lecture 15 Link Layer Protocols. Lecture 15-2 Link Layer Services r Framing and link access: encapsulate datagram into frame adding header and trailer,
Network Layer4-1 Link Layer: Introduction Some terminology: r hosts and routers are nodes (bridges and switches too) r communication channels that connect.
5-1 Link Layer: Introduction Some terminology: r hosts and routers are nodes r communication channels that connect adjacent nodes along communication path.
15 – Data link layer Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction.
5: DataLink Layer5-1 Data Link Layer r What is Data Link Layer? r Multiple access protocols r Ethernet.
11/11/ /13/2003 DLL, Error Detection, MAC, ARP November 11-13, 2003.
5: DataLink Layer5-1 Chapter 5 Link Layer and LANs Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross.
Review r Multicast Routing m Three options m source-based tree: one tree per source shortest path trees reverse path forwarding m group-shared tree: group.
1 Link Layer Message M A B Problem: Given a message M at a node A consisting of several packets, how do you send the packets to a “neighbor” node B –Neighbor:
Chapter 5 Link Layer slides are modified from J. Kurose & K. Ross CPE 400 / 600 Computer Communication Networks Lecture 20.
Review r Multicast Routing m Three options m source-based tree: one tree per source shortest path trees reverse path forwarding m group-shared tree: group.
MAC Addresses and ARP 32-bit IP address: –network-layer address –used to get datagram to destination IP subnet MAC (or LAN or physical or Ethernet) address:
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao
5-1 Data Link Layer r Today, we will study the data link layer… r This is the last layer in the network protocol stack we will study in this class…
5: DataLink Layer5-1 Link Layer – Error Detection/Correction and MAC.
5: DataLink Layer5-1 Chapter 5 Link Layer and LANs Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross.
16 – CSMA/CD - ARP Network Layer4-1. 5: DataLink Layer5-2 CSMA (Carrier Sense Multiple Access) CSMA: listen before transmit: If channel sensed idle: transmit.
5: DataLink Layer5-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction m.
IP Address 0 network host 10 network host 110 networkhost 1110 multicast address A B C D class to to
Lecture 16 Random Access protocols r A node transmits at random at full channel data rate R. r If two or more nodes “collide”, they retransmit at random.
Introduction 1 Lecture 23 Link Layer (Error Detection/Correction) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science.
5: DataLink Layer5-1 Chapter 5 Link Layer and LANs Part 1: Overview of the Data Link layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose,
Introduction1-1 Data Communications and Computer Networks Chapter 5 CS 3830 Lecture 26 Omar Meqdadi Department of Computer Science and Software Engineering.
5: DataLink Layer5-1 LAN technologies Data link layer so far: m services, error detection/correction, multiple access Next: LAN technologies m addressing.
5: DataLink Layer5-1 Chapter 5 Link Layer and LANs Part 3: MAC Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley.
Introduction1-1 Data Communications and Computer Networks Chapter 5 CS 3830 Lecture 27 Omar Meqdadi Department of Computer Science and Software Engineering.
1 Computer Communication & Networks Lecture 13 Datalink Layer: Local Area Network Waleed Ejaz
4-1 Last time □ Link layer overview ♦ Services ♦ Adapters □ Error detection and correction ♦ Parity check ♦ Internet checksum ♦ CRC □ PPP ♦ Byte stuffing.
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 Link Layer multiple.
Link Layer: MAC Ilam University Dr. Mozafar Bag-Mohammadi.
Datalink Layer 4/14/2008. Admin r Assignment 4 r MAC examples survey: m GSM/3G m Wireless m Cable Modem (DOCSIS) r Remaining class schedule 2.
Data Link Layer Moving Frames. Link Layer Protocols: ethernet, wireless, Token Ring and PPP Has node-to-node job of moving network layer.
5: DataLink Layer5-1 Chapter 5 Link Layer and LANs Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross.
5: DataLink Layer5a-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction.
4: DataLink Layer1 Multiple Access Links and Protocols Three types of “links”: r point-to-point (single wire, e.g. PPP, SLIP) r broadcast (shared wire.
Network Layer4-1 Link Layer: Introduction Some terminology: r hosts and routers are nodes (bridges and switches too) r communication channels that connect.
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 Link Layer introduction,
5: DataLink Layer5-1 Link Layer r 5.1 Introduction and services r 5.2 Error detection and correction r 5.3Multiple access protocols r 5.4 Link-Layer Addressing.
1 Week 5 Lecture 3 Data Link Layer. 2 Data Link Layer location application: supporting network applications –FTP, SMTP, STTP transport: host-host data.
11/25/20151 EEC-484 Computer Networks Lecture 12 Wenbing Zhao Cleveland State University
5: DataLink Layer5-1 The Data Link Layer Chapter 5 Kurose and Ross Today 5.1 and 5.3.
Multiple Access Links and Protocols
5: DataLink Layer5-1 Chapter 5 Link Layer and LANs Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross.
5: DataLink Layer 5a-1 Multiple Access protocol. 5: DataLink Layer 5a-2 Multiple Access Links and Protocols Three types of “links”: r point-to-point (single.
Data Link Layer. Useful References r Wireless Communications and Networks by William Stallings r Computer Networks (third edition) by Andrew Tanenbaum.
5: DataLink Layer5a-1 Chapter 5: The Data Link Layer Last time: r link layer services r error detection, correction r multiple access protocols and LANs.
Ch 5. The Link Layer and Local Area Networks Myungchul Kim
5: DataLink Layer5a-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction.
EE 122: Lecture 6 Ion Stoica September 13, 2001 (* this talk is based in part on the on-line slides of J. Kurose & K. Rose)
5: DataLink Layer5-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, error correction.
Transport Layer 3-1 Chapter 5 Link Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012  CPSC.
5: DataLink Layer5-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction m.
5: DataLink Layer5-1 Chapter 5 Link Layer and LANs Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross.
5: DataLink Layer5-1 Link Layer r 5.1 Introduction and services r 5.2 Error detection and correction r 5.3Multiple access protocols r 5.4 Link-layer Addressing.
CPSC 441: Link Layer1 Link Layer Addressing Slides originally from Carey Williamson Notes derived from “ Computer Networking: A Top Down Approach”, by.
CS 457 – Lecture 3 Link Layer Protocols Fall 2011.
Chapter 5 Link Layer and LANs
Computer Communication Networks
CS 457 – Lecture 6 Ethernet Spring 2012.
Services of DLL Framing Link access Reliable delivery
Multiple access.
Data Link Issues Relates to Lab 2.
Link Layer and LANs Its not about how hard you hit... It's about how hard you can get hit and keep moving forward 5: DataLink Layer.
Overview Jaringan Komputer (3)
Link Layer and LANs Not everyone is meant to make a difference. But for me, the choice to lead an ordinary life is no longer an option 5: DataLink Layer.
Optional Read Slides: Link Layer
Link Layer: Multiple Access
LAN Addresses and ARP IP address: drives the packet to destination network LAN (or MAC or Physical) address: drives the packet to the destination node’s.
Presentation transcript:

1 Computer Networks Lecture 24 Link Layer; Course Summary 12/05/2013

Admin r Assignment five r Exam 2 will be graded and available next Tues. r If you are considering replacement work, please stop by to talk to me r Any feedback/suggestions on the course will be appreciated. Please feel free to stop by during the reading period. 2

Summary of Network Layer r We have covered the very basics of the network layer m unicast routing and forwarding r There are multiple other topics that we did not cover m Multicast/anycast m QoS m slides will be linked on the schedule page just in case you need reading in the break 3

4 Recap: The Hourglass Architecture of the Internet IP EthernetFDDIWireless TCP UDP Telnet FTPWWW ADSL CableDOCSIS

5 Link Layer: Introduction Some terminology:  communication channels that connect adjacent nodes along a communication path are links m wired, wireless m dedicated, shared r 2-PDU is called a frame, encapsulates 3-PDU datagram “link”

6 Link layer: Context r Data-link layer has responsibility of transferring datagram from one node to another node r Datagram may be transferred by different link protocols over different links, e.g., m Ethernet on first link, m frame relay on intermediate links m on last link transportation analogy r trip from New Haven to San Francisco m taxi: home to union station m train: union station to JFK m plane: JFK to San Francisco airport m shuttle: airport to hotel

7 Link Layer Services  Framing o encapsulate datagram into frame, adding header, trailer and error detection/correction  Multiplexing/demultiplexing o frame headers to identify src, dest  Media access control  Forwarding/switching with a link-layer (Layer 2) domain  Reliable delivery between adjacent nodes o we learned how to do this already ! o seldom used on low bit error link (fiber, some twisted pair) o common for wireless links: high error rates

8 LAN/MAC/Physical Address  In most link-layer, each adapter has a unique link layer address (also called MAC address) used as address in datalink frames to identify the interface 48 bit MAC address (for most types of LANs) burned in the adapter ROM MAC address allocation administered by IEEE; manufacturer buys portion of MAC address space (to assure uniqueness)

9 Recall Earlier Routing Example Starting at A, given IP datagram addressed to E: r Net layer: look up net. address of E, find C r Link layer: sends datagram to C inside link-layer frame; the dest. address should be C’s MAC address A’s IP addr E’s IP addr IP payload datagram frame datagram source, dest address C’s MAC addr A’s MAC addr frame source, dest address A B E C Question: how to determine MAC address of C knowing C’s IP address?

10 ARP: Address Resolution Protocol r Each IP node (Host, Router) on LAN has ARP table r ARP Table: IP/MAC address mappings for some LAN nodes m TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min) yry3]$ /sbin/arp Address HWtype HWaddress Flags Mask Iface zoo-gatew.cs.yale.edu ether AA:00:04:00:20:D4 C eth0 artemis.zoo.cs.yale.edu ether 00:06:5B:3F:6E:21 C eth0 lab.zoo.cs.yale.edu ether 00:B0:D0:F3:C7:A5 C eth0

11 ARP Protocol r ARP is “plug-and-play”: m nodes create their ARP tables without intervention from net administrator r A broadcast protocol: m source broadcasts query frame, containing queried IP address all machines on LAN receive ARP query m destination D receives ARP frame, replies frame sent to A’s MAC address (unicast)

12 Comparison of IP address and MAC Address r IP address is locator m address depends on network to which an interface is attached NOT portable m introduces features (e.g., CIDR) for routing scalability r IP address needs to be globally unique (if no NAT) r MAC address is an identifier o dedicated to a device portable o flat r MAC address does not need to be globally unique, but the current assignment ensures uniqueness

Outline r Admin r Link layer overview r Media access protocols 13

14 Multiple Access Links and Protocols Two types of “links”: r point-to-point m e.g., a leased dedicated line, PPP for dial-up access r broadcast (shared wire or medium) m traditional Ethernet; Cable networks m wireless LAN; cellular networks m satellite

15 Multiple Access Protocols r Protocol that determines how nodes share channel, i.e., determines when nodes can transmit r Communication about channel sharing must use channel itself ! r Discussion: properties of an ideal multiple access protocol.

16 Ideal Mulitple Access Protocol Broadcast channel of rate R bps  Efficiency: when only one node wants to transmit, it can send at full rate R  Rate allocation:  simple fairness: when N nodes want to transmit, each can send at average rate R/N  we may need more complex rate control  Decentralized:  no special node to coordinate transmissions  no synchronization of clocks  Simple

17 MAC Protocols: a Taxonomy Goals r efficient, rate control, decentralized, simple Three broad classes: r channel partitioning m divide channel into smaller “pieces” (time slot, frequency, code) r non-partitioning m random access allow collisions m “taking-turns” a token coordinates shared access to avoid collisions

18 Outline r Admin. and recap r Link layer overview  Media access control (MAC) protocols  channel partitioning

19 Channel Partitioning: TDMA/FDMA TDMA: time division multiple access r Access to channel in "rounds" r Each station gets fixed length slot (length = pkt trans time) in each round FDMA: frequency division multiple access r Channel spectrum divided into frequency bands r Each station assigned fixed frequency band frequency bands time

MHz 124 channels (200 kHz) downlink MHz 124 channels (200 kHz) uplink frequency time GSM TDMA frame GSM time-slot (normal burst) ms µs 577 µs tailuser dataTrainingS guard space Suser datatail guard space 3 bits57 bits26 bits 57 bits1 13 GSM - TDMA/FDMA S: indicates data or control

21 Channel Partitioning: CDMA CDMA (Code Division Multiple Access) r Used mostly in wireless broadcast channels (cellular, satellite, etc) r A spread-spectrum technique History: hedy/lemarr.htm

22 CDMA: Encoding r All users share same frequency, but each user m has its own unique “chipping” sequence (i.e., code) c m to encode data, i.e., code set partitioning m e.g. c m = r Assume original data are represented by 1 and -1 r Encoded signal = (original data) modulated by (chipping sequence): if data is d, send d c m,

CDMA: Encoding 23 user data d(t) chipping sequence c(t) resulting signal X = tbtb tctc t b : bit period t c : chip period

24 CDMA: Decoding r Inner-product (summation of bit-by-bit product) of encoded signal and chipping sequence m if inner-product > 0, the data is 1; else -1

25 CDMA Encode/Decode Code of user m c m : The number of bits of each chipping sequence is M Encode Decode

26 CDMA: Deal with Multiple-User Interference r Two codes C i and C j are orthogonal, if m, where we use “.” to denote inner product, e.g. r If codes are orthogonal, multiple users can “coexist” and transmit simultaneously with minimal interference: C 1 : C 2 : C 1. C 2 = 1 +(-1) (-1) (-1)+(-1)=0 Analogy: Speak in different languages!

27 CDMA: Two-Sender Interference Code 1: Code 2:

Discussions r Advantages of channel partitioning r Problems of channel partitioning 28

29 Outline r Recap r Link layer overview r MAC protocols m Partitioning protocols m Non-partitioning MAC protocols Random access

30 Random Access Protocols r When a node has packets to send m transmit at full channel data rate R m no a priori coordination among nodes r Two or more transmitting nodes -> “collision” r Random access MAC protocol specifies: m when to access channel? m how to detect collisions? m how to recover from collisions?

31 Slotted Aloha [Norm Abramson] r Time is divided into equal size slots (= pkt trans. time) r Node with new arriving pkt: transmit at beginning of next slot r If collision: retransmit pkt in future slots with probability p, until successful. Success (S), Collision (C), Empty (E) slots

32 Slotted Aloha Efficiency Q: What is the fraction of successful slots? suppose n stations have packets to send suppose each transmits in a slot with probability p - prob. of succ. by a specific node: p (1-p) (n-1) - prob. of succ. by any one of the N nodes S(p) = n * Prob (only one transmits) = n p (1-p) (n-1)

33 Goodput vs. Offered Load S = throughput = “goodput” (success rate) G = offered load = np Slotted Aloha r when p n < 1, as p (or n) increases m probability of empty slots reduces m probability of collision is still low, thus goodput increases r when p n > 1, as p (or n) increases, m probability of empty slots does not reduce much, but m probability of collision increases, thus goodput decreases r goodput is optimal when p n = 1

34 Maximum Efficiency vs. n 1/e = 0.37 At best: channel use for useful transmissions 37% of time!

35 Pure (unslotted) Aloha r Unslotted Aloha: simpler, no clock synchronization r Whenever pkt needs transmission: m send without awaiting for the beginning of slot r Collision probability increases: m pkt sent at t 0 collide with other pkts sent in [t 0 -1, t 0 +1]

36 Goodput vs. Offered Load S = throughput = “goodput” (success rate) G = offered load = Np Pure Aloha protocol constrains effective channel throughput! Slotted Aloha

37 Dynamics of (Slotted) Aloha r In reality, the number of stations backlogged is changing m we need to study the dynamics when using a fixed transmission probability p r Assume we have a total of m stations (the machines on a LAN): m n of them are currently backlogged, each tries with a (fixed) probability p m the remaining m-n stations are not backlogged. They may start to generate packets with a probability p a, where p a is much smaller than p

38 Model n backlogged each transmits with prob. p m-n: unbacklogged each transmits with prob. p a

39 Dynamics of Aloha: Effects of Fixed Probability n: number of backlogged stations 0 m successful transmission rate at offered load np + (m-n)p a new arrival rate: (m-n) p a desirable stable point undesirable stable point Lesson: if we fix p, but n varies, we may have an undesirable stable point offered load = 1 - assume a total of m stations - p a << p - success rate is the departure rate, the rate the backlog is reducing dep. and arrival rate of backlogged stations

40 Summary of Problems of Aloha Protocols r Problems m Aloha protocols have low efficiency due to collision or empty slots when offered load is optimal (p = 1/N), the goodput is only about 37% when the offered load is not optimal, the goodput is even lower m undesirable steady state at a fixed transmission rate, when the number of backlogged stations varies r Ethernet design: address the problems: m approximate slotted Aloha without clock synchronization m reduce the penalty of collision or empty slots m infer optimal transmission rate

41 The Basic MAC Mechanisms of Ethernet get a packet from upper layer; K := 0; n := 0; // K: control wait time; n: no. of collisions repeat: wait for K * 512 bit-time; while (network busy) wait; wait for 96 bit-time after detecting no signal; transmit and detect collision; if detect collision stop and transmit a 48-bit jam signal; n ++; m:= min(n, 10), where n is the number of collisions choose K randomly from {0, 1, 2, …, 2 m -1}. if n < 16 goto repeat else give up

42 Ethernet “Dominant” LAN technology: r First widely used LAN technology r Kept up with speed race: 10 Mbps, 100 Mbps, 1 Gbps, 10 Gbps Metcalfe’s Ethernet sketch

Course Topics Summary r The Internet is a general-purpose, large-scale, distributed computer network r Major design features/principles m packet switching/statistical multiplexing m hour-glass architecture m end-to-end principle m decentralized architecture E.g., DNS, interdomain routing m resource allocation framework optimization decomposition through duality m adaptive control e.g., AIMD, sliding window self clocking, Ethernet m queueing modeling/performance analysis and design m tradeoff between theoretical impossibility and practice

Evolution r Driven by Technology, Infrastructure, Policy, Applications, and Understanding: m technology e.g., wireless/optical communication technologies and device miniaturization (sensors) m infrastructure e.g., cloud computing m applications e.g., content distribution, game, tele presence, sensing, grid computing, VoIP, m understanding e.g., resource sharing principle, routing principles, mechanism design, optimal stochastic control (randomized access) r Complexity comes from evolution. r Don’t be afraid to challenge the foundation and redesign!

Remaining Issues r How to make it faster r How to make it cheaper r How to make it more reliable/robust/secure r How to make it more flexible

Faster

The Wire: Fiber r A look at a fiber r How it works? A graded index fiber

The Wire: Fiber r Wide spectrum at low loss: ~0.3db/km (c.f. copper km without repeater r Bandwidth of a single fiber m theoretical: Tbps Study_shows_fiber_has_room_to_grow_ html r Lightweight: 33 tons of copper to transmit the same amount of information carried by ¼ pound of optical fiber

Advantages of Fibers

How to Do Switching? r Optical-Electrical-Optical r Optical switch: optical micro-electro-mechanical systems (MEMS) Optical path One optical switch

Example: MEMS Optical Switch r Using mirrors, e.g. Lambda Router

Implications  Fine-grained switching may not be feasible  What is the architecture of optical networks: packet switching, circuit switching, or others?

Fast Wireless Data Growth r AT&T m Wireless data growth 20,000% in the past 5 years Source: CISCO Visual Networking Index (VNI) Global Mobil Data Traffic Forecast 2011 to 2016 Problem: How to substantially improve wireless capacity?

Wireless Capacity r Capacity = Spectrum * SpectrumEfficiency

Idea: Multi-User Beamforming No Transmission in current n

Idea: Multi-User Beamforming –Capacity: ~min(K, M) K: # users M: # antennas

Argos Basic Idea eNodeB Cellular Core Network Inter net Multi-User Beamforming with an extreme large number of antennas to improve spectrum efficiency

Argos Implementation r Front view Antennas

Argos Implementation r Back view 1. Central Controller 2. WARP Software Radio 4. Argos Interconnect 3a. Clock Distribution 3c. Sync Distribution 3b. Ethernet Switch 3. Argos Switch

Argos Preliminary Results traditional: 9~15bps/Hz Argos: 85bps/Hz

Cheaper/More Flexible

From Traditional Networks to Software Defined Networks Traditional Distributed Networking Network Controller Network Controller Software-Defined Networking

Openflow Flow Table r An openflow switch has a simple flow table r If there is no matching rule for a packet, send to controller

SDN Potentials “…SDN will centralize and simplify control of the network, make networks programmable and more agile, and create opportunities for policy- driven supervision and more automation…” -- NetworkWorld, 2013 Commodity hardware  Lots of cheap forwarding engines  Lower cost Programmability  Customization

Current SDN Programming Systems

Policy Programming p.TcpDst= 22? dropdrop match:{TcpDst=22} action:drop send along lowest-weight path from p.EthSrc to p.EthDst send along lowest-weight path from p.EthSrc to p.EthDst S1: match:{EthSrc=p.EthSrc, EthDst=p.EthDst} action:outPort(1) yes no priority: HIGH priority: LOW tcpDst!=22 SDN Programming using Current Systems S2 S2: match:{EthSrc=p.EthSrc, EthDst=p.EthDst} action:outPort(1) S1 S3 S3: match:{EthSrc=p.EthSrc, EthDst=p.EthDst} action:outPort(1) src dst 3 1 1

Src:A Dst:D, TcpDst:8 0 Controller Switch S1 Src:A,Ds t:D, TcpDst:2 2 Low EthSrc:A, EthDst:D Port 1 if p.TcpDst=22: insert rule at S1 {prio:HIGH, match:{TcpDst=22}, action:drop } else: insert rule at S1 {prio:LOW, match:{EthSrc=…, EthDst=p.EthDst},action:outPut(1)) insert rule at S2 … insert rule at S3 … Example

OF Switches User Level Under the hood OF Controller Library Make Decisions Generate Rules Big Picture: Before Maple

Make Decisions OF Switches OF Controller Library Generate Rules User Level Under the hood Maple: Objective Using algorithmic and/or declarative policies

Maple Network Controller: Goals Easy to program, highly scalable network controllers for enterprise, data center, and carrier networks: m High-level programming languages (as opposed to “assembly language”). m Support both algorithmic and data-driven declarative policies m Automatic generation of correct, optimized rules. m Scalable and reliable controller on multicore CPUs.

Maple Programming Model (I): Algorithmic Policies

Algorithmic Programming Model r User defines a function f in a general purpose language (e.g., Java, Python, Haskell) to describe how packets should be routed on a global network view, not flow table configuration at each switch. r User is provided the abstraction that f is invoked on every packet entering the network r Function f can utilize both packet and external (e.g., network) state, and returns route (including pkt transformation, if needed)

Example Maple Policy Route f(Packet p, Env e) { if (p.tcpDstIs(22)) return nullRoute(); else { Location sloc = e.location(p.ethSrc()); Location dloc = e.location(p.ethDst()); Path path = myShortestPath(e.links(), sloc,dloc); return unicast(sloc,dloc,path); } Does not specify anything on flow tables! Specified in high-level language with a centralized view.

From a Maple Program to Switch Flow Table Rules

Maple Compiler and Runtime r Key design goals m Language independent core: to support multiple programming languages m Simple, efficient data structures to support correct, optimized rule generations

Maple Compiler and Runtime 1. Executes f on an arriving packet, observing traces of data accesses. Observing packet data accesses by asking f to access pkt using libraries Route f(Packet p, Env e) { if (p.tcpDstIs(22)) return nullRoute(); else { if (p.ethDst() == 2) return nullRoute(); Location dloc = e.location(p.ethDst()); Location sloc = e.location(p.ethSrc()); Path path = myShortestPath(e.links(), sloc,dloc); return unicast(sloc,dloc,path); }

Maple Compiler and Runtime PrioMatchAction 1tcpDst:22 ToControlle r 0ethDst:2discard 0ethDst:4, ethSrc:6port 30 PrioMatchAction 1tcpDst:22 ToControlle r 0ethDst:2discard 0ethDst:4, ethSrc:6port 30 PrioMatchAction 1tcpDst:22 ToControlle r 0ethDst:2discard 0ethDst:4, ethSrc:6port Executes f on an arriving packet, observing traces of data accesses. 2. Combine traces to form a trace tree (TT), a language-independent, partial decision tree representation of f. 3. Optimizing compiler to compile trace tree to flow tables (FTs)

Route f(Packet p, Env e) { if (p.tcpDstIs(22)) return nullRoute(); else { Location sloc = e.location(p.ethSrc()); Location dloc = e.location(p.ethDst()); Path path = myShortestPath( e.links(),sloc,dloc); return unicast(sloc,dloc,path); } EthSrc:1, EthDest:2, TcpDst:80 Assert( TcpDst,22) false Read( EthSrc) Read( EthDst) path1 1 2 Policy Trace Tree 1 2 ? truefalse Read( EthSrc) Read( EthDst) path1 Assert( TcpDs,22)

EthDst:1, TcpDst:22 null true Assert( TcpDs,22) Policy Trace Tree Route f(Packet p) { if (p.tcpDstIs(22)) return nullRoute(); else { Location sloc = location(p.ethSrc()); Location dloc = location(p.ethDst()); Path pth = myShortestPath( links(),sloc,dloc); return unicast(sloc,dloc,pth); } 1 2 ? truefalse Read( EthSrc) Read( EthDst) path1 Assert( TcpDs,22)

EthDst:1, TcpDst:22 null true Assert( TcpDs,22) Policy Trace Tree Route f(Packet p) { if (p.tcpDstIs(22)) return nullRoute(); else { Location sloc = location(p.ethSrc()); Location dloc = location(p.ethDst()); Path pth = myShortestPath( links(),sloc,dloc); return unicast(sloc,dloc,pth); } 1 2 null truefalse Read( EthSrc) Read( EthDst) path1 Assert( TcpDs,22)

Trace Tree as an Elegant Data Structure: TT => Flow Table tcpDst ==22 False ethDst 2 drop 4 port 30 ethSrc 6 drop True match:{tcpDst!=22, ethDst:4,ethSrc:6}

Trace Tree as an Elegant Data Structure: TT => Flow Table tcpDst ==22 False ethDst 2 drop 4 port 30 ethSrc 6 drop True match:{tcpDst!=22, ethDst:4,ethSrc:6} match:{tcpDst!=22, ethDst:2} match:{tcpDst==22}

tcpDst ==22 False ethDst 2 drop 4 port 30 ethSrc 6 drop True match:{tcpDst!=22, ethDst:4,ethSrc:6} Priority match:{tcpDst==22} action:ToController barrier rule: match:{tcpDst!=22, ethDst:2} Trace Tree as an Elegant Data Structure: TT => Flow Table match:{tcpDst==22}

tcpDst ==22 False ethDst 2 drop 4 port 30 ethSrc 6 drop True match:{tcpDst!=22, ethDst:4,ethSrc:6} Priority match:{tcpDst==22} action:ToController barrier rule: match:{tcpDst!=22, ethDst:2} Trace Tree as an Elegant Data Structure: TT => Flow Table match:{tcpDst==22} Simply, classical in-order tree traversal of TT generates correct flow table rules!

Maple Scalability Currently world’s most scalable network controller 85

More Reliable

Is the Internet Reliable? r A key design objective of the “Internet” (i.e., packet-switched networks) is robustness r Does the Internet infrastructure achieve the target reliability objective of a highly reliable system (99.999%)?

Perspective r 911 Phone service (1993 NRIC report +) m 29 minutes per year per line m % availability r Std. Phone service (various sources) m 53+ minutes per line per year m % availability r …what about the Internet? m Various studies: about 99.5% m Need to reduce down time by 500 times to achieve five nines; 50 times to match phone service

Unreachable Networks: 10 days

Internet Disaster Recovery Response r Why slow response? m the cable repairing is slow: not until 21 days after quake m BGP is not designed to create business relationship r One approach m a meta-BGP to facilitate discovery and creation of BGP business relationship

Backup Slides 94

95 Ethernet’s Exponential Backoff: Goal: adapt retransmission attempts to estimated current load m compared with CSMA, 1/2 m can be considered as p m not a static p---adjusted using exponential backoff first collision: choose K from {0,1}; delay is K x 512 bit transmission times after second collision: choose K from {0,1,2,3}… after ten or more collisions, choose K from {0,1,2,3,4,…,1023}

Many Issues r How to make it faster r How to make it more efficient r How to make it more reliable/robust/secure 96

97 CSMA: Carrier Sense Multiple Access CSMA: listen before transmit Objective: approximate slotted Aloha (compared with pure Aloha) r If backlogged, wait until channel sensed idle, then transmit pkt with prob. p r human analogy: don’t interrupt others !

98 CSMA Collisions collisions can still occur: propagation delay means two nodes may not hear each other’s transmission Collision: entire packet transmission time wasted; still not very efficient! spatial layout of nodes along Ethernet A BC D time t0t0

99 CSMA/CD (Collision Detection) r Human analogy: the polite conversationalist CSMA/CD: m observations: collisions can be detected within short time if colliding transmissions are aborted, we can reduce channel wastage m carrier sensing, deferral as in CSMA m collision detection: easy in wired LANs: measure signal strengths, compare transmitted, received signals difficult in wireless LANs: receiver shuts off while transmitting

100 spatial layout of nodes along Ethernet A BC D time t0t0 spatial layout of nodes along Ethernet A BC D time t0t0 B detects collision, aborts D detects collision, aborts CSMA/CD: Collision Detection instead of wasting the whole packet transmission time, abort after detection.

101 Efficiency of CSMA/CD r Given collision detection, instead of wasting the whole packet transmission time (a slot), we waste only the time needed to detect collision. r Use a contention slot of 2 T, where T is one-way propagation delay (why 2 T ?) r When the transmission probability p is approximately optimal (p = 1/N), we try approximately e times before each successful transmission P/C P: packet size, e.g bits C: link capacity, e.g. 10Mbps

102 Efficiency of CSMA/CD r The efficiency (the percentage of useful time) is approximately r The value of a plays a fundamental role in the efficiency of CSMA/CD protocols. r Question: you want to increase the capacity of a link layer technology (e.g.,, 10 Mbps Ethernet to 100 Mbps), but still want to maintain the same efficiency, what can you do?

103 Summary of Problems to be Addressed  Approximate slotted Aloha  Reduce the penalty of collision or empty slots  Infer optimal transmission rate

Physical Layer 104

Internet Bandwidth Growth Source: TeleGeograph Research

What Determines Transmission Rate? r Service: transmit a bit stream from a sender to a receiver Encoding channel Decoding output bit stream input bit stream sender receiver Question to be addressed: how much can we send through the channel ?

Basic Theory: Channel Capacity r The maximum number of bits that can be transmitted per second (bps) by a physical media is: where W is the frequency range, S/N is the signal noise ratio. We assume Gaussian noise.

Fourier Transform r Suppose the period of a data unit is f (=1/T), then the data unit can be represented as the sum of many harmonics (sin(), cos()) with frequencies f, 2f, 3f, 4f, … r A reasonably behaved periodic function g(t), with minimal period T, can be constructed as the sum of a series of sines and cosines:

char “b”

Signal Attenuation r The quality of signal will degrade when it travels m loss, frequency passing

Frequency Dependent Attenuation r The received signal will be distorted even when there is no interference and the transmitted signal is “perfect” square waveform Example: Voltage- attenuation magnitude ratios of Category 5 cable. For example, 500 feet of cable attenuates a 10-MHz, 1-V signal to 0.32 V, which corresponds to about –9.90 dB (= 20 log 1/0.32)

Example Example: W=3000Hz, S/N  4000 telephone network sender modem Modem Modulation (digit->analog) 3Khz bandwidth (add white noise) ISP demodulation output bit stream input bit stream Analog to Digital quantization for transmitting through the digital telephone backbone ISP modem V.34 (33.6kbps Dialup Modem) channel

Example: ADSL r Spectrum allocation: divided into a total of 256 downstream and 32 upstream tones, where each tone is a standard 4kHz voice channel r During initial negotiation, a tone is used only if the S/N is above 6 db (  4)

More Efficient 114

r Large deployment of highly adaptive, multipoint applications r An iterative process between two sets of adaptation: m ISP: traffic engineering to change routing to shift traffic away from higher utilized links current traffic pattern  new routing matrix m App: direct traffic to better performing end points current routing matrix  new traffic pattern Problem: Inefficient Interactions

ISP optimizer interacts poorly with App. ISP Traffic Engineering+ App Latency Optimizer -red: App adjust alone; fixed ISP routing -blue: ISP traffic engineering adapt alone; fixed App communications

The Fundamental Problem r Traditional Internet architectural feedback to application efficiency is limited: m routing (hidden) m rate control through coarse-grained TCP congestion feedback r To achieve better efficiency, needs explicit communications between network resource providers and applications

P4P Framework – Design Goals r Performance improvement r Scalability and extensibility: support diverse ISP objectives and applications scenarios in large networks r Privacy preservation r Ease of implementation r Open standard: any ISP, provider, applications can easily implement it

119 Error Detection D = Data protected by error checking, may include header fields ED = Error Detection bits (redundancy) Error detection not 100% reliable! a good error detector may miss some errors, but rarely larger ED field generally yields better detection Error detection design considers computation primitives.

120 Cyclic Redundancy Check: Background r Widely used in practice, e.g., m Ethernet, DOCSIS (Cable Modem), FDDI, PKZIP, WinZip, PNG r For a given data D, consider it as a polynomial D(x) m consider the string of 0 and 1 as the coefficients of a polynomial e.g. consider string as x 4 +x+1 m addition and subtraction are modular 2, thus the same as xor r Choose generator polynomial G(x) with r+1 bits, where r is called the degree of G(x)

121 Cyclic Redundancy Check: Encode r Given data G(x) and D(x), choose R(x) with r bits, such that m D(x)x r +R(x) is exactly divisible by G(x) r The bits correspond to D(x)x r +R(x) are sent to the receiver + x

122 Ethernet Frame Structure Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame r Preamble: 8 bytes m 7 bytes with pattern followed by one byte with pattern (why the preamble?) r Source and dest. addresses: 6 bytes r Type: indicates the higher layer protocol, mostly IP but others may be supported such as Novell IPX and AppleTalk r CRC: CRC-32 checked at receiver, if error is detected, the frame is simply dropped (including padding) 4

123 Cyclic Redundancy Check: Decode r Since G(x) is global, when the receiver receives the transmission T’(x), it divides T’(x) by G(x) m if non-zero remainder: error detected! m if zero remainder, assumes no error Encode: CRC(G) D T = D(x)x r +R(x) T’T’ check

124 CRC: Steps and an Example Suppose the degree of G(x) is r Append r zero to D(x), i.e. consider D(x)x r Divide D(x)x r by G(x). Let R(x) denote the reminder Send to the receiver

125 The Power of CRC r Let T(x) denote D(x)x r +R(x), and E(x) the polynomial of the error bits m the received signal is T’(x) = T(x)+E(x) r Since T(x) is divisible by G(x), we only need to consider if E(x) is divisible by G(x) Encode: CRC(G) D T = D(x)x r +R(x) T’T’ check

126 Designing CRC r Detect a single-bit error: E(x) = x i m if G(x) contains two or more terms, E(x) is not divisible by G(x) r Detect an odd number of errors: E(x) has an odd number of terms: m lemma: if E(x) has an odd number of terms, E(x) cannot be divisible by (x+1) suppose E(x) = (x+1)F(x), let x=1, the left hand will be 1, while the right hand will be 0 m thus if G(x) contains x+1 as a factor, E(x) will not be divided by G(x) r Many more errors can be detected by designing the right G(x)

127 Example G(x) r 32 bits CRC: m CRC32: x 32 + x 26 + x 23 + x 22 + x 16 + x 12 + x 11 + x 10 + x 8 + x 7 + x 5 + x 4 + x 2 + x + 1 m used by Ethernet, FDDI, PKZIP, WinZip, and PNG r GSM phones r For more details see the link below and further links it contains: m

128 Adaptors Communicating r link layer typically implemented in “adaptor” (aka NIC) m Ethernet card, modem, card r adapter is semi- autonomous, implementing link & physical layers r sending side: m encapsulates datagram in a frame m adds error checking bits, rdt, flow control, etc. r receiving side m looks for errors, rdt, flow control, etc m extracts datagram, passes to receiving node sending node frame receiving node datagram frame adapter link layer protocol