4. UNIT II
DATA-LINK LAYER & MEDIA
ACCESS 9
Introduction – Link-Layer Addressing –
DLC Services – Data-Link Layer Protocols
– HDLC – PPP - Media Access Control -
Wired LANs: Ethernet - Wireless LANs –
Introduction – IEEE 802.11, Bluetooth –
Connecting Devices.
5. Data Link Layer
The data link layer is responsible for moving frames from one hop
(node) to the next.
Data Link Layer
6. Functions of Data Link Layer
1. Framing: It divides the stream of bits received from network layer into
manageable data units called frames.
2. Physical Addressing: It adds a header to the frame to define the sender
and receiver of the frame.
3. Flow Control: The data link layer imposes a flow control mechanism to
avoid overwhelming the receiver.
4. Error Control
• It adds reliability by adding mechanisms to detect and retransmit
damaged or lost frames.
• It also uses a mechanism to recognize duplicate frames by adding the
trailer to the end of the frame
5. Access Control
• It determines which device has control over the link at any given
time when two or more devices are connected to the same link.
Data Link Layer
7. Sub-layers of Data Link Layer
1. Logical Link Control (LLC) Layer
• The Logical Link Control (LLC) layer is one of two sub-layers
that make up the Data Link Layer of the OSI model.
• The Logical Link Control layer controls frame
synchronization, flow control and error checking.
2. Media Access Control (MAC) Layer
• The Media Access Control Layer is one of two sub-layers that
make up the Data Link Layer of the OSI model.
• The MAC layer is responsible for moving data packets to and
from one Network Interface Card (NIC) to another across a
shared channel.
Data Link Layer
11. Link-Layer Addressing
Address Resolution Protocol
The Address Resolution Protocol (ARP) is used to associate
a logical address with a physical address.
On a typical physical network, such as a LAN, each device
on a link is identified by a physical or station address,
usually imprinted on the network interface card (NIC).
ARP is used to find the physical address of the node when
its Internet address is known.
Reverse Address Resolution Protocol
The Reverse Address Resolution
Protocol (RARP) allows a host to discover its Internet
address when it knows only its physical address.
It is used when a computer is connected to a network for the
first time or when a diskless computer is booted.
12. The two main functions of the data link
layer are data link control and media
access control.
1. Data Link Control functions include
framing, flow and error control, and
software-implemented protocols that
provide smooth and reliable
transmission of frames between nodes.
2. Media Access Control
Data Link Layer
13. Link Layer Services
Framing
Framing in the data link layer separates a message from one
source to a destination, or from other messages to other
destinations, by adding a sender address and a destination
address.
The destination address defines where the packet is to go; the
sender address helps the recipient acknowledge the receipt.
Although the whole message could be packed in one frame,
that is not normally done.
One reason is that a frame can be very large, making flow and error
control very inefficient.
When a message is carried in one very large frame, even a
single-bit error would require the retransmission of the whole
message. When a message is divided into smaller frames, a
single-bit error affects only that small frame.
14. Link Layer Services
Fixed-Size Framing
Frames can be of fixed or variable size.
In fixed-size framing, there is no need for
defining the boundaries of the frames; the
size itself can be used as a delimiter.
An example of this type of framing is the
ATM wide-area network, which uses
frames of fixed size called cells.
15. Link Layer Services
Variable-Size Framing
Variable-size framing is prevalent in local
area networks.
In variable-size framing, we need a way to
define the end of the frame and the
beginning of the next.
Historically, two approaches were used for
this purpose: a character-oriented approach
and a bit-oriented approach.
16. Link Layer Services
Framing
To transmit frames over the node, it is
necessary to mention start and end of each
frame. There are two techniques to solve
this frame.
1. Byte-oriented Protocols (Character-
oriented Protocols)
2. Bit-oriented Protocols
3. Clock-based Framing
17. Link Layer Services
FRAMING
Byte-oriented Protocols (Character-oriented
Protocols)
Each frame is to be viewed as a collection of bytes
(characters) rather than a collection of bits.
Such a byte-oriented approach is exemplified by the
Binary Synchronous Communication (BISYNC)
Protocol and the Digital Data Communication
Message Protocol (DDCMP).
The more recent and widely used Point-to-Point
Protocol (PPP) provides another example of this
approach.
18. Link Layer Services
FRAMING
Byte-oriented Protocols
Sentinel Approach
The BISYNC protocol illustrates the sentinel approach to framing.
Its frame format is shown in the figure.
The beginning of a frame is denoted by sending a special SYN
(synchronization) character.
The data portion of the frame is then contained between special
sentinel characters: STX (start of text) and ETX (end of text).
The SOH (start of header) field serves much the same purpose as
the STX field.
The frame format also includes a field labeled CRC (Cyclic
Redundancy Check) that is used to detect transmission errors.
20. Link Layer Services
FRAMING - Byte-oriented Protocols
Sentinel Approach
The problem with the sentinel approach is that the ETX
character might appear in the data portion of the frame.
BISYNC overcomes this problem by “escaping” the ETX
character by preceding it with DLE (Data Link Escape)
character whenever it appears in the body of a frame;
The DLE character is also escaped (by preceding it with an in
extra DLE) in the frame body. This approach is called
Character stuffing.
22. Link Layer Services
FRAMING - Byte-oriented Protocols
Point-to-Point Protocol
The format of PPP frame is given in figure.
The flag field has 0 1 1 1 1 1 1 0 as starting sequence.
The address and control field usually contain default values.
The protocol is used for demultiplexing.
The frame payload size can be negotiated, but it is 1500 bytes by default.
The checksum field is either 2 (by default) or 4 bytes long.
The PPP frame format is unusual in that several of the field sizes are
negotiated rather than fixed.
Negotiation is conducted by a protocol called LCP (Link Control
Protocol).
LCP sends control message encapsulated in PPP frames – such messages
are denoted by an LCP identifier in the PPP protocol.
27. Link Layer Services
FRAMING - Byte-oriented Protocols
Byte-counting Approach
The number of bytes contained in a frame can be included as a field in the
frame header. DDCMP protocol is used for this approach as shown in
figure.
CLASS field: There are three classes of message: Data, Control, and
Maintenance.
COUNT field specifies how many bytes are contained in the frame’s body.
Sometimes, count field will be corrupted during transmission, so the
receiver will accumulate as many bytes as the bad COUNT field indicates
and then use the error detection field to determine that the frame is bad.
The receiver will then wait until it sees the next SYN character to start
collecting the bytes that make up the next frame. This is sometimes called
a framing error.
28. Link Layer Services
Bit-oriented Protocols
HDLC
In bit-oriented protocols, frames are viewed as a collection of bits. High-level Data Link Control
(HDLC) protocol is used. The format is shown in Figure.
HDLC denotes both the beginning and end of a frame with the distinguished bit sequence 0 1 1 1 1
1 1 0.
This sequence might appear anywhere in the body of the frame, it can be avoided by bit stuffing.
On the sending side, any time five consecutive 1s have been transmitted from the body of the
message, the sender inserts a 0 before transmitting the next bit.
On the receiving side, five consecutive 1s arrive, the receiver makes its decision based on the next
bit it sees.
If the next bit is a 0, it must have been stuffed, and so the receiver removes it.
If the next bit is a 1, then one of the two things is true
(i) Either this is the end-of-frame marker
(ii) An error has been introduced into the bit stream.
By looking at the next bit, the receiver can distinguish between these two cases:
(i) If it sees a 0 (i.e., the last eight bits it has looked at are 01111110), then it is the end-of-frame
marker.
(ii) If it sees a 1 (i.e., the last eight bits it has looks at are 01111111), then there must have been
an error and the whole frame is discarded.
29. HDLC
To provide the flexibility necessary to support all the
options possible in the modes and configurations,
HDLC defines three types of frames: Information
frames (I-frames), supervisory frames (S-frames),
and unnumbered frames (U-frames). Each type of
frame serves as an envelope for the transmission of a
different type of message.
I-frames are used to transport user data and control
information relating to user data (piggybacking). S-
frames are used only to transport control information.
U-frames are reserved for system management.
Information carried by U-frames is intended for
managing the link itself.
30. HDLC
Frame Format
Each frame in HDLC may contain up to six fields, as shown in
the following figure, a beginning flag field, an address field, a
control field, an information field, a frame check sequence
(FCS) field, and an ending flag field. In multiple-frame
transmissions, the ending flag of one frame can serve as the
beginning flag of the next frame.
33. Link Layer Services
Clock-based Framing (SONET)
The Clock-Based Framing approach is exemplified by the Synchronous Optical
Network (SONET) standard.
SONET is the dominant standard for long distance transmission of data over optical
networks.
An STS-1 frame is used in this method. The frame format of STS-1 is shown in
figure.
It is arranged as nine rows of 90 bytes each, and the first 3 bytes of each row are
overhead, with the rest being available for data that is being transmitted over the link.
The first 2 bytes of the frame contain a special bit pattern, and these bytes can enable
the receiver to determine where the frame starts.
The receiver looks for the special bit pattern consistently, once in every 810 bytes,
since each frame is 9 × 90 = 810 bytes long.
34. Link Layer Services
Clock-based Framing (SONET)
The STS-N frame is consisting of STS-1 frame, where the bytes from these frames are
interleaved. That is, a byte from the first frame is transmitted, and then a byte from the
second frame is transmitted, and so on.
Payload from these STS-1 frames can be linked together to form a larger STS-N
payload, such a link is denoted STS-3c.
Figure: Three STS-1 frames multiplexed onto one
STS-3c frame
35. Error Detection and Correction
Data can be corrupted during transmission. For reliable
communication, errors must be detected and corrected.
Types of errors
1. Single-bit Error
2. Burst Error
36. Error Detection and Correction
Single-bit Error
In a single-bit error, only one bit in the data unit has
changed.
0 is changed to a 1 or a 1 to a 0.
E.g. Data rate: 1 Mbps = 1 × 106 bps; Possibility = 1/ 106
37. Error Detection and Correction
Burst Error
A burst error means that 2 or more bits in the data unit have
changed.
Figure shows the effect of a burst error on a data unit.
The length of burst is measured from the first corrupted to the
last corrupted bit. Some bits may not have been corrupted.
E.g., Data rate = 1 Kbps; noise = 1/100 sec;
No. of bits affected = 1 × 103 × 1/100
38. Error Detection and Correction
Redundancy
One error detection mechanism would send every data unit twice.
The receiving device would then be able to do a bit-for-bit
comparison between the two versions of data. Any discrepancy
would indicate an error.
If any error found, the necessary correction mechanism should take
place.
Disadvantage:
1. Transmission time is double.
2. Time taken for bit-for-bit comparison is high.
To overcome this drawback, instead of repeating the entire data
stream, a shorter group of bits may be appended to the end of each
unit. This technique is called redundancy.
Because the extra bits are redundant to the information; they are
discarded as soon as the accuracy of the transmission has been
determined.
40. Error Detection and Correction
Types of Redundancy Check
Four types of redundancy checks are common in data communications.
1. Vertical Redundancy Check (VRC)
2. Longitudinal Redundancy Check (LRC)
3. Cyclic Redundancy Check (CRC)
4. Checksum
41. Figure: Vertical Redundancy Check (VRC)
• Most common and least expensive
mechanism for error detection.
• VRC is also called Parity Check.
• In this technique, a redundant bit,
called parity bit, is appended to
every data unit so that the total
number of 1s in the data unit
becomes even.
• Some systems may use odd parity
checking.
• It can detect only single bit error.
1. Vertical Redundancy Check (VRC)
Error Detection and Correction
42. Figure: Longitudinal Redundancy Check (LRC)
• In LRC, a block of bits is organized in a table (rows and columns).
• For example, instead of sending a block of 32 bits, data unit is arranged
in a table made of four rows and eight columns.
• Check the parity bit for each column and create a new row of eight
bits which are parity bits for the whole block.
• Original data with eight parity bits are transferred to the receiver.
2. Longitudinal Redundancy Check (LRC)
Error Detection and Correction
43. Figure: Cyclic Redundancy Check (CRC)
• Unlike VRC and LRC, CRC
method is working based on binary
division.
• In CRC, instead of adding bits
together to achieve a desired parity,
a sequence of redundant bits, called
the CRC or the CRC remainder, is
appended to the end of a data unit so
that the resulting data unit becomes
exactly divisible by a second,
predetermined binary number.
• The redundancy bits used by CRC
are derived by dividing the data unit
by a predetermined divisor; the
remainder is the CRC.
3. Cyclic Redundancy Check (CRC)
Error Detection and Correction
44. Error Detection and Correction
CRC generator uses modulo-2
division.
• CRC checker functions exactly like
the CRC generator .
• After receiving the data appended with
the CRC, the checker does the same
modulo-2 division.
• If the remainder is all 0’s, the CRC is
dropped and the data accepted.
Otherwise, the data will be discarded (it
should be resent by the sender).
45. Figure: Check sum generator and checker
• The error detection method used by the higher-layer protocols is called
checksum.
• Like VRC, LRC and CRC, Checksum is based on the concept of
redundancy.
4. Checksum
Error Detection and Correction
46. • At the Sender (Checksum Generator)
• The unit is divided into k sections, each of n bits.
• All sections are added together using one’s complement to get the sum.
• The sum is complemented and becomes the checksum.
• The checksum is sent with the data
• At the Receiver (Checksum Checker)
• The unit is divided into k sections, each of n bits.
• All sections are added together using one’s complement to get the sum.
• The sum is complemented.
• If the result is zero, the data are accepted: otherwise, they are rejected.
• Performance
• The checksum detects all errors involving an odd number of bits.
• It detects most errors involving an even number of bits.
• If one or more bits of a segment are damaged and the corresponding bit or bits
of opposite value in a second segment are also damaged, the sums of those
columns will not change and the receiver will not detect a problem.
Error Detection and Correction
48. Flow control is a set of procedures that tells the sender how
much data it can transmit before it must wait for an
acknowledgement from the receiver.
Any receiving device has a limited speed at which it can
process incoming data and a limited amount of memory to
store the incoming data.
Incoming data must be checked and processed before they can
be used.
The rate of such processing is slower than the rate of
transmission.
For this reason, each receiving device has a block of memory,
called a buffer, reserved for storing incoming data until they
are processed.
If the buffer begins to fill up, the receiver must be able to tell
the sender to halt transmission until it is once again able to
receive.
Flow Control
49. Flow control is technique that a transmitting entity does not
conquer a receiving entity with data.
Two functional mechanisms are acknowledgment and
timeouts.
After getting each frame, the receiver will send ACK to
sender.
If the sender does not receive ACK up to reasonable
amount of time, the it retransmit the original frame; waiting
for reasonable amount of time is called timeout.
The general strategy of using acknowledgments and
timeouts to implement reliable delivery is sometimes called
automatic repeat request (ARQ).
The two flow control mechanisms are:
Stop and Wait Flow Control
Sliding Window Flow Control
Flow Control
53. Flow Control
Stop-and-Wait ARQ
The simplest ARQ scheme is the stop-and-wait algorithm.
After transmitting one frame, the sender waits for an
acknowledgment before transmitting the next frame.
If the acknowledgment does not arrive after a certain period of
time, the sender times out and retransmit the original frame.
54. Stop-and-Wait ARQ
The main drawback of the stop-and-wait algorithm is that it allows the
sender to have only one outstanding frame on the link at a time.
65. Flow Control
The sender can transmit several frames before needing
an acknowledgement.
Frames can be sent one right after another meaning that
the link can carry several frames at once and its
capacity can be used efficiently.
The receiver acknowledges only some of the frames,
using a single ACK to confirm the receipt of multiple
data frames.
Sliding window refers to imaginary boxes at both the
sender and the receiver.
Window can hold frames at either end and provides the
upper limit on the number of frames that can be
transmitted before requiring an acknowledgement.
Frames are numbered modulo-n which means they are
number from 0 to n-1.
E.g., If n=8, the frames are numbered
0,1,2,3,4,5,6,7, i.e., the size of the window is n-1
When the receiver sends ACK, it includes the number
of the next frame it expects to receive.
When the sender sees an ACK with the number 5, it
knows that all frames up through number 4 have been
received.
Sliding
Window
66. Sliding Window
The sliding window algorithm works as follows.
First sender assigns a sequence number, denoted
SeqNum to each frame.
The sender maintains three variables:
send window size (SWS), gives the upper bound on
the number of outstanding (unacknowledged) frames
that the sender can transmit;
last acknowledgment received (LAR);
last frame sent (LFS);
The sender also maintains the following invariant:
LFS – LAR ≤ SWS
Figure: Sliding window on
sender
67. Sliding Window
The receiver maintains three variables:
receive window size (RWS), gives the upper bound on
the number of out-of-order frames that the receiver is
willing to accept;
LAF denotes the sequence number of the largest
acceptable frame;
LFR denotes the sequence number of the largest
frame received;
The receiver also maintains the following invariant:
LAF – LFR ≤ RWS
Figure: Sliding window on
receiver
68. Sliding Window
The sliding window algorithm works as follows.
First sender assigns a sequence number, denoted
SeqNum to each frame.
The sender maintains three variables:
send window size (SWS), gives the upper
bound on the number of outstanding
(unacknowledged) frames that the sender can
transmit;
last acknowledgment received (LAR);
last frame sent (LFS);
The sender also maintains the following invariant:
LFS – LAR ≤ SWS
The receiver maintains three variables:
receive window size (RWS), gives the upper
bound on the number of out-of-order frames
that the receiver is willing to accept;
LAF denotes the sequence number of the
largest acceptable frame;
LFR denotes the sequence number of the
largest frame received;
The receiver also maintains the following invariant:
LAF – LFR ≤ RWS
Figure: Sliding window on
sender
Figure: Sliding window on
receiver
69. Media Access Control
The two main function of the data link layer
are Data Link Control and Media Access
Control.
The data link layer deals with the design and
procedures for communication between two
adjacent nodes: node-to-node communication.
The second function of the data link layer is
media access control, or how to share the link.
70. Media Access Control
When nodes or stations are connected and use a
common link, called a multipoint or broadcast
link, we need a multiple-access protocol to
coordinate access to the link.
The upper sub-layer of the DLL that is
responsible for flow and error control is called the
Logical Link Control (LLC) layer.
The lower sub-layer of the DLL that is mostly
responsible for multiple access resolution is called
the Media Access Control (MAC) layer.
71. Media Access Control
Many formal protocols have been revised to
handle access to a shared links;
We categorize them into three groups:
72. Media Access Control
RANDOM ACCESS or CONTENTION METHOD
In random access, no station is superior to another station.
No station is assigned the control over another.
A station that has data to send uses a procedure defined by
the protocol to make a decision on whether or not to send.
This decision depends on the state of the medium (idle or busy).
Two features of random access are:
1) There is no scheduled time for a station to transmit.
Transmission is random among the stations. That is why
these methods are called Random Access.
2) No rules specify which station should send next. Stations
compete with one another to access the medium. That is why
these methods are also called Contention Methods.
73. Media Access Control
RANDOM ACCESS or CONTENTION METHOD
In random access, each station has the right to the medium
without being controlled by any other station.
If more than one station tries to send, there is an access
conflict (collision) and the frames will be either destroyed or
modified.
To avoid access conflict or to resolve it when it happens,
each station follows a procedure that answers the following
questions:
1) When can the station access the medium?
2) What can the station do if the medium is busy?
3) How can the station determine the success or failure of the
transmission?
4) What can the station do if there is an access conflict?
74. Media Access Control
RANDOM ACCESS or CONTENTION METHOD
The random access method evolved from ALOHA protocol
which used a very simple procedure called multiple access
(MA).
The method was improved with the addition of procedure
that forces the station to sense the medium before
transmitting. This was called Carrier Sense Multiple Access
(CSMA). This method later evolved into two parallel
methods:
i. Carrier Sense Multiple Access with collision detection
(CSMA/CD); CSMA/CD tells the station what to do when a
collision is detected.
ii. Carrier Sense Multiple Access with collision avoidance
(CSMA/CA); CSMA/CA tries to avoid the collision.
75. RANDOM ACCESS or CONTENTION METHOD
ALOHA
ALOHA, the earliest random access method was
developed at the University of Hawaii in 1970.
It was designed for a radio (wireless) LAN, but it can
be used on any shared medium.
Pure ALOHA
The original ALOHA protocol is called pure
ALOHA.
The idea is that each station sends a frame whenever
it has a frame to send. When the channel is shared,
there is the possibility of collision between frames
from different station.
Media Access Control
77. Pure ALOHA
In the figure, there are four
stations that contend with one
another for access to the shared
channel.
Each station sends two frames;
there are a total of eight frames
on the shared medium.
Some of these frames collide
because multiple frames are in
contention for the shared channel.
Only two frames survive: frame
1.1 and frame 3.2.
The pure ALOHA protocol relies
on acknowledgments from the
receiver.
If the acknowledgment does not
arrive after a time-out period, the
station assumes that the frame (or
acknowledgment) has been
destroyed and resends the frame.
RANDOM ACCESS or CONTENTION
METHOD
Media Access Control
79. Procedure for pure ALOHA protocol
A Collision involves two or more
stations.
If all these stations try to resend
their frames after the time-out, the
frames will collide again.
Pure ALOHA dictates that when
the time-out period passes, each
station waits a random amount of
time before resending its frame.
The randomness will help avoid
more collisions. This time is called
the Back-off time TB.
Pure ALOHA has a 2nd method to
prevent congesting the channel
with retransmitted frames . After a
maximum number of
retransmission attempts, Kmax’s
station must give up and try later.
RANDOM ACCESS or CONTENTION
METHOD
Media Access Control
81. Vulnerable time
The length of time in which there is a
possibility of collision is the
vulnerable time.
We assume that the stations send fixed-
length frames with each frame taking
Tfr seconds to send.
Pure ALOHA vulnerable time = 2 × Tfr
The throughput for pure ALOHA is
S = G × e-2G
where G = average number of frames
generated by the system during one
frame transmission.
The maximum throughput
Smax = 0.184 when G = ½
RANDOM ACCESS or CONTENTION METHOD
Media Access Control
83. • Slotted ALOHA was invented to improve the efficiency of pure ALOHA.
• In slotted ALOHA, we divide the time into slots of Tfr seconds and force the station to send
only at the beginning of the time slot.
• Because a station is allowed to send only at the beginning of the synchronized time slot, if a
station misses this moment, it must wait until the beginning of the next time slot. The
vulnerable time is now reduced to one-half , equal to Tfr .
• Slotted ALOHA vulnerable time = Tfr
• Throughput: It can be proved that the average number of successful transmissions for slotted
ALOHA is
S = G × e-G
The maximum throughput
Smax = 0.368 when G = 1
Slotted ALOHA
RANDOM ACCESS or CONTENTION METHOD
Media Access Control
85. Media Access Control
Carrier Sense Multiple Access (CSMA)
CSMA is based on the principle
‘Sense before transmit’ or ‘listen
before talk’.
CSMA can reduce the possibility of
collision, but it cannot eliminate it.
The reason for this is shown in Figure
– Space and time model of the
collision in CSMA.
Stations are connected to a shared
channel (usually a dedicated medium).
The possibility of collision still exists because of propagation delay; When a station sends a
frame, it still takes time (although very short) for the first bit to reach every station and for
every station to sense it. In other words, a station may sense the medium and find it idle,
only because the first bit sent by another station has not yet been received.
86. Vulnerable Time for CSMA
Carrier Sense Multiple Access (CSMA)
Media Access Control
87. Vulnerable Time for CSMA
• The vulnerable time for CSMA is the propagation time Tp. This is the time needed
for a signal to propagate from one end of the medium to the other.
• When a station sends a frame, and any other station tries to send a frame during
this time, a collision will result.
• But if the first bit of the frame reaches the end of the medium, every station will
already have heard the bit and will refrain from sending.
• In the figure, the leftmost station A sends a frame at time t1, which reaches the rightmost
station D at tine t1+Tp. The grey area shows the vulnerable area in time and space.
Carrier Sense Multiple Access (CSMA)
Media Access Control
88. Persistence Methods
• What should a station do if the channel is busy? What
should a station do if the channel is idle?
• Three methods have been devised to answer these
questions:
1. 1-persistent method
2. non-persistent method
3. p-persistent method
Carrier Sense Multiple Access (CSMA)
Media Access Control
89. Persistence Methods
• Figure shows the behavior of three persistence methods when a
station finds a channel busy.
1-persistent
• Simple and straightforward.
• In this methods, after the station finds the line idle, it sends its
frame immediately (with probability 1).
• This method has the highest chance of collision because two or
more stations may find the idle and send their frames
immediately.
Media Access Control
Carrier Sense Multiple Access (CSMA)
90. Non-persistent
• In this methods, a station that has a frame to send senses the line.
• If the line is idle, it sends immediately.
• If the line is not idle, it waits a random amount of time and then senses the
line again.
• The non-persistent approach reduces the chance of collision. Because it
is unlikely that two or more stations will wait the same amount of time
and retry to send simultaneously.
• However, this method reduces the efficiency of the network because the
medium remains idle when there may be stations with frames to send.
Media Access Control
Carrier Sense Multiple Access (CSMA)
93. • CSMA/CD augments the algorithm to handle the
collision.
• In this method, a station monitors the medium after it
sends a frame to see if the transmission was successful.
If so, the station is finished.
• If, however, there is collision, the frame is sent again.
Carrier Sense Multiple Access with Collision
Detection (CSMA/CD)
Media Access Control
94. • Procedure
• We need to sense the channel before we start sending the
frame by using one of the persistent processes.
• Transmission and collision detection is a continuous
process.
• We do not send the entire frame (bit by bit).
• By sending a short jamming signal, we can enforce the
collision, in case, other stations have not yet sensed the
collision.
Carrier Sense Multiple Access with
Collision Detection (CSMA/CD)
Media Access Control
99. • CSMA/CA was invented to avoid collisions on wireless
networks.
• Collisions are avoided through the use of CSMA/CA’s
three strategies:
1. Interframe Space (IFS)
2. Contention Window
3. Acknowledgment
Carrier Sense Multiple Access with
Collision Avoidance (CSMA/CA)
Media Access Control
100. 1. Interframe Space (IFS)
• When an idle channel is found, the station does not send
immediately.
• It waits for a period of time called the interframe space
or IFS.
• Even though the channel may appear idle when it is
sensed, a distant station may have already started
transmitting. The distant station’s signal has not yet
reached this station.
Carrier Sense Multiple Access with
Collision Detection (CSMA/CA)
Media Access Control
101. 2. Contention Window
• The contention window is an amount of time divided
into slots.
• A station that is ready to send chooses a random number
of slot as its wait time.
• The station needs to sense the channel after each time
slot.
• However, if the station finds the channel busy, it does
not restart the process; it just stops the timer and restarts
it when the channel is sensed as idle. This gives priority
to the station with the longest waiting time.
Carrier Sense Multiple Access with
Collision Detection (CSMA/CA)
Media Access Control
102. 3. Acknowledgment
• With all these precautions, there still may be a collision
resulting in destroyed data, and the data may be
corrupted during the transmission.
• The positive acknowledgment and the time-out timer can
help guarantee that the receiver has received the frame.
Carrier Sense Multiple Access with
Collision Detection (CSMA/CA)
Media Access Control
103. Media Access Control
Many formal protocols have been revised to handle
access to a shared links;
We categorize them into three groups:
104. • In controlled access, the stations consult one another to
find which station has the right to send.
• A station cannot send unless it has been authorized by
other stations.
• Three popular controlled-access methods:
1. Reservation
2. Polling
3. Token Passing
Media Access Control
CONTROLLED ACCESS
105. 1. Reservation
• In the reservation method, a station needs to make a
reservation before sending data.
• Time divided into intervals.
• In each interval, a reservation frame precedes the data frames
sent in that interval.
• This figure shows a situation with five stations and five-mini
slot reservation frame. In the first interval, only stations 1, 3
and 4 have made reservations. In the second interval, only
station 1 has made a reservation.
CONTROLLED ACCESS
106. 2. Polling
• Here one device is designated as a primary station and the other devices are
secondary stations. All data exchanges must be made through the primary
device.
• The primary device controls link; the secondary devices follow its instructions.
• The primary device is the initiator of a session.
• If the primary wants to receive data, it asks the secondary if they have
anything to send; this is called poll function.
• If the primary wants to send data, it tells the secondary to get ready to receive;
this is called select function.
CONTROLLED ACCESS
107. 3. Token Passing
• In the token-passing method, the stations in a network are
organized in a logical ring.
• For each station, there is a predecessor and a successor.
CONTROLLED ACCESS
108. • Channelization is a multi-access method in which the
available bandwidth of a link is shared in time,
frequency, or through code between different stations.
• Three channelization protocols are used. They are
1. Frequency-Division Multiple Access (FDMA)
2. Time-Division Multiple Access (TDMA)
3. Code-Division Multiple Access (CDMA)
CHANNELIZATION
110. 1. Frequency-Division Multiple Access (FDMA)
• The available bandwidth is divided into frequency
bands.
• Each station is allocated a band to send its data.
• Each band is reserved for a specific station, and it
belongs to the station all the time.
• Each station also uses a band-pass filter to confine the
transmitter frequencies.
• To prevent station interferences, the allocated bands are
separated from one another by small guard bands.
• FDMA specifies predetermined frequency band for the
entire period of communication.
CHANNELIZATION
112. 2. Time-Division Multiple Access (TDMA)
• The stations share the bandwidth of the channel in time.
• Each station is allocated a time slot during which it can send
data.
• Each station transmits its data in assigned time slot.
• The main problem with TDMA lies in achieving
synchronization between the different stations.
• Each station needs to know the beginning of its slot and the
location of its slot.
• This is difficult because of propagation delays introduced in
the system if the stations are spread over a large are.
• To compensate for the delays, we can insert guard times.
Synchronization is normally accomplished by having some
synchronization bits at the beginning of each bit.
CHANNELIZATION
114. 3. Code-Division Multiple Access (CDMA)
• CDMA differs from FDMA because only one channel
occupies the entire bandwidth of the link.
• It differs from TDMA because all stations can send data
simultaneously; there is no time-sharing.
• In CDMA, one channel carries all transmissions
simultaneously.
CHANNELIZATION
115. • A LAN can be used as an isolated network to connect
computers in an organization for sharing resources.
• Most of the LANs today are linked to a Wide Area Network
(WAN) or the Internet.
• The LAN market has been several technologies such as
Ethernet
Token Ring
Token Bus
FDDI
ATM LAN
ETHERNET (IEEE 802.3)
116. • Ethernet is a baseband LAN specification invented in
1970s by Xerox Corporation that operates at 10 Mbps
using CSMA/CD to run over coaxial cable.
• The term is now often used to refer to all CSMA/CD
LANs.
ETHERNET (IEEE 802.3)
117. • In 1985, the Computer Society of the IEEE started a project,
called Project 802, to set standards to enable
intercommunication among equipments from variety of
manufacturers.
• The Standard was adopted by American National Standards
Institute (ANSI).
• In 1987, the International Organization for Standardization
(ISO) also approved it as an international standard under the
designation ISO 8802.
• IEEE 802.3 specification was developed based on the original
Ethernet Technology, jointly by Digital Equipment
Corporation, Intel Corporation and Xerox Corporation.
• Ethernet is compatible with IEEE 802.3.
• Ethernet and IEEE 802.3 are usually implemented in either an
interface card or in circuitry on a primary circuit board.
ETHERNET (IEEE 802.3)
120. IEEE STANDARDS
• The relationship of the 802 Standard to the traditionl OSI model
is shown in the below figure.
• The IEEE has subdivided the data link layer into two sub layers.
(i) Logical Link Control (LLC) (ii) Media Access Control
(MAC).
ETHERNET (IEEE 802.3)
121. IEEE STANDARDS
• Logical Link Control (LLC)
• In IEEE Project 802, flow control, error control, and
part of framing duties are collected into a sublayer
called the logical link control.
• Framing is handled in both LLC sublayer and MAC
sublayer.
• The LLC provides a single data link control protocol for
all IEEE LANs, but the MAC sublayer provides
different protocols for different LANs.
• A single LLC protocol can provide interconnectivity
between different LANs because it makes the MAC
sublayer trransparent.
ETHERNET (IEEE 802.3)
122. IEEE STANDARDS
• Media Access Control (MAC)
• IEEE Project 802 has created a sublayer, called
Media Access Control that defines the specific
access method for each LAN.
• For example, it defines CSMA/CD as the media
access method for Ethernet LANs and the token
passing method for Token Ring and Token Bus
LANs.
• A part of the framing function is also handled by the
MAC layer.
ETHERNET (IEEE 802.3)
123. IEEE STANDARDS
• MAC Sublayer
• In standard Ethernet, the MAC sublayer
governs the operation of the access method.
• It also frames the data received from the
upper layer and passes them to the physical
layer.
ETHERNET (IEEE 802.3)
125. Figure:
Ethernet (802.3) Frame Format
• Preamble: Each frame starts with a preamble of 7 bytes, each byte
containing bit 10101010 used to synchronize receiver’s clock to
sender’s.
• SFD: This field containing a byte sequence 10101011 denotes the
start of frame .
• Addresses: Destination Address (DA) field is 6 bytes and contains
physical address of the destination station. Source address (SA) field
is also 6 bytes and contains the physical address of the sender of the
packet.
• Length: The length indicates the number of bytes of data that
follows this field. (Maximum 1500 bytes)
IEEE 802.3
126. Figure: Ethernet (802.3) Frame Format
• Data: carries data encapsulated from the upper-layer
protocols.
• Pad: Zeroes are added to the data field to make minimum
data length = 46 bytes. (If data in the frame is insufficient to
fill the frame to its minimum 64-byte size, padding bytes are
inserted to ensure at least a 64-byte frame.)
• Frame Check Sequence (FCS): This sequence contains 4-
byte cyclic redundancy check (CRC) value, which is created
by sending device and is recalculated by receiving device to
check for damaged frames.
IEEE 802.3
132. Comparison of ETHERNET and IEEE 802.3
10Base5, 10Base2, 10BaseF: Signal regeneration can be done with help of
repeaters.
10BaseT: A hub functions as a repeater with additional functions.
133. 10Base5
• Advantages:
• Low attenuation
• Excellent noise immunity
• Superior mechanical strength
• Disadvantages:
• Bulky
• Difficult to pull
• Transceiver boxes are too expensive
• Wiring represented a significant part of total installed cost.
10Base2
• Advantages:
• Easier to install
• Reduced hardware cost
• BNC connectors widely deployed (Lower installation costs)
• Disadvantages:
• Attenuation is not good
• Could not support as many stations due to signal reflection caused by BNC Tee
connector.
ETHERNET (IEEE 802.3)
134.
135. 10BaseT
• Advantages:
• Fewer cable problems
• Easier to troubleshoot than coax.
• Disadvantages:
• Cable length at most 100 meters.
10BaseF
• Advantages:
• Could be done without pulling new wires.
• Each hub amplifies and restores incoming signal.
ETHERNET (IEEE 802.3)
136. EXPERIENCES WITH ETHERNET
• Ethernets work best under light loads (Utilization over
30% is considered heavy.)
• Network capacity is wasted by collision.
• Most networks are limited to about 200 hosts
(Specification allows for upto 1024.)
• Transport level flow control helps reduce load (number of
back to back packets)
• Ethernet is inexpensive, fast and easy to administer.
ETHERNET (IEEE 802.3)
137. EXPERIENCES WITH ETHERNET
Ethernet Problems
• Ethernet’s peak utilization is pretty low (like Aloha).
• Peak throughput worst with
i. More hosts: More collisions needed to identify single sender.
ii. Smaller packet sizes: More frequent arbitration.
iii. Longer links: collision take longer to observe, more wasted
bandwidths.
iv. Efficiency is improved by avoiding these conditions.
• Why does Ethernet win?
i. There are lots of LAN protocols
ii. Price
iii. Performance
iv. Availability
v. Ease of use
vi. Scalability
ETHERNET (IEEE 802.3)
138. • Wireless communication is one of the fastest-growing
technologies because the demand for connecting
devices without use of cables is increasing
everywhere.
• Wireless LANs can be found on college campuses, in
office buildings, and in many public areas.
• IEEE 802.11 wireless LANs are sometimes called
wireless Ethernet.
• IEEE 802.11 operates on the physical and data link
layers.
Wireless LAN
139. 802.11 Wireless LAN
Provides network connectivity over wireless media
An Access Point (AP) is installed to act as Bridge
between Wireless and Wired Network
The AP is connected to wired network and is
equipped with antennae to provide wireless
connectivity
Network
connectivity
to the
legacy
wired LAN
Desktop
with PCI 802.11 LAN card
Laptop
with PCMCIA 802.11 LAN card
Access Point
140. • IEEE 802.11 defines two kinds of services. They are
i. Basic Service Set (BSS)
ii. Extended Service Set (ESS)
IEEE 802.11 Wireless LAN
141. • Basic Service Set (BSS)
• A Basic Service Set (BSS) is made of stationary or mobile wireless
stations and an optional central base station, known as the Access Point
(AP).
• The BSS without an AP is a stand-alone network and cannot send data
to other BSSs. It is called an ad hoc network.
• A BSS with an AP is sometimes referred to as an infrastructure
network.
IEEE 802.11 Wireless LAN
142. • Extended Service Set (ESS)
• An Extended Service Set
(ESS) is made up of two or
more BSSs with Access
Points (AP).
• In this case, the BSSs are
connected through a
distribution system, which is
usually a wired LAN such as
an Ethernet.
• The distribution system
connects the APs in the BSSs.
• The extended service set uses
two types of stations. They
are (i) Mobile stations (ii)
Stationary stations.
• The mobile stations are
normal stations inside a BSS.
The stationary stations are AP
stations that are part of a
wired LAN.
IEEE 802.11 Wireless LAN
143. • Station Types
• IEEE 802.11 defines three types of stations based on their
mobility in a wireless LAN.
i. No-transition mobility
ii. BSS-transition mobility
iii. ESS-transition mobility
• A station with no-transition mobility is either stationary (not
moving) or moving only inside a BSS.
• A station with BSS-transition mobility can move from one BSS
to another, but the movement is confined inside one ESS.
• A station with ESS-transition mobility can move from one ESS
to another.
• However, IEEE 802.11 does not guarantee that communication
is continuous during the move.
IEEE 802.11 Wireless LAN
144. • MAC Sublayer
• IEEE 802.11 defines two types of MAC sublayers.
i. The Distributed Coordination Function (DCF)
ii. The Point Coordination Function (PCF)
IEEE 802.11 Wireless LAN
145. IEEE 802.11 Wireless LAN
In wireless networking, the hidden node problem or hidden
terminal problem occurs when a node is visible from a
wireless access point (AP), but not from other nodes
communicating with said AP. This leads to difficulties in
media access control.
151. Addressing Mechanism
• Four possible Cases of Addressing
• Case 1: 00 in this case To DS = 0 and From DS = 0
This means that the frame is not going to a distribution system (To DS = 0)
and is not coming from a distribution system (From DS = 0). The frame is
going from one station in a BSS to another without passing through the
distribution system. The ACK frame should be sent to the original sender.
• Case 2: 01 in this case To DS = 0 and From DS = 1
This means that the frame is coming from a distribution system (From DS =
1). The frame is coming from an AP and going to a station. The ACK frame
should be sent to the AP. Note that Address 3 contains the original sender of
the frame (in another BSS).
• Case 3: 10 in this case To DS = 1 and From DS = 0
This means that the frame is going to a distribution system (From DS = 1).
The frame is going from a station to AP. The ACK is sent to the original
station. Note that Address 3 contains the final destination of the frame (in
another BSS).
• Case 4: 11 in this case To DS = 1 and From DS = 1
This means that the frame is going from AP to another AP in a wireless
distribution system. We need four addresses to define the original sender, the
final destination and two intermediate APs.
152. Addressing Mechanism
• IEEE 802.11 addressing mechanism specifies four cases, defined
by the value of the two flags in the FC field, To DS and From DS.
• Either flag can be either 0 or 1, resulting in four different
situations.
• Address 1 is the address of the next device.
• Address 2 is the address of the previous device.
• Address 3 is the final destination station, if the address is not
defined by Address 1.
• Address 4 is the original source station, if it is not the same as
address 2.
153.
154. Physical Layer
• IEEE 802.11 LAN has several physical layers defined to operate with
its MAC layer.
• Specification of the 802.11 types are:
• IEEE 802.11 FHSS – Frequency Hopping Spread Spectrum
• IEEE 802.11 DSSS – Direct Sequence Spread Spectrum
• IEEE 802.11 Infrared
• IEEE 802.11a OFDM – Orthogonal Frequency Division Multiplexing
• IEEE802.11b DSSS
• IEEE802.11g OFDM
• (FSK: Frequency Shift Keying; PSK: Phase Shift Keying; PPM: Pulse
Position Modulation; QAM: Quadrature Amplitude Modulation)
155. BLUETOOTH
• Bluetooth is a wireless LAN technology designed to
connect devices of different functions such as telephones,
notebooks, computers, cameras, printers, coffee makers,
and so on.
• A Bluetooth LAN is an ad hoc network, which means that
the network is formed spontaneously.
• The device sometimes called gadgets, find each other and
make a network called a piconet.
• A Bluetooth LAN can even be connected to the Internet if
one of the gadgets has this capability.
• A Bluetood LAN, by nature, cannot be large.
• Architecture
• Bluetooth defines two types of networks.
i. Piconet
ii. Scatternet
157. BLUETOOTH
• Piconet
• A Bluetooth network is called a piconet, or a small net.
• The communication between the primary and the secondary can be
one-to-one or one-to-many.
• It can have up to eight stations, one of which is called the master; the
rest are called slaves.
• Slaves synchronize their clocks and hopping sequence with the
master.
158. BLUETOOTH
• Scatternet
• Piconets can be combined to form what is called a scatternet.
• This station can receive message from the primary in the first piconet
(as a secondary) and, acting as a primary, deliver them to secondaries
in the second piconet.
• A slave station in one piconet can become the master in another
piconet.
• A Bluetooth device has a built-in-short range radio transmitter.
159. BLUETOOTH
• Bluetooth Layers
• Bluetooth uses several layers that do not exactly match those of the
Internet model.
• Bluetooth devices are low-power and have range 10 centimeters t0
10 meters.
• Bluetooth uses a 2.4 GHz ISM band divided into 79 channels of 1
MHz each.
160. BLUETOOTH
• Radio Layer
• Roughly equal to physical layer of the Internet model.
Physical links can be synchronous or asynchronous.
• Uses Frequency-Hopping Spread Spectrum (FHSS).
• Changes its modulation frequency 1600 times per second.
• Uses frequency shift keying (FSK) with Gaussian
bandwidth filtering to transform bits to a signal.
161. BLUETOOTH
• Baseband Layer
• Roughly equal to MAC sublayer in LANs. The access
method is Time Division Multiple Access (TDMA).
• The primary (master) and secondary (slave) communicate
with each other using time slots.
• The length of the time slot is exactly the same as the dwell
time, 625 microseconds.
• Time division duplexing TDMA (TDD-TDMA) is a kind
of half-duplex communication in which the slave and
receiver send and receive data, but not at the same time
(half-duplex).
163. BLUETOOTH
• Single-secondary communication
• Also called Single-slave communication
• If the piconet has only one secondary, the TDMA operation is very
simple.
• The time is divided into slots of 625 micro seconds.
• The primary uses even numbered slots (0,2,4,…) and the secondary
uses odd numbered slots (1,3,5,…).
• TDD-TDMA allows the primary and the secondary to communicate
in half duplex mode.
• In Slot 0, the primary sends and the secondary received; In Slot 1, the
secondary sends and the primary receives. The cycle is repeated.
165. BLUETOOTH
• Multiple-Secondary communication
• Also called multiple-slave communication (if there is more than one
secondary in the piconet.)
• Master uses even-number slots.
• Slave sends in the next odd-numbered slot if the packet in the previous lot
was addressed to it.
• In slot 0, the primary sends a frame to secondary 1.
• In slot 1, only secondary 1 sends a frame to the primary because the
previous frame was addressed to secondary 1; other secondaries are silent.
• In slot 2,the primary sends a frame to secondary 2.
• In slot 3, only secondary 2 sends a frame to the primary because the
previous frame was addressed to secondary 2; other secondaries are silent.
• The cycle contiunes.
166. BLUETOOTH
• PHYSICAL LINKS
• Two types of links can be created between a primary and a secondary:
i. Synchronous Connection Oriented (SCO) Link
ii. Asynchronous Connectionless Link (ACL)
• Synchronous Connection-oriented (SCO) Link
• SCO is used for real-time audio where avoiding delay is all
important.
• Avoiding latency is more important than integrity.
• A secondary can create upto three SCO links with the primary,
sending digitized audio (PCM) at 64kbps in each link.
• Transmission using slots.
• No retransmission.
• Asynchronous Connectionless Link (ACL)
• ACL is used when data integrity is more important than avoiding
latency.
167. BLUETOOTH
• FRAME FORMAT
• A frame in the baseband layer can be one of three types: one-
slot, three-slot, or five-slot.
• A slot is 625 micro seconds.
• In a one-slot frame exchange, 259 micro seconds is needed
for hopping and control mechanisms. The size of a one-slot
frame is (625-259) 366 bits.
• A three-slot frame occupies three slots. Since 259 micro
sends is needed for hopping, the length of the frame is 3 ×
625 – 259 = 1616 micro seconds or bits.
• A five-slot frame also uses 259 bits for hopping, which
means that the length of the frame is 5 × 625 -259 = 2866
bits.
169. BLUETOOTH
• FRAME FORMAT
• Access code: This 72-bit field normally contains synchronization bits and the identifier of the
primary to distinguish the frame of one piconet from another.
170. BLUETOOTH
• L2CAP (Logical Link Control and Adaptation Protocol)
• Equivalent to LLC sublayer in LANs.
• Used for data exchange on ACL link. SCQ channels do not use
L2CAP.
• Frame format contains the following three fields: Length,
ChannelID, Data and Control.
• L2CAP can do Multiplexing, segmentation and reassembly,
QoS and group management.
171. Switching
Connectivity
Whenever we have multiple devices, we have the problem of how to
connect them to make one-on-one communication possible.
One solution is to install a point-to-point connection between each pair
of devices (mesh topology) or between a central device (hub) and
every other device (star topology).
However, these methods are impractical and wasteful when applied to
very large networks.
The number and length of the links require too much infrastructure to
be cost efficient, and the majority of those links would be idle most of
the time.
In Bus topology, the distances between devices and the total number
of devices increase beyond the capacities of the media and equipment.
A better solution is switching.
172. Switches
Connectivity
A Switched network consists of a series of interlinked nodes, called
Switches.
Switches are devices capable of creating temporary connections
between two or more devices linked to the switch.
In a switched network, some of these nodes are connected to the
communicating devices (e.g. telephones). Others are used only for
routing.
174. Switches
Circuit-switched Network
Circuit switching creates a direct physical connection between two
devices such as phones or computers.
A circuit switch is a device with n inputs and m outputs that creates a
temporary connection between an input link and an output link
175. Switches
Packet Switching
Circuit switching was designed for voice communication. In a telephone
conversation, for example, once a circuit is established, it remains connected for
the duration of the session.
1. Circuit switching is less well suited to data and other non-voice transmissions.
Non-voice transmissions tend to be bursty; meaning that data come in spurt
with idle gaps between them. When circuit-switched links are used for data
transmission, therefore, the line is often idle and its facilities wasted.
2. A second weakness of circuit-switched connections for data transmission is in its
data rate. A circuit-switched link creates the equivalent of a single cable between
two devices and thereby assume a single data rate for both devices.
This assumption limits the flexibility and usefulness of a circuit-switched
connection for networks interconnecting a variety of digital devices.
3. Third, circuit switching is inflexible. Once a circuit has been established, that
circuit is the path taken by all parts of the transmission whether it remains the
most efficient / available or not.
Finally, circuit switching sees all transmission as equal.
176. Switches
Packet-switched Network
When a computer attempts to send a file to another computer, the file
is broken into packets so that it can be sent across the network in the
most efficient way.
177. Switches
Connectionless Packet-switched Network
Each packet contains complete addressing or routing
information (Destination Address, Source Address, Total
number of pieces, Sequence number - - written in the header
section of packet)
178. Switches
Connection-oriented Packet-switched Network
Data packets are sent sequentially over a predefined route.
Packets are assembled, given a sequence number and then transported over
the network to a destination in order.
In this mode, address information is not required. This is also known as
virtual circuit switching.
179. Switches
Message switched Network
Message switching is a method in which the whole
message is stored in a switch and forwarded when a
route is available.
180. Switching and Forwarding
Switch
A mechanism that allows us to
interconnect links to form a
large network
A multi-input, multi-output
device which transfers packets
from an input to one or more
outputs
A switch is connected to a set of
links and for each of these links,
runs the appropriate data link
protocol to communicate with
that node
Adds the star topology
to the links
43
181. Switching and Forwarding
A switch’s primary job is to receive incoming packets on one of its
links and to transmit them on some other link
This function is referred as switching or forwarding
According to OSI architecture this is the
main function of the
network layer
How does the switch decide which output port to place each packet
on?
It looks at the header of the packet for an identifier that it uses to
make the decision
Two common approaches
Datagram or Connectionless approach
Virtual circuit or Connection-oriented approach
A third approach source routing is less common
44
182. Switching and Forwarding
packet contains
Datagrams
Key Idea
Every
enough information to
enable any switch to decide
how to get it to destination
Every packet
contains
the complete
destination address
To decide how to
packet, a
forward a
consults
a
forwarding
switch
table (sometimes
called a routing table)
An example network
Dest Port
-------------------
A 3
B.0
C.3
D.3
E.2
F.1
G.0
H.0
Forwarding Table
for Switch 2
45
183. Switching and Forwarding
Characteristics of Connectionless (Datagram) Network
A host can send a packet anywhere at any time, since any packet that turns
up at the switch can be immediately forwarded using the forwarding table
When a host sends a packet, it does NOT know if the network is capable
of delivering it or if the destination host is even up and running
Each packet is forwarded independently of previous packets that might
have been sent to the same destination.
Thus two successive packets from host A to
host B may follow completely different paths
A switch or link failure might not have any serious effect on
communication if it is possible to find an alternate route around the failure
and update the forwarding table accordingly
Virtual Circuit Switching (connection-oriented)
Uses the concept of virtual circuit (VC)
First set up a virtual connection from the source host to the destination host
and then send the data
46
184. Switching and Forwarding
Two-stage process
Connection setup
Data Transfer
Host A wants to send
packets to host B
Connection setup
Establish “connection state” in each of the switches
between the source and destination hosts
The connection state for a single connection consists of an
entry in the “VC table” in each switch through which the
connection passes
47
185. Switching and Forwarding
Characteristics of VC
Since host A has to wait for the connection request to reach the far side of the network
and return before it can send its first data packet, there is at least one RTT of delay
before data is sent
While the connection request contains the full address for host B (which might be quite
large, being a global identifier on the network), each data packet contains only a small
identifier, which is only unique on one link.
Thus the per-packet overhead caused by the header is reduced relative to the datagram model
If a switch or a link in a connection fails, the connection is broken and a new one will
need to be established.
Also the old one needs to be torn down to free up table storage space in the switches
The issue of how a switch decides which link to forward the connection request on has
similarities with the function of a routing algorithm
Comparison with the Datagram Model
Datagram network has no connection establishment phase and each switch processes
each packet independently
Each arriving packet competes with all other packets for buffer space
If there are no buffers, the incoming packet must be dropped
48
186. Switching and Forwarding
Good Properties of VC
By the time the host gets the go-ahead to send data, it knows quite a lot about the
network-
For example, that there is really a route to the receiver and that the receiver is
willing to receive data
It is also possible to allocate resources to the virtual circuit at the time it is established
X.25 network ( an early virtual-circuit-based networking technology but now
largely obsolete) allocates buffers per VC
In VC, we could imagine providing each circuit with a different quality of service (QoS)
The network gives the user some kind of performance related guarantee
Switches set aside the resources they need to meet this guarantee
For example, a percentage of each outgoing link’s bandwidth
Delay tolerance on each switch
Most popular examples of VC technologies are X.25, Frame Relay and ATM
However, with the success of the Internet’s connection-less model, none of them enjoys
great popularity today
49
187. Switching and Bridging
• BRIDGES
• A class of switch that is used to forward packets between
shared-media LANs such as Ethernet. Such switches are
sometimes known by the obvious name of LAN switches;
historically they have also been referred to as bridges.
• It is a node that forward frames from one Ethernet to the
other. This node would be in promiscuous mode, accepting
all frames transmitted on either of the Ethernets, so it could
forward them to the other. A bridge is connected between
two LANs with port.
• By using the port number, the LANs are addressed.
• Connected LANs are known as extended LAN.
188.
189. Switching and Bridging
• Functions of BRIDGES
• Bridges can divide the large network into smaller segments.
• A bridge operates in both the physical layer and the data link
layer.
• As a physical layer device, it regenerates the signal it receives.
• As a data link layer device, the bridge can check the physical
(MAC) addresses (source and destination) contained in the
frame.
• Bridges will keep the traffic of each segment separately.
• Bridges can control the congestion and isolate the problem
links.
190. Switching and Forwarding
ATM (Asynchronous Transfer Mode)
Most well-known VC-based networkingtechnology
Somewhat pasts its peak in terms of deployment
Was important in the 1980s and early 1990s
High-speed switching technology
Was thought of to take over the world
Connection-oriented packet-switched network
Packets are called cells
5 byte header + 48 byte payload
Fixed length packets are easier to switch in hardware
Simpler to design
ATM
VPI: Virtual Path Identifier
CLP: Cell Loss Priority
GFC: Generic Flow Control (not used)
VCI: Virtual Circuit Identifier
(VPI + VCI together makes the VC number we talked about)
Type: management, congestion control HEC: Header Error Check (CRC-8)
50
191. Source Routing
All the information about network topology that is
required to switch a packet across the network is
provided by the source host
Notes on Source Routing
Assumes that the source host knows enough about the
topology of the network
Analogous the problem of building the forwarding
tables in datagram networks or
figuring out where to send a setup packet in a virtual
circuit network
We can not predict how the header needs to be (# of
switches in the path)
Can be used in both
datagram and virtual circuit
networks
For example, IP, which is a datagram protocol includes a
source route option that allows selected packets to be source
routed.
Switching and Forwarding
51
192. Bridges and LAN Switches
Bridges and LAN Switches
Class of switches that is used to forward packets between shared-media LANs such as
Ethernets
Known as LAN switches
Referred to as Bridges
Suppose you have a pair of Ethernets that you want to interconnect
One approach is put a repeater in between them
It might exceed the physical limitation of the Ethernet
No more than four repeaters between any pair of hosts
No more than a total of 2500 m in length is allowed
An alternative would be to put a node between the two Ethernets and have the node forward
frames from one Ethernet to the other
This node is called a Bridge
A collection of LANs connected by one or more bridges is usually said to form an Extended LAN
Simplest Strategy for Bridges
Accept LAN frames on their inputs and forward them out to all other outputs
Used by early bridges
Learning Bridges
Observe that there is no need to forward all the frames that a bridge receives
52
193. Consider the following figure
When a frame from host A that is addressed to host B arrives on port 1, there
is no need for the bridge to forward the frame out over port 2.
How does a bridge come to learn on which port the various hosts reside?
Solution
Download a table into the bridge
Who does the download?
Human
Too much work for maintenance
Bridges and LAN Switches
Host Port
--------------------
A 1
B 1
C 1
X 2
Y 2
Z 2
53
194. Bridges and LAN Switches
Can the bridge learn this information by itself?
Yes
How
Each bridge inspects the source address in all the frames it receives
Record the information at the bridge and build the table
When a bridge first boots, this table is empty
Entries are added over time
A timeout is associated with each entry
The bridge discards the entry after a specified period of time
To protect against the situation in which a host is moved from one network to
another
If the bridge receives a frame that is
addressed to host not currently in the table
Forward the frame out on all other ports
54
195. Bridges and LAN Switches
Strategy works fine if the extended LAN does not have a loop
in it
Why?
Frames potentially loop through the extended LAN forever
Bridges B1, B4, and B6 form a loop
55
196. Bridges and LAN Switches
How does an extended LAN come to have a loop in it?
Network is managed by more than one administrator
For example, it spans multiple
departments in an
organization
It is possible that no single person
knows the entire configuration of the network
A bridge that closes a loop might be added without anyone knowing
to provide
Loops are built into the network
redundancy in case of failures
Solution
Distributed Spanning Tree Algorithm
56
197. Spanning Tree Algorithm
Think of the extended LAN as being represented by a graph that
possibly has loops (cycles)
A spanning tree is a sub-graph of this
graph that covers all the vertices but contains no
cycles
Spanning tree keeps all the vertices of
the original graph but throws out some of the edges
Example of (a) a cyclic graph; (b) a corresponding spanning tree.
57
198. Spanning Tree Algorithm
Developed by Radia Perlman at Digital
A protocol used by a set of bridges to agree upon a spanning
tree for a particular extended LAN
IEEE 802.1 specification for LAN bridgesis
based on this algorithm
Each bridge decides the ports over which it is and is not willing
to forward frames
In a sense the extended LAN is reduced to an acyclic tree
Details are NOT required for the exam purposes
Take point: Spanning Tree Algorithm removes the cycles/loops
from the extended (bridged) LANs
58
199. Limitation of Bridges
Do not scale
Spanning tree algorithm does not scale
Broadcast does not scale
Nodes get bothered with too many broadcasts that the
bridges forward to ALL nodes
Do not accommodate heterogeneity
Ethernet with Ethernet, Wi-Fi with Wi-Fi, etc.
A solution
Virtual LAN (VLAN)
59
200. Virtual LANs (VLANs)
Allow a single extended LAN to be partitioned into
several logical LANs
Each VLAN is assigned an ID (or color)
Frames can only be travel between LANs segments
within the same VLAN
Partially solvesthe broadcast problem in
the extended LAN
One Attractive feature of VLANs is
We can change the logical topology
of the extended LAN without moving/changing
any wire or addresses
Just change the Bridge configuration
60
201. Virtual LANs (VLANs)
When a frame from X arrives at bridge B2, the bridge observes that
it came in a port that was configured as being in VLAN 100, so it
inserts a VLAN header (has the VLAN ID) between the Ethernet
header and its payload
When the frame arrives at B1, it will only forward it to the port of
VLAN 100 and not to VLAN 200
The link between B1 and B2 is considered to be in both VLANs
61