Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Transmission and Computer Networks

Similar presentations


Presentation on theme: "Data Transmission and Computer Networks"— Presentation transcript:

1 Data Transmission and Computer Networks
6 Data Link Layer

2 DATA LINK LAYER The Data Link Layer Tasks:
The data link layer transmits raw bits into a line that appears free of transmission errors to the network layer. The Data Link Layer Tasks: Bits Error Detection and Corrections Point-to-point Error Control: a frame may be destroyed, an acknowledgement frames may get lost, a duplicate frame may be produced. , a frame may be out of sequence ….etc Point-to-point flow control: mechanism employed to prevent a fast transmitter from drowning a slow receiver in data. Framing: It creates and recognizes frame boundaries.

3 DATA LINK LAYER The Data Link Layer Tasks: Devices Interfacing
Medium Access Control (MAC) To allow multiple devices share a common link Addressing To define address of each device connected to the link Line configurations : To define transmission & communication modes and transmission techniques.

4 Transmission Techniques 1.Parallel Transmission

5 2.Serial Transmission Time 1- bit 1 Destination Source DTE
Signal Reference 1- bit Time

6 Communication Modes When data is transmitted between two pieces of equipment, three communication modes of operation can be used. Simplex: Data is to be transmitted in one direction only. Half-Duplex: This is used when two interconnected devices which to interchange information alternately. Duplex or full-Duplex: This is used when data is to be exchanged between two connected devices in both directions simultaneously.

7 Transmission Modes For the receiving device to interpret the bit pattern correctly, it must be able to determine the following: Bit Synchronization: The start of each bit cell period (in order to sample the incoming signal in the middle of the bit cell). Character Synchronization: The start and end of each character or byte. Frame Synchronization: The start and end of each complete message block (frame). Two transmission modes to accomplish synchronization : 1. Asynchronous Transmission. 2. Synchronous Transmission.

8 1. Asynchronous Transmission
In asynchronous transmission, the receiver clock (R×C) runs unsynchronized with respect to the incoming signal (R×D). Each character (byte) is encapsulated between an additional start bit and one or more stop bits. The state of the signal on the transmission line between characters is idle state.

9 Standard Interchange Codes
1. American Standards Committee for Information Interchange (ASCII): 1 7 Bit Positions 6 5 2 3 4 p \ P @ SP DLE NUL q a Q A ! DC1 SOH r b R B DC2 STX s c S C # DC3 ETX t d T D $ DC4 EOT u e U E % NAK ENQ v f V F & SYN ACK w g W G ETB BEL x h X H 8 ( CAN BS y i Y I 9 ) EM HT z j Z J : * SUB LF { k [ K ; + ESC VT | l L < , FS FF } m ] M = - GS CR ~ n ^ N > . RS SO DEL o _ O ? / US SI

10 Standard Interchange Codes
1. Extended Binary Coded Decimal Interchange Code (EBCDIC): 1 8 Bit Positions 7 6 5 2 3 4 - & SP DS DLE NUL J A j a / SOS DC1 SOH S K B s k b SYN FS DC2 STX T L C t l c DC3 ETX U M D u m d PN BYP RES PF V N E v n e RS LF NL HT W O F w o f UC EOB BS LC X P G x p g EOT PRE IL DEL Y Q H y q h CAN 9 Z I z r i EM : ! SM CC SMM # $ . VT @ % * < DC4 IFS FF , ) ( NAK ENQ IGS CR = > ; + ACK IRS SO ? | SUB BEL IUS SI

11 1. Asynchronous Transmission
Example 3.1: Construct the transmitted frame using asynchronous transmission mode which contains the following data: GO. Assume that the number of stop bits is 2 and parity bit is used. STX P Idle Start of text Start bit Two stop bits Parity Charater P End of text ETX P O Message : GO P G

12 1. Asynchronous Transmission
Example : Construct the transmitted frame using asynchronous transmission mode which contains the following data: YES. Assume that the number of stop bits is 1 and no parity bit is used. STX Idle Start of text Start bit Stop bit Charater End of text ETX S Message : YES Y E

