topic 2 - data link layer and lans introduction and services error detection and correction multiple...

47
Topic 2 - Data Link layer and LANs •Introduction and services •Error detection and correction •Multiple access protocols •Link-layer Addressing •Ethernet

Upload: annis-peters

Post on 16-Jan-2016

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Topic 2 - Data Link layer and LANs

bullIntroduction and services

bullError detection and correction

bullMultiple access protocols

bullLink-layer Addressing

bullEthernet

Learning Outcomes

bull Be able to distinguish the between data link layer mechanisms and network layer mechanisms in source to destination delivery

bull Identify the advantages and limitations of generic link control techniques

bull Understand the concepts of parity and CRC in the context of error detection

bull Appreciate the need for and the different types of MACbull Understand the nature of Channel partitioning Random access

protocols and lsquotaking turnsrsquo protocolsbull A good understanding of CSMACD and be able to perform

some basic analysis

Introduction and servicesSome terminologybull Hosts and routers are nodesbull Communication channels that

connect adjacent nodes along a communication path are called linksndash wired linksndash wireless linksndash LAN topologies

bull A layer-2 packet is a frame the encapsulates the datagram

data-link layer has responsibility of transferring a datagram from one node to the adjacent node over the link

Link layer context

bull Datagrams are transferred by different link protocols over different linksndash eg Ethernet on first link frame relay on

intermediate links 80211 on last link

bull Each link protocol provides different servicesndash eg may or may not provide reliable delivery

Link Layer Servicesbull Framing

- Encapsulate datagram into by adding header and trailer MACrdquo addresses used in frame headers to identify source and destination - different from IP address

bull Link access - Medium access control protocol specifies how the frame is

transmitted onto the link

bull Reliable delivery between adjacent nodes - This is a guarantee to deliver the datagram error free across the linkndash Mechanisms are flow and error controlndash Seldom used on low bit-error link (fiber some twisted pair)ndash Wireless links may have high error rates

Q Why employ both link-level and end-end reliability

A bit more on reliable deliverybull Flow control

ndash Pacing the exchange between the sending and receiving nodes Examples are

Stop and waitSliding window

bull Error detection ndash Errors caused by signal attenuation noise ndash Receiver detects presence of errors Techniques are

Go-back-n ARQ and select-reject ARQbull Error correction

ndash The receiver identifies and corrects bit error(s) without resorting to retransmission (FEC)

bull Half-duplex and full-duplexndash With half duplex nodes at both ends of link can

transmit but not at same time Full duplex is simultaneous transmission in both directions

Where is the link layer implementedbull In each and every hostbull Link layer implemented in

ldquoadaptorrdquo (aka network interface card NIC)ndash Ethernet card PCMCI

card 80211 cardndash implements at both link

and physical layerbull Attaches into hostrsquos

system busesbull Combination of hardware

software firmware

controller

physicaltransmission

cpu memory

host bus

network adaptercard

host schematic

applicationtransportnetwork

link

linkphysical

Adaptors communicating

sending sideencapsulates datagram in

frameadds error checking bits

flow control etc

receiving side looks for errors flow control etc extracts datagram passes to upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

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

fields bull Error detection not 100 reliable

ndash Protocol may miss some errors - but rarelyndash Larger EDC field yields better detection and correction

Parity Checking - an approach to Error Detection

Single Bit ParityThis is the simplest form of error detection

Can detect single bit errors The scheme can either be odd or even The technique is to use an additional bit so the the total number of bits is either odd or even depending the type of scheme

Example showing odd parity

As you might have guessed this approach is limited because it will not notice if an even number of bits are in error

A more robust approach is the two dimensional parity scheme

In this case the datagram is divided into i rows of equal length j (these will be the columns)

Parity bits are added to each row and column

As you can see in the example it can not only detect a single error but also correct it ndash because it can identify the bit

As with the single parity this technique is limited but it has served as an introduction to error detection

10101 1

10110 0

01110 1

00101 0Parity errors

10101 1

11110 0

01110 1

00101 0

No error Single bit error

Cyclic Redundancy Check (CRC)These are known as polynomial codes

bull View data bits D as a binary numberbull Choose r+1 bit pattern called the generator G (agreed by Tx and Rx)bull Choose r CRC bits R such that

ndash ltDRgt is exactly divisible by G (using mod 2 arithmetic) ndash Then the receiver knowing G can divide ltDRgt by G If the

remainder is non-zero then an error has been detectedndash This technique can detect all burst errors less than r+1 bits

bull widely used in practice (Ethernet 80211 WiFi ATM)

See next slide

Modulo 2 arithmetic

bull Addition and subtraction are carried without lsquocarries or borrowsrsquo and therefore produce identical results Using XOR will enable this operation

1011 + 0101=1110

1011 - 0101=1110

1011 XOR 0101=1110

bull Multiplication and division is the same as with base 2 arithmetic except no carries when either carry or borrow occur

AnalysisThe following result is stated

D2rG = Q + RGA quotient and remainder Use R to form the transmitted bit patternT = D2r + RThe question is does R satisfy the requirement that TG does not

produce a remainder The following two lines confirm the validity of the above approach

TG = (D2r + R)G Q + RG+ RG = Q no remainder because (R XOR R)G = 0

The FCS is easily generated ndash just divide D2r by G and use the remainder as the FCS

R = remainder[ ]D2r

G

Example

D = 101110

G = 1001

R = 3

So D2r = 101110000

We now need to calculate D2rG

Ans T = D2r + R

101110011

Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull Point-to-point

ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host

bull Broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Multiple Access protocolsbull single shared broadcast channel bull When there are two or more simultaneous

transmissions by nodes interference will occur and is called a collision if node receives two or more signals at the same time

Multiple access protocol (MAC)bull Distributed algorithm that determines how nodes

share the channel ie determine when a node can transmit

bull Communication about channel sharing must use channel itself ndash no out-of-band channel for coordination

Ideal Multiple Access Protocol

Broadcast channel of rate R bps

1 when one node wants to transmit it can send at rate R

2 when M nodes want to transmit each can send at average rate RM

3 fully decentralizedndash no special node to coordinate transmissionsndash no synchronization of clocks slots

4 Simple

MAC Protocols a taxonomyThree broad classesbull Channel Partitioning (Channelisation)

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

ndash allocate piece to node for exclusive usebull Random Access

ndash channel not divided collisions possiblendash ldquorecoverrdquo from collisions

bull ldquoTaking turnsrdquondash nodes take turns but nodes with more to send

can take longer turns

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 2: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Learning Outcomes

bull Be able to distinguish the between data link layer mechanisms and network layer mechanisms in source to destination delivery

bull Identify the advantages and limitations of generic link control techniques

bull Understand the concepts of parity and CRC in the context of error detection

bull Appreciate the need for and the different types of MACbull Understand the nature of Channel partitioning Random access

protocols and lsquotaking turnsrsquo protocolsbull A good understanding of CSMACD and be able to perform

some basic analysis

Introduction and servicesSome terminologybull Hosts and routers are nodesbull Communication channels that

connect adjacent nodes along a communication path are called linksndash wired linksndash wireless linksndash LAN topologies

bull A layer-2 packet is a frame the encapsulates the datagram

data-link layer has responsibility of transferring a datagram from one node to the adjacent node over the link

Link layer context

bull Datagrams are transferred by different link protocols over different linksndash eg Ethernet on first link frame relay on

intermediate links 80211 on last link

bull Each link protocol provides different servicesndash eg may or may not provide reliable delivery

Link Layer Servicesbull Framing

- Encapsulate datagram into by adding header and trailer MACrdquo addresses used in frame headers to identify source and destination - different from IP address

bull Link access - Medium access control protocol specifies how the frame is

transmitted onto the link

bull Reliable delivery between adjacent nodes - This is a guarantee to deliver the datagram error free across the linkndash Mechanisms are flow and error controlndash Seldom used on low bit-error link (fiber some twisted pair)ndash Wireless links may have high error rates

Q Why employ both link-level and end-end reliability

A bit more on reliable deliverybull Flow control

ndash Pacing the exchange between the sending and receiving nodes Examples are

Stop and waitSliding window

bull Error detection ndash Errors caused by signal attenuation noise ndash Receiver detects presence of errors Techniques are

Go-back-n ARQ and select-reject ARQbull Error correction

ndash The receiver identifies and corrects bit error(s) without resorting to retransmission (FEC)

bull Half-duplex and full-duplexndash With half duplex nodes at both ends of link can

transmit but not at same time Full duplex is simultaneous transmission in both directions

Where is the link layer implementedbull In each and every hostbull Link layer implemented in

ldquoadaptorrdquo (aka network interface card NIC)ndash Ethernet card PCMCI

card 80211 cardndash implements at both link

and physical layerbull Attaches into hostrsquos

system busesbull Combination of hardware

software firmware

controller

physicaltransmission

cpu memory

host bus

network adaptercard

host schematic

applicationtransportnetwork

link

linkphysical

Adaptors communicating

