ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D....

94
ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J.
  • date post

    22-Dec-2015
  • Category

    Documents

  • view

    214
  • download

    0

Transcript of ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D....

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

ECE544 Communication Networks-II Spring 2009

H Liu

Lecture II

Includes teaching materials from D Raychaudhuri L Peterson J Kurose

Todayrsquos Lecturebull Link Layer Servicesbull Link Layer Techniques

ndash Binary Encoding (actually more Physical Layer stuff)ndash Framing amp PPP Protocolndash Error Detection amp Correction ndash ARQ amp Sliding Window

bull Medium Access Control Protocolsndash 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 LANs

Link Layer Introductionbull Some terminology

ndash hubrepeater (layer 1) bridgeLAN switch (layer 2) router (layer 3) host (not forwarding)

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)ndash Flow control pacing between adjacent sending and

receiving nodesndash Half-duplex and full-duplex

bull with half duplex either transmit or receive on a link but not both nodes at same time

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

Binary Encoding

bull 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 Control

bull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)

bull popular point-to-point DLC protocolsndash PPP (point-to-point protocol) byte-oriented

bull 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 Stuff

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

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 2: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Todayrsquos Lecturebull Link Layer Servicesbull Link Layer Techniques

ndash Binary Encoding (actually more Physical Layer stuff)ndash Framing amp PPP Protocolndash Error Detection amp Correction ndash ARQ amp Sliding Window

bull Medium Access Control Protocolsndash 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 LANs

Link Layer Introductionbull Some terminology

ndash hubrepeater (layer 1) bridgeLAN switch (layer 2) router (layer 3) host (not forwarding)

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)ndash Flow control pacing between adjacent sending and

receiving nodesndash Half-duplex and full-duplex

bull with half duplex either transmit or receive on a link but not both nodes at same time

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

Binary Encoding

bull 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 Control

bull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)

bull popular point-to-point DLC protocolsndash PPP (point-to-point protocol) byte-oriented

bull 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 Stuff

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

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 3: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Link Layer Introductionbull Some terminology

ndash hubrepeater (layer 1) bridgeLAN switch (layer 2) router (layer 3) host (not forwarding)

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)ndash Flow control pacing between adjacent sending and

receiving nodesndash Half-duplex and full-duplex

bull with half duplex either transmit or receive on a link but not both nodes at same time

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

Binary Encoding

bull 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 Control

bull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)

bull popular point-to-point DLC protocolsndash PPP (point-to-point protocol) byte-oriented

bull 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 Stuff

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

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 4: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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)ndash Flow control pacing between adjacent sending and

receiving nodesndash Half-duplex and full-duplex

bull with half duplex either transmit or receive on a link but not both nodes at same time

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

Binary Encoding

bull 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 Control

bull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)

bull popular point-to-point DLC protocolsndash PPP (point-to-point protocol) byte-oriented

bull 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 Stuff

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

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 5: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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

Binary Encoding

bull 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 Control

bull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)

bull popular point-to-point DLC protocolsndash PPP (point-to-point protocol) byte-oriented

bull 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 Stuff

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

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 6: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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

Binary Encoding

bull 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 Control

bull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)

bull popular point-to-point DLC protocolsndash PPP (point-to-point protocol) byte-oriented

bull 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 Stuff

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

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 7: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

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

Binary Encoding

bull 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 Control

bull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)

bull popular point-to-point DLC protocolsndash PPP (point-to-point protocol) byte-oriented

bull 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 Stuff

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

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 8: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Binary Encoding

bull 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 Control

bull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)

bull popular point-to-point DLC protocolsndash PPP (point-to-point protocol) byte-oriented

bull 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 Stuff

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

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 9: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 Control

bull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)

bull popular point-to-point DLC protocolsndash PPP (point-to-point protocol) byte-oriented

bull 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 Stuff

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

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 10: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 Control

bull no need for explicit MAC addressingbull eg dialup link ISDN line

ndash Broadcast (shared wire or medium)

bull popular point-to-point DLC protocolsndash PPP (point-to-point protocol) byte-oriented

