EEC-484/584 Computer Networks - PowerPoint PPT Presentation

Loading...

PPT – EEC-484/584 Computer Networks PowerPoint presentation | free to download - id: 8063fb-OTY0M



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

EEC-484/584 Computer Networks

Description:

EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao wenbingz_at_gmail.com – PowerPoint PPT presentation

Number of Views:71
Avg rating:3.0/5.0
Slides: 33
Provided by: Wenb91
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: EEC-484/584 Computer Networks


1
EEC-484/584Computer Networks
  • Lecture 13
  • Wenbing Zhao
  • wenbingz_at_gmail.com

2
Outline
  • CRC
  • Medium Access Control (MAC)
  • Ethernet
  • Manchester Encoding
  • The Ethernet MAC Sublayer Protocol
  • The Binary Exponential Backoff Algorithm

3
Checksumming Cyclic Redundancy Check
  • view data bits, D, as a binary number
  • choose r1 bit pattern (generator), G
  • goal choose r CRC bits, R, such that
  • ltD,Rgt exactly divisible by G (modulo 2)
  • receiver knows G, divides ltD,Rgt by G. If
    non-zero remainder error detected!
  • can detect all burst errors less than r1 bits
  • widely used in practice (Ethernet, 802.11 WiFi)

1/14/2017
3
EEC484/584 Computer Networks
4
CRC Example
  • Want
  • D.2r XOR R nG
  • equivalently
  • D.2r nG XOR R
  • equivalently
  • if we divide D.2r by G, want remainder R

D.2r G
R remainder
1/14/2017
4
EEC484/584 Computer Networks
5
Medium Access Control
  • Two types of links
  • point-to-point
  • PPP for dial-up access
  • point-to-point link between Ethernet switch and
    host
  • broadcast (shared wire or medium)
  • old-fashioned Ethernet
  • 802.11 wireless LAN

humans at a cocktail party (shared air,
acoustical)
shared wire (e.g., cabled Ethernet)
shared RF (e.g., 802.11 WiFi)
shared RF (satellite)
1/14/2017
5
EEC484/584 Computer Networks
6
MAC Protocols
  • Assumption
  • Single shared broadcast channel
  • Two or more simultaneous transmissions by nodes
    interference
  • Collision if node receives two or more signals at
    the same time
  • MAC protocols
  • Distributed algorithm that determines how nodes
    share channel, i.e., determine when node can
    transmit
  • Communication about channel sharing must use
    channel itself!
  • No out-of-band channel for coordination

1/14/2017
6
EEC484/584 Computer Networks
7
Ideal MAC 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 R/M
  • 3. fully decentralized
  • no special node to coordinate transmissions
  • no synchronization of clocks, slots
  • 4. simple

1/14/2017
7
EEC484/584 Computer Networks
8
MAC Protocols a taxonomy
  • Three broad classes
  • Channel Partitioning
  • divide channel into smaller pieces (time slots,
    frequency, code)
  • allocate piece to node for exclusive use
  • Random Access
  • channel not divided, allow collisions
  • recover from collisions
  • Taking turns
  • nodes take turns, but nodes with more to send can
    take longer turns

1/14/2017
8
EEC484/584 Computer Networks
9
Channel Partitioning MAC protocols TDMA
  • TDMA time division multiple access
  • access to channel in "rounds"
  • each station gets fixed length slot (length pkt
    trans time) in each round
  • unused slots go idle
  • example 6-station LAN, 1,3,4 have pkt, slots
    2,5,6 idle

6-slot frame
3
3
4
1
4
1
1/14/2017
9
EEC484/584 Computer Networks
10
Channel Partitioning MAC protocols FDMA
  • FDMA frequency division multiple access
  • channel spectrum divided into frequency bands
  • each station assigned fixed frequency band
  • unused transmission time in frequency bands go
    idle
  • example 6-station LAN, 1,3,4 have pkt, frequency
    bands 2,5,6 idle