sending sideencapsulates datagram in

frameadds error checking bits

flow control etc

receiving side looks for errors flow control etc extracts datagram passes to upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

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

fields bull Error detection not 100 reliable

ndash Protocol may miss some errors - but rarelyndash Larger EDC field yields better detection and correction

Parity Checking - an approach to Error Detection

Single Bit ParityThis is the simplest form of error detection

Can detect single bit errors The scheme can either be odd or even The technique is to use an additional bit so the the total number of bits is either odd or even depending the type of scheme

Example showing odd parity

As you might have guessed this approach is limited because it will not notice if an even number of bits are in error

A more robust approach is the two dimensional parity scheme

In this case the datagram is divided into i rows of equal length j (these will be the columns)

Parity bits are added to each row and column

As you can see in the example it can not only detect a single error but also correct it ndash because it can identify the bit

As with the single parity this technique is limited but it has served as an introduction to error detection

10101 1

10110 0

01110 1

00101 0Parity errors

10101 1

11110 0

01110 1

00101 0

No error Single bit error

Cyclic Redundancy Check (CRC)These are known as polynomial codes

bull View data bits D as a binary numberbull Choose r+1 bit pattern called the generator G (agreed by Tx and Rx)bull Choose r CRC bits R such that

ndash ltDRgt is exactly divisible by G (using mod 2 arithmetic) ndash Then the receiver knowing G can divide ltDRgt by G If the

remainder is non-zero then an error has been detectedndash This technique can detect all burst errors less than r+1 bits

bull widely used in practice (Ethernet 80211 WiFi ATM)

See next slide

Modulo 2 arithmetic

bull Addition and subtraction are carried without lsquocarries or borrowsrsquo and therefore produce identical results Using XOR will enable this operation

1011 + 0101=1110

1011 - 0101=1110

1011 XOR 0101=1110

bull Multiplication and division is the same as with base 2 arithmetic except no carries when either carry or borrow occur

AnalysisThe following result is stated

D2rG = Q + RGA quotient and remainder Use R to form the transmitted bit patternT = D2r + RThe question is does R satisfy the requirement that TG does not

produce a remainder The following two lines confirm the validity of the above approach

TG = (D2r + R)G Q + RG+ RG = Q no remainder because (R XOR R)G = 0

The FCS is easily generated ndash just divide D2r by G and use the remainder as the FCS

R = remainder[ ]D2r

G

Example

D = 101110

G = 1001

R = 3

So D2r = 101110000

We now need to calculate D2rG

Ans T = D2r + R

101110011

Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull Point-to-point

ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host

bull Broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Multiple Access protocolsbull single shared broadcast channel bull When there are two or more simultaneous

transmissions by nodes interference will occur and is called a collision if node receives two or more signals at the same time

Multiple access protocol (MAC)bull Distributed algorithm that determines how nodes

share the channel ie determine when a node can transmit

bull Communication about channel sharing must use channel itself ndash no out-of-band channel for coordination

Ideal Multiple Access Protocol

Broadcast channel of rate R bps

1 when one node wants to transmit it can send at rate R

2 when M nodes want to transmit each can send at average rate RM

3 fully decentralizedndash no special node to coordinate transmissionsndash no synchronization of clocks slots

4 Simple

MAC Protocols a taxonomyThree broad classesbull Channel Partitioning (Channelisation)

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

ndash allocate piece to node for exclusive usebull Random Access

ndash channel not divided collisions possiblendash ldquorecoverrdquo from collisions

bull ldquoTaking turnsrdquondash nodes take turns but nodes with more to send

can take longer turns

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 3: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Introduction and servicesSome terminologybull Hosts and routers are nodesbull Communication channels that

connect adjacent nodes along a communication path are called linksndash wired linksndash wireless linksndash LAN topologies

bull A layer-2 packet is a frame the encapsulates the datagram

data-link layer has responsibility of transferring a datagram from one node to the adjacent node over the link

Link layer context

bull Datagrams are transferred by different link protocols over different linksndash eg Ethernet on first link frame relay on

intermediate links 80211 on last link

bull Each link protocol provides different servicesndash eg may or may not provide reliable delivery

Link Layer Servicesbull Framing

- Encapsulate datagram into by adding header and trailer MACrdquo addresses used in frame headers to identify source and destination - different from IP address

bull Link access - Medium access control protocol specifies how the frame is

transmitted onto the link

bull Reliable delivery between adjacent nodes - This is a guarantee to deliver the datagram error free across the linkndash Mechanisms are flow and error controlndash Seldom used on low bit-error link (fiber some twisted pair)ndash Wireless links may have high error rates

Q Why employ both link-level and end-end reliability

A bit more on reliable deliverybull Flow control

ndash Pacing the exchange between the sending and receiving nodes Examples are

Stop and waitSliding window

bull Error detection ndash Errors caused by signal attenuation noise ndash Receiver detects presence of errors Techniques are

Go-back-n ARQ and select-reject ARQbull Error correction

ndash The receiver identifies and corrects bit error(s) without resorting to retransmission (FEC)

bull Half-duplex and full-duplexndash With half duplex nodes at both ends of link can

transmit but not at same time Full duplex is simultaneous transmission in both directions

Where is the link layer implementedbull In each and every hostbull Link layer implemented in

ldquoadaptorrdquo (aka network interface card NIC)ndash Ethernet card PCMCI

card 80211 cardndash implements at both link

and physical layerbull Attaches into hostrsquos

system busesbull Combination of hardware

software firmware

controller

physicaltransmission

cpu memory

host bus

network adaptercard

host schematic

applicationtransportnetwork

link

linkphysical

Adaptors communicating

sending sideencapsulates datagram in

frameadds error checking bits

flow control etc

receiving side looks for errors flow control etc extracts datagram passes to upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

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

fields bull Error detection not 100 reliable

ndash Protocol may miss some errors - but rarelyndash Larger EDC field yields better detection and correction

Parity Checking - an approach to Error Detection

Single Bit ParityThis is the simplest form of error detection

Can detect single bit errors The scheme can either be odd or even The technique is to use an additional bit so the the total number of bits is either odd or even depending the type of scheme

Example showing odd parity

As you might have guessed this approach is limited because it will not notice if an even number of bits are in error

A more robust approach is the two dimensional parity scheme

In this case the datagram is divided into i rows of equal length j (these will be the columns)

Parity bits are added to each row and column

As you can see in the example it can not only detect a single error but also correct it ndash because it can identify the bit

As with the single parity this technique is limited but it has served as an introduction to error detection

10101 1

10110 0

01110 1

00101 0Parity errors

10101 1

11110 0

01110 1

00101 0

No error Single bit error

Cyclic Redundancy Check (CRC)These are known as polynomial codes

bull View data bits D as a binary numberbull Choose r+1 bit pattern called the generator G (agreed by Tx and Rx)bull Choose r CRC bits R such that

ndash ltDRgt is exactly divisible by G (using mod 2 arithmetic) ndash Then the receiver knowing G can divide ltDRgt by G If the

remainder is non-zero then an error has been detectedndash This technique can detect all burst errors less than r+1 bits

bull widely used in practice (Ethernet 80211 WiFi ATM)

See next slide

Modulo 2 arithmetic

bull Addition and subtraction are carried without lsquocarries or borrowsrsquo and therefore produce identical results Using XOR will enable this operation

1011 + 0101=1110

1011 - 0101=1110

1011 XOR 0101=1110

bull Multiplication and division is the same as with base 2 arithmetic except no carries when either carry or borrow occur

AnalysisThe following result is stated

D2rG = Q + RGA quotient and remainder Use R to form the transmitted bit patternT = D2r + RThe question is does R satisfy the requirement that TG does not

produce a remainder The following two lines confirm the validity of the above approach

TG = (D2r + R)G Q + RG+ RG = Q no remainder because (R XOR R)G = 0

The FCS is easily generated ndash just divide D2r by G and use the remainder as the FCS

R = remainder[ ]D2r

G

Example

D = 101110

G = 1001

R = 3

So D2r = 101110000

We now need to calculate D2rG

Ans T = D2r + R

101110011

Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull Point-to-point

ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host

bull Broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Multiple Access protocolsbull single shared broadcast channel bull When there are two or more simultaneous

transmissions by nodes interference will occur and is called a collision if node receives two or more signals at the same time

Multiple access protocol (MAC)bull Distributed algorithm that determines how nodes

share the channel ie determine when a node can transmit

bull Communication about channel sharing must use channel itself ndash no out-of-band channel for coordination

Ideal Multiple Access Protocol

Broadcast channel of rate R bps

1 when one node wants to transmit it can send at rate R

2 when M nodes want to transmit each can send at average rate RM

3 fully decentralizedndash no special node to coordinate transmissionsndash no synchronization of clocks slots

4 Simple

MAC Protocols a taxonomyThree broad classesbull Channel Partitioning (Channelisation)

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

ndash allocate piece to node for exclusive usebull Random Access

