Igor Radovanovic, i.radovanovic@tue.nl - PowerPoint PPT Presentation

1 / 54
About This Presentation
Title:

Igor Radovanovic, i.radovanovic@tue.nl

Description:

A. B. Forouzan A. Tanenbaum Packet ... used by the sender & receiver unreliable communication channel 6-14, a, b disconnect ... and Networking d1 d2 d3 1 2 1 2 ... – PowerPoint PPT presentation

Number of Views:190
Avg rating:3.0/5.0
Slides: 55
Provided by: IgorR1
Category:

less

Transcript and Presenter's Notes

Title: Igor Radovanovic, i.radovanovic@tue.nl


1
Computer Networks (2IC10)
  • Communication Protocols
  • Igor Radovanovic
  • Thanks to
  • P. van der Stok
  • A. B. Forouzan
  • A. Tanenbaum

2
Packet transmission in ideal network
N. Olifer, V. Olifer
Computer Networks,
principles, technologies and protocols
for network design, Wiley Sons
  • All packets delivered to the destination node
    without loss or distortion
  • All packets delivered in the same order
  • Delivery with minimum delay (d1d2d3)

3
Communication problems
  • corruption of packets
  • loss of packets
  • replication of packets
  • ordering of packets
  • independent failures of nodes

4
Packet transmission in a real network
?1
2
3
4
5
6
1
t
1
2
3
4
6
d1
d4
t
d2
?1
d3
N. Olifer, V. Olifer
Computer Networks,
principles, technologies and protocols
for network design, Wiley Sons
  • Packets are delivered with variable delays (d1?d2
    ?d3)
  • Packets are delivered out of order
  • Packets may be lost or corrupted
  • Average rate of information flow is different at
    the input and at the output of the network

5
Packet corruption
  • Error detection
  • Error correction
  • Types of errors
  • single bit only 1 bit in the data unit has
    changed
  • burst error 2 or more bits in the data unit have
    changed

Example 0.01 s of burst impulse noise
1200 bps data rate
12 bits of errors
6
Error detection
  • Redundancy adding extra bits for detecting
    errors at the destination

7
Error detection
  • All methods use redundancy

8
Parity check
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)

9
Parity check-example-
  • Suppose the sender wants to send the word world.
    In ASCII, the five characters
    are coded as
  • 1110111 1101111 1110010 1101100
    1100100
  • The following shows the actual bits sent
  • 11101110 11011110 11100100 11011000
    11001001
  • Parity check can detect single-bit errors
  • What about burst errors?

10
Error detection
11
CRC check
  • based on binary division
  • CRC added to the data unit so that the resulting
    data becomes exactly divisible by a predetermined
    number
  • CRC
  • exactly 1 less bit than the divisor
  • A string of n zeros added to the data unit
  • New data divided by divisor
  • Replace 0s by CRC

12
CRC generator
  • Modulo-2 division

13
CRC generator (cntd)
Name Polynomial Application
CRC-8 x8 x2 x 1 ATM header
CRC-10 x10 x9 x5 x4 x 2 1 ATM AAL
ITU-16 x16 x12 x5 1 HDLC
ITU-32 x32 x26 x23 x22 x16 x12 x11 x10 x8 x7 x5 x4 x2 x 1 LANs
14
CRC performance
  • CRC can detect
  • all burst errors that affect odd number of bits
  • all burst errors of length ? degree of polynomial
  • with high probability burst errors gt degree of
    polynomial
  • Example
  • CRC-12 (degree of 12)
  • OK
  • OK
  • 99.97

15
Error detection
16
Checksum
Example IP header
  1. The data unit is divided into k sections, each of
    n bits
  2. All sections are added using 1s complement
  3. The sum is complemented
  4. The checksum is sent with data

17
1s complement
  • Suppose the following block of 16 bits is to be
    sent using a checksum of 8 bits.
  • 10101001 00111001
  • The numbers are added using ones complement
  • 10101001
  • 00111001
    ------------
  • Sum 11100010
  • Checksum 00011101
  • The pattern sent is 10101001 00111001
    00011101

