You are on page 1of 70

DATA COMMUNICATIONS AND

NETWORKING
ผศ.ดร.ณัฐกานต์ พุทธรักษ์
Lecture 3
ภาคการศึกษาที่ 1 ปี การศึกษา 2562

อังคาร: 8.45 – 12.00น. and 13.00 – 16.15น.


@E12-403

1
LAST CLASS

Physical layer:
 Fundamental of Signal Transmission
 Topology
 Transmission Mode
 Media Types
 Conversion Methods (Digital-to-Digital
Transmission)

2
TODAY’S OUTLINE
▪Conversion Methods (Cont’d)
▪Data Link Layer

3
Analog-To-Digital Conversion

 In Analog-To-Digital conversion, representing the


information contains in a continuous wave form as a
series of digital pulses (1’s or 0’s)

4
PULSE AMPLITUDE MODULATION (PAM)
This technique takes an analog signal, Samples it, and
generate a series of pulses based on the results of the
sampling.
Sampling: Measuring the amplitude of the signal at equal
intervals.

5
PULSE CODE MODULATION (PCM)
PCM modifies the pulses created by PAM to create a completely
digital signal.
PCM first quantizes the PAM
Quantization: A method of assigning integral values in a
specific range to sampled instances

Quantized PAM Signal 6


Quantizing Using Sign and Magnitude

PCM

7
PCM have 4 separate processes:
- PAM,
- Quantization,
- Binary encoding,
- Digital-to-digital encoding.

8
SAMPLING RATE
The sampling rate must be at least twice the highest
frequency of the original signal.
Nyquist Theorem

9
EXAMPLE
What sampling rate is needed for a signal with
a bandwidth of 10,000 Hz (1,000 to 11,000 Hz)?

10
HOW MANY BIT PER SAMPLE?
Example
A signal is sampled, each sample requires at least 12
levels of precision (+0 to +5 and -0 to -5).

How many bits should be sent for each sample?

11
BIT RATE
Bit Rate = Sampling rate * Number of bits per sample.

Example
We want to digitize the human voice. What is the bit
rate assuming eight bits per sample?

12
TRANSMISSION IMPAIRMENT

Attenuation means loss of energy. When a signal


travels through a medium, it loses some of its
energy so that it can overcome the resistance of
the medium. To compensate for this loss,
amplifiers are used to amplify the signal. The
decibel (dB) measures the relative strengths of
two signals or a signal at two different points.
dB = 10log10 (P2/P1)
where P1 and P2 are the power of a signal at
points 1 and 2 13
Limits of Transmission Media
Sources of noise include:
✓crosstalk: a signal on one line is picked up by adjacent
lines as a small noise signal
▪Near-End Crosstalk (NEXT) caused when a strong transmitter output
signal interferes with a much weaker incoming receiver signal.

✓impulse noise: caused by external activity or


equipment which generates electrical impulses on the line
which cause large signal distortion for their duration.
✓thermal noise (white noise): caused by the thermal
agitation of electrons associated with each atom in the
device or transmission line material. It consists of random
frequency components of continuously varying
amplitude. 14
Distortion
✓Signal Distortion involves the Shape of the signal
becoming altered as it propagates along the line.
▪One cause of distortion is the different attenuation rates for
different frequency components of the signal. => This can be
addressed using an equalizer

✓Delay distortion is caused by different frequency


components of the signal propagating at slightly
different speeds. => the frequency components of one
bit are delayed sufficiently they will overlap with the
component of the next bit resulting in Inter Symbol
Interference (ISI).
15
PERFORMANCE
Throughput: Is #bits that can pass a point of reference in
one second.
Propagation speed: Measures the distance a signal or a bit
can travel through a medium in one second. The
propagation speed of electromagnetic signals depends
on the medium and the frequency of the signal.
Propagation time: Measures the time required for a signal
(or a bit) to travel from one point of the transmission
medium to another. The propagation time is calculated by
dividing the distance by the propagation speed.
Propagation time = Distance / Propagation speed. 16
DIGITAL-TO-ANALOG CONVERSION
AMPLITUDE – SHIFT KEYING :ASK

◦ เป็ นการ Modulate เชิงเลขทางแอมปลิจดู


