Top Banner
EEC-484/584 EEC-484/584 Computer Networks Computer Networks Lecture 13 Lecture 13 Wenbing Zhao Wenbing Zhao [email protected] [email protected]
30
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

EEC-484584EEC-484584Computer NetworksComputer Networks

Lecture 13Lecture 13

Wenbing ZhaoWenbing Zhao

wenbingzgmailcom wenbingzgmailcom

22

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

OutlineOutline

bull Medium Access Controlbull Ethernet

ndash Manchester Encodingndash The Ethernet MAC Sublayer Protocolndash The Binary Exponential Backoff Algorithm

33

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Medium Access Control SublayerMedium Access Control Sublayer

bull Broadcast channels often used on data link layerndash Broadcast channels often referred to as

multiaccess or random access channels

bull The channel allocation problem Who gets to use the channelndash Static Channel Allocationndash Dynamic Channel Allocation

44

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Static Channel AllocationStatic Channel Allocation

bull FDM ndash Frequency Division Multiplexingndash Frequency spectrum divided into logical channelndash Each user has exclusive use of own frequency band

bull TDM ndash Time Division Multiplexingndash Time divided into slots each user has time slotndash Users take turns in round robin fashion

bull Problem wasted bandwidth if user does not use hisher frequency band or timeslot

55

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Frequency Division MultiplexingFrequency Division Multiplexing

66

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Time Division MultiplexingTime Division Multiplexing

T1 Carrier (1544 Mbps)

77

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Model for Model for Dynamic Channel AllocationDynamic Channel Allocation

bull N independent stations (also called terminals)bull Once a frame has been generated the station is

blocked until the frame is transmitted successfully

bull Single Channel shared by all stationsbull Collision ndash event when two frames transmitted

simultaneously and the resulting signal is garbledndash All stations can detect collisions

88

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Model for Model for Dynamic Channel AllocationDynamic Channel Allocation

bull Frame transmission timendash Continuous Time ndash can begin at any instantndash Slotted Time ndash always begin at the start of a

slot

bull Carrier sense or notndash Carrier sense ndash stations can tell if the channel

is busy Do not send if channel is busyndash No carrier sense ndash just go ahead and send

99

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Multiple Access ProtocolsMultiple Access Protocols

bull ALOHA

bull Carrier Sense Multiple Access Protocols

1010

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHAPure ALOHA

bull Let users transmit whenever they have data to send

bull If frame destroyed (due to collision) sender waits random amount of time sends again

bull User does not listen before transmitting

1111

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHA Vulnerable PeriodPure ALOHA Vulnerable Periodbull Vulnerable period for a frame A collision will

happen if another frame is sent during this period

2 frame time

1212

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Slotted ALOHASlotted ALOHA

bull Idea divide time into intervals each interval corresponds to one framendash Station is permitted to send only at the

beginning of next slot

bull Vulnerable period is halved (1 frame time)ndash Probability of no collision in time slot = e-G

ndash Throughput S = G e-G

ndash Max occurs when G = 1 S = 20184 (G of attempts per frame time)

1313

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Throughput for ALOHA SystemsThroughput for ALOHA Systems

1414

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Carrier Sense Multiple AccessCarrier Sense Multiple Access

bull When station has data to send listens to channel to see if anyone else is transmitting

bull If channel is idle station transmits a framendash Else station waits for it to become idle

bull If collisions occurs station waits random amount of time tries again

bull Also called 1-persistent CSMAndash With probability 1 station will transmit if channel is idle

1515

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

bull After a station starts sending it takes a while before 2nd station receives 1st stationrsquos signalndash 2nd station might start sending before it knows that

another station has already been transmitting

bull If two stations become ready while third station transmittingndash Both wait until transmission ends and start

transmitting collision results

Carrier Sense Multiple AccessCarrier Sense Multiple AccessCollision Still PossibleCollision Still Possible

1616

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

pp-persistent CSMA-persistent CSMAReduce the Probability of CollisionReduce the Probability of Collision

bull Sense continuously but does not always send when channel is idlendash Applicable for slotted channels

bull When ready to send station senses the channelndash If channel idle station transmits with probability p

defers to next slot with probability q = 1-pndash Else (if channel is busy) station waits until next slot tries

againndash If next slot idle station transmits with probability p

defers with probability q = 1-pndash hellip

1717

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Non-Persistent CSMANon-Persistent CSMA

bull Does not sense continuously send if it senses the channel is idle

bull Before sending station senses the channelndash If channel is idle station begins sendingndash Else station does not continuously sense waits

random amount of time tries again

1818

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Persistent and Nonpersistent CSMAPersistent and Nonpersistent CSMA

bull Improves over ALOHA because they ensure no station to transmit when it senses channel is busy

1919

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Minimum time to detect collision

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 2: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

22

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

OutlineOutline

bull Medium Access Controlbull Ethernet

ndash Manchester Encodingndash The Ethernet MAC Sublayer Protocolndash The Binary Exponential Backoff Algorithm

33

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Medium Access Control SublayerMedium Access Control Sublayer

bull Broadcast channels often used on data link layerndash Broadcast channels often referred to as

multiaccess or random access channels

bull The channel allocation problem Who gets to use the channelndash Static Channel Allocationndash Dynamic Channel Allocation

44

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Static Channel AllocationStatic Channel Allocation

bull FDM ndash Frequency Division Multiplexingndash Frequency spectrum divided into logical channelndash Each user has exclusive use of own frequency band

bull TDM ndash Time Division Multiplexingndash Time divided into slots each user has time slotndash Users take turns in round robin fashion

bull Problem wasted bandwidth if user does not use hisher frequency band or timeslot

55

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Frequency Division MultiplexingFrequency Division Multiplexing

66

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Time Division MultiplexingTime Division Multiplexing

T1 Carrier (1544 Mbps)

77

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Model for Model for Dynamic Channel AllocationDynamic Channel Allocation

bull N independent stations (also called terminals)bull Once a frame has been generated the station is

blocked until the frame is transmitted successfully

bull Single Channel shared by all stationsbull Collision ndash event when two frames transmitted

simultaneously and the resulting signal is garbledndash All stations can detect collisions

88

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Model for Model for Dynamic Channel AllocationDynamic Channel Allocation