ndash channel not divided collisions possiblendash ldquorecoverrdquo from collisions

bull ldquoTaking turnsrdquondash nodes take turns but nodes with more to send

can take longer turns

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 4: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Link layer context

bull Datagrams are transferred by different link protocols over different linksndash eg Ethernet on first link frame relay on

intermediate links 80211 on last link

bull Each link protocol provides different servicesndash eg may or may not provide reliable delivery

Link Layer Servicesbull Framing

- Encapsulate datagram into by adding header and trailer MACrdquo addresses used in frame headers to identify source and destination - different from IP address

bull Link access - Medium access control protocol specifies how the frame is

transmitted onto the link

bull Reliable delivery between adjacent nodes - This is a guarantee to deliver the datagram error free across the linkndash Mechanisms are flow and error controlndash Seldom used on low bit-error link (fiber some twisted pair)ndash Wireless links may have high error rates

Q Why employ both link-level and end-end reliability

A bit more on reliable deliverybull Flow control

ndash Pacing the exchange between the sending and receiving nodes Examples are

Stop and waitSliding window

bull Error detection ndash Errors caused by signal attenuation noise ndash Receiver detects presence of errors Techniques are

Go-back-n ARQ and select-reject ARQbull Error correction

ndash The receiver identifies and corrects bit error(s) without resorting to retransmission (FEC)

bull Half-duplex and full-duplexndash With half duplex nodes at both ends of link can

transmit but not at same time Full duplex is simultaneous transmission in both directions

Where is the link layer implementedbull In each and every hostbull Link layer implemented in

ldquoadaptorrdquo (aka network interface card NIC)ndash Ethernet card PCMCI

card 80211 cardndash implements at both link

and physical layerbull Attaches into hostrsquos

system busesbull Combination of hardware

software firmware

controller

physicaltransmission

cpu memory

host bus

network adaptercard

host schematic

applicationtransportnetwork

link

linkphysical

Adaptors communicating

sending sideencapsulates datagram in

frameadds error checking bits

flow control etc

receiving side looks for errors flow control etc extracts datagram passes to upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

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

fields bull Error detection not 100 reliable

ndash Protocol may miss some errors - but rarelyndash Larger EDC field yields better detection and correction

Parity Checking - an approach to Error Detection

Single Bit ParityThis is the simplest form of error detection

Can detect single bit errors The scheme can either be odd or even The technique is to use an additional bit so the the total number of bits is either odd or even depending the type of scheme

Example showing odd parity

As you might have guessed this approach is limited because it will not notice if an even number of bits are in error

A more robust approach is the two dimensional parity scheme

In this case the datagram is divided into i rows of equal length j (these will be the columns)

Parity bits are added to each row and column

As you can see in the example it can not only detect a single error but also correct it ndash because it can identify the bit

As with the single parity this technique is limited but it has served as an introduction to error detection

10101 1

10110 0

01110 1

00101 0Parity errors

10101 1

11110 0

01110 1

00101 0

No error Single bit error

Cyclic Redundancy Check (CRC)These are known as polynomial codes

bull View data bits D as a binary numberbull Choose r+1 bit pattern called the generator G (agreed by Tx and Rx)bull Choose r CRC bits R such that

ndash ltDRgt is exactly divisible by G (using mod 2 arithmetic) ndash Then the receiver knowing G can divide ltDRgt by G If the

remainder is non-zero then an error has been detectedndash This technique can detect all burst errors less than r+1 bits

bull widely used in practice (Ethernet 80211 WiFi ATM)

See next slide

Modulo 2 arithmetic

bull Addition and subtraction are carried without lsquocarries or borrowsrsquo and therefore produce identical results Using XOR will enable this operation

1011 + 0101=1110

1011 - 0101=1110

1011 XOR 0101=1110

bull Multiplication and division is the same as with base 2 arithmetic except no carries when either carry or borrow occur

AnalysisThe following result is stated

D2rG = Q + RGA quotient and remainder Use R to form the transmitted bit patternT = D2r + RThe question is does R satisfy the requirement that TG does not

produce a remainder The following two lines confirm the validity of the above approach

TG = (D2r + R)G Q + RG+ RG = Q no remainder because (R XOR R)G = 0

The FCS is easily generated ndash just divide D2r by G and use the remainder as the FCS

R = remainder[ ]D2r

G

Example

D = 101110

G = 1001

R = 3

So D2r = 101110000

We now need to calculate D2rG

Ans T = D2r + R

101110011

Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull Point-to-point

ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host

bull Broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Multiple Access protocolsbull single shared broadcast channel bull When there are two or more simultaneous

transmissions by nodes interference will occur and is called a collision if node receives two or more signals at the same time

Multiple access protocol (MAC)bull Distributed algorithm that determines how nodes

share the channel ie determine when a node can transmit

bull Communication about channel sharing must use channel itself ndash no out-of-band channel for coordination

Ideal Multiple Access Protocol

Broadcast channel of rate R bps

1 when one node wants to transmit it can send at rate R

2 when M nodes want to transmit each can send at average rate RM

3 fully decentralizedndash no special node to coordinate transmissionsndash no synchronization of clocks slots

4 Simple

MAC Protocols a taxonomyThree broad classesbull Channel Partitioning (Channelisation)

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

ndash allocate piece to node for exclusive usebull Random Access

ndash channel not divided collisions possiblendash ldquorecoverrdquo from collisions

bull ldquoTaking turnsrdquondash nodes take turns but nodes with more to send

can take longer turns

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 5: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Link Layer Servicesbull Framing

- Encapsulate datagram into by adding header and trailer MACrdquo addresses used in frame headers to identify source and destination - different from IP address

bull Link access - Medium access control protocol specifies how the frame is

transmitted onto the link

bull Reliable delivery between adjacent nodes - This is a guarantee to deliver the datagram error free across the linkndash Mechanisms are flow and error controlndash Seldom used on low bit-error link (fiber some twisted pair)ndash Wireless links may have high error rates

Q Why employ both link-level and end-end reliability

A bit more on reliable deliverybull Flow control

ndash Pacing the exchange between the sending and receiving nodes Examples are

Stop and waitSliding window

bull Error detection ndash Errors caused by signal attenuation noise ndash Receiver detects presence of errors Techniques are

Go-back-n ARQ and select-reject ARQbull Error correction

ndash The receiver identifies and corrects bit error(s) without resorting to retransmission (FEC)

bull Half-duplex and full-duplexndash With half duplex nodes at both ends of link can

transmit but not at same time Full duplex is simultaneous transmission in both directions

Where is the link layer implementedbull In each and every hostbull Link layer implemented in

ldquoadaptorrdquo (aka network interface card NIC)ndash Ethernet card PCMCI

card 80211 cardndash implements at both link

and physical layerbull Attaches into hostrsquos

system busesbull Combination of hardware

software firmware

controller

physicaltransmission

cpu memory

host bus

network adaptercard

host schematic

applicationtransportnetwork

link

linkphysical

Adaptors communicating

sending sideencapsulates datagram in

frameadds error checking bits

flow control etc

receiving side looks for errors flow control etc extracts datagram passes to upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

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

fields bull Error detection not 100 reliable

ndash Protocol may miss some errors - but rarelyndash Larger EDC field yields better detection and correction

Parity Checking - an approach to Error Detection

Single Bit ParityThis is the simplest form of error detection

Can detect single bit errors The scheme can either be odd or even The technique is to use an additional bit so the the total number of bits is either odd or even depending the type of scheme

Example showing odd parity

As you might have guessed this approach is limited because it will not notice if an even number of bits are in error

A more robust approach is the two dimensional parity scheme

In this case the datagram is divided into i rows of equal length j (these will be the columns)

Parity bits are added to each row and column

As you can see in the example it can not only detect a single error but also correct it ndash because it can identify the bit

As with the single parity this technique is limited but it has served as an introduction to error detection

10101 1

10110 0

01110 1

00101 0Parity errors

10101 1

11110 0

01110 1

00101 0

No error Single bit error

Cyclic Redundancy Check (CRC)These are known as polynomial codes

bull View data bits D as a binary numberbull Choose r+1 bit pattern called the generator G (agreed by Tx and Rx)bull Choose r CRC bits R such that

ndash ltDRgt is exactly divisible by G (using mod 2 arithmetic) ndash Then the receiver knowing G can divide ltDRgt by G If the

remainder is non-zero then an error has been detectedndash This technique can detect all burst errors less than r+1 bits

bull widely used in practice (Ethernet 80211 WiFi ATM)

See next slide

Modulo 2 arithmetic

bull Addition and subtraction are carried without lsquocarries or borrowsrsquo and therefore produce identical results Using XOR will enable this operation

1011 + 0101=1110

1011 - 0101=1110

1011 XOR 0101=1110

bull Multiplication and division is the same as with base 2 arithmetic except no carries when either carry or borrow occur

AnalysisThe following result is stated

D2rG = Q + RGA quotient and remainder Use R to form the transmitted bit patternT = D2r + RThe question is does R satisfy the requirement that TG does not

