SlideShare ist ein Scribd-Unternehmen logo
1 von 70
Downloaden Sie, um offline zu lesen
PHYSICAL LAYER &
DATA LINK LAYER (PART 1)
Dr. Nawaporn Wisitpongphan1
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
ชนิดของสัญญาณข้อมูล
สัญญาณ (Signal) จะอ้างถึงรูปแบบ (form) หรือต้นแบบ
(pattern) ที่ส่งข้อมูลออกไป
 ตัวอย่าง
รูปแบบของแสง (Light Pattern)
คลื่นแม่เหล็กไฟฟ้ า (Electromagnetic Wave)
สามารถจาแนกได้ 2 ชนิด
 สัญญาณอนาลอก (Analog Signal)
 สัญญาณดิจิตอล (Digital Signal)
3
สัญญาณอนาลอก (ANALOG SIGNAL)
 ลักษณะสัญญาณที่มีความต่อเนื่องกันเป็นคลื่นไซน์ (sine wave)
 แต่ละคลื่นจะมีความถี่และความเข้มข้นของสัญญาณที่ต่างกัน
 เฮิรตซ์ (hertz) คือหน่วยวัดความถี่ของสัญญาณแบบอนาลอก ใช้วิธีนับจานวนรอบ
ของสัญญาณที่เกิดขึ้นภายใน 1 วินาที
4
ระดับสัญญาณ
เวลา
1 รอบสัญญาณ
สัญญาณดิจิตอล (DIGITAL SIGNAL)
 ลักษณะสัญญาณที่ไม่ต่อเนื่องกัน
 จะใช้สื่อสารข้อมูลในคอมพิวเตอร์ ซึ่งข้อมูลถูกแทนด้วยเลขฐาน 2 (0,1)
5
ANALOG VS. DIGITAL
6
 คุณภาพและความละเอียดของข้อมูล
อนาลอกมีมากกว่าข้อมูลแบบดิจิตอล
 สามารถนาสัญญาณอนาลอกมา
ประมวลผลได้ทันทีโดยใช้อุปกรณ์อนาลอก
 สัญญาณอนาลอกถูกรบกวนด้วย noise
ได้ง่าย จึงต้องส่งผ่านตัวกลางที่มีคุณภาพ
เช่น twisted pair cable,
coaxial cable
 สัญญาณอนาลอกที่ถูกบิดเบือนด้วย
noise จะ restore ได้ยากกว่า
สัญญาณ digital ที่ถูกบิดเบือน
Advantanges (ข้อดี) Disadvantages (ข้อเสีย)
BANDWIDTH VS. THROUGHPUT
7
 ในระบบดิจิตอล bandwidth คือความเร็วข้อมูล
เป็น bits per second (จานวนบิตต่อวินาที)
 ตัวอย่าง โมเด็มซึ่งทางานที่ 57,600bps จะมี
bandwidth เป็น 2 เท่าของ โมเด็ม ซึ่งทางานที่
28,800bps
 ในในระบบอนาลอก ความหมายของ
bandwidth หมายถึงความแตกต่างระหว่าง
ความถี่สูงสุดและต่าสุดของสัญญาณ มีหน่วย
วัดเป็น hertz
 สัญญาณเสียงมี bandwidth ประมาณ 33 KHz
และการกระจายภาพของโทรทัศน์แบบอะนาล็อก ใช้
สัญญาณวิดีโอ ซึ่งมี bandwidth ประมาณ 6
MHz
 คือ อัตราความเร็วในการรับ-ส่งข้อมูล ซึ่งเป็น
ค่าที่บอกถึงประสิทธิภาพในการรับส่งข้อมูลที่
สามารถนามาใช้ได้จริง
BANDWIDTH THROUGHPUT
 Set of allocated/allowed frequencies
 Example: WLAN has a total of 14
channels with 3 non-overlapping
channels
CHANNEL
SIGNAL IMPAIRMENTS
 Attenuation: คือการลดทอนของสัญญาณ
 Distortion: ความบิดเบือนของสัญญาณ
 Noise: สัญญาณรบกวน
