Professional Documents
Culture Documents
Parity
Parity, also known as a (Vertical Redundancy Check or VRC), is the simplest error detection technique. Parity works by adding an error check bit to each character.
DATALINK LAYER
Parity check
ASCII a
even parity A parity bit is added to every data unit so that the total number of 1s is even (or odd for odd parity)
Parity Checking
Parity Checking
Error Correction
The receiving device detects the error and requests a re-transmission The sending device then retransmits the the portion that contained the error.
DATALINK LAYER
Error Correction
VRC Easy to find Single bit error. To correct single bit error in ASCII, the error correction code must determine which of the 7 bits has changed.
i.e. error in position 1, or 2, orupto 7. So requires enough redundancy bit to show all 8 states.
Aug 23, 2007 DATALINK LAYER 7
Contd..
Example now take 3 bit redundancy code, i.e to show (000 to 111) 8 different states.
i.e 7 bits ASCII 7 states. 1 state for redundancy themselves. 1 state for correct data. 7 =m data bits, 3=r redundancy bit total m+r bits transmitted. If m+r bits transmitted then r must indicate atleast m+r+1 states.
DATALINK LAYER
Contd..
Of these 1 state No-error, & m+r state indicates the location of error in each of m+r positions. So m+r+1 states must be discovered by r bits, i.e r bits indicates 2r different states. r Therefore 2 m+ r +1
Aug 23, 2007 DATALINK LAYER 9
Hamming code
Example: 7-bit ASCII code + 4 bit redundancy
Each r bit is the parity bit for one combination 20 1 1 1 1 1 1 of data bits
21 22 2 2 2 2 2 2 8 4 4 4 4 r1: bits: 1, 3, 5, 7, 9, 11 3 8 8 8 r2: bits: 2, 3, 6, 7, 10, 11 2 r3: bits 4, 5, 6, 7 r4: bits 8, 9, 10, 11
1 2 3 4 5 6 7 8 9 10 11
Once the bit is identified the receiver can reverse its value
Flow Control
Ensuring the sending entity does not overcome the receiving entity Preventing buffer overflow Transmission time Time taken to emit all bits into medium Propagation time Time for a bit to traverse the link
DATALINK LAYER
13
DATALINK LAYER
14
Continuous-ARQ
DATALINK LAYER
15
Stop-and-Wait ARQ -Normal operationThe sender will not send the next piece of data until it is sure that the current one is correctly received sequence number necessary to check for duplicated packets No NACK when packet is corrupted duplicate ACKs instead
Importance of numbering
Go-back-N ARQ
Based on sliding window Use window to control number of outstanding frames If no error, ACK as usual with next frame expected(RR=Receive Ready) If destination station detects error in a frame it sends a NACK (REJ=Reject) Discard that frame and all future frames until error frame received correctly Transmitter must go back and retransmit that frame and all subsequent frames
Aug 23, 2007 DATALINK LAYER 23
Go Back N -
Damaged Frame
(Case 1)
A transmits frame i, B detects an error and has previously successfully received frame (i-1). B sends REJ i, indicated the frame i is rejected. When A receives REJ, it must retransmit frame i and all subsequent frames that it has transmitted since the original transmission of frame i.
DATALINK LAYER
24
Go Back N -
Damaged Frame
(Case 2)
Frame i is lost in transit, A subsequently sends frame (i+1). B receives frame (i+1) out of order and send REJ i , A must retransmit frame i and all subsequent frames.
DATALINK LAYER
26
Go Back N -
Damaged Frame
(Case 3)
Frame i is lost in transit, and A does not soon send additional frame. B receives nothing and returns neither RR nor an REJ. When As timer expires, it transmits an RR frame that include a bit known as the P bit, which is set to 1. B interprets the RR frame with a P bit of 1 a command that must be acknowledged by sending an RR indicating the next frame that it expects. When A receives the RR, it retransmits frame i.
Aug 23, 2007 DATALINK LAYER 27
Damaged RR (case 1)
B receives frame i and sends RR(i+1), which is in transit.
Because acknowledgements are cumulative (e.g., RR 6 means that all frames through 5 are acknowledged), it may be that A will receive a subsequent RR to a subsequent frame and that it will arrive before the timer associated with frame i expires.
DATALINK LAYER 28
Damaged RR (case 2)
If As timer expires, it transmits a RR command as in Slide 26. It sets another timer, called the P bit timer. If B fails to respond to RR command, or if its response is damaged, then As P-bit timer will expire. At this point, A will try again by issuing a new RR command and restarting the P-bit timer. This procedure is tried for number of iterations. If A fails t obtain an acknowledgement after some maximum number if attempts, it initiates a reset procedure.
Aug 23, 2007 DATALINK LAYER 29
Selective Reject
Also called selective re-transmission Only rejected frames are retransmitted Subsequent frames are accepted by the receiver and buffered Minimizes retransmission Receiver must maintain large enough buffer More complex login in transmitter
Aug 23, 2007 DATALINK LAYER 30
DATALINK LAYER
31
DATALINK LAYER
32
Balanced
Two combined stations Supports full duplex and half duplex
DATALINK LAYER
34
DATALINK LAYER
36
DATALINK LAYER
37
Frame Structure
Synchronous transmission All transmissions in frames Single frame format for all data and control exchanges
DATALINK LAYER
38
Frame Structure
DATALINK LAYER
39
Flag Fields
Delimit frame at both ends 01111110 May close one frame and open another Receiver hunts for flag sequence to synchronize Bit stuffing used to avoid confusion with data containing 01111110 0 inserted after every sequence of five 1s If receiver detects five 1s it checks next bit If 0, it is deleted If 1 and seventh bit is 0, accept as flag If sixth and seventh bits 1, sender is indicating abort
DATALINK LAYER
40
Bit Stuffing
Example with possible errors
Address Field
Identifies secondary station that sent or will receive frame Usually 8 bits long May be extended to multiples of 7 bits LSB of each octet indicates that it is the last octet (1) or not (0) All ones (11111111) is broadcast
DATALINK LAYER
42
Control Field
Different for different frame type
Information frames (I-Frame) - data to be transmitted to user (next layer up)
Flow and error control piggybacked on information frames.
Supervisory frames (S- Frames)- provide ARQ when piggyback not used. Unnumbered frames (U- Frames)- supplementary link control functions.
First one or two bits of control filed identify frame type Remaining bits explained later
Aug 23, 2007 DATALINK LAYER 43
DATALINK LAYER
44
Poll/Final Bit
Use depends on context Command frame Response frame
P bit 1 to solicit (poll) response from peer F bit 1 indicates response to soliciting command
DATALINK LAYER 45
Information Field
Only in information and some unnumbered frames Must contain integral number of octets Variable length
DATALINK LAYER
46
DATALINK LAYER
47
HDLC Operation
Exchange of information, supervisory and unnumbered frames Three phases
Initialization Data transfer Disconnect
DATALINK LAYER
48
Initialization
Initialization may be requested either side by issuing one of the six set-mode commands It signals the other side that Initialization is requested. It specifies which of the three modes (NRM,ABM,ARM) is requested. It specifies whether 3-or 7-bit sequence numbers are to be used. If the other side accepts the request, then HDLC module on that end transmits an, Unnumbered acknowledgement (UA) frame back to the initiating side. If the request is rejected, then a Disconnected mode (DM) frame is sent.
DATALINK LAYER
49
Data transfer
Both sides may begin to send the user data in I- frames, starting with sequence no.(0). The N(S) and N(R) of I- frames flow control & Error Control. An HDLC module sending a sequence of I-frames will number them sequentially, mod 8 or 128, - 3 or 7-bit sequence number is used in N(S) and N(R). S- frames are also used for flow and error control.
Receive ready (RR)- Frame Receive-not-ready (RNR) Frame REJ initiates the GO-back-N ARQ. SREJ- used to request re-transmission of just a single frame.
Aug 23, 2007 DATALINK LAYER 50
Disconnect
Either HDLC module can initiate a disconnect, either on its own initiative if there is some sort of fault, or at the request of its higher-layer user. HDLC issues a disconnect by sending a Disconnect(DISC) frame. The other side must accept the disconnect by replying with UA
DATALINK LAYER
51
DATALINK LAYER
52
DATALINK LAYER
53