งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

Week 1: Introduction Review 1: Data Communications

งานนำเสนอที่คล้ายกัน


งานนำเสนอเรื่อง: "Week 1: Introduction Review 1: Data Communications"— ใบสำเนางานนำเสนอ:

1 Week 1: Introduction Review 1: Data Communications
CPE 426 Computer Networks Week 1: Introduction Review 1: Data Communications

2 Course Outlines ดูใน Sheet สามารถ Download ได้

3 TOPICS 1. Communication/NW Model
Ch 2. Communication Protocols OSI and TCP/IP Ch 3. Communication/NW Topology Ch. 13.8

4 TOPICS 4. Signal/Power/Loss 5. Data Coding(Line Coding)
Ch 5. Data Coding(Line Coding) Ch 6. Trasmission Media/Noise/Channel Capacity Ch &

5 TOPICS 7. Multiplexing & DSL 8. Asynchronous Communication

6 TOPICS 10. Flow Control/Error Control/ARQ
Ch 11. Circuit vs Packet Switching NW Ch % ALSO Reference From CPE 326 (Stalling Book)

7 การสื่อสาร ประกอบด้วย 2 Entity
Sender = Source ผู้ส่ง หรือแหล่งกำเนิดข้อมูล Destination ผู้รับ หรือ ปลายทางข้อมูล Transmitter Receiver DATA Signal = สัญญาณ DATA Transmission Medium

8 ผู้รับ หรือ ปลายทางข้อมูล
Data comm.Model มี 5 ส่วน Sender = Source ผู้ส่ง หรือแหล่งกำเนิดข้อมูล Destination ผู้รับ หรือ ปลายทางข้อมูล Transmitter Receiver DATA Signal = สัญญาณ DATA ABC… ABC… 01011… 01011… ADC… Transmission Medium Plus Error File: ABCD…  Data Coding/Compression (ASCII, EBCDIC/ZIP) …. Wire/Wireless Loss and Noise Decodine/Demodulation Demultiplexing Line Coding/Modulation Plus Multiplexing

9 ASCII Code American Standard Code for Information Interchange
ASCII includes definitions for 128 characters: 33 are non-printing control characters (now mostly obsolete) that affect how text and space is processed; 94 are printable characters, and the space is considered an invisible graphic. The most commonly used character encoding on the World Wide Web was US-ASCII until December 2007, when it was surpassed by UTF-8

10 Mode ของการสื่อสาร Data Communication Model ที่กล่าวถึงใช้สำหรับการสื่อสารสองคน ถ้ามีวงจรรับและส่งแยกจากกัน โดยใช้ Transmission Medium คนละตัว Simplex ถ้าใช้ Transmission อันเดียวกัน Duplex ถ้าสื่อสารสองทางได้พร้อมกัน Full-Duplex ถ้าสื่อสารสองทางไม่พร้อมกัน Half-Duplex

11 Simplex บางครั้งเรียก 4-wire Duplex
Destination Source Tx Rx Transmission Medium Source Destination Rx Tx Transmission Medium

12 Duplex Destination Source Tx Rx Source Destination Rx Tx
Transmission Medium Half-Duplex Destination Source Tx/Rx Tx/Rx Source Destination Transmission Medium Full-Duplex

13 ถ้าเราต้องการสื่อสารมากกว่า 2 คน
ใช้วงจร(Duplex)ดังกล่าวตามจำนวนคู่ของการสื่อสาร = Full Mesh Topology B C จำนวนวงจร = n(n-1)/2 =O(n2) A D ราคาแพงมากถ้า n มีค่าสูง = O(n2) F E Topology ในภาษา Network คือรูปแบบการเชื่อมต่อของอุปกรณ์ต่างๆเข้าด้วยกัน

14 วิธีแก้คือ Share Medium และทำ Multiple Access Control
ใน LAN จะใช้ Topology 3 แบบที่สำคัญ Bus (และ Tree), Ring, Star hub

15 วิธีแก้คือ Share Medium และทำ Multiple Access Control
ใน WAN มักจะเป็น Partial Mesh Medium จัดได้ว่าเป็น Statistical Time Division Multiplexing แบบหนึ่ง Intermediate Node = Switching/Routing Node C A D B End Node E H F G

16 การ Share Medium ต้องมีการควบคุม = Medium Access Control
End Node จะต้องมีการกำหนดชื่อหรือ Address สำหรับอ้างอิง หรือกำหนด Circuit Number Intermediate Node จะใช้หมายเลขอ้างอิงดังกล่าวในการตัดสินใจส่งข้อมูลต่อออกไป(Forwarding) ดังนั้น 1. Data ที่ส่งจะต้องแปะส่วนหัว (Header) ด้วยข้อมูลต่างๆของ Address และการ Control เราเรียกว่าเป็นการทำ Encapsulation ผลลัพธ์ที่ได้เรียกว่า Frame 2. ที่ส่วนท้ายของ Frame จะมีการต่อด้วยข้อมูลช่วยตรวจจับความผิดพลาด (Error Detection) มักจะเป็น CRC Code เรียก Frame Check Sequence(FCS) 3. ก่อนหน้าส่วน Header และหลัง FCS อาจจะมีการเติมบิตสำหรับช่วยตรวจจับหัวและท้ายของ Frame (Frame Delimiter: Pre-amble/Post-amble) 4. สำคัญที่สุดต้องมีการกำหนดกฎเกณฑ์ต่างๆเหล่านี้ให้เป็นมาตรฐาน คือกำหนดเป็น Protocol ของการสื่อสาร

