ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials...

74
ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose

description

Link Layer: Introduction Some terminology: –hub/repeater (layer 1), bridge/LAN switch (layer 2), router (layer 3), host (layers app) –Links are communication channels that connect adjacent nodes along communication path (point-to-point, shared, wired, wireless) –Layer-2 frame: encapsulates payload/datagram/IP packet/service unit Router Switch Link Host Lin k LAN 1 LAN 2 Switch Link Host

Transcript of ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials...

Page 1: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

ECE544 Communication Networks-II Spring 2013

D Raychaudhuri

Lecture II

Includes teaching materials from L Peterson J Kurose

Todayrsquos Lecturebull Recap of network architecture amp

top-down designndash architecture paper discussion

bull Shared media (MAC) protocolsndash Ethernetndash Token ringndash IEEE 80211

Link Layer Introductionbull Some terminology

ndash hubrepeater (layer 1) bridgeLAN switch (layer 2) router (layer 3) host (layers 1-3 + app)

ndash Links are communication channels that connect adjacent nodes along communication path (point-to-point shared wired wireless)

ndash Layer-2 frame encapsulates payloaddatagramIP packetservice unit

RouterSwitch

Link

Host

Link

LAN 1LAN 2

Switch

Link

Host

Link Layer Servicesbull Data-link layer transfer datagram from

one node to adjacent node over a linkndash Framing encapsulate datagram into frame

adding header trailer bull Identify what set of bits constitute a frame that is

determining the beginning and the end of a framendash channel access if shared medium

bull MAC addresses used in frame headers to identify source destination

bull different from IP addressndash Reliable delivery between adjacent nodes

bull Error detection bull Error recovery forward error correction code

retransmission (ARQ)

Link Layer Communicationbull Link layer implemented in adaptor (NIC) and driver (Ethernet

card WLAN card)bull Sending side encapsulates higher layer payload in a frame

adds error checking bits flow control etcbull Receiving side error detection flow control extracts payload

passes to the receiving node

CPU

Cache

Memory

Control status register

Bus interface

Linkinterface

Host

NIC

IObus

Network

Datagram

Frame

Adaptor

Sendingnode

Datagram

Frame

Adaptor

Recvnode

Link layer protocol

Layer 2 vs Layer 3

bull Layer 2 switchingndash Based on MAC

addressndash Self configuring and

plug amp playndash Transparent to

protocols above the MAC layer

ndash Fast and inexpensivendash Does not limit the

scope of broadcasts ndash Does not scale to

extremely large networks

bull Layer 3 routingndash Based on IP addressndash Must get IP address

(DHCP or manual assign)

ndash Easily connect LANs that uses different link protocols

ndash Scalable to large network by subnet routing

ndash Broadcast limited only in a subnet

bull Link Layer Techniquesndash Encoding (more Physical Layer stuff)ndash Framing amp PPP Protocolndash Error Detection amp Correction ndash ARQ

bull Self study topics (see Ch2 amp slides)

Binary Encodingbull Binary Encoding turn the binary data (bits) into

signals to transmit on cable or optical fiber link (physical layer stuff but better to know)

bull Baseband not modulate to high frequencybull Nonreturn To Zero (NRZ) 1=high signal 0=low

signalndash May stay on high or low signal too long for a long strings

of consecutive 1s or 0s =gt baseline wander clock recovery problems

bull Nonreturn to Zero Inverted (NRZI) 1 = signal transition (low to high or high to low) 0=no changendash Solve the problem of consecutive 1s but not

consecutive 0s

Manchester Encoding bull Manchester Encoding NRZ_encode data XOR clock

ndash Clock cycle (a lowhigh pair) = 2 x signal intervalndash Baud rate (the signal change rate) = 2 x bitratendash 0 =high-to-low transition 1 = low-to-high transitionndash Clock recovery

bull Variation Differential Manchesterndash 1 = the first half of the signal equal to the last half of the previous

bitrsquos signalndash 0 = the first half of the signal opposite to the last half of the

previous bitrsquos signal

1 1101 0000 11 0Bits

NRZ

Clock

Manchester

NRZI

Point-to-Point Data Link Protocolbull Two types of links

ndash point-to-point link (easier than broadcast link)bull one sender one receiver on the link NO Media

Access Controlbull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)bull popular point-to-point DLC protocols

ndash PPP (point-to-point protocol) byte-orientedbull PPP for dial-up accessbull PPP over Ethernet (DSL)

ndash HDLC (High level data link control) bit-oriented

PPPModem

PPP Functionsbull Framing encapsulation of network-layer datagram in

data link frame ndash Identify what set of bits constitute a frame that is

determining the beginning and the end of a framebull carry data of any network layer protocol (not just IP) at

same timendash ability to demultiplex upwards

bull bit transparency must carry any bit pattern in the data field

bull error detection (no correction)bull connection liveness detect signal link failure to

network layerbull network layer address negotiation endpoint can

learnconfigure each otherrsquos network addressbull PPP

ndash no error correctionrecoveryndash no flow controlndash out of order delivery OK ndash no need to support multipoint links (eg polling)

PPP Data Framebull Flag delimiter (framing)bull Address bull Control bull Protocol upper layer protocol to which frame carried (eg

IP)bull Info upper layer databull Check CRC

01111110 11111111 00000011 protocol info CRC 01111110

flag

Octet 1

controladdress

1 or 21 variable 2 or 41 1

Byte Stuffbull ldquodata transparencyrdquorequirement data field

must be allowed to include flag pattern lt01111110gtndash Q is received lt01111110gt data or flag

bull Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byte

bull Receiverndash two 01111110 bytes in a row discard first byte

continue data receptionndash single 01111110 flag byte

PPP Link Control Protocol (LCP)

bull Before exchanging network-layer data data link peers mustndash configure PPP link (max frame length

authentication)bull learnconfigure network

ndash layer informationndash for IP carry IP Control Protocol (IPCP)

msgs (protocol field 8021) to configurelearn IP address

High-Level Data Link Control (HDLC) bull Bit oriented protocol view the frame as a collection of

bits does not care byte boundariesbull Sentinel characters 01111110 transmitted as the link is

idle for synchronizationbull Bit stuffing to distinguish the data pattern 01111110 in

the body from the special ldquobeginningendrdquo sequencendash after transmitting any 5 consecutive 1s in body insert a 0ndash 011111xxxx =gt 0111110xxx

01111110 Header body CRC 01111110

Beginningsequence

Bits 8 variable 1616 8

endingsequence

Error Detectionbull EDC= Error Detection and Correction bits (redundancy)bull D = Data protected by error checking may include header fields bull Error detection not 100 reliable

ndash protocol may miss some errors but rarelyndash larger EDC field yields better detection and correction

Parity Checkingbull Single Bit Parity

ndash Detect single bit errors

bull Two Dimensional Bit Parityndash Detect and correct

single bit error

Internet Checksum

Senderbull treat segment

contents as sequence of 16-bit integers

bull checksum addition (1rsquos complement sum) of segment contents and take the ones complement of the result

bull sender puts checksum value into UDP checksum field

Receiverbull compute checksum

of received segmentbull check if computed

checksum equals checksum field valuendash NO -error detectedndash YES -no error

detected But maybe errors (internet checksum not very strong for error detection but simple)

bull Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer)

Cyclic Redundancy Check (CRC)bull A (n+1)-bit message M can be represented as a

polynomial of degree n For example ndash X = 10011010 ndash M(X) = X7 + X4 + X3 + X

bull Choose k+1 bit pattern (divisor) C(X) a polyn of degree k

bull goal get k CRC bits Y such thatndash P=ltMYgt exactly divisible by C (modulo 2) ndash receiver knows C divides ltMYgt by C If non-zero

remainder error detectedndash can detect all burst errors less than k+1 bits

M data bits to be sent Y CRC

n bits k bits

M x 2k XOR R

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 2: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Todayrsquos Lecturebull Recap of network architecture amp

top-down designndash architecture paper discussion

bull Shared media (MAC) protocolsndash Ethernetndash Token ringndash IEEE 80211

Link Layer Introductionbull Some terminology

ndash hubrepeater (layer 1) bridgeLAN switch (layer 2) router (layer 3) host (layers 1-3 + app)

ndash Links are communication channels that connect adjacent nodes along communication path (point-to-point shared wired wireless)

ndash Layer-2 frame encapsulates payloaddatagramIP packetservice unit

RouterSwitch

Link

Host

Link

LAN 1LAN 2

Switch

Link

Host

Link Layer Servicesbull Data-link layer transfer datagram from

one node to adjacent node over a linkndash Framing encapsulate datagram into frame

adding header trailer bull Identify what set of bits constitute a frame that is

determining the beginning and the end of a framendash channel access if shared medium

bull MAC addresses used in frame headers to identify source destination

bull different from IP addressndash Reliable delivery between adjacent nodes

bull Error detection bull Error recovery forward error correction code

retransmission (ARQ)

Link Layer Communicationbull Link layer implemented in adaptor (NIC) and driver (Ethernet

card WLAN card)bull Sending side encapsulates higher layer payload in a frame

adds error checking bits flow control etcbull Receiving side error detection flow control extracts payload

passes to the receiving node

CPU

Cache

Memory

Control status register

Bus interface

Linkinterface

Host

NIC

IObus

Network

Datagram

Frame

Adaptor

Sendingnode

Datagram

Frame

Adaptor

Recvnode

Link layer protocol

Layer 2 vs Layer 3

bull Layer 2 switchingndash Based on MAC

addressndash Self configuring and

plug amp playndash Transparent to

protocols above the MAC layer

ndash Fast and inexpensivendash Does not limit the

scope of broadcasts ndash Does not scale to

extremely large networks

bull Layer 3 routingndash Based on IP addressndash Must get IP address

(DHCP or manual assign)

ndash Easily connect LANs that uses different link protocols

ndash Scalable to large network by subnet routing

ndash Broadcast limited only in a subnet

bull Link Layer Techniquesndash Encoding (more Physical Layer stuff)ndash Framing amp PPP Protocolndash Error Detection amp Correction ndash ARQ

bull Self study topics (see Ch2 amp slides)

Binary Encodingbull Binary Encoding turn the binary data (bits) into

signals to transmit on cable or optical fiber link (physical layer stuff but better to know)

bull Baseband not modulate to high frequencybull Nonreturn To Zero (NRZ) 1=high signal 0=low

signalndash May stay on high or low signal too long for a long strings

of consecutive 1s or 0s =gt baseline wander clock recovery problems

bull Nonreturn to Zero Inverted (NRZI) 1 = signal transition (low to high or high to low) 0=no changendash Solve the problem of consecutive 1s but not

consecutive 0s

Manchester Encoding bull Manchester Encoding NRZ_encode data XOR clock

ndash Clock cycle (a lowhigh pair) = 2 x signal intervalndash Baud rate (the signal change rate) = 2 x bitratendash 0 =high-to-low transition 1 = low-to-high transitionndash Clock recovery

bull Variation Differential Manchesterndash 1 = the first half of the signal equal to the last half of the previous

bitrsquos signalndash 0 = the first half of the signal opposite to the last half of the

previous bitrsquos signal

1 1101 0000 11 0Bits

NRZ

Clock

Manchester

NRZI

Point-to-Point Data Link Protocolbull Two types of links

ndash point-to-point link (easier than broadcast link)bull one sender one receiver on the link NO Media

Access Controlbull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)bull popular point-to-point DLC protocols

ndash PPP (point-to-point protocol) byte-orientedbull PPP for dial-up accessbull PPP over Ethernet (DSL)

ndash HDLC (High level data link control) bit-oriented

PPPModem

PPP Functionsbull Framing encapsulation of network-layer datagram in

data link frame ndash Identify what set of bits constitute a frame that is

determining the beginning and the end of a framebull carry data of any network layer protocol (not just IP) at

same timendash ability to demultiplex upwards

bull bit transparency must carry any bit pattern in the data field

bull error detection (no correction)bull connection liveness detect signal link failure to

network layerbull network layer address negotiation endpoint can

learnconfigure each otherrsquos network addressbull PPP

ndash no error correctionrecoveryndash no flow controlndash out of order delivery OK ndash no need to support multipoint links (eg polling)

PPP Data Framebull Flag delimiter (framing)bull Address bull Control bull Protocol upper layer protocol to which frame carried (eg

IP)bull Info upper layer databull Check CRC

01111110 11111111 00000011 protocol info CRC 01111110

flag

Octet 1

controladdress

1 or 21 variable 2 or 41 1