bull Frame transmission timendash Continuous Time ndash can begin at any instantndash Slotted Time ndash always begin at the start of a

slot

bull Carrier sense or notndash Carrier sense ndash stations can tell if the channel

is busy Do not send if channel is busyndash No carrier sense ndash just go ahead and send

99

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Multiple Access ProtocolsMultiple Access Protocols

bull ALOHA

bull Carrier Sense Multiple Access Protocols

1010

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHAPure ALOHA

bull Let users transmit whenever they have data to send

bull If frame destroyed (due to collision) sender waits random amount of time sends again

bull User does not listen before transmitting

1111

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHA Vulnerable PeriodPure ALOHA Vulnerable Periodbull Vulnerable period for a frame A collision will

happen if another frame is sent during this period

2 frame time

1212

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Slotted ALOHASlotted ALOHA

bull Idea divide time into intervals each interval corresponds to one framendash Station is permitted to send only at the

beginning of next slot

bull Vulnerable period is halved (1 frame time)ndash Probability of no collision in time slot = e-G

ndash Throughput S = G e-G

ndash Max occurs when G = 1 S = 20184 (G of attempts per frame time)

1313

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Throughput for ALOHA SystemsThroughput for ALOHA Systems

1414

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Carrier Sense Multiple AccessCarrier Sense Multiple Access

bull When station has data to send listens to channel to see if anyone else is transmitting

bull If channel is idle station transmits a framendash Else station waits for it to become idle

bull If collisions occurs station waits random amount of time tries again

bull Also called 1-persistent CSMAndash With probability 1 station will transmit if channel is idle

1515

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

bull After a station starts sending it takes a while before 2nd station receives 1st stationrsquos signalndash 2nd station might start sending before it knows that

another station has already been transmitting

bull If two stations become ready while third station transmittingndash Both wait until transmission ends and start

transmitting collision results

Carrier Sense Multiple AccessCarrier Sense Multiple AccessCollision Still PossibleCollision Still Possible

1616

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

pp-persistent CSMA-persistent CSMAReduce the Probability of CollisionReduce the Probability of Collision

bull Sense continuously but does not always send when channel is idlendash Applicable for slotted channels

bull When ready to send station senses the channelndash If channel idle station transmits with probability p

defers to next slot with probability q = 1-pndash Else (if channel is busy) station waits until next slot tries

againndash If next slot idle station transmits with probability p

defers with probability q = 1-pndash hellip

1717

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Non-Persistent CSMANon-Persistent CSMA

bull Does not sense continuously send if it senses the channel is idle

bull Before sending station senses the channelndash If channel is idle station begins sendingndash Else station does not continuously sense waits

random amount of time tries again

1818

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Persistent and Nonpersistent CSMAPersistent and Nonpersistent CSMA

bull Improves over ALOHA because they ensure no station to transmit when it senses channel is busy

1919

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Minimum time to detect collision

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 3: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

33

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Medium Access Control SublayerMedium Access Control Sublayer

bull Broadcast channels often used on data link layerndash Broadcast channels often referred to as

multiaccess or random access channels

bull The channel allocation problem Who gets to use the channelndash Static Channel Allocationndash Dynamic Channel Allocation

44

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Static Channel AllocationStatic Channel Allocation

bull FDM ndash Frequency Division Multiplexingndash Frequency spectrum divided into logical channelndash Each user has exclusive use of own frequency band

bull TDM ndash Time Division Multiplexingndash Time divided into slots each user has time slotndash Users take turns in round robin fashion

bull Problem wasted bandwidth if user does not use hisher frequency band or timeslot

55

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Frequency Division MultiplexingFrequency Division Multiplexing

66

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Time Division MultiplexingTime Division Multiplexing

T1 Carrier (1544 Mbps)

77

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Model for Model for Dynamic Channel AllocationDynamic Channel Allocation

bull N independent stations (also called terminals)bull Once a frame has been generated the station is

blocked until the frame is transmitted successfully

bull Single Channel shared by all stationsbull Collision ndash event when two frames transmitted

simultaneously and the resulting signal is garbledndash All stations can detect collisions

88

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Model for Model for Dynamic Channel AllocationDynamic Channel Allocation

bull Frame transmission timendash Continuous Time ndash can begin at any instantndash Slotted Time ndash always begin at the start of a

slot

bull Carrier sense or notndash Carrier sense ndash stations can tell if the channel

is busy Do not send if channel is busyndash No carrier sense ndash just go ahead and send

99

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Multiple Access ProtocolsMultiple Access Protocols

bull ALOHA

bull Carrier Sense Multiple Access Protocols

1010

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHAPure ALOHA

bull Let users transmit whenever they have data to send

bull If frame destroyed (due to collision) sender waits random amount of time sends again

bull User does not listen before transmitting

1111

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHA Vulnerable PeriodPure ALOHA Vulnerable Periodbull Vulnerable period for a frame A collision will

happen if another frame is sent during this period

2 frame time

1212

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Slotted ALOHASlotted ALOHA

bull Idea divide time into intervals each interval corresponds to one framendash Station is permitted to send only at the

beginning of next slot

bull Vulnerable period is halved (1 frame time)ndash Probability of no collision in time slot = e-G

ndash Throughput S = G e-G

ndash Max occurs when G = 1 S = 20184 (G of attempts per frame time)

1313

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Throughput for ALOHA SystemsThroughput for ALOHA Systems

1414

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Carrier Sense Multiple AccessCarrier Sense Multiple Access

bull When station has data to send listens to channel to see if anyone else is transmitting

bull If channel is idle station transmits a framendash Else station waits for it to become idle

bull If collisions occurs station waits random amount of time tries again

bull Also called 1-persistent CSMAndash With probability 1 station will transmit if channel is idle

1515

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

bull After a station starts sending it takes a while before 2nd station receives 1st stationrsquos signalndash 2nd station might start sending before it knows that

another station has already been transmitting

bull If two stations become ready while third station transmittingndash Both wait until transmission ends and start

transmitting collision results

Carrier Sense Multiple AccessCarrier Sense Multiple AccessCollision Still PossibleCollision Still Possible

1616

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

pp-persistent CSMA-persistent CSMAReduce the Probability of CollisionReduce the Probability of Collision

bull Sense continuously but does not always send when channel is idlendash Applicable for slotted channels

