2. OUTLINE
Let’s get down to the Physical Layer
Terminologies
Sampling
Quantization
Encoding
Modulation
Data Link Layer (Part I)
Line Discipline
Flow Control
Error Control
2
9. ANALOG TO DIGITAL
9
Formatting and transmission of baseband signals
From: Digital Communicatoins Fundamental and Applications by Bernard Sklar
10. TEXT TO BINARY
10
ASCII Code: Seven-bit American standard code for information interchange
From: Digital Communicatoins Fundamental and Applications by Bernard Sklar
11. “THINK” IN A BINARY FORM
11
ข้อความ
bit
Symbol
Waveform
12. SAMPLING & QUANTIZING
12
Amplitude and time coordinates of source data. (a) Original
analog waveform. (b) Natural-sampled data. (c) Quantized samples. (d)
Sample and hold.
15. SAMPLING THEOREM: EXAMPLE
Audio (MP3)
32 kbps – AM Quality
96 kbps – FM Quality
128 kbps – Standard Quality
224 – 320 kbps – Near CD quality
Audio ประเภทอื่นๆ
800 bps – Recognizable speech
8 kbps – Telephone quality
Video
16 kbps – videophone quality (สาหรับผู้ใช้ทั่วไป)
128 – 384 kbps – vdo conferencing (เชิงธุรกิจ)
1.25 Mbps – VCD quality
5 Mbps – DVD quality
8 – 15 Mbps – HDTV quality
29.4 Mbps – HD DVD
40 Mbps – Blu-ray Disc 15
16. NYQUIST THEOREM
Nyquist Theorem: “an analog signal that has been sampled can be
perfectly reconstructed from the samples if the sampling rate exceeds 2B
samples per second, where B is the highest frequency in the original signal.”
16
แล้วต้องสุ่ม
ถี่แค่ไหน
“สัญญาณอนาลอกใดก็ตาม ที่มีคลื่นความถี่สูงสุด B Hz เมื่อทาการสุ่มที่
อัตราที่มากกว่า 2B/s จะสามารถกู้สัญญาณกลับมาในสภาพเดิมได้อย่าง
สมบูรณ์”
20. NON-RETURN TO ZERO (NRZ)
1 high signal; 0 low signal
Or
1 low signal; 0 high signal
20
0 0 1 0 1 0 1 1 0
NRZ
(non-return to zero)
Clock
• ข้อเสีย: เมื่อมี 1 หรือ 0 ติดต่อกันนานๆ จะทาให้เกิด clock skew ได้เพราะการส่งข้อมูลที่มีลักษณะนี้จะทาให้สัญญาแช่อยู่ที่
0 หรือ 1 เป็นเวลานาน ทาให้ตัวรับสัญญาณหรืออุปกรณ์ต่างๆที่ต้องทางานโดยใช้clock signal ไม่สามารถ synchronize
clock signal ได้
21. NON-RETURN TO ZERO INVERTED (NRZI)
1 make transition; 0 stay at the same level
วิธีนี้สามารถแก้ปัญหาข้อมูล bit 1 ติดต่อกันนานๆได้ แต่ไม่สามารถแก้ปัญหาข้อมูล bit 0
ติดต่อกันได้
21
0 0 1 0 1 0 1 1 0
Clock
NRZI
(non-return to zero
inverted)
22. MANCHESTER
1 high-to-low transition; 0 low-to-high transition
or
1 low-to-high transition; 0 high-to-low transition
แก้ปัญหา clock skew ได้
ข้อเสีย: signal transition rate doubled
i.e.usefuldata rate on the same physicalmedium is halved
Efficiencyof 50%
22
0 0 1 0 1 0 1 1 0
Clock
Manchester
27. 27
DATA LINK CONTROL PROTOCOLS
Data Link Control Protocols
Line
Discipline
Flow
Control
Error
Control
ใครส่ง? ส่งข้อมูลได้เท่าไหร่ จะแก้ปัญหาความ
ผิดพลาดในการส่ง
อย่างไร
28. 28
DATA LINK CONTROL PROTOCOLS
Line Discipline
Poll/SelectENQ/ACK
•In half-duplex transmissions, it is essential that only one device transmit at
a time.
•If both ends of the link put signals on the line simultaneously, they collide,
leaving nothing on the line but noise.
•The coordination of half-duplex transmission is part of a procedure called
line discipline.
29. ENQ/ACK
ENQ/ACK coordinates which device may start a transmission and whether or not
the intended recipient is ready and enabled.
Using ENQ/ACK, a session can be initiated by either station on a link as long as both
are of equal rank.
In both half-duplex and full-duplex transmission, the initiating device establishes the
session.
In half duplex, the initiator sends its data while the responder waits. The responder
may take over the link when the initiator is finished or has requested a response.
In full duplex, both devices can transmit simultaneously once the session has been
established.
29
31. POLL/SELECT
The poll/select method of line discipline works with
topologies where one device is designated as a primary
station and the other devices are secondary stations.
Multipoint systems must coordinate several nodes, not just
two.
The question to be determined in these cases, therefore, is
more than just, are you ready? It is also, which of the
several nodes has the right to use the channel?
32. POLL/SELECT : HOW DOES IT WORK?
Whenever multipoint link consists of a primary device and
multiple secondary devices using a single transmission
line, all exchanges must be made through primary device.
The primary device controls the link; the secondary device
follow its instructions.
It is up to the primary to determine which device is allowed
to use the channel at a given time
The primary, therefore is always the initiator of a session.
If the primary wants to receive data and send data. It
apply function called poll and select respectively.
33. ADDRESSING IN POLL/SELECT
For point-to-point configurations, there is no
need for addressing; any transmission put onto
the link by one device can be intended only for
the other.
For the primary device in a multipoint topology
to be able to identify and communicate with a
specific secondary device, however, there must be
an addressing convention.
For this reason, every device on a link has an
address that can be used for identification.
34. POLL
The polling function is used by the primary device to solicit
transmission from the secondary devices.
As noted, the secondaries are not allowed to transmit data
unless asked (don’t call us-we’ll call you).
By keeping all control with the primary, the multipoint
system guarantees that only one transmission can occur at
a time, thereby ensuring against signal collision.
When the primary is ready to receive data, it must ask
(poll) each device in turn if it has anything to send.
When the first secondary is approached, it responds either
with a NAK frame if it has nothing to send or with data (in
the form of a data frame) if it does.
35. POLL (CONT)
There are two possibilities for terminating
the exchange: either the secondary sends
all its data, finishing with an EOT frame
Or the primary says, “time’s up” which of
these occurs depends on the protocol and
the length of the message.
Once a secondary has finished
transmitting, the primary can poll the
remaining devices
37. SELECT
The select mode is used whenever the primary device has
something to send.
But first, it must ensure that the target device is prepared
to receive.
So the primary must alert the secondary to the upcoming
transmission and wait for an acknowledgment of the
secondary’s ready status.
Before sending data, the primary creates and transmits a
select (SEL) frame, one field of which includes the address
of the intended secondary.
If the secondary is awake and running, it returns an ACK
frame to the primary. The primary then sends one or more
data frames each addressed to the intended secondary.
39. 39
DATA LINK CONTROL PROTOCOLS
Data Link Control Protocols
Line
Discipline
Flow
Control
Error
Control
Who should
Send now?
How much data
Can be sent?
How can error
be corrected?
40. 40
FLOW CONTROL/ STOP & WAIT
Flow Control
Sliding WindowStop-and-Wait
Send 1 frame
at a time
Send several
frames at a time
41. 41
STOP-AND-WAIT FLOW CONTROL
Procedure
1. Source transmits frame
2. Destination receives frame and replies
with acknowledgement (ACK)
3. Source waits for ACK before sending the
next frame
4. Destination can stop flow by not send ACK
Works well for a few large frames
Stop and wait becomes inadequate if
large block of data is split into small
frames
44. WHAT’S WRONG WITH STOP & WAIT?
a<1 : the propagation time is less than
the transmission time
The frame is sufficiently long that the first bits of the
frame have arrived at the destination before the source
has completed the transmission of the frame.
The line is inefficiently utilized.
a > 1: the propagation time is greater
than the transmission time.
In this case, the sender completes transmission of the
entire frame before the leading bits of that frame arrive
at the receiver.
The line is always underutilized.
For very high data rates and very long distances between sender /receiv
stop-and-wait flow control provides inefficient line utilization.
45. 45
FLOW CONTROL/ SLIDING WINDOW
Flow Control
Sliding WindowStop-and-Wait
Send 1 frame
at a time
Send several
frames at a time
46. SLIDING-WINDOWS FLOW CONTROL
Allows multiple frames to be in transit
Receiver has buffer for W frames
Transmitter sends up to W frames once without
ACK from receiver
ACK includes sequence number of next frame
expected
Sequence number is bounded by size of field (k)
frames are numbered modulo 2k
giving max window size of up to 2k - 1 46
47. SLIDING-WINDOWS FLOW CONTROL
Receiver can ACK frames without permitting
further transmission (Receive Not Ready)
Allow a station to cut off the flow of frames from
the other side by sending a Receive Not Ready
(RNR) message, which acknowledges former
frames but forbids transfer of future frames.
Must send a normal acknowledgment to resume
data transmission
Can use Piggyback ACKs in Full Duplex Links
Send data and ACK together in 1 frame
If a station has only ACK to send (No data) : Send a
separate ACK frame (RR/RNR)
If a station has only data to send (No new ACK) :
Send a repeat (as previous) ACK frame 47
50. 50
DATA LINK CONTROL PROTOCOLS
Data Link Control Protocols
Line
Discipline
Flow
Control
Error
Control
Who should
Send now?
How much data
Can be sent?
How can error
be corrected?
55. Transmitter
CYCLIC REDUNDANCY CHECK (CRC)
Data
K bits
FCSData
n-k bits
(Can be divided by predetermined number)
n bits
FCSData
Divided by the same number
If no remainder assume no error
Receiver
T(x) = x n-k D(x) + R(x)
T(x) = Transmitted frame (n bits)
D(x) = Message or Block of Data (the first k bits of T)
R(x) =FCS (the last n-k bits of T)
56. P = the predetermined divisor (n-k+1 bits)
Q = Quotient
R = Remainder
Note: Pattern of P depends on the types of errors
expected, but at least the highest & the lowest order of
P must be “1”
Express all values as polynomials in a dummy variable X, with
binary coefficients. The coefficients correspond to the bits in
the binary number
Example:
Using the preceding example, where
D = 1010001101 ; D(x) = x9 + x7 + x3 + x2 + 1
P = 110101 ; P(x) = x5 + x4 + x2 + 1
POLYNOMIAL MODULO 2 ARITHMETIC
D= Q + R
P P
58. WIDELY USED POLYNOMIALS
CRC-12 = x12 + x11 + x3 + x2 + x + 1
CRC-12 (12-bits FCS) : for streams of 6-bits characters
CRC-16 = x16 + x15 + x2 + 1
CRC-16 (16-bits FCS) : for 8-bits characters, used in North
America
CRC-CCITT = x16 + x12 + x5 + 1
CRC-CCITT (16-bits FCS) : for 8-bits characters, used in
Europe
CRC-32 = x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8
+ x7 + x5 + x4 + x2 + x + 1
CRC-32 (32-bits FCS) : for some point-to-point synchronous
transmission and IEEE 802 LAN Standards
58
59. ERROR CONTROL
Detection and correction of errors such as:
Lost frames
Damaged frames
Common techniques use:
Error detection : CRC
Positive acknowledgment
Retransmission after timeout
Negative acknowledgement & retransmission
59
60. 60
AUTOMATIC REPEAT REQUEST (ARQ)
Collective name for such error control
mechanisms, including:
Stop-and-Wait
Go-back-N
Selective-Reject (selective retransmission)
61. STOP-AND-WAIT ARQ
Based on Stop-and-Wait Flow Control
Source transmits single frame & wait for ACK
If received frame damaged, discard it
Transmitter has timeout
If no ACK within timeout, retransmit
If ACK is damaged, transmitter will not
recognize it
Transmitter will retransmit
Receive gets two copies of frame - Discard
Use alternate numbering and ACK0 / ACK1
61
63. GO-BACK-N ARQ
Based on Sliding-Window Flow Control
If no error, ACK as usual
Use window to control number of outstanding
frames
If error, reply with rejection
Discard that frame and all future frames until error
frame received correctly
Transmitter must go back and retransmit that frame
and all subsequent frames 63
64. GO-BACK-N – HANDLING ERROR
Damaged Frame
Error in frame i so receiver rejects frame i
Transmitter retransmits frames from i
Lost Frame
Frame i lost and either
Transmitter sends i+1 and receiver gets frame i+1
out of sequence and rejects frame i
Or transmitter times out and send ACK with P-bit
set which receiver responds to with ACK i
Transmitter then retransmits frames from
i
64
65. GO-BACK-N - HANDLING
Damaged Acknowledgement
Receiver gets frame i, sends ACK (i+1)
which is lost
ACKs are cumulative, so next ACK (i+n)
may arrive before transmitter times out on
frame i
If transmitter times out, it sends ACK with
P-bit set
Can be repeated a number of times before
a reset procedure is initiated
Damaged Rejection
Reject for damaged frame is lost
Handled as for lost frame when
transmitter times out 65
66. SELECTIVE-REJECT ARQ
Also called Selective-Retransmission
Only rejected frames are retransmitted
Subsequent frames are accepted by the
receiver and buffered
Minimizes retransmission
Receiver must maintain large enough
buffer
More complex logic in transmitter
Hence less widely used
Useful for satellite links with long
propagation delays
66