47
March 22, 2004 March 22, 2004 Prof. Paul Lin Prof. Paul Lin 1 CPET 355 CPET 355 4. The Medium Access Control 4. The Medium Access Control Sublayer Sublayer Paul I-Hai Lin, Professor Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology Electrical and Computer Engineering Technology Purdue University, Fort Wayne Campus Purdue University, Fort Wayne Campus

March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

Embed Size (px)

Citation preview

Page 1: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 11

CPET 355 CPET 355

4. The Medium Access Control 4. The Medium Access Control SublayerSublayer

Paul I-Hai Lin, Professor Paul I-Hai Lin, Professor Electrical and Computer Engineering TechnologyElectrical and Computer Engineering Technology

Purdue University, Fort Wayne CampusPurdue University, Fort Wayne Campus

Page 2: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 22

MAC SublayersMAC Sublayers

The Channel Allocation ProblemThe Channel Allocation Problem Multiple Access ProtocolsMultiple Access Protocols EthernetEthernet Wireless LANsWireless LANs Broadband WirelessBroadband Wireless BluetoothBluetooth Data Link Layer SwitchingData Link Layer Switching

Page 3: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 33

The Channel Allocation ProblemThe Channel Allocation Problem

Static Channel AllocationStatic Channel Allocation• Frequency Division Multiplexing (FDM) – poor Frequency Division Multiplexing (FDM) – poor

utilizationutilization• Time Division Multiplexing (TDM) – poor utilizationTime Division Multiplexing (TDM) – poor utilization

Dynamic Channel AllocationDynamic Channel Allocation• Station ModelStation Model• Single Channel AssumptionSingle Channel Assumption• Collision AssumptionCollision Assumption• Continuous Time, Slotted TimeContinuous Time, Slotted Time• Carrier Sense, No Carrier SenseCarrier Sense, No Carrier Sense

Page 4: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 44

Multiple Access ProtocolsMultiple Access Protocols

ALOHA – 1970, University of HawaiiALOHA – 1970, University of Hawaii• Pure ALOHA, Slotted ALOHAPure ALOHA, Slotted ALOHA

CSMA (Carrier Sense Multiple Access) – CSMA (Carrier Sense Multiple Access) – 1975, contention-based1975, contention-based• Persistent and Non-persistent CSMAPersistent and Non-persistent CSMA• CSMA/CD (Collision Detection) CSMA/CD (Collision Detection)

Collision-Free ProtocolCollision-Free Protocol• Bit-MappedBit-Mapped• Binary CountdownBinary Countdown

Page 5: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 55

CSMA/CD ProtocolCSMA/CD Protocol

A multiple access network: a set of nodes A multiple access network: a set of nodes or stations send and receive frames over a or stations send and receive frames over a shared linkshared link

Time-division multiplexed busTime-division multiplexed bus Carrier Sense - means that all the nodes Carrier Sense - means that all the nodes

can distinguish between an idle and a can distinguish between an idle and a busy linkbusy link

Page 6: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 66

CSMA/CD Access RuleCSMA/CD Access Rule

Step 1. All stations listen to the transmission Step 1. All stations listen to the transmission medium. medium.

1a. If the medium is idle, transmit; 1a. If the medium is idle, transmit; otherwise, go to step 2 (listen)otherwise, go to step 2 (listen)

1b. If a collision is detected during 1b. If a collision is detected during transmission, transmit a brief jamming transmission, transmit a brief jamming signal to ensure that all stations know that signal to ensure that all stations know that there has been a collision and then cease there has been a collision and then cease transmissiontransmission

Page 7: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 77

CSMA/CD Access RuleCSMA/CD Access Rule

1c. After transmitting the jamming signal, 1c. After transmitting the jamming signal, wait a random amount of time, then wait a random amount of time, then attempt to transmit againattempt to transmit again

Step 2. If the medium is busy, continue to Step 2. If the medium is busy, continue to listen until the channel is idle, then listen until the channel is idle, then transmit immediatelytransmit immediately

Page 8: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 88

CSMA/CD Protocol CSMA/CD Protocol (cont.)(cont.)

