Ethernet
Outline
Multiple Access and Ethernet Intro
Ethernet Framing
CSMA/CD protocol
Exponential backoff
1
Shared Access Networks are Different
• Shared Access Networks assume multiple nodes on the
same physical link
– Bus, ring and wireless structures
– Transmission sent by one node is received by all others
– No intermediate switches
• Need methods for moderating access (MAC protocols)
– Fairness
– Performance
– How can this be done?
2
Multiple Access Methods
• Fixed assignment
– Partition channel so each node gets a slice of the bandwidth
– Essentially circuit switching – thus inefficient
– Examples: TDMA, FDMA, CDMA (all used in wireless/cellular
environments)
• Contention-based
– Nodes contends equally for bandwidth and recover from collisions
– Examples: Aloha, Ethernet
• Token-based or reservation-based
– Take turns using the channel
– Examples: Token ring
3
Our Focus is Ethernet
• History
– Developed by Bob Metcalfe and others at Xerox PARC in mid-1970s
– Roots in Aloha packet-radio network
– Standardized by Xerox, DEC, and Intel in 1978
– LAN standards define MAC and physical layer connectivity
• IEEE 802.3 (CSMA/CD - Ethernet) standard – originally 2Mbps
• IEEE 802.3u standard for 100Mbps Ethernet
• IEEE 802.3z standard for 1,000Mbps Ethernet
• CSMA/CD: Ethernet’s Media Access Control (MAC) policy
– CS = carrier sense
• Send only if medium is idle
– MA = multiple access
– CD = collision detection
• Stop sending immediately if collision is detected
4
Ethernet Standard Defines Physical Layer
• 802.3 standard defines both MAC and physical layer
details
Metcalfe’s original
Ethernet Sketch
5
Ethernet Technologies: 10Base2
• 10: 10Mbps; 2: under 185 (~200) meters cable length
• Thin coaxial cable in a bus topology
• Repeaters used to connect multiple segments
– Repeater repeats bits it hears on one interface to its other interfaces: physical layer device only!
6
10BaseT and 100BaseT
• 10/100 Mbps rate
• T stands for Twisted Pair
• Hub(s) connected by twisted pair facilitate “star topology”
– Distance of any node to hub must be < 100m
7
Physical Layer Configurations for 802.3
• Physical layer configurations are specified in three parts
• Data rate (10, 100, 1,000)
– 10, 100, 1,000Mbps
• Signaling method (base, broad)
– Baseband
• Digital signaling
– Broadband
• Analog signaling
• Cabling (2, 5, T, F, S, L)
– 5 - Thick coax (original Ethernet cabling)
– F – Optical fiber
– S – Short wave laser over multimode fiber
– L – Long wave laser over single mode fiber
8
Ethernet Overview
• Most popular packet-switched LAN technology
• Bandwidths: 10Mbps, 100Mbps, 1Gbps
• Max bus length: 2500m
– 500m segments with 4 repeaters
• Bus and Star topologies are used to connect hosts
– Hosts are attached to network via Ethernet transceiver or hub or switch
• Detects line state and sends/receives signals
– Hubs are used to facilitate shared connections
– All hosts on an Ethernet are competing for access to the medium
• Switches break this model
• Problem: Distributed algorithm that provides fair access
9
Ethernet Overview (contd.)
• Ethernet by definition is a broadcast protocol
– Any signal can be received by all hosts
– Switching enables individual hosts to communicate
• Network layer packets are transmitted over an
Ethernet by encapsulating
• Frame Format
64 48 48 16 32
Preamble Dest Src Type Body CRC
addr addr
10
Switched Ethernet
• Switches forward and filter frames based on LAN addresses
– It’s not a bus or a router (although simple forwarding tables are maintained)
• Very scalable
– Options for many interfaces
– Full duplex operation (send/receive frames simultaneously)
• Connect two or more “segments” by copying data frames between them
– Switches only copy data when needed
• key difference from repeaters
• Higher link bandwidth
– Collisions are completely avoided
• Much greater aggregate bandwidth
– Separate segments can send at once
11
Ethernet Frames
• Preamble is a sequence of 7 bytes, each set to “10101010”
– Used to synchronize receiver before actual data is sent
• Addresses
– unique, 48-bit uni-cast address assigned to each adapter
• example: [Link]
• Each manufacturer gets its own address range
– broadcast: all 1s
– multicast: first bit is 1
• Type field is a de-multiplexing key used to determine to which higher level
protocol the frame should be delivered
• Body can contain up to 1500 bytes of data
12
A Quick Word about Aloha Networks
• Developed in late 60’s by Norm Abramson at Univ. of Hawaii
(!!) for use with packet radio systems
– Any station can send data at any time
– Receiver sends an ACK for data
– Timeout for ACK signals that there was a collision
• What happens if timeout is poorly timed?
– If there is a collision, sender will resend data after a random backoff
• Utilization (fraction of transmitted frames avoiding collision for
N nodes) was pretty bad
– Max utilization = 18%
• Slotted Aloha (dividing transmit time into windows) helped
– Max utilization increased to 36%
13
Ethernet’s MAC Algorithm
• In Aloha, decisions to transmit are made without paying attention
to what other nodes might be doing
• Ethernet uses CSMA/CD – listens to line before/during sending
• If line is idle (no carrier sensed)
– send packet immediately
– upper bound message size of 1500 bytes
– must wait 9.6us between back-to-back frames
• If line is busy (carrier sensed)
– wait until idle and transmit packet immediately
• called 1-persistent sending
• If collision detected
– Stop sending and jam signal
– Try again later
14
State Diagram for CSMA/CD
Packet?
No
Sense Send Detect
Carrier Collision
Yes
Discard
Packet Jam channel
attempts < 16 b=CalcBackoff();
wait(b);
attempts++;
attempts == 16
15
Collisions
Collisions are caused when two adaptors transmit at the same
time (adaptors sense collision based on voltage differences)
• Both found line to be idle
• Both had been waiting to for a busy line to become idle
A starts at A B
time 0
Message almost
A B
there at time T when
B starts – collision!
How can we be sure A knows about the collision?
16
Collision Detection
• How can A know that a collision has taken place?
– There must be a mechanism to insure retransmission on collision
– A’s message reaches B at time T
– B’s message reaches A at time 2T
– So, A must still be transmitting at 2T
• IEEE 802.3 specifies max value of 2T to be 51.2us
– This relates to maximum distance of 2500m between hosts
– At 10Mbps it takes 0.1us to transmit one bit so 512 bits (64B) take 51.2us to send
– So, Ethernet frames must be at least 64B long
• 14B header, 46B data, 4B CRC
• Padding is used if data is less than 46B
• Send jamming signal after collision is detected to insure all hosts see collision
– 48 bit signal
17
Collision Detection contd.
A B
time = 0
A B
time = T
A B
time = 2T
18
Exponential Backoff
• If a collision is detected, delay and try again
• Delay time is selected using binary exponential back-off
– 1st time: choose K from {0,1} then delay = K * 51.2us
– 2nd time: choose K from {0,1,2,3} then delay = K * 51.2us
– nth time: delay = K x 51.2us, for K=0,…,2n – 1
• Note max value for k = 1023
– give up after several tries (usually 16)
• Report transmit error to host
• If delay were not random, then there would be a chance that
sources would retransmit in lock step
• Why not just choose from small set for K
– This works fine for a small number of hosts
– Large number of nodes would result in more collisions
19
MAC Algorithm from the Receiver Side
• Senders handle all access control
• Receivers simply read frames with acceptable
address
– Address to host
– Address to broadcast
– Address to multicast to which host belongs
– All frames if host is in promiscuous mode
20
Fast and Gigabit Ethernet
• Fast Ethernet (100Mbps) has technology very similar to
10Mbps Ethernet
– Uses different physical layer encoding (4B5B)
– Many NIC’s are 10/100 capable
• Can be used at either speed
• Gigabit Ethernet (1,000Mbps)
– Compatible with lower speeds
– Uses standard framing and CSMA/CD algorithm
– Distances are severely limited
– Typically used for backbones and inter-router connectivity
– Becoming cost competitive
– How much of this bandwidth is realizable?
21
Experiences with Ethernet
• Ethernets work best under light loads
– Utilization over 30% is considered heavy
• Network capacity is wasted by collisions
• Most networks are limited to about 200 hosts
– Specification allows for up to 1024
• Most networks are much shorter
– 5 to 10 microsecond RTT (round trip-time)
• Transport level flow control helps reduce load (number of
back to back packets)
• Ethernet is inexpensive, fast and easy to administer!
22
Ethernet Problems
• Ethernet’s peak utilization is pretty low (like Aloha)
• Peak throughput worst with
– More hosts
• More collisions needed to identify single sender
– Smaller packet sizes
• More frequent arbitration
– Longer links
• Collisions take longer to observe, more wasted bandwidth
– Efficiency is improved by avoiding these conditions
23
Why did Ethernet Win?
• There are LOTS of LAN protocols
• Price
• Performance
• Availability
• Ease of use
• Scalability
24
Virtual Local Area Networks
(VLANs)
25
VIRTUAL LANs
• Virtual LANs (VLANs) are software - defined
LANs that group users by logical addresses
into a virtual, rather than physical, LAN through a
switch or router.
• The LAN switch can support many VLANs,
which operate as subnets.
26
VIRTUAL LANs
• Users within a VLAN traditionally are grouped by
physical ports on switches and routers, TCP port
address, MAC address, or IP address.
• Each node is attached to the switch port via a
dedicated circuit.
27
Defining VLANs
Separate Broadcast
• In traditional switched LANs,
Domains
the physical topology is
closely related to the logical
topology.
• Generally, workstations must
be grouped by their physical
proximity to a switch.
• To communicate among
LANs, each segment must
have a separate port on the
backbone device or a
connection to a common
backbone.
28
Defining VLANs Separate Broadcast
• VLANs provide segmentation
Domains
based on broadcast domains.
• VLANs logically segment
switched networks based on the
functions, project teams, or
applications of the organization
regardless of the physical
location or connections to the
network.
• Communication among VLANs
still require a router. BUT, only
one physical connection will
handle all routing.
29
Defining VLANs
• VLANs are created to provide segmentation services
traditionally provided by physical routers in LAN
configurations.
– They address:
• Scalability
• Security
• Network Management
• Broadcast Filtering
• Traffic Flow Management
• Switches may not forward any traffic between VLANs, as
this would violate the integrity of the VLAN broadcast
domain.
• Traffic must be routed between VLANs. 30
What Does This Mean?
31
Requirements:
- Different department on
each floor.
- Three different LANs per floor.
- Separate networks
With routers:
Expensive!
- 4 Ports each
- 3 hubs per floor
- 10 Broadcast domains
- Inefficient traffic flow
32
What Does This Mean?
:
le
nage
Domains
ffic flow 33
Defining VLANs
• A VLAN, then, is a broadcast domain (IP Subnet) created
by one or more switches. 34
Defining VLANs
• The above design shows 3 separate broadcast domains
created using one router with 3 ports and 3 switches.
• The router filters the broadcasts for each LAN. 35
Defining VLANs
• A better design still creates the 3 separate broadcast
domains but only requires 1 switch.
• The router provides broadcast filtering over a single link.
36
Defining VLANs
• A VLAN allows:
• Creation of groups of logically networked devices.
• The devices to act as if they are on their own independent network.
• The devices can share a common infrastructure.
– Each VLAN is a separate broadcast domain.
• Broadcast traffic is controlled.
– Each VLAN is a separate IP subnet.
• To communicate among VLANs, you must use a router
37
Benefits of VLANs
• Security:
– Groups with specific security needs are isolated from the rest of
the network.
• Cost Reduction:
– Need for expensive hardware upgrades is reduced.
– Better use of existing bandwidth and links.
• Higher Performance:
– Dividing large, flat Layer 2 networks into separate broadcast
domains reduces unnecessary traffic on each new subnet.
38
Benefits of VLANs
• Broadcast Storm Mitigation:
– Dividing a network into VLANs prevents a broadcast storm
from propagating to the whole network.
• Improved IT Staff Efficiency:
– Easier to manage the network because users with similar
network requirements share the same VLAN.
• Simpler Project or Application Management:
– Having separate functions makes working with a specialized
application easier. For example, an
e-learning development platform for faculty.
39
Types of VLANs
• Traditionally, two methods of implementing VLANs:
– Static or Port-Based:
• Ports on a switch are assigned to a specific VLAN.
– Dynamic:
• VLANs created by accessing a Network Management server. The
MAC address/VLAN ID mapping is set up by the Network
Administrator and the server assigns a VLAN ID when the device
contacts it.
• Today, there is essentially one method of
implementing VLANs: Port-Based.
40