Byte Stuffbull ldquodata transparencyrdquorequirement data field

must be allowed to include flag pattern lt01111110gtndash Q is received lt01111110gt data or flag

bull Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byte

bull Receiverndash two 01111110 bytes in a row discard first byte

continue data receptionndash single 01111110 flag byte

PPP Link Control Protocol (LCP)

bull Before exchanging network-layer data data link peers mustndash configure PPP link (max frame length

authentication)bull learnconfigure network

ndash layer informationndash for IP carry IP Control Protocol (IPCP)

msgs (protocol field 8021) to configurelearn IP address

High-Level Data Link Control (HDLC) bull Bit oriented protocol view the frame as a collection of

bits does not care byte boundariesbull Sentinel characters 01111110 transmitted as the link is

idle for synchronizationbull Bit stuffing to distinguish the data pattern 01111110 in

the body from the special ldquobeginningendrdquo sequencendash after transmitting any 5 consecutive 1s in body insert a 0ndash 011111xxxx =gt 0111110xxx

01111110 Header body CRC 01111110

Beginningsequence

Bits 8 variable 1616 8

endingsequence

Error Detectionbull EDC= Error Detection and Correction bits (redundancy)bull D = Data protected by error checking may include header fields bull Error detection not 100 reliable

ndash protocol may miss some errors but rarelyndash larger EDC field yields better detection and correction

Parity Checkingbull Single Bit Parity

ndash Detect single bit errors

bull Two Dimensional Bit Parityndash Detect and correct

single bit error

Internet Checksum

Senderbull treat segment

contents as sequence of 16-bit integers

bull checksum addition (1rsquos complement sum) of segment contents and take the ones complement of the result

bull sender puts checksum value into UDP checksum field

Receiverbull compute checksum

of received segmentbull check if computed

checksum equals checksum field valuendash NO -error detectedndash YES -no error

detected But maybe errors (internet checksum not very strong for error detection but simple)

bull Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer)

Cyclic Redundancy Check (CRC)bull A (n+1)-bit message M can be represented as a

polynomial of degree n For example ndash X = 10011010 ndash M(X) = X7 + X4 + X3 + X

bull Choose k+1 bit pattern (divisor) C(X) a polyn of degree k

bull goal get k CRC bits Y such thatndash P=ltMYgt exactly divisible by C (modulo 2) ndash receiver knows C divides ltMYgt by C If non-zero

remainder error detectedndash can detect all burst errors less than k+1 bits

M data bits to be sent Y CRC

n bits k bits

M x 2k XOR R

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 3: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Link Layer Introductionbull Some terminology

ndash hubrepeater (layer 1) bridgeLAN switch (layer 2) router (layer 3) host (layers 1-3 + app)

ndash Links are communication channels that connect adjacent nodes along communication path (point-to-point shared wired wireless)

ndash Layer-2 frame encapsulates payloaddatagramIP packetservice unit

RouterSwitch

Link

Host

Link

LAN 1LAN 2

Switch

Link

Host

Link Layer Servicesbull Data-link layer transfer datagram from

one node to adjacent node over a linkndash Framing encapsulate datagram into frame

adding header trailer bull Identify what set of bits constitute a frame that is

determining the beginning and the end of a framendash channel access if shared medium

bull MAC addresses used in frame headers to identify source destination

bull different from IP addressndash Reliable delivery between adjacent nodes

bull Error detection bull Error recovery forward error correction code

retransmission (ARQ)

Link Layer Communicationbull Link layer implemented in adaptor (NIC) and driver (Ethernet

card WLAN card)bull Sending side encapsulates higher layer payload in a frame

adds error checking bits flow control etcbull Receiving side error detection flow control extracts payload

passes to the receiving node

CPU

Cache

Memory

Control status register

Bus interface

Linkinterface

Host

NIC

IObus

Network

Datagram

Frame

Adaptor

Sendingnode

Datagram

Frame

Adaptor

Recvnode

Link layer protocol

Layer 2 vs Layer 3

bull Layer 2 switchingndash Based on MAC

addressndash Self configuring and

plug amp playndash Transparent to

protocols above the MAC layer

ndash Fast and inexpensivendash Does not limit the

scope of broadcasts ndash Does not scale to

extremely large networks

bull Layer 3 routingndash Based on IP addressndash Must get IP address

(DHCP or manual assign)

ndash Easily connect LANs that uses different link protocols

ndash Scalable to large network by subnet routing

ndash Broadcast limited only in a subnet

bull Link Layer Techniquesndash Encoding (more Physical Layer stuff)ndash Framing amp PPP Protocolndash Error Detection amp Correction ndash ARQ

bull Self study topics (see Ch2 amp slides)

Binary Encodingbull Binary Encoding turn the binary data (bits) into

signals to transmit on cable or optical fiber link (physical layer stuff but better to know)

bull Baseband not modulate to high frequencybull Nonreturn To Zero (NRZ) 1=high signal 0=low

signalndash May stay on high or low signal too long for a long strings

of consecutive 1s or 0s =gt baseline wander clock recovery problems

bull Nonreturn to Zero Inverted (NRZI) 1 = signal transition (low to high or high to low) 0=no changendash Solve the problem of consecutive 1s but not

consecutive 0s

Manchester Encoding bull Manchester Encoding NRZ_encode data XOR clock

ndash Clock cycle (a lowhigh pair) = 2 x signal intervalndash Baud rate (the signal change rate) = 2 x bitratendash 0 =high-to-low transition 1 = low-to-high transitionndash Clock recovery

bull Variation Differential Manchesterndash 1 = the first half of the signal equal to the last half of the previous

bitrsquos signalndash 0 = the first half of the signal opposite to the last half of the

previous bitrsquos signal

1 1101 0000 11 0Bits

NRZ

Clock

Manchester

NRZI

Point-to-Point Data Link Protocolbull Two types of links

ndash point-to-point link (easier than broadcast link)bull one sender one receiver on the link NO Media

Access Controlbull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)bull popular point-to-point DLC protocols

ndash PPP (point-to-point protocol) byte-orientedbull PPP for dial-up accessbull PPP over Ethernet (DSL)

ndash HDLC (High level data link control) bit-oriented

PPPModem

PPP Functionsbull Framing encapsulation of network-layer datagram in

data link frame ndash Identify what set of bits constitute a frame that is

determining the beginning and the end of a framebull carry data of any network layer protocol (not just IP) at

same timendash ability to demultiplex upwards

bull bit transparency must carry any bit pattern in the data field

bull error detection (no correction)bull connection liveness detect signal link failure to

network layerbull network layer address negotiation endpoint can

learnconfigure each otherrsquos network addressbull PPP

ndash no error correctionrecoveryndash no flow controlndash out of order delivery OK ndash no need to support multipoint links (eg polling)

PPP Data Framebull Flag delimiter (framing)bull Address bull Control bull Protocol upper layer protocol to which frame carried (eg

IP)bull Info upper layer databull Check CRC

01111110 11111111 00000011 protocol info CRC 01111110

flag

Octet 1

controladdress

1 or 21 variable 2 or 41 1

Byte Stuffbull ldquodata transparencyrdquorequirement data field

must be allowed to include flag pattern lt01111110gtndash Q is received lt01111110gt data or flag

bull Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byte

bull Receiverndash two 01111110 bytes in a row discard first byte

continue data receptionndash single 01111110 flag byte

PPP Link Control Protocol (LCP)

bull Before exchanging network-layer data data link peers mustndash configure PPP link (max frame length

authentication)bull learnconfigure network

ndash layer informationndash for IP carry IP Control Protocol (IPCP)

msgs (protocol field 8021) to configurelearn IP address

High-Level Data Link Control (HDLC) bull Bit oriented protocol view the frame as a collection of

bits does not care byte boundariesbull Sentinel characters 01111110 transmitted as the link is

idle for synchronizationbull Bit stuffing to distinguish the data pattern 01111110 in

the body from the special ldquobeginningendrdquo sequencendash after transmitting any 5 consecutive 1s in body insert a 0ndash 011111xxxx =gt 0111110xxx

01111110 Header body CRC 01111110

Beginningsequence

Bits 8 variable 1616 8

endingsequence

Error Detectionbull EDC= Error Detection and Correction bits (redundancy)bull D = Data protected by error checking may include header fields bull Error detection not 100 reliable

ndash protocol may miss some errors but rarelyndash larger EDC field yields better detection and correction

Parity Checkingbull Single Bit Parity

ndash Detect single bit errors

bull Two Dimensional Bit Parityndash Detect and correct

single bit error

Internet Checksum

Senderbull treat segment

contents as sequence of 16-bit integers

bull checksum addition (1rsquos complement sum) of segment contents and take the ones complement of the result

bull sender puts checksum value into UDP checksum field

Receiverbull compute checksum

of received segmentbull check if computed

checksum equals checksum field valuendash NO -error detectedndash YES -no error

detected But maybe errors (internet checksum not very strong for error detection but simple)

bull Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer)

Cyclic Redundancy Check (CRC)bull A (n+1)-bit message M can be represented as a

polynomial of degree n For example ndash X = 10011010 ndash M(X) = X7 + X4 + X3 + X

bull Choose k+1 bit pattern (divisor) C(X) a polyn of degree k

bull goal get k CRC bits Y such thatndash P=ltMYgt exactly divisible by C (modulo 2) ndash receiver knows C divides ltMYgt by C If non-zero

remainder error detectedndash can detect all burst errors less than k+1 bits

M data bits to be sent Y CRC

n bits k bits

M x 2k XOR R

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 4: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Link Layer Servicesbull Data-link layer transfer datagram from

one node to adjacent node over a linkndash Framing encapsulate datagram into frame

adding header trailer bull Identify what set of bits constitute a frame that is

determining the beginning and the end of a framendash channel access if shared medium

bull MAC addresses used in frame headers to identify source destination

bull different from IP addressndash Reliable delivery between adjacent nodes

bull Error detection bull Error recovery forward error correction code

retransmission (ARQ)

Link Layer Communicationbull Link layer implemented in adaptor (NIC) and driver (Ethernet

card WLAN card)bull Sending side encapsulates higher layer payload in a frame

adds error checking bits flow control etcbull Receiving side error detection flow control extracts payload

passes to the receiving node

CPU

Cache

Memory

Control status register

Bus interface

Linkinterface

Host

NIC

IObus

Network

Datagram

Frame

Adaptor

Sendingnode

Datagram

Frame

Adaptor

Recvnode

Link layer protocol

Layer 2 vs Layer 3

bull Layer 2 switchingndash Based on MAC

addressndash Self configuring and

plug amp playndash Transparent to

protocols above the MAC layer

ndash Fast and inexpensivendash Does not limit the

scope of broadcasts ndash Does not scale to

extremely large networks

bull Layer 3 routingndash Based on IP addressndash Must get IP address

(DHCP or manual assign)

ndash Easily connect LANs that uses different link protocols

ndash Scalable to large network by subnet routing

ndash Broadcast limited only in a subnet

bull Link Layer Techniquesndash Encoding (more Physical Layer stuff)ndash Framing amp PPP Protocolndash Error Detection amp Correction ndash ARQ

bull Self study topics (see Ch2 amp slides)

Binary Encodingbull Binary Encoding turn the binary data (bits) into

signals to transmit on cable or optical fiber link (physical layer stuff but better to know)

bull Baseband not modulate to high frequencybull Nonreturn To Zero (NRZ) 1=high signal 0=low

signalndash May stay on high or low signal too long for a long strings

of consecutive 1s or 0s =gt baseline wander clock recovery problems

bull Nonreturn to Zero Inverted (NRZI) 1 = signal transition (low to high or high to low) 0=no changendash Solve the problem of consecutive 1s but not

consecutive 0s

Manchester Encoding bull Manchester Encoding NRZ_encode data XOR clock

ndash Clock cycle (a lowhigh pair) = 2 x signal intervalndash Baud rate (the signal change rate) = 2 x bitratendash 0 =high-to-low transition 1 = low-to-high transitionndash Clock recovery

bull Variation Differential Manchesterndash 1 = the first half of the signal equal to the last half of the previous

bitrsquos signalndash 0 = the first half of the signal opposite to the last half of the

previous bitrsquos signal

1 1101 0000 11 0Bits

NRZ

Clock

Manchester

NRZI

Point-to-Point Data Link Protocolbull Two types of links

ndash point-to-point link (easier than broadcast link)bull one sender one receiver on the link NO Media

Access Controlbull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)bull popular point-to-point DLC protocols

