Unit Ii PPTS
Unit Ii PPTS
Unit Ii PPTS
FRAMING
11.5
A frame in a bit-oriented protocol
Note
11.7
Bit stuffing and unstuffing
FLOW AND ERROR CONTROL
Now let us see how the data link layer can combine
framing, flow control, and error control to achieve the
delivery of data from one node to another. The
protocols are normally implemented in software by
using one of the common programming languages. To
make our discussions language-free, we have written
in pseudocode a version of each protocol that
concentrates mostly on the procedure instead of
delving into the details of language rules.
Taxonomy of protocols
11.13
NOISELESS CHANNELS
11.17
Example 1
11.19
Stop-and-Wait Protocol
Design of Stop-and-Wait Protocol
Sender-site algorithm for Stop-and-Wait Protocol
Algorithm Receiver-site algorithm for Stop-and-Wait Protocol
Example 2
11.26
Stop and Wait ARQ
•Sequence Number
•Acknowledgement Number
Stop and Wait ARQ
11.31
Example 3
1. Lost Frame
2. Damaged Frame
3. Lost ACK
Flow diagram
Efficiency?..
Example
Solution
The bandwidth-delay product is
The system can send 20,000 bits during the time it takes
for the data to go from the sender to the receiver and then
back again. However, the system sends only 1000 bits. We
can say that the link utilization is only 1000/20,000, or 5
percent. For this reason, for a link with a high bandwidth
or long delay, the use of Stop-and-Wait ARQ wastes the
capacity of the link.
Solution ?...
What if we can send multiple frames before waiting
for an ACK?
Sliding
Window
Protocols
Selective
G-Back-N
Repeat
Go-Back-N
Note
11.51
Lost Frame
Note
SEQ_NO ACK
S - Frame
Node 3
Node 4
Node 2 Shared Multiple
Access Control
Channel to BS
Node 1 Node N …
Introduction (Cont’d)
Multiple access issues
If more than one node transmit at a time on the
control channel to BS, a collision occurs
How to determine which node can transmit to BS?
Multiple access protocols
Solving multiple access issues
Different types:
Contention protocols resolve a collision after it
never occur.
Data link layer divided into two functionality-oriented sublayers
12.81
Taxonomy of multiple-access protocols
12.82
RANDOM ACCESS
ALOHA
Carrier Sense Multiple Access
Carrier Sense Multiple Access with Collision
Detection
Carrier Sense Multiple Access with Collision
Avoidance
Contention Protocols
ALOHA
Developed in the 1970s for a packet radio network by
Hawaii University.
Whenever a station has a data, it transmits. Sender finds out
whether transmission was successful or experienced a
collision by listening to the broadcast from the destination
station. Sender retransmits after some random time if there
is a collision.
Slotted ALOHA
Improvement: Time is slotted and a packet can only be
transmitted at the beginning of one slot. Thus, it can reduce
the collision duration.
Contention Protocols (Cont’d)
12.86
Procedure for pure ALOHA protocol
12.87
Example 1
12.88
Example 1 (continued)
12.89
Vulnerable time for pure ALOHA protocol
12.90
Example 2
Solution
Average frame transmission time Tfr is 200 bits/200
kbps or 1 ms. The vulnerable time is 2 × 1 ms = 2
ms. This means no station should send later than
1 ms before this station starts transmission and no
station should start sending during the one 1-ms
period that this station is sending.
12.91
Throughput of ALOHA
12.93
Example 3
A pure ALOHA network transmits 200-bit frames on a
shared channel of 200 kbps. What is the throughput if the
system (all stations together) produces
a. 1000 frames per second b. 500 frames per second
c. 250 frames per second.
Solution
The frame transmission time is 200/200 kbps or 1 ms.
a. If the system creates 1000 frames per second, this is 1
frame per millisecond. The load is 1. In this case
S = G× e−2 G or S = 0.135 (13.5 percent). This means
that the throughput is 1000 × 0.135 = 135 frames. Only
135 frames out of 1000 will probably survive.
12.94
Example 3 (continued)
b. If the system creates 500 frames per second, this is
(1/2) frame per millisecond. The load is (1/2). In this
case S = G × e −2G or S = 0.184 (18.4 percent). This
means that the throughput is 500 × 0.184 = 92 and that
only 92 frames out of 500 will probably survive. Note
that this is the maximum throughput case,
percentagewise.
12.97
Throughput of Slotted ALOHA
• The throughput S is
12.99
Vulnerable time for slotted ALOHA protocol
12.100
Example 4
A slotted ALOHA network transmits 200-bit frames on a
shared channel of 200 kbps. What is the throughput if the
system (all stations together) produces
a. 1000 frames per second b. 500 frames per second
c. 250 frames per second.
Solution
The frame transmission time is 200/200 kbps or 1 ms.
a. If the system creates 1000 frames per second, this is 1
frame per millisecond. The load is 1. In this case
S = G× e−G or S = 0.368 (36.8 percent). This means
that the throughput is 1000 × 0.0368 = 368 frames.
Only 386 frames out of 1000 will probably survive.
12.101
Example 4 (continued)
b. If the system creates 500 frames per second, this is
(1/2) frame per millisecond. The load is (1/2). In this
case S = G × e−G or S = 0.303 (30.3 percent). This
means that the throughput is 500 × 0.0303 = 151.
Only 151 frames out of 500 will probably survive.
12.102
Throughput
0.368
Slotted Aloha
S
0.184
Aloha
G
Carrier Sense Multiple Access
CSMA
12.105
Vulnerable time in CSMA
12.106
What should a station do if channel is Busy?
•1- persistent
•Non-persistent
•p-persistent
Behavior of 1-persistence method
0.2
1-persistent CSMA
0.1
0
Slotted Aloha
Aloha
0 1 2 3 4 5 6 7 8 9
G
Carrier Sense Multiple Access
Collision Detection
CSMA/CD
In CSMA, if 2 terminals begin sending
packet at the same time, each will
transmit its complete packet (although
collision is taking place).
Wasting medium for an entire packet
time.
Monitors the channel after it
sends a frame to see if the
transmission was successful.
CSMA/CD
Step 1: If the medium is idle, transmit.
Step 2: If the medium is busy, continue
to listen until the channel is idle then
transmit.
Step 3: If a collision is detected during
transmission, cease transmitting.
Step 4: Wait a random amount of time
and repeats the same algorithm.
Collision of the first bit in CSMA/CD
12.119
Collision and abortion in CSMA/CD
12.120
Example 5
Solution
The frame transmission time is Tfr = 2 × Tp = 51.2
μs. This means, in the worst case, a station needs
to transmit for a period of 51.2 μs to detect the
collision. The minimum size of the frame is 10
Mbps × 51.2 μs = 512 bits or 64 bytes. This is
actually the minimum size of the frame for
Standard Ethernet.
Flow diagram for the CSMA/CD
12.122
Energy level during transmission, idleness, or collision
12.123
Carrier Sense Multiple Access
Collision Avoidance
CSMA/CA
CSMA/CA
Avoid the collision.
Contention window
Acknowledgements
Timing in CSMA/CA
12.126
Note
In CSMA/CA, if the station finds the
channel busy, it does not restart the
timer of the contention window;
it stops the timer and restarts it when
the channel becomes idle.
12.127
Flow diagram for CSMA/CA
12.128
CONTROLLED ACCESS
Reservation
Polling
Token Passing
12.129
Reservation
Reservation access method
12.131
Polling
Polling
12.135
Token Passing
Stations are organized in logical ring.
When station has some data to send, should wait for the
Token.
Figure 12.20 Logical ring and physical topology in token-passing acces
12.138
CHANNELIZATION
12.139
Frequency Division
Multiple Access
Frequency-division multiple access (FDMA)
12.141
Time Division
Multiple Access
Time-division multiple access (TDMA)
12.143
Code Division
Multiple Access
One channel carries all the transmissions
simultaneously.
Differs from FDMA in the sense that, all
transmissions are carried on a single
frequency.
Differs from TDMA in the sense that, all
transmissions are simultaneous.
Each station is assigned a code, which is
sequence of numbers called chips
Simple idea of communication with code
Code Properties
12.146
Chip sequences
Properties
•If we multiply sequence by any number, each element is multiplied
by that number.
2. [+1 +1 -1 -1]= [+2 +2 -2 -2]
12.147
Data representation in CDMA
12.148
Sharing channel in CDMA
12.149
Digital signal created by four stations in CDMA
12.150
Decoding of the composite signal for one in CDMA
12.151
Sequence Generation
Walsh Table(nxn)
General rule and examples of creating Walsh tables
12.153
Note
The number of sequences in a Walsh
table needs to be N = 2m.
12.154
Find the chips for a network with
a. Two stations b. Four stations
Solution
We can use the rows of W2 and W4
a. For a two-station network, we have
[+1 +1] and [+1 −1].
12.155
Example 1
Solution
The number of sequences needs to be 2m. We
need to choose m = 7 and N = 27 or 128. We can
then use 90
of the sequences as the chips.
12.156
Example 2
Solution
Let us prove this for the first station, using our previous
four-station example. We can say that the data on the
channel
D = (d1 ⋅ c1 + d2 ⋅ c2 + d3 ⋅ c3 + d4 ⋅ c4).
The receiver which wants to get the data sent by station 1
multiplies these data by c1.
12.157
Example 2 (continued)
12.158
ADDRESS MAPPING
MAC Sublayer
Physical Layer
Ethernet evolution through four generations
STANDARD ETHERNET- 802.3
Preamble: Alerts the receiving system to the coming frame and enables it to synchronize its
input timing. The pattern provides only an alert and a timing pulse. The 56-bit pattern allows
the stations to miss some bits at the beginning of the frame. The preamble is actually added at
the physical layer and is not (formally) part of the frame.
Start frame delimiter (SFD). The second field (l byte: 10101011) signals the
beginning of the frame. The SFD warns the station or stations that this is the
last chance for synchronization. The last 2 bits is 11 and alerts the receiver that
the next field is the destination address.
Minimum and maximum lengths
Frame length:
Minimum: 64 bytes (512 bits)
Maximum: 1518 bytes (12,144 bits)
Unicast and multicast addresses
Note
Solution
To find the type of the address, we need to look at the second
hexadecimal digit from the left. If it is even, the address is unicast.
If it is odd, the address is multicast. If all digits are F’s, the address
is broadcast. Therefore, we have the following:
a. This is a unicast address because A in binary is 1010.
b. This is a multicast address because 7 in binary is 0111.
c. This is a broadcast address because all digits are F’s.
Example 2
Solution
The address is sent left-to-right, byte by byte; for each byte, it is sent
right-to-left, bit by bit, as shown below:
Connecting LANs,
Backbone Networks,
and Virtual LANs
15.177
CONNECTING DEVICES
Passive Hubs
Active hubs
Two-Layer Switches
Routers
Three-Layer Switches
Gateways
15.178
Five categories of connecting devices
15.179
Passive Hub
It is just a connector.
It connects wires coming from different
branches.
Its location in Internet model is below physical
layer.
Repeater
15.182
Note
15.183
Note
15.184
Note
A repeater is a regenerator,
not an amplifier.
15.185
Function of a repeater
15.186
Active Hubs
It is multiport repeater.
Used to create star topology.
Can also be used to create multilevel
hierarchy.
Bridge
15.189
A bridge connecting two LANs
15.190
Note
15.191
Transparent bridge
Is a bridge in which stations are completely
unaware of existence of the bridge.
Reconfiguration of the system is not necessary
(if bridge is added or deleted).
Must meet the three criteria,
1. Frame forwarding
2. Building forwarding table automatically by
learning process
3. Create loopless topology.
Learning
Earlier tables were static, managed by system
administrator.
A learning bridge and the process of learning
15.194
LOOP PROBLEM
(in learning process)
Loop problem in a learning bridge
15.196
Solution?
Spanning Tree
15.198
Finding the shortest paths and the spanning
tree in a system of bridges
15.199
Forwarding and blocking ports after using spanning
tree algorithm
15.200
Source Routing Bridges
Membership
Configuration
Communication between Switches
IEEE Standard
Advantages
A switch connecting three LANs
A switch using VLAN software
Two switches in a backbone using VLAN software
Note
Port number
MAC address
IP address
Multicast IP address
Combination
Configuration
Manual configuration
Automatic configuration
Semiautomatic configuration
Advantages
Security
POINT-TO-POINT PROTOCOL
After data transfer, the user then terminates the data link
connection, which is acknowledged by the system. Of
course the user or the system could have chosen to
terminate the network layer IPCP and keep the data link
layer running if it wanted to run another NCP protocol.
An example
An example (continued)
FRAME RELAY
Architecture
Frame Relay Layers
Extended Address
FRADs
VOFR
LMI
Frame Relay network
Note
Architecture
MAC Sublayer
Physical Layer
Note
Architecture
Bluetooth Layers
Baseband Layer
L2CAP
Piconet
Scatternet
Bluetooth layers
Single-secondary communication
Multiple-secondary communication
Frame format types
L2CAP data packet format