Collision Detection - means that a node Collision Detection - means that a node listens as it transmits, and can therefore listens as it transmits, and can therefore detect a frame when it is transmitting has detect a frame when it is transmitting has interfered (collided) with a frame interfered (collided) with a frame transmitted by another nodetransmitted by another node

When a station is in transmission, When a station is in transmission, according to the CSMA/CD scheme no according to the CSMA/CD scheme no other station may transmit.other station may transmit.

Page 9: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 99

Collision DetectionCollision Detection

If two stations transmit at once, their If two stations transmit at once, their signals interfere with each other signals interfere with each other

Since each sender listens (sense the Since each sender listens (sense the carrier) before the transmission, they know carrier) before the transmission, they know that there has been a collision that there has been a collision

Both of the stations stop and wait a Both of the stations stop and wait a random amount time before next attempt random amount time before next attempt to transmitto transmit

Page 10: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 1010

CSMA/CD State DiagramCSMA/CD State Diagram

MediumIdle?

Transmit

Channel isBusy

YesNo

Transmit abrief

jammingSignal

Wait for arandom

amount oftime

Tryagain

Tryagain

Channel Busy

Page 11: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 1111

Multiple Access ProtocolsMultiple Access Protocols

Limited-Content ProtocolsLimited-Content Protocols• The Adaptive Tree Walk ProtocolThe Adaptive Tree Walk Protocol

Wavelength Division Multiple Access Protocol Wavelength Division Multiple Access Protocol (WDMA)(WDMA)

Wireless LAN ProtocolsWireless LAN Protocols• Multiple Access with Collision Avoidance (MACA, Multiple Access with Collision Avoidance (MACA,

Karn 1990)Karn 1990)• Multiple Access with Collision Avoidance for Wireless Multiple Access with Collision Avoidance for Wireless

(MACA for Wirelss, Bharghavan, et. Al, 1994)(MACA for Wirelss, Bharghavan, et. Al, 1994)

Page 12: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 1212

EthernetEthernet

IEEE StandardsIEEE Standards• IEEE 802.3 (Ethernet)IEEE 802.3 (Ethernet)• IEEE 802.11 (Wireless LAN)IEEE 802.11 (Wireless LAN)• IEEE 802.15 (Bluetooth)IEEE 802.15 (Bluetooth)• IEEE 802.16 (Wireless MAN)IEEE 802.16 (Wireless MAN)

IEEE 802.3 IEEE 802.3 • Access Methodology – CSMA/CDAccess Methodology – CSMA/CD• Logical Topology – BroadcastLogical Topology – Broadcast• Physical Topology – StarPhysical Topology – Star

Page 13: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 1313

LAN TechnologyLAN Technology

MAC Lower Sublayer MAC Lower Sublayer • Medium Access Control - Different options for Medium Access Control - Different options for

IEEE 802.x IEEE 802.x • 802.3 (Ethernet, CSMA/CD or Carrier Sensed 802.3 (Ethernet, CSMA/CD or Carrier Sensed

Multiple Access/Collision Detection)Multiple Access/Collision Detection)• 802.4 (Token Bus) - obsolete802.4 (Token Bus) - obsolete• 802.5 (Token Ring)802.5 (Token Ring)

Page 14: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 1414

Layers of TCP/IP over LANLayers of TCP/IP over LAN

Application Layer (http, ftp, telnet, etc)Application Layer (http, ftp, telnet, etc) TCP LayerTCP Layer IP LayerIP Layer LLC Layer (Logical Link Control)LLC Layer (Logical Link Control) MAC Layer (Medium Access Control)MAC Layer (Medium Access Control) Physical LayerPhysical Layer

Page 15: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 1515

LAN SwitchLAN Switch

Server

Printer

Ethernet Card

Hub

10BASE-T wall plate

10BASE-T wall plate

10BASE-T wall plate

Ethernet Card

Print Server

10BaseT Ethernet Hub

Station A

Station BEthernet Card

Station C

Transmit

Page 16: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 1616

IEEE 802.3 - EthernetIEEE 802.3 - Ethernet

IEEE 802.3 CSMA/CDIEEE 802.3 CSMA/CD• Carrier Sensed Multiple Access/Collision Carrier Sensed Multiple Access/Collision