ndash PPP (point-to-point protocol) byte-orientedbull PPP for dial-up accessbull PPP over Ethernet (DSL)

ndash HDLC (High level data link control) bit-oriented

PPPModem

PPP Functionsbull Framing encapsulation of network-layer datagram in

data link frame ndash Identify what set of bits constitute a frame that is

determining the beginning and the end of a framebull carry data of any network layer protocol (not just IP) at

same timendash ability to demultiplex upwards

bull bit transparency must carry any bit pattern in the data field

bull error detection (no correction)bull connection liveness detect signal link failure to

network layerbull network layer address negotiation endpoint can

learnconfigure each otherrsquos network addressbull PPP

ndash no error correctionrecoveryndash no flow controlndash out of order delivery OK ndash no need to support multipoint links (eg polling)

PPP Data Framebull Flag delimiter (framing)bull Address bull Control bull Protocol upper layer protocol to which frame carried (eg

IP)bull Info upper layer databull Check CRC

01111110 11111111 00000011 protocol info CRC 01111110

flag

Octet 1

controladdress

1 or 21 variable 2 or 41 1

Byte Stuffbull ldquodata transparencyrdquorequirement data field

must be allowed to include flag pattern lt01111110gtndash Q is received lt01111110gt data or flag

bull Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byte

bull Receiverndash two 01111110 bytes in a row discard first byte

continue data receptionndash single 01111110 flag byte

PPP Link Control Protocol (LCP)

bull Before exchanging network-layer data data link peers mustndash configure PPP link (max frame length

authentication)bull learnconfigure network

ndash layer informationndash for IP carry IP Control Protocol (IPCP)

msgs (protocol field 8021) to configurelearn IP address

High-Level Data Link Control (HDLC) bull Bit oriented protocol view the frame as a collection of

bits does not care byte boundariesbull Sentinel characters 01111110 transmitted as the link is

idle for synchronizationbull Bit stuffing to distinguish the data pattern 01111110 in

the body from the special ldquobeginningendrdquo sequencendash after transmitting any 5 consecutive 1s in body insert a 0ndash 011111xxxx =gt 0111110xxx

01111110 Header body CRC 01111110

Beginningsequence

Bits 8 variable 1616 8

endingsequence

Error Detectionbull EDC= Error Detection and Correction bits (redundancy)bull D = Data protected by error checking may include header fields bull Error detection not 100 reliable

ndash protocol may miss some errors but rarelyndash larger EDC field yields better detection and correction

Parity Checkingbull Single Bit Parity

ndash Detect single bit errors

bull Two Dimensional Bit Parityndash Detect and correct

single bit error

Internet Checksum

Senderbull treat segment

contents as sequence of 16-bit integers

bull checksum addition (1rsquos complement sum) of segment contents and take the ones complement of the result

bull sender puts checksum value into UDP checksum field

Receiverbull compute checksum

of received segmentbull check if computed

checksum equals checksum field valuendash NO -error detectedndash YES -no error

detected But maybe errors (internet checksum not very strong for error detection but simple)

bull Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer)

Cyclic Redundancy Check (CRC)bull A (n+1)-bit message M can be represented as a

polynomial of degree n For example ndash X = 10011010 ndash M(X) = X7 + X4 + X3 + X

bull Choose k+1 bit pattern (divisor) C(X) a polyn of degree k

bull goal get k CRC bits Y such thatndash P=ltMYgt exactly divisible by C (modulo 2) ndash receiver knows C divides ltMYgt by C If non-zero

remainder error detectedndash can detect all burst errors less than k+1 bits

M data bits to be sent Y CRC

n bits k bits

M x 2k XOR R

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 5: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Link Layer Communicationbull Link layer implemented in adaptor (NIC) and driver (Ethernet

card WLAN card)bull Sending side encapsulates higher layer payload in a frame

adds error checking bits flow control etcbull Receiving side error detection flow control extracts payload

passes to the receiving node

CPU

Cache

Memory

Control status register

Bus interface

Linkinterface

Host

NIC

IObus

Network

Datagram

Frame

Adaptor

Sendingnode

Datagram

Frame

Adaptor

Recvnode

Link layer protocol

Layer 2 vs Layer 3

bull Layer 2 switchingndash Based on MAC

addressndash Self configuring and

plug amp playndash Transparent to

protocols above the MAC layer

ndash Fast and inexpensivendash Does not limit the

scope of broadcasts ndash Does not scale to

extremely large networks

bull Layer 3 routingndash Based on IP addressndash Must get IP address

(DHCP or manual assign)

ndash Easily connect LANs that uses different link protocols

ndash Scalable to large network by subnet routing

ndash Broadcast limited only in a subnet

bull Link Layer Techniquesndash Encoding (more Physical Layer stuff)ndash Framing amp PPP Protocolndash Error Detection amp Correction ndash ARQ

bull Self study topics (see Ch2 amp slides)

Binary Encodingbull Binary Encoding turn the binary data (bits) into

signals to transmit on cable or optical fiber link (physical layer stuff but better to know)

bull Baseband not modulate to high frequencybull Nonreturn To Zero (NRZ) 1=high signal 0=low

signalndash May stay on high or low signal too long for a long strings

of consecutive 1s or 0s =gt baseline wander clock recovery problems

bull Nonreturn to Zero Inverted (NRZI) 1 = signal transition (low to high or high to low) 0=no changendash Solve the problem of consecutive 1s but not

consecutive 0s

Manchester Encoding bull Manchester Encoding NRZ_encode data XOR clock

ndash Clock cycle (a lowhigh pair) = 2 x signal intervalndash Baud rate (the signal change rate) = 2 x bitratendash 0 =high-to-low transition 1 = low-to-high transitionndash Clock recovery

bull Variation Differential Manchesterndash 1 = the first half of the signal equal to the last half of the previous

bitrsquos signalndash 0 = the first half of the signal opposite to the last half of the

previous bitrsquos signal

1 1101 0000 11 0Bits

NRZ

Clock

Manchester

NRZI

Point-to-Point Data Link Protocolbull Two types of links

ndash point-to-point link (easier than broadcast link)bull one sender one receiver on the link NO Media

Access Controlbull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)bull popular point-to-point DLC protocols

ndash PPP (point-to-point protocol) byte-orientedbull PPP for dial-up accessbull PPP over Ethernet (DSL)

ndash HDLC (High level data link control) bit-oriented

PPPModem

PPP Functionsbull Framing encapsulation of network-layer datagram in

data link frame ndash Identify what set of bits constitute a frame that is

determining the beginning and the end of a framebull carry data of any network layer protocol (not just IP) at

same timendash ability to demultiplex upwards

bull bit transparency must carry any bit pattern in the data field

bull error detection (no correction)bull connection liveness detect signal link failure to

network layerbull network layer address negotiation endpoint can

learnconfigure each otherrsquos network addressbull PPP

ndash no error correctionrecoveryndash no flow controlndash out of order delivery OK ndash no need to support multipoint links (eg polling)

PPP Data Framebull Flag delimiter (framing)bull Address bull Control bull Protocol upper layer protocol to which frame carried (eg

IP)bull Info upper layer databull Check CRC

01111110 11111111 00000011 protocol info CRC 01111110

flag

Octet 1

controladdress

1 or 21 variable 2 or 41 1

Byte Stuffbull ldquodata transparencyrdquorequirement data field

must be allowed to include flag pattern lt01111110gtndash Q is received lt01111110gt data or flag

bull Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byte

bull Receiverndash two 01111110 bytes in a row discard first byte

continue data receptionndash single 01111110 flag byte

PPP Link Control Protocol (LCP)

bull Before exchanging network-layer data data link peers mustndash configure PPP link (max frame length

authentication)bull learnconfigure network

ndash layer informationndash for IP carry IP Control Protocol (IPCP)

msgs (protocol field 8021) to configurelearn IP address

High-Level Data Link Control (HDLC) bull Bit oriented protocol view the frame as a collection of

bits does not care byte boundariesbull Sentinel characters 01111110 transmitted as the link is

idle for synchronizationbull Bit stuffing to distinguish the data pattern 01111110 in

the body from the special ldquobeginningendrdquo sequencendash after transmitting any 5 consecutive 1s in body insert a 0ndash 011111xxxx =gt 0111110xxx

01111110 Header body CRC 01111110

Beginningsequence

Bits 8 variable 1616 8

endingsequence

Error Detectionbull EDC= Error Detection and Correction bits (redundancy)bull D = Data protected by error checking may include header fields bull Error detection not 100 reliable

ndash protocol may miss some errors but rarelyndash larger EDC field yields better detection and correction

Parity Checkingbull Single Bit Parity

ndash Detect single bit errors

bull Two Dimensional Bit Parityndash Detect and correct

single bit error

Internet Checksum

Senderbull treat segment

contents as sequence of 16-bit integers

bull checksum addition (1rsquos complement sum) of segment contents and take the ones complement of the result

bull sender puts checksum value into UDP checksum field

Receiverbull compute checksum

of received segmentbull check if computed

checksum equals checksum field valuendash NO -error detectedndash YES -no error

detected But maybe errors (internet checksum not very strong for error detection but simple)

bull Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer)

Cyclic Redundancy Check (CRC)bull A (n+1)-bit message M can be represented as a

polynomial of degree n For example ndash X = 10011010 ndash M(X) = X7 + X4 + X3 + X

bull Choose k+1 bit pattern (divisor) C(X) a polyn of degree k

bull goal get k CRC bits Y such thatndash P=ltMYgt exactly divisible by C (modulo 2) ndash receiver knows C divides ltMYgt by C If non-zero

remainder error detectedndash can detect all burst errors less than k+1 bits

M data bits to be sent Y CRC

n bits k bits

M x 2k XOR R

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 6: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Layer 2 vs Layer 3

bull Layer 2 switchingndash Based on MAC

addressndash Self configuring and

plug amp playndash Transparent to

protocols above the MAC layer

ndash Fast and inexpensivendash Does not limit the

scope of broadcasts ndash Does not scale to

extremely large networks

bull Layer 3 routingndash Based on IP addressndash Must get IP address

(DHCP or manual assign)

ndash Easily connect LANs that uses different link protocols

ndash Scalable to large network by subnet routing

ndash Broadcast limited only in a subnet

bull Link Layer Techniquesndash Encoding (more Physical Layer stuff)ndash Framing amp PPP Protocolndash Error Detection amp Correction ndash ARQ

bull Self study topics (see Ch2 amp slides)

Binary Encodingbull Binary Encoding turn the binary data (bits) into

signals to transmit on cable or optical fiber link (physical layer stuff but better to know)

bull Baseband not modulate to high frequencybull Nonreturn To Zero (NRZ) 1=high signal 0=low

signalndash May stay on high or low signal too long for a long strings

of consecutive 1s or 0s =gt baseline wander clock recovery problems

bull Nonreturn to Zero Inverted (NRZI) 1 = signal transition (low to high or high to low) 0=no changendash Solve the problem of consecutive 1s but not

consecutive 0s

Manchester Encoding bull Manchester Encoding NRZ_encode data XOR clock

ndash Clock cycle (a lowhigh pair) = 2 x signal intervalndash Baud rate (the signal change rate) = 2 x bitratendash 0 =high-to-low transition 1 = low-to-high transitionndash Clock recovery

bull Variation Differential Manchesterndash 1 = the first half of the signal equal to the last half of the previous

bitrsquos signalndash 0 = the first half of the signal opposite to the last half of the

previous bitrsquos signal

1 1101 0000 11 0Bits

NRZ

Clock

Manchester

NRZI

Point-to-Point Data Link Protocolbull Two types of links

ndash point-to-point link (easier than broadcast link)bull one sender one receiver on the link NO Media

Access Controlbull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)bull popular point-to-point DLC protocols

ndash PPP (point-to-point protocol) byte-orientedbull PPP for dial-up accessbull PPP over Ethernet (DSL)

ndash HDLC (High level data link control) bit-oriented

PPPModem

PPP Functionsbull Framing encapsulation of network-layer datagram in

data link frame ndash Identify what set of bits constitute a frame that is

determining the beginning and the end of a framebull carry data of any network layer protocol (not just IP) at

same timendash ability to demultiplex upwards

bull bit transparency must carry any bit pattern in the data field

bull error detection (no correction)bull connection liveness detect signal link failure to

network layerbull network layer address negotiation endpoint can

learnconfigure each otherrsquos network addressbull PPP

ndash no error correctionrecoveryndash no flow controlndash out of order delivery OK ndash no need to support multipoint links (eg polling)