bull When ready to send station senses the channelndash If channel idle station transmits with probability p

defers to next slot with probability q = 1-pndash Else (if channel is busy) station waits until next slot tries

againndash If next slot idle station transmits with probability p

defers with probability q = 1-pndash hellip

1717

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Non-Persistent CSMANon-Persistent CSMA

bull Does not sense continuously send if it senses the channel is idle

bull Before sending station senses the channelndash If channel is idle station begins sendingndash Else station does not continuously sense waits

random amount of time tries again

1818

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Persistent and Nonpersistent CSMAPersistent and Nonpersistent CSMA

bull Improves over ALOHA because they ensure no station to transmit when it senses channel is busy

1919

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Minimum time to detect collision

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 4: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

44

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Static Channel AllocationStatic Channel Allocation

bull FDM ndash Frequency Division Multiplexingndash Frequency spectrum divided into logical channelndash Each user has exclusive use of own frequency band

bull TDM ndash Time Division Multiplexingndash Time divided into slots each user has time slotndash Users take turns in round robin fashion

bull Problem wasted bandwidth if user does not use hisher frequency band or timeslot

55

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Frequency Division MultiplexingFrequency Division Multiplexing

66

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Time Division MultiplexingTime Division Multiplexing

T1 Carrier (1544 Mbps)

77

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Model for Model for Dynamic Channel AllocationDynamic Channel Allocation

bull N independent stations (also called terminals)bull Once a frame has been generated the station is

blocked until the frame is transmitted successfully

bull Single Channel shared by all stationsbull Collision ndash event when two frames transmitted

simultaneously and the resulting signal is garbledndash All stations can detect collisions

88

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Model for Model for Dynamic Channel AllocationDynamic Channel Allocation

bull Frame transmission timendash Continuous Time ndash can begin at any instantndash Slotted Time ndash always begin at the start of a

slot

bull Carrier sense or notndash Carrier sense ndash stations can tell if the channel

is busy Do not send if channel is busyndash No carrier sense ndash just go ahead and send

99

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Multiple Access ProtocolsMultiple Access Protocols

bull ALOHA

bull Carrier Sense Multiple Access Protocols

1010

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHAPure ALOHA

bull Let users transmit whenever they have data to send

bull If frame destroyed (due to collision) sender waits random amount of time sends again

bull User does not listen before transmitting

1111

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHA Vulnerable PeriodPure ALOHA Vulnerable Periodbull Vulnerable period for a frame A collision will

happen if another frame is sent during this period

2 frame time

1212

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Slotted ALOHASlotted ALOHA

bull Idea divide time into intervals each interval corresponds to one framendash Station is permitted to send only at the

beginning of next slot

bull Vulnerable period is halved (1 frame time)ndash Probability of no collision in time slot = e-G

ndash Throughput S = G e-G

ndash Max occurs when G = 1 S = 20184 (G of attempts per frame time)

1313

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Throughput for ALOHA SystemsThroughput for ALOHA Systems

1414

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Carrier Sense Multiple AccessCarrier Sense Multiple Access

bull When station has data to send listens to channel to see if anyone else is transmitting

bull If channel is idle station transmits a framendash Else station waits for it to become idle

bull If collisions occurs station waits random amount of time tries again

bull Also called 1-persistent CSMAndash With probability 1 station will transmit if channel is idle

1515

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

bull After a station starts sending it takes a while before 2nd station receives 1st stationrsquos signalndash 2nd station might start sending before it knows that

another station has already been transmitting

bull If two stations become ready while third station transmittingndash Both wait until transmission ends and start

transmitting collision results

Carrier Sense Multiple AccessCarrier Sense Multiple AccessCollision Still PossibleCollision Still Possible

1616

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

pp-persistent CSMA-persistent CSMAReduce the Probability of CollisionReduce the Probability of Collision

bull Sense continuously but does not always send when channel is idlendash Applicable for slotted channels

bull When ready to send station senses the channelndash If channel idle station transmits with probability p

defers to next slot with probability q = 1-pndash Else (if channel is busy) station waits until next slot tries

againndash If next slot idle station transmits with probability p

defers with probability q = 1-pndash hellip

1717

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Non-Persistent CSMANon-Persistent CSMA

bull Does not sense continuously send if it senses the channel is idle

bull Before sending station senses the channelndash If channel is idle station begins sendingndash Else station does not continuously sense waits

random amount of time tries again

1818

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Persistent and Nonpersistent CSMAPersistent and Nonpersistent CSMA

bull Improves over ALOHA because they ensure no station to transmit when it senses channel is busy

1919

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Minimum time to detect collision

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 5: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

55

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Frequency Division MultiplexingFrequency Division Multiplexing

66

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Time Division MultiplexingTime Division Multiplexing

T1 Carrier (1544 Mbps)

77

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Model for Model for Dynamic Channel AllocationDynamic Channel Allocation

bull N independent stations (also called terminals)bull Once a frame has been generated the station is

blocked until the frame is transmitted successfully

bull Single Channel shared by all stationsbull Collision ndash event when two frames transmitted

simultaneously and the resulting signal is garbledndash All stations can detect collisions

88

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Model for Model for Dynamic Channel AllocationDynamic Channel Allocation

bull Frame transmission timendash Continuous Time ndash can begin at any instantndash Slotted Time ndash always begin at the start of a

slot

bull Carrier sense or notndash Carrier sense ndash stations can tell if the channel

is busy Do not send if channel is busyndash No carrier sense ndash just go ahead and send

99

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Multiple Access ProtocolsMultiple Access Protocols

bull ALOHA

bull Carrier Sense Multiple Access Protocols

1010

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHAPure ALOHA

bull Let users transmit whenever they have data to send

bull If frame destroyed (due to collision) sender waits random amount of time sends again

bull User does not listen before transmitting

1111

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHA Vulnerable PeriodPure ALOHA Vulnerable Periodbull Vulnerable period for a frame A collision will

happen if another frame is sent during this period

2 frame time

1212

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Slotted ALOHASlotted ALOHA

bull Idea divide time into intervals each interval corresponds to one framendash Station is permitted to send only at the

beginning of next slot

bull Vulnerable period is halved (1 frame time)ndash Probability of no collision in time slot = e-G

ndash Throughput S = G e-G

ndash Max occurs when G = 1 S = 20184 (G of attempts per frame time)

