Professional Documents
Culture Documents
Computer Communication and Networks
Computer Communication and Networks
Computer Communication and Networks
&
Networking
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
S1C=((1+1+1+1+1+1+1+1)/8=1
S2C=((2+0+0+0+2+2+0+2)/8=1
S3C=((0+0+2+2+0-2+0-2)/8=0
S4C=((1+1+3+3+1-1+1-1)/8=1
S5C=((4+0+2+0+2+0-2+2)/8=1
S6C=((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
37
Finite sequence numbers (Contd.)
Na+1 Nt Na+Wt
Transmitter window
Nr Ns Ns+Wr
Receiver window
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
44
Stop-and-Wait ARQ
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
=1+(i-1)K =(1-K)+Ki
50
Go-back-N ARQ
Thus Nr = (1-P+KP)/(1-P)
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