PPP Data Framebull Flag delimiter (framing)bull Address bull Control bull Protocol upper layer protocol to which frame carried (eg

IP)bull Info upper layer databull Check CRC

01111110 11111111 00000011 protocol info CRC 01111110

flag

Octet 1

controladdress

1 or 21 variable 2 or 41 1

Byte Stuffbull ldquodata transparencyrdquorequirement data field

must be allowed to include flag pattern lt01111110gtndash Q is received lt01111110gt data or flag

bull Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byte

bull Receiverndash two 01111110 bytes in a row discard first byte

continue data receptionndash single 01111110 flag byte

PPP Link Control Protocol (LCP)

bull Before exchanging network-layer data data link peers mustndash configure PPP link (max frame length

authentication)bull learnconfigure network

ndash layer informationndash for IP carry IP Control Protocol (IPCP)

msgs (protocol field 8021) to configurelearn IP address

High-Level Data Link Control (HDLC) bull Bit oriented protocol view the frame as a collection of

bits does not care byte boundariesbull Sentinel characters 01111110 transmitted as the link is

idle for synchronizationbull Bit stuffing to distinguish the data pattern 01111110 in

the body from the special ldquobeginningendrdquo sequencendash after transmitting any 5 consecutive 1s in body insert a 0ndash 011111xxxx =gt 0111110xxx

01111110 Header body CRC 01111110

Beginningsequence

Bits 8 variable 1616 8

endingsequence

Error Detectionbull EDC= Error Detection and Correction bits (redundancy)bull D = Data protected by error checking may include header fields bull Error detection not 100 reliable

ndash protocol may miss some errors but rarelyndash larger EDC field yields better detection and correction

Parity Checkingbull Single Bit Parity

ndash Detect single bit errors

bull Two Dimensional Bit Parityndash Detect and correct

single bit error

Internet Checksum

Senderbull treat segment

contents as sequence of 16-bit integers

bull checksum addition (1rsquos complement sum) of segment contents and take the ones complement of the result

bull sender puts checksum value into UDP checksum field

Receiverbull compute checksum

of received segmentbull check if computed

checksum equals checksum field valuendash NO -error detectedndash YES -no error

detected But maybe errors (internet checksum not very strong for error detection but simple)

bull Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer)

Cyclic Redundancy Check (CRC)bull A (n+1)-bit message M can be represented as a

polynomial of degree n For example ndash X = 10011010 ndash M(X) = X7 + X4 + X3 + X

bull Choose k+1 bit pattern (divisor) C(X) a polyn of degree k

bull goal get k CRC bits Y such thatndash P=ltMYgt exactly divisible by C (modulo 2) ndash receiver knows C divides ltMYgt by C If non-zero

remainder error detectedndash can detect all burst errors less than k+1 bits

M data bits to be sent Y CRC

n bits k bits

M x 2k XOR R

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 7: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

bull Link Layer Techniquesndash Encoding (more Physical Layer stuff)ndash Framing amp PPP Protocolndash Error Detection amp Correction ndash ARQ

bull Self study topics (see Ch2 amp slides)

Binary Encodingbull Binary Encoding turn the binary data (bits) into

signals to transmit on cable or optical fiber link (physical layer stuff but better to know)

bull Baseband not modulate to high frequencybull Nonreturn To Zero (NRZ) 1=high signal 0=low

signalndash May stay on high or low signal too long for a long strings

of consecutive 1s or 0s =gt baseline wander clock recovery problems

bull Nonreturn to Zero Inverted (NRZI) 1 = signal transition (low to high or high to low) 0=no changendash Solve the problem of consecutive 1s but not

consecutive 0s

Manchester Encoding bull Manchester Encoding NRZ_encode data XOR clock

ndash Clock cycle (a lowhigh pair) = 2 x signal intervalndash Baud rate (the signal change rate) = 2 x bitratendash 0 =high-to-low transition 1 = low-to-high transitionndash Clock recovery

bull Variation Differential Manchesterndash 1 = the first half of the signal equal to the last half of the previous

bitrsquos signalndash 0 = the first half of the signal opposite to the last half of the

previous bitrsquos signal

1 1101 0000 11 0Bits

NRZ

Clock

Manchester

NRZI

Point-to-Point Data Link Protocolbull Two types of links

ndash point-to-point link (easier than broadcast link)bull one sender one receiver on the link NO Media

Access Controlbull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)bull popular point-to-point DLC protocols

ndash PPP (point-to-point protocol) byte-orientedbull PPP for dial-up accessbull PPP over Ethernet (DSL)

ndash HDLC (High level data link control) bit-oriented

PPPModem

PPP Functionsbull Framing encapsulation of network-layer datagram in

data link frame ndash Identify what set of bits constitute a frame that is

determining the beginning and the end of a framebull carry data of any network layer protocol (not just IP) at

same timendash ability to demultiplex upwards

bull bit transparency must carry any bit pattern in the data field

bull error detection (no correction)bull connection liveness detect signal link failure to

network layerbull network layer address negotiation endpoint can

learnconfigure each otherrsquos network addressbull PPP

ndash no error correctionrecoveryndash no flow controlndash out of order delivery OK ndash no need to support multipoint links (eg polling)

PPP Data Framebull Flag delimiter (framing)bull Address bull Control bull Protocol upper layer protocol to which frame carried (eg

IP)bull Info upper layer databull Check CRC

01111110 11111111 00000011 protocol info CRC 01111110

flag

Octet 1

controladdress

1 or 21 variable 2 or 41 1

Byte Stuffbull ldquodata transparencyrdquorequirement data field

must be allowed to include flag pattern lt01111110gtndash Q is received lt01111110gt data or flag

bull Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byte

bull Receiverndash two 01111110 bytes in a row discard first byte

continue data receptionndash single 01111110 flag byte

PPP Link Control Protocol (LCP)

bull Before exchanging network-layer data data link peers mustndash configure PPP link (max frame length

authentication)bull learnconfigure network

ndash layer informationndash for IP carry IP Control Protocol (IPCP)

msgs (protocol field 8021) to configurelearn IP address

High-Level Data Link Control (HDLC) bull Bit oriented protocol view the frame as a collection of

bits does not care byte boundariesbull Sentinel characters 01111110 transmitted as the link is

idle for synchronizationbull Bit stuffing to distinguish the data pattern 01111110 in

the body from the special ldquobeginningendrdquo sequencendash after transmitting any 5 consecutive 1s in body insert a 0ndash 011111xxxx =gt 0111110xxx

01111110 Header body CRC 01111110

Beginningsequence

Bits 8 variable 1616 8

endingsequence

Error Detectionbull EDC= Error Detection and Correction bits (redundancy)bull D = Data protected by error checking may include header fields bull Error detection not 100 reliable

ndash protocol may miss some errors but rarelyndash larger EDC field yields better detection and correction

Parity Checkingbull Single Bit Parity

ndash Detect single bit errors

bull Two Dimensional Bit Parityndash Detect and correct

single bit error

Internet Checksum

Senderbull treat segment

contents as sequence of 16-bit integers

bull checksum addition (1rsquos complement sum) of segment contents and take the ones complement of the result

bull sender puts checksum value into UDP checksum field

Receiverbull compute checksum

of received segmentbull check if computed

checksum equals checksum field valuendash NO -error detectedndash YES -no error

detected But maybe errors (internet checksum not very strong for error detection but simple)

bull Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer)

Cyclic Redundancy Check (CRC)bull A (n+1)-bit message M can be represented as a

polynomial of degree n For example ndash X = 10011010 ndash M(X) = X7 + X4 + X3 + X

bull Choose k+1 bit pattern (divisor) C(X) a polyn of degree k

bull goal get k CRC bits Y such thatndash P=ltMYgt exactly divisible by C (modulo 2) ndash receiver knows C divides ltMYgt by C If non-zero

remainder error detectedndash can detect all burst errors less than k+1 bits

M data bits to be sent Y CRC

n bits k bits

M x 2k XOR R

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 8: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Binary Encodingbull Binary Encoding turn the binary data (bits) into

signals to transmit on cable or optical fiber link (physical layer stuff but better to know)

bull Baseband not modulate to high frequencybull Nonreturn To Zero (NRZ) 1=high signal 0=low

signalndash May stay on high or low signal too long for a long strings

of consecutive 1s or 0s =gt baseline wander clock recovery problems

bull Nonreturn to Zero Inverted (NRZI) 1 = signal transition (low to high or high to low) 0=no changendash Solve the problem of consecutive 1s but not

consecutive 0s

Manchester Encoding bull Manchester Encoding NRZ_encode data XOR clock

ndash Clock cycle (a lowhigh pair) = 2 x signal intervalndash Baud rate (the signal change rate) = 2 x bitratendash 0 =high-to-low transition 1 = low-to-high transitionndash Clock recovery

bull Variation Differential Manchesterndash 1 = the first half of the signal equal to the last half of the previous

bitrsquos signalndash 0 = the first half of the signal opposite to the last half of the

previous bitrsquos signal

1 1101 0000 11 0Bits

NRZ

Clock

Manchester

NRZI

Point-to-Point Data Link Protocolbull Two types of links

ndash point-to-point link (easier than broadcast link)bull one sender one receiver on the link NO Media

Access Controlbull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)bull popular point-to-point DLC protocols

ndash PPP (point-to-point protocol) byte-orientedbull PPP for dial-up accessbull PPP over Ethernet (DSL)

ndash HDLC (High level data link control) bit-oriented

PPPModem

PPP Functionsbull Framing encapsulation of network-layer datagram in

data link frame ndash Identify what set of bits constitute a frame that is

determining the beginning and the end of a framebull carry data of any network layer protocol (not just IP) at

same timendash ability to demultiplex upwards

bull bit transparency must carry any bit pattern in the data field

bull error detection (no correction)bull connection liveness detect signal link failure to

network layerbull network layer address negotiation endpoint can

learnconfigure each otherrsquos network addressbull PPP

ndash no error correctionrecoveryndash no flow controlndash out of order delivery OK ndash no need to support multipoint links (eg polling)

PPP Data Framebull Flag delimiter (framing)bull Address bull Control bull Protocol upper layer protocol to which frame carried (eg

IP)bull Info upper layer databull Check CRC

01111110 11111111 00000011 protocol info CRC 01111110

flag

Octet 1

controladdress

1 or 21 variable 2 or 41 1

Byte Stuffbull ldquodata transparencyrdquorequirement data field

must be allowed to include flag pattern lt01111110gtndash Q is received lt01111110gt data or flag

bull Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byte

bull Receiverndash two 01111110 bytes in a row discard first byte

continue data receptionndash single 01111110 flag byte

PPP Link Control Protocol (LCP)

bull Before exchanging network-layer data data link peers mustndash configure PPP link (max frame length

authentication)bull learnconfigure network

ndash layer informationndash for IP carry IP Control Protocol (IPCP)

msgs (protocol field 8021) to configurelearn IP address

High-Level Data Link Control (HDLC) bull Bit oriented protocol view the frame as a collection of

bits does not care byte boundariesbull Sentinel characters 01111110 transmitted as the link is

idle for synchronizationbull Bit stuffing to distinguish the data pattern 01111110 in

the body from the special ldquobeginningendrdquo sequencendash after transmitting any 5 consecutive 1s in body insert a 0ndash 011111xxxx =gt 0111110xxx

01111110 Header body CRC 01111110

Beginningsequence

Bits 8 variable 1616 8

endingsequence

Error Detectionbull EDC= Error Detection and Correction bits (redundancy)bull D = Data protected by error checking may include header fields bull Error detection not 100 reliable

ndash protocol may miss some errors but rarelyndash larger EDC field yields better detection and correction

Parity Checkingbull Single Bit Parity

ndash Detect single bit errors

bull Two Dimensional Bit Parityndash Detect and correct

single bit error

Internet Checksum

Senderbull treat segment

contents as sequence of 16-bit integers

bull checksum addition (1rsquos complement sum) of segment contents and take the ones complement of the result

bull sender puts checksum value into UDP checksum field

Receiverbull compute checksum

of received segmentbull check if computed

checksum equals checksum field valuendash NO -error detectedndash YES -no error

detected But maybe errors (internet checksum not very strong for error detection but simple)

bull Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer)

Cyclic Redundancy Check (CRC)bull A (n+1)-bit message M can be represented as a

polynomial of degree n For example ndash X = 10011010 ndash M(X) = X7 + X4 + X3 + X

bull Choose k+1 bit pattern (divisor) C(X) a polyn of degree k

