Title: CS 456 Computer Networks
1CS 456 Computer Networks
- Local Area Networks/Media Access Control
- Prof. Varsha Apte
- References Stallings, Tanenbaum, Halsall
2CSMA (Carrier-sense multiple access)
- If propagation time is much less than
transmission time - all stations know that a
transmission has started almost immediately - First listen for clear medium (carrier sense)
- If medium idle, transmit
- Collision occurs if another user starts
transmitting within the time it takes for the
first bit to reach this user (propagation delay) - Collision detected by waiting round trip plus
ACK contention - No ACK then retransmit
- Max utilization depends on propagation time
(medium length) and frame length - Longer frame and shorter propagation gives better
utilization
3CSMA collisions
spatial layout of nodes
collisions can still occur propagation delay
means two nodes may not hear each others
transmission
collision entire packet transmission time wasted
note role of distance propagation delay in
determining collision probability
4CSMA/CD
- With CSMA, collision occupies medium for duration
of transmission of full frame - Instead CD collision detect
- Stations listen whilst transmitting
- If medium idle, transmit
- If busy, listen for idle, then transmit (and
listen) - If collision detected, jam (send noise) then
cease transmission - Even if collision happens at the station next to
the transmitting station, collision will be
detected after gt RTT - After jam, wait random time then start again
- Binary exponential back off
5Collision detection
??
Collision detection can still take as long as
6CSMA/CD collision detection
7Collision Detection
- Collision produces much higher signal voltage
than signal - Collision detected if cable signal greater than
single station signal - Signal attenuated over distance
- Limit distance to 500m (10Base5) or 200m
(10Base2) - For twisted pair (star-topology) activity on more
than one port is collision - Frames repeated, for CD to work
8Why Jam?
- Tanenbaum to make sure the sender does not miss
the collision (48 bits) - Halsall Ensure that the collision is detected
by all stations involved - Stallings Assure all staitons know that there
has been a collision - Keshav Sequence of 512 bits to ensure that
every active station on the network knows that a
collision happened and increments its backoff
counter to ensure that all colliding stations
agree that a collision has happened
9CSMA/CDOperation
10IEEE 802 v OSI
11802 Layers -Media Access Control
- Assembly of data into frame with address and
error detection fields - Disassembly of frame
- Address recognition
- Error detection
- Govern access to transmission medium
- Not found in traditional layer 2 data link
control - For the same LLC, several MAC options may be
available
12LAN Protocols in Context
13LAN Topologies
14IEEE 802.3 (Ethernet) Frame Format
15Collision detection
- Transmitting stations may detect collisions
almost immediately, and stop transmission - Saves time and bandwidth
- Will improve upon just CSMA only if collision is
detected during frame transmission - This is possible if frames are long enough (and
prop. Delay is short enough) so that collision is
detected while transmission - Guideline used in IEEE 802.3
- Frame transmission time gt 2prop delta
16Ethernet min frame length
- Min length needed for CD for 2500m distance
specification, RT prop delay is determined to be
50 ?sec - Frame transmission time gt 50 ?sec
- At 10Mbps, bits transmitted in 50 ?sec is 500 lt
512 648 bits 64 bytes - When transmission interrupted, bits pieces of
frames appear on the cable - Min frame length is one filter for valid frames
forward
17Binary Expon. Backoff
- After collision, time divided into slots, length
51.2 ?secs each (64-byte transmission time,
remember 2.T?) - After 1st collision, wait for rand(0,1) slot
times - After 2nd, wait for rand(0,1,2,3) slot times
- And so on till max 1023 slots (210, and after 16
collisions, abort. - Adapts to the number of stations on the bus
18Fast Ethernet
- Higher bit rate media (100 Mbps) is available.
- Can it be used for Ethernet?
- Recall minimum frame length?
- Set512 bits by calculating time needed to detect
collisions in Ethernets of upto 2.5km length, of
10Mbps bit rate - Can higher bit rates be used without changing
protocol specs, and still make it work? - Frame transmission time for 512 bit frame
_at_100Mbps 5?sec - 5 ?sec gt twice prop. delay
- Should be lt (1/10th) of 2.5 km gt 200m
19Switched Ethernet
- Use switching hub
- Possibility of collisions?
- Only when two frames are headed for the same
destination port - As opposed to normal switches, no buffering
-yes collision! - Collision signal indicated to sources, and
normal CSMA/CD used - Switching table filled same way as bridge
technique (learning from source address/port of
entry) - Enhancements where if traffic is mostly to one
host, that port is higher rate, and buffering is
done
20Gigabit Ethernet
- 1000 Mbps transmission media available.
- Cannot continue reducing max length
- Two enhancements to basic CSMA/CD
- Carrier extension Pad MAC frames to be at least
4096 bits - This means 4 ?sec frame transmission time
- 2Prop delay lt 4 ?sec Length restrictions
21Performance analysis Bus Utilization
a gt 1
a lt 1
U 1/(1a)
Assumes no collisions etc
22Performance Analysis
- U 1/(1a) no overheads, no collisions
- With collisions?
- a propagation time/frame transmission time
- Frame transmission interval 1/2a
- U (1/2a)/(1/2a) w,
- Where w mean length of contention interval
- As n-gtinfinity,
- U -gt 1/(13.44a)
-
23Extending LANs
- Hubs
- Bridges
- Switched LANs
24Star LANs
- Use unshielded twisted pair wire (telephone)
- Minimal installation cost
- May already be an installed base
- All locations in building covered by existing
installation - Attach to a central active hub
- Two links
- Transmit and receive
- Hub repeats incoming signal on all outgoing lines
- Link lengths limited to about 100m
- Fiber optic - up to 500m
- Logical bus - with collisions
25Two Level Star Topology
26Hubs and Switches
- Shared medium hub
- Central hub
- Hub retransmits incoming signal to all outgoing
lines - Only one station can transmit at a time
- With a 10Mbps LAN, total capacity is 10Mbps
- Switched LAN hub
- Hub acts as switch
- Incoming frame switches to appropriate outgoing
line - With two pairs of lines in use, overall capacity
is now 20Mbps
27Switched Hubs
- No change to software or hardware of devices
- Each device has dedicated capacity
- Scales well
- Store and forward switch
- Accept input, buffer it briefly, then output
- Cut through switch
- Take advantage of the destination address being
at the start of the frame - Begin repeating incoming frame onto output line
as soon as address recognized - May propagate some bad frames
28Hubs and Switches (diag)
29Bridges
- Ability to expand beyond single LAN
- Provide interconnection to other LANs
- Use Bridge or router
- Bridge is simpler
- Connects similar LANs
- Identical protocols for physical and link layers
- Minimal processing
- Router more general purpose
- Interconnect various LANs and WANs
- see later
30Why Bridge?
- Reliability
- Performance
- Security
- Geography
31Functions of a Bridge
- Read all frames transmitted on one LAN and accept
those address to any station on the other LAN - Using MAC protocol for second LAN, retransmit
each frame - Do the same the other way round
32Bridge Operation
33Bridge Design Aspects
- No modification to content or format of frame
- No encapsulation
- Exact bitwise copy of frame
- Minimal buffering to meet peak demand
- Contains routing and address intelligence
- Must be able to tell which frames to pass
- May be more than one bridge to cross
- May connect more than two LANs
- Bridging is transparent to stations
- Appears to all stations on multiple LANs as if
they are on one single LAN
34Bridge Protocol Architecture
- IEEE 802.1D
- MAC level
- Station address is at this level
- Bridge does not need LLC layer
- It is relaying MAC frames
- Can pass frame over external comms system
- e.g. WAN link
- Capture frame
- Encapsulate it
- Forward it across link
- Remove encapsulation and forward over LAN link
35Connection of Two LANs
36Multiple LANs
37Needed Routing
- Complex large LANs need alternative routes
- Load balancing
- Fault tolerance
- Bridge must decide whether to forward frame
- Bridge must decide which LAN to forward frame on
- Routing selected for each source-destination pair
of LANs - Done in configuration
- Usually least hop route
- Only changed when topology changes