produce a remainder The following two lines confirm the validity of the above approach

TG = (D2r + R)G Q + RG+ RG = Q no remainder because (R XOR R)G = 0

The FCS is easily generated ndash just divide D2r by G and use the remainder as the FCS

R = remainder[ ]D2r

G

Example

D = 101110

G = 1001

R = 3

So D2r = 101110000

We now need to calculate D2rG

Ans T = D2r + R

101110011

Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull Point-to-point

ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host

bull Broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Multiple Access protocolsbull single shared broadcast channel bull When there are two or more simultaneous

transmissions by nodes interference will occur and is called a collision if node receives two or more signals at the same time

Multiple access protocol (MAC)bull Distributed algorithm that determines how nodes

share the channel ie determine when a node can transmit

bull Communication about channel sharing must use channel itself ndash no out-of-band channel for coordination

Ideal Multiple Access Protocol

Broadcast channel of rate R bps

1 when one node wants to transmit it can send at rate R

2 when M nodes want to transmit each can send at average rate RM

3 fully decentralizedndash no special node to coordinate transmissionsndash no synchronization of clocks slots

4 Simple

MAC Protocols a taxonomyThree broad classesbull Channel Partitioning (Channelisation)

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

ndash allocate piece to node for exclusive usebull Random Access

ndash channel not divided collisions possiblendash ldquorecoverrdquo from collisions

bull ldquoTaking turnsrdquondash nodes take turns but nodes with more to send

can take longer turns

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 6: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

A bit more on reliable deliverybull Flow control

ndash Pacing the exchange between the sending and receiving nodes Examples are

Stop and waitSliding window

bull Error detection ndash Errors caused by signal attenuation noise ndash Receiver detects presence of errors Techniques are

Go-back-n ARQ and select-reject ARQbull Error correction

ndash The receiver identifies and corrects bit error(s) without resorting to retransmission (FEC)

bull Half-duplex and full-duplexndash With half duplex nodes at both ends of link can

transmit but not at same time Full duplex is simultaneous transmission in both directions

Where is the link layer implementedbull In each and every hostbull Link layer implemented in

ldquoadaptorrdquo (aka network interface card NIC)ndash Ethernet card PCMCI

card 80211 cardndash implements at both link

and physical layerbull Attaches into hostrsquos

system busesbull Combination of hardware

software firmware

controller

physicaltransmission

cpu memory

host bus

network adaptercard

host schematic

applicationtransportnetwork

link

linkphysical

Adaptors communicating

sending sideencapsulates datagram in

frameadds error checking bits

flow control etc

receiving side looks for errors flow control etc extracts datagram passes to upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

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

fields bull Error detection not 100 reliable

ndash Protocol may miss some errors - but rarelyndash Larger EDC field yields better detection and correction

Parity Checking - an approach to Error Detection

Single Bit ParityThis is the simplest form of error detection

Can detect single bit errors The scheme can either be odd or even The technique is to use an additional bit so the the total number of bits is either odd or even depending the type of scheme

Example showing odd parity

As you might have guessed this approach is limited because it will not notice if an even number of bits are in error

A more robust approach is the two dimensional parity scheme

In this case the datagram is divided into i rows of equal length j (these will be the columns)

Parity bits are added to each row and column

As you can see in the example it can not only detect a single error but also correct it ndash because it can identify the bit

As with the single parity this technique is limited but it has served as an introduction to error detection

10101 1

10110 0

01110 1

00101 0Parity errors

10101 1

11110 0

01110 1

00101 0

No error Single bit error

Cyclic Redundancy Check (CRC)These are known as polynomial codes

bull View data bits D as a binary numberbull Choose r+1 bit pattern called the generator G (agreed by Tx and Rx)bull Choose r CRC bits R such that

ndash ltDRgt is exactly divisible by G (using mod 2 arithmetic) ndash Then the receiver knowing G can divide ltDRgt by G If the

remainder is non-zero then an error has been detectedndash This technique can detect all burst errors less than r+1 bits

bull widely used in practice (Ethernet 80211 WiFi ATM)

See next slide

Modulo 2 arithmetic

bull Addition and subtraction are carried without lsquocarries or borrowsrsquo and therefore produce identical results Using XOR will enable this operation

1011 + 0101=1110

1011 - 0101=1110

1011 XOR 0101=1110

bull Multiplication and division is the same as with base 2 arithmetic except no carries when either carry or borrow occur

AnalysisThe following result is stated

D2rG = Q + RGA quotient and remainder Use R to form the transmitted bit patternT = D2r + RThe question is does R satisfy the requirement that TG does not

produce a remainder The following two lines confirm the validity of the above approach

TG = (D2r + R)G Q + RG+ RG = Q no remainder because (R XOR R)G = 0

The FCS is easily generated ndash just divide D2r by G and use the remainder as the FCS

R = remainder[ ]D2r

G

Example

D = 101110

G = 1001

R = 3

So D2r = 101110000

We now need to calculate D2rG

Ans T = D2r + R

101110011

Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull Point-to-point

ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host

bull Broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Multiple Access protocolsbull single shared broadcast channel bull When there are two or more simultaneous

transmissions by nodes interference will occur and is called a collision if node receives two or more signals at the same time

Multiple access protocol (MAC)bull Distributed algorithm that determines how nodes

share the channel ie determine when a node can transmit

bull Communication about channel sharing must use channel itself ndash no out-of-band channel for coordination

Ideal Multiple Access Protocol

Broadcast channel of rate R bps

1 when one node wants to transmit it can send at rate R

2 when M nodes want to transmit each can send at average rate RM

3 fully decentralizedndash no special node to coordinate transmissionsndash no synchronization of clocks slots

4 Simple

MAC Protocols a taxonomyThree broad classesbull Channel Partitioning (Channelisation)

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

ndash allocate piece to node for exclusive usebull Random Access

ndash channel not divided collisions possiblendash ldquorecoverrdquo from collisions

bull ldquoTaking turnsrdquondash nodes take turns but nodes with more to send

can take longer turns

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 7: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Where is the link layer implementedbull In each and every hostbull Link layer implemented in

ldquoadaptorrdquo (aka network interface card NIC)ndash Ethernet card PCMCI

card 80211 cardndash implements at both link

and physical layerbull Attaches into hostrsquos

system busesbull Combination of hardware

software firmware

controller

physicaltransmission

cpu memory

host bus

network adaptercard

host schematic

applicationtransportnetwork

link

linkphysical

Adaptors communicating

sending sideencapsulates datagram in

frameadds error checking bits

flow control etc

receiving side looks for errors flow control etc extracts datagram passes to upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

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

fields bull Error detection not 100 reliable

ndash Protocol may miss some errors - but rarelyndash Larger EDC field yields better detection and correction

Parity Checking - an approach to Error Detection

Single Bit ParityThis is the simplest form of error detection

Can detect single bit errors The scheme can either be odd or even The technique is to use an additional bit so the the total number of bits is either odd or even depending the type of scheme

Example showing odd parity

As you might have guessed this approach is limited because it will not notice if an even number of bits are in error

A more robust approach is the two dimensional parity scheme

In this case the datagram is divided into i rows of equal length j (these will be the columns)

Parity bits are added to each row and column

As you can see in the example it can not only detect a single error but also correct it ndash because it can identify the bit

As with the single parity this technique is limited but it has served as an introduction to error detection

10101 1

10110 0

01110 1

00101 0Parity errors

10101 1

11110 0

01110 1

00101 0

No error Single bit error

Cyclic Redundancy Check (CRC)These are known as polynomial codes

bull View data bits D as a binary numberbull Choose r+1 bit pattern called the generator G (agreed by Tx and Rx)bull Choose r CRC bits R such that

ndash ltDRgt is exactly divisible by G (using mod 2 arithmetic) ndash Then the receiver knowing G can divide ltDRgt by G If the

remainder is non-zero then an error has been detectedndash This technique can detect all burst errors less than r+1 bits

bull widely used in practice (Ethernet 80211 WiFi ATM)

See next slide

Modulo 2 arithmetic

bull Addition and subtraction are carried without lsquocarries or borrowsrsquo and therefore produce identical results Using XOR will enable this operation

1011 + 0101=1110

1011 - 0101=1110

1011 XOR 0101=1110

bull Multiplication and division is the same as with base 2 arithmetic except no carries when either carry or borrow occur

AnalysisThe following result is stated

D2rG = Q + RGA quotient and remainder Use R to form the transmitted bit patternT = D2r + RThe question is does R satisfy the requirement that TG does not

produce a remainder The following two lines confirm the validity of the above approach

TG = (D2r + R)G Q + RG+ RG = Q no remainder because (R XOR R)G = 0

The FCS is easily generated ndash just divide D2r by G and use the remainder as the FCS

R = remainder[ ]D2r

G

Example

D = 101110

G = 1001

R = 3

So D2r = 101110000

We now need to calculate D2rG

Ans T = D2r + R