bull goal get k CRC bits Y such thatndash P=ltMYgt exactly divisible by C (modulo 2) ndash receiver knows C divides ltMYgt by C If non-zero

remainder error detectedndash can detect all burst errors less than k+1 bits

M data bits to be sent Y CRC

n bits k bits

M x 2k XOR R

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 9: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Manchester Encoding bull Manchester Encoding NRZ_encode data XOR clock

ndash Clock cycle (a lowhigh pair) = 2 x signal intervalndash Baud rate (the signal change rate) = 2 x bitratendash 0 =high-to-low transition 1 = low-to-high transitionndash Clock recovery

bull Variation Differential Manchesterndash 1 = the first half of the signal equal to the last half of the previous

bitrsquos signalndash 0 = the first half of the signal opposite to the last half of the

previous bitrsquos signal

1 1101 0000 11 0Bits

NRZ

Clock

Manchester

NRZI

Point-to-Point Data Link Protocolbull Two types of links

ndash point-to-point link (easier than broadcast link)bull one sender one receiver on the link NO Media

Access Controlbull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)bull popular point-to-point DLC protocols

ndash PPP (point-to-point protocol) byte-orientedbull PPP for dial-up accessbull PPP over Ethernet (DSL)

ndash HDLC (High level data link control) bit-oriented

PPPModem

PPP Functionsbull Framing encapsulation of network-layer datagram in

data link frame ndash Identify what set of bits constitute a frame that is

determining the beginning and the end of a framebull carry data of any network layer protocol (not just IP) at

same timendash ability to demultiplex upwards

bull bit transparency must carry any bit pattern in the data field

bull error detection (no correction)bull connection liveness detect signal link failure to

network layerbull network layer address negotiation endpoint can

learnconfigure each otherrsquos network addressbull PPP

ndash no error correctionrecoveryndash no flow controlndash out of order delivery OK ndash no need to support multipoint links (eg polling)

PPP Data Framebull Flag delimiter (framing)bull Address bull Control bull Protocol upper layer protocol to which frame carried (eg

IP)bull Info upper layer databull Check CRC

01111110 11111111 00000011 protocol info CRC 01111110

flag

Octet 1

controladdress

1 or 21 variable 2 or 41 1

Byte Stuffbull ldquodata transparencyrdquorequirement data field

must be allowed to include flag pattern lt01111110gtndash Q is received lt01111110gt data or flag

bull Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byte

bull Receiverndash two 01111110 bytes in a row discard first byte

continue data receptionndash single 01111110 flag byte

PPP Link Control Protocol (LCP)

bull Before exchanging network-layer data data link peers mustndash configure PPP link (max frame length

authentication)bull learnconfigure network

ndash layer informationndash for IP carry IP Control Protocol (IPCP)

msgs (protocol field 8021) to configurelearn IP address

High-Level Data Link Control (HDLC) bull Bit oriented protocol view the frame as a collection of

bits does not care byte boundariesbull Sentinel characters 01111110 transmitted as the link is

idle for synchronizationbull Bit stuffing to distinguish the data pattern 01111110 in

the body from the special ldquobeginningendrdquo sequencendash after transmitting any 5 consecutive 1s in body insert a 0ndash 011111xxxx =gt 0111110xxx

01111110 Header body CRC 01111110

Beginningsequence

Bits 8 variable 1616 8

endingsequence

Error Detectionbull EDC= Error Detection and Correction bits (redundancy)bull D = Data protected by error checking may include header fields bull Error detection not 100 reliable

ndash protocol may miss some errors but rarelyndash larger EDC field yields better detection and correction

Parity Checkingbull Single Bit Parity

ndash Detect single bit errors

bull Two Dimensional Bit Parityndash Detect and correct

single bit error

Internet Checksum

Senderbull treat segment

contents as sequence of 16-bit integers

bull checksum addition (1rsquos complement sum) of segment contents and take the ones complement of the result

bull sender puts checksum value into UDP checksum field

Receiverbull compute checksum

of received segmentbull check if computed

checksum equals checksum field valuendash NO -error detectedndash YES -no error

detected But maybe errors (internet checksum not very strong for error detection but simple)

bull Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer)

Cyclic Redundancy Check (CRC)bull A (n+1)-bit message M can be represented as a

polynomial of degree n For example ndash X = 10011010 ndash M(X) = X7 + X4 + X3 + X

bull Choose k+1 bit pattern (divisor) C(X) a polyn of degree k

bull goal get k CRC bits Y such thatndash P=ltMYgt exactly divisible by C (modulo 2) ndash receiver knows C divides ltMYgt by C If non-zero

remainder error detectedndash can detect all burst errors less than k+1 bits

M data bits to be sent Y CRC

n bits k bits

M x 2k XOR R

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 10: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Point-to-Point Data Link Protocolbull Two types of links

ndash point-to-point link (easier than broadcast link)bull one sender one receiver on the link NO Media

Access Controlbull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)bull popular point-to-point DLC protocols

ndash PPP (point-to-point protocol) byte-orientedbull PPP for dial-up accessbull PPP over Ethernet (DSL)

ndash HDLC (High level data link control) bit-oriented

PPPModem

PPP Functionsbull Framing encapsulation of network-layer datagram in

data link frame ndash Identify what set of bits constitute a frame that is

determining the beginning and the end of a framebull carry data of any network layer protocol (not just IP) at

same timendash ability to demultiplex upwards

bull bit transparency must carry any bit pattern in the data field

bull error detection (no correction)bull connection liveness detect signal link failure to

network layerbull network layer address negotiation endpoint can

learnconfigure each otherrsquos network addressbull PPP

ndash no error correctionrecoveryndash no flow controlndash out of order delivery OK ndash no need to support multipoint links (eg polling)

PPP Data Framebull Flag delimiter (framing)bull Address bull Control bull Protocol upper layer protocol to which frame carried (eg

IP)bull Info upper layer databull Check CRC

01111110 11111111 00000011 protocol info CRC 01111110

flag

Octet 1

controladdress

1 or 21 variable 2 or 41 1

Byte Stuffbull ldquodata transparencyrdquorequirement data field

must be allowed to include flag pattern lt01111110gtndash Q is received lt01111110gt data or flag

bull Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byte

bull Receiverndash two 01111110 bytes in a row discard first byte

continue data receptionndash single 01111110 flag byte

PPP Link Control Protocol (LCP)

bull Before exchanging network-layer data data link peers mustndash configure PPP link (max frame length

authentication)bull learnconfigure network

ndash layer informationndash for IP carry IP Control Protocol (IPCP)

msgs (protocol field 8021) to configurelearn IP address

High-Level Data Link Control (HDLC) bull Bit oriented protocol view the frame as a collection of

bits does not care byte boundariesbull Sentinel characters 01111110 transmitted as the link is

idle for synchronizationbull Bit stuffing to distinguish the data pattern 01111110 in

the body from the special ldquobeginningendrdquo sequencendash after transmitting any 5 consecutive 1s in body insert a 0ndash 011111xxxx =gt 0111110xxx

01111110 Header body CRC 01111110

Beginningsequence

Bits 8 variable 1616 8

endingsequence

Error Detectionbull EDC= Error Detection and Correction bits (redundancy)bull D = Data protected by error checking may include header fields bull Error detection not 100 reliable

ndash protocol may miss some errors but rarelyndash larger EDC field yields better detection and correction

Parity Checkingbull Single Bit Parity

ndash Detect single bit errors

bull Two Dimensional Bit Parityndash Detect and correct

single bit error

Internet Checksum

Senderbull treat segment

contents as sequence of 16-bit integers

bull checksum addition (1rsquos complement sum) of segment contents and take the ones complement of the result

bull sender puts checksum value into UDP checksum field

Receiverbull compute checksum

of received segmentbull check if computed

checksum equals checksum field valuendash NO -error detectedndash YES -no error

detected But maybe errors (internet checksum not very strong for error detection but simple)

bull Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer)

Cyclic Redundancy Check (CRC)bull A (n+1)-bit message M can be represented as a

polynomial of degree n For example ndash X = 10011010 ndash M(X) = X7 + X4 + X3 + X

bull Choose k+1 bit pattern (divisor) C(X) a polyn of degree k

bull goal get k CRC bits Y such thatndash P=ltMYgt exactly divisible by C (modulo 2) ndash receiver knows C divides ltMYgt by C If non-zero

remainder error detectedndash can detect all burst errors less than k+1 bits

M data bits to be sent Y CRC

n bits k bits

M x 2k XOR R

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 11: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

PPP Functionsbull Framing encapsulation of network-layer datagram in

data link frame ndash Identify what set of bits constitute a frame that is

determining the beginning and the end of a framebull carry data of any network layer protocol (not just IP) at

same timendash ability to demultiplex upwards

bull bit transparency must carry any bit pattern in the data field

bull error detection (no correction)bull connection liveness detect signal link failure to

network layerbull network layer address negotiation endpoint can

learnconfigure each otherrsquos network addressbull PPP

ndash no error correctionrecoveryndash no flow controlndash out of order delivery OK ndash no need to support multipoint links (eg polling)

PPP Data Framebull Flag delimiter (framing)bull Address bull Control bull Protocol upper layer protocol to which frame carried (eg

IP)bull Info upper layer databull Check CRC

01111110 11111111 00000011 protocol info CRC 01111110

flag

Octet 1

controladdress

1 or 21 variable 2 or 41 1

Byte Stuffbull ldquodata transparencyrdquorequirement data field

must be allowed to include flag pattern lt01111110gtndash Q is received lt01111110gt data or flag

bull Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byte

bull Receiverndash two 01111110 bytes in a row discard first byte

continue data receptionndash single 01111110 flag byte

PPP Link Control Protocol (LCP)

bull Before exchanging network-layer data data link peers mustndash configure PPP link (max frame length

authentication)bull learnconfigure network

ndash layer informationndash for IP carry IP Control Protocol (IPCP)

msgs (protocol field 8021) to configurelearn IP address

High-Level Data Link Control (HDLC) bull Bit oriented protocol view the frame as a collection of

bits does not care byte boundariesbull Sentinel characters 01111110 transmitted as the link is

idle for synchronizationbull Bit stuffing to distinguish the data pattern 01111110 in

the body from the special ldquobeginningendrdquo sequencendash after transmitting any 5 consecutive 1s in body insert a 0ndash 011111xxxx =gt 0111110xxx

01111110 Header body CRC 01111110

Beginningsequence

Bits 8 variable 1616 8

endingsequence

Error Detectionbull EDC= Error Detection and Correction bits (redundancy)bull D = Data protected by error checking may include header fields bull Error detection not 100 reliable

ndash protocol may miss some errors but rarelyndash larger EDC field yields better detection and correction

Parity Checkingbull Single Bit Parity

ndash Detect single bit errors

bull Two Dimensional Bit Parityndash Detect and correct

single bit error

Internet Checksum

Senderbull treat segment

contents as sequence of 16-bit integers

bull checksum addition (1rsquos complement sum) of segment contents and take the ones complement of the result

bull sender puts checksum value into UDP checksum field

Receiverbull compute checksum

of received segmentbull check if computed

checksum equals checksum field valuendash NO -error detectedndash YES -no error

detected But maybe errors (internet checksum not very strong for error detection but simple)

bull Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer)

Cyclic Redundancy Check (CRC)bull A (n+1)-bit message M can be represented as a

polynomial of degree n For example ndash X = 10011010 ndash M(X) = X7 + X4 + X3 + X

bull Choose k+1 bit pattern (divisor) C(X) a polyn of degree k

bull goal get k CRC bits Y such thatndash P=ltMYgt exactly divisible by C (modulo 2) ndash receiver knows C divides ltMYgt by C If non-zero

remainder error detectedndash can detect all burst errors less than k+1 bits

M data bits to be sent Y CRC

n bits k bits

M x 2k XOR R

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 12: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

PPP Data Framebull Flag delimiter (framing)bull Address bull Control bull Protocol upper layer protocol to which frame carried (eg

IP)bull Info upper layer databull Check CRC

01111110 11111111 00000011 protocol info CRC 01111110

flag

Octet 1

controladdress

1 or 21 variable 2 or 41 1

Byte Stuffbull ldquodata transparencyrdquorequirement data field

must be allowed to include flag pattern lt01111110gtndash Q is received lt01111110gt data or flag

bull Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byte

bull Receiverndash two 01111110 bytes in a row discard first byte

continue data receptionndash single 01111110 flag byte

PPP Link Control Protocol (LCP)

bull Before exchanging network-layer data data link peers mustndash configure PPP link (max frame length

authentication)bull learnconfigure network

