Komunikasi Data dan Jaringan Komputer Bagian 2 Dr

Komunikasi Data dan Jaringan Komputer (Bagian 2) Dr. Tb. Maulana Kusuma mkusuma@staff. gunadarma. ac. id http: //staffsite. gunadarma. ac. id/mkusuma Magister Teknik Elektro 0

Review of OSI Networking Model Program X Data AH Data Application Presentation SH Data unit Transport TH Network Physical Application PH Data unit Session Data link Program Y NH LH Session Data unit Transport Data unit Network Data unit Bits LT Data link Physical transmission medium Magister Teknik Elektro 1

Data Link Layer Means of activating, maintaining and deactivating a reliable link Error detection and control Higher layers may assume error free transmission Magister Teknik Elektro 2

Introduction The PDU at the Data Link Layer (DL-PDU) is typically called a Frame. A Frame has a header, a data field, and a trailer Example: Magister Teknik Elektro 3

Framing Problem: Identify the beginning and the end of a frame in a bit stream Solution (bit-oriented Framing): A special bit pattern (flag) signals the beginning and the end of a frame (e. g. , "01111110") Problem: n The sequence '01111110' must not appear in the data of the frame Magister Teknik Elektro 4

Bit-oriented framing and bit stuffing 'Bit stuffing': If the sender detects five consecutive '1‘ it adds a '0' bit into the bit stream. The receiver removes the '0' from each occurrence of the sequence '111110' Note: The flags itself are not bit-stuffed. Magister Teknik Elektro 5

Flow control Flow Control is a technique for speed-matching of transmitter and receiver. Flow control ensures that a transmitting station does not overflow a receiving station with data We will discuss two protocols for flow control: n n Stop-and-Wait Protocol Sliding Window Protocol For the time being, we assume that we have a perfect channel between sender and receiver (no errors) Magister Teknik Elektro 6

Stop-and-wait flow control Simplest form of flow control In Stop-and-Wait flow control, the receiver indicates its readiness to receive data for each frame Operations: 1. Sender: Transmit a single frame 2. Receiver: Transmit acknowledgment (ACK) 3. Go to 1. Magister Teknik Elektro 7

Analysis of stop-and-wait Magister Teknik Elektro 8

Analysis of stop-and-wait Transmission delay is the time that the sender needs to transmit a frame Transmission delay is dependent on the size of a frame and the maximum data rate Example: Frame Size = 1000 bit Data rate of network = 1 Mbps Transmission delay = 1000 bit / 1 Mbps = 1 ms Magister Teknik Elektro 9

Analysis of stop-and-wait Propagation delay is the time that a transmitted bit needs to travel from sender to the receiver Propagation delay is only dependent on the speed of the transmission medium and the distance between sender and receiver. Speed of light: 300000 km/sec, Speed in guided media (approx. ): 200000 km/sec Example: Distance = 1000 km Propagation delay = 1000 km / (200000 km/sec) = 5 ms Magister Teknik Elektro 10

Sliding window flow control Major Drawback of Stop-and-Wait Flow Control: n Only one frame can be in transmission at a time Sliding Window Flow Control n n n Allows transmission of multiple frames Assigns each frame a k-bit sequence number Range of sequence number is [0. . 2 k-1], i. e. , frames are counted modulo 2 k Magister Teknik Elektro 11

Operation of sliding window Sending Window: n n At any instant, the sender is permitted to send frames with sequence numbers in a certain range The range of sequence numbers is called the sending window Magister Teknik Elektro 12

Operation of sliding window Receiving Window: n The receiver maintains a receiving window corresponding to the sequence numbers of frames that are accepted Magister Teknik Elektro 13

Operation of sliding window Operations at the sender: Magister Teknik Elektro 14

Operation of sliding window Operations at the sender: Magister Teknik Elektro 15

Operation of sliding window Operations at the receiver Magister Teknik Elektro 16

Operation of sliding window Operations at the receiver Magister Teknik Elektro 17