17 LAN vs WAN Technologies
LAN มักจะใช้การ Share Medium แบบ Contention ดังนั้นจะต้องมีขบวนการควบคุมการทำ Multiple Access Topology ที่เหมาะสมคือ Bus, Ring, Star WAN จะ Share Medium เช่นกัน แต่มักจะใช้วิธีของ Synchronous Multiplexing (TDM) ใน Circuit Switching Networkหรือ Statistical Multiplexing (ใช้ใน Packet Switching Network) Topology ที่เหมาะสมคือ Mesh Network และมักจะเป็น Partial Mesh Internetworking Technologies มักจะถูกใช้ในการเชื่อมต่อระหว่าง LAN ผ่าน WAN Network ที่นิยมคือ Internet (IP Network)

18 Protocol and Protocol Architecture
ถ้ากำหนดเป็นมาตรฐาน หรือ Standard การสื่อสารจะทำได้ง่ายระหว่างอุปกรณ์ที่ต่างกัน ประกอบด้วย Syntax Data formats = รูปแบบของข้อมูล, เฟรม, การเข้ารหัส Signal levels=ลักษณะของสัญญาณที่แทนข้อมูล Semantics Control information=การควบคุมการสื่อสาร Error handling=การจัดการกับ Error Timing Speed matching=กำหนดอัตราการส่ง Sequencing=กำหนดลำดับของข้อมูล

19 Protocol Architecture (Protocol Stack)
เนื่องจากการสื่อสารเป็นเรื่องที่สลับซับซ้อน เราแบ่งการสื่อสารทั้งหมดออกเป็น Module แต่ละ Module มีหน้าที่เฉพาะของมัน แต่ละ Module จะมีการสื่อสารระหว่าง Module อื่น แต่ละ Module มี Protocol กำกับ ปกติจะแบ่งเป็นลำดับชั้น เรียก Protocol Stack หรือ Protocol Architecture

20 Protocol Architecture (Protocol Stack)
7 Layer OSI Reference Model ของ ISO ปัจจุบันไม่ได้ใช้งานจริง แต่ใช้เป็น Reference TCP/IP Protocol Suite (มี 5 ชั้น) การสื่อสารเกือบจะทั้งหมด มาตรฐานของ Internet

21 7 Layer OSI Reference Model

22 7 Layer Layer 1: Physical Layer Layer 2: Data Link Layer
ทำหน้าที่เชื่อมต่อผ่าน Physical Medium รับผิดชอบแปลงบิตเป็นสัญญาณ เรื่องของการ Interface, สายนำสัญญาณ ,มองเห็นข้อมูลในลักษณะ Bit Stream Layer 2: Data Link Layer ประกอบข้อมูลเป็น Frame, รับผิดชอบในการสื่อสารผ่าน แต่ละ Link ทำ Error Control, Flow Control ผ่าน Link Layer 3: Network Layer รับผิดชอบในการส่งข้อมูลผ่าน Network, หาทิศทางข้อมูล, เชื่อมต่อกับ Layer บนเข้ากับ Network หลายๆแบบ มองเห็นข้อมูลในลักษณะ Packet

23 7 Layer Layer 4: Transport Layer Layer 5: Session Layer
รับผิดชอบการส่งข้อมูลให้ถูกต้องจากต้นทางถึงปลายทาง(End-to-End), จัดการในเรื่อง Error และ Flow Control ในระดับต้นทางถึงปลายทาง ข้อมูลที่ส่งจะถูกแบ่งเป็น Segment Layer 5: Session Layer ทำหน้าที่จัดตั้ง ดูแล การเชื่อมต่อ(Connection) ระหว่าง Applicationต้นทางและปลายทาง แบ่งการเชื่อมต่อสื่อสารออกเป็น Session

24 7 Layer Layer 6: Presentation Layer Layer 7: Application Layer
รับผิดชอบในเรื่องรูปแบบและ Format ของข้อมูล การทำ Encryption รวมถึงการทำ Data Compression ให้อยู่ในรูปแบบที่สื่อสารได้ Layer 7: Application Layer ทำหน้าที่เชื่อมต่อกับ Application และผู้ใช้

25 OSI Environment

26 การเชื่อมต่อผ่าน Router

27 TCP/IP Protocol Architecture
Developed by the US Defense Advanced Research Project Agency (DARPA) for its packet switched network (ARPANET) Used by the global Internet No official model but a working one. Application layer Host to host or transport layer Internet layer Network access layer Physical layer