101110011

Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull Point-to-point

ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host

bull Broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Multiple Access protocolsbull single shared broadcast channel bull When there are two or more simultaneous

transmissions by nodes interference will occur and is called a collision if node receives two or more signals at the same time

Multiple access protocol (MAC)bull Distributed algorithm that determines how nodes

share the channel ie determine when a node can transmit

bull Communication about channel sharing must use channel itself ndash no out-of-band channel for coordination

Ideal Multiple Access Protocol

Broadcast channel of rate R bps

1 when one node wants to transmit it can send at rate R

2 when M nodes want to transmit each can send at average rate RM

3 fully decentralizedndash no special node to coordinate transmissionsndash no synchronization of clocks slots

4 Simple

MAC Protocols a taxonomyThree broad classesbull Channel Partitioning (Channelisation)

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

ndash allocate piece to node for exclusive usebull Random Access

ndash channel not divided collisions possiblendash ldquorecoverrdquo from collisions

bull ldquoTaking turnsrdquondash nodes take turns but nodes with more to send

can take longer turns

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 8: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Adaptors communicating

sending sideencapsulates datagram in

frameadds error checking bits

flow control etc

receiving side looks for errors flow control etc extracts datagram passes to upper layer at receiving side

controller controller

sending host receiving host

datagram datagram

datagram

frame

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

fields bull Error detection not 100 reliable

ndash Protocol may miss some errors - but rarelyndash Larger EDC field yields better detection and correction

Parity Checking - an approach to Error Detection

Single Bit ParityThis is the simplest form of error detection

Can detect single bit errors The scheme can either be odd or even The technique is to use an additional bit so the the total number of bits is either odd or even depending the type of scheme

Example showing odd parity

As you might have guessed this approach is limited because it will not notice if an even number of bits are in error

A more robust approach is the two dimensional parity scheme

In this case the datagram is divided into i rows of equal length j (these will be the columns)

Parity bits are added to each row and column

As you can see in the example it can not only detect a single error but also correct it ndash because it can identify the bit

As with the single parity this technique is limited but it has served as an introduction to error detection

10101 1

10110 0

01110 1

00101 0Parity errors

10101 1

11110 0

01110 1

00101 0

No error Single bit error

Cyclic Redundancy Check (CRC)These are known as polynomial codes

bull View data bits D as a binary numberbull Choose r+1 bit pattern called the generator G (agreed by Tx and Rx)bull Choose r CRC bits R such that

ndash ltDRgt is exactly divisible by G (using mod 2 arithmetic) ndash Then the receiver knowing G can divide ltDRgt by G If the

remainder is non-zero then an error has been detectedndash This technique can detect all burst errors less than r+1 bits

bull widely used in practice (Ethernet 80211 WiFi ATM)

See next slide

Modulo 2 arithmetic

bull Addition and subtraction are carried without lsquocarries or borrowsrsquo and therefore produce identical results Using XOR will enable this operation

1011 + 0101=1110

1011 - 0101=1110

1011 XOR 0101=1110

bull Multiplication and division is the same as with base 2 arithmetic except no carries when either carry or borrow occur

AnalysisThe following result is stated

D2rG = Q + RGA quotient and remainder Use R to form the transmitted bit patternT = D2r + RThe question is does R satisfy the requirement that TG does not

produce a remainder The following two lines confirm the validity of the above approach

TG = (D2r + R)G Q + RG+ RG = Q no remainder because (R XOR R)G = 0

The FCS is easily generated ndash just divide D2r by G and use the remainder as the FCS

R = remainder[ ]D2r

G

Example

D = 101110

G = 1001

R = 3

So D2r = 101110000

We now need to calculate D2rG

Ans T = D2r + R

101110011

Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull Point-to-point

ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host

bull Broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Multiple Access protocolsbull single shared broadcast channel bull When there are two or more simultaneous

transmissions by nodes interference will occur and is called a collision if node receives two or more signals at the same time

Multiple access protocol (MAC)bull Distributed algorithm that determines how nodes

share the channel ie determine when a node can transmit

bull Communication about channel sharing must use channel itself ndash no out-of-band channel for coordination

Ideal Multiple Access Protocol

Broadcast channel of rate R bps

1 when one node wants to transmit it can send at rate R

2 when M nodes want to transmit each can send at average rate RM

3 fully decentralizedndash no special node to coordinate transmissionsndash no synchronization of clocks slots

4 Simple

MAC Protocols a taxonomyThree broad classesbull Channel Partitioning (Channelisation)

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

ndash allocate piece to node for exclusive usebull Random Access

ndash channel not divided collisions possiblendash ldquorecoverrdquo from collisions

bull ldquoTaking turnsrdquondash nodes take turns but nodes with more to send

can take longer turns

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 9: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

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

fields bull Error detection not 100 reliable

ndash Protocol may miss some errors - but rarelyndash Larger EDC field yields better detection and correction

Parity Checking - an approach to Error Detection

Single Bit ParityThis is the simplest form of error detection

Can detect single bit errors The scheme can either be odd or even The technique is to use an additional bit so the the total number of bits is either odd or even depending the type of scheme

Example showing odd parity

As you might have guessed this approach is limited because it will not notice if an even number of bits are in error

A more robust approach is the two dimensional parity scheme

In this case the datagram is divided into i rows of equal length j (these will be the columns)

Parity bits are added to each row and column

As you can see in the example it can not only detect a single error but also correct it ndash because it can identify the bit

As with the single parity this technique is limited but it has served as an introduction to error detection

10101 1

10110 0

01110 1

00101 0Parity errors

10101 1

11110 0

01110 1

00101 0

No error Single bit error

Cyclic Redundancy Check (CRC)These are known as polynomial codes

bull View data bits D as a binary numberbull Choose r+1 bit pattern called the generator G (agreed by Tx and Rx)bull Choose r CRC bits R such that

ndash ltDRgt is exactly divisible by G (using mod 2 arithmetic) ndash Then the receiver knowing G can divide ltDRgt by G If the

remainder is non-zero then an error has been detectedndash This technique can detect all burst errors less than r+1 bits

bull widely used in practice (Ethernet 80211 WiFi ATM)

See next slide

Modulo 2 arithmetic

bull Addition and subtraction are carried without lsquocarries or borrowsrsquo and therefore produce identical results Using XOR will enable this operation

1011 + 0101=1110

1011 - 0101=1110

1011 XOR 0101=1110

bull Multiplication and division is the same as with base 2 arithmetic except no carries when either carry or borrow occur

AnalysisThe following result is stated

D2rG = Q + RGA quotient and remainder Use R to form the transmitted bit patternT = D2r + RThe question is does R satisfy the requirement that TG does not

produce a remainder The following two lines confirm the validity of the above approach

TG = (D2r + R)G Q + RG+ RG = Q no remainder because (R XOR R)G = 0

The FCS is easily generated ndash just divide D2r by G and use the remainder as the FCS

R = remainder[ ]D2r

G

Example

D = 101110

G = 1001

R = 3

So D2r = 101110000

We now need to calculate D2rG

Ans T = D2r + R

101110011

Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull Point-to-point

ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host

bull Broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Multiple Access protocolsbull single shared broadcast channel bull When there are two or more simultaneous

transmissions by nodes interference will occur and is called a collision if node receives two or more signals at the same time

Multiple access protocol (MAC)bull Distributed algorithm that determines how nodes

share the channel ie determine when a node can transmit

bull Communication about channel sharing must use channel itself ndash no out-of-band channel for coordination

Ideal Multiple Access Protocol

Broadcast channel of rate R bps

1 when one node wants to transmit it can send at rate R

2 when M nodes want to transmit each can send at average rate RM

3 fully decentralizedndash no special node to coordinate transmissionsndash no synchronization of clocks slots

4 Simple

MAC Protocols a taxonomyThree broad classesbull Channel Partitioning (Channelisation)

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

ndash allocate piece to node for exclusive usebull Random Access

ndash channel not divided collisions possiblendash ldquorecoverrdquo from collisions

bull ldquoTaking turnsrdquondash nodes take turns but nodes with more to send

can take longer turns

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 10: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Parity Checking - an approach to Error Detection

Single Bit ParityThis is the simplest form of error detection

Can detect single bit errors The scheme can either be odd or even The technique is to use an additional bit so the the total number of bits is either odd or even depending the type of scheme

Example showing odd parity

As you might have guessed this approach is limited because it will not notice if an even number of bits are in error

A more robust approach is the two dimensional parity scheme

In this case the datagram is divided into i rows of equal length j (these will be the columns)

Parity bits are added to each row and column

As you can see in the example it can not only detect a single error but also correct it ndash because it can identify the bit

As with the single parity this technique is limited but it has served as an introduction to error detection

10101 1

10110 0

01110 1

00101 0Parity errors

10101 1

11110 0

01110 1

00101 0

No error Single bit error

Cyclic Redundancy Check (CRC)These are known as polynomial codes