8
ANALOG TO DIGITAL
9
Formatting and transmission of baseband signals
From: Digital Communicatoins Fundamental and Applications by Bernard Sklar
TEXT TO BINARY
10
ASCII Code: Seven-bit American standard code for information interchange
From: Digital Communicatoins Fundamental and Applications by Bernard Sklar
“THINK” IN A BINARY FORM
11
ข้อความ
bit
Symbol
Waveform
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.
SAMPLE
13
SAMPLING THEOREM
14
สุ่มน้อยไป
สุ่มมากขึ้นทาให้สัญญาณใกล้เคียง
สัญญาณเดิมมากขึ้น
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
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 จะสามารถกู้สัญญาณกลับมาในสภาพเดิมได้อย่าง
สมบูรณ์”
QUANTIZE
17
SAMPLING  QUANTIZING
18
ENCODE (LINE CODING)
19
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 ได้
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)
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
รูปแบบการแปลงข้อมูลเป็นสัญญาณดิจิตอล
23
MODULATING
25
ANALOG ENCODING OF DIGITAL DATA: MODULATION
 Modulates a carrier
signal A*cos(2pfct +f )
 ASK change A
 FSK changes f
 PSK change f
DATA LINK: OUTLINE
 Error Detection
 Error Correction
 Flow Control
27
DATA LINK CONTROL PROTOCOLS
Data Link Control Protocols
Line
Discipline
Flow
Control
Error
Control
ใครส่ง? ส่งข้อมูลได้เท่าไหร่ จะแก้ปัญหาความ
ผิดพลาดในการส่ง
อย่างไร
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.
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
ENQ/ACK
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?
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.
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.
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.
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
36
POLL
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.
38
SELECT
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
FLOW CONTROL/ STOP & WAIT
Flow Control
Sliding WindowStop-and-Wait
Send 1 frame
at a time
Send several
frames at a time
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
42
STOP-AND-WAIT FLOW CONTROL
STOP-AND-WAIT LINK UTILIZATION
TransmissionTime is normalized to 1, Propagation Delay is expressed as ‘a’
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
FLOW CONTROL/ SLIDING WINDOW
Flow Control
Sliding WindowStop-and-Wait
Send 1 frame
at a time
Send several
frames at a time
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
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
48
SLIDING-WINDOW DIAGRAM
49
SLIDING-WINDOW EXAMPLE
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?
ERROR DETECTION
 Errors :
 การเปลี่ยนแปลงของข้อมูลตั้งแต่ 1 bit เป็นต้นไป ที่เกิดขึ้นขณะส่งผ่าน
ข้อมูลไปตาม transmission media แบบต่างๆ
 Detection:
 การตรวจสอบความผิดพลาดในการส่ง ทาได้โดยการใช้ “error-
detecting code” ที่เรียกว่าการ “check bits”
 ข้อมูลที่ใช้สาหรับการทา error detection จะถูกเพิ่มเติมลงใน packet
โดยผู้ส่ง
 ผู้รับจะทาการตรวจสอบข้อมูลที่เพิ่มมานี้อีกรอบเพื่อดูว่ามีความผิดพลาดใน
การส่งหรือไม่
 อย่างไรก็ตาม การตรวจเช็คไม่สามารถตรวจับความผิดพลาดได้ 100% 51
52
ERROR DETECTION PROCESS
ERROR DETECTION SCHEME:
PARITY CHECK
หลักการทางานของ parity check
 Even Parity : จานวนของ bit 1 ในข้อมูลเป็นจานวนคู่
 Odd Parity: จานวนของ bit 1 ในข้อมูลเป็นจานวนคี่
ตัวอย่าง: ถ้า “A” (ASCII Code = 41 : 01000001) ถูกส่งด้วยวิธี “Odd Parity”
ผู้ส่งจะต้องเพิ่ม “1” ลงไปในข้อมูลเป็น 101000001, เพื่อให้จานวน “1” ที่มีอยู่เป็นจานวน
คี่ (3 bits)
 Correction Capability:
 Can only detect error but cannot correct error