bull 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 Stuff

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

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 11: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 Stuff

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

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 12: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 Stuff

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

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 13: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Byte Stuff

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

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 14: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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)

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 15: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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)

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 16: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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)

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 17: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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)

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 18: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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)

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 19: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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)

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 20: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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)

])(

)([

XC

XTremainderR

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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 21: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 high

bull 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 22: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 frames

bull 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 23: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 24: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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

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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 25: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 26: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Media Access Protocol

bull 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 27: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 28: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Pure (Unslotted) ALOHA

bull Early packet radio network created at the U of Hawaii in 1970

bull 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

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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 29: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 probability increasesndash frame sent at t0 collides with other frames sent in [t0-

1t0+1]

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 30: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Pure Aloha efficiency

bull 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 time

bull 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 transmission

ndash S = GP0 = Ge-2G

bull S is optimum at G=12

bull S=12e = 0184

k

Ge kG

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 31: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Another Method to Analyze Alohabull G the mean number of aggregate arrivals (for N nodes in network) in a

time-interval (time-interval = one frame transmission time)

bull P(node transmits) = GNP(success by any node) = N P(node transmits)

P(no other node transmits in [t0-1t0]

P(no other node transmits in [t0-1t0]

= N p (1-p)N-1 (1-p)N-1

= G (1-GN)2(N-1)

= Ge -2G (N-gtinfinity)

= 1(2e) = 018 (optimum G=12)

bull The Poisson distribution can be derived as a limiting case to the binomial

distribution as N goes to infinity

GN

Ne

N

G

)1(lim

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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 32: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 33: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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)

k

Ge kG

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 34: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Another Method to Analyze Slotted Aloha

bull Suppose N nodes with G frames to send each transmits in slot with probability p = GN

bull prob that node 1 has success in a slot = p(1-p)N-1

bull prob that any node has a success = Np(1-p)N-1

= G(1-GN)N-1

bull as N goes to infinity take limit of G(1-GN)N-1= Ge-G

bull Maximum prob = 1e (G=1)bull At best channel used for useful transmissions

37 of time

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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 35: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 36: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Carrier Sense Multiple Access (CSMA)

bull CSMA listen before transmitndash 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 CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 37: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Non-persistent CSMA

bull 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

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 38: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

1-persistent CSMA

Algorithm1 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 39: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 1ndash 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 40: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 41: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

CSMA Performance Analysis

bull Assumptionsndash 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 42: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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

a

1YBusy periodIdle period1

a

Normalized Time

Unsuccessful transmission period

Successful transmission period

a

aG

aG

eaG

GeS

)21(

a the ratio of propagation delay to packet transmission time

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

Ge ktGt

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 43: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Discussion of Collisionsbull Whats the effect of signal propagation delay a

ndash The longer the delay the more the collisions

and the worse the performance of the protocol bull How about zero propagation delay

ndash There still exist chances of collisions bull S = G(1+G)

bull Is this protocol any better than ALOHA (both pure and slotted) ndash Yes because both stations have the decency to

desist from interfering with the third nodes frame

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 44: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Tradeoff between Non-persistent and 1-persistent

bull If B and C become ready in the middle of Arsquos transmissionndash 1-Persistent B and C collidendash Non-Persistent B and C probably do not

collide

bull If only B becomes ready in the middle of Arsquos transmissionndash 1-Persistent B succeeds as soon as A endsndash Non-Persistent B may have to wait

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 45: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

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

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 46: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

CSMA with Collision Detection

CSMACD (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 listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 47: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

How to Detect Collision

bull Prerequisite A node can listening 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

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 48: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

CSMACD (Cont)

bull CSMACD can be in one of three states contention transmission or idle

bull The minimum time to detect the collision is the time it takes the signal to propagate from one node to the other

bull How long could the transmitting node be sure it has seized the network ( or 2 where is time for the signal to propagate from one end to another)

bull Model the contention interval as slotted aloha with slot width 2

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 49: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

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

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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 50: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 51: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 52: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 53: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 54: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Pros amp Cons of Random Access

bull Advantagesndash Simple (due to distributed control)ndash Flexible to fluctuations in the number

of hostsndash Fairness

bull Disadvantagesndash Low channel efficiency with a large

number of hostsndash High variance in transmission delays

bull Not good for continuous traffic (eg voice)

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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 55: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 sequentiallybull token messagebull concerns

ndash token overhead ndash complexityndash single point of failure (token)

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 56: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Scheduled Access

bull TDMAbull Dynamic TDMAbull FDMAbull CDMAbull Widely used

ndash Cellularndash IEEE 80216 (WiMax)ndash HyperLAN ndash Wireless ATM

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 57: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

TDMAbull Time Division Multiple Access (TDMA)

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 58: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Fixed TDMA

bull 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 59: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 Point

Burst 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 60: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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

Fre

quen

cy b

ands

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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 61: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 inevitable

bull 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 Spectrum

bull Another perspective to solve multiple access problems

bull Spread Spectrum is a PHY innovation not a MAC technique

bull 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 62: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 63: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 64: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Code Division Multiple Access (CDMA)

bull Multiplexing Technique used with spread spectrum

bull Start with data signal rate Dndash Called bit data rate

bull 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

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 65: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

CDMA Example

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 66: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

CDMA Explanationbull Consider A communicating with basebull Base knows Arsquos codebull Assume communication already synchronizedbull A wants to send a 1

ndash Send chip pattern lt1-1-11-11gtbull Arsquos code

bull A wants to send 0ndash Send chip pattern lt-111-11-1gt

bull Complement of Arsquos codebull Decoder ignores other sources when using Arsquos

code to decodendash Orthogonal codes

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 67: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Summary of Scheduled Access Protocols

bull Avoid of contentioncollision better channel efficiency with a large number of hosts

bull Predetermined channel allocation bull Need centralized control bull Require global synchronizationbull Guard time period to protect slotsbull Bounded delay

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 68: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Summary of MAC protocols

bull What do you do with a shared mediandash Random partitioning (dynamic)

bull ALOHA S-ALOHA CSMA CSMACDbull carrier sensing easy in some technologies (wire)

hard in others (wireless)bull CSMACD used in Ethernetbull CSMACA used in 80211

ndash Taking Turnsbull polling from a central station token passing

ndash Channel Partitioning by time frequency or code

bull Time Division Frequency Division Code Divisionbull Multiple divisions

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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 69: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 70: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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)

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

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 71: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 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 longer

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 72: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 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 longer

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 73: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 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 longer

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 74: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 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 longer

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 75: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 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 longer

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 76: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 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 longer

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 77: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 longer

bull 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

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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 78: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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

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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 79: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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 framebull B sends runt frame the runt

frame arrives A at t+2dbull 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 80: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 81: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Manchester encoding

bull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherbull no need for a centralized global clock among

nodes

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 82: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Gbit Ethernet

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

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 83: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, 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)

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 84: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Token Ring Overview

bull Examplesndash 16Mbps IEEE 8025 (based on earlier IBM ring)ndash 100Mbps Fiber Distributed Data Interface (FDDI)

bull Double ring failure protection

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 85: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Token Ring (cont)bull Idea

ndash Frames flow in one direction upstream to downstream

ndash special bit pattern (token) rotates around ringndash must capture token before transmittingndash release token after done transmitting

bull immediate release immediate after the frame is sentbull delayed release after the frame has gone around the

ring and has been removedndash remove your frame when it comes back aroundndash stations get round-robin service

bull Frame Format

AccessControl

Octet 1 1 1 1

CRCStartdelimiter

End delimiter

Destaddr

Body

66

Srcaddr Status

4

Frame control

1 up to 18200

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 86: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Timed Token Algorithmbull Token Holding Time (THT)

ndash upper limit on how long a station can hold the token

bull Token Rotation Time (TRT)ndash how long it takes the token to traverse the ringndash TRT lt= ActiveNodes x THT + RingLatency

bull Target Token Rotation Time (TTRT)ndash agreed-upon upper bound on TRT

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 87: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Token Ring Priority

bull 3-bit priority subfield amp 3-bit reservation subfield in access control field

bull Sender assigns packet a prioritybull Station can only seize token to transmit a packet if

the priority of the packet gt= tokenrsquosbull Token priority changes

ndash Station A waiting to send a priority n packet sets the reservation bits to n if it sees the current priority lt priority n

ndash The station currently holding token elevates the priority to n when it release it

ndash Station A lowers the token to the old value when it is done

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 88: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Failure Detection

bull A and C bits in trailerbull Destination

ndash set A in the frame once it sees the framendash Set C when it copies the frame into its

adaptor

bull Source check the frame after it comes back over the ringndash A not set problem with destinationndash A set but C not set destination cannot

accept frame (buffer overflow)

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 89: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Token Maintenancebull Monitor station performs a number of ring administration

functions (only one active monitor on the ring)ndash detects the problem and removes andor reinserts tokens as

necessary to make sure there is always a tokenndash Announces its presence periodicallyndash Master clock for synchronizationndash detect a broken ringndash Remove corrupted or orphaned frames

bull The monitor selection process is initiated when one of the following conditions occurndash A station has not seen a token for a certain timendash A loss of signal on the ring is detected ndash An active monitor station is not detected by other stations on

the ringbull Monitor contention process

ndash transmit a claim token frame ndash If that token returns back to the sender it is OK for it to

become the active monitor ndash If some other station tries to become the monitor at the same

time then the station with the highest MAC address will win the election process

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 90: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Wireless LANs

bull 80211 abg different Phy technologiesndash 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)

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 91: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

80211 MACbull Distributed coordination function (DCF) CSMACA with exponential

backoffbull Point coordination function (PCF) pollingbull QoS enhanced distributed channel access (EDCA) based on DCF with

prioritybull QoS hybrid coordination function (HCF) controlled channel access

(HCCA) based on polling with QoS HC (AP) is centralized coordinator

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 92: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Association (Selecting an AP)

bull Active Scanning ndash node sends Probe framendash all APrsquos win reach reply with ProbeResponse frame

bull Passive scanning ndash AP periodically sends Beacon framendash Listen to beacons

bull Associationndash node selects one AP sends it AssociateRequest

framendash AP replies with AssociationResponse frame

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 93: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

Supporting Mobilitybull Case 1 ad hoc net workingbull Case 2 access points (AP)

ndash tetheredndash each mobile node associates with an AP

B

H

A

F

G

D

AP-2

AP-3AP-1

EC

Distribution system

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework
Page 94: ECE544: Communication Networks-II Spring 2009 H. Liu Lecture II Includes teaching materials from D. Raychaudhuri, L. Peterson, J. Kurose.

94

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 213

  • ECE544 Communication Networks-II Spring 2009
  • Todayrsquos Lecture
  • Link Layer Introduction
  • Link Layer Services
  • Link Layer Communication
  • Layer 2 vs Layer 3
  • Slide 7
  • 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
  • Medium Access Sublayer
  • Media Access Protocol
  • MAC Classification
  • Pure (Unslotted) ALOHA
  • Aloha Algorithm
  • Pure Aloha efficiency
  • Another Method to Analyze Aloha
  • Slotted Aloha
  • Efficiency of Slotted ALOHA
  • Another Method to Analyze 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
  • Discussion of Collisions
  • Tradeoff between Non-persistent and 1-persistent
  • Comparison of the channel utilization versus load for various random access protocols
  • CSMA with Collision Detection
  • How to Detect Collision
  • CSMACD (Cont)
  • CSMACA
  • Problems with carrier sensing
  • Slide 51
  • Solving Hidden Node problem with RTSCTS
  • RTSCTS exchange example
  • Pros amp Cons of Random Access
  • ldquoTaking Turnsrdquo MAC protocols
  • Scheduled Access
  • TDMA
  • Fixed TDMA
  • Dynamic TDMA
  • FDMA
  • Spread Spectrum and CDMA
  • Spread Spectrum
  • Spread Spectrum (cont)
  • Code Division Multiple Access (CDMA)
  • CDMA Example
  • CDMA Explanation
  • Summary of Scheduled Access Protocols
  • Summary of MAC protocols
  • 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)
  • Legacy Ethernet
  • Collisions
  • 10BaseT and 100BaseT
  • Manchester encoding
  • Gbit Ethernet
  • Ethernet Performance
  • Token Ring Overview
  • Token Ring (cont)
  • Timed Token Algorithm
  • Token Ring Priority
  • Failure Detection
  • Token Maintenance
  • Wireless LANs
  • 80211 MAC
  • Association (Selecting an AP)
  • Supporting Mobility
  • Todayrsquos Homework