Computer Communication and Networks

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 52

Computer Communication

&
Networking

Data Link Control

Sudipta Mahapatra

1
The DLC Layer
• Major Functions
1. Link layer addressing
2. Sharing of a broadcast channel
3. Error control
4. Flow control

2
A Communication Architecture

3
Link Layer Services
• Framing
– Encapsulates higher layer PDU, e.g, datagram,
in frames by adding (i) header and (ii) trailer
– Puts the physical address of the destination in
the header; may take help of the ARP for this.
– Implements media access protocols if the
channel is shared, e.g., in a LAN.

4
Link Layer Services (Contd.)
• Flow control: Ensures that the sender
does not transmit too fast to drown the
receiver.
• Error handling:
– Error detection and retransmission (ARQ)
– Error correction (FEC)

5
Link Layer Implementation

6
Links with Multiple Access
• Types of links:
– Point-to-point (Direct connection)
– Broadcast (Ethernet)
– Switched (Switched Ethernet, ATM)

7
MAC protocol
• Multiple stations share a common
medium; chance of interference or
collision!
• MAC protocol refers to the algorithm that
assigns the channel to a station in a way
that reduces the chance of collision.

8
Taxonomy of MAC protocols
• Use channel partitioning
• Random access: Collision and recovery
• Coordinated access

9
Time Division Multiple Access
• TDMA
– Each station gets a fixed length time slot
during which it can transmit.
– Unused slot goes idle, example – 6-station
LAN

10
Frequency Division Multiple
Access
• FDMA
– The transmission spectrum is divided into
multiple bands.
– Each station allocated its own frequency
band.
– Unused frequency bands go idle.

11
FDMA (Contd.)
• Example – LANs 1, 3, 4 have packets; the
other frequency bands are idle.

12
Code Division Multiple Access
• CDMA
– Each user is assigned a unique codeword or
chipping sequence that is a pseudo random
or PN-sequence
– A station transmits using its own chipping
sequence.
– Only a receiver who knows the code can
decode the received bit stream.

13
CDMA
• CDMA
– Typical number of chips per bit is 64 or 128.
– For a 1, the node transmits its chip sequence
and for a 0, it sends the one’s complement of
this sequence.
– Two chip sequences are orthogonal or for any
two chip sequences S and T,
1 m 1 m 2
S•T=  Si Ti =0 and S  S=  Si =1
m i=1 m i=1
14
CDMA Operation
• Is a spread spectrum technology

15
CDMA Example
Chip sequence Bipolar notation
A: 0 0 0 1 1 0 1 1 A: (-1 -1 -1 1 1 -1 1 1)
B: 0 0 1 0 1 1 1 0 B: (-1 -1 1 -1 1 1 1 -1)
C: 0 1 0 1 1 1 0 0 C: (-1 1 -1 1 1 1 -1 -1)
D: 0 1 0 0 0 0 1 0 D: (-1 1 -1 -1 -1 -1 1 -1)

16
Example (Contd.)
Example transmissions
--1- C S1=(-1 1 -1 1 1 1 -1 -1)
- 1 1 - B+C S2=(-2 0 0 0 2 2 0 -2)
1 0 - - A+B’ S3=(0 0 -2 2 0 -2 0 2)
1 0 1 - A+B’+C S4=(-1 1 -3 3 1 -1 -1 1)
1 1 1 1 A+B+C+D S5=(-4 0 -2 0 2 0 2 -2)
1 1 0 1 A+B+C’+D S6=(-2 -2 0 -2 0 -2 4 0)

17
Example (Contd.)
Recovery of station C’s signal