53
7 bits of data
(number of
1s)
8 bits including parity
even odd
0000000 (0) 00000000 10000000
1010001 (3) 11010001 01010001
1101001 (4) 01101001 11101001
1111111 (7) 11111111 01111111
ERROR DETECTION SCHEME:
CYCLIC REDUNDANCY CHECK (CRC)
 เป็นวิธีการตรวจจับข้อผิดพลาดในข้อมูลที่ใช้กันมากที่สุด
 ถ้าข้อมูลมีอยู่ k bits ผู้ส่งจะคานวนหา bit check เป็นจานวน (n-k) bits ที่เรียกกัน
ว่า Frame Check Sequence (FCS)
 ผู้ส่งจะทาการส่ง n bits ที่มีอยู่นี้ไป ซึ่งค่าที่ส่งไปจะสามารถหารลงตัวได้ โดยใช้ตัวหารที่ถูก
กาหนดขึ้น
 ผู้รับเมื่อได้รับข้อมูลที่ถูกส่งมาแล้ว จะหารข้อมูลที่ได้มาด้วยตัวหารที่ถูกาหนดไว้แล้ว
 ถ้าไม่มีส่วนเกิน ไม่มีความผิดพลาดในข้อมูล
 วิธีที่ใช้กันในปัจจุบัน เช่น Polynomial Modulo 2 Arithmetic
54
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)
 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
57
POLYNOMIALS: หารยาว
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
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
AUTOMATIC REPEAT REQUEST (ARQ)
 Collective name for such error control
mechanisms, including:
 Stop-and-Wait
 Go-back-N
 Selective-Reject (selective retransmission)
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
62
STOP-AND-WAIT ARQ
 Possible Transmission Errors
 Data Lost
 ACK Lost
 Pros
 Simple
 Cons
 inefficient
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
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
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
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
67
GO BACK N
VS.
SELECTIVE
REJECT
HOMEWORK
1. จงแปลง 10010011100010101 โดยใช้วิธีดังต่อไปนี้
a) NRZ
b) NRZI
c) Manchester
2. จงอธิบายวิธีการแปลงสัญญาณแบบต่างๆดังต่อไปนี้ และจงใช้ข้อกาหนดดังกล่าวแปลงสัญญาณตามข้อ 1
a) Bipolar หรือ AMI
b) Pseudoternary
c) DifferentialManchester
3. นาย ก. จะส่งไฟล์เพลงขนาด 3 MB ให้นาย ข. โดยที่อัตราเร็วในการส่งข้อมูลนั้นอยู่ที่ 1 Mbps และ ACK packet
มีขนาด 100 bits โดยให้คอมพิวเตอร์สองเครื่องนี้ถูกเชื่อมต่อด้วยสายที่มีขนาดยาว 50 เมตร โดยสัญญาณจะ
สามารถส่งผ่านสายด้วยอัตราเร็ว 2.5x108 m/s จงคานวนหาว่า delay ที่ใช้ในการส่งไฟล์เพลงนี้เป็นเท่าไหร่ถ้า
(ให้คิดว่า M = 106 )
a) นาย ก. ส่งแบบ stop & wait โดยที่ขนาดของ packet แต่ละอันคือ 500 Byte
b) นาย ก. ส่งแบบ stop & wait โดยที่ขนาดของ packet แต่ละอันคือ 1500 Byte
c) นาย ก. ควรจะส่งแบบวิธีตามข้อ a) หรือข้อ b) เพราะอะไร
d) จงคานวนหา delay ในการส่งในข้อ a) และ b) ใหม่ ถ้านาย ก.ส่งแบบ sliding window โดยที่ window size = 5
4. จงคานวนหา Frame CheckSumโดยให้ (ให้แสดงวิธีทาอย่างละเอียด)
D= 1101001101
P= 110101
68
WORKSHEET ข้อ 1
69
1 0 0 1 0 0 1 1 1 0 0 0 1 0 1 0 1
Clock
NRZ 0
NRZI 0
Manchester 0
WORKSHEET ข้อ 2
70
1 0 0 1 0 0 1 1 1 0 0 0 1 0 1 0 1
Clock
Differential
Manchester 0
Pseudoternary
0
Bipolar 0