◦ ความถี่ของสัญญาณคลื่นพาห์จะคงที่
◦ เมื่อค่าสัญญาณ Digital เป็ น 1 Carrier Wave จะสูงขึ้นกว่า
ปกติ และเมื่อค่าบิตเป็ น 0 Carrier Wave จะตกลงกว่าปกติ
◦ แต่วิธีการนี้ จะไม่ค่อยได้รบั ความนิ ยม เนื่ องจากว่าถูกรบกวน
จาก สัญญาณอื่นได้ง่าย
FREQUENCY – SHIFT KEYING : FSK
◦ เป็ นการ Modulate เชิงเลขทางความถี่
◦ ขนาดของคลื่นพาห์ Carrier Wave จะไม่เปลี่ยน แต่ความถี่ของคลื่นจะเปลี่ยนแทน
◦ เมื่อบิตมีค่าเป็ น 1 ความถี่จะสูงกว่าปกติ และเมื่อบิตมีค่าเป็ น 0 ความถี่ของคลื่น
จะต ่ากว่าปกติ
PHASE – SHIFT KEYING : PSK
◦ เป็ นการ Modulate เชิงเลขทางเฟส
◦ ค่าของขนาดและความถี่ของคลื่นพาห์จะไม่มีการเปลี่ยนแปลง แต่
เฟสของสัญญาณจะเป็ นตัวเปลี่ยนแปลง
◦ เมื่อสภาวะของบิตเป็ น 0 หรือเป็ น 1 เฟสของคลื่นจะเปลีย่ น
(Shift) ไป 180 องศาด้วย
◦ วิธีนี้จะมีสญ
ั ญาณรบกวนเกิดขึ้นน้อยที่สุด ทาให้ได้สญ
ั ญาณที่มี
คุณภาพดีที่สุด แต่วา่ วงจรในการทางานจะซับซ้อนกว่า และ
ราคาอุปกรณ์แพงกว่าปกติดว้ ย
QUADRATURE PHASE SHIFT KEYING (QPSK)
ANALOG-TO-ANALOG CONVERSION
AMPLITUDE MODULATION (AM)
FREQUENCY MODULATION (FM)
PHASE MODULATION (PM)

VCO

d/dt

BPM = 2(1 + b )B

0
fc
Data Signal Encoding or Conversion Common Devices Common Systems
Technique

Analog Analog Amplitude modulation Radio tuner Telephone


Frequency modulation TV tuner AM and FM radio
Broadcast TV
Cable TV

Digital Digital NRZ-L Digital encoder Local area networks


NRZI Telephone systems
Manchester
Differential Manchester
Bipolar-AMI
4B/5B

Digital (Discrete) Amplitude shift keying Modem Dial-up Internet access


Analog Frequency shift keying DSL
Phase shift keying Cable modems
Digital Broadcast TV

Analog Digital Pulse code modulation Codec Telephone systems


Delta modulation Music systems

30
DATA LINK LAYER
Medium access protocol
Multi-access channels
Medium access control (MAC) to determine access from
competing parties
 Very important in LANs
 Timed Token Rotation Protocol
 Carrier Sense Multiple Access with Collision Detection (CSMA/CD)

Point-to-Point connection
DATA LINK LAYER FUNCTIONS
Line Discipline : It determines which device can send
and when it can send
Flow Control: coordinates the amount of data that can
be sent before receiving acknowledgment
Error Control: allows the receiver to inform the sender
of any frames lost or damaged in transmission

32
LINE DISCIPLINE
▪Line Discipline function is to oversee the
establishment of links and the right of a
particular device to transmit at a given time.
▪Determine who should send now

33
ENQUIRY/ACKNOWLEDGMENT (ENQ/ACK)
▪Used when there is a dedicated link between
two devices (peer-to-peer communication)
▪Coordinates which device may start a
transmission
▪Determine whether or not the intended recipient
is ready to accept the transmission

34
HOW ENQ/ACK WORKS?
The initiator transmit a frame called enquiry
(ENQ) asking if the receiver is available to
receive the data
The receiver must answer either:
- acknowledgement (ACK) frame if it is ready
OR
- negative acknowledgement (NAK) frame if
it is not ready
35
▪If neither ACK nor a NAK is received within a
specified time limit, then the initiator assumes that
the ENQ frame was lost and will sends a
replacement
▪If the initiator made 3 attempts and no response,
then it disconnects and will try later again

 If the response is positive, then the initiator is free


to send its data
 At the end of the transmission the sending system
will send an End Of Transmission (EOT) frame to
36
indicates that all data has been sent
ENQ/ACK

37
POLL/SELECT

▪Used when there is a device is designated


as a primary station and other devices
are secondary stations (Multi-point
System)
▪It has to determine which node has the
right to use the channel

38
HOW POLL/SELECT WORK
▪All transmission must be made through the
primary device
▪The primary device control the link
▪The secondary devices follow the primary
instructions
▪The primary device determine which device is
allowed to use the channel at a given time

39
Multipoint Discipline

 If the primary wants to receive data, it asks the


secondaries if they have anything to send (polling)
 If the primary wants to send data, it tells the target
secondary to get ready to receive (Selecting)

40
▪Each device on the link has an address that
can be used for identification
▪In any transmission the address will appear in
a specified portion of each frame called the
address field
▪If the transmission comes from the primary, the
address indicates the recipient of the data
▪If the transmission comes from the secondary,
the address indicates the originator of the
data

41
POLL
▪When the primary is ready to receive data, it must ask
(POLL) each device in turn if it has anything to send
▪If the response is (NAK) frame, this means no data to
send.
▪The primary (POLL) the next secondary and so on
 When the response is positive (data frame) the primary