Operation of sliding window How is “flow control” achieved? n n Receiver can control the size of the sending window By limiting the size of the sending window data flow from sender to receiver can be limited Interpretation of ACK N message: n Receiver acknowledges all packets until (but not including) sequence number N Magister Teknik Elektro 18

Analysis of sliding window Magister Teknik Elektro 19

Error control Two basic approaches to handle bit errors: Error-detecting codes plus retransmission (Automatic Repeat re. Quest / ARQ) n n Used if retransmission of corrupted data is feasible Receiver detects error and requests retransmission of a frame. Error-correcting codes n n n Used if retransmission of the data is not possible Data are encoded with sufficient redundancy to correct bit errors Examples: Hamming Codes, Reed Solomon Codes, etc. Magister Teknik Elektro 20

Error detection techniques Error Detection Techniques: n n Parity Checks Cyclic Redundancy Check (CRC) Magister Teknik Elektro 21

Parity checks General Method: n Append a parity bit to the end of each character in a frame such that the total number of '1' in a character is: even (even parity) or odd (odd parity) Example: n n n With ASCII code, a parity bit can be attached to an 7 -bit character ASCII "G" = 1 1 1 0 0 0 1 with even parity = with odd parity = Magister Teknik Elektro 22

Cyclic-Redundancy Codes General Method: n The transmitter generates an n-bit check sequence number from a given k-bit frame such that the resulting (k+n)-bit frame is divisible by some number The receiver divides the incoming frame by the same number If the result of the division does not leave a remainder, the receiver assumes that there was no error Magister Teknik Elektro 23

Cyclic-Redundancy Codes CRC is used by all advanced data link protocols, for the following reasons: n n Powerful error detection capability CRC can be efficiently implemented in hardware Magister Teknik Elektro 24

Additional facts on CRC can be efficiently implemented in hardware by a set of XOR gates and a shift register The following generator polynomials are widely used: CRC-12: CRC-16: CRC-CCITT: CRC-32: P(x) = x 12 + x 11 + x 3 + x 2 + x + 1 P(x) = x 16 + x 15 + x 2 + 1 P(x) = x 16 + x 12 + x 5 + 1 P(x) = x 32 + x 26 + x 23 + x 22 + x 16 + x 12 + x 11 + x 10 + x 8 + x 7 + x 5 + x 4 + x 2 + x + 1 Magister Teknik Elektro 25

ARQ error control Two types of errors: n n Lost frames Damaged Frames Most Error Control techniques are based on (1) Error Detection Scheme (e. g. , Parity checks, CRC), and (2) Retransmission Scheme Error control schemes that involve error detection and retransmission of lost or corrupted frames are referred to as Automatic Repeat Re. Quest (ARQ) error control Magister Teknik Elektro 26

ARQ error control All retransmission schemes use all or a subset of the following procedures: n n Receiver sends an acknowledgment (ACK) if a frame is correctly received Receiver sends a negative acknowledgment (NAK) if a frame is not correctly received The sender retransmits a packet if an ACK is not received within a timeout interval All retransmission schemes (using ACK, NAK or both) rely on the use of timers Magister Teknik Elektro 27

ARQ error control Note: Once retransmission is used, a sequence number is required for every data packet to prevent duplication of packets Both ACKs and NAKs can be sent as special frames, or be attached to data frames going in the opposite direction (Piggybacking) Magister Teknik Elektro 28

ARQ schemes The most common ARQ retransmission schemes: n n n Stop-and-Wait ARQ Go-Back-N ARQ Selective Repeat ARQ The protocol for sending ACKs in all ARQ protocols are based on the sliding window flow control scheme Magister Teknik Elektro 29

Stop-and-wait ARQ Stop-and-Wait ARQ is an addition to the Stopand-Wait flow control protocol: n n Frames have 1 -bit sequence numbers (SN = 0 or 1) Receiver sends an ACK (1 -SN) if frame SN is correctly received Sender waits for an ACK (1 -SN) before transmitting the next frame with sequence number 1 -SN If sender does not receive anything before a timeout value expires, it retransmits frame SN Magister Teknik Elektro 30