Weitere ähnliche Inhalte

Ähnlich wie PHYSICALLAYER

บบที่ 4 การสื่อสารข้อมูลในระบบคอมพิวเตอร์
บบที่ 4 การสื่อสารข้อมูลในระบบคอมพิวเตอร์บบที่ 4 การสื่อสารข้อมูลในระบบคอมพิวเตอร์
บบที่ 4 การสื่อสารข้อมูลในระบบคอมพิวเตอร์xsitezaa
 
ใบความรู้ที่ 3
ใบความรู้ที่ 3ใบความรู้ที่ 3
ใบความรู้ที่ 3Nattapon
 
อุปกรณ์เครือข่ายคอมพิวเตอร์
อุปกรณ์เครือข่ายคอมพิวเตอร์อุปกรณ์เครือข่ายคอมพิวเตอร์
อุปกรณ์เครือข่ายคอมพิวเตอร์Kasin Wasuwanich
 
อุปกรณ์เครือข่ายคอมพิวเตอร์
อุปกรณ์เครือข่ายคอมพิวเตอร์อุปกรณ์เครือข่ายคอมพิวเตอร์
อุปกรณ์เครือข่ายคอมพิวเตอร์Kasin Wasuwanich
 
อุปกรณ์เครือข่ายคอมพิวเตอร์
อุปกรณ์เครือข่ายคอมพิวเตอร์อุปกรณ์เครือข่ายคอมพิวเตอร์
อุปกรณ์เครือข่ายคอมพิวเตอร์Vorakit Prateeppetchthong
 
การสื่อสาร อ.พรทิพย์
การสื่อสาร อ.พรทิพย์การสื่อสาร อ.พรทิพย์
การสื่อสาร อ.พรทิพย์Namfon Phenpit
 
Data communication and network
Data communication and networkData communication and network
Data communication and networkkamol
 
Data communication and network
Data communication and networkData communication and network
Data communication and networkNidzy Krajangpat
 
Ch4 communication and computer networks
Ch4 communication and computer networksCh4 communication and computer networks
Ch4 communication and computer networksChangnoi Etc
 
เทอม 1 คาบ 7บทบาทของการสื่อสาร
เทอม 1 คาบ 7บทบาทของการสื่อสารเทอม 1 คาบ 7บทบาทของการสื่อสาร
เทอม 1 คาบ 7บทบาทของการสื่อสารMrpopovic Popovic
 
ระบบสื่อสารข้อมูลสำหรับเครือข่ายคอมพิวเตอร์
ระบบสื่อสารข้อมูลสำหรับเครือข่ายคอมพิวเตอร์ระบบสื่อสารข้อมูลสำหรับเครือข่ายคอมพิวเตอร์
ระบบสื่อสารข้อมูลสำหรับเครือข่ายคอมพิวเตอร์GRimoho Siri
 

Ähnlich wie PHYSICALLAYER (20)

บบที่ 4 การสื่อสารข้อมูลในระบบคอมพิวเตอร์
บบที่ 4 การสื่อสารข้อมูลในระบบคอมพิวเตอร์บบที่ 4 การสื่อสารข้อมูลในระบบคอมพิวเตอร์
บบที่ 4 การสื่อสารข้อมูลในระบบคอมพิวเตอร์
 
Communication Concept 3
Communication Concept 3Communication Concept 3
Communication Concept 3
 
ใบความรู้ที่ 3
ใบความรู้ที่ 3ใบความรู้ที่ 3
ใบความรู้ที่ 3
 
Datacom
DatacomDatacom
Datacom
 
อุปกรณ์เครือข่ายคอมพิวเตอร์
อุปกรณ์เครือข่ายคอมพิวเตอร์อุปกรณ์เครือข่ายคอมพิวเตอร์
อุปกรณ์เครือข่ายคอมพิวเตอร์
 
Network
NetworkNetwork
Network
 
Network
NetworkNetwork
Network
 