bull View data bits D as a binary numberbull Choose r+1 bit pattern called the generator G (agreed by Tx and Rx)bull Choose r CRC bits R such that

ndash ltDRgt is exactly divisible by G (using mod 2 arithmetic) ndash Then the receiver knowing G can divide ltDRgt by G If the

remainder is non-zero then an error has been detectedndash This technique can detect all burst errors less than r+1 bits

bull widely used in practice (Ethernet 80211 WiFi ATM)

See next slide

Modulo 2 arithmetic

bull Addition and subtraction are carried without lsquocarries or borrowsrsquo and therefore produce identical results Using XOR will enable this operation

1011 + 0101=1110

1011 - 0101=1110

1011 XOR 0101=1110

bull Multiplication and division is the same as with base 2 arithmetic except no carries when either carry or borrow occur

AnalysisThe following result is stated

D2rG = Q + RGA quotient and remainder Use R to form the transmitted bit patternT = D2r + RThe question is does R satisfy the requirement that TG does not

produce a remainder The following two lines confirm the validity of the above approach

TG = (D2r + R)G Q + RG+ RG = Q no remainder because (R XOR R)G = 0

The FCS is easily generated ndash just divide D2r by G and use the remainder as the FCS

R = remainder[ ]D2r

G

Example

D = 101110

G = 1001

R = 3

So D2r = 101110000

We now need to calculate D2rG

Ans T = D2r + R

101110011

Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull Point-to-point

ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host

bull Broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Multiple Access protocolsbull single shared broadcast channel bull When there are two or more simultaneous

transmissions by nodes interference will occur and is called a collision if node receives two or more signals at the same time

Multiple access protocol (MAC)bull Distributed algorithm that determines how nodes

share the channel ie determine when a node can transmit

bull Communication about channel sharing must use channel itself ndash no out-of-band channel for coordination

Ideal Multiple Access Protocol

Broadcast channel of rate R bps

1 when one node wants to transmit it can send at rate R

2 when M nodes want to transmit each can send at average rate RM

3 fully decentralizedndash no special node to coordinate transmissionsndash no synchronization of clocks slots

4 Simple

MAC Protocols a taxonomyThree broad classesbull Channel Partitioning (Channelisation)

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

ndash allocate piece to node for exclusive usebull Random Access

ndash channel not divided collisions possiblendash ldquorecoverrdquo from collisions

bull ldquoTaking turnsrdquondash nodes take turns but nodes with more to send

can take longer turns

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 11: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

A more robust approach is the two dimensional parity scheme

In this case the datagram is divided into i rows of equal length j (these will be the columns)

Parity bits are added to each row and column

As you can see in the example it can not only detect a single error but also correct it ndash because it can identify the bit

As with the single parity this technique is limited but it has served as an introduction to error detection

10101 1

10110 0

01110 1

00101 0Parity errors

10101 1

11110 0

01110 1

00101 0

No error Single bit error

Cyclic Redundancy Check (CRC)These are known as polynomial codes

bull View data bits D as a binary numberbull Choose r+1 bit pattern called the generator G (agreed by Tx and Rx)bull Choose r CRC bits R such that

ndash ltDRgt is exactly divisible by G (using mod 2 arithmetic) ndash Then the receiver knowing G can divide ltDRgt by G If the

remainder is non-zero then an error has been detectedndash This technique can detect all burst errors less than r+1 bits

bull widely used in practice (Ethernet 80211 WiFi ATM)

See next slide

Modulo 2 arithmetic

bull Addition and subtraction are carried without lsquocarries or borrowsrsquo and therefore produce identical results Using XOR will enable this operation

1011 + 0101=1110

1011 - 0101=1110

1011 XOR 0101=1110

bull Multiplication and division is the same as with base 2 arithmetic except no carries when either carry or borrow occur

AnalysisThe following result is stated

D2rG = Q + RGA quotient and remainder Use R to form the transmitted bit patternT = D2r + RThe question is does R satisfy the requirement that TG does not

produce a remainder The following two lines confirm the validity of the above approach

TG = (D2r + R)G Q + RG+ RG = Q no remainder because (R XOR R)G = 0

The FCS is easily generated ndash just divide D2r by G and use the remainder as the FCS

R = remainder[ ]D2r

G

Example

D = 101110

G = 1001

R = 3

So D2r = 101110000

We now need to calculate D2rG

Ans T = D2r + R

101110011

Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull Point-to-point

ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host

bull Broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Multiple Access protocolsbull single shared broadcast channel bull When there are two or more simultaneous

transmissions by nodes interference will occur and is called a collision if node receives two or more signals at the same time

Multiple access protocol (MAC)bull Distributed algorithm that determines how nodes

share the channel ie determine when a node can transmit

bull Communication about channel sharing must use channel itself ndash no out-of-band channel for coordination

Ideal Multiple Access Protocol

Broadcast channel of rate R bps

1 when one node wants to transmit it can send at rate R

2 when M nodes want to transmit each can send at average rate RM

3 fully decentralizedndash no special node to coordinate transmissionsndash no synchronization of clocks slots

4 Simple

MAC Protocols a taxonomyThree broad classesbull Channel Partitioning (Channelisation)

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

ndash allocate piece to node for exclusive usebull Random Access

ndash channel not divided collisions possiblendash ldquorecoverrdquo from collisions

bull ldquoTaking turnsrdquondash nodes take turns but nodes with more to send

can take longer turns

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 12: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Cyclic Redundancy Check (CRC)These are known as polynomial codes

bull View data bits D as a binary numberbull Choose r+1 bit pattern called the generator G (agreed by Tx and Rx)bull Choose r CRC bits R such that

ndash ltDRgt is exactly divisible by G (using mod 2 arithmetic) ndash Then the receiver knowing G can divide ltDRgt by G If the

remainder is non-zero then an error has been detectedndash This technique can detect all burst errors less than r+1 bits

bull widely used in practice (Ethernet 80211 WiFi ATM)

See next slide

Modulo 2 arithmetic

bull Addition and subtraction are carried without lsquocarries or borrowsrsquo and therefore produce identical results Using XOR will enable this operation

1011 + 0101=1110

1011 - 0101=1110

1011 XOR 0101=1110

bull Multiplication and division is the same as with base 2 arithmetic except no carries when either carry or borrow occur

AnalysisThe following result is stated

D2rG = Q + RGA quotient and remainder Use R to form the transmitted bit patternT = D2r + RThe question is does R satisfy the requirement that TG does not

produce a remainder The following two lines confirm the validity of the above approach

TG = (D2r + R)G Q + RG+ RG = Q no remainder because (R XOR R)G = 0

The FCS is easily generated ndash just divide D2r by G and use the remainder as the FCS

R = remainder[ ]D2r

G

Example

D = 101110

G = 1001

R = 3

So D2r = 101110000

We now need to calculate D2rG

Ans T = D2r + R

101110011

Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull Point-to-point

ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host

bull Broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Multiple Access protocolsbull single shared broadcast channel bull When there are two or more simultaneous

transmissions by nodes interference will occur and is called a collision if node receives two or more signals at the same time

Multiple access protocol (MAC)bull Distributed algorithm that determines how nodes

share the channel ie determine when a node can transmit

bull Communication about channel sharing must use channel itself ndash no out-of-band channel for coordination

Ideal Multiple Access Protocol

Broadcast channel of rate R bps

1 when one node wants to transmit it can send at rate R

2 when M nodes want to transmit each can send at average rate RM

3 fully decentralizedndash no special node to coordinate transmissionsndash no synchronization of clocks slots

4 Simple

MAC Protocols a taxonomyThree broad classesbull Channel Partitioning (Channelisation)

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

ndash allocate piece to node for exclusive usebull Random Access

ndash channel not divided collisions possiblendash ldquorecoverrdquo from collisions

bull ldquoTaking turnsrdquondash nodes take turns but nodes with more to send

can take longer turns

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 13: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Modulo 2 arithmetic

bull Addition and subtraction are carried without lsquocarries or borrowsrsquo and therefore produce identical results Using XOR will enable this operation

1011 + 0101=1110

1011 - 0101=1110

1011 XOR 0101=1110

bull Multiplication and division is the same as with base 2 arithmetic except no carries when either carry or borrow occur

AnalysisThe following result is stated

D2rG = Q + RGA quotient and remainder Use R to form the transmitted bit patternT = D2r + RThe question is does R satisfy the requirement that TG does not

produce a remainder The following two lines confirm the validity of the above approach

TG = (D2r + R)G Q + RG+ RG = Q no remainder because (R XOR R)G = 0

The FCS is easily generated ndash just divide D2r by G and use the remainder as the FCS

R = remainder[ ]D2r

G

Example

D = 101110

G = 1001

R = 3

So D2r = 101110000

We now need to calculate D2rG

Ans T = D2r + R

101110011

Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull Point-to-point

ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host

bull Broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Multiple Access protocolsbull single shared broadcast channel bull When there are two or more simultaneous

transmissions by nodes interference will occur and is called a collision if node receives two or more signals at the same time