13 1. Asynchronous Transmission
Example : Assuming asynchronous transmission mode is used with 8-bit character, a parity bit, two stop bits, and transfer rate bps. Calculate the following: 1. Size of the transmitted element (in bits) which contains one character. 2. Time duration for each bit . 3. Maximum number of characters that can be transmitted per second. Solution of Example : 1. Size of transmitted element = = 12 bits. 2. Time duration for each bit = 1 / sec. 3. Max. number of char per second = / 12 = 1200 char/sec. 4.0 Efficiency = 8/12 = 66.6 %

14 1. Asynchronous Transmission
Character Synchronization using Asynchronous Transmission: After the start bit is detected, the receiver achieves character synchronization simply by counting the programmed number of bits.

15 Framing using Asynchronous Transmission:
Frame synchronization is used to determine the start and end of frame. Case I: Printable Characters Encapsulate the complete block between two non-printable characters: STX (start-of-text) and ETX (end-of-text). Case II: Binary Data When transmitting binary data, STX and ETX are preceded by another control character known as Data Link Escape (DLE).

16 Framing Frame Synchronization using Asynchronous Transmission:
To transmit binary data: The binary file may contain ETX character which would cause the receiver to terminate reception abnormally. For this , the following steps are taken Step 1: When transmitting binary data, STX and ETX are preceded by another control character known as Data Link Escape (DLE). Step 2: After transmitting the start of frame sequence (DLE-STX), the transmitter inspects each byte in frame prior to transmission to determine if it is a DLE character. If it is, a second DLE character is transmitted before the next byte. Step 3: Step 2 is repeated until the appropriate number of bytes have been transmitted. The transmitter then transmits the unique DLE-ETX sequence. To receive binary data: When the receiver receives a DLE, it checks the next character. If the next character is another DLE, the receiver discards it and waits for the next byte. If it is an ETX, then it terminates reception process.

17 1. Asynchronous Transmission
Frame Synchronization using Asynchronous Transmission: Case I: For Printable Characters

18 1. Asynchronous Transmission
Frame Synchronization using Asynchronous Transmission: Case II: For Binary Data

19 1. Asynchronous Transmission
Example : Construct the transmitted frame using asynchronous transmission mode which contains the following data: A B DLE ETX Z. Assume that the number of stop bits is 1 and no parity bit is used. Start-of-text sequence Idle DLE STX A B DLE DLE End-of-text sequence Start bit Charater Stop bit ETX Z DLE ETX

20 1. Asynchronous Transmission
Example : Construct the transmitted frame using asynchronous transmission mode which contains the following data: R DLE DLE ETX I DLE. Assume that the number of stop bits is 1 and no parity bit is used. DLE Idle Start-of-text sequence Start bit Stop bit Charater STX R ETX I End-of-text

21 2. Synchronous Transmission
The complete block or frame of data is transmitted as a contiguous stream with no delay between each 8-bit element. To enable the receiving device to achieve synchronization: The transmitted bit stream is suitably encoded. All frames are preceded by two or more reserved bytes or characters. The content of each frame is encapsulated between a pair of reserved characters.

22 Framing in Synchronous Transmission
There are two schemes to achieve character and frame synchronization in the synchronous transmission: Character-Oriented Synchronous Transmission Bit-Oriented Synchronous Transmission Both use the same bit synchronization method.

23 2. Synchronous Transmission
I. Character-Oriented Synchronous Transmission: The transmitter adds two or more transmission control characters known as Synchronous Idle or (SYN) characters before each block of characters. SYN characters are used to allow receiver to maintain bit synchronization.

24 2. Synchronous Transmission
I. Character-Oriented Synchronous Transmission: Once this has been done, they allow the receiver to start interpret the received bit stream on the correct character boundaries - Character Synchronization. The frame synchronization is achieved by encapsulating the block of characters between STX and ETX pair for the case of the text transmission, and the start-of-frame sequence (DLE-STX) and the end-of-frame sequence (DLE-ETX) for the case of the binary transmission.