reads the frame and send (ACK) frame
 The secondary sends all its data, and finished with
(EOT) frame
 The primary can stop receiving says “Time’s up” 42
Poll

Poll
ACK
Data

43
SELECT
▪Select mode is used when the primary device has
something to send
▪The primary transmit a select (SEL) frame, one field of
which indicates the address of the intended secondary
▪In multipoint systems, A single link is used for all devices
▪All secondaries check the address field, and only the
intended secondary open the frame and read the data

 If the secondary is awake and running, it returns an


ACK frame to the primary, so the primary can sends
more data frames. 44
Select

45
FLOW CONTROL

▪A set of procedures used to restrict the


amount of data the sender can send before
waiting for acknowledgment
▪Each receiving device has a block of memory
called buffer, reserved for storing incoming
data until they are processed

46
METHODS OF FLOW CONTROL
▪X-ON and X-OFF

▪Stop-and-wait : Send one frame at a time

▪Sliding window: send several frames at a


time

47
X-ON and X-OFF

48
STOP-AND-WAIT

▪The sender send one frame and wait for (ACK)


frame from the receiver
▪The sender will send the next frame when it
receives the (ACK) frame
▪The process is repeated until the sender sends
the (EOT) frame
▪Simple and inefficient (slow)
49
Stop and Wait

50
SLIDING WINDOW

▪Several frames can be transmitted before


needing an acknowledgment
▪The window can hold frames and provides the
upper limit on the number of frames that can
be transmitted before (ACK)
▪Frames are numbered module-n based on the
size of the window

51
Sliding Window
 If n = 8 then frames are numbered from 0 to 7,
and the size of the window is (n – 1) which is 7

 The ACK includes the number of the next frame it


expect to receive
 An ACK with number 5, means that all frames before 5
has been received
52
SENDER WINDOW

▪If the window size is w, and 3 frames has


been transmitted since the last ACK, then
the number of frames left in the window is
(w – 3)
▪When ACK arrives, the window expands to
let in a number of frames equal to the
number of frames acknowledged by ACK

53
Sender Sliding Window

54
EXAMPLE
▪Size of the window is 7
▪Frames from 0 to 4 have been sent and no
ACK has been received
▪The sender window then contains 2 frames (5
and 6)
▪If ACK 4 received, means that frames 0
through 3 are received
▪The sender window expand to include the next
4 frames and will contains 6 frames
(5,6,7,0,1,2) 55
RECEIVER WINDOW

▪Represent the number of frames that may still


be received before an ACK must be sent.
▪If window size is w, and if 3 frames are
received without ACK being returned, then the
number of spaces in the window is (w-3)
▪When ACK is sent, the window expands to
include places for a number of frames equal to
the number of frames acknowledged
56
Receiver Sliding Window

57
EXAMPLE
▪If window size is 7, when the first frame is
arrived the window will shrinks by 1
▪If frames 0 through 3 have arrived but no
ACK, the window will contain 3 frame spaces
▪If the prior ACK was for frame 2 and the
current ACK for frame 5, the window expands
by 3 spaces

58
Sliding Window Example

59
ERROR CONTROL
Error control in the data link layer is based on
automatic repeat request (ARQ) , which means
retransmission of data in three cases: Damage
frame, lost frame, and lost acknowledgment.

60
ARQ FUNCTION
▪Allow us to say that the frame has been lost
▪Automatic retransmission of lost frames (ACK
and NAK frames).

61
STOP-AND-WAIT ARQ

Stop-and-Wait ARQ is a form of stop-and-wait


flow control extended to include retransmission
of data in case of lost or damaged frames.

62
BASIC FLOW CONTROL MECHANISM
(RETRANSMISSION )

▪The sending device keeps a copy of the last frame


transmitted until it receives an acknowledgment for that
frame.
▪Data frames and ACK frames are numbered alternately
0 and 1.
▪Not numbered NAK frames, tell the sender to retransmits
the last frame sent.
▪The sending device is equipped with a timer, if an
expected acknowledgment is not received within a
allotted time period, the sender assumes that the last data
frame was lost in transit and sends it again. 63
Stop and wait Damaged Frame

64
LOST FRAME?

Time Out

1
ACK 1

65
SLIDING WINDOW ARQ
Among the several popular mechanisms for
continuous transmission error control, two protocols
are the most popular:
▪Go-back-n ARQ
▪Selective-reject ARQ

Both based on sliding window flow control

66
Go-Back-n ARQ
 If one frame is lost or damaged, all frames sent since
the last frame acknowledged are retransmitted.
Go back-n Damaged Frame

67
Lost Data Frame

Go back-n Lost Frame

68
Lost Acknowledgment
Go back-n Lost ACK

69
SELECTIVE-REJECT ARQ
Only the specific damaged or lost frame is
retransmitted.
Selective Reject

70
NEXT CLASS
▪Switching Networks
✓ Circuit Switching
✓ Packet Switching
✓ Structure of Switch

▪LAN Technologies

71

You might also like