28 TCP/IP Protocol Architecture
Application INTERNET Transport Layer Internet Layer Network Access Physical

29 Physical Layer Physical interface between data transmission device (e.g. computer) and transmission medium or network Characteristics of transmission medium Signal levels Data rates etc.

30 Network Access Layer Exchange of data between end system and network
Destination address provision Invoking services like priority ปกติมาตรฐานของ TCP/IP จะไม่ครอบคลุมถึง Layer 1-2 ทั่วไปเรานำ TCP/IP เป็น WAN และวางบน LAN คือ Ethernet

31 Internet Layer (IP) Systems may be attached to different networks
Routing functions across multiple networks Implemented in end systems and routers คือ IP Protocol มีการทำงานแบบ Datagram

32 Transport Layer (TCP) Reliable delivery of data Ordering of delivery
ที่สำคัญมี 2 Protocol TCP = Transport Control Protocol Connection Oriented Guarantee Delivery UDP = User Datagram Protocol Connectionless Best Effort

33 Application Layer Support for user applications e.g. http, SMPT

34 TCP/IP VS OSI Application Software NOS = Window NIC + Driver
Physical Link

35 รูปแบบการเชื่อมต่อด้วย TCP/IP

36 Addressing ใน TCP/IP TCP Port หรือ UDP Port = 16 Bit
IP Address, IPv4 = 32 Bit หมายเลขเครื่อง และหมายเลข Network Physical Hardware Address ถ้าใช้ TCP/IP บน Ethernet LAN อันนี้คือ Address ของ NIC หรือ MAC Address = 48 Bit

37 PDU = Protocol Data Unit
TCP Segment IP Packet / IP Datagram Frame

38 Protocol ที่สำคัญของ TCP/IP

39 Standard LAN: WAN TCP/IP IEEE 802 Ethernet IEEE 802.3 มีย่อยอีกหลายตัว
WLAN IEEE , b, g, n,802.11i PAN-Bluetooth IEEE WAN มีหลายตัว ที่สำคัญมักจะถูกดูแลโดย OSI (ITU) TCP/IP RFC = Request for Comments มีประมาณ 4000 RFCs

40 Physical Layer Basics Signal, Power, Noise
Bandwidth ที่ใช้ในการสื่อสาร Channel Capacity NyQuist Shannon SNR, Eb/No BER

41 Signal, Power และ Loss ข้อมูลจะต้องเปลี่ยนให้อยู่ในรูปแบบทางฟิสิกค์ที่สามารถส่งผ่าน Medium ได้ Medium Copper Wire = Electrical Signal Medium Air/Vacuum = Radio Signal or Microwave or LASER Medium Fiber Optic = Light or LASER ระยะทางที่สามารถส่งได้ขึ้นอยู่กับกำลังของสัญญาณ(dBW, dBm) อัตราการส่งข้อมูลจะขึ้นกับค่า SNR(dB) หรือค่า Eb/No(dB)

42 ทำไมต้องใช้หน่วย Decibel
กำลัง (W) คำนวณค่า Power ที่จุดต่างๆ ยาก ระยะทาง กำลัง (dBW) คำนวณจากสมการเส้นตรง คือใช้บัญญัติไตรยางค์ ระยะทาง

43 การคำนวณ แปลง dB: P(dBW) = 10log(P(W)) P(dBm) = 10log(P(mW)) กำหนด Power ที่ต้นทาง และอัตราค่า Loss(dB) ของ Medium สามารถหา Power ที่จุดใดๆใน Medium ได้จาก Power (dB) = Power ต้นทาง(dB)- Loss ใน Medium (dB) แปลง dB กลับเป็นค่า Power(Absolute) โดยใช้ Inverse Log หน่วย dB ของ Power จะมี dBW และ dBm หน่วย dB ของ Loss/Gain จะเป็น dB เท่านั้น ถ้ามีการขยาย หรือ Gain จะนำค่า Gain (dB) ไปบวกกับค่า Power (dB)

44 ตัวอย่าง สัญญาณ 5 W ส่งไปในสายที่มีค่า Loss 4 dB ต่อ 100 เมตร จงหาค่าสัญญาณในสายที่จุด 750 เมตร Power ต้นทาง = 10log5 = dBW Loss ในสายเท่ากับ 4x750/100 = 30 dB สัญญาณที่จุด 750 เมตร = = dBW แปลงกลับเป็นหน่วย Watt : P(W) = 10( /10) = 5x10-3 W = 5mW

45 Exercise ไปคิดเอง จงหาค่า Power ที่ปลายสาย 620 m 1.5 km 480 m 6W P=?W
Gain = 50 dB Gain = 45 dB 620 m 1.5 km 480 m 6W P=?W Loss = 3 dB/100 m Loss = 4 dB/100 m Loss = 3 dB/100 m

46 Transmission Impairment
เป็นตัวขัดขวางการส่งสัญญาณ Attenuation (Loss) Distortion Delay Distortion Noise Crosstalk Thermal Noise Shot Noise Noise from Environment

