Data Encoding and Transmission
Data Encoding and Transmission
Data Encoding and Transmission
1
Agenda
1 Session Overview
2
What is the class about?
Textbooks:
» Computer Networking: A Top-Down Approach (6th Edition)
James F. Kurose, Keith W. Ross
Addison Wesley
ISBN-10: 0132856204, ISBN-13: 978-0132856201, 6th Edition (02/24/12)
3
Course Overview
4
Course Approach
6
Icons / Metaphors
Information
Common Realization
Knowledge/Competency Pattern
Governance
Alignment
Solution Approach
77
Agenda
1 Session Overview
8
Data Encoding and Transmission - Roadmap
9
Simplified Data Communications Model
10
S(t) = A sin(2ft + Φ)
11
Terminology (1/3)
Transmitter
Receiver
Medium
Guided medium
E.g., twisted pair, optical fiber
Unguided medium
E.g., air, water, vacuum
12
Terminology (2/3)
Direct link
No intermediate devices
Point-to-point
Direct link
Only 2 devices share link
Multi-point
More than two devices share the link
13
Terminology (3/3)
Simplex
One direction
e.g., television
Half duplex
Either direction, but only one way at a time
e.g. police radio
Flux duplex
Both directions at the same time
e.g., telephone
14
Analog and Digital Data Transmission
Data
Entities that convey meaning
Signals
Electric or electromagnetic representations of
data
Transmission
Communication of data by propagation and
processing of signals
15
Data
Analog
Continuous values within some interval
e.g., sound, video
Digital
Discrete values
e.g., text, integers
16
Signals
Digital
Use two DC components
17
Data and Signals
18
Analog Transmission
19
Digital Transmission
20
Advantages/Disadvantages of Digital
Cheaper
Less susceptible to noise
Greater attenuation
Pulses become rounded and smaller
Leads to loss of information
21
Attenuation of Digital Signals
22
Interpreting Signals
Need to know
Timing of bits - when they start and end
Signal levels
26
NRZ
27
Differential Encoding
28
Summary of Encodings
29
NRZs Pros and Cons
Pros
Easy to engineer
Make good use of bandwidth
Cons
DC component
Lack of synchronization capability
Manchester
Transition in middle of each bit period
Transition serves as clock and data
Low to high represents one
High to low represents zero
Used by IEEE 802.3
Differential Manchester
Mid-bit transition is clocking only
Transition at start of a bit period represents zero
No transition at start of a bit period represents one
Note: this is a differential encoding scheme
Used by IEEE 802.5
31
Biphase Pros and Cons
Con
At least one transition per bit time and possibly two
Maximum modulation rate is twice NRZ
Requires more bandwidth
Pros
Synchronization on mid bit transition (self clocking)
No dc component
Error detection
Absence of expected transition
32
Asynchronous/Synchronous Transmission
33
Asynchronous
34
Asynchronous (Diagram)
35
Asynchronous - Behavior
36
Synchronous – Bit Level
37
Synchronous – Block Level
39
Data Encoding and Transmission - Roadmap
40
Common Issues in Design
41
Data from Two Sources
42
Data from Two Sources
43
Ring Buffer of Size N
0 Inititial State
1 Input: 0
2
Output: 0
.
.
.
N-1
44
Ring Buffer of Size N
0 Element 0
New Element
1 Arrives
2 Input: 1
. Output: 0
.
.
N-1
45
Ring Buffer of Size N
0 Element 0
New Element
1 Element 1 Arrives
2 Input: 2
. Output: 0
.
.
N-1
46
Ring Buffer of Size N
Read next
0 Element 0 (element 0)
1 Element 1 Input: 2
2 Output: 1
.
.
Read next
. (element 1)
Input: 2
Output: 2
N-1
47
Ring Buffer of Size N
After Nth
0 Element 0 input:
1 Element 1 Input: 0
2 Element 2 Output: 2
.
.
How many more
. input elements can we
accept?
48
Ring Buffer Spec (1/3)
Let B be a buffer.
Let S be the size of the buffer B in bytes.
Let I be an index into the buffer where the producer will store
the next new byte of data.
Let O be the index of the next byte that the consumer should
remove from the buffer.
Let N be the number of unconsumed bytes in the buffer.
Define % as the modulus operator.
Initially, I = O = N = 0.
The buffer is full (has no room for new data) when N == S.
The available space (for new data) A = S - N
49
Ring Buffer Spec (2/3)
int j = I;
I = (I+m)%S
N += m;
50
Ring Buffer Spec (3/3)
int j = O;
O = (O+r)%S
N -= r
51
Ring Buffer: Making it Safe
So, you see that the idea is that the input (I) and output
(O) pointers change continuously from the beginning of
the buffer to the end and then wrap around back to the
beginning again. Conceptually, it appears as if the end of
the buffer is connected back the front of the buffer as if to
form a ring (or circle). We enforce that the input pointer
never tries to overtake the output pointer!
52
Ring Buffer Characteristics
Finite
Fixed space must be allocated a priori
Low overhead
No “per element” costs like we have in a Queue
53
Queue
Payload
55
Queue (Doubly Linked)
tail z
Payload
56
Queue Operations
Required Operations
Put (add to tail)
Get (get from head)
Deluxe Operations
Peek (non-destructive Get)
Put to head
Get from tail
Iterate (head to tail or tail to head)
57
Queue Characteristics
58
Queue or Ring Buffer
59
What is a FSM?
Mealy machine
one that generates an output for each transition
Moore machine
one that generates an output for each state
63
From State Diagram to FSM
Identify
States
Events
Transitions
Actions (outputs)
1 Session Overview
2 Application Layer
65
Assignments & Readings
Readings
» Chapters 1 and 5
Assignment #3
66
Next Session: Data Link Control
67