DetectionDetection• Access Medium Access Medium

Base band coaxial cableBase band coaxial cable Unshield twisted pair (UTP)Unshield twisted pair (UTP) Shield twisted pairShield twisted pair Broadband coaxial cablesBroadband coaxial cables Optical fiberOptical fiber

Page 17: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 1717

Cable TopologyCable Topology

Linear Bus (tap)Linear Bus (tap) Spine (backbone)Spine (backbone) StarStar TreeTree MashMash Segmented (repeater, bridge)Segmented (repeater, bridge)

Page 18: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 1818

EthernetEthernet

Ethernet Cabling (10 M bits/second)Ethernet Cabling (10 M bits/second)• 10Base5, Thick coax, 500m, 100 nodes/seg, 10Base5, Thick coax, 500m, 100 nodes/seg,

obsoleteobsolete• 10Base2, Thin coax, 185 m, 30 nodes/seg, no 10Base2, Thin coax, 185 m, 30 nodes/seg, no

hub neededhub needed• 10BaseT, Twisted pair, 100 m, 1024 10BaseT, Twisted pair, 100 m, 1024

nodes/seg, cheapestnodes/seg, cheapest• 10BaseF, Fiber optics, 2000 m, 1024 10BaseF, Fiber optics, 2000 m, 1024

nodes/seg, between buildingsnodes/seg, between buildings• 100BaseT100BaseT

Page 19: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 1919

Other Devices/ConnectionsOther Devices/Connections

Transceiver TapTransceiver Tap• A connecting mechanism that allows the A connecting mechanism that allows the

transceiver to tap into the cable line at any transceiver to tap into the cable line at any pointpoint

BNC-T connectorBNC-T connector• A T-shaped device with three ports: use for A T-shaped device with three ports: use for

the NIC and one each for the input and output the NIC and one each for the input and output ends of cables.ends of cables.

Page 20: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 2020

High Speed EthernetHigh Speed Ethernet

100BaseT Ethernet Cabling (CSMA/CD, 100BaseT Ethernet Cabling (CSMA/CD, IEEE 802.3u, 100 M bits/second, base IEEE 802.3u, 100 M bits/second, base band, up to 2 repeaters/hubs, 210 m band, up to 2 repeaters/hubs, 210 m diameter)diameter)• 100BaseTX - Twisted pair, two-pair Cat 5 100BaseTX - Twisted pair, two-pair Cat 5

UTPUTP• 100BaseT4 – 4-pair, Cat 3,4 or 5 UTP100BaseT4 – 4-pair, Cat 3,4 or 5 UTP• 100BaseFX – Duplex multimode fiber-optics 100BaseFX – Duplex multimode fiber-optics

cablecable

Page 21: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 2121

Giga-Bit EthernetGiga-Bit Ethernet

1000BaseT Ethernet Cabling (CSMA/CD, 1000BaseT Ethernet Cabling (CSMA/CD, IEEE 802.3z, 1000M bits/second)IEEE 802.3z, 1000M bits/second)• 1000BaseSX – 850nm short wave length 1000BaseSX – 850nm short wave length

laser fiber-media, laying on floorlaser fiber-media, laying on floor• 1000BaseLX – 1300 nm long wave length 1000BaseLX – 1300 nm long wave length

laser fiber media, backbonelaser fiber media, backbone• 1000BaseCX – Copper twinaxial cable, 25m 1000BaseCX – Copper twinaxial cable, 25m

distance, data centerdistance, data center• 1000BaseTX – UTP Cat 5, 100 m1000BaseTX – UTP Cat 5, 100 m

Page 22: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 2222

Signal EncodingSignal Encoding

Binary EncodingBinary Encoding• 1 = + V, 0 = -V;1 = + V, 0 = -V;

1 0 1 1 1 0

Page 23: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 2323

Signal EncodingSignal Encoding

Manchester Encoding (Ethernet)Manchester Encoding (Ethernet)• High +0.85 V, Low -0.85 VHigh +0.85 V, Low -0.85 V• One bit has two equal intervals, non-return to One bit has two equal intervals, non-return to

