Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "1 Computer Networks Lecture 24 Link Layer; Course Summary 12/05/2013."— Presentation transcript:

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

2 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

3 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 4 Recap: The Hourglass Architecture of the Internet IP EthernetFDDIWireless TCP UDP TelnetEmailFTPWWW ADSL CableDOCSIS

5 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 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 802.11 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 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 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 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 223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27 A B E C Question: how to determine MAC address of C knowing C’s IP address?

10 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@cicada 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 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 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

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

14 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 802.11 wireless LAN; cellular networks m satellite

15 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 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 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 18 Outline r Admin. and recap r Link layer overview  Media access control (MAC) protocols  channel partitioning

19 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 5 1 4 3 2 6

20 20 12 3 4 5 6 78 935-960 MHz 124 channels (200 kHz) downlink 890-915 MHz 124 channels (200 kHz) uplink frequency time GSM TDMA frame GSM time-slot (normal burst) 4.615 ms 546.5 µ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 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: http://people.seas.harvard.edu/~jones/cscie129/nu_lectures/lecture7/ hedy/lemarr.htm

22 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 = 1 1 1 -1 1 -1 -1 -1 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,

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

24 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 25 CDMA Encode/Decode Code of user m c m : 1 1 1 -1 1 -1 -1 -1 - The number of bits of each chipping sequence is M Encode Decode

26 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 : 1 1 1 -1 1 -1 -1 -1 C 2 : 1 -1 1 1 1 -1 1 1 ----------------------------------------- C 1. C 2 = 1 +(-1) + 1 + (-1) +1 + 1+ (-1)+(-1)=0 Analogy: Speak in different languages!

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

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

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

30 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 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 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 33 Goodput vs. Offered Load S = throughput = “goodput” (success rate) G = offered load = np 0.51.0 1.5 2.0 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 34 Maximum Efficiency vs. n 1/e = 0.37 At best: channel use for useful transmissions 37% of time!

35 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 36 Goodput vs. Offered Load S = throughput = “goodput” (success rate) G = offered load = Np 0.51.0 1.5 2.0 0.1 0.2 0.3 0.4 Pure Aloha protocol constrains effective channel throughput! Slotted Aloha

37 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 38 Model n backlogged each transmits with prob. p m-n: unbacklogged each transmits with prob. p a

39 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 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 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 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

43 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

44 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!

45 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

46 Faster

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

48 The Wire: Fiber r Wide spectrum at low loss: ~0.3db/km (c.f. copper ~190db/km @100Mhz), 30-100km without repeater r Bandwidth of a single fiber m theoretical: 100-200Tbps http://www.trnmag.com/Stories/080101/ Study_shows_fiber_has_room_to_grow_ 080101.html r Lightweight: 33 tons of copper to transmit the same amount of information carried by ¼ pound of optical fiber

49 Advantages of Fibers

50 How to Do Switching? r Optical-Electrical-Optical r Optical switch: optical micro-electro-mechanical systems (MEMS) Optical path One optical switch http://www.qwest.com/largebusiness/enterprisesolutions/networkMaps/preloader.swf

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

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

53 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?

54 Wireless Capacity r Capacity = Spectrum * SpectrumEfficiency

55 Idea: Multi-User Beamforming No Transmission in current 802.11n

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

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

58 Argos Implementation r Front view Antennas

59 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

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

61 Cheaper/More Flexible

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

63 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

64 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

65 Current SDN Programming Systems

66 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

67 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

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

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

70 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.

71 Maple Programming Model (I): Algorithmic Policies

72 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)

73 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.

74 From a Maple Program to Switch Flow Table Rules

75 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

76 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); }

77 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 30 1. 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)

78 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)

79 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)

80 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)

81 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}

82 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}

83 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}

84 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} 1 2 3 Simply, classical in-order tree traversal of TT generates correct flow table rules!

85 Maple Scalability Currently world’s most scalable network controller 85

86 More Reliable

87 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%)?

88 Perspective r 911 Phone service (1993 NRIC report +) m 29 minutes per year per line m 99.994% availability r Std. Phone service (various sources) m 53+ minutes per line per year m 99.99+% 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

89 Unreachable Networks: 10 days

90

91

92 https://www.mint.com/blog/consumer-iq/the-cheapest-warm-vacations-when-you-just-cant-wait-for-summer-0413/?display=wide

93 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

94 Backup Slides 94

95 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}

96 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 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 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 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 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 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. 1000 bits C: link capacity, e.g. 10Mbps

102 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 103 Summary of Problems to be Addressed  Approximate slotted Aloha  Reduce the penalty of collision or empty slots  Infer optimal transmission rate

104 Physical Layer 104

105 Internet Bandwidth Growth Source: TeleGeograph Research

106 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 ?

107 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.

108 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:

109 char “b”

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

111 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)

112 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

113 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)

114 More Efficient 114

115 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

116 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

117 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

118 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 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 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 10011 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 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 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 10101010 followed by one byte with pattern 10101011 (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 8 66 2 46-1500 (including padding) 4

123 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 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 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 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 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 http://en.wikipedia.org/wiki/Cyclic_redundancy_check.

128 128 Adaptors Communicating r link layer typically implemented in “adaptor” (aka NIC) m Ethernet card, modem, 802.11 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


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

Similar presentations


Ads by Google