47 Delay Distortion Only in guided media
Propagation velocity varies with frequency

48 Noise (1) Additional signals inserted between transmitter and receiver
Thermal Due to thermal agitation of electrons Uniformly distributed White noise Intermodulation Signals that are the sum and difference of original frequencies sharing a medium

49 Noise (2) Crosstalk Impulse
A signal from one line is picked up by another Impulse Irregular pulses or spikes e.g. External electromagnetic interference Short duration High amplitude

50 Thermal Noise, Thermal Equivalent, Effective Noise Temperature
เกิดจากการสั่นของ Molecule(Electron, Proton) เป็นคลื่นแม่เหล็กไฟฟ้ารบกวน สสารที่อุณหภูมิสูงกว่า ศูนย์องศาสมบูรณ์(0 degree Kelvin = degree Celcius), แปรผันโดยตรง เป็น White Noise, Gaussian Noise ดังนั้น Noise Power Density, เนื่องจากเป็น White Noise, จะมี Density เท่ากันทุกความถี่ แต่ Noise จะถูกจำกัดที่ Bandwidth ของระบบเช่นกัน ดังนั้น Noise Power, Ex. ที่ Room Temp.(25 C)

51 Channel Capacity Data rate Bandwidth
In bits per second Rate at which data can be communicated Bandwidth In cycles per second of Hertz Constrained by transmitter and medium NyQuist Bandwidth and Shannon Channel Capacity

52 NyQuist Bandwidth If rate of signal transmission is 2B then signal with frequencies no greater than B is sufficient to carry signal rate Given bandwidth B, highest signal rate is 2B Given binary signal, data rate supported by B Hz is 2B bps Can be increased by using M signal levels C = 2B for Binary Signal(M=2), Baud Rate=Bit Rate C= 2B log2M ( M-ary Signal ), Baud Rate = R/log2M In case of No Noise C can be increased by increasing M

53 Shannon Capacity Formula
Consider data rate, noise and error rate Faster data rate shortens each bit so burst of noise affects more bits At given noise level, high data rate means higher error rate Signal to noise ratio (in decibels, dB) SNRdb=10 log10 (signal power/noise power) Capacity C=B log2(1+SNR), Shannon channel capacity, SNR is not in dB This is error free capacity

54 Digital data rate and error rate
ในระบบ Analog Communication ที่เราสนใจคือ SNR เพราะแสดงถึงคุณภาพของสัญญาณ ในระบบ Digital Communication เราสนใจ Data Rate ที่ส่งได้ และ Error Rate ที่เกิดขึ้น เพราะมีผลต่อประสิทธิภาพของระบบ ดังนั้น SNR จะไม่บอกทั้งหมดใน Digital System เราต้องหาตัววัดตัวอื่น ที่ใช้คือ Energy Per Bit/ Noise Energy(Eb/No) ค่านี้ สัมพันธ์กับ BER(Bit Error Rate) ในแต่ละระบบ B เท่าเดิม แต่เพิ่ม R เราเพิ่ม Bandwidth Efficiency แต่จะลด Eb/No ทำให้ BER เพิ่มขึ้น

55 BER and Eb/No

56 สรุปสูตรการคำนวณ Power in dBw = Power in dBm =
Signal-to-Noise Ratio = power of signal/power of noise SNR(dB)= NyQuist Rate, Shannon Channel Capacity, Thermal Noise(Thermal Equivalent) Noise Energy, Noise Power,

57 Examples (ให้อ่านเอง)
1. เครื่องรับมีค่า Effective Noise Temperature เท่ากับ 100 องศาเคลวิน และมี Bandwidth = 10 MHz จงคำนวณหาค่า Thermal Noise เป็น dBW 2. ระบบการสื่อสารกระทำที่ Spectrum ระหว่าง 3 MHz และ 4 MHz และมีค่า SNR 24 dB จงหาว่าระบบนี้สามารถส่ง Data ในอัตราได้สูงที่สุดเท่าไร และในกรณีนี้ต้องส่งสัญญาณเป็นกี่ระดับ 3. ในระบบ BPSK(Binary Phase Shift Keying) ต้องการค่า Eb/No ไม่ต่ำกว่า 8.4 dB เพื่อให้ค่า BER อยู่ต่ำกว่า 1/10000 ถ้าค่า Effective Noise Temperature ของระบบเท่ากับ 290 K และ Data Rate ที่ส่งเท่ากับ 2400 bps จงคำนวณหาระดับของสัญญาณที่ต้องการที่เครื่องรับ

58 Example 1 1. เครื่องรับมีค่า Effective Noise Temperature เท่ากับ 100 องศาเคลวิน และมี Bandwidth = 10 MHz จงคำนวณหาค่า Thermal Noise เป็น dBW

59 Example 2 2. ระบบการสื่อสารกระทำที่ Spectrum ระหว่าง 3 MHz และ 4 MHz และมีค่า SNR 24 dB จงหาว่าระบบนี้สามารถส่ง Data ในอัตราได้สูงที่สุดเท่าไร และในกรณีนี้ต้องส่งสัญญาณเป็นกี่ระดับ Shannon Channel Capacity, B=1 MHz, a) ดังนั้น จาก เราได้ b)