zerozero• 0 – Low to high, 1 – High to low0 – Low to high, 1 – High to low

1 0 1 1 1 0

Page 24: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 2424

IEEE 802.3 Frame Format IEEE 802.3 Frame Format (64 to 1518 Octets)(64 to 1518 Octets)

Preamble – 7 octets or 56 bit(synch. )Preamble – 7 octets or 56 bit(synch. ) Start Frame Delimiter – 1 octet or 8-bitStart Frame Delimiter – 1 octet or 8-bit Destination Address – 2 to 6 octetsDestination Address – 2 to 6 octets Source Address – 2 to 6 octetsSource Address – 2 to 6 octets Length of Protocol Data Unit (PDU) – 2 octetsLength of Protocol Data Unit (PDU) – 2 octets LLC or 802.2 Data Frame – 46 to 1500 bytesLLC or 802.2 Data Frame – 46 to 1500 bytes CRC or Frame Check Sequence – 4 OctetsCRC or Frame Check Sequence – 4 Octets

Pre. SFD D.Addr S.Assr Len Data Pad CkSum

Page 25: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 2525

IEEE 802.3 Frame FormatIEEE 802.3 Frame Format

Minimum frame size – 64 octetsMinimum frame size – 64 octets• Overhead 18 octetsOverhead 18 octets• 46-byte min data field46-byte min data field

PreamblePreamble• 7-bytes (56 bits) pattern of alternating 1s and 7-bytes (56 bits) pattern of alternating 1s and

0’s (1010101..) 0’s (1010101..) • Alert the receiving station to the incoming Alert the receiving station to the incoming

frame, and enable it to synchronize its input frame, and enable it to synchronize its input timing.timing.

Page 26: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 2626

IEEE 802.3 Frame FormatIEEE 802.3 Frame Format

Start Frame Delimiter (SFD) Start Frame Delimiter (SFD) • The second field (one byte 10101011) of the The second field (one byte 10101011) of the

frame indicates the beginning of the frameframe indicates the beginning of the frame• It tells the receiver that the next thing coming It tells the receiver that the next thing coming

is the destination address of the receiveris the destination address of the receiver

Page 27: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 2727

IEEE 802.3 Frame FormatIEEE 802.3 Frame Format

Destination Address (DA) Destination Address (DA) • When the packet reaches the target network, the DA When the packet reaches the target network, the DA

field contains the physical address of the destination field contains the physical address of the destination stationstation

• DA filed is either 2- or 6-byte for holding a unique DA filed is either 2- or 6-byte for holding a unique physical address, a group address, or a global physical address, a group address, or a global address of the packet’s next destination address of the packet’s next destination

• DA address may hold the router connection address DA address may hold the router connection address at the beginning if the packet must cross from one at the beginning if the packet must cross from one LAN to another LAN to another

Page 28: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 2828

IEEE 802.3 Frame FormatIEEE 802.3 Frame Format

Source Address (SA)Source Address (SA)• SA field is either 2- or 6-bytes for holding the SA field is either 2- or 6-bytes for holding the

frame sender’s addressframe sender’s address Length of PDU (Protocol Data Unit)Length of PDU (Protocol Data Unit)

• two bytes length field for indicating the two bytes length field for indicating the number of bytes of the data field.number of bytes of the data field.

Page 29: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 2929

IEEE 802.3 Frame FormatIEEE 802.3 Frame Format

LLC or 802.2 Data frameLLC or 802.2 Data frame• Entire data frame from 46 to 1500 bytes long Entire data frame from 46 to 1500 bytes long • DSAP – Destination Service Access PointDSAP – Destination Service Access Point• SSAP – Source Service Access PointSSAP – Source Service Access Point• Control Control • InformationInformation

CRC or FCSCRC or FCS• 4-byte field that holds a CRC-32 (Cyclic Redundancy 4-byte field that holds a CRC-32 (Cyclic Redundancy

Check) for checking the frame integrity.Check) for checking the frame integrity.

Page 30: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 3030

IEEE 802.3 Frame FormatIEEE 802.3 Frame Format

RFC 1042 RFC 1042 • A Standard of Transmission IP Datagrams A Standard of Transmission IP Datagrams