1313

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Throughput for ALOHA SystemsThroughput for ALOHA Systems

1414

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Carrier Sense Multiple AccessCarrier Sense Multiple Access

bull When station has data to send listens to channel to see if anyone else is transmitting

bull If channel is idle station transmits a framendash Else station waits for it to become idle

bull If collisions occurs station waits random amount of time tries again

bull Also called 1-persistent CSMAndash With probability 1 station will transmit if channel is idle

1515

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

bull After a station starts sending it takes a while before 2nd station receives 1st stationrsquos signalndash 2nd station might start sending before it knows that

another station has already been transmitting

bull If two stations become ready while third station transmittingndash Both wait until transmission ends and start

transmitting collision results

Carrier Sense Multiple AccessCarrier Sense Multiple AccessCollision Still PossibleCollision Still Possible

1616

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

pp-persistent CSMA-persistent CSMAReduce the Probability of CollisionReduce the Probability of Collision

bull Sense continuously but does not always send when channel is idlendash Applicable for slotted channels

bull When ready to send station senses the channelndash If channel idle station transmits with probability p

defers to next slot with probability q = 1-pndash Else (if channel is busy) station waits until next slot tries

againndash If next slot idle station transmits with probability p

defers with probability q = 1-pndash hellip

1717

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Non-Persistent CSMANon-Persistent CSMA

bull Does not sense continuously send if it senses the channel is idle

bull Before sending station senses the channelndash If channel is idle station begins sendingndash Else station does not continuously sense waits

random amount of time tries again

1818

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Persistent and Nonpersistent CSMAPersistent and Nonpersistent CSMA

bull Improves over ALOHA because they ensure no station to transmit when it senses channel is busy

1919

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Minimum time to detect collision

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 6: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

66

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Time Division MultiplexingTime Division Multiplexing

T1 Carrier (1544 Mbps)

77

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Model for Model for Dynamic Channel AllocationDynamic Channel Allocation

bull N independent stations (also called terminals)bull Once a frame has been generated the station is

blocked until the frame is transmitted successfully

bull Single Channel shared by all stationsbull Collision ndash event when two frames transmitted

simultaneously and the resulting signal is garbledndash All stations can detect collisions

88

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Model for Model for Dynamic Channel AllocationDynamic Channel Allocation

bull Frame transmission timendash Continuous Time ndash can begin at any instantndash Slotted Time ndash always begin at the start of a

slot

bull Carrier sense or notndash Carrier sense ndash stations can tell if the channel

is busy Do not send if channel is busyndash No carrier sense ndash just go ahead and send

99

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Multiple Access ProtocolsMultiple Access Protocols

bull ALOHA

bull Carrier Sense Multiple Access Protocols

1010

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHAPure ALOHA

bull Let users transmit whenever they have data to send

bull If frame destroyed (due to collision) sender waits random amount of time sends again

bull User does not listen before transmitting

1111

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHA Vulnerable PeriodPure ALOHA Vulnerable Periodbull Vulnerable period for a frame A collision will

happen if another frame is sent during this period

2 frame time

1212

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Slotted ALOHASlotted ALOHA

bull Idea divide time into intervals each interval corresponds to one framendash Station is permitted to send only at the

beginning of next slot

bull Vulnerable period is halved (1 frame time)ndash Probability of no collision in time slot = e-G

ndash Throughput S = G e-G

ndash Max occurs when G = 1 S = 20184 (G of attempts per frame time)

1313

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Throughput for ALOHA SystemsThroughput for ALOHA Systems

1414

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Carrier Sense Multiple AccessCarrier Sense Multiple Access

bull When station has data to send listens to channel to see if anyone else is transmitting

bull If channel is idle station transmits a framendash Else station waits for it to become idle

bull If collisions occurs station waits random amount of time tries again

bull Also called 1-persistent CSMAndash With probability 1 station will transmit if channel is idle

1515

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

bull After a station starts sending it takes a while before 2nd station receives 1st stationrsquos signalndash 2nd station might start sending before it knows that

another station has already been transmitting

bull If two stations become ready while third station transmittingndash Both wait until transmission ends and start

transmitting collision results

Carrier Sense Multiple AccessCarrier Sense Multiple AccessCollision Still PossibleCollision Still Possible

1616

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

pp-persistent CSMA-persistent CSMAReduce the Probability of CollisionReduce the Probability of Collision

bull Sense continuously but does not always send when channel is idlendash Applicable for slotted channels

bull When ready to send station senses the channelndash If channel idle station transmits with probability p

defers to next slot with probability q = 1-pndash Else (if channel is busy) station waits until next slot tries

againndash If next slot idle station transmits with probability p

defers with probability q = 1-pndash hellip

1717

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Non-Persistent CSMANon-Persistent CSMA

bull Does not sense continuously send if it senses the channel is idle

bull Before sending station senses the channelndash If channel is idle station begins sendingndash Else station does not continuously sense waits

random amount of time tries again

1818

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Persistent and Nonpersistent CSMAPersistent and Nonpersistent CSMA

bull Improves over ALOHA because they ensure no station to transmit when it senses channel is busy

1919

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Minimum time to detect collision

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 7: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

77

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Model for Model for Dynamic Channel AllocationDynamic Channel Allocation

bull N independent stations (also called terminals)bull Once a frame has been generated the station is

blocked until the frame is transmitted successfully

bull Single Channel shared by all stationsbull Collision ndash event when two frames transmitted

simultaneously and the resulting signal is garbledndash All stations can detect collisions

88

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Model for Model for Dynamic Channel AllocationDynamic Channel Allocation

bull Frame transmission timendash Continuous Time ndash can begin at any instantndash Slotted Time ndash always begin at the start of a

slot

bull Carrier sense or notndash Carrier sense ndash stations can tell if the channel

is busy Do not send if channel is busyndash No carrier sense ndash just go ahead and send

99

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Multiple Access ProtocolsMultiple Access Protocols

bull ALOHA

bull Carrier Sense Multiple Access Protocols

1010

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHAPure ALOHA

bull Let users transmit whenever they have data to send

bull If frame destroyed (due to collision) sender waits random amount of time sends again

bull User does not listen before transmitting

1111

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHA Vulnerable PeriodPure ALOHA Vulnerable Periodbull Vulnerable period for a frame A collision will