60 Examples 3. ในระบบ BPSK(Binary Phase Shift Keying) ต้องการค่า Eb/No ไม่ต่ำกว่า 8.4 dB เพื่อให้ค่า BER อยู่ต่ำกว่า 1/10000 ถ้าค่า Effective Noise Temperature ของระบบเท่ากับ 290 K และ Data Rate ที่ส่งเท่ากับ 2400 bps จงคำนวณหาระดับของสัญญาณที่ต้องการที่เครื่องรับ

61 Line Coding การส่ง Pulse เพื่อที่จะแทน Data แต่ละบิต ข้อควรคำนึง
Pulse 2 ระดับ = Binary Signal M-ary Signal จะใช้ M ระดับ ข้อควรคำนึง Average DC เป็นศูนย์หรือไม่ Signal Transition มากเพียงพอ

62 NRZ

63 Biphase

64 Biphase Manchester Transition in middle of each bit period
Transition serves as clock and data Low to high represents one (ที่กึ่งกลาง Bit) High to low represents zero (ที่กึ่งกลาง Bit) Used by IEEE 802.3(Ethernet = 10 Mbps) Differential Manchester Midbit 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(Token Ring)

65 Bipolar-AMI+Scrambling

66 Scrambling; B8ZS vs HDB3 High Density Bipolar 3 Zeros
Bipolar With 8 Zeros Substitution Based on bipolar-AMI If octet of all zeros and last voltage pulse preceding was positive, encode as If octet of all zeros and last voltage pulse preceding was negative, encode as Causes two violations of AMI code Unlikely to occur as a result of noise Receiver detects and interprets as octet of all zeros High Density Bipolar 3 Zeros String of four zeros replaced with one or two pulses Voltage ก่อนหน้า จำนวน ‘1’ คี่ จำนวน ‘1’ คู่ - 000- +00+ + 000+ -00-

67 Multiplexing เป็นวิธีการที่จะสามารถส่งสัญญาณได้หลายคู่บน Transmission Medium เดียวกัน FDM = Frequency Division Multiplexing สัญญาณแต่ละคู่ใน Bandwidth (ช่วงความถี่) ต่างกัน TDM = Time Division Multiplexing สัญญาณแต่ละคู่ส่งที่เวลาต่างกัน แบ่งเป็น Synchronous TDM: แบ่งเวลาเป็น Channel ตามจำนวนคู่ คู่หนึ่งจะใช้ Channel เบอร์ที่กำหนดเท่านั้น Statistical TDM แบ่งเป็น Channel เช่นกัน แต่ไม่กำหนด คู่ใดต้องการส่งข้อมูลให้จอง Channel เพื่อส่ง ดังนั้นในการส่งข้อมูลครั้งหนึ่งๆ อาจจะใช้ Channel แตกต่างกัน

68 FDM vs TDM

69 Statistical TDM Frame Formats

70 Asymmetrical Digital Subscriber Line
ADSL Link between subscriber and network Local loop Uses currently installed twisted pair cable Can carry broader spectrum 1 MHz or more

71 ADSL Design Asymmetric Frequency division multiplexing Range 5.5km
Greater capacity downstream than upstream Frequency division multiplexing Lowest 25kHz for voice Plain old telephone service (POTS) Use echo cancellation or FDM to give two bands Use FDM within bands Range 5.5km

72 ADSL Channel Configuration

73 Discrete Multitone 15.36MHz
DMT Multiple carrier signals at different frequencies Some bits on each channel 4kHz subchannels Send test signal and use subchannels with better signal to noise ratio 256 downstream subchannels at 4kHz (60kbps) 15.36MHz Impairments bring this down to 1.5Mbps to 9Mbps

74 DTM Bits Per Channel Allocation

75 Mode ของการส่งข้อมูล Digital
Timing problems require a mechanism to synchronize the transmitter and receiver Two solutions Asynchronous Synchronous

76 Asynchronous Communicaton
Data transmitted on character at a time 5 to 8 bits Timing only needs maintaining within each character Resynchronize with each character

77 Asynchronous (diagram)

78 Asynchronous - Behavior
In a steady stream, interval between characters is uniform (length of stop element) In idle state, receiver looks for transition 1 to 0 Then samples next seven intervals (char length) Then looks for next 1 to 0 for next char Simple Cheap Overhead of 2 or 3 bits per char (~20%) Good for data with large gaps (keyboard)

79 Data Communications Interfacing

80 Characteristics of Interface
Mechanical Connection plugs Electrical Voltage, timing, encoding Functional Data, control, timing, grounding Procedural Sequence of events

81 V.24/EIA-232-F ITU-T v.24 Only specifies functional and procedural
References other standards for electrical and mechanical EIA-232-F (USA) RS-232 Mechanical ISO 2110 Electrical v.28 Functional v.24 Procedural v.24