ndash layer informationndash for IP carry IP Control Protocol (IPCP)

msgs (protocol field 8021) to configurelearn IP address

High-Level Data Link Control (HDLC) bull Bit oriented protocol view the frame as a collection of

bits does not care byte boundariesbull Sentinel characters 01111110 transmitted as the link is

idle for synchronizationbull Bit stuffing to distinguish the data pattern 01111110 in

the body from the special ldquobeginningendrdquo sequencendash after transmitting any 5 consecutive 1s in body insert a 0ndash 011111xxxx =gt 0111110xxx

01111110 Header body CRC 01111110

Beginningsequence

Bits 8 variable 1616 8

endingsequence

Error Detectionbull EDC= Error Detection and Correction bits (redundancy)bull D = Data protected by error checking may include header fields bull Error detection not 100 reliable

ndash protocol may miss some errors but rarelyndash larger EDC field yields better detection and correction

Parity Checkingbull Single Bit Parity

ndash Detect single bit errors

bull Two Dimensional Bit Parityndash Detect and correct

single bit error

Internet Checksum

Senderbull treat segment

contents as sequence of 16-bit integers

bull checksum addition (1rsquos complement sum) of segment contents and take the ones complement of the result

bull sender puts checksum value into UDP checksum field

Receiverbull compute checksum

of received segmentbull check if computed

checksum equals checksum field valuendash NO -error detectedndash YES -no error

detected But maybe errors (internet checksum not very strong for error detection but simple)

bull Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer)

Cyclic Redundancy Check (CRC)bull A (n+1)-bit message M can be represented as a

polynomial of degree n For example ndash X = 10011010 ndash M(X) = X7 + X4 + X3 + X

bull Choose k+1 bit pattern (divisor) C(X) a polyn of degree k

bull goal get k CRC bits Y such thatndash P=ltMYgt exactly divisible by C (modulo 2) ndash receiver knows C divides ltMYgt by C If non-zero

remainder error detectedndash can detect all burst errors less than k+1 bits

M data bits to be sent Y CRC

n bits k bits

M x 2k XOR R

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 13: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Byte Stuffbull ldquodata transparencyrdquorequirement data field

must be allowed to include flag pattern lt01111110gtndash Q is received lt01111110gt data or flag

bull Sender adds (ldquostuffsrdquo) extra lt 01111110gt byte after each lt 01111110gt data byte

bull Receiverndash two 01111110 bytes in a row discard first byte

continue data receptionndash single 01111110 flag byte

PPP Link Control Protocol (LCP)

bull Before exchanging network-layer data data link peers mustndash configure PPP link (max frame length

authentication)bull learnconfigure network

ndash layer informationndash for IP carry IP Control Protocol (IPCP)

msgs (protocol field 8021) to configurelearn IP address

High-Level Data Link Control (HDLC) bull Bit oriented protocol view the frame as a collection of

bits does not care byte boundariesbull Sentinel characters 01111110 transmitted as the link is

idle for synchronizationbull Bit stuffing to distinguish the data pattern 01111110 in

the body from the special ldquobeginningendrdquo sequencendash after transmitting any 5 consecutive 1s in body insert a 0ndash 011111xxxx =gt 0111110xxx

01111110 Header body CRC 01111110

Beginningsequence

Bits 8 variable 1616 8

endingsequence

Error Detectionbull EDC= Error Detection and Correction bits (redundancy)bull D = Data protected by error checking may include header fields bull Error detection not 100 reliable

ndash protocol may miss some errors but rarelyndash larger EDC field yields better detection and correction

Parity Checkingbull Single Bit Parity

ndash Detect single bit errors

bull Two Dimensional Bit Parityndash Detect and correct

single bit error

Internet Checksum

Senderbull treat segment

contents as sequence of 16-bit integers

bull checksum addition (1rsquos complement sum) of segment contents and take the ones complement of the result

bull sender puts checksum value into UDP checksum field

Receiverbull compute checksum

of received segmentbull check if computed

checksum equals checksum field valuendash NO -error detectedndash YES -no error

detected But maybe errors (internet checksum not very strong for error detection but simple)

bull Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer)

Cyclic Redundancy Check (CRC)bull A (n+1)-bit message M can be represented as a

polynomial of degree n For example ndash X = 10011010 ndash M(X) = X7 + X4 + X3 + X

bull Choose k+1 bit pattern (divisor) C(X) a polyn of degree k

bull goal get k CRC bits Y such thatndash P=ltMYgt exactly divisible by C (modulo 2) ndash receiver knows C divides ltMYgt by C If non-zero

remainder error detectedndash can detect all burst errors less than k+1 bits

M data bits to be sent Y CRC

n bits k bits

M x 2k XOR R

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 14: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

PPP Link Control Protocol (LCP)

bull Before exchanging network-layer data data link peers mustndash configure PPP link (max frame length

authentication)bull learnconfigure network

ndash layer informationndash for IP carry IP Control Protocol (IPCP)

msgs (protocol field 8021) to configurelearn IP address

High-Level Data Link Control (HDLC) bull Bit oriented protocol view the frame as a collection of

bits does not care byte boundariesbull Sentinel characters 01111110 transmitted as the link is

idle for synchronizationbull Bit stuffing to distinguish the data pattern 01111110 in

the body from the special ldquobeginningendrdquo sequencendash after transmitting any 5 consecutive 1s in body insert a 0ndash 011111xxxx =gt 0111110xxx

01111110 Header body CRC 01111110

Beginningsequence

Bits 8 variable 1616 8

endingsequence

Error Detectionbull EDC= Error Detection and Correction bits (redundancy)bull D = Data protected by error checking may include header fields bull Error detection not 100 reliable

ndash protocol may miss some errors but rarelyndash larger EDC field yields better detection and correction

Parity Checkingbull Single Bit Parity

ndash Detect single bit errors

bull Two Dimensional Bit Parityndash Detect and correct

single bit error

Internet Checksum

Senderbull treat segment

contents as sequence of 16-bit integers

bull checksum addition (1rsquos complement sum) of segment contents and take the ones complement of the result

bull sender puts checksum value into UDP checksum field

Receiverbull compute checksum

of received segmentbull check if computed

checksum equals checksum field valuendash NO -error detectedndash YES -no error

detected But maybe errors (internet checksum not very strong for error detection but simple)

bull Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer)

Cyclic Redundancy Check (CRC)bull A (n+1)-bit message M can be represented as a

polynomial of degree n For example ndash X = 10011010 ndash M(X) = X7 + X4 + X3 + X

bull Choose k+1 bit pattern (divisor) C(X) a polyn of degree k

bull goal get k CRC bits Y such thatndash P=ltMYgt exactly divisible by C (modulo 2) ndash receiver knows C divides ltMYgt by C If non-zero

remainder error detectedndash can detect all burst errors less than k+1 bits

M data bits to be sent Y CRC

n bits k bits

M x 2k XOR R

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 15: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

High-Level Data Link Control (HDLC) bull Bit oriented protocol view the frame as a collection of

bits does not care byte boundariesbull Sentinel characters 01111110 transmitted as the link is

idle for synchronizationbull Bit stuffing to distinguish the data pattern 01111110 in

the body from the special ldquobeginningendrdquo sequencendash after transmitting any 5 consecutive 1s in body insert a 0ndash 011111xxxx =gt 0111110xxx

01111110 Header body CRC 01111110

Beginningsequence

Bits 8 variable 1616 8

endingsequence

Error Detectionbull EDC= Error Detection and Correction bits (redundancy)bull D = Data protected by error checking may include header fields bull Error detection not 100 reliable

ndash protocol may miss some errors but rarelyndash larger EDC field yields better detection and correction

Parity Checkingbull Single Bit Parity

ndash Detect single bit errors

bull Two Dimensional Bit Parityndash Detect and correct

single bit error

Internet Checksum

Senderbull treat segment

contents as sequence of 16-bit integers

bull checksum addition (1rsquos complement sum) of segment contents and take the ones complement of the result

bull sender puts checksum value into UDP checksum field

Receiverbull compute checksum

of received segmentbull check if computed

checksum equals checksum field valuendash NO -error detectedndash YES -no error

detected But maybe errors (internet checksum not very strong for error detection but simple)

bull Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer)

Cyclic Redundancy Check (CRC)bull A (n+1)-bit message M can be represented as a

polynomial of degree n For example ndash X = 10011010 ndash M(X) = X7 + X4 + X3 + X

bull Choose k+1 bit pattern (divisor) C(X) a polyn of degree k

bull goal get k CRC bits Y such thatndash P=ltMYgt exactly divisible by C (modulo 2) ndash receiver knows C divides ltMYgt by C If non-zero

remainder error detectedndash can detect all burst errors less than k+1 bits

M data bits to be sent Y CRC

n bits k bits

M x 2k XOR R

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 16: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Error Detectionbull EDC= Error Detection and Correction bits (redundancy)bull D = Data protected by error checking may include header fields bull Error detection not 100 reliable

ndash protocol may miss some errors but rarelyndash larger EDC field yields better detection and correction

Parity Checkingbull Single Bit Parity

ndash Detect single bit errors

bull Two Dimensional Bit Parityndash Detect and correct

single bit error

Internet Checksum

Senderbull treat segment

contents as sequence of 16-bit integers

bull checksum addition (1rsquos complement sum) of segment contents and take the ones complement of the result

bull sender puts checksum value into UDP checksum field

Receiverbull compute checksum

of received segmentbull check if computed

checksum equals checksum field valuendash NO -error detectedndash YES -no error

detected But maybe errors (internet checksum not very strong for error detection but simple)

bull Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer)

Cyclic Redundancy Check (CRC)bull A (n+1)-bit message M can be represented as a

polynomial of degree n For example ndash X = 10011010 ndash M(X) = X7 + X4 + X3 + X

bull Choose k+1 bit pattern (divisor) C(X) a polyn of degree k

bull goal get k CRC bits Y such thatndash P=ltMYgt exactly divisible by C (modulo 2) ndash receiver knows C divides ltMYgt by C If non-zero

remainder error detectedndash can detect all burst errors less than k+1 bits

M data bits to be sent Y CRC

n bits k bits

M x 2k XOR R

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 17: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Parity Checkingbull Single Bit Parity

ndash Detect single bit errors

bull Two Dimensional Bit Parityndash Detect and correct

single bit error

Internet Checksum

Senderbull treat segment

contents as sequence of 16-bit integers

bull checksum addition (1rsquos complement sum) of segment contents and take the ones complement of the result

bull sender puts checksum value into UDP checksum field

Receiverbull compute checksum

of received segmentbull check if computed

checksum equals checksum field valuendash NO -error detectedndash YES -no error

detected But maybe errors (internet checksum not very strong for error detection but simple)

bull Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer)

Cyclic Redundancy Check (CRC)bull A (n+1)-bit message M can be represented as a

polynomial of degree n For example ndash X = 10011010 ndash M(X) = X7 + X4 + X3 + X

bull Choose k+1 bit pattern (divisor) C(X) a polyn of degree k

bull goal get k CRC bits Y such thatndash P=ltMYgt exactly divisible by C (modulo 2) ndash receiver knows C divides ltMYgt by C If non-zero

remainder error detectedndash can detect all burst errors less than k+1 bits

M data bits to be sent Y CRC

n bits k bits

M x 2k XOR R

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 18: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Internet Checksum

Senderbull treat segment

contents as sequence of 16-bit integers

bull checksum addition (1rsquos complement sum) of segment contents and take the ones complement of the result

bull sender puts checksum value into UDP checksum field

Receiverbull compute checksum

of received segmentbull check if computed

checksum equals checksum field valuendash NO -error detectedndash YES -no error

detected But maybe errors (internet checksum not very strong for error detection but simple)

bull Goal detect ldquoerrorsrdquo (eg flipped bits) in transmitted segment (note used at transport layer)

Cyclic Redundancy Check (CRC)bull A (n+1)-bit message M can be represented as a

polynomial of degree n For example ndash X = 10011010 ndash M(X) = X7 + X4 + X3 + X

bull Choose k+1 bit pattern (divisor) C(X) a polyn of degree k

bull goal get k CRC bits Y such thatndash P=ltMYgt exactly divisible by C (modulo 2) ndash receiver knows C divides ltMYgt by C If non-zero

remainder error detectedndash can detect all burst errors less than k+1 bits

M data bits to be sent Y CRC

n bits k bits

M x 2k XOR R

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 19: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Cyclic Redundancy Check (CRC)bull A (n+1)-bit message M can be represented as a