happen if another frame is sent during this period

2 frame time

1212

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Slotted ALOHASlotted ALOHA

bull Idea divide time into intervals each interval corresponds to one framendash Station is permitted to send only at the

beginning of next slot

bull Vulnerable period is halved (1 frame time)ndash Probability of no collision in time slot = e-G

ndash Throughput S = G e-G

ndash Max occurs when G = 1 S = 20184 (G of attempts per frame time)

1313

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Throughput for ALOHA SystemsThroughput for ALOHA Systems

1414

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Carrier Sense Multiple AccessCarrier Sense Multiple Access

bull When station has data to send listens to channel to see if anyone else is transmitting

bull If channel is idle station transmits a framendash Else station waits for it to become idle

bull If collisions occurs station waits random amount of time tries again

bull Also called 1-persistent CSMAndash With probability 1 station will transmit if channel is idle

1515

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

bull After a station starts sending it takes a while before 2nd station receives 1st stationrsquos signalndash 2nd station might start sending before it knows that

another station has already been transmitting

bull If two stations become ready while third station transmittingndash Both wait until transmission ends and start

transmitting collision results

Carrier Sense Multiple AccessCarrier Sense Multiple AccessCollision Still PossibleCollision Still Possible

1616

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

pp-persistent CSMA-persistent CSMAReduce the Probability of CollisionReduce the Probability of Collision

bull Sense continuously but does not always send when channel is idlendash Applicable for slotted channels

bull When ready to send station senses the channelndash If channel idle station transmits with probability p

defers to next slot with probability q = 1-pndash Else (if channel is busy) station waits until next slot tries

againndash If next slot idle station transmits with probability p

defers with probability q = 1-pndash hellip

1717

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Non-Persistent CSMANon-Persistent CSMA

bull Does not sense continuously send if it senses the channel is idle

bull Before sending station senses the channelndash If channel is idle station begins sendingndash Else station does not continuously sense waits

random amount of time tries again

1818

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Persistent and Nonpersistent CSMAPersistent and Nonpersistent CSMA

bull Improves over ALOHA because they ensure no station to transmit when it senses channel is busy

1919

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Minimum time to detect collision

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 8: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

88

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Model for Model for Dynamic Channel AllocationDynamic Channel Allocation

bull Frame transmission timendash Continuous Time ndash can begin at any instantndash Slotted Time ndash always begin at the start of a

slot

bull Carrier sense or notndash Carrier sense ndash stations can tell if the channel

is busy Do not send if channel is busyndash No carrier sense ndash just go ahead and send

99

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Multiple Access ProtocolsMultiple Access Protocols

bull ALOHA

bull Carrier Sense Multiple Access Protocols

1010

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHAPure ALOHA

bull Let users transmit whenever they have data to send

bull If frame destroyed (due to collision) sender waits random amount of time sends again

bull User does not listen before transmitting

1111

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHA Vulnerable PeriodPure ALOHA Vulnerable Periodbull Vulnerable period for a frame A collision will

happen if another frame is sent during this period

2 frame time

1212

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Slotted ALOHASlotted ALOHA

bull Idea divide time into intervals each interval corresponds to one framendash Station is permitted to send only at the

beginning of next slot

bull Vulnerable period is halved (1 frame time)ndash Probability of no collision in time slot = e-G

ndash Throughput S = G e-G

ndash Max occurs when G = 1 S = 20184 (G of attempts per frame time)

1313

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Throughput for ALOHA SystemsThroughput for ALOHA Systems

1414

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Carrier Sense Multiple AccessCarrier Sense Multiple Access

bull When station has data to send listens to channel to see if anyone else is transmitting

bull If channel is idle station transmits a framendash Else station waits for it to become idle

bull If collisions occurs station waits random amount of time tries again

bull Also called 1-persistent CSMAndash With probability 1 station will transmit if channel is idle

1515

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

bull After a station starts sending it takes a while before 2nd station receives 1st stationrsquos signalndash 2nd station might start sending before it knows that

another station has already been transmitting

bull If two stations become ready while third station transmittingndash Both wait until transmission ends and start

transmitting collision results

Carrier Sense Multiple AccessCarrier Sense Multiple AccessCollision Still PossibleCollision Still Possible

1616

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

pp-persistent CSMA-persistent CSMAReduce the Probability of CollisionReduce the Probability of Collision

bull Sense continuously but does not always send when channel is idlendash Applicable for slotted channels

bull When ready to send station senses the channelndash If channel idle station transmits with probability p

defers to next slot with probability q = 1-pndash Else (if channel is busy) station waits until next slot tries

againndash If next slot idle station transmits with probability p

defers with probability q = 1-pndash hellip

1717

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Non-Persistent CSMANon-Persistent CSMA

bull Does not sense continuously send if it senses the channel is idle

bull Before sending station senses the channelndash If channel is idle station begins sendingndash Else station does not continuously sense waits

random amount of time tries again

1818

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Persistent and Nonpersistent CSMAPersistent and Nonpersistent CSMA

bull Improves over ALOHA because they ensure no station to transmit when it senses channel is busy

1919

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Minimum time to detect collision

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 9: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

99

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Multiple Access ProtocolsMultiple Access Protocols

bull ALOHA

bull Carrier Sense Multiple Access Protocols

1010

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHAPure ALOHA

bull Let users transmit whenever they have data to send

bull If frame destroyed (due to collision) sender waits random amount of time sends again

bull User does not listen before transmitting

1111

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHA Vulnerable PeriodPure ALOHA Vulnerable Periodbull Vulnerable period for a frame A collision will

happen if another frame is sent during this period

2 frame time

1212

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Slotted ALOHASlotted ALOHA

bull Idea divide time into intervals each interval corresponds to one framendash Station is permitted to send only at the

beginning of next slot

bull Vulnerable period is halved (1 frame time)ndash Probability of no collision in time slot = e-G

ndash Throughput S = G e-G

ndash Max occurs when G = 1 S = 20184 (G of attempts per frame time)

1313

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Throughput for ALOHA SystemsThroughput for ALOHA Systems

1414

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Carrier Sense Multiple AccessCarrier Sense Multiple Access

bull When station has data to send listens to channel to see if anyone else is transmitting