Multiple access protocol (MAC)bull Distributed algorithm that determines how nodes

share the channel ie determine when a node can transmit

bull Communication about channel sharing must use channel itself ndash no out-of-band channel for coordination

Ideal Multiple Access Protocol

Broadcast channel of rate R bps

1 when one node wants to transmit it can send at rate R

2 when M nodes want to transmit each can send at average rate RM

3 fully decentralizedndash no special node to coordinate transmissionsndash no synchronization of clocks slots

4 Simple

MAC Protocols a taxonomyThree broad classesbull Channel Partitioning (Channelisation)

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

ndash allocate piece to node for exclusive usebull Random Access

ndash channel not divided collisions possiblendash ldquorecoverrdquo from collisions

bull ldquoTaking turnsrdquondash nodes take turns but nodes with more to send

can take longer turns

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 14: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

AnalysisThe following result is stated

D2rG = Q + RGA quotient and remainder Use R to form the transmitted bit patternT = D2r + RThe question is does R satisfy the requirement that TG does not

produce a remainder The following two lines confirm the validity of the above approach

TG = (D2r + R)G Q + RG+ RG = Q no remainder because (R XOR R)G = 0

The FCS is easily generated ndash just divide D2r by G and use the remainder as the FCS

R = remainder[ ]D2r

G

Example

D = 101110

G = 1001

R = 3

So D2r = 101110000

We now need to calculate D2rG

Ans T = D2r + R

101110011

Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull Point-to-point

ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host

bull Broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Multiple Access protocolsbull single shared broadcast channel bull When there are two or more simultaneous

transmissions by nodes interference will occur and is called a collision if node receives two or more signals at the same time

Multiple access protocol (MAC)bull Distributed algorithm that determines how nodes

share the channel ie determine when a node can transmit

bull Communication about channel sharing must use channel itself ndash no out-of-band channel for coordination

Ideal Multiple Access Protocol

Broadcast channel of rate R bps

1 when one node wants to transmit it can send at rate R

2 when M nodes want to transmit each can send at average rate RM

3 fully decentralizedndash no special node to coordinate transmissionsndash no synchronization of clocks slots

4 Simple

MAC Protocols a taxonomyThree broad classesbull Channel Partitioning (Channelisation)

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

ndash allocate piece to node for exclusive usebull Random Access

ndash channel not divided collisions possiblendash ldquorecoverrdquo from collisions

bull ldquoTaking turnsrdquondash nodes take turns but nodes with more to send

can take longer turns

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 15: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Example

D = 101110

G = 1001

R = 3

So D2r = 101110000

We now need to calculate D2rG

Ans T = D2r + R

101110011

Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull Point-to-point

ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host

bull Broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Multiple Access protocolsbull single shared broadcast channel bull When there are two or more simultaneous

transmissions by nodes interference will occur and is called a collision if node receives two or more signals at the same time

Multiple access protocol (MAC)bull Distributed algorithm that determines how nodes

share the channel ie determine when a node can transmit

bull Communication about channel sharing must use channel itself ndash no out-of-band channel for coordination

Ideal Multiple Access Protocol

Broadcast channel of rate R bps

1 when one node wants to transmit it can send at rate R

2 when M nodes want to transmit each can send at average rate RM

3 fully decentralizedndash no special node to coordinate transmissionsndash no synchronization of clocks slots

4 Simple

MAC Protocols a taxonomyThree broad classesbull Channel Partitioning (Channelisation)

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

ndash allocate piece to node for exclusive usebull Random Access

ndash channel not divided collisions possiblendash ldquorecoverrdquo from collisions

bull ldquoTaking turnsrdquondash nodes take turns but nodes with more to send

can take longer turns

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 16: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Multiple Access Links and ProtocolsTwo types of ldquolinksrdquobull Point-to-point

ndash PPP for dial-up accessndash point-to-point link between Ethernet switch and host

bull Broadcast (shared wire or medium)ndash old-fashioned Ethernetndash upstream HFCndash 80211 wireless LAN

shared wire (eg cabled Ethernet)

shared RF (eg 80211 WiFi)

shared RF(satellite)

humans at acocktail party

(shared air acoustical)

Multiple Access protocolsbull single shared broadcast channel bull When there are two or more simultaneous

transmissions by nodes interference will occur and is called a collision if node receives two or more signals at the same time

Multiple access protocol (MAC)bull Distributed algorithm that determines how nodes

share the channel ie determine when a node can transmit

bull Communication about channel sharing must use channel itself ndash no out-of-band channel for coordination

Ideal Multiple Access Protocol

Broadcast channel of rate R bps

1 when one node wants to transmit it can send at rate R

2 when M nodes want to transmit each can send at average rate RM

3 fully decentralizedndash no special node to coordinate transmissionsndash no synchronization of clocks slots

4 Simple

MAC Protocols a taxonomyThree broad classesbull Channel Partitioning (Channelisation)

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

ndash allocate piece to node for exclusive usebull Random Access

ndash channel not divided collisions possiblendash ldquorecoverrdquo from collisions

bull ldquoTaking turnsrdquondash nodes take turns but nodes with more to send

can take longer turns

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 17: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Multiple Access protocolsbull single shared broadcast channel bull When there are two or more simultaneous

transmissions by nodes interference will occur and is called a collision if node receives two or more signals at the same time

Multiple access protocol (MAC)bull Distributed algorithm that determines how nodes

share the channel ie determine when a node can transmit

bull Communication about channel sharing must use channel itself ndash no out-of-band channel for coordination

Ideal Multiple Access Protocol

Broadcast channel of rate R bps

1 when one node wants to transmit it can send at rate R

2 when M nodes want to transmit each can send at average rate RM

3 fully decentralizedndash no special node to coordinate transmissionsndash no synchronization of clocks slots

4 Simple

MAC Protocols a taxonomyThree broad classesbull Channel Partitioning (Channelisation)

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

ndash allocate piece to node for exclusive usebull Random Access

ndash channel not divided collisions possiblendash ldquorecoverrdquo from collisions

bull ldquoTaking turnsrdquondash nodes take turns but nodes with more to send

can take longer turns

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 18: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Ideal Multiple Access Protocol

Broadcast channel of rate R bps

1 when one node wants to transmit it can send at rate R

2 when M nodes want to transmit each can send at average rate RM

3 fully decentralizedndash no special node to coordinate transmissionsndash no synchronization of clocks slots

4 Simple

MAC Protocols a taxonomyThree broad classesbull Channel Partitioning (Channelisation)

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

ndash allocate piece to node for exclusive usebull Random Access

ndash channel not divided collisions possiblendash ldquorecoverrdquo from collisions

bull ldquoTaking turnsrdquondash nodes take turns but nodes with more to send

can take longer turns

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 19: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

MAC Protocols a taxonomyThree broad classesbull Channel Partitioning (Channelisation)

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

ndash allocate piece to node for exclusive usebull Random Access

ndash channel not divided collisions possiblendash ldquorecoverrdquo from collisions

bull ldquoTaking turnsrdquondash nodes take turns but nodes with more to send

can take longer turns

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 20: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Channel Partitioning MAC protocols TDMA

TDMA time division multiple access (used by GSM for example)

bull access to channel in TDMA frames bull each station gets fixed length slot (length = pkt trans

time) in each frame bull unused slots go idle bull example 6-station LAN 134 have pkt slots 256

idle

1 3 4 1 3 4

6-slotframe

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 21: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Channel Partitioning MAC protocols FDMAFDMA frequency division multiple access bull channel spectrum divided into frequency bandsbull each station assigned fixed frequency bandbull unused transmission time in frequency bands go idle bull example 6-station LAN 134 have pkt frequency bands

256 idle

frequ

ency

bands

time

FDM cable

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 22: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Random Access Protocolsbull When node has packet to send

ndash It transmits at full channel data rate Rndash no a priori coordination among nodes

bull Two or more transmitting nodes results in a ldquocollisionrdquobull random access MAC protocol specify

ndash how to detect collisionsndash how to recover from collisions (retransmissions)

bull Examples of random access MAC protocolsndash slotted ALOHAndash ALOHAndash CSMA CSMACD CSMACA

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 23: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

CSMA (Carrier Sense Multiple Access)

CSMA listen before transmit

If channel sensed idle transmit entire frame

bull If channel sensed busy defer transmission

bull human analogy donrsquot interrupt others

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 24: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

CSMA collisionsbull collisions can still occurbull propagation delay means

two nodes may not hear each otherrsquos transmission collision

bull entire packet transmission time wasted

bull note role of distance amp propagation delay in determining collision probability

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 25: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

CSMACD (Collision Detection)CSMACD carrier sensing deferral as in CSMA

ndash collisions detected within short timendash colliding transmissions aborted reducing channel

wastage bull collision detection

ndash easy in wired LANs measure signal strengths compare transmitted received signals

ndash difficult in wireless LANs received signal strength overwhelmed by local transmission strength

bull human analogy the polite conversationalist

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 26: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

