EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao

Slides:



Advertisements
Similar presentations
Network Layer4-1 Link Layer: Introduction Some terminology: r hosts and routers are nodes (bridges and switches too) r communication channels that connect.
Advertisements

5-1 Link Layer: Introduction Some terminology: r hosts and routers are nodes r communication channels that connect adjacent nodes along communication path.
5: DataLink Layer5a-1 MAC Sublayer. 5: DataLink Layer5a-2 Multiple Access Links and Protocols Two types of “links”: r point-to-point m PPP for dial-up.
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.
5-1 Data Link Layer r What is Data Link Layer? r Multiple access protocols r Link-layer Addressing r Ethernet.
1 Announcement r Homework #3 was due last night r Homework #4 is out.
EEC-484/584 Computer Networks Lecture 8 Wenbing Zhao
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.
EE 122: Ethernet and Ion Stoica September 18, 2002 (* this talk is based in part on the on-line slides of J. Kurose & K. Rose)
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:
DataLink Layer session 1 TELE3118: Network Technologies Week 2: Data Link Layer Framing, Error Control, Multiple Access Some slides have been taken.
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.
EEC-484/584 Computer Networks Lecture 8 Wenbing Zhao
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao
Chapter 5 Link Layer slides are modified from J. Kurose & K. Ross CPE 400 / 600 Computer Communication Networks Lecture 21.
5: DataLink Layer5-1 Link Layer – Error Detection/Correction and MAC.
EEC-484/584 Computer Networks Lecture 14 Wenbing Zhao
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 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction m.
Introduction1-1 1DT014/1TT821 Computer Networks I Chapter 5 Link Layer and LANs.
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.
1 Random Access Protocols r When node has packet to send m transmit at full channel data rate R. m no a priori coordination among nodes  two or more transmitting.
Introduction1-1 Data Communications and Computer Networks Chapter 5 CS 3830 Lecture 27 Omar Meqdadi Department of Computer Science and Software Engineering.
4-1 Last time □ Link layer overview ♦ Services ♦ Adapters □ Error detection and correction ♦ Parity check ♦ Internet checksum ♦ CRC □ PPP ♦ Byte stuffing.
CSC4220/6220 Computer Networks
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 Link Layer multiple.
CS 1652 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights Reserved Jack Lange.
Network Layer4-1 Lower limit on the number of check bits r We want to design a code m with m message bits and r check bits Allowing all single errors to.
Link Layer5-1 Chapter 5: Link layer our goals:  understand principles behind link layer services:  error detection, correction  sharing a broadcast.
Medium Access Control NWEN302 Computer Network Design.
Multiple Access Readings: Kurose & Ross, 5.3, 5.5.
November 8 th, 2012 CS1652 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights Reserved.
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.
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.
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
EEC-484 Computer Networks Lecture 13 Wenbing Zhao 12/6/20151.
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.
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao
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.
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.
EEC-484/584 Computer Networks
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.
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.
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 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.
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
5: DataLink Layer5-1 Slotted ALOHA Assumptions r all frames same size r time is divided into equal size slots, time to transmit 1 frame r nodes start to.
EEC-484/584 Computer Networks
Chapter 5 Link Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
Link Layer 5.1 Introduction and services
Random Access Protocols
Chapter 5 Link Layer and LANs
CS 457 – Lecture 6 Ethernet Spring 2012.
Services of DLL Framing Link access Reliable delivery
Multiple access.
2017 session 1 TELE3118: Network Technologies Week 2: Data Link Layer Framing, Error Control, Multiple Access Slides have been adapted from: Computer.
2012 session 1 TELE3118: Network Technologies Week 2: Data Link Layer Framing, Error Control, Multiple Access Some slides have been taken from: Computer.
EEC-484/584 Computer Networks
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.
Link Layer 5.1 Introduction and services
Link Layer: Multiple Access
Presentation transcript:

EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao

7/12/2015 EEC-484/584: Computer Networks Wenbing Zhao Outline CRC Medium Access Control (MAC) Ethernet  Manchester Encoding  The Ethernet MAC Sublayer Protocol  The Binary Exponential Backoff Algorithm

7/12/2015 EEC484/584: Computer Networks 3 Checksumming: Cyclic Redundancy Check view data bits, D, as a binary number choose r+1 bit pattern (generator), G goal: choose r CRC bits, R, such that  exactly divisible by G (modulo 2)  receiver knows G, divides by G. If non-zero remainder: error detected!  can detect all burst errors less than r+1 bits widely used in practice (Ethernet, WiFi)

7/12/2015 EEC484/584: Computer Networks 4 CRC Example Want: D. 2 r XOR R = nG equivalently: D. 2 r = nG XOR R equivalently: if we divide D. 2 r by G, want remainder R R = remainder[ ] D.2rGD.2rG