82 Mechanical Specification

83 Electrical Specification
Digital signals Values interpreted as data or control, depending on circuit Less than -3v is binary 1, more than +3v is binary 0 (NRZ-L) Signal rate < 20kbps Distance <15m For control, Less than-3v is off, +3v is on

84 3-wire and 5-wire RS-232 A minimal "3-wire" RS-232 connection consisting only of transmit data, receive data, and ground, is commonly used when the full facilities of RS-232 are not required. Even a two-wire connection (data and ground) can be used if the data flow is one way (for example, a digital postal scale that periodically sends a weight reading, or a GPS receiver that periodically sends position, if no configuration via RS-232 is necessary). When only hardware flow control is required in addition to two-way data, the RTS and CTS lines are added in a 5-wire version.

85 Null Modem: DTE to DTE RS-232-C Null Modem Cable (for Terminal/PC with 25-pin Connector) RS-232-C Null Modem Cable (for Terminal/PC with 9-pin Connector)

86 Null Modem

87 With Loop-Back Handshaking With Partial Handshaking
Summary Null Modem Simple Null Modem without Handshaking Null Modem With Loop-Back Handshaking Null Modem With Partial Handshaking Null Modem With Full Handshaking

88 Synchronous - Bit Level
Block of data transmitted without start or stop bits Clocks must be synchronized Can use separate clock line Good over short distances Subject to impairments Embed clock signal in data Manchester encoding Carrier frequency (analog)

89 Synchronous - Block Level
Need to indicate start and end of block Use preamble and postamble e.g. series of SYN (hex 16) characters e.g. block of patterns ending in More efficient (lower overhead) than async

90 Synchronous (diagram)

91 Flow Control/Error Control
เราควบคุมการใหลข้อมูลเพื่อไม่ให้ผู้ส่ง ส่งข้อมูลเกินกว่าผู้รับจะรับได้ เมื่อส่งข้อมูลแล้ว ให้รอสัญญาณพร้อมที่จะรับข้อมูลอันต่อไปจากผู้รับ ปกติ Mechanism นี้จะใช้ร่วมกับ Error Control โดยเมื่อมี Error จะใช้วิธีการ Retransmission เราเรียกรวมว่า ARQ = Automatic Repeat Request

92 Model of Frame Transmission

93 Stop and Wait Flow Control
Efficiency = d/T x 100%

94 Sliding Window Diagram

95 Example Sliding Window

96 Stop and Wait - Diagram แต่ละ Frame ที่ส่ง กำหนด Timer
Frame Sequence ใช้ 1 Bit สำหรับตรวจ Frame ซ้ำ ในทางปฎิบัติ การ Acknowledge จะใช้ Piggyback สำหรับใน Microprocessor อาจจะใช้สาย Ack แยกต่างหาก

97 ในทางปฎิบัติ การ Acknowledge จะใช้ Piggyback
Go Back N - Diagram แต่ละ Frame ที่ส่ง กำหนด Timer ขนาด Window สูงสุดไม่เกิน 2n-1 เมื่อมี Error ให้เริ่มส่งใหม่ตั้งแต่ Frame นั้น ในทางปฎิบัติ การ Acknowledge จะใช้ Piggyback

98 Selective Reject - Diagram
แต่ละ Frame ที่ส่ง กำหนด Timer ขนาด Window สูงสุดไม่เกิน 2n-1 เมื่อมี Error ส่งใหม่เฉพาะ Error Frame ในทางปฎิบัติ การ Acknowledge จะใช้ Piggyback

99 WAN WAN Public Network Network
การเชื่อมต่อปกติจะผ่าน Network ของผู้ให้บริการ หรือ Service Provider เราไม่ได้เป็นเจ้าของ เป็นลักษณะการเช่า จ่ายตามจำนวนที่ใช้ เวลา/จำนวนข้อมูล ระยะทางไกลกว่า Technologies ที่ใช้ในการเชื่อมต่อ แตกต่างกัน Network Circuit Switching Network Packet Switching Network

100 Circuit Switching Network
สำหรับเครือข่ายโทรศัพท์ ลักษณะข้อมูลและสัญญาณเป็น Real-Time ยอมให้มี Error ได้บ้าง ค่า Delay และ Delay Variation จะถูกจำกัดไม่ให้เกินค่าที่กำหนด ดังนั้นเพื่อให้ NW สามารถรองรับความต้องการได้ ทั้งผู้ส่งและผู้รับจะต้องมีวงจรเชื่อมต่อ (Circuit) ที่เป็นส่วนตัว จะใช้ร่วมกันไม่ได้ = Dedicate Circuit อย่างไรก็ตาม เพื่อประหยัด Resource ตัววงจรดังกล่าวจะแบ่งกันใช้ ถ้าผู้ใดไม่ใช้สามารถให้คนอื่นใช้ได้ และการใช้ต้องมีการจอง

