CSIS 6251 CSIS 625 Week 4 Statistical TDM, Traffic Engineering, Error Detection & Correction Data...
-
date post
21-Dec-2015 -
Category
Documents
-
view
217 -
download
4
Transcript of CSIS 6251 CSIS 625 Week 4 Statistical TDM, Traffic Engineering, Error Detection & Correction Data...
CSIS 625 1
CSIS 625 Week 4
Statistical TDM, Traffic Engineering,
Error Detection & Correction
Data Link LayerCopyright 2001 - Dan Oelke
For use by students of CSIS 625 for purposes of this class only.
CSIS 625 2
Overview
• Statistical TDM
• Traffic Engineering
• Error Detection
• Error Correction
• Data Link Layer– Line Discipline– Flow Control– Error Control
CSIS 625 3
Statistical Time Division Multiplexing
• With Synchronous TDM, if an input has nothing to send, that timeslot is wasted.
• With Statistical TDM you are betting that at any given time only some of the inputs want to send data
• The sum of the input bit rates to the MUX may exceed the output bit rate of the MUX
• If you are “unlucky” some data may be delayed or discarded by the MUX
CSIS 625 4
Statistical TDM
• Delaying data because others are using the line requires additional buffers at the MUX
• A burst of high speed data at the DEMUX may require the DEMUX to buffer data until the lower speed output can accept it
• Timeslots can be borrowed
• Some inputs can have priority over others
• Some systems have variable length timeslots
CSIS 625 5
Statistical TDM
• Additional framing overhead required– Just knowing the timeslots is not enough– Each packet of data in a statistical TDM system
must have overhead labeling its source or destination
– It is best to have relatively large timeslots to minimize overhead relative to data carried
• Almost all data systems today use statistical TDM at some point.
CSIS 625 6
Traffic Engineering
• In telephony networks, not all phones are in use at the same time, so trunks between central offices are over-subscribed– This is a form of statistical TDM
• Agner Krarup Erlang (1878-1929)– developed equations on how the blocking
probability relates to the amount of traffic and number of lines.
CSIS 625 7
Traffic Engineering Definitions
• Trunk - a communication line between two switching systems
• Poisson Distribution - A mathematical formula that defines the probability of x events occurring in a certain time
• Busy Hour - The one hour during the day or year that has the most traffic
• CCS - Centum Call Seconds - amount of traffic offered on a line.– 60 * 60 = 3600 seconds or 36 CCS
CSIS 625 8
Traffic Engineering
• Amount of traffic offered can be calculated from the average number of calls and average length.– For example: 2 calls / hour * 3 minutes / call =
2 * 180 = 360 call seconds = 3.6 CCS– If one phone offers 3.6CCS, then 100 phones
offer 360 CCS
• Often Erlangs are used in describe the amount of traffic offered.– 36 CCS = 1 Erlang
CSIS 625 9
Different Traffic Engineering models
• Poisson distribution - simplest – Assumes that blocked calls are held.– Infinite number of sources
• Erlang B – Assumes that blocked calls never return
• Used originally for blocked calls that went to higher cost lines.
– Infinite number of sources
• Extended Erlang B– Has a retry probability
CSIS 625 10
Different Traffic Engineering models
• Erlang C– Assumes that blocked calls are delayed– Infinite number of sources– Used for Call Center applications
• “Trunks” are service people
• There are models for Finite number of sources, but they are used much less often.– Even if they should be used - people don’t
• Equations given are nice, but either look up tables, or calculators are really used.
CSIS 625 11
Poisson Distribution
• Poisson assumes that blocked calls wait forever.– This will tend to over estimate the number of
trunks needed– Equation for Poisson
• N = Number of events to occur in a unit time (Number of trunks)
• A = Average number of events occuring per unit time (Traffic in Erlangs)
CSIS 625 12
Erlang B
• Erlang B assumes that blocked calls never retry– This will tend to under estimate the number of
trunks needed– Equation for Erlang B
• N = Number of trunks
• A = Traffic offered in Erlangs
CSIS 625 13
Traffic Engineering example problem
– Given • 100 homes, with average 1.5 phones / home
• First line of a home has 3.5CCS
• Second line of a home has 30CCS
• 50% of blocked calls retry immediately
– Calculate number of trunks to serve these homes with a blocking probability of 0.02
• 100 * 3.6 CCS = 360CCS
• 50 * 30 CCS = 1500CCS
• 360 CCS + 1500 CCS = 51.67 Erlangs
• From Extended Erlang B calculator - 63 trunks
CSIS 625 14
Traffic Engineering Web pages
– http://www.erlang.com/calculator/– http://www.iinet.net.au/~clark
CSIS 625 15
Error Detection
• Errors always occur during transmission
• Bit Error - an error that changes only one bit
• Burst Error - an error that changes several adjacent bits.
• Coding Violations - When the line coding mechanism tells us of an error. – Need to use something like Bipolar-AMI,
8b10b, etc.
CSIS 625 16
Error Detection - Parity Bits
• Parity Bit - an extra bit of data sent with every data packet.
• Even Parity - The extra bit is set so that the number of bits is always even
• Odd Parity - The extra bit is set so that the number of bits is always odd
• Receiver checks parity and discards data if parity is not valid
• Regular parity is also known as Vertical Redundancy Check
• Parity is sometimes mis-used as any redundant bit
CSIS 625 17
Error Detection - BIP
• BIP-8 - Bit Interleaved Parity - 8 bits– BIP is also known as Longitudinal Redundancy
Check– Takes bytes and calculates a parity bit for each
bit position– Diagram of BIP:– Provides better
1 1 1 1Byte 1: 0 0 0 0
1 1 1 1Byte 2: 1 1 1 1
0 0 0 0Byte 3: 0 0 0 0
1 1 0 0Byte 4: 1 0 0 1
0 0 1 1Byte 5: 0 0 1 1
1 1 1 1BIP-8: 0 1 0 1
protection against burst errors
CSIS 625 18
Error Detection - Checksum
• Checksum - a byte added to the end of the frame to catch errors
• Simplest form is calculated by adding up all the bytes in the frame
• There are several algorithms - so check specifics on any one algorithm
• BIP-8 is sometimes called a checksum
CSIS 625 19
Error Detection - CRC
• CRC - Cyclic Redundancy Check
• Catches many errors that Parity or BIP-8 will miss.
• Adds bits to the end of a frame so that it can be evenly divided by a number
• Usually 8, 16, or 32-bit CRC
• Easy to implement in hardware with shift register and feedback xor’s.
• See book for examples
CSIS 625 20
CRC - Strength
• All bursts of errors r (r = length of CRC)
• All odd number of errors
• Probability of missing error – if burst is r+1 => 0.5r-1 (0.532-1 = 4.6E-10)– if burst is r+1 => 0.5r (0.532 = 2.3E-10)
• CRC’s are considered quite strong
• See also:– http://www.ross.net/crc/
CSIS 625 21
Error Rates - BER
• BER - Bit Error Rate - the probability of a bit being changed– Used to describe transmission lines– All transmission lines have some non-zero BER– Calculate by counting the number of errors and
dividing by the number of bits• Need to adjust for errors that occur but are not
detected
• For example - an odd number of errors when using parity
CSIS 625 22
Error Rates - BER
• Normal practice is to measure 10 times the period to report a BER– This means that to state the line has a 1E-10
error rate (or better) you must measure 1E+11 bits
– A T1 would require 18 hours to have 1E+11 bits go through.
• Voice sounds ok at BER of 1E-5– Still intelligible at 1E-3
• Data doesn’t work very well below 1E-7
CSIS 625 23
FEC - Forward Error Correction
• Sometimes it is advantageous to correct an error instead of just detecting it.
• Brute force is to send data repeatedly– To correct n errors, send data 2n+1 times– Not very efficient - there are better ways.
• Hamming codes or Reed-Solomon codes do it much more efficiently
CSIS 625 24
Hamming Distance
• Hamming distance - the number of bits that have to be changed to go from one valid code to another.– To detect d errors -Hamming distance of d+1
• parity gives a Hamming distance of 2, so it detects up to one bit error
– To correct d errors - Hamming distance of 2d+1• Need to be able to distinguish “closest” valid code
CSIS 625 25
Hamming Code
• Hamming Code - an error correcting code to correct 1 bit error– For 4 data bits, 3 redundancy bits needed– For 8 data bits, 5 redundancy bits needed
• Rule for Hamming Codes:– (m + r + 1) 2r
• m = message bits
• r = redundant bits
• To handle burst errors, multiple codes can be interleaved.
CSIS 625 26
Reed-Solomon codes
• Another error correcting code
• Designed to have redundant symbols
• Allows for whole symbols to be errored – It handles bursts of errors
• Common applications– CD Players, – Spacecraft communication– DSL lines
CSIS 625 27
Reed Solomon Codes
• Notation - RS(NN,KK)• MM - the code symbol size in bits
• NN - the block size in symbols (2**MM - 1)
• KK - the number of data symbols per block– KK < NN
• Can correct (NN-KK)/2 errors per block
• If known that there are missing symbols, then RS can correct NN-KK “erasures”
CSIS 625 28
Common Reed Solomon Codes
• RS (255,223) – Sends 255 8 bit characters, 223 of them are data
and 32 are parity– Can correct 16 errors or 32 erasures
• RS(204,188) - Used in Digital Video– Sends 204 8 bit characters, 188 of them are data
and 16 are parity– Can correct 8 symbol errors
• Can be done on other than 8-bit characters
CSIS 625 29
More on FEC
• FEC is often used to improve the BER of lines.– Can be more cost effective than boosting the
power sent over the line– Retransmission at higher levels may not be
practical
• Error Correcting web pages• http://www.piclist.com/techref/method/errors.htm
• http://people.qualcomm.com/karn/code/fec/
• http://www.engelschall.com/u/sb/hamming/
CSIS 625 30
Line Discipline
• Line Discipline defines who can send and when they can send.
• Simplex system– Who is always known– When is usually any time
• In a duplex system, the sender should send only when it knows that the receiver is ready.– This is in theory, but in practice it only
sometimes works this way
CSIS 625 31
Line Discipline
• Three phases of communication– Establishment of communication
• Determines who is sending to whom
– Data transfer• Moving the data
– Termination• Tying up loose ends
CSIS 625 32
ENQ/ACK system
• Process• Sender sends a ENQ (Enquiry) to the intended
receiver.
• Receiver sends back an ACK (Acknowledgement) when it is ready to receive
• Sender sends data
• Sender sends EOT (End of Transmission) when done sending.
• Receiver may send a NAK (Negative Acknowledgement) if it isn’t ready.
• Used in point to point systems
CSIS 625 33
ENQ/ACK system
• Common to have one node a primary and another a secondary– Primary is responsible for initiating
communication
• Some systems have nodes as peers– Either can initiate a transfer
• In full-duplex system, data and control messages can be sent simultaneously
CSIS 625 34
Poll & Select system
• Always has a primary and secondary nodes
• Process - Poll– Primary node requests data from the secondary– If no data, secondary responds with a NAK– Otherwise secondary responds with the data
• Process - Select– Primary node selects a secondary node and
sends data to it– Secondary responds with ACK after successful
transfer of data
CSIS 625 35
Network Addresses
– In a multi-point system, addresses needed so that nodes know who is talking to who
– Simple in some systems where physical position or dip-switch sets it.
– Ethernet defines that all manufactures of devices include a unique 48-bit (6-byte) address in every device.
– Polling 2^48 devices isn’t practical• at 10Mbps, with a 60 byte poll it would take
– 2^24 / 10Mbps * 60 * 8 bytes = 1.35E+10 seconds
– or about 428 years
CSIS 625 36
Media Access Control
• MAC - Media access Control
• A multipoint network with no clear master and slave. – master == primary– slave == secondary
• In this system, there needs to be more complicated protocol than ENQ/ACK or select/poll to figure out who sends when
• Next week’s lecture…..
CSIS 625 37
Flow Control
• Flow control - a protocol to ensure that the sender does not overwhelm a receiving station
• Incoming data must be checked and processed before it can be used– This is often slower than the transmission rate– Receivers need to buffer received data until it is
processed– Buffers are always limited
CSIS 625 38
Flow Control - Stop-n-Wait
• Stop and Wait flow control is simplest form of flow control
• Process– Sender sends one frame of data– Sender waits for ACK before sending more – Receiver can slow down process by waiting to
send ACK
• May be simple - but it is inefficient
CSIS 625 39
Stop-n-Wait efficiency
– Entire set of data is divided into n frames
– tprop = time to go from sender to receiver • depends on distance and medium
– tframe = time to send one data frame• depends on bit rate
– TD = n(2 tprop + tframe) = Time to send data
– Actual transmission of data is n* tframe
– Efficiency is (n* tframe )/ n(2 tprop + tframe)
– = 1 / (1 +2(tprop / tframe))
– If tprop is small and tframefor frame is large, it approaches 100%, but never reaches it.
CSIS 625 40
Sliding Window Protocol
• Sliding Window flow control allows for more than one frame to be sent before an acknowledgement is received
• frames are numbered from 0 to n-1• Sender sends frames up until it has sent n-1
frames• Receiver sends back an ACK with the number
of the next frame it expects• Sender can now send up to this new number • Maximum window size is n-1 frames
CSIS 625 41
Figure 10-14
WCB/McGraw-Hill The McGraw-Hill Companies, Inc., 1998
Sliding Window Example
CSIS 625 42
Sliding Window Efficiency
• If the sliding window is big enough, and the receiver is fast enough, then 100% efficiency can be achieved
• To get 100% - – tprop ((n - 1) * tframe )
CSIS 625 43
Error Control
• Error detection and retransmission
• Error detection is detection is achieved using parity, checksums, CRC, etc– Extra data added to each frame
• ARQ - Automatic Repeat Request– This abbreviation isn’t really used much
CSIS 625 44
Stop-n-Wait Error Control
• Extension of Stop-n-Wait flow control– When a good frame is received, an ACK sent
back to originator.– When a damaged frame is received, a NAK is
sent back to originator– When a NAK is received, the same frame is
retransmitted
CSIS 625 45
Stop-n-Wait Error Control
• Any frame may be dropped - data or NAK or ACK.– If ACK isn’t received after some time, a NAK
is assumed– If a NAK is lost - timeout and retransmission – If a ACK is lost timeout and retransmission
• Frames must be numbered so receiver can throw away duplicates
– If data is lost - timeout and retransmission
• Has same efficiency issues
CSIS 625 46
Go-back-N Error Control
• Uses a Sliding window
• If a NAK is received or an ACK timeout occurs– all data since last ACK received is resent– This may be several frames
• ACKs contain next expected frame number
• NAKs contain errored frame number
CSIS 625 47
Selective-Reject Error Control
• Uses a Sliding window– If a NAK is received, only the damaged frame is
resent
• Selective Reject is more complicated to implement – Receiver must contain the sorting logic to enable it to reorder frames
– Sending device must contain searching mechanism to enable it to find and select only the requested frame for retransmission
– Buffer in the receiver must keep all previously received frames on hold until all retransmissions have been sorted, duplicates identified and discarded
– ACK numbers must refer to the frame received instead of next frame expected
CSIS 625 48
Selective-Reject Error Control
• More efficient as it resends less data – If errors don’t occur very often - there isn’t a
big difference in efficiency
• Selective Reject is rarely implemented over Go-back-N method