7/12/2015 EEC484/584: Computer Networks 5 Medium Access Control Two types of “links”: point-to-point  PPP for dial-up access  point-to-point link between Ethernet switch and host broadcast (shared wire or medium)  old-fashioned Ethernet  wireless LAN shared wire (e.g., cabled Ethernet) shared RF (e.g., WiFi) shared RF (satellite) humans at a cocktail party (shared air, acoustical)

7/12/2015 EEC484/584: Computer Networks 6 MAC Protocols Assumption  Single shared broadcast channel  Two or more simultaneous transmissions by nodes: interference  Collision if node receives two or more signals at the same time MAC protocols Distributed algorithm that determines how nodes share channel, i.e., determine when node can transmit Communication about channel sharing must use channel itself!  No out-of-band channel for coordination

7/12/2015 EEC484/584: Computer Networks 7 Ideal MAC Protocol Broadcast channel of rate R bps 1. when one node wants to transmit, it can send at rate R. 2. when M nodes want to transmit, each can send at average rate R/M 3. fully decentralized:  no special node to coordinate transmissions  no synchronization of clocks, slots 4. simple

7/12/2015 EEC484/584: Computer Networks 8 MAC Protocols: a taxonomy Three broad classes: Channel Partitioning  divide channel into smaller “pieces” (time slots, frequency, code)  allocate piece to node for exclusive use Random Access  channel not divided, allow collisions  “recover” from collisions “Taking turns”  nodes take turns, but nodes with more to send can take longer turns

7/12/2015 EEC484/584: Computer Networks 9 Channel Partitioning MAC protocols: TDMA TDMA: time division multiple access access to channel in "rounds" each station gets fixed length slot (length = pkt trans time) in each round unused slots go idle example: 6-station LAN, 1,3,4 have pkt, slots 2,5,6 idle slot frame

7/12/2015 EEC484/584: Computer Networks 10 Channel Partitioning MAC protocols: FDMA FDMA: frequency division multiple access channel spectrum divided into frequency bands each station assigned fixed frequency band unused transmission time in frequency bands go idle example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6 idle frequency bands time FDM cable

7/12/2015 EEC484/584: Computer Networks 11 Random Access Protocols When node has packet to send  transmit at full channel data rate R.  no a priori coordination among nodes two or more transmitting nodes ➜ “collision”, random access MAC protocol specifies:  how to detect collisions  how to recover from collisions (e.g., via delayed retransmissions) Examples of random access MAC protocols:  ALOHA  slotted ALOHA  CSMA, CSMA/CD, CSMA/CA

7/12/2015 EEC484/584: Computer Networks 12 Pure ALOHA pure Aloha: simple, no synchronization when frame first arrives  transmit immediately collision probability increases:  frame sent at t 0 collides with other frames sent in [t 0 -1,t 0 +1]