Stop-and-wait ARQ Lost frame Magister Teknik Elektro 31

Stop-and-wait ARQ Lost ACK Magister Teknik Elektro 32

Go-back-N ARQ Go-Back-N uses the sliding window flow control protocol. If no errors occur the operations are identical to Sliding Window Operations: n n n A station may send multiple frames as allowed by the window size Receiver sends a NAKi if frame i is in error. After that, the receiver discards all incoming frames until the frame in error was correctly retransmitted If sender receives a NAKi it will retransmit frame i and all packets i+1, i+2, . . . which have been sent, but not been acknowledged Magister Teknik Elektro 33

Go-back-N ARQ Lost frame Magister Teknik Elektro 34

Go-back-N ARQ Lost ACK Magister Teknik Elektro 35

Details Go-back-N ARQ Scenario 1: A transmits frame i, and B detects error in frame i, but has received frames i-1, i-2, . . . correctly ➨ B sends NAKi Scenario 2: Frame i is lost or B does not recognize frame i Assume that A sends frame i+1 and B receives it ➨ B sends NAKi, or A will timeout and retransmit frame i Magister Teknik Elektro 36 and all subsequent frames

Details Go-back-N ARQ Scenario 3: B receives frame i and sends ACK(i+1) which is lost ➨ B may send an ACK(i+k) later which also acknowledges all frames < i+k (ACKs are “cumulative”) or A retransmits frame i and all subsequent frames Scenario 4: NAKi is lost ➨ A will eventually time out Magister Teknik Elektro 37

Example of Go-back-N ARQ Magister Teknik Elektro 38

Selective-repeat ARQ Similar to Go-Back-N ARQ. However, the sender only retransmits frames for which a NAK is received Advantage over Go-Back-N: n Fewer Retransmissions. Disadvantages: n n n More complexity at sender and receiver Each frame must be acknowledged individually (no cumulative acknowledgements) Receiver may receive frames out of sequence Magister Teknik Elektro 39

Selective-repeat ARQ Lost frame Magister Teknik Elektro 40

Example of Selective-repeat ARQ Magister Teknik Elektro 41

Analysis of ARQ protocols What is the efficiency of the discussed ARQ protocols? A number of assumptions: n n ACKs and NAKs are never lost, and frames are not dropped. Sizes of ACKs, NAKs, and frame headers are negligible. Magister Teknik Elektro 42

Error correction techniques Forward error correction (FEC) Hybrid-ARQ (H-ARQ) n n n Type-I H-ARQ Type-III H-ARQ Magister Teknik Elektro 43

Networking Point to point communication not usually practical n n Devices are too far apart Large set of devices would need impractical number of connections Solution is a communications network Magister Teknik Elektro 44

Simplified Network Model Magister Teknik Elektro 45

Two types of networks at the data link layer n n n Broadcast Networks: All stations share a single communication channel Point-to-Point Networks: Pairs of hosts (or routers) are directly connected Typically, local area networks (LANs) are broadcast and wide area networks (WANs) are point-to-point Magister Teknik Elektro 46

Networking Computer network A collection of computing devices that are connected in various ways in order to communicate and share resources Usually, the connections between computers in a network are made using physical wires or cables However, some connections are wireless, using radio waves or infrared signals Magister Teknik Elektro 47

Networking The generic term node or host refers to any device on a network Data transfer rate The speed with which data is moved from one place on a network to another Data transfer rate is a key issue in computer networks Magister Teknik Elektro 48

Switching Networks Long distance transmission is typically done over a network of switched nodes Nodes not concerned with content of data End devices are stations n Computer, terminal, phone, etc. A collection of nodes and connections is a communications network Data routed by being switched from node to node Magister Teknik Elektro 49

Nodes may connect to other nodes only, or to stations and other nodes Node to node links usually multiplexed Network is usually partially connected Some redundant connections are desirable for reliability Two different switching technologies n Circuit switching n Packet switching n Magister Teknik Elektro 50

Simple Switched Network Magister Teknik Elektro 51