อุปกรณ์เครือข่ายคอมพิวเตอร์
อุปกรณ์เครือข่ายคอมพิวเตอร์อุปกรณ์เครือข่ายคอมพิวเตอร์
อุปกรณ์เครือข่ายคอมพิวเตอร์
 
อุปกรณ์เครือข่ายคอมพิวเตอร์
อุปกรณ์เครือข่ายคอมพิวเตอร์อุปกรณ์เครือข่ายคอมพิวเตอร์
อุปกรณ์เครือข่ายคอมพิวเตอร์
 
หน่วยที่ 1 เทคโนโลยีสารสนเทศ
หน่วยที่ 1 เทคโนโลยีสารสนเทศหน่วยที่ 1 เทคโนโลยีสารสนเทศ
หน่วยที่ 1 เทคโนโลยีสารสนเทศ
 
เทอม 1 คาบ 11
เทอม 1 คาบ 11เทอม 1 คาบ 11
เทอม 1 คาบ 11
 
การสื่อสาร อ.พรทิพย์
การสื่อสาร อ.พรทิพย์การสื่อสาร อ.พรทิพย์
การสื่อสาร อ.พรทิพย์
 
Data communication and network
Data communication and networkData communication and network
Data communication and network
 
Lan 01
Lan 01Lan 01
Lan 01
 
Lan 01
Lan 01Lan 01
Lan 01
 
Protocol
ProtocolProtocol
Protocol
 
Data communication and network
Data communication and networkData communication and network
Data communication and network
 
Ch4 communication and computer networks
Ch4 communication and computer networksCh4 communication and computer networks
Ch4 communication and computer networks
 
เทอม 1 คาบ 7บทบาทของการสื่อสาร
เทอม 1 คาบ 7บทบาทของการสื่อสารเทอม 1 คาบ 7บทบาทของการสื่อสาร
เทอม 1 คาบ 7บทบาทของการสื่อสาร
 
ระบบสื่อสารข้อมูลสำหรับเครือข่ายคอมพิวเตอร์
ระบบสื่อสารข้อมูลสำหรับเครือข่ายคอมพิวเตอร์ระบบสื่อสารข้อมูลสำหรับเครือข่ายคอมพิวเตอร์
ระบบสื่อสารข้อมูลสำหรับเครือข่ายคอมพิวเตอร์
 