101 Circuit Switching Network
อย่างไรก็ตาม เพื่อประหยัด Resource ตัววงจรดังกล่าวจะแบ่งกันใช้ ถ้าผู้ใดไม่ใช้สามารถให้คนอื่นใช้ได้ และการใช้ต้องมีการจอง ดังนั้นการใช้งานจะแบ่งเป็น 3 Phase 1. Connection เพื่อขอ Circuit โดยการหมุนเลขหมายไปยังปลายทาง ตัว Network จะหาทิศทาง กำหนดว่าใช้ Link ไหน และผ่าน Node = Switch อะไรบ้าง ถ้าทิศทางว่าง และผู้รับทำการรับสาย วงจรนั้นจะถูกจองไว้ 2. Data Transfer ในกรณีโทรศัพท์คือเสียง 3. Disconnection เมื่อไม่ใช้แล้ว ส่วน Resource ต่างๆที่ถูกจองไว้จะถูกส่งคืน และ Network สามารถนำไปให้ผู้อื่นใช้ได้

102 Simple Switched Network

103 Simple Switched Network

104 Simple Switched Network

105 Simple Switched Network

106 Simple Switched Network

107 Simple Switched Network
BLOCKING

108 Simple Switched Network
B  D Finish BLOCKING

109 Simple Switched Network
B  D Finish BLOCKING

110 Simple Switched Network
B  D Finish

111 Public Circuit Switched Network
ลักษณะการทำงานของตัว Switching ใน Circuit Switching Network

112 Circuit Switch เมื่อนำมาส่ง Data
ผ่านอุปกรณ์ MODEM = Modulator/Demodulator พฤติกรรมการส่งข้อมูลปกติจะเป็น Burst คือนานๆจะส่ง แต่เมื่อส่งจะส่งข้อมูลทีละมากๆ การดู WEB Page เรา Load Web ในช่วงเวลาสั้นๆ ถ้า Page มีขนาดใหญ่ ข้อมูลจำนวนมากจะถูกส่งในเวลาสั้นๆนั้น เราอ่าน Web Page เราไม่ได้ใช้ Network Bandwidth ปกติเราจะใช้เวลาอ่านนานกว่าการ Load Circuit ที่จองไว้ เวลาส่วนใหญ่จะเสียไป ไม่ได้ใช้งาน แต่คนอื่นใช้ไม่ได้ ประสิทธิภาพจะต่ำ

113 Circuit Switch ใช้สำหรับการเชื่อมต่อระหว่าง Site ที่ไม่ต้องการส่งข้อมูลแบบ Real-Time แบบ Off Line เช่นการเชื่อมต่อระหว่างสาขา และส่งยอดขายประจำวันมายังสำนักงานใหญ่ วันละ 1 ครั้ง เมื่อจะส่ง ต่อ Modem ผ่านสายโทรศัพท์ ส่งข้อมูล หยุดการติดต่อ ราคาถูก จ่ายค่าโทรศัพท์ทางไกล ในเวลาสั้นๆ ปัจจุบัน Internet ราคาไม่แพง และต่อ Online ได้ ดังนั้นวิธีนี้นับวันจะหมดไป

114 Example Huahin Chiang Mai เครือข่ายโทรศัพท์ Bangkok Koraj Modem Modem

115 Packet Switching Network
Circuit Switching ไม่เหมาะสมสำหรับการส่งข้อมูล เราใช้ Packet Switching ข้อมูลจะถูกตัดเป็น Packet ส่งออกไป ในหนึ่ง Circuit สามารถแชร์กันได้หลายคน ทำให้ประสิทธิภาพสูงกว่า Online จะใช้สามารถใช้ได้ทันที ไม่ถูก Block ประสิทธิภาพสูงกว่า ถ้าเรา Share กันเพียง Circuit เดียว เมื่อผู้ใดไม่ส่ง คนอื่นส่งได้ ถ้าส่งพร้อมกันหลายคนก็ทำได้ แต่ละคนจะใช้เวลาในการส่งมากขึ้น เรียกว่าเกิด Delay หลายข้อมูล ของหลายคนใช้ Circuit เดียว แต่ละคนคิดว่าตัวเองเป็นเจ้าของ Circuit คนเดียว = Transparency อย่างไรก็ตามข้อมูลจริงๆ วิ่งอยู่บน Circuit เดียวกัน ต้องมีวิธีบ่งบอก Address ผู้ส่งและผู้รับ แปะที่ส่วน Header ของข้อมูล หรือ ใช้ Virtual Circuit Number สำหรับแต่ละคน และแปะที่ส่วนหัวข้อมูล

116 Packet Switching Network
เนื่องจากต้อง Share วงจรกัน เพื่อป้องกันไม่ให้ผู้ใดผู้หนึ่งผูกขาดการใช้งาน ต้องกำหนดขนาดข้อมูลสูงสุดที่ผู้ส่ง ส่งได้ในแต่ละครั้ง = MTU, Maximum Transfer Unit ถ้าข้อมูลใหญ่กว่านั้น ต้องแบ่ง หรือตัดข้อมูลเป็น Packet ย่อยๆ แต่ละ Packet มีส่วนหัว นอกเหนือจาก Address/VC แล้ว จะต้องมี Sequence Number บ่งบอกลำดับของข้อมูล กระทำโดย Protocol ผู้ใช้ (Application) ไม่ต้องทำ นี่คือ Packet Switching Network