7/12/2015 EEC484/584: Computer Networks 13 Pure Aloha efficiency P(success by given node) = P(node transmits). P(no other node transmits in [p 0 -1,p 0 ]. P(no other node transmits in [p 0,p 0+1 ] = p. (1-p) N-1. (1-p) N-1 = p. (1-p) 2(N-1) … choosing optimum p and then letting n -> infty... = 1/(2e) =.18

7/12/2015 EEC484/584: Computer Networks 14 Slotted ALOHA Assumptions: all frames same size time divided into equal size slots (time to transmit 1 frame) nodes start to transmit only slot beginning nodes are synchronized if 2 or more nodes transmit in slot, all nodes detect collision Operation: when node obtains fresh frame, transmits in next slot  if no collision: node can send new frame in next slot  if collision: node retransmits frame in each subsequent slot with prob. p until success

7/12/2015 EEC484/584: Computer Networks 15 Slotted ALOHA Pros single active node can continuously transmit at full rate of channel highly decentralized: only slots in nodes need to be in sync simple Cons collisions, wasting slots idle slots clock synchronization

7/12/2015 EEC484/584: Computer Networks 16 Slotted Aloha efficiency suppose: N nodes with many frames to send, each transmits in slot with probability p prob that given node has success in a slot = p(1-p) N-1 prob that any node has a success = Np(1-p) N-1 max efficiency: find p* that maximizes Np(1-p) N-1 for many nodes, take limit of Np*(1-p*) N-1 as N goes to infinity, gives: Max efficiency = 1/e =.37 Efficiency : long-run fraction of successful slots (many nodes, all with many frames to send) At best: channel used for useful transmissions 37% of time! !

7/12/2015 EEC484/584: Computer Networks 17 CSMA (Carrier Sense Multiple Access) CSMA: listen before transmit: If channel sensed idle: transmit entire frame If channel sensed busy, defer transmission human analogy: don’t interrupt others!

7/12/2015 EEC484/584: Computer Networks 18 CSMA collisions collisions can still occur: propagation delay means two nodes may not hear each other’s transmission collision: entire packet transmission time wasted spatial layout of nodes note: role of distance & propagation delay in determining collision probability

7/12/2015 EEC484/584: Computer Networks 19 CSMA/CD (Collision Detection) CSMA/CD: carrier sensing, deferral as in CSMA  collisions detected within short time  colliding transmissions aborted, reducing channel wastage collision detection:  easy in wired LANs: measure signal strengths, compare transmitted, received signals  difficult in wireless LANs: received signal strength overwhelmed by local transmission strength

7/12/2015 EEC484/584: Computer Networks 20 CSMA/CD collision detection

Ethernet “dominant” wired LAN technology: cheap $20 for NIC first widely used LAN technology simpler, cheaper than other schemes kept up with speed race: 10 Mbps – 10 Gbps Metcalfe’s Ethernet sketch

802.3 Ethernet Standards: Link & Physical Layers Many different Ethernet standards  common MAC protocol and frame format  different speeds: 2 Mbps, 10 Mbps, 100 Mbps, 1Gbps, 10G bps  different physical layer media: fiber, cable application transport network link physical MAC protocol and frame format 100BASE-TX 100BASE-T4 100BASE-FX 100BASE-T2 100BASE-SX 100BASE-BX fiber physical layer copper (twister pair) physical layer

7/12/2015 EEC-484/584: Computer Networks Wenbing Zhao Manchester Encoding Binary encoding  Hard to distinguish 0 bit (0-volt) from idle (0-volt)  Requires clocks of all stations synchronized Manchester encoding  used in 10BaseT  each bit has a transition  allows clocks in sending and receiving nodes to synchronize to each other no need for a centralized, global clock among nodes!

7/12/2015 EEC-484/584: Computer Networks Wenbing Zhao Ethernet Frame Structure Preamble: for clock synchronization  First 7 bytes with pattern , last byte with pattern  The two consecutive 1 ’ s indicate the start of a frame How can the receiver tell the end of the frame?  No current on the wire ( interesting discussion at >= 64 bytes Not considered as part of the header!

7/12/2015 EEC-484/584: Computer Networks Wenbing Zhao Ethernet Frame Structure Destination address: 6 bytes (48 bits)  Highest order bit: 0 individual, 1 multicast; all 1 ’ s broadcast  Frames received with non-matching destination address is discarded Type/Length: type of network layer protocol (or length of payload) Pad – used to produce valid frame >= 64 bytes Checksum – 32-bit cyclic redundancy check

7/12/2015 EEC-484/584: Computer Networks Wenbing Zhao CSMA with Collision Detection If two stations start transmitting simultaneously, both detect collision and stop transmitting Monitor collision while sending  Minimum time to detect collision => minimum frame length Time divided into slots  Length of slot = 2  = worst-case round-trip propagation time  To accommodate longest path, slot time = 512 bit times = 51.2  sec (10Mbps Ethernet) => min frame length: 51.2  sec X 10 Mbps = 512 b = 64 byte

7/12/2015 EEC-484/584: Computer Networks Wenbing Zhao Minimum Time to Detect Collision (in worst-case scenario) To ensure the sender can detect collision  All frames must take more than 2  to send so that transmission is still taking place when the noise burst gets back to the sender

EEC-484/584: Computer Networks 5-28 Ethernet MAC Sublayer Protocol Connectionless: No handshaking between sending and receiving NICs  Ethernet resides in the Network Interface Card (NIC) Unreliable: receiving NIC doesn’t send acks or nacks to sending NIC  stream of datagrams passed to network layer can have gaps (missing datagrams)  gaps will be filled if app is using TCP  otherwise, app will see gaps Ethernet’s MAC protocol: CSMA/CD 7/12/2015

EEC-484/584: Computer Networks 5-29 Ethernet CSMA/CD algorithm 1. NIC receives datagram from network layer, creates frame 2. If NIC senses channel idle, starts frame transmission If NIC senses channel busy, waits until channel idle, then transmits 3. If NIC transmits entire frame without detecting another transmission, NIC is done with frame ! 4. If NIC detects another transmission while transmitting, aborts and sends jam signal 5. After aborting, NIC enters exponential backoff: after mth collision, NIC chooses K at random from {0,1,2,…,2 m -1}. NIC waits K·512 bit times, returns to Step 2 7/12/2015

7/12/2015 EEC-484/584: Computer Networks Wenbing Zhao Randomization and Binary Exponential Backoff After 1 st collision, station picks 0 or 1 at random, waits that number of slots and tries again After 2 nd collision, station picks 0,1,2,3 at random, waits that number of slots and tries again …. After i-th collision, station picks 0,1, …,2 i -1 at random, … If 10 <= i < 16, station picks 0,1, …, at random If i=16, controller reports failure to computer Why randomization is needed?

7/12/2015 EEC-484/584: Computer Networks Wenbing Zhao Exercise An IP packet to be transmitted by Ethernet is 60 bytes long. Is padding needed in the Ethernet frame, and if so, how many bytes?

7/12/2015 EEC-484/584: Computer Networks Wenbing Zhao Exercise Consider building a CSMA/CD network running at 1 Gbps over a 1-km cable. The signal speed in the cable is 200,000 km/sec. What is the minimum frame size?