PHYSICALLAYER

  • 1. PHYSICAL LAYER & DATA LINK LAYER (PART 1) Dr. Nawaporn Wisitpongphan1
  • 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
  • 3. ชนิดของสัญญาณข้อมูล สัญญาณ (Signal) จะอ้างถึงรูปแบบ (form) หรือต้นแบบ (pattern) ที่ส่งข้อมูลออกไป  ตัวอย่าง รูปแบบของแสง (Light Pattern) คลื่นแม่เหล็กไฟฟ้ า (Electromagnetic Wave) สามารถจาแนกได้ 2 ชนิด  สัญญาณอนาลอก (Analog Signal)  สัญญาณดิจิตอล (Digital Signal) 3
  • 4. สัญญาณอนาลอก (ANALOG SIGNAL)  ลักษณะสัญญาณที่มีความต่อเนื่องกันเป็นคลื่นไซน์ (sine wave)  แต่ละคลื่นจะมีความถี่และความเข้มข้นของสัญญาณที่ต่างกัน  เฮิรตซ์ (hertz) คือหน่วยวัดความถี่ของสัญญาณแบบอนาลอก ใช้วิธีนับจานวนรอบ ของสัญญาณที่เกิดขึ้นภายใน 1 วินาที 4 ระดับสัญญาณ เวลา 1 รอบสัญญาณ
  • 5. สัญญาณดิจิตอล (DIGITAL SIGNAL)  ลักษณะสัญญาณที่ไม่ต่อเนื่องกัน  จะใช้สื่อสารข้อมูลในคอมพิวเตอร์ ซึ่งข้อมูลถูกแทนด้วยเลขฐาน 2 (0,1) 5
  • 6. ANALOG VS. DIGITAL 6  คุณภาพและความละเอียดของข้อมูล อนาลอกมีมากกว่าข้อมูลแบบดิจิตอล  สามารถนาสัญญาณอนาลอกมา ประมวลผลได้ทันทีโดยใช้อุปกรณ์อนาลอก  สัญญาณอนาลอกถูกรบกวนด้วย noise ได้ง่าย จึงต้องส่งผ่านตัวกลางที่มีคุณภาพ เช่น twisted pair cable, coaxial cable  สัญญาณอนาลอกที่ถูกบิดเบือนด้วย noise จะ restore ได้ยากกว่า สัญญาณ digital ที่ถูกบิดเบือน Advantanges (ข้อดี) Disadvantages (ข้อเสีย)
  • 7. BANDWIDTH VS. THROUGHPUT 7  ในระบบดิจิตอล bandwidth คือความเร็วข้อมูล เป็น bits per second (จานวนบิตต่อวินาที)  ตัวอย่าง โมเด็มซึ่งทางานที่ 57,600bps จะมี bandwidth เป็น 2 เท่าของ โมเด็ม ซึ่งทางานที่ 28,800bps  ในในระบบอนาลอก ความหมายของ bandwidth หมายถึงความแตกต่างระหว่าง ความถี่สูงสุดและต่าสุดของสัญญาณ มีหน่วย วัดเป็น hertz  สัญญาณเสียงมี bandwidth ประมาณ 33 KHz และการกระจายภาพของโทรทัศน์แบบอะนาล็อก ใช้ สัญญาณวิดีโอ ซึ่งมี bandwidth ประมาณ 6 MHz  คือ อัตราความเร็วในการรับ-ส่งข้อมูล ซึ่งเป็น ค่าที่บอกถึงประสิทธิภาพในการรับส่งข้อมูลที่ สามารถนามาใช้ได้จริง BANDWIDTH THROUGHPUT  Set of allocated/allowed frequencies  Example: WLAN has a total of 14 channels with 3 non-overlapping channels CHANNEL
  • 8. SIGNAL IMPAIRMENTS  Attenuation: คือการลดทอนของสัญญาณ  Distortion: ความบิดเบือนของสัญญาณ  Noise: สัญญาณรบกวน 8
  • 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
  • 25. 25 ANALOG ENCODING OF DIGITAL DATA: MODULATION  Modulates a carrier signal A*cos(2pfct +f )  ASK change A  FSK changes f  PSK change f
  • 26. DATA LINK: OUTLINE  Error Detection  Error Correction  Flow Control
  • 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
  • 43. STOP-AND-WAIT LINK UTILIZATION TransmissionTime is normalized to 1, Propagation Delay is expressed as ‘a’
  • 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?
  • 51. ERROR DETECTION  Errors :  การเปลี่ยนแปลงของข้อมูลตั้งแต่ 1 bit เป็นต้นไป ที่เกิดขึ้นขณะส่งผ่าน ข้อมูลไปตาม transmission media แบบต่างๆ  Detection:  การตรวจสอบความผิดพลาดในการส่ง ทาได้โดยการใช้ “error- detecting code” ที่เรียกว่าการ “check bits”  ข้อมูลที่ใช้สาหรับการทา error detection จะถูกเพิ่มเติมลงใน packet โดยผู้ส่ง  ผู้รับจะทาการตรวจสอบข้อมูลที่เพิ่มมานี้อีกรอบเพื่อดูว่ามีความผิดพลาดใน การส่งหรือไม่  อย่างไรก็ตาม การตรวจเช็คไม่สามารถตรวจับความผิดพลาดได้ 100% 51
  • 53. ERROR DETECTION SCHEME: PARITY CHECK หลักการทางานของ parity check  Even Parity : จานวนของ bit 1 ในข้อมูลเป็นจานวนคู่  Odd Parity: จานวนของ bit 1 ในข้อมูลเป็นจานวนคี่ ตัวอย่าง: ถ้า “A” (ASCII Code = 41 : 01000001) ถูกส่งด้วยวิธี “Odd Parity” ผู้ส่งจะต้องเพิ่ม “1” ลงไปในข้อมูลเป็น 101000001, เพื่อให้จานวน “1” ที่มีอยู่เป็นจานวน คี่ (3 bits)  Correction Capability:  Can only detect error but cannot correct error 53 7 bits of data (number of 1s) 8 bits including parity even odd 0000000 (0) 00000000 10000000 1010001 (3) 11010001 01010001 1101001 (4) 01101001 11101001 1111111 (7) 11111111 01111111
  • 54. ERROR DETECTION SCHEME: CYCLIC REDUNDANCY CHECK (CRC)  เป็นวิธีการตรวจจับข้อผิดพลาดในข้อมูลที่ใช้กันมากที่สุด  ถ้าข้อมูลมีอยู่ k bits ผู้ส่งจะคานวนหา bit check เป็นจานวน (n-k) bits ที่เรียกกัน ว่า Frame Check Sequence (FCS)  ผู้ส่งจะทาการส่ง n bits ที่มีอยู่นี้ไป ซึ่งค่าที่ส่งไปจะสามารถหารลงตัวได้ โดยใช้ตัวหารที่ถูก กาหนดขึ้น  ผู้รับเมื่อได้รับข้อมูลที่ถูกส่งมาแล้ว จะหารข้อมูลที่ได้มาด้วยตัวหารที่ถูกาหนดไว้แล้ว  ถ้าไม่มีส่วนเกิน ไม่มีความผิดพลาดในข้อมูล  วิธีที่ใช้กันในปัจจุบัน เช่น Polynomial Modulo 2 Arithmetic 54
  • 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
  • 62. 62 STOP-AND-WAIT ARQ  Possible Transmission Errors  Data Lost  ACK Lost  Pros  Simple  Cons  inefficient
  • 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
  • 68. HOMEWORK 1. จงแปลง 10010011100010101 โดยใช้วิธีดังต่อไปนี้ a) NRZ b) NRZI c) Manchester 2. จงอธิบายวิธีการแปลงสัญญาณแบบต่างๆดังต่อไปนี้ และจงใช้ข้อกาหนดดังกล่าวแปลงสัญญาณตามข้อ 1 a) Bipolar หรือ AMI b) Pseudoternary c) DifferentialManchester 3. นาย ก. จะส่งไฟล์เพลงขนาด 3 MB ให้นาย ข. โดยที่อัตราเร็วในการส่งข้อมูลนั้นอยู่ที่ 1 Mbps และ ACK packet มีขนาด 100 bits โดยให้คอมพิวเตอร์สองเครื่องนี้ถูกเชื่อมต่อด้วยสายที่มีขนาดยาว 50 เมตร โดยสัญญาณจะ สามารถส่งผ่านสายด้วยอัตราเร็ว 2.5x108 m/s จงคานวนหาว่า delay ที่ใช้ในการส่งไฟล์เพลงนี้เป็นเท่าไหร่ถ้า (ให้คิดว่า M = 106 ) a) นาย ก. ส่งแบบ stop & wait โดยที่ขนาดของ packet แต่ละอันคือ 500 Byte b) นาย ก. ส่งแบบ stop & wait โดยที่ขนาดของ packet แต่ละอันคือ 1500 Byte c) นาย ก. ควรจะส่งแบบวิธีตามข้อ a) หรือข้อ b) เพราะอะไร d) จงคานวนหา delay ในการส่งในข้อ a) และ b) ใหม่ ถ้านาย ก.ส่งแบบ sliding window โดยที่ window size = 5 4. จงคานวนหา Frame CheckSumโดยให้ (ให้แสดงวิธีทาอย่างละเอียด) D= 1101001101 P= 110101 68
  • 69. WORKSHEET ข้อ 1 69 1 0 0 1 0 0 1 1 1 0 0 0 1 0 1 0 1 Clock NRZ 0 NRZI 0 Manchester 0
  • 70. WORKSHEET ข้อ 2 70 1 0 0 1 0 0 1 1 1 0 0 0 1 0 1 0 1 Clock Differential Manchester 0 Pseudoternary 0 Bipolar 0