CSMACD collision detection

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 27: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

ldquoTaking Turnsrdquo MAC protocolsChannel partitioning MAC protocols

ndash share channel efficiently and fairly at high loadndash inefficient at low load delay in channel access

1N bandwidth allocated even if only 1 active node

Random access MAC protocolsndash efficient at low load single node can fully utilize

channelndash high load collision overhead

ldquotaking turnsrdquo protocols

look for best of both worlds

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 28: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

ldquoTaking Turnsrdquo MAC protocolsPolling bull Master (Primary) node

ldquoinvitesrdquo slave nodes to transmit in turn

bull Typically used with ldquodumbrdquo slave (secondary) devices

bull Concernsndash polling overhead ndash latencyndash single point of failure

(master)

master

slaves

poll

data

data

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 29: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

ldquoTaking Turnsrdquo MAC protocolsToken passingbull Control token passed from

one node to next sequentially

bull Token used to build the frame and is passed back onto the ring by the same station that made use of it

bull Concernsndash token overhead ndash latencyndash single point of failure

(token)

T

data

(nothingto send)

T

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 30: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Summary of MAC protocolsbull Channel partitioning by time frequency or code

ndash Time Division Frequency Divisionbull Random access (dynamic)

ndash ALOHA S-ALOHA CSMA CSMACDndash carrier sensing easy in some technologies (wire)

hard in others (wireless)ndash CSMACD used in Ethernetndash CSMACA used in 80211

bull Taking turnsndash polling from central site token passingndash Bluetooth FDDI IBM Token Ring

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 31: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

MAC Addresses and ARPbull 32-bit IP address

ndash network-layer addressndash used to get datagram to destination IP subnet

bull MAC (or LAN or physical or Ethernet) address ndash function get frame from one interface to another

physically-connected interface (same network)ndash 48 bit MAC address (for most LANs)

bull burned in NIC ROM also sometimes software settable

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 32: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

LAN Addresses and ARP

bull Each adapter on LAN has unique LAN address

Broadcast address =FF-FF-FF-FF-FF-FF

= adapter

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN(wired orwireless)

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 33: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

LAN Address (more)bull MAC address allocation administered by IEEEbull Manufacturer buys portion of MAC address space

(to assure uniqueness)bull Analogy

(a) MAC address like Social Security Number

(b) IP address like postal addressbull MAC flat address portability

ndash can move LAN card from one LAN to another

bull IP hierarchical address NOT portablendash address depends on IP subnet to which node is

attached

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 34: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

ARP Address Resolution Protocolbull Each IP node (host

router) on LAN has ARP table

bull ARP table IPMAC address mappings for LAN nodes Entry

lt IP address MAC address TTLgt

bull TTL (Time To Live) time after which address mapping will be forgotten (typically 20 min)

1A-2F-BB-76-09-AD

58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98

71-65-F7-2B-08-53

LAN

137196723

137196778

137196714

137196788

Question how to determineMAC address of B knowing Brsquos IP address

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 35: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

ARP protocol Same LAN (network)

1 A wants to send datagram to B and Brsquos MAC address is not in Arsquos ARP table

2 A broadcasts ARP query packet containing Bs IP address

dest MAC address = FF-FF-FF-FF-FF-FF

all machines on LAN receive ARP query

3 B receives ARP packet replies to A with its (Bs) MAC address

frame sent to Arsquos MAC address (unicast)

4 A caches (saves) IP-to-MAC address pair in its ARP table until information becomes old (times out) soft state

information that times out (goes away) unless refreshed

5 ARP is ldquoplug-and-playrdquo nodes create their ARP tables without intervention from net administrator

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 36: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Addressing routing to another LANWalkthrough send datagram from A to B via R

assume A knows Brsquos IP addressbull Two ARP tables in router R one for each IP network

(LAN)

R

1A-23-F9-CD-06-9B

222222222220

111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 37: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

More MAC addressingbull A creates IP datagram with source A destination B bull A uses ARP to get Rrsquos MAC address for 111111111110bull A creates link-layer frame with Rs MAC address as dest frame

contains A-to-B IP datagrambull Arsquos NIC sends frame bull Rrsquos NIC receives frame bull R removes IP datagram from Ethernet frame sees its destined

to Bbull R uses ARP to get Brsquos MAC address bull R creates frame containing A-to-B IP datagram sends to B

R

1A-23-F9-CD-06-9B

222222222220111111111110

E6-E9-00-17-BB-4B

CC-49-DE-D0-AB-7D

111111111112

111111111111

A74-29-9C-E8-FF-55

222222222221

88-B2-2F-54-1A-0F

B222222222222

49-BD-D2-C7-56-2A

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 38: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Ethernet

ldquoDominantrdquo wired LAN technology bull cheap $20 for NICbull first widely used LAN technologybull simpler cheaper than token LANs and

ATMbull kept up with speed race 10 Mbps ndash

10 Gbps

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 39: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Star topologybull Bus topology popular through mid 90s

ndash all nodes in same collision domain (can collide with each other)

bull Today star(hub) topology prevailsndash active switch in centerndash each ldquospokerdquo runs a (separate) Ethernet protocol (nodes do

not collide with each other)

switch

bus coaxial cable star

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 40: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Ethernet Frame Structurebull Sending adapter encapsulates IP datagram (or

other network layer protocol packet) in Ethernet frame

Preamble bull 7 bytes with pattern 10101010 followed by one byte

with pattern 10101011bull used to synchronize receiver sender clock rates

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 41: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Ethernet Frame Structure (more)

bull Address 6 bytesndash if adapter receives frame with matching destination address

or with broadcast address (eg ARP packet) it passes data in frame to network layer protocol

ndash otherwise adapter discards frame

bull Type indicates higher layer protocol (mostly IP but others possible eg Novell IPX AppleTalk)

bull CRC checked at receiver if error is detected frame is dropped

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 42: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Ethernet Unreliable connectionless

bull Connectionless No handshaking between sending and receiving NICs

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 unslotted CSMACD

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 43: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Ethernet CSMACD algorithm1 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 signal5 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

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 44: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Ethernetrsquos CSMACD (more)

Jam Signal make sure all other transmitters are aware of collision 48 bits

Exponential Backoff Goal adapt retransmission attempts to estimated current load Heavy load random wait will be longerFirst collision choose K from 01 delay is K 512 bit transmission timesafter second collision choose K from 0123hellipafter ten collisions choose K from 01234hellip1023

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 45: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

8023 Ethernet Standards Link amp Physical Layers

bull Many different Ethernet standardsndash common MAC protocol and frame formatndash different speeds 2 Mbps 10 Mbps 100 Mbps 1Gbps

10G bpsndash different physical layer media fiber cable

applicationtransportnetwork

linkphysical

MAC protocoland frame format

100BASE-TX

100BASE-T4

100BASE-FX100BASE-T2

100BASE-SX 100BASE-BX

fibre physical layercopper (twisterpair) physical layer

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 46: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

Manchester encoding

bull Used in 10BaseTbull Biphase polarbull Each bit has a transitionbull Allows clocks in sending and receiving nodes to

synchronize to each otherndash no need for a centralized global clock among nodes

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End
Page 47: Topic 2 - Data Link layer and LANs Introduction and services Error detection and correction Multiple access protocols Link-layer Addressing Ethernet

The End

bull Next week The network layer and IP

  • Topic 2 - Data Link layer and LANs
  • Learning Outcomes
  • Introduction and services
  • Link layer context
  • Link Layer Services
  • A bit more on reliable delivery
  • Where is the link layer implemented
  • Adaptors communicating
  • Error Detection
  • Parity Checking - an approach to Error Detection
  • A more robust approach is the two dimensional parity scheme
  • Cyclic Redundancy Check (CRC) These are known as polynomial codes
  • Modulo 2 arithmetic
  • Analysis
  • Example
  • Multiple Access Links and Protocols
  • Multiple Access protocols
  • Ideal Multiple Access Protocol
  • MAC Protocols a taxonomy
  • Channel Partitioning MAC protocols TDMA
  • Channel Partitioning MAC protocols FDMA
  • Random Access Protocols
  • CSMA (Carrier Sense Multiple Access)
  • CSMA collisions
  • CSMACD (Collision Detection)
  • CSMACD collision detection
  • ldquoTaking Turnsrdquo MAC protocols
  • Slide 28
  • Slide 29
  • Summary of MAC protocols
  • MAC Addresses and ARP
  • LAN Addresses and ARP
  • LAN Address (more)
  • ARP Address Resolution Protocol
  • ARP protocol Same LAN (network)
  • Addressing routing to another LAN
  • More MAC addressing
  • Ethernet
  • Star topology
  • Ethernet Frame Structure
  • Ethernet Frame Structure (more)
  • Ethernet Unreliable connectionless
  • Ethernet CSMACD algorithm
  • Ethernetrsquos CSMACD (more)
  • 8023 Ethernet Standards Link amp Physical Layers
  • Manchester encoding
  • The End