time
frequency bands
FDM cable
1/14/2017
10
EEC484/584 Computer Networks
11
Random Access Protocols
  • When node has packet to send
  • transmit at full channel data rate R.
  • no a priori coordination among nodes
  • two or more transmitting nodes ? collision,
  • random access MAC protocol specifies
  • how to detect collisions
  • how to recover from collisions (e.g., via delayed
    retransmissions)
  • Examples of random access MAC protocols
  • ALOHA
  • slotted ALOHA
  • CSMA, CSMA/CD, CSMA/CA

1/14/2017
11
EEC484/584 Computer Networks
12
Pure ALOHA
  • pure Aloha simple, no synchronization
  • when frame first arrives
  • transmit immediately
  • collision probability increases
  • frame sent at t0 collides with other frames sent
    in t0-1,t01

1/14/2017
12
EEC484/584 Computer Networks
13
Pure Aloha efficiency
  • P(success by given node) P(node transmits) .
  • P(no
    other node transmits in p0-1,p0 .
  • P(no
    other node transmits in p0,p01
  • p .
    (1-p)N-1 . (1-p)N-1
  • p .
    (1-p)2(N-1)
  • choosing optimum
    p and then letting n -gt infty ...

  • 1/(2e) .18

1/14/2017
13
EEC484/584 Computer Networks
14
Slotted ALOHA
  • Assumptions
  • all frames same size
  • time divided into equal size slots (time to
    transmit 1 frame)
  • nodes start to transmit only slot beginning
  • nodes are synchronized
  • if 2 or more nodes transmit in slot, all nodes
    detect collision
  • Operation
  • when node obtains fresh frame, transmits in next
    slot
  • if no collision node can send new frame in next
    slot
  • if collision node retransmits frame in each
    subsequent slot with prob. p until success

1/14/2017
14
EEC484/584 Computer Networks
15
Slotted ALOHA
  • Pros
  • single active node can continuously transmit at
    full rate of channel
  • highly decentralized only slots in nodes need to
    be in sync
  • simple
  • Cons
  • collisions, wasting slots
  • idle slots
  • clock synchronization

1/14/2017
15
EEC484/584 Computer Networks
16
Slotted Aloha efficiency
  • max efficiency find p that maximizes
    Np(1-p)N-1
  • for many nodes, take limit of Np(1-p)N-1 as N
    goes to infinity, gives
  • Max efficiency 1/e .37

Efficiency long-run fraction of successful
slots (many nodes, all with many frames to send)
  • suppose N nodes with many frames to send, each
    transmits in slot with probability p
  • prob that given node has success in a slot
    p(1-p)N-1
  • prob that any node has a success Np(1-p)N-1

At best channel used for useful transmissions
37 of time!
!
1/14/2017
16
EEC484/584 Computer Networks
17
CSMA (Carrier Sense Multiple Access)
  • CSMA listen before transmit
  • If channel sensed idle transmit entire frame
  • If channel sensed busy, defer transmission
  • human analogy dont interrupt others!

1/14/2017
17
EEC484/584 Computer Networks
18
CSMA 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
1/14/2017
18
EEC484/584 Computer Networks
19
CSMA/CD (Collision Detection)
  • CSMA/CD carrier sensing, deferral as in CSMA
  • collisions detected within short time
  • colliding transmissions aborted, reducing channel
    wastage
  • collision detection
  • easy in wired LANs measure signal strengths,
    compare transmitted, received signals
  • difficult in wireless LANs received signal
    strength overwhelmed by local transmission
    strength

1/14/2017
19
EEC484/584 Computer Networks
20
CSMA/CD collision detection
1/14/2017
20
EEC484/584 Computer Networks
21
Ethernet
  • dominant wired LAN technology
  • cheap 20 for NIC
  • first widely used LAN technology
  • simpler, cheaper than other schemes
  • kept up with speed race 10 Mbps 10 Gbps

Metcalfes Ethernet sketch
22
802.3 Ethernet Standards Link Physical Layers
  • Many different Ethernet standards
  • common MAC protocol and frame format
  • different speeds 2 Mbps, 10 Mbps, 100 Mbps,
    1Gbps, 10G bps
  • different physical layer media fiber, cable

MAC protocol and frame format
100BASE-TX
100BASE-FX
100BASE-T2
100BASE-SX
100BASE-BX
100BASE-T4
23
Manchester Encoding
  • Binary encoding
  • Hard to distinguish 0 bit (0-volt) from idle
    (0-volt)
  • Requires clocks of all stations synchronized
  • Manchester encoding
  • used in 10BaseT
  • each bit has a transition
  • allows clocks in sending and receiving nodes to
    synchronize to each other
  • no need for a centralized, global clock among
    nodes!

24
Ethernet Frame Structure
  • Preamble for clock synchronization
  • First 7 bytes with pattern 10101010, last byte
    with pattern 10101011
  • The two consecutive 1s indicate the start of a
    frame
  • How can the receiver tell the end of the frame?
  • No current on the wire (interesting discussion at
    http//www.tomshardware.com/forum/19951-42-detecti
    ng-length-ethernet-frame)

Not considered as part of the header!
gt 64 bytes
25
Ethernet Frame Structure
  • Destination address 6 bytes (48 bits)
  • Highest order bit 0 individual, 1 multicast
    all 1s broadcast
  • Frames received with non-matching destination
    address is discarded
  • Type/Length type of network layer protocol (or
    length of payload)
  • Pad used to produce valid frame gt 64 bytes
  • Checksum 32-bit cyclic redundancy check

26
CSMA with Collision Detection
  • If two stations start transmitting
    simultaneously, both detect collision and stop
    transmitting
  • Monitor collision while sending
  • Minimum time to detect collision gt minimum frame
    length
  • Time divided into slots
  • Length of slot 2t worst-case round-trip
    propagation time
  • To accommodate longest path, slot time 512 bit
    times 51.2 msec (10Mbps Ethernet) gt min frame
    length 51.2 msec X 10 Mbps 512 b 64 byte

27
Minimum Time to Detect Collision (in worst-case
scenario)
  • To ensure the sender can detect collision
  • All frames must take more than 2t to send so that
    transmission is still taking place when the noise
    burst gets back to the sender

1/14/2017
EEC-484/584 Computer Networks
Wenbing Zhao
28
Ethernet MAC Sublayer Protocol
  • Connectionless No handshaking between sending
    and receiving NICs
  • Ethernet resides in the Network Interface Card
    (NIC)
  • Unreliable receiving NIC doesnt send acks or
    nacks to sending NIC
  • stream of datagrams passed to network layer can
    have gaps (missing datagrams)
  • gaps will be filled if app is using TCP
  • otherwise, app will see gaps
  • Ethernets MAC protocol CSMA/CD

29
Ethernet CSMA/CD algorithm
  • 1. 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 signal
  • 5. After aborting, NIC enters exponential
    backoff after mth collision, NIC chooses K at
    random from 0,1,2,,2m-1. NIC waits K?512 bit
    times, returns to Step 2

30
Randomization and Binary Exponential Backoff
  • After 1st collision, station picks 0 or 1 at
    random, waits that number of slots and tries
    again
  • After 2nd collision, station picks 0,1,2,3 at
    random, waits that number of slots and tries
    again
  • .
  • After i-th collision, station picks 0,1,,2i-1 at
    random,
  • If 10 lt i lt 16, station picks 0,1,,210-1 at
    random
  • If i16, controller reports failure to computer

Why randomization is needed?
31
Exercise
  • An IP packet to be transmitted by Ethernet is 60
    bytes long. Is padding needed in the Ethernet
    frame, and if so, how many bytes?

32
Exercise
  • Consider building a CSMA/CD network running at 1
    Gbps over a 1-km cable. The signal speed in the
    cable is 200,000 km/sec. What is the minimum
    frame size?
About PowerShow.com