Computer Networks Lecture 4: Data Link - part III Based on slides from D. Choffnes Northeastern U. and P. Gill from StonyBrook University Revised Autumn.

Slides:



Advertisements
Similar presentations
Channel Allocation Protocols. Dynamic Channel Allocation Parameters Station Model. –N independent stations, each acting as a Poisson Process for the purpose.
Advertisements

Computer Networks Ethernet I Professor Hui Zhang
The ALOHA Protocol “Free for all”: whenever station has a frame to send, it does so. –Station listens for maximum RTT for an ACK. –If no ACK after a specified.
EECC694 - Shaaban #1 lec #5 Spring Data Link In Broadcast Networks: The Media Access Sublayer Broadcast networks with multi-access (or random.
Ethernet – CSMA/CD Review
Fundamentals of Computer Networks ECE 478/578
Multiple access What if multiple machines are sharing the same link?
Communication Networks Lecture 5 NETW 501-L5: NETW 501-L5: Medium Access Control Dr.-Ing. Khaled Shawky Hassan Room: C3-222, ext: 1204,
1 K. Salah Module 4.2: Media Access Control The Media Access Control (MAC) sublayer –Random Access (CSMA), IEEE –Token Passing, IEEE Ch 13-
1 Pertemuan 13 Teknik Akses Jaringan - Random Matakuliah: H0174/Jaringan Komputer Tahun: 2006 Versi: 1/0.
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao
MAC Protocols Media Access Control (who gets the use the channel) zContention-based yALOHA and Slotted ALOHA. yCSMA. yCSMA/CD. TDM and FDM are inefficient.
CS 5253 Workshop 1 MAC Protocol and Traffic Model.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 17 Introduction to Computer Networks.
Chapter 14 LAN Systems Ethernet (CSMA/CD) ALOHA Slotted ALOHA CSMA
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao
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)
EE 4272Spring, 2003 Chapter 14 LAN Systems Ethernet (CSMA/CD)  ALOHA  Slotted ALOHA  CSMA  CSMA/CD Token Ring /FDDI Fiber Channel  Fiber Channel Protocol.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 16 Introduction to Computer Networks.
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao
EEC-484/584 Computer Networks Lecture 9 Wenbing Zhao (Part of the slides are based on materials supplied by Dr. Louise Moser at UCSB and.
Studying Local Area Networks Via Media Access Control (MAC) SubLayer
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429 Introduction to Computer Networks Broadcast network access control Some slides used.
CS 5253 Workshop 1 MAC Protocol and Traffic Model.
Networks: Local Area Networks1 LANs Studying Local Area Networks Via Media Access Control (MAC) SubLayer.
Computer Networks: Local Area Networks 1 LANs Studying Local Area Networks via the Media Access Control (MAC) SubLayer.
Semester EEE449 Computer Networks The Data Link Layer Part 2: Media Access Control En. Mohd Nazri Mahmud MPhil (Cambridge, UK) BEng (Essex,
Medium Access Control Sublayer
Shashank Srivastava Motilal Nehru National Institute Of Technology, Allahabad Medium Access Control.
Chap 4 Multiaccess Communication (Part 1)
1 ECE453 – Introduction to Computer Networks Lecture 7 – Multiple Access Control (I)
9/11/2015 5:55 AM1 Ethernet and CSMA/CD CSE 6590 Fall 2010.
1 Computer Communication & Networks Lecture 12 Datalink Layer: Multiple Access Waleed Ejaz
: Data Communication and Computer Networks
McGraw-Hill © The McGraw-Hill Companies, Inc., 2004 Chapter 12 Multiple Access Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
Chi-Cheng Lin, Winona State University CS412 Introduction to Computer Networking & Telecommunication Medium Access Control Sublayer.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking LANs 2: MAC protocols.
جلسه دهم شبکه های کامپیوتری به نــــــــــــام خدا.
Medium Access Control NWEN302 Computer Network Design.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Medium Access Control Sublayer.
جلسه یازدهم شبکه های کامپیوتری به نــــــــــــام خدا.
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.
17 - Winter 2005 ECE ECE 766 Computer Interfacing and Protocols 1 Local Area Networks Need for high performance communications for physically close devices.
Medium Access Control Sub Layer
Data Communications, Kwangwoon University12-1 Chapter 12. Multiple Access 1.Random Access 2.Controlled Access 3.Channelization.
1 Kyung Hee University Chapter 12 Multiple Access.
Computer Networks Lecture 3: Data Link - part II Based on slides from D. Choffnes Northeastern U. and P. Gill from StonyBrook University Revised Autumn.
CS3502: Data and Computer Networks Local Area Networks - 1 introduction and early broadcast protocols.
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.
Ch 12. Multiple Access. Multiple Access for Shared Link Dedicated link – Point-to-point connection is sufficient Shared link – Link is not dedicated –
CS3502: Data and Computer Networks Local Area Networks - 1 introduction and early broadcast protocols.
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)
1 Ethernet CSE 3213 Fall February Introduction Rapid changes in technology designs Broader use of LANs New schemes for high-speed LANs High-speed.
The Medium Access Control Sublayer
Chapter 4 The Medum Access Sublayer. MA Sublayer Additional Reference –Local and Metropolitan Area Networks, William Stallings, Prentice Hall, 2000, 6th.
UNIT 2 Medium Access sub layer: Medium Access sub layer - Channel Allocations, LAN protocols - ALOHA protocols(PURE AND SLOTTED ALOHA),CSMA/CA,CSMA/CD.
UNIT 3 MULTIPLE ACCESS Adapted from lecture slides by Behrouz A. Forouzan © The McGraw-Hill Companies, Inc. All rights reserved.
COMPUTER NETWORKS Data-link Layer (The Medium Access Control Sublayer) MAC Sublayer.
Multiple Access Methods
Module 3 Medium Access Control.
Multiple Access Mahesh Jangid Assistant Professor JVW University.
Computer Networks Lecture 3: Data Link - part II
Services of DLL Framing Link access Reliable delivery
Figure 12.1 Data link layer divided into two functionality-oriented sublayers Networks can be divided into two categories: those using point-to-point.
Channel Allocation Problem/Multiple Access Protocols Group 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.
Channel Allocation Problem/Multiple Access Protocols Group 3
Multiple Access Methods
Multiple Access Control (MAC) Protocols
Chapter 12 Media Access Control (MAC)
Presentation transcript:

Computer Networks Lecture 4: Data Link - part III Based on slides from D. Choffnes Northeastern U. and P. Gill from StonyBrook University Revised Autumn 2015 by S. Laki

Announcement 2  Our next lecture (next Thursday) is cancelled…  BUT  there is a good opportunity for you to take part in the Next Generation Day of ITU Telecom World 2015 Conference & Exhibition October 15, 2015 – next Thursday  For students the event is free of charge, BUT you have to register in advance!  For more information and registration:

Announcement 3  Our next lecture (next Thursday) is cancelled…  BUT  there is a good opportunity for you to take part in the Next Generation Day of ITU Telecom World 2015 Conference & Exhibition October 15, 2015 – next Thursday  For students the event is free of charge, BUT you have to register in advance!  For more information and registration: „Signatures of humanity” We will also be there with a demo. Look for the Ericsson-ELTE-BME booth in the Hungarian pavilon!

Data Link Layer 4  Function:  Send blocks of data (frames) between physical devices  Regulate access to the physical media  Key challenge:  How to delineate frames?  How to detect errors?  How to perform media access control (MAC)?  How to recover from and avoid collisions? Application Presentation Session Transport Network Data Link Physical

 Framing  Error Checking and Reliability  Media Access Control  Ethernet  Wifi Outline 5

What is Media Access? 6  Ethernet and Wifi are both multi-access technologies  Broadcast medium, shared by many hosts  Simultaneous transmissions cause collisions This destroys the data  Media Access Control (MAC) protocols are required  Rules on how to share the medium  Strategies for detecting, avoiding, and recovering from collisions

Strategies for Media Access 7  Channel partitioning  Divide the resource into small pieces  Allocate each piece to one host  Example: Time Division Multi-Access (TDMA) cellular  Example: Frequency Division Multi-Access (FDMA) cellular  Taking turns  Tightly coordinate shared access to avoid collisions  Example: Token ring networks

CDMA – Code Division Multiple Access 8

CDMA Analogy  10 people in a room.  5 speak English, 2 speak Spanish, 2 speak Chinese, and 1 speaks Russian.  Everyone is talking at relatively the same time over the same medium – the air.  Who can listen to whom and why?  Who can’t you understand?  Who can’t speak to anyone else?

CDMA – Code Division Multiple Access 10  Used by 3G and 4G cellular networks  Each station can broadcast at any time in the full frequency spectrum  The signals may interfere  Resulting in a linear combination of individual signals  Algorithm  We assign a vector of length m to each station: v Pairwise orthogonal vectors!!!  Each bit is encoded by the chip vector of the sender or it’s complement: v or -v  If it sends bit 1, it transmits v  If it sends bit 0, it transmits -v  Result is a sequence of vectors of length m

CDMA – Code Division Multiple Access 11  Interference  A sends a,-a,a,a  B sends b,b,-b,-b  After interference we receive: a+b,-a+b,a-b,a-b ???  How to decode?

CDMA – Code Division Multiple Access 12  Interference  A sends a,-a,a,a  B sends b,b,-b,-b  After interference we receive: a+b,-a+b,a-b,a-b ???  Decoding the message of A  Take the dot product by the sender’s chip code (a+b)a > 0 => 1 (-a+b)a 0 (a-b)a >0 => 1 If the dot product is <0: bit 0 was sent by A >0: bit 1 was sent by A =0: nothing was sent by A the channel is not used by A

Dynamic Channel Allocation in LANs and MANs 1. Station Model.  N terminals/hosts  The prob. of a frame being generated in Δ t is λΔ t, where the arrival rate is λ. 2. Single Channel Assumption.  All stations are equivalent  A single channel is available for all communications 3. Collision Assumption.  If two frames are transmitted simultaneously, they overlap in time which results a garbled signal  This event is called collision 4. Continuous Time VS Slotted Time. 5. Carrier Sense VS No Carrier Sense.

Dynamic Channel Allocation in LANs and MANs 4. Continuous Time VS Slotted Time. 5. Carrier Sense VS No Carrier Sense. Time

How can the efficiency be measured?  Throughput (S)  Number of packets/frames transmitted in a time unit (successfully)  Delay  The time needs for transmitting a packet  Fairness  All the terminals are treated as equals

Throughput and offered load  Offered load (G)  The number of packets in a time unit that the protocol must handle  G>1: overloading  An ideal protocol  If G<1, S=G  If G≥1, S=1  where sending out a packet takes 1 time unit.

Strategies for Media Access 17  Channel partitioning  Divide the resource into small pieces  Allocate each piece to one host  Example: Time Division Multi-Access (TDMA) cellular  Example: Frequency Division Multi-Access (FDMA) cellular  Taking turns  Tightly coordinate shared access to avoid collisions  Example: Token ring networks  Contention  Allow collisions, but use strategies to recover  Examples: Ethernet, Wifi

Contention MAC Goals 18  Share the medium  Two hosts sending at the same time collide, thus causing interference  If no host sends, channel is idle  Thus, want one user sending at any given time  High utilization  TDMA is low utilization  Just like a circuit switched network  Simple, distributed algorithm  Multiple hosts that cannot directly coordinate  No fancy (complicated) token-passing schemes

Contention Protocol Evolution 19  ALOHA  Developed in the 70’s for packet radio networks  Stations transmit data immedately If there is a collision, it retransmits the packet later.  Slotted ALOHA  Start transmissions only at fixed time slots  Significantly fewer collisions than ALOHA  Carrier Sense Multiple Access (CSMA)  Start transmission only if the channel is idle  CSMA / Collision Detection (CSMA/CD)  Stop ongoing transmission if collision is detected

Pure ALOHA  The goal was to use low-cost commercial radio equipment to connect users on Oahu and the other Hawaiian islands with a central time-sharing computer on the main Oahu campus.  Algorithm was developed by Uni. of Hawaii  If you have data to send, send the data  Low-cost and very simple

ALOHA 21  Topology: radio broadcast with multiple stations  Protocol:  Stations transmit data immediately  Receivers ACK all packets  No ACK = collision, wait a random time then retransmit ABC Simple, but radical concept Previous attempts all divided the channel TDMA, FDMA, etc. Optimized for the common case: few senders

Performance analysis -Poisson Process  The Poisson Process is a celebrated model used in Queuing Theory for “random arrivals”. Assumptions leading to this model include:  The probability of an arrival during a short time interval Δ t is proportional to the length of the interval, and does not depend on the origin of the time interval (memory-less property)  The probability of having multiple arrivals during a short time interval Δ t approaches zero.

Performance analysis - Poisson Distribution The probability of having k arrivals during a time interval of length t is given by: where λ is the arrival rate. Note that this is a single- parameter model; all we have to know is λ.

24 FYI: Poisson Distribution The following is the plot of the Poisson probability density function for four values of λ.

Analysis of Pure ALOHA  Notation:  T f = frame time (processing, transmission, propagation)  S: Average number of successful transmissions per T f ; that is, the throughput  G: Average number of total frames transmitted per T f  D: Average delay between the time a packet is ready for transmission and the completion of successful transmission.  We will make the following assumptions  All frames are of constant length  The channel is noise-free; the errors are only due to collisions.  Frames do not queue at individual stations  The channel acts as a Poisson process.

Analysis of Pure ALOHA…  Since S represents the number of “good” transmissions per frame time, and G represents the total number of attempted transmissions per frame time, then we have: S = G  (Probability of good transmission)  The vulnerable time for a successful transmission is 2T f  So, the probability of good transmission is not to have an “ arrival ” during the vulnerable time.

27 Analysis of Pure ALOHA… t0t0 t 0 + tt 0 + 2tt 0 + 3t Collides with the start of the shaded frame Collides with the end of the shaded frame Vulnerable Time Vulnerable period for the shaded frame t

Analysis of Pure ALOHA… Using: And setting t = 2T f and k = 0, we get

29 Analysis of Pure ALOHA…  If we differentiate S = Ge -2G with respect to G and set the result to 0 and solve for G, we find that the maximum occurs when G = 0.5, and for that S = 1/2e = So, the maximum throughput is only 18% of capacity.

Tradeoffs vs. TDMA 30  In TDMA, each host must wait for its turn  Delay is proportional to number of hosts  In Aloha, each host sends immediately  Much lower delay  But, much lower utilization ALOHA Frame Time Sender A Sender B  Maximum throughput is ~18% of channel capacity Load Throughput

31 Slotted ALOHA  Channel is organized into uniform slots whose size equals the frame transmission time.  Transmission is permitted only to begin at a slot boundary.  Here is the procedure:  While there is a new frame A to send do Send frame A at (the next) slot boundary

Analysis of Slotted ALOHA  Note that the vulnerable period is now reduced in half. Using: And setting t = T f and k = 0, we get

Slotted ALOHA 33  Protocol  Same as ALOHA, except time is divided into slots  Hosts may only transmit at the beginning of a slot  Thus, frames either collide completely, or not at all  37% throughput vs. 18% for ALOHA  But, hosts must have synchronized clocks Load Throughput

802.3 Ethernet 34  Preamble is 7 bytes of Why?  Start Frame (SF) is  Source and destination are MAC addresses  E.g. 00:45:A5:F3:25:0C  Broadcast: FF:FF:FF:FF:FF:FF  Minimum packet length of 64 bytes, hence the pad PreambleSFSourceDest.Length Bytes DataChecksumPad

Broadcast Ethernet 35  Originally, Ethernet was a broadcast technology Tee Connector Terminator Hub Hubs and repeaters are layer-1 devices, i.e. physical only 10Base2 10BaseT and 100BaseT T stands for Twisted Pair Repeater

Carrier Sense Multiple Access (CSMA)  Additional assumption:  Each station is capable of sensing the medium to determine if another transmission is underway

Non-persistent CSMA While there is a new frame A to send 1. Check the medium 2. If the medium is busy, wait some time, and go to (medium idle) Send frame A

1-persistent CSMA While there is a new frame A to send 1. Check the medium 2. If the medium is busy, go to (medium idle) Send frame A

p-persistent CSMA While there is a new frame A to send 1. Check the medium 2. If the medium is busy, go to (medium idle) With probability p send frame A, and probability (1- p) delay one time slot and go to 1.

40 CSMA Summary Non-persistent: Transmit if idle Otherwise, delay, try again Constant or variable Delay Channel busy Ready 1-persistent: Transmit as soon as channel goes idle If collision, back off and try again Time p-persistent: Transmit as soon as channel goes idle with probability p Otherwise, delay one slot, repeat process CSMA persistence and backoff  Nonpersistent  1-persistent  p-persistent

Persistent and Non-persistent CSMA Comparison of throughput versus load for various random access protocols.

CSMA with Collision Detection  Stations can sense the medium while transmitting  A station aborts its transmission if it senses another transmission is also happening (that is, it detects collision)  Question: When can a station be sure that it has seized the channel?  Minimum time to detect collision is the time it takes for a signal to traverse between two farthest apart stations.

CSMA/CD  A station is said to seize the channel if all the other stations become aware of its transmission.  There has to be a lower bound on the length of each frame for the collision detection feature to work out.  Ethernet uses CSMA/CD

CSMA/CD 44  Carrier sense multiple access with collision detection  Key insight: wired protocol allows us to sense the medium  Algorithm 1. Sense for carrier 2. If carrier is present, wait for it to end Sending would cause a collision and waste time 3. Send a frame and sense for collision 4. If no collision, then frame has been delivered 5. If collision, abort immediately Why keep sending if the frame is already corrupted? 6. Perform exponential backoff then retransmit

CSMA/CD Collisions 45 ABCD Time t0t0 t1t1 Detect Collision and Abort  Collisions can occur  Collisions are quickly detected and aborted  Note the role of distance, propagation delay, and frame length Spatial Layout of Hosts

Exponential Backoff 46  When a sender detects a collision, send “jam signal”  Make sure all hosts are aware of collision  Jam signal is 32 bits long (plus header overhead)  Exponential backoff operates:  Select k ∈ [0, 2 n – 1] unif. rnd., where n = number of collisions  Wait k time units (packet times) before retransmission  n is capped at 10, frame dropped after 16 collisions  Backoff time is divided into contention slots Remember this number

Minimum Packet Sizes 47  Why is the minimum packet size 64 bytes?  To give hosts enough time to detect collisions  What is the relationship between packet size and cable length? Propagation Delay (d) 1. Time t: Host A starts transmitting 2. Time t + d: Host B starts transmitting 3. Time t + 2*d: collision detected A B Basic idea: Host A must be transmitting at time 2*d!

CSMA/CD  CSMA/CD can be in one of three states: contention, transmission, or idle.  To detect all the collisions we need  T f ≥ 2T pg  where T f is the time needed to send the frame  And T pg is the propagation delay between A and B

Minimum Packet Size 49  Host A must be transmitting after 2*d time units  Min_pkt = rate (b/s) * 2 * d (s) … but what is d? propagation delay: limited by speed of light Propagation delay (d) = distance (m) / speed of light (m/s)  This gives:  Min_pkt = rate (b/s) * 2 * dist (m) / speed of light (m/s)  So cable length is equal ….  Dist = min_pkt * light speed /(2 * rate) 10 Mbps Ethernet Packet and cable lengths change for faster Ethernet standards (64B*8)*(2.5*10 8 mps)/(2*10 7 bps) = 6400 meters

Cable Length Examples 50 min_frame_size*light_speed/(2*bandwidth) = max_cable_length (64B*8)*(2.5*10 8 mps)/(2*10Mbps) = 6400 meters  What is the max cable length if min packet size were changed to 1024 bytes?  kilometers  What is max cable length if bandwidth were changed to 1 Gbps ?  64 meters  What if you changed min packet size to 1024 bytes and bandwidth to 1 Gbps?  1024 meters

Maximum Packet Size 51  Maximum Transmission Unit (MTU): 1500 bytes  Pros:  Bit errors in long packets incur significant recovery penalty  Cons:  More bytes wasted on header information  Higher per packet processing overhead  Datacenters shifting towards Jumbo Frames  9000 bytes per packet

Long Live Ethernet 52  Today’s Ethernet is switched  More on this later  1Gbit and 10Gbit Ethernet now common  100Gbit on the way  Uses same old packet header  Full duplex (send and receive at the same time)  Auto negotiating (backwards compatibility)  Can also carry power