18
Checksum (cntd)
  • Performance
  • Can we use this technique to detect an error if 2
    corresponding opposite bits in 2 data segments
    become corrupted?
  • An example
  • Transmitted sequence 10101001 00111001
    00011101
  • Received sequence 00101001 10111001
    00011101

19
Error correction
  • By retransmission
  • flow and error control protocols
  • Forward Error Correction (FEC)
  • require more redundancy bits
  • should locate the invalid bit or bits
  • n-bit code word contains m data bits r
    redundancy bits
  • nmr
  • mr1 bits discoverable by r bits
  • Example
  • For m5 data bits can r be 3?

20
Hamming code
  • Example 7-bit ASCII code 4 bit redundancy
  • Each r bit is the parity bit for one combination
    of data bits
  • r1 bits 1, 3, 5, 7, 9, 11
  • r2 bits 2, 3, 6, 7, 10, 11
  • r3 bits 4, 5, 6, 7
  • r4 bits 8, 9, 10, 11

20 1 1 1 1 1 1
21 2 2 2 2 2 2
22 4 4 4 4
23 8 8 8 8

? ? ? ? ? ? ? ? ? ? ?
1 2 3 4 5 6 7 8 9 10 11
21
Hamming code (cntd)
  • Example of redundancy bit calculation (even
    parity)

22
Hamming code (cntd)
  • Error detection using Hamming code

once the bit is identified the receiver can
reverse its value
23
Communication protocols
24
Communication protocols-Wanted behavior-
  • Communicating sender and receiver
  • Order
  • When sender has sent mi before mj and receiver
    has accepted mj, then receiver has also accepted
    mi
  • Validity
  • When receiver has accepted mi then mi was sent by
    sender
  • Progress
  • A sent message is eventually accepted

25
Stop-and-Wait Automatic Repeat reQuest
  • simplest flow and error control mechanism
  • the sending device keeps a copy of the last frame
    transmitted until it receives an acknowledgement
  • identification of duplicate transmission (lost or
    delayed ACK)
  • a damaged or lost frame is treated in the same
    way
  • timers introduced
  • positive ACK sent only for frames received safe
    sound

26
A Simplex Stop-and-Wait ARQ
  1. normal operation
  2. the frame is lost
  3. the ACK is lost
  4. the ACK is delayed

27
Stop-and-Wait ARQ -Normal operation-
  • The 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

28
Stop-and-Wait ARQ -Lost or damaged frame-
roundtrip delay
processing in the receiver
Should be as short as possible. Why?
29
Stop-and-Wait ARQ -Lost ACK-
Importance of numbering
30
Stop-and-Wait ARQ -Delayed ACK-
Importance of ACK numbering
31
Duplex Stop-and-Wait ARQ
  • Piggybacking
  • combine data with ACK (less overhead saves
    bandwidth)

32
Drawbacks of Stop-and-Wait ARQ
  • after each frame sent the host must wait for an
    ACK
  • inefficient use of bandwidth
  • to improve efficiency ACK should be sent after
    multiple frames
  • Alternatives Sliding Window protocols
  • Go-back-N ARQ
  • Selective Repeat ARQ

33
Pipelining
  • One task begins before the other one ends
  • increases efficiency in transmission

34
Sliding Window Protocols
  • Sequence numbers
  • sent frames are numbered sequentially
  • number of frames stored in the header
  • if the number of bits in the header is m than
    sequence number goes from 0 to
    2m-1
  • Sliding window
  • to hold the
  • unacknowledged
  • outstanding frames
  • the receiver
  • window size
  • always 1

sequence number
frame
acknowledged frames
35
Question
  • What is the consequence of the window size in the
    receiver on the order of the received packets?
  • Answer
  • Window size 1 means that the packets are received
    in order
  • Note this is not the case for the larger
    receiver window size

36
Go-back-N-Control variables-
  • S- holds the sequence number of the recently sent
    frame
  • SF holds sequence number of the first frame in
    the window
  • SL holds the sequence number of the last frame
  • R sequence number of the frame expected to be
    received