over Ethernetover Ethernet• 802.2/802.3 Encapsulation802.2/802.3 Encapsulation

Page 31: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 3131

Ethernet AddressEthernet Address

RFC 826 – Ethernet AddressingRFC 826 – Ethernet Addressing NIC Address NIC Address

• 48-bit address in Hexadecimal Notation48-bit address in Hexadecimal Notation• An example: 06-01-02-01-21-48An example: 06-01-02-01-21-48

NIC Address Checking Commands:NIC Address Checking Commands:• Windows 98 - winipcfgWindows 98 - winipcfg• Windows NT/2000/XP command - ipconfig/allWindows NT/2000/XP command - ipconfig/all

Page 32: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 3232

Ethernet AddressEthernet Address

Linux Commands:Linux Commands:

$ dmesg | grep eth$ dmesg | grep eth

divert: allocating divert_blk for eth0divert: allocating divert_blk for eth0

eth0: 3c5x9 at 0x220, 10baseT port, eth0: 3c5x9 at 0x220, 10baseT port, address 00 60 08 14 4b da, IRQ 5.address 00 60 08 14 4b da, IRQ 5.

eth0: Setting 3c5x9/3c5x9B half-duplex eth0: Setting 3c5x9/3c5x9B half-duplex mode if_port: 0, sw_info: 1321mode if_port: 0, sw_info: 1321

eth0: Setting Rx mode to 1 addresses.eth0: Setting Rx mode to 1 addresses.

Page 33: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 3333

Ethernet AddressEthernet Address

Source AddressSource Address• Unicast - a source address is always a Unicast - a source address is always a

unicast addressunicast address• Bit 0 of byte 1 Bit 0 of byte 1

Destination AddressDestination Address• Multicast – received by a group of stationsMulticast – received by a group of stations• Broadcast (1111 …1111) – destination Broadcast (1111 …1111) – destination

address is 48-bit of all 1’s, received by all address is 48-bit of all 1’s, received by all stationsstations

Page 34: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 3434

Network Analyzer ProtocolNetwork Analyzer Protocol

Ethereal (Open Source)Ethereal (Open Source)• www.ethereal.comwww.ethereal.com• Data frame capture Data frame capture • Protocol AnalyzingProtocol Analyzing

Page 35: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 3535

Example 1: Time needed for Example 1: Time needed for collision detectioncollision detection

Question: Question: Two stations begin transmitting at exactly Two stations begin transmitting at exactly

the same time. the same time. How long will it take to realize that there How long will it take to realize that there

has been a collision? has been a collision? Contention period, delay, and throughput.Contention period, delay, and throughput.

Page 36: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 3636

Example 1: Time needed for Example 1: Time needed for collision detectioncollision detection

Answer: Answer: The minimum time for detecting the The minimum time for detecting the

collision is the time that it takes to collision is the time that it takes to propagate from one station to the other.propagate from one station to the other.

Page 37: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 3737

Example 2: Elapses time and Example 2: Elapses time and throughputthroughput

Consider the transfer of a file containing Consider the transfer of a file containing one million characters from one station one million characters from one station to another. to another.

What is the total elapsed time and What is the total elapsed time and effective throughput for the 10BaseT effective throughput for the 10BaseT star topology with a data rate of 10 star topology with a data rate of 10 Mbps? Mbps?

Assume that the network setup time is Assume that the network setup time is negligible.negligible.

Page 38: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 3838

Example 2: Elapses time and Example 2: Elapses time and throughputthroughput

Solution: 0.8 sec.Solution: 0.8 sec.

8 bit/char x 1 M char 8 bit/char x 1 M char 10 Mbits/sec = 10 Mbits/sec = 0.8 seconds.0.8 seconds.

Page 39: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 3939

Example 3: Carrier Detection Example 3: Carrier Detection CircuitCircuit

Collision detection process:Collision detection process: We imagine that the station’s hardware must We imagine that the station’s hardware must

listen to the cable while it is transmitting. listen to the cable while it is transmitting. If what it reads back is different from it is putting If what it reads back is different from it is putting

out, it knows a collision is occurring. out, it knows a collision is occurring. A station wants to acquire the medium it must A station wants to acquire the medium it must

