Вы находитесь на странице: 1из 38

Data Communications &

Network Principles
Lecture 2
Token passing
CSMA/CD & Ethernet
13th October 2005

Aims & Learning Outcomes


Medium Access Control
Token passing
Token ring
Token bus

CSMA/CD
Multiple Access
Carrier Sensing
Persistence strategies

Collision detection

Ethernet & IEEE 802.3

Medium Access Control (MAC)


Discipline imposed to ensure that the
medium is accessed & used in a fair way
Associated with OSI layer 2 data link
layer
Defined by IEEE802 project

Token passing
Token: special frame
Control of medium achieved by passing
token from node to node
A station can only transmit data when it is
in possession of the token

Token ring
D
token

Token passing applied to a ring topology


Token circulates when all stations are idle
Each station has a predecessor (upstream
neighbour) and a successor (downstream
neighbour)
5

Token ring ctd


Example: Node A needs to send a frame to
node C
Node A waits for
receipt of token from
its upstream
neighbour
(predecessor)

token

C
B

Token ring ctd


Node A seizes the token
There is no token on the ring
All other stations wishing to
transmit must wait

It begins to transmit a data


frame
Node C copies data frame
addressed to it
Frame continues around the
ring

D
A
Fram
e

C
B

Token ring ctd


Node A is still in possession of
the token
Node A awaits receipt of the
start of frame and absorbs it
i.e. frame is now removed by
transmitting node

Fram
e

C
B

Token ring ctd


Last stage
Either: When last bit of frame
has been received, node A
generates and passes on the
token
Or: When last bit of frame
has been transmitted by
node A, it passes on the
token early release

D
A

token
B

D
A
token

C
B
9

Token ring ctd


Advantages
Flexible control over access that is provided
Access is fair
Can easily provide for priority and guaranteed
bandwidth services

Disadvantages
Requires token maintenance
Loss of token prevents further utilisation of the ring
Duplication of the token can disrupt ring operation
10

Token
bus
Logical
ring

Token passing applied to a bus topology


Nodes are linked in the form of a logical
ring
Token is passed physically using the bus
along the logical ring

11

Token bus ctd


Example: Node A needs to send a frame to
node D
Node A waits for receipt of token from its
predecessor or upstream neighbour (node C)
Once in possession of the token, node A
broadcasts the frames on the bus
After completion of transmission, node A
passes the token to its successor or
downstream neighbour (node D)
12

Token passing: analysis


Under lightly loaded conditions: some
inefficiency as station must wait for token
Under heavy loads: efficient and fair
Round-robin fashion: each station in turn
is given the opportunity to transmit

13

Token passing: procedure

14

CSMA/CD
Carrier Sense Multiple Access with
Collision Detection (CSMA/CD)
Three components:
Multiple Access: several nodes or stations
are connected to or use a common link
Carrier Sensing: checking the state of the
medium
Collision detection: procedure to handle a
collision
15

CSMA/CD Multiple Access


Multiple Access
Several nodes are connected to or use a
common link i.e. multipoint link
Cable is said to operate in multiple access
mode

Carrier Sensing
A problem arises if two nodes attempt to
transmit a fame over the cable at the same
time
This results in the data being corrupted: a
collision is said to have occurred

16

CSMA/CD: Collision

17

CSMA/CD: Collision ctd


At time t1, station A at the left end of the
medium goes through carrier sensing
Medium is idle, so it starts sending a frame
At time t2 (t2 > t1), station Z at the right end
of the medium goes through carrier
sensing
It finds the medium idle because at this
time propagation from A has not reached
Z, hence Z also sends a frame
18

CSMA/CD: Collision ctd


The two signals collide at time t3 (t3 > t2 >
t1)
Result of collision is a garbled signal
which also propagates in both directions
The collision signal reaches
station Z at time t4 (t4 > t3 > t2 > t1)
& station A at time t5 (t5 > t4 > t3 > t2 > t1)
Hence unsuccessful transmission

Acknowledgement sent if successful


transmission
19

CSMA/CD Carrier Sensing


To minimise the chance of a collision:
before transmitting a frame, a station
listens to the cable to detect whether a
frame is being transmitted
Two possibilities:
No carrier is sensed i.e. medium is idle
Station may transmit
Carrier is sensed i.e. the medium is busy as a
frame is being transmitted
Transmission is deferred i.e. station waits
20
(according to persistence strategy)

CSMA/CD Carrier Sensing:


Persistence Strategy
Persistence strategy defines the
procedures for a station that senses a
busy medium
Two substrategies:
Non-Persistent
Persistent
1-persistent
p-persistent
21

Persistence strategies: Nonpersistent


A station wishing to transmit listens to the
medium and obeys the following rules:
1. If medium is idle, transmit; otherwise go
to step 2
2. If medium is busy, wait a random
amount of time (transmission delay)
and repeat step 1
Disadvantage: Capacity is wasted because
the medium will generally remain idle!
22

Persistence strategies: Persistent


A station wishing to transmit listens to the
medium
If the line is idle, the stations sends a
frame according to two possible
variations:
1-persistent
p-persistent

23

Persistence strategies: 1-persistent


A station wishing to transmit listens to the
medium and obeys the following rules:
1. If medium is idle, transmit; otherwise go
to step 2
2. If medium is busy, continue to listen
until the channel is sensed idle; then
transmit immediately
Advantage: Avoids channel idle time, hence
solving the problem of nonpersistent mode
24

Persistence strategies: p-persistent


Compromise between nonpersistent and 1persistent (reduced collisions like nonpersistent
& reduced idle time like 1-persistent):
The rules are as follows:
1. If medium is idle, transmit with probability p,
and delay one time unit with probability (1-p)
A time unit = max propagation delay, typically
2. If medium is busy, continue to listen until the
channel is idle and then repeat step 1
3. If transmission is delayed one time unit,
repeat step 1
25

Persistence strategies

26

CSMA/CD: Description
1. If the medium is idle, transmit; otherwise go to
step 2
2. If the medium is busy, continue to listen until
the channel is idle, then transmit immediately
3. Receiving end of transmitting station monitors
the medium to see if the transmission was
successful
4. If a collision is detected during transmission,
transmit a brief jamming signal to assure that
all stations know that there has been a
collision and then cease transmission (and
frame needs to be sent again)
27

CSMA/CD: Description ctd


5. After transmitting the jamming signal,
wait a random amount of time, referred to
as the backoff, then attempt to transmit
again (repeat from step 1)

Back off how much?


A little the first time
More if a collision occurs again
Much more if it happens a third time, and so
on
28

CSMA/CD: procedure

29

Ethernet
Based upon the IEEE802.3 standards
Data rate: 10 Mbps
Bus network topology
i.e. the medium is shared between all stations

Operates in broadcast mode


All stations receive all transmissions

MAC method used: CSMA/CD


30

IEEE 802.3 MAC Frame

6 fixed-length fields + 1 variable-length field


Preamble: a 7-octet pattern of alternating 0s
and 1s
Used by the receiver to establish bit synchronisation

Start Frame Delimiter (SFD): 1-octet long


The sequence is 10101011 & indicates the actual
start of the frame
It enables the receiver to locate the first bit of the rest
31
of the frame

IEEE 802.3 MAC Frame ctd

Destination Address (DA): 6 octets


Specifies the station(s) for which the frame is
intended

Source Address (SA): 6 octets


Specifies the station that sent the frame

Length PDU (Protocol Data Unit): 2 octets


Indicates the length of the data field

32

IEEE 802.3 MAC Frame ctd

Data & Padding


Minimum and maximum frame sizes apply
Padding: Octets added to ensure that the frame
meets the minimum frame size requirement

CRC (Cyclic Redundancy Code) or FCS (Frame


Check Sequence): 4 octets
Error detection information

33

Addressing
Each station on an Ethernet network has
its own network interface card (NIC)
The NIC fits inside the station and
provides it with a 6-byte physical address
Ethernet address
6 bytes
Written in hexadecimal notation

34

Ethernet: categories
IEEE802.3 10 Mbps specifications
Physical layer implementations
Concise notation:
<data rate><signalling method><max segment length>
<Mbps>
<100s m>

35

Ethernet: categories ctd


10Base5
50 coaxial cable
Manchester digital signalling
Maximum length of a cable segment = 500m

10Base2
Similar to 10Base5, but thinner cable
Supports fewer taps over a shorter distance
Lower-cost alternative to 10Base5
36

Ethernet: categories ctd


10Base-T
Unshielded twisted pair in a star-shaped
topology
Length of link is limited to 100m (as a result of
high data rate and poor transmission qualities
of unshielded twisted pair)

10Base-FL
Uses optical fibre
Uses a star topology to connect stations to a
hub
37

Reading list
Stallings, W., (2004), Data and Computer
Communications, Pearson Prentice Hall,
7th Edition: sections 15.3, 16.1-16.3

38

Вам также может понравиться