25 2. Synchronous Transmission
I. Character-Oriented Synchronous Transmission: Case 1: Printable characters: Case 2: Binary data:

26 2. Synchronous Transmission
II. Bit-Oriented Synchronous Transmission: Character-oriented transmission is inefficient for transmission binary data because it performs too much DLE stuffing. Therefore, alternative synchronous transmission scheme is used – Bit-Oriented Synchronous Transmission. In Bit-Oriented Synchronous Transmission, the transmitter sends a string of idle bytes (each compromising ) preceding the opening flag ( ). When the receiver gets the opening flag, the frame contents are read and interpreted on 8-bit boundaries until the closing flag ( ) is detected. The reception process is then terminated.

27 2. Synchronous Transmission
II. Bit-Oriented Synchronous Transmission:

28 2. Synchronous Transmission
II. Bit-Oriented Synchronous Transmission: To achieve data transparency with this scheme, we must ensure the flag pattern is not present in the frame contents. We can do this by bit Stuffing. The bit stuffing technique is to detect a sequence of 5 contiguous binary 1 digits in the transmitted frame contents, then automatically inserts an additional binary 0 digit. In this way, the flag pattern can never be present in the frame contents between the opening and closing flag.

29 Number of additional bits =322 bits
Example : Deduce the number of additional bits required to transmit a text message comprising 100 of 8-bit characters over a data link using each of the following transmission control schemes: Case 1: Asynchronous with two stop bits per character. Stop bits Start bit STX Char 1 Char 2 Char 100 ETX 1 2 1 2 1 2 11-bit 3-bit 3-bit 3-bit 11-bit Number of additional bits =322 bits

30 2. Synchronous Transmission
Example (Continued): Case 2: Synchronous with two synchronization characters. Char 1 SYN STX Char 2 Char 100 ETX 8-bit Number of additional bits = 32 bits

31 2. Synchronous Transmission
II. Bit-Oriented Synchronous Transmission: Example 3.8: Assume Bit-Oriented Synchronous Transmission is to be used. Construct the transmitted frame, which contains the binary data: Solution of Example 3.8: Opening flag Closing flag Additional zero bits inserted

32 Transmission Modes (Summary)
Synchronous Transmission Asynchronous Transmission Bit Synchronization Frame Synchronization Character Synchronization Bit Synchronization Bipolar Encoding Bit-Oriented Character-Oriented Printable- Character Frame Manchester Encoding Printable- Character Frame Binary Data Frame Differential Manchester Encoding Binary Data Frame

33 Bit Error Control There are two approaches for achieving bit error control: Forward error control, in which the receiver cannot only detect when error are present but also determine where in the received bit stream the errors are. The correct data is then obtained by inverting these bits. Feedback (backward) error control, in which the receiver detects when errors are present but not their location. A retransmission control scheme is used to request that another copy of information to be sent.

34 1. Feedback (Backward) Error Control
I. Parity:

35 1. Feedback (Backward) Error Control
I. Parity:

36 1. Feedback (Backward) Error Control
II. Vertical Redundancy Check (VRC):

37 1. Feedback (Backward) Error Control
III. Cyclic Redundancy Check (CRC) :

38 1. Feedback (Backward) Error Control
III. Cyclic Redundancy Check (CRC) : Example : A series of 8-bit message blocks (frames) is to be transmitted across a data link using a CRC for error control. A generator polynomial of is to be used. Use an example to illustrate the following: The FCS generation process. The FCS checking process.

39 1. Feedback (Backward) Error Control
III. Cyclic Redundancy Check (CRC) : Solution of Example : The FCS generation process. M(x) R(x)

40 1. Feedback (Backward) Error Control
III. Cyclic Redundancy Check (CRC) : Solution of Example 3.9: (b) The FCS checking process.


Download ppt "Data Transmission and Computer Networks"

Similar presentations


Ads by Google