You are on page 1of 20

Data and Computer

Communications

Tenth Edition
by William Stallings
CHAPTER 12

Ethernet

2
Traditional Ethernet
Earliest was ALOHA

• Developed for packet radio networks


• Station may transmit a frame at any time
• If frame is determined invalid, it is ignored
• Maximum utilization of channel about 18%

Next came slotted ALOHA

• Organized slots equal to transmission time


• Increased utilization to about 37%

3
CSMA/CD Precursors
➢ Carrier Sense Multiple Access (CSMA)
⚫ Station listens to determine if there is another

transmission in progress
⚫ If idle, station transmits

⚫ Waits for acknowledgment

⚫ If no acknowledgment, collision is assumed and

station retransmits
⚫ Utilization far exceeds ALOHA

4
5
Nonpersistent CSMA
If the medium is idle,
transmit; otherwise, go to Disadvantage:
step 2 Capacity is wasted because
the medium will generally
remain idle following the end
of a transmission even if there
are one or more stations
waiting to transmit

If the medium is busy,


wait an amount of time
drawn from a probability
distribution and repeat
step 1 6
1-Persistent CSMA
➢ Avoids idle channel time
➢ Rules:
1. If medium is idle, transmit
2. If medium is busy, listen until idle; then transmit
immediately
➢ Stations are selfish
➢ If two or more stations are waiting, a collision is
guaranteed

7
P-Persistent CSMA
➢ A compromise to try and reduce collisions and idle time
➢ P-persistent CSMA rules:
1. If medium is idle, transmit with probability p, and
delay one time unit with probability (1–p)
2. If medium is busy, listen until idle and repeat step 1
3. If transmission is delayed one time unit,
repeat step 1
➢ Issue of choosing effective value of p to avoid instability
under heavy load

8
Value of p?
➢ Have n stations waiting to send
➢ At end of transmission, expected number of stations is
np
⚫ If np>1 on average there will be a collision
➢ Repeated transmission attempts mean collisions are
likely
➢ Eventually all stations will be trying to send, causing
continuous collisions, with throughput dropping to zero
➢ To avoid catastrophe np<1 for expected peaks of n
⚫ If heavy load expected, p must be small
⚫ Smaller p means stations wait longer
9
Description of CSMA/CD

4.
1. 2. 3.
After
If a collision is
If the medium transmitting
If the detected,
is busy, the jamming
medium is transmit a brief
continue to signal, wait a
idle, jamming signal
listen until the random
transmit; to assure that all
channel is idle, amount of
otherwise, stations know
then transmit time, referred
go to step 2 that there has
immediately to as the
been a collision
backoff, then
and cease
attempt to
transmission
transmit again

10
A B C D

TIME t0

A's transmission

C's transmission

Signal on bus

TIME t1

A's transmission

C's transmission

Signal on bus

TIME t2

A's transmission

C's transmission

Signal on bus

TIME t3

A's transmission

C's transmission

Signal on bus

Figure 12.3 CSMA/CD Operation 11


Which Persistence Algorithm?
➢ IEEE 802.3 uses 1-persistent
➢ Both nonpersistent and p-persistent have performance
problems

1-persistent seems more


unstable than p-persistent

• Because of greed of the stations


• Wasted time due to collisions is short
• With random backoff unlikely to collide on next
attempt to send 12
Binary Exponential Backoff
➢ IEEE 802.3 and Ethernet both use binary exponential
backoff
➢ A station will attempt to transmit repeatedly in the face of
repeated collisions
⚫ On first 10 attempts, mean random delay doubled

⚫ Value then remains the same for 6 further attempts

⚫ After 16 unsuccessful attempts, station gives up and

reports error
➢ 1-persistent algorithm with binary exponential backoff is
efficient over wide range of loads
➢ Backoff algorithm has last-in, first-out effect

13
Collision Detection
On twisted pair
On baseband bus
(star-topology)

Collision produces higher


signal voltage
Activity on more than
Collision detected if cable one port is collision
signal is greater than single
station signal

Signal is attenuated over


distance
Use special collision
Limit to 500m (10Base5) or
presence signal
200m (10Base2)
14
CHAPTER 14

The Internet Protocol

15
0 Network (7 bits) Host (24 bits) Class A

1 0 Network (14 bits) Host (16 bits) Class B

1 1 0 Network (21 bits) Host (8 bits) Class C

1 1 1 0 Multicast Class D

1 1 1 1 0 Future Use Class E

Figure 14.6 IPv4 Address Formats


16
IP IP IP
Addresses Addresses Addresses
Class A Class B Class C
Start with binary 110
Start with binary 0 Start with binary 10

Network addresses with a Range 192 to 223


first octet of 0 (binary Range 128 to 191(binary
0000000) and 127 (binary 10000000 to 10111111)
01111111) are reserved Second and third octet
also part of network
address
Second octet also
126 potential Class A
included in network
network numbers
address
221 = 2,097,152 addresses

214 = 16,384 Class B Nearly all allocated


Range 1 to 126 •See IPv6
addresses

17
Subnets and Subnet Masks
➢ Allows arbitrary complexity of internetworked LANs
within organization
➢ Insulate overall internet from growth of network numbers
and routing complexity
➢ Site looks to rest of internet like single network
➢ Each LAN assigned subnet number
➢ Host portion of address partitioned into subnet number
and host number
➢ Local routers route within subnetted network
➢ Subnet mask indicates which bits are subnet number
and which are host number
18
Table 14.2
IPv4 Addresses and Subnet Masks
Binary Representation Dotted Decimal
IP address 11000000.11100100.00010001.00111001 192.228.17.57
Subnet mask 11111111.11111111.11111111.11100000 255.255.255.224
Bitwise AND of address 11000000.11100100.00010001.00100000 192.228.17.32
and mask (resultant
network/subnet number)
Subnet number 11000000.11100100.00010001.001 1
Host number 00000000.00000000.000 00000.00011001 25
(a) Dotted decimal and binary representations of IPv4 address and subnet masks

Binary Representation Dotted Decimal


Class A default mask 11111111.00000000.00000000.00000000 255.0.0.0
Example Class A mask 11111111.11000000.00000000.00000000 255.192.0.0
Class B default mask 11111111.11111111.00000000.00000000 255.255.0.0
Example Class B mask 11111111.11111111.11111000.00000000 255.255.248.0
Class C default mask 11111111.11111111.11111111.00000000 255. 255. 255.0
Example Class C mask 11111111.11111111.11111111.11111100 255. 255. 255.252 19

(b) Default subnet masks


LAN X Net ID/Subnet ID: 192.228.17.32
Subnet number: 1

B
A
IP Address: 192.228.17.57
IP Address: 192.228.17.33 Host number: 25
Host number: 1
Rest of
R1
Internet Net ID/Subnet ID: 192.228.17.64
Subnet number: 2
LAN Y C

IP Address: 192.228.17.65
Host number: 1
R2

LAN Z Net ID/Subnet ID: 192.228.17.96


Subnet number: 3

D
IP Address: 192.228.17.97
Host number: 1

Figure 14.7 Example of Subnetworking


20

You might also like