The Physic Layer 6Data Communication and Digital Signal ❒ Signals propagate over a physical medium ❍ Digital signal a binary string ❍ Analog signal a continuous number ❒ Data can be eith
Trang 1Ch ng 3: T ng V t lý ươ ầ ậ
The Physic Layer
Trang 2The Physic Layer 2
The physical layer functions
❒ deals with mechanical, electrical and procedural interfacing
❒ provides collision detection
❒ specifies cables, connectors, and other components
❒ transmits raw information over communication channel
❒ establishes, maintains, and disconnects physical links
❒ includes software device drivers for communication
interfaces
Trang 3Các ch c năng c b n c a t ng V t ứ ơ ả ủ ầ ậ
lý
❒ Cung c p các đ c t k thu t v c , đi n, các hàm, th t cấ ặ ả ỹ ậ ề ơ ệ ủ ụ
❒ Cung c p kh năng dò tìm xung đ tấ ả ộ
Trang 4The Physic Layer 4
Questions to Think
❒ Why do we prefer digital transmission to analog
transmission?
❒ What is the most promising physical transmission
medium for the future?
❒ Can wireless communication replace all the wired
communication?
❒ What does the “personal communication system”
mean to you?
Trang 5Các v n đ c n cân nh c ấ ề ầ ắ
❒ T i sao chúng ta thích truy n thông tín hi u s h n ạ ề ệ ố ơ
truy n thông tín hi u t ng t ?ề ệ ươ ự
❒ Ph ng ti n truy n v t lý h a h n nh t cho t ng lai là ươ ệ ề ậ ứ ẹ ấ ươgì?
❒ Truy n thông vô tuy n có th thay th hoàn toàn truy n ề ế ể ế ềthông h u tuy n?ữ ế
❒ “H th ng truy n thông cá nhân” là gì?ệ ố ề
Trang 6The Physic Layer 6
Data Communication and Digital Signal
❒ Signals propagate over a physical medium
❍ Digital signal (a binary string)
❍ Analog signal (a continuous number)
❒ Data can be either digital or analog
❍ Some data naturally represented as digital
signals
• Letter ‘A’: 01000001 in ASCII
❍ Other data need to be converted from analog
to digital
• Voice, video etc
❒ We are interested in digital signals/data
Trang 7analog sang digial
• Âm thanh, video,…
❒ Chúng ta quan tâm đ n tín hi u/d li u s !ế ệ ữ ệ ố
Trang 8The Physic Layer 8
Why Digital Signals
❒ Digital signal better than analog signal for
❍ Storage
❍ Manipulation
❍ Transmission
Trang 9T i sao l i là tín hi u s ?! ạ ạ ệ ố
❒ Tín hi u s t t h n tín hi u t ng t ệ ố ố ơ ệ ươ ự để
❍ L u tr ư ữ
❍Thao tác, x lý ử
❍Truy n tin ề
Trang 10The Physic Layer 10
❒ Transmission of data depends on
❍ Quality of signal
❍ Characteristics of medium
❒ Need to do signal processing
❒ Need to measure quality of received signal
❍ Analog: signal-to-noise ratio
❍ Digital: probability of symbol error
❒ To transmit bits (0’s or 1’s) we need to map them
into electromagnetic waves Modulation
techniques
Trang 11❒ C n ph i đo l ng ch t l ng c a tín hi u nh n đ cầ ả ườ ấ ượ ủ ệ ậ ượ
❍ Analog: t l tín hi u/t p nhi uỷ ệ ệ ạ ễ
❍ Digital: Xác su t c a các bit l iấ ủ ỗ
❒ Đ truy n các dòng bits (0’s or 1’s) ta c n ánh x chúng ể ề ầ ạsang các sóng đi n t => các k thu t đi u chệ ừ ỹ ậ ề ế
Trang 12The Physic Layer 12
❒ Attenuation and distortion depend on
❍ Type of transmission medium
Trang 14The Physic Layer 14
Data Transmission (3)
❒ Medium:
❍ Guided: twisted pair, coaxial cable, optical fiber
❍ Unguided: radio, satellite, infrared, microwave
❒ Direct link: point-to-point or guided
❍ Two devices share the medium (intermediate
repeaters, amplifiers)
❒ Indirect link: multipoint or broadcast
❍ More than two devices share the medium
❒ Transmission modes: simplex, half-duplex, full-duplex
❒ Frequency, spectrum, bandwidth
❍ Time-domain vs frequency domain
Trang 15❒ Liên k t tr c ti p: đi m – đi mế ự ế ể ể
❍ Hai thi t b chia s ph ng ti n truy n (các b ế ị ẻ ươ ệ ề ộ
chuy n ti p, b khu ch đ i trung gian)ể ế ộ ế ạ
❒ Liên k t gián ti p: nhi u đi m ho c qu ng báế ế ề ể ặ ả
❍ Nhi u h n hai thi t b chia s ph ng ti n ề ơ ế ị ẻ ươ ệ
truy nề
❒ Các ph ng th c truy n: đ n công, bán song công, ươ ứ ề ơ
song công
❒ Các khái ni m c n l u ý: t n s , ph , d i thôngệ ầ ư ầ ố ổ ả
Trang 16The Physic Layer 16
Baseband & Broadband
❒ Baseband: The data signal is transmitted directly over the transmission medium
❒ Broadband: the data signal is no longer placed directly on the transmission medium An analog or carrier signal is
modulated by the data signal and then transmitted
Trang 17D i t n c s và D i t n r ng ả ầ ơ ở ả ầ ộ
❒ D i t n c s : Tín hi u s đ c truy n tr c ti p qua ả ầ ơ ở ệ ố ượ ề ự ế
ph ng ti n truy n.ươ ệ ề
❒ D i t n r ng: Tín hi u s không đ c đ a tr c ti p lên ả ầ ộ ệ ố ượ ư ự ế
ph ng ti n truy n Tín hi u t ng t hay sóng mang đ c ươ ệ ề ệ ươ ự ượ
đi u bi n t tín hi u s và truy n đi qua ph ng ti n ề ế ừ ệ ố ề ươ ệ
truy n ề
Trang 18The Physic Layer 18
M t mô hình truy n thông đ n gi n ộ ề ơ ả
A simple model of communications
Trang 19Maximum Data Rate
❒ Signal rate: number of signal changes per second
❍ Each signal may take from several values (M)
❒ What is the maximum data rate of the channel
with cutoff frequency of H?
❒ Nyquist’s theorem
❍ Max data rate = 2H log 2 M bits/sec
❍ Signal can be reconstructed with only 2H samples/sec
❒ In computer science, data rate is referred to as bandwidth
❒ Can we obtain any data rate by making M
arbitrarily large?
Trang 20The Physic Layer 20
T c đ truy n d li u t i đa ố ộ ề ữ ệ ố
❒ T c đ tín hi u: s tín hi u thay đ i trong m t giây ố ộ ệ ố ệ ổ ộ
❍ M i tín hi u có th đ c truy n theo nhi u t c đ ỗ ệ ể ượ ề ề ố ộ
Trang 21❒ For noisy channel with frequency H and SNR S/N
❍ Max data rate = H log 2 (1+S/N)
Max data rate = min(H log2(1+S/N), 2H log2M)
Trang 22The Physic Layer 22
Đ nh lý Shannon ị
❒ Kênh truy n t p nhi uề ạ ễ
❍ Nhi u nhi t sinh ra do các electrons va ch m nhauễ ệ ạ
❍ T l Tín hi u/Nhi u: Signal-to-Noise Ratio (SNR)ỷ ệ ệ ễ
• T l c a công su t tín hi u (S) và công su t nhi u (N): S/N ỷ ệ ủ ấ ệ ấ ễ
• Đ c đo b ng đ n v dB hay decibels ượ ằ ơ ị
– 10 log10 (S/N) – S/N = 10 10 dB, 100 20dB
❒ Cho kênh truy n t p nhi u v i t n s H và t l tín ề ạ ễ ớ ầ ố ỷ ệ
hi u/nhi u là S/Nệ ễ
❍ T c đ d li u t i đa = H logố ộ ữ ệ ố 2(1+S/N)
T c đ d li u t i đa = min(H logố ộ ữ ệ ố 2(1+S/N), 2H log2M)
Trang 23Application of Shannon’s Theorem
❒ Conventional telephone system
Engineered for voice
Trang 24The Physic Layer 24
ng d ng đ nh lý Shannon
❒ H th ng đi n tho i quy cệ ố ệ ạ ướ
Đ c thi t k đ truy n t i gi ng nóiượ ế ế ể ề ả ọ
Trang 25Transmission Media
❒ Twisted Pair
❒ Baseband Coaxial Cable
❒ Broadband Coaxial Cable
❒ Fiber Optics
❒ Wireless
Trang 26The Physic Layer 26
Trang 27Physical Media: Twisted Pair
❒ Bit: propagates between
transmitter/rcvr pairs
❒ physical link: what lies
between transmitter &
receiver
❒ guided media:
❍ signals propagate in solid
media: copper, fiber, coax
❍ Category 5 UTP:
100Mbps Ethernet
Trang 28The Physic Layer 28
Ph ng ti n truy n: cáp đôi dây xo n ươ ệ ề ắ
❒ Bit: truy n gi a các đôi g i ề ữ ử
và nh n ậ
❒ Liên k t v t lý: ế ậ là nh ng gì ữ
n m gi a n i g i và bên nh n ằ ữ ơ ử ậ
❒ Đ ng truy n h u tuy n: ườ ề ữ ế
❍ Tín hi u truy n đi trong ph ng ệ ề ươ
ti n truy n: cáp đôi dây xo n, ệ ề ắ
cáp đ ng tr c, cáp quang ồ ụ
❒ Đ ng truy n vô tuy n: ườ ề ế
❍ Tín hi u đ c truy n đi trong ệ ượ ề
môi tr ng không khí, vd: sóng ườ
t c đ 10 Mbps ố ộ
❍ CAT 5 UTP: 100Mbps Ethernet
Trang 29Physical Media: coax, fiber
❍ multiple channel on cable
❍ HFC (hybrid fiber coaxial)
Fiber optic cable:
❒ glass fiber carrying light pulses, each pulse a bit
❒ high-speed operation:
❍ high-speed point-to-point transmission (e.g., 5 Gps)
❒ low error rate: repeaters spaced far apart ; immune
to electromagnetic noise
Trang 30The Physic Layer 30
❍ Nhi u kênh trên cáp ề
❍ Dùng trong mô hình lai gi a ữ
c n đ n repeatersầ ế
Trang 31Physical media: radio
❍ 270 msec end-end delay
❍ geosynchronous versus LEOS
Trang 32The Physic Layer 32
❍ Đ tr cu i - cu i kho ng 270 msec ộ ễ ố ố ả
Trang 33Access networks and physical media
Q: How to connect end systems to
edge router?
❒ residential access nets
❒ institutional access networks
Trang 34The Physic Layer 34
Truy c p m ng và ph ng ti n truy n ậ ạ ươ ệ ề
Trang 35Residential access: point to point access
❒ Dialup via modem
❍ up to 56Kbps direct access to
router (often less)
❍ Can’t be “always on”
❒ ADSL: asymmetric digital subscriber line
❍ up to 1 Mbps upstream (today typically < 256 kbps)
❍ up to 8 Mbps downstream (today typically < 1 Mbps)
❍ FDM: 50 kHz - 1 MHz for downstream
4 kHz - 50 kHz for upstream
0 kHz - 4 kHz for ordinary telephone
Trang 36The Physic Layer 36
Truy c p t i nhà: truy c p đi m – đi m ậ ạ ậ ể ể
❍ t c đ truy c p đ n router c a ố ộ ậ ế ủ
nhà cung c p có th đ t đ n ấ ể ạ ế
56Kbps (th ng thì th p h n) ườ ấ ơ
❍ không th ể “luôn tr c tuy n” ự ế
❒ Qua đ ng thuê bao s b t đ i x ng (ADSL):ườ ố ấ ố ứ
❍ T c đ upstream lên đ n 1 Mbps (hi n nay th ng thì < ố ộ ế ệ ườ
Trang 37Residential access: cable modems
❒ HFC: hybrid fiber coax
❍ asymmetric: up to 10Mbps downstream, 1
Mbps upstream
❒ network of cable and fiber attaches homes to
ISP router
❍ shared access to router among home
❍ issues: congestion, dimensioning
❒ deployment: available via cable companies, e.g.,
MediaOne (USA), STCV (Vietnam)…
Trang 38The Physic Layer 38
Truy c p t i nhà qua cable modems ậ ạ
❒ H th ng cáp “lai” gi a đ ng tr c và quang (HFC: ệ ố ữ ồ ụ hybrid fiber coax)
❍ không đ i x ng: downstream có th đ t đ n ố ứ ể ạ ế
10Mbps, upstream có th đ t đ n 1Mbps ể ạ ế
❒ m ng l i ạ ướ cáp đ ng tr c và cáp quang “g n” các h ồ ụ ắ ộ gia đình đ n router c a ISP ế ủ
❍ chia s truy c p đ n router gi a các gia đình ẻ ậ ế ữ
❍ các v n đ : t c ngh n, “kích c ” ấ ề ắ ẽ ỡ
❒ tri n khai: qua các công ty “ch y” cáp, vd: ể ạ
MediaOne (USA), STCV (Vietnam)…
Trang 39Minh h a v h th ng cung c p d ch v cable ọ ề ệ ố ấ ị ụ
modem
Residential access: cable modems
Trang 40The Physic Layer 40
Ki n trúc m ng cable modem t ng quát ế ạ ổ
Cable Network Architecture: Overview
home
cable headend
cable distribution network (simplified)
Typically 500 to 5,000 homes
Trang 41Ki n trúc m ng cable modem t ng quát ế ạ ổ
Cable Network Architecture: Overview
home cable headend
cable distribution
Trang 42The Physic Layer 42
Ki n trúc m ng cable modem t ng quát ế ạ ổ
Cable Network Architecture: Overview
home
cable headend
cable distribution network server(s)
Trang 43Ki n trúc m ng cable modem t ng quát ế ạ ổ
Cable Network Architecture: Overview
V I D E O
V I D E O
V I D E O
V I D E O
V I D E O
D A T A
D A T A
C O N T R O L
1 2 3 4 5 6 7 8 9
FDM:
Trang 44The Physic Layer 44
Company access: local area networks
❒ company/univ local area
network (LAN) connects end
system to edge router
❒ Ethernet:
❍ shared or dedicated link
connects end system and
router
❍ 10 Mbs, 100Mbps, Gigabit
Ethernet
❒ deployment: institutions, home
LANs happening now
Trang 46The Physic Layer 46
Wireless access networks
❒ shared wireless access network
connects end system to router
❍ via base station aka “access point”
❒ wireless LANs:
❍ 802.11b (WiFi): 11 Mbps
❒ wide-area wireless access
❍ provided by telco operator
❍ 3G ~ 384 kbps
• Will it widely happen in Vietnam??
❍ WAP/GPRS in Europe
basestation
mobilehostsrouter
Trang 47M ng truy c p không dây ạ ậ
❒ M ng truy c p không dây chia ạ ậ
❒ Truy c p không dây di n r ngậ ệ ộ
❍ Đ c cung c p b i các nhà đi u ượ ấ ở ề
hành vi n thông ễ
❍ 3G ~ 384 kbps
❍ WAP/GPRS châu Âu ở
basestation
mobilehostsrouter
Trang 48The Physic Layer 48
Home networks
Typical home network components:
❒ ADSL or cable modem
❒ router/firewall/NAT
❒ Ethernet
❒ wireless access point
wireless access point
wireless laptops router/
firewall
cable modem
to/from cable headend
Ethernet (switched)
Trang 49M ng gia đình ạ
wireless access
wireless laptops router/
firewall
cable modem
to/from
cable
headend
❒ Các thành ph n c b n c a m ng gia đình: ầ ơ ả ủ ạ
o ADSL ho c cable modem đ k t n i đ n ISPặ ể ế ố ế
o Thi t b đ nh tuy n/t ng l a/NATế ị ị ế ườ ử
o Các thi t b đ c n i k t theo chu n Ethernetế ị ượ ố ế ẩ
o Đi m truy c p d ch v không dây (wireless access point)ể ậ ị ụ
Trang 50The Physic Layer 50
How do loss and delay occur?
packets queue in router buffers
❒ packet arrival rate to link exceeds output link capacity
❒ packets queue, wait for turn
A
B
packet being transmitted (delay)
packets queueing (delay)
free (available) buffers: arriving packets dropped ( loss ) if no free buffers
Trang 51Đ tr và m t mát xu t hi n nh th ộ ễ ấ ấ ệ ư ế
nào?
Các gói tin x p hàng t i vùng đ m c a routerế ạ ệ ủ
❒ t c đ các gói tin đ n t liên k t đi vào v t quá kh năng c a liên ố ộ ế ừ ế ượ ả ủ
k t đi ra ế
❒ các gói tin ph i x p hàng, đ i đ n phiên đ c truy n ả ế ợ ế ượ ề
A
B
gói tin đang đ c truy n ượ ề (delay)
các gói đang x p hàng ế (delay)
vùng đ m còn tr ng; các gói tin đ n s b b đi n u
Trang 52The Physic Layer 52
Four sources of packet delay
❒ 1 nodal processing:
❍ check bit errors
❍ determine output link
A
B
propagation transmission
nodal processing queueing
❒ 2 queueing
❍ time waiting at output link for transmission
❍ depends on congestion level of router
Trang 53nodal processing queueing
❒ 2 x p hàng (queueing) ế
❍ th i gian ch đ i đ đ c ờ ờ ợ ể ượ truy n đi t i các liên k t đ u ề ạ ế ầ ra
❍ tùy thu c vào m c đ t c ộ ứ ộ ắ ngh n c a các router ẽ ủ
Trang 54The Physic Layer 54
Delay in packet-switched networks
3 Transmission delay:
❒ R=link bandwidth (bps)
❒ L=packet length (bits)
❒ time to send bits into
link = L/R
4 Propagation delay:
❒ d = length of physical link
❒ s = propagation speed in medium (~2x108 m/sec)
❒ propagation delay = d/s
A
B
propagation transmission
nodal processing queueing
Note: s and R are very
different quantities!
Trang 55Đ tr trong m ng chuy n m ch gói ộ ễ ạ ể ạ
Chú ý: s và R là hai đ i ạ
l ng hoàn toàn khác ượnhau!
Trang 56The Physic Layer 56
Caravan analogy
❒ Cars “propagate” at
100 km/hr
❒ Toll booth takes 12 sec to
service a car (transmission
time)
❒ car~bit; caravan ~ packet
❒ Q: How long until caravan is
lined up before 2nd toll
booth?
❒ Time to “push” entire caravan through toll booth onto highway = 12*10 = 120 sec
❒ Time for last car to propagate from 1st to 2nd toll both: 100km/
(100km/hr)= 1 hr
❒ A: 62 minutes
toll booth
toll booth
ten-car caravan
Trang 57Caravan analogy (more)
❒ Cars now “propagate” at
1000 km/hr
❒ Toll booth now takes 1 min
to service a car
❒ Q: Will cars arrive to 2nd
booth before all cars
serviced at 1st booth?
❒ Yes! After 7 min, 1st car
at 2nd booth and 3 cars still at 1st booth
❒ 1st bit of packet can arrive
at 2nd router before packet is fully transmitted
at 1st router!
toll booth
toll booth
ten-car caravan
Trang 58The Physic Layer 58
Nodal delay
❒ dproc = processing delay
❍ typically a few microsecs or less
❒ dqueue = queuing delay
❍ depends on congestion
❒ dtrans = transmission delay
❍ = L/R, significant for low-speed links
❒ dprop = propagation delay
❍ a few microsecs to hundreds of msecs
prop trans
queue proc
nodal d d d d
Trang 59Queueing delay (revisited)
❒ R=link bandwidth (bps)
❒ L=packet length (bits)
❒ a=average packet
arrival rate
traffic intensity = La/R
❒ La/R ~ 0: average queueing delay small
❒ La/R -> 1: delays become large
❒ La/R > 1: more “work” arriving than can be
serviced, average delay infinite!
Trang 60The Physic Layer 60
Packet loss
❒ queue preceding link in buffer has finite capacity
❒ when packet arrives to full queue, packet is
dropped (lost)
❒ lost packet may be retransmitted by previous
node, by source end system, or not retransmitted
at all
Trang 61S m t gói tin ự ấ
❒ Dung l ng vùng đ m c a hàng đ i là gi i h nượ ệ ủ ợ ớ ạ
❒ Khi các gói tin đ n nh ng hàng đ i đ y, chúng s b ế ư ợ ầ ẽ ị
b (dropped)ỏ
❒ Các gói b m t có th đ c truy n l i b i nút li n ị ấ ể ượ ề ạ ở ề
tr c, b i ngu n g i, ho c không đ c truy n l i ướ ở ồ ử ặ ượ ề ạ
gì c ả