bull If channel is idle station transmits a framendash Else station waits for it to become idle

bull If collisions occurs station waits random amount of time tries again

bull Also called 1-persistent CSMAndash With probability 1 station will transmit if channel is idle

1515

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

bull After a station starts sending it takes a while before 2nd station receives 1st stationrsquos signalndash 2nd station might start sending before it knows that

another station has already been transmitting

bull If two stations become ready while third station transmittingndash Both wait until transmission ends and start

transmitting collision results

Carrier Sense Multiple AccessCarrier Sense Multiple AccessCollision Still PossibleCollision Still Possible

1616

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

pp-persistent CSMA-persistent CSMAReduce the Probability of CollisionReduce the Probability of Collision

bull Sense continuously but does not always send when channel is idlendash Applicable for slotted channels

bull When ready to send station senses the channelndash If channel idle station transmits with probability p

defers to next slot with probability q = 1-pndash Else (if channel is busy) station waits until next slot tries

againndash If next slot idle station transmits with probability p

defers with probability q = 1-pndash hellip

1717

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Non-Persistent CSMANon-Persistent CSMA

bull Does not sense continuously send if it senses the channel is idle

bull Before sending station senses the channelndash If channel is idle station begins sendingndash Else station does not continuously sense waits

random amount of time tries again

1818

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Persistent and Nonpersistent CSMAPersistent and Nonpersistent CSMA

bull Improves over ALOHA because they ensure no station to transmit when it senses channel is busy

1919

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Minimum time to detect collision

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 10: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

1010

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHAPure ALOHA

bull Let users transmit whenever they have data to send

bull If frame destroyed (due to collision) sender waits random amount of time sends again

bull User does not listen before transmitting

1111

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHA Vulnerable PeriodPure ALOHA Vulnerable Periodbull Vulnerable period for a frame A collision will

happen if another frame is sent during this period

2 frame time

1212

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Slotted ALOHASlotted ALOHA

bull Idea divide time into intervals each interval corresponds to one framendash Station is permitted to send only at the

beginning of next slot

bull Vulnerable period is halved (1 frame time)ndash Probability of no collision in time slot = e-G

ndash Throughput S = G e-G

ndash Max occurs when G = 1 S = 20184 (G of attempts per frame time)

1313

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Throughput for ALOHA SystemsThroughput for ALOHA Systems

1414

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Carrier Sense Multiple AccessCarrier Sense Multiple Access

bull When station has data to send listens to channel to see if anyone else is transmitting

bull If channel is idle station transmits a framendash Else station waits for it to become idle

bull If collisions occurs station waits random amount of time tries again

bull Also called 1-persistent CSMAndash With probability 1 station will transmit if channel is idle

1515

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

bull After a station starts sending it takes a while before 2nd station receives 1st stationrsquos signalndash 2nd station might start sending before it knows that

another station has already been transmitting

bull If two stations become ready while third station transmittingndash Both wait until transmission ends and start

transmitting collision results

Carrier Sense Multiple AccessCarrier Sense Multiple AccessCollision Still PossibleCollision Still Possible

1616

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

pp-persistent CSMA-persistent CSMAReduce the Probability of CollisionReduce the Probability of Collision

bull Sense continuously but does not always send when channel is idlendash Applicable for slotted channels

bull When ready to send station senses the channelndash If channel idle station transmits with probability p

defers to next slot with probability q = 1-pndash Else (if channel is busy) station waits until next slot tries

againndash If next slot idle station transmits with probability p

defers with probability q = 1-pndash hellip

1717

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Non-Persistent CSMANon-Persistent CSMA

bull Does not sense continuously send if it senses the channel is idle

bull Before sending station senses the channelndash If channel is idle station begins sendingndash Else station does not continuously sense waits

random amount of time tries again

1818

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Persistent and Nonpersistent CSMAPersistent and Nonpersistent CSMA

bull Improves over ALOHA because they ensure no station to transmit when it senses channel is busy

1919

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Minimum time to detect collision

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 11: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

1111

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Pure ALOHA Vulnerable PeriodPure ALOHA Vulnerable Periodbull Vulnerable period for a frame A collision will

happen if another frame is sent during this period

2 frame time

1212

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Slotted ALOHASlotted ALOHA

bull Idea divide time into intervals each interval corresponds to one framendash Station is permitted to send only at the

beginning of next slot

bull Vulnerable period is halved (1 frame time)ndash Probability of no collision in time slot = e-G

ndash Throughput S = G e-G

ndash Max occurs when G = 1 S = 20184 (G of attempts per frame time)

1313

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Throughput for ALOHA SystemsThroughput for ALOHA Systems

1414

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Carrier Sense Multiple AccessCarrier Sense Multiple Access

bull When station has data to send listens to channel to see if anyone else is transmitting

bull If channel is idle station transmits a framendash Else station waits for it to become idle

bull If collisions occurs station waits random amount of time tries again

bull Also called 1-persistent CSMAndash With probability 1 station will transmit if channel is idle

1515

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

bull After a station starts sending it takes a while before 2nd station receives 1st stationrsquos signalndash 2nd station might start sending before it knows that

another station has already been transmitting

bull If two stations become ready while third station transmittingndash Both wait until transmission ends and start

transmitting collision results

Carrier Sense Multiple AccessCarrier Sense Multiple AccessCollision Still PossibleCollision Still Possible

1616

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

pp-persistent CSMA-persistent CSMAReduce the Probability of CollisionReduce the Probability of Collision

bull Sense continuously but does not always send when channel is idlendash Applicable for slotted channels

bull When ready to send station senses the channelndash If channel idle station transmits with probability p

defers to next slot with probability q = 1-pndash Else (if channel is busy) station waits until next slot tries

againndash If next slot idle station transmits with probability p

defers with probability q = 1-pndash hellip

1717

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Non-Persistent CSMANon-Persistent CSMA

bull Does not sense continuously send if it senses the channel is idle

bull Before sending station senses the channelndash If channel is idle station begins sendingndash Else station does not continuously sense waits

random amount of time tries again

1818

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Persistent and Nonpersistent CSMAPersistent and Nonpersistent CSMA

bull Improves over ALOHA because they ensure no station to transmit when it senses channel is busy

1919

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Minimum time to detect collision

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 12: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

1212

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Slotted ALOHASlotted ALOHA