S1C=((1+1+1+1+1+1+1+1)/8=1
S2C=((2+0+0+0+2+2+0+2)/8=1
S3C=((0+0+2+2+0-2+0-2)/8=0
S4C=((1+1+3+3+1-1+1-1)/8=1
S5C=((4+0+2+0+2+0-2+2)/8=1
S6C=((2-2+0-2+0-2-4+0)/8=-1
18
Advantages
• Efficient Practical utilization of Fixed
Frequency Spectrum
• Flexible Allocation of Resources
• Privacy protection in Spread Spectrum
CDMA due to anti-jamming capabilities of
PN sequences
Ref.:
http://en.wikipedia.org/wiki/Code_division_multiple_access

19
CDMA Encode and Decode

20
Interference?

21
22
transmitting

23
24
25
26
27
28
29
30
31
32
33
SW with Go-back-n
Consider a 3-bit SW protocol, Window size=8.
Sender Action Receiver Action
Send F0 Send ACK1
Send F1-F7, F0 Send ACK1
SW with Go-back-n

Were all the eight frames received correctly or were all of


them lost?

For a n-bit sequence number the maximum window size is


2^n-1.
SW with Selective Repeat
Consider a 3-bit SW protocol. Let W_S=W_R=7
Sender Action Receiver Action
Send F0-F6 ACK1-ACK7 // All ACKs get lost
Timeout and // Receiver window is F7-F5
Retransmit F0 Accepts F0 thinking it to be a new one.

For n-bit sequence number the maximum window size is


2^(n-1).
Finite sequence numbers
(Contd.)
• In a SW protocol with selective repeat, if
the transmitter window is of size Ws and
the receiver window is of size Wt, what is
the minimum required range of sequence
numbers?

37
Finite sequence numbers (Contd.)

Na+1 Nt Na+Wt
Transmitter window

Nr Ns Ns+Wr

Receiver window

Refer to the website:


http://en.wikipedia.org/wiki/Sliding_Window_Protocol

38
39
40
A sliding window of size 1, with a
3-bit sequence number

(a) Initially.
(b) After the first frame has been sent.
(c) After the first frame has been received.
(d) After the first acknowledgement has been received. 41
Sliding Window Protocol

42
43
Performance of ARQ schemes

• What is the efficiency of the ARQ scheme? That


is, of the total time spent, how much is actually
used to send the data?
• Variables:
– tf.= time to transmit a frame.
– tprop = propagation delay.
– Tf = time to transmit n frames= ntf.
– Ttotal = total time taken = n(tf+2 tprop), neglecting
the other overhead.

44
Stop-and-Wait ARQ

• Error free channel: Utilization,


U= Tf/ Ttotal = ntf/n(tf + 2 tp) = 1/(1+2a) where
a= tp / tf = (d/V)/(L/R)
d=distance; V=velocity; L=frame length; R=data rate
Processing time? ACK. Time?
• Erroneous channel:
U= Tf/ (Nr Tp).
Nr=Expected number of transmissions of a frame
= 1/(1-P) where P is the probability of a frame error.
Thus, Utilisation U=(1-P)/(1+2a)

45
Stop-and-Wait Link Utilisation

a>1 a<1
tf=1 46
Sliding Window ARQ

N>2a+1
47
N<2a+1
48
Performance
• Error free channel:
U= 1 ; N > 2a+1
N/(2a+1) ; N < 2a+1
• Erroneous channel:
Selective repeat ARQ: Nr is same as SW ARQ.
• U=1-P ; N>2a+1
N(1-P)/2a+1; N<2a+1

49
Go-back-N ARQ
• Assume K frames are to be retransmitted for an
erroneous transmission.
Nr = E[Number of transmissions for each successful
transmission]

= 
i 1
f (i ) P i 1 (1  P), f(i)= Number of transmissions if

the original frame was sent i times

=1+(i-1)K =(1-K)+Ki

50
Go-back-N ARQ
Thus Nr = (1-P+KP)/(1-P)

K=2a+1 for N>2a+1 and K=N for N<2a+1 (approx.)

U= (1-P)/(1+2aP) ; N>2a+1
N(1-P)/[(2a+1)(1-P+NP)] ; N<2a+1

51
Line utilisation for various error control schemes for
P=10-3

52

You might also like