37
The name of Go-back-N why?
  • Re-sending frame
  • when the frame is damaged the sender goes back
    and sends a set of frames starting from the last
    one ACKnd
  • the number of retransmitted frames is N
  • Example
  • The window size is 4.
  • A sender has sent frame 6 and the timer expires
    for frame 3 (frame 3 not ACKnd). The sender goes
    back and re-sends the frames 3, 4, 5 and 6.

38
Go-back-N -normal operation-
  • How many frames can be transmitted without
    acknowledgment?
  • ACK1 not necessary if ACK2 is sent
  • Cumulative ACK

expected sequence number
39
Go-back-N -damaged or lost frame-
damaged frames are discarded! Why are correctly
received packets not buffered? What is the
disadvantage of this?
40
Go-back-N -sender window size-
sequence number
41
Go-back-N
  • Inefficient
  • all out of order received packets are discarded
  • This is a problem in a noisy link
  • many frames must be retransmitted -gt bandwidth
    consuming
  • Solution
  • re-send only the damaged frames
  • Selective Repeat ARQ
  • avoid unnecessary retransmissions

42
Selective Repeat ARQ
  • Processing at the receiver more complex
  • The window size is reduced to 2m-1 (at most)
  • Both the transmitter and the receiver have the
    same window size
  • Receiver expects frames within the range of the
    sequence numbers

43
Selective Repeat ARQ-lost frame-
Note retransmission triggered with NACK and not
with expired timer
44
Selective Repeat ARQ-sender window size-
45
Communication problems
  • corruption of packets
  • loss of packets
  • replication of packets
  • ordering of packets
  • independent failures of nodes

46
Communication protocols
  • We have assumed until now that packets cannot be
    reordered
  • this when the parties are connected by a single
    physical line
  • What if the channel is a network?
  • the packets may arrive out of order
  • Sequence number might be reused duplications
    possible
  • How to solve this problem?
  • Introduce the lifetime of the packet

47
Connection establishment
  • Connection request PDU
  • Connection accepted PDU
  • Is this enough?
  • What if the network can store or duplicate
    packets?
  • What if the subnet is so congested that ACK or
    datagrams cannot go through?
  • Example bank transaction (delayed duplicates)
  • Solutions
  • new addresses for each connection?
  • incremented sequence numbers?
  • PACKET LIFETIME

48
Packet lifetime
  • Can be restricted using
  • restricted subnet design
  • prevents looping
  • bounding congestion delay over the longest
    possible path
  • putting a hop counter in each packet
  • decrementing default value dropping when zero
  • time stamping each packet
  • carry the time when it was created
  • discarded after some predefined time
  • all the routers synchronized nontrivial
  • Lifetime expires
  • Not only the packets but all the ACKs must be
    dead

49
Connection Establishment (2)
dead time after crash (max packet lifetime)
data rate lt clk rate
  • Time-of-day clock (not necessarily sync) 2 PDU
    with the same seq. num. are never outstanding at
    the same time
  • solves the delayed duplicate problem for data
    PDU
  • (a) PDUs may not enter the forbidden region.
  • (b) The resynchronization problem.

50
Connection Establishment (2)
Three protocol scenarios for establishing a
connection using a three-way handshake. CR
denotes CONNECTION REQUEST. (a)
Normal operation, (b) Old CONNECTION REQUEST
appearing out of nowhere. (c) Duplicate
CONNECTION REQUEST and duplicate ACK.
51
Connection Release
  • asymmetric release
  • a telephone line
  • connection is broken when one party hangs up
  • abrupt disconnection with loss of data.
  • symmetric release
  • each connection released separately
  • continue to receive after disconnect PDU is sent
  • avoid data loss

52
Connection Release (2)
unreliable communication channel
  • The two-army problem.

53
Connection Release (3)
disconnect request
6-14, a, b
  • Four protocol scenarios for releasing a
    connection.
  • (a) Normal case of a three-way handshake. (b)
    final ACK lost.

54
Connection Release (4)
6-14, c,d
  • (c) Response lost. (d) Response lost and
    subsequent DRs lost.
Write a Comment
User Comments (0)
About PowerShow.com