polynomial of degree n For example ndash X = 10011010 ndash M(X) = X7 + X4 + X3 + X

bull Choose k+1 bit pattern (divisor) C(X) a polyn of degree k

bull goal get k CRC bits Y such thatndash P=ltMYgt exactly divisible by C (modulo 2) ndash receiver knows C divides ltMYgt by C If non-zero

remainder error detectedndash can detect all burst errors less than k+1 bits

M data bits to be sent Y CRC

n bits k bits

M x 2k XOR R

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 20: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

CRC Examplebull Goal design P(X) such that

it is exactly divisible by C(X)bull T(X) = M(X) Xk (add k zerorsquos

to the end of the message)

])()([

XCXTremainderR

bull Subtract the remainder from T(X) to get P(X)ndash P(X) is now exactly divisible by C(X)

bull Corresponding to the complete transmitted message

(Remember ndash all additionsubtract use modulo-2 arithmetic)

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 21: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Automatic Repeat reQuest(ARQ)bull Stop-and-wait ARQ

ndash Transmit a frame and wait for acknowledgendash If positive acknowledge (ACK) from receiver send next framendash If ACK does not arrive after a certain period of time (Timeout) retransmits the

framendash Simple low efficiency

bull Go-back-N ARQndash Transmit frames continuously no waitingndash The receiver only acks the highest-numbered frames received in sequencendash ACK comes back after a round-trip delayndash If timeout the sender retransmits the frames that are not acked and N-1

succeeding frames that were transmitted during the round-trip delay (N frames transmitted during a round-trip delay)

ndash Need buffer at transmitter does not have to buffer the frames at the receiver ndash moderate efficiency and complexity Less efficient when the round-trip delay

is large and data transmission rate is highbull Selective-repeat

ndash Transmit continuously no waitingndash The receiver acks all successfully received frames ndash The sender only retransmits (repeats) the unacked frames when their timers

expirendash Most efficient but most complex buffer needed at both transmitter and

receiver need per frame timer

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 22: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Sliding Window bull Reliable delivery retransmissionbull Ordered delivery preserve the order in

which the frames are transmittedndash Receiver does not pass along (buffer) out-of-

order framesbull Flow control feedback mechanism by which

the receiver is able to throttle the senderndash Inform the sender of how much frames the

receiver has room to receive

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 23: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Sliding Window (Cont)bull Send window size (SWS) the upper bound on the

number of unacked frames that the sender can transmit ndash set according to the round-trip delay to keep the pipe full

(recall bandwidth x delay product represents the amount of data that could be in transit)

bull LAR the sequence of the last ack receivedbull LFS the sequence of the last frame sentbull Receiver window size (RWS) the upper bound on

the number of out-of-order frames that the receiver is willing to accept

bull LAF the sequence of the largest acceptable frame

bull LFR the sequence of the last frame receivedbull SeqNumToAck the largest sequence not yet

acked such that all frames with seq lt= SeqnumToAck have been received

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 24: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Sliding Window

bull LFS-LARlt=SWS LAF-LFRlt=RWSbull Finite Seq wraps around

ndash SWS lt (MaxSeqNum+1)2 when RWS=SWS to distinguish between different incarnations of the same seq

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

1 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 11 12

Sender

Receiver

Ack 1 Ack 2

Error

Ack 2 Ack 3Ack 2 Ack 2Ack 4 Ack 5

Ack 6

SWSLAR LFS

RWSLFR LAF

SeqNumToAck

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 25: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Shared Media Networksbull MAC (medium access control)

ndash ALOHA Slotted ALOHAndash CSMACD CSMACA ndash Token Ringndash TDMA Dynamic TDMAndash FDMA CDMA

bull LAN Technologiesndash IEEE 8023 Ethernet ndash IEEE 8025 Token Ring ndash IEEE 80211 Wireless LAN

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 26: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Medium Access Sublayerbull Medium access control (MAC)

sublayer is not relevant on point-to-point links

bull The MAC sublayer is only used in broadcast or shared mediumchannel networks

bull All communication entities ldquosharerdquo a common channelndash Wired networks Ethernet LANndash Wireless amp Mobile Networks

Satellite Cellular Wireless LAN

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

LLCMAC

Physical

Subnet

IP

TCPUDP

Applications

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 27: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Media Access Protocolbull Shared broadcast channel

ndash two or more simultaneous transmissions by nodes interference

bull Collision if node receives two or more signals at the same time

bull MAC protocolndash Determines how nodes share channel ie determine

when node can transmit

bull Ideally if broadcast channel of rate R bpsndash When one node wants to transmit it can send at rate Rndash When M nodes want to transmit each can send at

average rate RM (fairness)

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 28: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

MAC Classificationbull Channel Partitioning

ndash divide channel into smaller ldquopiecesrdquo (time slots frequency code)

ndash allocate piece to node for exclusive usebull TDMA CDMA FDMA

bull Random Accessndash channel not divided

bull When node has frame to send transmit with the total channel bandwidth

ndash No coordination between nodes control is completely distributed

ndash two or more nodes transmit simultaneously ldquocollisionrdquondash random access MAC protocol should specify

bull how to detect collisionsbull how to recover from collisions (eg via delayed retransmissions)bull Examples ALOHA Slotted ALOHA CSMACD CSMACA

bull ldquoTaking turnsrdquondash Nodes take turns

bull Token ringbull Hybrid

ndash Combine two or more techniques together

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 29: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Pure (Unslotted) ALOHAbull Early packet radio network created at the

U of Hawaii in 1970bull Uplink channel (clients-gthub) and

downlink channel (hub-gtclients) uses different frequencies

bull Client nodes send data frames to the central hub using the shared uplink channel

bull The hub immediately re-send the received frames allowing clients to determine whether or not their data had been received properly

bull Simplest form of random access provides basis for more advance contention MAC

Hub

Client

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 30: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Aloha Algorithmbull Aloha Algorithm

ndash Nodes transmit immediately whenever they have a frame to send

ndash No synchronization among nodesbull If collision retransmit after random delay

ndash random delay prevents the same frames from colliding over and over again

bull collision window or ldquovulnerable periodrdquondash frame sent at t0 collides with other frames sent in [t0-1t0+1]

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 31: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Pure Aloha efficiencybull Assume that the aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (all nodes in network) in the time interval

bull time-interval = one frame transmission timebull Conditional successful probability for one frame transmission attempt

is ndash P0 = P [0 other attempts in 2 time-intervals] =e-2G

bull The probability of successful transmissionndash S = GP0 = Ge-2G

bull S is optimum at G=12bull S=12e = 0184

kGe kG

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 32: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Slotted Aloha

bull Assumptionsndash all frames same sizendash time is divided into equal size

slots time to transmit 1 framendash nodes start to transmit frames

only at beginning of slotsndash nodes are synchronizedndash if 2 or more nodes transmit in

slot detect collisionndash Feedback channel about

whether packet is received or not (half-duplex)

bull Operationndash when node obtains fresh

frame it transmits at the beginning of next slot

ndash no collision node can send new frame in next slot

ndash if collision wait a random number of slots and try to send again

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 33: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Efficiency of Slotted ALOHAbull Aggregate frame arrival is Poisson Process

bull P [k arrivals in a time-interval] =

bull G the mean number of aggregate arrivals (for all nodes in network) in this interval

bull time-interval = slot (one frame transmission time)bull Successful probability for each slot is

S= P [1 attempt in a slot] =Ge-G

bull S is optimum at G=1bull S=1e = 0368(slotted aloha reduce the potential collision period from 2t to t

by node synchronization)

kGe kG

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 34: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Performance of ALOHA

bull Throughput versus offered traffic for ALOHA systemsbull The main reason for poor channel utilization of ALOHA (pure

or slotted) is that all stations can transmit at will without paying attention to what the other stations are doing

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 35: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Carrier Sense Multiple Access (CSMA)bull CSMA listen before transmit

ndash If channel sensed idle transmit ndash If channel sensed busy defer transmission

bull Human analogy donrsquot interrupt othersbull Can collisions occur in this scheme

ndash Two nodes might attempt to transmit a frame at the same time

ndash Propagation delay means two nodes may not hear each otherrsquos transmission immediately

bull Several variants of CSMA protocolsndash Non-Persistent CSMAndash 1-Persistent CSMAndash P-Persistent CSMA

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 36: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Non-persistent CSMAbull To send data a node first listens to the

channel to see if anyone else is transmitting bull If so the node waits a random period of time

(instead of keeping sensing until the end of the transmission) and repeats the algorithm Otherwise it transmits a frame

bull If a collision occurs the node waits a random amount of time and starts all over again

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 37: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

1-persistent CSMA Algorithm

1 To send data a node first listens to the channel to see if anyone else is transmitting

2 If so the node waits (keeps sensing it) until the channel becomes idle Otherwise it transmits a frame

3 If a collision occurs the node waits a random amount of time and starts all over again

It is called 1-persistent because the station transmits with a probability of 1 whenever it starts sensing the channel and finds the channel idle (Greedy)

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 38: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

P-persistent CSMAbull Assume channels are slottedbull One slot = contention period (ie one round trip propagation

delay)Algorithm1 Sense the channel

ndash If channel is idle transmit a packet with probability pbull if a packet was transmitted go to step 2bull if a packet was not transmitted wait one slot and go to step 1

ndash If channel is busy wait one slot and go to step 1ndash In other words wait until idle and then transmit with probability p

2 Detect collisionsndash If a collision occurs wait a random amount of time and go to step

1

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 39: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Propagation Delay

bull D only sense Arsquos transmission after a propagation delay τ

bull If τ is larger than packet transmission time too much time wasted

bull CSMA in satellite communication Nobull Distance amp propagation delay determine

collision probability

BA C D

The size (length) of the network must be limited

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 40: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

CSMA Performance Analysisbull Assumptions

ndash Constant length packetsndash No errors except those caused by

collisionsndash Collision entire packet transmission time

wastedndash Each host can sense the transmissions of

all other hostsndash The propagation delay is small compared

to the transmission time

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 41: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Analysis of Non-persistent CSMA

bull Prob of success transmission S= U x I(B+I)

bull Mean B = Y + 1 + a mean I = 1Gbull U = Ge-Ga

bull FY(y)=Pno packet occur in an duration of a-y = e-G(a-y) (CDF) )1(1)( aGe

GaYE

Busy period

a1Y

Busy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaGGeS

)21(

a the ratio of propagation delay to packet transmission time

bull Poisson arrival P(k arrivals in time duration t) = k

Ge ktGt

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 42: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Comparison of the channel utilization versus load for various random access protocols

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 43: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

CSMA with Collision DetectionCSMACD (Carrier Sense Multiple Access with Collision

Detection) protocol further improves ALOHA by aborting transmissions as soon as a collision is detected

Operation bull To send data a node first listens to the channel to see if

anyone else is transmitting bull If not it transmits a framebull If channel busy deferral as in CSMA

ndash the node wait a random period of time and repeats the algorithm (non-persistent) or waits until the end of the transmission (1-persistent)

bull The node will detect the collision if collision detected abort its transmission (reducing channel wastage) waits a random amount of time and starts all over again

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 44: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

How to Detect Collision

bull Prerequisite A node can listen while talking

bull Easy in wired LANs measure signal strength compare Tx and Rx signals

bull Difficult in wireless LANs receiver shut off while transmitting

Tx Rx

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 45: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

CSMACAbull Wireless LANsbull How can a node detect collision if it cannot listen while

talkingbull Collision Avoidance

ndash Random Backoff (instead of 1-persistent)ndash Request-to-send (RTS)clear-to-send (CTS)

bull CS no longer works wellndash Rules

bull carrier ==gt do not transmitbull no carrier ==gt OK to transmit

ndash But the above rules do not always apply to wireless

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 46: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Problems with carrier sensing

Y

Z

W

Hidden terminal problem

W finds that medium is freeand it transmits a packet to Z

no carrier ===gt OK to transmit

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 47: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Problems with carrier sensing

Z

W

YX

Exposed terminal problem

Z is transmittingto W

Y will not transmit to Xeven though it cannot interfere

Presence of carrier ===gt hold off transmission

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 48: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Solving Hidden Node problem with RTSCTS

Y

ZX

W

RTS CTS

listen RTS ==gt transmitter is close listen CTS ==gt receiver is close

- listen RTS- wait long enough for the requested station to respond with CTS- if (timeout) then ready to transmit

- listen CTS- wait long enough for the transmitter to send its data

Note RTSCTS does not solve exposed terminal problem In the example above X can send RTS but CTS from the responder will collide with Yrsquos data

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 49: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

RTSCTS exchange example

bull RTS + CTS + Frame + ACK exchange invoked when frame size is large

bull NAV (Network Allocation Vector)ndash NAV maintains prediction of future traffic on the medium

based on duration information that is announced in RTSCTS frames prior to actual exchange of data

Transmitter

DIFS

ACK

RTS

Receiver

Frame

CTS

352 micros 10

micros

SIFS

8192 s

Other NAV (RTS)

NAV (CTS)

304micros 10

micros

10micros

304micros

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 50: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

ldquoTaking Turnsrdquo MAC protocols

Polling bull master node

ldquoinvitesrdquo slave nodes to transmit in turn

bull concernsndash polling

overhead ndash single point of

failure (master)

Token passingbull control token passed from

one node to next sequentially

bull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure

(token)

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 51: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 52: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Fixed TDMAbull access to channel in rounds bull each station gets fixed length slot (length =

packet transmission time) in each round bull unused slots go idle ndash Not efficientbull example 6-station LAN 134 have pkt slots

256 idle

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 53: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Dynamic TDMAbull In dynamic TDMA a scheduling algorithm dynamically

reserves a variable number of timeslots in each frame to variable user data streams based on the traffic demand of each user data stream

bull Negotiations (beforehand) to determine how to allocate slots dynamically

Modempreamble

TDM Downlink D-TDMA UplinkS-ALOHA

control

User B User C

TDD-TDMA Frame

Burst from User ATo Access PointBurst from Access Point -gt Mobiles

Frame header and schedule

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 54: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

FDMAbull FDMA frequency division multiple access

ndash channel spectrum divided into frequency bandsndash each station assigned a frequency band

bull unused transmission time in frequency bands go idle if assignment fixed

ndash Inefficient =gt make it dynamically assigned to different stations based on traffic demand

ndash OFDMA

Freq

uenc

y ba

nds

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 55: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Spread Spectrum and CDMAbull What if we donrsquoy not divide up the channel by time (as in

TDMA) or frequency (as in FDMA) Is collision inevitablebull Not if collision is no longer damaging

ndash Is there any way to decode bits garbled by other overlapping frames

Code Division Multiple Access (CDMA) based on Spread Spectrumbull Another perspective to solve multiple access problemsbull Spread Spectrum is a PHY innovation not a MAC techniquebull CDMA encodes data with a special code associated with each

user and uses the constructive interference properties of the special codes to perform the multiplexing

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 56: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Spread Spectrumbull Idea

ndash spread signal over wider frequency band than required

ndash originally deigned to thwart jammingbull Frequency Hopping

ndash transmit over random sequence of frequenciesndash sender and receiver sharehellip

bull pseudorandom number generatorbull seed

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 57: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Spread Spectrum (cont)bull Direct Sequence

ndash for each bit send XOR of that bit and n random bits

ndash random sequence known to both sender and receiver

ndash called n-bit chipping code

Random sequence 0100101101011001

Data stream 1010

XOR of the two 1011101110101001

0

0

0

1

1

1

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 58: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrumbull Start with data signal rate D

ndash Called bit data ratebull Break each bit into k chips according to fixed

pattern specific to each userndash Userrsquos code

bull New channel has chip data rate kD chips per second

bull Eg k=6 three users (ABC) communicating with base station R

bull Code for A = lt1-1-11-11gtbull Code for B = lt11-1-111gtbull Code for C = lt11-111-1gt

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 59: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

LAN technologies

EthernetToken RingWireless LAN

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 60: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Ethernet Overviewbull History

ndash developed by Xerox PARC in mid-1970sndash roots in Aloha packet-radio networkndash standardized by Xerox DEC and Intel in 1978ndash similar to IEEE 8023 standard

bull CSMACDbull Evolution Bus topology (90rsquos) Star topology (now)bull Most successful access network technology

Hub or switch

Advance

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 61: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Ethernet Framebull Preamble 8 bytes

ndash 7 bytes with pattern 10101010 followed by one byte with pattern 10101011

ndash used to synchronize receiver sender clock ratesbull Addresses6 bytes

ndash if adapter receives frame with matching destination address or with broadcast address it passes data in frame to net-layer protocol otherwise adapter discards frame

bull Type 2 bytesndash indicates the higher layer protocol (mostly IP but others also

supported)bull CRC 4 bytes

ndash checked at receiver if error is detected the frame is simply droppedbull Body 46-1500 bytes

ndash Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame

Destaddr

8 6 4

CRCPreamble Srcaddr Type Body

26Octets 46-1500

64-1518

72-1526

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 62: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

MAC Addressbull MAC Addresses

ndash unique 48-bit unicast address assigned to each adapterbull example 38102be4b102

ndash broadcast all 1s ffffffffffffndash multicast multicast flag (the lowest bit of the 1st octet)= 1

bull 01-00-5E-00-00-00 to 01-00-5E-7F-FF-FF for IP multicastndash IP multicast group address mapped to the lower

order 23 bits of MAC address (not one-to-one mapping)

ndash Unique MAC address allocation administered by IEEEbull manufacturer buys portion of MAC address spacebull the first three octets as vendor-specific

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 63: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

MAC Address vs IP Address

bull 48-bit MAC addressndash Layer 2ndash Used to get packet from

one interface to another within the same LANsubnet (Ethernet token ringhellip)

ndash Flatndash Uniquendash No change when

moving

bull 32-bit IP addressndash Network layerndash Used to get packet to

destination IP subnetndash Hierarchicalndash Change when moving

bull Depending on IP subnet to which node is attached

bull IP to MAC address translation ARP (more later)

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 64: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Different Flavors of Ethernet Formatbull Ethernet version II

DestMAC

8 6 4

FCSPreamble SrcMAC Type Body

26Octets 46-1500

Data link header Data amp CRC (FCS)

bull IEEE 8023

DestMAC

8 6

Preamble SrcMAC

Length

26Octets

Datalink Header

DSAP SSAP Control

4

FCSBody

43-1497

Data amp CRC (FCS)Logical Link Control

1 1 1

bull Length the length of the data in the frame (excluding preamble CRC DLC addresses and the Length field itself)

bull Destination Service Access Point (DSAP) a pointer to a memory buffer in the receiving station It tells the receiving NIC in which buffer to put this information useful in situations where users are running multiple protocol stacks etc

bull Source Service Access Point (SSAP) bull Control the type of LLC frame bull Distinguish Ethertypes and Control field

ndash Ethertypes value gt 0x05DC (1500) Length lt= 1500

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 65: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Unreliable connectionless service

bull Connectionless No handshaking between sending and receiving adapter

bull Unreliable receiving adapter doesnrsquot send acks or nacks to sending adapterndash stream of datagrams passed to network

layer can have gapsndash gaps will be filled if app is using TCPndash otherwise app will see the gaps

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 66: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Ethernet CSMACD1 If sender senses channel idle it starts to transmit

frame If it senses channel busy waits until channel idle and then transmits (1-persistent CSMA)bull Inter-frame gap time to send 96 bits (96 s for 10Mbps)

2 If adapter transmits entire frame without detecting another transmission the adapter is done with frame

3 If adapter detects another transmission while transmitting aborts and sends 32-bit jam signal (collision detection)

4 After aborting sender enters exponential backoffndash after the mth collision adapter chooses a K at random

from 012hellip2m-1 Then waits K512 bit times (k x 512 us in 10 Mbps Ethernet) and returns to Step 1

ndash give up after several tries (usually 16)

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 67: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Ethernet CSMACD (Cont)Jam Signal bull make sure all other

transmitters are aware of collision

bull 32 bitsbull Frame 64 (preamble) +

32 (jamming sequence) = 96 bits ndash Runt Frame

Exponential Backoffbull Goal adapt retransmission

attempts to the estimated current of active stations or loadndash heavy load random wait will

be longerbull first collision choose K from

01 delay is K512 bit (512 s in 10 Mbps) transmission times

bull after second collision choose K from 0123hellip

bull after ten collisions choose K from 01234hellip1023

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 68: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

CollisionsA B

A B

A B

A B

Worst casebull A sends at t Arsquos frame

arrives B at t+dbull B begins transmitting at

t+d and collides with Arsquos frame

bull B sends runt frame the runt frame arrives A at t+2d

bull To detect collision A must continue transmit until t+2d A must transmit for 2d

bull Round-trip delay about 512 us for 2500m long Ethernet with 4 repeater ndash Corresponds to 512 bits for

10 Mbps Ethernetndash So min frame size 512 bits

The longer the propagation delay the higher probability of collision

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 69: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

10BaseT and 100BaseTbull 10100 Mbps rate latter called ldquofast ethernetrdquobull T stands for Twisted Pairbull Star toplogy max 100m between node and hubbull Hubs physical-layer repeaters

ndash bits coming from one link go out all other links at the same rate

ndash no frame bufferingndash no CSMACD at hub adapters detect collisionsndash provides net management functionality

Hub

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 70: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Legacy Ethernetbull 10Base5

ndash Bus topology with coaxial cablendash 10 Mbps Up to 500m each segmentndash No more than 4 repeaters between any pair of stationsndash Max 2500 m ndash Max 1024 hosts

bull 10Base2ndash Daisy chainndash Up to 200m

Terminator Transceiver

Adaptor

Repeater

Terminator

10 Base5 Ethernet

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 71: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Gbit Ethernetbull uses standard Ethernet frame formatbull allows for point-to-point links and shared

broadcast channelsbull in shared mode CSMACD is used short

distances between nodes required for efficiency

bull uses hubsbull Full-Duplex at 1 Gbps for point-to-point linksbull 10 Gbps now

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 72: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Ethernet Performancebull Max throughput lt1 as a function of span

ndash As propagation delay increases efficiency decreasesndash instability can occur unless load is reduced under

congestion conditionsndash retransmission backoff policy for stability

Overloadregion

Normal operatingpoint

Capacity Limit~08

load lines

Offered Traffic

ThruTrafficmargin

stable policy(retx backoff)

stable policy(backoff too high)

unstable policy(no backoff)

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 73: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

Wireless LANsbull 80211 abg different Phy technologies

ndash 80211 bg 20 MHz channel in 24 GHz up to 11 Mbps (80211b) 54 Mbps (80211g) phy data rate

ndash 80211a 20 MHz channel in 5GHz up to 54 Mbps phy data rate

bull 80211n ndash 130 Mbps phy data rate on 20 MHz channel

(2 x 2 MIMO)ndash 300 Mbps phy data rate on 40 MHz channel

(channel bonding with 2 x 2 MIMO)See supplementary WLAN tutorial slides

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework
Page 74: ECE544: Communication Networks-II Spring 2013 D. Raychaudhuri Lecture II Includes teaching materials from L. Peterson, J. Kurose.

74

Todayrsquos Homeworkbull Peterson amp Davie Chap 2 4th ed

26218223233244242

Download and review Ethernet and 80211 MAC specs and study IEEE 80211 Wireless LAN Overview slides

Due 28

  • ECE544 Communication Networks-II Spring 2013
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • PowerPoint Presentation
  • Binary Encoding
  • Manchester Encoding
  • Point-to-Point Data Link Protocol
  • PPP Functions
  • PPP Data Frame
  • Byte Stuff
  • PPP Link Control Protocol (LCP)
  • High-Level Data Link Control (HDLC)
  • Error Detection
  • Parity Checking
  • Internet Checksum
  • Cyclic Redundancy Check (CRC)
  • CRC Example
  • Automatic Repeat reQuest(ARQ)
  • Sliding Window
  • Sliding Window (Cont)
  • Sliding Window
  • Shared Media Networks
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Performance of ALOHA
  • Carrier Sense Multiple Access (CSMA)
  • Non-persistent CSMA
  • 1-persistent CSMA
  • P-persistent CSMA
  • Propagation Delay
  • CSMA Performance Analysis
  • Analysis of Non-persistent CSMA
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACA
  • Problems with carrier sensing
  • Slide 47
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • ldquoTaking Turnsrdquo MAC protocols
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • LAN technologies
  • Ethernet Overview
  • Ethernet Frame
  • MAC Address
  • MAC Address vs IP Address
  • Different Flavors of Ethernet Format
  • Unreliable connectionless service
  • Ethernet CSMACD
  • Ethernet CSMACD (Cont)
  • Collisions
  • 10BaseT and 100BaseT
  • Legacy Ethernet
  • Gbit Ethernet
  • Ethernet Performance
  • Wireless LANs
  • Todayrsquos Homework