117 Packet Switched Network

118 Packet Switched Network

119 Packet Switched Network

120 Packet Switched Network

121 Advantages Line efficiency Data rate conversion
แต่ละ Link สามารถจะ Share กันได้ Packets ที่เข้ามาแต่ละ Node จะถูกเข้า Queue เพื่อส่งออกไป Data rate conversion Each station เชื่อมต่อกับ Local Node ด้วยความเร็วที่ตัวเองกำหนด Packets are accepted even when network is busy โดยเก็บไว้ใน Queue Delivery may slow down = Delay Priorities can be used

122 Packet Switching Network
2 Concepts กำหนดการทำงานใน Network (Switching Technique) Datagram Virtual Circuit 2 Concepts กำหนดการเชื่อมต่อกับผู้ใช้ภายนอก (User Interface, Network Service) Connection Oriented Connectionless

123 Switching Technique Station breaks long message into packets
Packets sent one at a time to the network Network จะจัดการ Packet สองแบบ (การทำงานของ Network = L3) Datagram Network รับข้อมูลจากผู้ใช้ได้โดยตรง และทำการส่งโดยดูจาก Address ปลายทางที่ส่วนหัวของข้อมูล ทิศทางของข้อมูลจะทำการหา เมื่อข้อมูลแต่ละ Packet ไปถึงในแต่ละ Node แต่ละ Packet อาจจะใช้ทิศทางไม่เหมือนกัน (Flexibility) Virtual circuit Network จะต้องทำ Connection หรือหาทิศทางก่อน โดยดูจาก Address ปลายทาง จากนั้นจะกำหนด Connection ด้วย Virtual Circuit Number, การส่งข้อมูลไม่ต้องกำหนด Address อีกต่อไป เพียงแต่อ้างอิงจาก Virtual Circuit Number ก็พอ ทุก Packet จะใช้ทิศทางเดียวกัน แม้ว่าไม่ Flexible เท่า Datagram แต่ข้อมูลจะส่งได้รวดเร็วกว่า เพราะการหาทิสทางทำครั้งเดียว เมื่อทำ Connection

124 Different Services of Network (Mostly Layer 4) เมื่อมองจากผู้ใช้
Connection Oriented Must perform connection to the network before sending data the result is a connection number to reference, reliable communication from end-to-end Connection Oriented on Virtual Circuit is used in packet switching network Connection Oriented on datagram is used in IP network (TCP/IP) Connectionless Do not guarantee delivery but fast and efficient for small data transmission Connectionless on VC ไม่พบการใช้งาน Connectionless on datagram is used in IP network (UDP/IP)

125 สรุป Packet Switching Network
2 Concepts กำหนดการทำงานใน Network(L3) Datagram Virtual Circuit 2 Concepts กำหนดการเชื่อมต่อกับผู้ใช้ภายนอก (ปกติจะอยู่ใน L4) Connection Oriented Connectionless

126 การทำงานของ Datagram Each packet treated independently
Packets can take any practical route Packets may arrive out of order Packets may go missing Up to receiver(ปลายทาง) to re-order packets and recover from missing packets สรุปแล้ว การทำงานของ Network ประเภทนี้จะไม่ Guarantee การส่งข้อมูล

127 Datagram Diagram

128 Virtual Circuit Preplanned route established before any packets sent เส้นทางจะถูกกำหนดในช่วงการ Connection Call request and call accept packets establish connection (handshake) กำหนด Connection ด้วยตัวเลข คือ VC Number Each packet contains a virtual circuit identifier instead of destination address No routing decisions required for each packet ดูจาก VC # ก็เพียงพอ Clear request to drop circuit เมื่อจบ Not a dedicated path แต่มองจากผู้ใช้เหมือน Circuit Switching

129 Virtual Circuit Diagram

130 Virtual Circuits vs Datagram
Network can provide sequencing and error control Packets are forwarded more quickly No routing decisions to make Less reliable Loss of a node looses all circuits through that node Datagram No call setup phase Better if few packets More flexible Routing can be used to avoid congested parts of the network

131 Circuit vs Packet Switching
Performance Propagation delay Transmission time Node delay

132 Event Timing เปรียบเทียบ 3 NW

133 HW1 Due Next Week ให้นักศึกษา Download HW 1, Week 1
ลงในกระดาษที่พิมพ์ ด้วยการเขียนเท่านั้น(ห้ามพิมพ์) และส่งต้นชั่วโมง สัปดาห์ถัดไป อย่าลืมใส่ชื่อ รหัส และ Section ในหน้าแรก

134 End of Week 1 End of Review Part I Next Week Review Part II
LAN and LAN Technologies


ดาวน์โหลด ppt Week 1: Introduction Review 1: Data Communications

งานนำเสนอที่คล้ายกัน


Ads by Google