first output a 1 bit, if the channel is busy the first output a 1 bit, if the channel is busy the return bit is 0, otherwise the bit is 1.return bit is 0, otherwise the bit is 1.

Page 40: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 4040

Collision Detection CircuitCollision Detection Circuit

XOR

Ethernet CardTransmit=1

Busy = 1Idle = 0

Channel Idle = 1Channel Busy = 0

Page 41: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 4141

Example 4: Slot TimeExample 4: Slot Time

What is the most amount of time needed What is the most amount of time needed for a station to know that if it be granted for a station to know that if it be granted the access to the channel? the access to the channel?

This time is normally called slot time.This time is normally called slot time.

Page 42: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 4242

Example 4: Slot Time Example 4: Slot Time (Calculation)(Calculation)

Let Tau be the time for a signal to propagate Let Tau be the time for a signal to propagate between the two farthest stations.between the two farthest stations.

At time t0, station A begins transmitting.At time t0, station A begins transmitting. At time t0 - tAt time t0 - t, before the signal arrive at station , before the signal arrive at station

B which is the farthest station, the station B also B which is the farthest station, the station B also begins transmission. The station B detects the begins transmission. The station B detects the collision instantaneously.collision instantaneously.

Page 43: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 4343

Example 4: Slot Time Example 4: Slot Time (Calculation)(Calculation)

But the jamming signal did not get back to the But the jamming signal did not get back to the station A until (2Tau - tstation A until (2Tau - t).).

So that the most amount of the time needed to So that the most amount of the time needed to be sure that it has seized the channel is it has be sure that it has seized the channel is it has transmitted for 2Tau time without hearing a transmitted for 2Tau time without hearing a collision.collision.

Page 44: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 4444

Example 5: Effective Data Rate Example 5: Effective Data Rate CalculationCalculation

What is the effective data rate, excluding What is the effective data rate, excluding overhead? overhead?

Assuming that there are no collisions for a Assuming that there are no collisions for a 10 Mbps Ethernet with the following 10 Mbps Ethernet with the following specification:specification:

Page 45: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 4545

Example 5: Effective data rate Example 5: Effective data rate calculationcalculation

1 km long cable that has a propagation 1 km long cable that has a propagation speed of 200 m/speed of 200 m/sec. Data packets are sec. Data packets are 1024 bits long, including 32-bit header, 1024 bits long, including 32-bit header, CRC check sum and other overhead.CRC check sum and other overhead.

The first bit slot after a successful The first bit slot after a successful transmission is reserved for the receiver to transmission is reserved for the receiver to capture the channel to send a 32-bit capture the channel to send a 32-bit acknowledgement packet.acknowledgement packet.

Page 46: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 4646

Example 5: Effective data rate Example 5: Effective data rate calculationcalculation

Solution:Solution: The round trip propagation time of the The round trip propagation time of the

cable is cable is

(200 m/(200 m/sec sec 1 km) 1 km) 2 = 10 2 = 10 ss And we know that a complete transmission And we know that a complete transmission

has four phases:has four phases: Sender seizes cable (10 Sender seizes cable (10 sec)sec)

Page 47: March 22, 2004 Prof. Paul Lin 1 CPET 355 4. The Medium Access Control Sublayer Paul I-Hai Lin, Professor Electrical and Computer Engineering Technology

March 22, 2004March 22, 2004 Prof. Paul LinProf. Paul Lin 4747

Example 5: Effective data rate Example 5: Effective data rate calculationcalculation

Solution:Solution: Transmit data ( 1024 bits Transmit data ( 1024 bits 10 Mbps = 10 Mbps =

102.4 102.4 sec)sec) Receiver seizes cable (10 Receiver seizes cable (10 sec)sec) Ack. Sent (32 bits Ack. Sent (32 bits 10 Mbps = 3.2 10 Mbps = 3.2 sec)sec) The sum of these time is 125.6 The sum of these time is 125.6 sec.sec. In this period (1024 - 32 = 992) data bits In this period (1024 - 32 = 992) data bits

are sent, for a rate of 7.9 Mbpsare sent, for a rate of 7.9 Mbps