bull Idea divide time into intervals each interval corresponds to one framendash Station is permitted to send only at the

beginning of next slot

bull Vulnerable period is halved (1 frame time)ndash Probability of no collision in time slot = e-G

ndash Throughput S = G e-G

ndash Max occurs when G = 1 S = 20184 (G of attempts per frame time)

1313

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Throughput for ALOHA SystemsThroughput for ALOHA Systems

1414

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Carrier Sense Multiple AccessCarrier Sense Multiple Access

bull When station has data to send listens to channel to see if anyone else is transmitting

bull If channel is idle station transmits a framendash Else station waits for it to become idle

bull If collisions occurs station waits random amount of time tries again

bull Also called 1-persistent CSMAndash With probability 1 station will transmit if channel is idle

1515

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

bull After a station starts sending it takes a while before 2nd station receives 1st stationrsquos signalndash 2nd station might start sending before it knows that

another station has already been transmitting

bull If two stations become ready while third station transmittingndash Both wait until transmission ends and start

transmitting collision results

Carrier Sense Multiple AccessCarrier Sense Multiple AccessCollision Still PossibleCollision Still Possible

1616

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

pp-persistent CSMA-persistent CSMAReduce the Probability of CollisionReduce the Probability of Collision

bull Sense continuously but does not always send when channel is idlendash Applicable for slotted channels

bull When ready to send station senses the channelndash If channel idle station transmits with probability p

defers to next slot with probability q = 1-pndash Else (if channel is busy) station waits until next slot tries

againndash If next slot idle station transmits with probability p

defers with probability q = 1-pndash hellip

1717

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Non-Persistent CSMANon-Persistent CSMA

bull Does not sense continuously send if it senses the channel is idle

bull Before sending station senses the channelndash If channel is idle station begins sendingndash Else station does not continuously sense waits

random amount of time tries again

1818

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Persistent and Nonpersistent CSMAPersistent and Nonpersistent CSMA

bull Improves over ALOHA because they ensure no station to transmit when it senses channel is busy

1919

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Minimum time to detect collision

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 13: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

1313

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Throughput for ALOHA SystemsThroughput for ALOHA Systems

1414

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Carrier Sense Multiple AccessCarrier Sense Multiple Access

bull When station has data to send listens to channel to see if anyone else is transmitting

bull If channel is idle station transmits a framendash Else station waits for it to become idle

bull If collisions occurs station waits random amount of time tries again

bull Also called 1-persistent CSMAndash With probability 1 station will transmit if channel is idle

1515

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

bull After a station starts sending it takes a while before 2nd station receives 1st stationrsquos signalndash 2nd station might start sending before it knows that

another station has already been transmitting

bull If two stations become ready while third station transmittingndash Both wait until transmission ends and start

transmitting collision results

Carrier Sense Multiple AccessCarrier Sense Multiple AccessCollision Still PossibleCollision Still Possible

1616

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

pp-persistent CSMA-persistent CSMAReduce the Probability of CollisionReduce the Probability of Collision

bull Sense continuously but does not always send when channel is idlendash Applicable for slotted channels

bull When ready to send station senses the channelndash If channel idle station transmits with probability p

defers to next slot with probability q = 1-pndash Else (if channel is busy) station waits until next slot tries

againndash If next slot idle station transmits with probability p

defers with probability q = 1-pndash hellip

1717

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Non-Persistent CSMANon-Persistent CSMA

bull Does not sense continuously send if it senses the channel is idle

bull Before sending station senses the channelndash If channel is idle station begins sendingndash Else station does not continuously sense waits

random amount of time tries again

1818

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Persistent and Nonpersistent CSMAPersistent and Nonpersistent CSMA

bull Improves over ALOHA because they ensure no station to transmit when it senses channel is busy

1919

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Minimum time to detect collision

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 14: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

1414

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Carrier Sense Multiple AccessCarrier Sense Multiple Access

bull When station has data to send listens to channel to see if anyone else is transmitting

bull If channel is idle station transmits a framendash Else station waits for it to become idle

bull If collisions occurs station waits random amount of time tries again

bull Also called 1-persistent CSMAndash With probability 1 station will transmit if channel is idle

1515

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

bull After a station starts sending it takes a while before 2nd station receives 1st stationrsquos signalndash 2nd station might start sending before it knows that

another station has already been transmitting

bull If two stations become ready while third station transmittingndash Both wait until transmission ends and start

transmitting collision results

Carrier Sense Multiple AccessCarrier Sense Multiple AccessCollision Still PossibleCollision Still Possible

1616

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

pp-persistent CSMA-persistent CSMAReduce the Probability of CollisionReduce the Probability of Collision

bull Sense continuously but does not always send when channel is idlendash Applicable for slotted channels

bull When ready to send station senses the channelndash If channel idle station transmits with probability p

defers to next slot with probability q = 1-pndash Else (if channel is busy) station waits until next slot tries

againndash If next slot idle station transmits with probability p

defers with probability q = 1-pndash hellip

1717

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Non-Persistent CSMANon-Persistent CSMA

bull Does not sense continuously send if it senses the channel is idle

bull Before sending station senses the channelndash If channel is idle station begins sendingndash Else station does not continuously sense waits

random amount of time tries again

1818

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Persistent and Nonpersistent CSMAPersistent and Nonpersistent CSMA

bull Improves over ALOHA because they ensure no station to transmit when it senses channel is busy

1919

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Minimum time to detect collision

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 15: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

1515

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

bull After a station starts sending it takes a while before 2nd station receives 1st stationrsquos signalndash 2nd station might start sending before it knows that

another station has already been transmitting

bull If two stations become ready while third station transmittingndash Both wait until transmission ends and start

transmitting collision results

Carrier Sense Multiple AccessCarrier Sense Multiple AccessCollision Still PossibleCollision Still Possible

1616

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

pp-persistent CSMA-persistent CSMAReduce the Probability of CollisionReduce the Probability of Collision

bull Sense continuously but does not always send when channel is idlendash Applicable for slotted channels

bull When ready to send station senses the channelndash If channel idle station transmits with probability p

defers to next slot with probability q = 1-pndash Else (if channel is busy) station waits until next slot tries

againndash If next slot idle station transmits with probability p

defers with probability q = 1-pndash hellip