Circuit Switching Dedicated communication path between two stations Three phases n n n Establish Transfer Disconnect Must have switching capacity and channel capacity to establish connection Must have intelligence to work out routing Magister Teknik Elektro 52

Circuit Switching - Applications Inefficient n n Channel capacity dedicated for duration of connection If no data, capacity wasted Set up (connection) takes time Once connected, transfer is transparent Developed for voice traffic (phone) Magister Teknik Elektro 53

Public Circuit Switched Network Magister Teknik Elektro 54

Telecomm Components Subscriber n Devices attached to network Local Loop n Subscriber loop n Connection to network Exchange n Switching centers n End office - supports subscribers Trunks n Branches between exchanges n Multiplexed Magister Teknik Elektro 55

Circuit Switch Elements Magister Teknik Elektro 56

Circuit Switching Concepts Digital Switch n Provide transparent signal path between devices Network Interface Control Unit n Establish connections Generally on demand Handle and acknowledge requests Determine if destination is free construct path n Maintain connection n Disconnect Magister Teknik Elektro 57

Blocking or Non-blocking Blocking n n n A network is unable to connect stations because all paths are in use A blocking network allows this Used on voice systems Short duration calls Non-blocking n n Permits all stations to connect (in pairs) at once Used for some data connections Magister Teknik Elektro 58

Space Division Switching Developed for analog environment Separate physical paths Crossbar switch n Number of crosspoints grows as square of number of stations n Loss of crosspoint prevents connection n Inefficient use of crosspoints All stations connected, only a few crosspoints in use n Non-blocking Magister Teknik Elektro 59

Crossbar Matrix Magister Teknik Elektro 60

Time Division Switching Partition low speed bit stream into pieces that share higher speed stream e. g. TDM bus switching n based on synchronous time division multiplexing n Each station connects through controlled gates to high speed bus n Time slot allows small amount of data onto bus n Another line’s gate is enabled for output at the same time Magister Teknik Elektro 61

Control Signaling Functions Audible communication with subscriber Transmission of dialed number Call can not be completed indication Call ended indication Signal to ring phone Billing info Equipment and trunk status info Diagnostic info Control of specialist equipment Magister Teknik Elektro 62

Control Signal Sequence Both phones on hook Subscriber lifts receiver (off hook) End office switch signaled Switch responds with dial tone Caller dials number If target not busy, send ringer signal to target subscriber Feedback to caller n Ringing tone, engaged tone, unobtainable Target accepts call by lifting receiver Switch terminates ringing signal and ringing tone Switch establishes connection Connection release when Source subscriber hangs up Magister Teknik Elektro 63

Packet Switching Data transmitted in small packets n Typically 1000 octets n Longer messages split into series of packets n Each packet contains a portion of user data plus some control info Control info n Routing (addressing) info Packets are received, stored briefly (buffered) and past on to the next node n Store and forward Magister Teknik Elektro 64

Use of Packets Magister Teknik Elektro 65

Advantages Line efficiency n Single node to node link can be shared by many packets over time n Packets queued and transmitted as fast as possible Data rate conversion n Each station connects to the local node at its own speed n Nodes buffer data if required to equalize rates Packets are accepted even when network is busy n Delivery may slow down Priorities can be used Magister Teknik Elektro 66

Switching Technique Station breaks long message into packets Packets sent one at a time to the network Packets handled in two ways n n Datagram Virtual circuit Magister Teknik Elektro 67

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 Magister Teknik Elektro 68

Virtual Circuit Preplanned route established before any packets sent Call request and call accept packets establish connection (handshake) Each packet contains a virtual circuit identifier instead of destination address No routing decisions required for each packet Clear request to drop circuit Not a dedicated path Magister Teknik Elektro 69

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

Circuit v Packet Switching Performance n n n Propagation delay Transmission time Node delay Magister Teknik Elektro 71

External Virtual Circuit and Datagram Operation Magister Teknik Elektro 72

Internal Virtual Circuit and Datagram Operation Magister Teknik Elektro 73
- Slides: 74