1717

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Non-Persistent CSMANon-Persistent CSMA

bull Does not sense continuously send if it senses the channel is idle

bull Before sending station senses the channelndash If channel is idle station begins sendingndash Else station does not continuously sense waits

random amount of time tries again

1818

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Persistent and Nonpersistent CSMAPersistent and Nonpersistent CSMA

bull Improves over ALOHA because they ensure no station to transmit when it senses channel is busy

1919

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Minimum time to detect collision

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 16: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

1616

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

pp-persistent CSMA-persistent CSMAReduce the Probability of CollisionReduce the Probability of Collision

bull Sense continuously but does not always send when channel is idlendash Applicable for slotted channels

bull When ready to send station senses the channelndash If channel idle station transmits with probability p

defers to next slot with probability q = 1-pndash Else (if channel is busy) station waits until next slot tries

againndash If next slot idle station transmits with probability p

defers with probability q = 1-pndash hellip

1717

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Non-Persistent CSMANon-Persistent CSMA

bull Does not sense continuously send if it senses the channel is idle

bull Before sending station senses the channelndash If channel is idle station begins sendingndash Else station does not continuously sense waits

random amount of time tries again

1818

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Persistent and Nonpersistent CSMAPersistent and Nonpersistent CSMA

bull Improves over ALOHA because they ensure no station to transmit when it senses channel is busy

1919

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Minimum time to detect collision

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 17: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

1717

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Non-Persistent CSMANon-Persistent CSMA

bull Does not sense continuously send if it senses the channel is idle

bull Before sending station senses the channelndash If channel is idle station begins sendingndash Else station does not continuously sense waits

random amount of time tries again

1818

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Persistent and Nonpersistent CSMAPersistent and Nonpersistent CSMA

bull Improves over ALOHA because they ensure no station to transmit when it senses channel is busy

1919

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Minimum time to detect collision

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 18: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

1818

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Persistent and Nonpersistent CSMAPersistent and Nonpersistent CSMA

bull Improves over ALOHA because they ensure no station to transmit when it senses channel is busy

1919

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Minimum time to detect collision

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 19: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

1919

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Minimum time to detect collision

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 20: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

2020

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Minimum Time to Detect CollisionMinimum Time to Detect Collision

bull To ensure the sender can detect collisionndash All frames must take more than 2 to send so that

transmission is still taking place when the noise burst gets back to the sender

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 21: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

2121

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Manchester EncodingManchester Encodingbull Binary encoding

ndash Hard to distinguish 0 bit (0-volt) from idle (0-volt)ndash Requires clocks of all stations synchronized

bull Manchester encoding and differential Manchester encoding

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 22: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

2222

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Preamble for clock synchronization

ndash First 7 bytes with pattern 10101010 last byte with pattern 10101011

ndash The two consecutive 1rsquos indicate the start of a frame

bull How can the receiver tell the end of the framendash No current on the wire (interesting discussion at

httpwwwtomshardwarecomforum19951-42-detecting-length-ethernet-frame)

gt= 64 bytesNot considered as part of the

header

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 23: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

2323

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet Frame StructureEthernet Frame Structurebull Destination address 6 bytes (48 bits)

ndash Highest order bit 0 individual 1 multicast all 1rsquos broadcast

ndash Frames received with non-matching destination address is discarded

bull TypeLength type of network layer protocol (or length of payload)

bull Pad ndash used to produce valid frame gt= 64 bytesbull Checksum ndash 32-bit cyclic redundancy check

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 24: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

2424

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

CSMA with Collision DetectionCSMA with Collision Detection

bull If two stations start transmitting simultaneously both detect collision and stop transmitting

bull Monitor collision while sendingndash Minimum time to detect collision =gt minimum frame

length

bull Time divided into slotsndash Length of slot = 2 = worst-case round-trip propagation

timendash To accommodate longest path slot time = 512 bit

times = 512 sec (10Mbps Ethernet) =gt min frame length 512 sec X 10 Mbps = 512 b = 64 byte

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 25: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

2525

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2525

Ethernet MAC Sublayer ProtocolEthernet MAC Sublayer Protocol

bull Connectionless No handshaking between sending and receiving NICs ndash Ethernet resides in the Network Interface Card (NIC)

bull Unreliable receiving NIC doesnrsquot send acks or nacks to sending NICndash stream of datagrams passed to network layer can have gaps

(missing datagrams)ndash gaps will be filled if app is using TCPndash otherwise app will see gaps

bull Ethernetrsquos MAC protocol CSMACD

041823041823

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 26: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

2626

EEC-484584 Computer NetworksEEC-484584 Computer Networks 5-5-2626

Ethernet CSMACD algorithmEthernet CSMACD algorithm

1 NIC receives datagram from network layer creates frame

2 If NIC senses channel idle starts frame transmission If NIC senses channel busy waits until channel idle then transmits

3 If NIC transmits entire frame without detecting another transmission NIC is done with frame

4 If NIC detects another transmission while transmitting aborts and sends jam signal

5 After aborting NIC enters exponential backoff after mth collision NIC chooses K at random from 012hellip2m-1 NIC waits K512 bit times returns to Step 2

041823041823

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 27: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

2727

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Randomization and Randomization and Binary Exponential BackoffBinary Exponential Backoff

bull After 1st collision station picks 0 or 1 at random waits that number of slots and tries again

bull After 2nd collision station picks 0123 at random waits that number of slots and tries again

bull hellipbull After i-th collision station picks 01hellip2i-1 at random hellipbull If 10 lt= i lt 16 station picks 01hellip210-1 at randombull If i=16 controller reports failure to computer

Why randomization is needed

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 28: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

2828

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

Ethernet PerformanceEthernet Performance

bull Binary exponential backoff results inndash Low delay when few stations collidendash Reasonable delay for collision resolution

when many stations collide

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 29: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

2929

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull An IP packet to be transmitted by Ethernet is 60 bytes long Is padding needed in the Ethernet frame and if so how many bytes

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size

Page 30: EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz@gmail.com.

3030

041823041823 EEC-484584 Computer NetworksEEC-484584 Computer Networks Wenbing ZhaoWenbing Zhao

ExerciseExercise

bull Consider building a CSMACD network running at 1 Gbps over a 1-km cable The signal speed in the cable is 200000 kmsec What is the minimum frame size