Unit 5
Unit 5
5.2 FRAMING
The data-link layer packs the bits of a message into frames, so that each frame
is distinguishable from another.
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.
Frame Size
Frames can be of fixed or variable size.
Frames of fixed size are called cells. In fixed-size framing, there is no need for
defining the boundaries of the frames; the size itself can be used as a delimiter.
In variable-size framing, we need a way to define the end of one frame and the
beginning of the next. Two approaches were used for this purpose: a character-
oriented approach and a bit-oriented approach.
Character-Oriented Framing
In character-oriented (or byte-oriented) framing, data to be carried are 8-bit
characters.
To separate one frame from the next, an 8-bit (1-byte) flag is added at the
beginning and the end of a frame.
The flag, composed of protocol-dependent special characters, signals the start
or end of a frame.
Bit-Oriented Framing
In bit-oriented framing, the data section of a frame is a sequence of bits to
be interpreted by the upper layer as text, graphic, audio, video, and so on.
If the acknowledgement is not received within the allotted time, then the sender
assumes that the frame is lost during the transmission, so it will retransmit the
frame.
The acknowledgement may not arrive because of the following three scenarios :
1. Original frame is lost
2. ACK is lost
3. ACK arrives after the timeout
SLIDING WINDOW
The Sliding Window is a method of flow control in which a sender can
transmit the several frames before getting an acknowledgement.
In Sliding Window Control, multiple frames can be sent one after the another
due to which capacity of the communication channel can be utilized efficiently.
A single ACK acknowledge multiple frames.
Sliding Window refers to imaginary boxes at both the sender and receiver end.
The window can hold the frames at either end, and it provides the upper limit
on the number of frames that can be transmitted before the acknowledgement.
Frames can be acknowledged even when the window is not completely filled.
The window has a specific size in which they are numbered as modulo-n means
that they are numbered from 0 to n-1.
For example, if n = 8, the frames are numbered from
0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1........
The size of the window is represented as n-1. Therefore, maximum n-1 frames
can be sent before acknowledgement.
When the receiver sends the ACK, it includes the number of the next frame that
it wants to receive.
For example, to acknowledge the string of frames ending with frame number 4,
the receiver will send the ACK containing the number 5.
When the sender sees the ACK with the number 5, it got to know that the
frames from 0 through 4 have been received.
TYPES OF ERRORS
SINGLE-BIT ERROR
The term Single-bit error means that only one bit of a given data unit (such as byte,
character, data unit or packet) is changed from 1 to 0 or from 0 to 1.
BURST ERROR
The term Burst Error means that two or more bits in the data unit have changed from 1
to 0 or from 0 to 1.
The basic idea behind any error detection scheme is to add additional information to a
frame that can be used to determine if errors have been introduced.
PARITY CHECK
One bit, called parity bit is added to every data unit so that the total number of
1’s in the data unit becomes even (or) odd.
The source then transmits this data via a link, and bits are checked and verified
at the destination.
Data is considered accurate if the number of bits (even or odd) matches the
number transmitted from the source.
This techniques is the most common and least complex method.
Steps Involved :
Consider the original message (dataword) as M(x) consisting of ‘k’ bits and the
divisor as C(x) consists of ‘n+1’ bits.
The original message M(x) is appended by ‘n’ bits of zero’s. Let us call this
zero-extended message as T(x).
Divide T(x) by C(x) and find the remainder.
The division operation is performed using XOR operation.
The resultant remainder is appended to the original message M(x) as CRC and
sent by the sender(codeword).
Polynomials
Example 1:
Consider the Dataword / Message M(x) = 1001
Divisor C(x) = 1011 (n+1=4)
Appending ‘n’ zeros to the original Message M(x).
The resultant messages is called T(x) = 1001 000. (here n=3)
Divide T(x) by the divisor C(x) using XOR operation.
CHECKSUM
ERROR CONTROL
STOP-AND-WAIT ARQ
Damaged Frame: When the receiver receives a damaged frame(i.e., the frame contains
an error), then it returns the NAK frame. For example, when the frame DATA 1 is sent,
and then the receiver sends the ACK 0 frame means that the data 1 has arrived
correctly. The sender transmits the next frame: DATA 0. It reaches undamaged, and the
receiver returns ACK 1.The sender transmits the third frame: DATA 1. The receiver
reports an error and returns the NAK frame. The sender retransmits the DATA 1 frame.
Lost Frame: Sender is equipped with the timer and starts when the frame is
transmitted. Sometimes the frame has not arrived at the receiving end so that it
cannot be acknowledged either positively or negatively. The sender waits for
acknowledgement until the timer goes off. If the timer goes off, it retransmits the last
transmitted frame.
Sliding Window ARQ is a technique used for continuous transmission error control.
1. GO-BACK-N ARQ
In the above figure, three frames (Data 0,1,2) have been transmitted before
an error discovered in the third frame.
The receiver discovers the error in Data 2 frame, so it returns the NAK 2 frame.
All the frames including the damaged frame (Data 2,3,4) are discarded as it is
transmitted after the damaged frame.
Therefore, the sender retransmits the frames (Data2,3,4).
SELECTIVE-REJECT(REPEAT) ARQ
In the above figure, three frames (Data 0,1,2) have been transmitted
before an error discovered in the third frame.
The receiver discovers the error in Data 2 frame, so it returns the NAK
2 frame.
The damaged frame only (Data 2) is discarded.
The other subsequent frames (Data 3,4) are accepted.
Therefore, the sender retransmits only the damaged frame (Data2).
5.5 DATA-LINK LAYER PROTOCOLS
Four protocols have been defined for the data-link layer controls.
They are
1. Simple Protocol
2. Stop-and-Wait Protocol
3. Go-Back-N Protocol
4. Selective-Repeat Protocol
SIMPLE PROTOCOL
The first protocol is a simple protocol with neither flow nor error control.
We assume that the receiver can immediately handle any frame it receives.
In other words, the receiver can never be overwhelmed with incoming frames.
The data-link layers of the sender and receiver provide transmission services
for their network layers.
The data-link layer at the sender gets a packet from its network layer,
makes a frame out of it, and sends the frame.
The data-link layer at the receiver receives a frame from the link,
extracts the packet from the frame, and delivers the packet to its network
layer.
HDLC FRAMES
Each type of frame serves as an envelope for the transmission of a different type of
message. Each frame in HDLC may contain up to six fields:
1. Beginning flag field
2. Address field
3. Control field
4. Information field (User Information/ Management Information)
5. Frame check sequence (FCS) field
6. Ending flag field In multiple-frame transmissions, the ending flag of one frame
can serve as the beginning flag of the next frame.
Address field - This field contains the address of the secondary station. If a
primary station created the frame, it contains a ‘to’ address. If a secondary
station creates the frame, it contains a ‘from’ address. The address field can be
one byte or several bytes long, depending on the needs of the network.
Control field. The control field is one or two bytes used for flow and error
control.
Information field. The information field contains the user’s data from the
network layer or management information. Its length can vary from one
network to another.
FCS field. The frame check sequence (FCS) is the HDLC error detection
field. It can contain either a 16- bit or 32-bit CRC
CONTROL FIELD FORMAT FOR THE DIFFERENT FRAME TYPES
I-frames are designed to carry user data from the network layer. In
addition, they can include flow-control and error-control information
The first bit defines the type. If the first bit of the control field is 0, this
means the frame is an I-frame.
The next 3 bits, called N(S), define the sequence number of the frame.
The last 3 bits, called N(R), correspond to the acknowledgment number
when piggybacking is used.
The single bit between N(S) and N(R) is called the P/F bit. If this bit is 1 it
means poll (the frame is sent by a primary station to a secondary).
PPP Frame
PPP is a byte - oriented protocol where each field of the frame is composed of one
or more bytes.
1. Flag − 1 byte that marks the beginning and the end of the frame. The bit
pattern of the flag is 01111110.
2. Address − 1 byte which is set to 11111111 in case of broadcast.
3. Control − 1 byte set to a constant value of 11000000.
4. Protocol − 1 or 2 bytes that define the type of data contained in the payload
field.
5. Payload − This carries the data from the network layer. The
maximum length of the payload field is 1500 bytes.
6. FCS − It is a 2 byte(16-bit) or 4 bytes(32-bit) frame check sequence
for error detection. The standard code used is CRC.
Components/Protocols of PPP
Authentication means validating the identity of a user who needs to access a set of
resources. PPP has created two protocols for authentication -Password Authentication
Protocol and Challenge Handshake Authentication Protocol.
PAP
CHAP
When two or more nodes transmit data at the same time, their frames
will collide and the link bandwidth is wasted during collision.
To coordinate the access of multiple sending/receiving nodes to the shared
link, we need a protocol to coordinate the transmission.
These protocols are called Medium or Multiple Access Control
(MAC) Protocols. MAC belongs to the data link layer of OSI model
MAC defines rules for orderly access to the shared medium. It tries to
ensure that no two nodes are interfering with each other’s transmissions, and
deals with the situation when they do.
Goals of MAC
1. Fairness in sharing
2. Efficient sharing of bandwidth
3. Need to avoid packet collisions at the receiver due to interference
MAC Management
Ethernet was developed in the mid-1970’s at the Xerox Palo Alto Research
Center (PARC),
IEEE controls the Ethernet standards.
The Ethernet is the most successful local area networking technology, that uses
bus topology.
The Ethernet is multiple-access networks that is set of nodes send and
receive frames over a shared link.
Ethernet uses the CSMA / CD ( Carrier Sense Multiple Access with
Collision Detection) mechanism.
EVOLUTION OF ETHERNET
The 64-bit preamble allows the receiver to synchronize with the signal; it is
a sequence of alternating 0’s and 1’s.
Both the source and destination hosts are identified with a 48-bit address.
The packet type field serves as the demultiplexing key.
Each frame contains up to 1500 bytes of data(Body).
CRC is used for Error detection
Ethernet Addresses
Every Ethernet host has a unique Ethernet address (48 bits – 6 bytes).
Ethernet address is represented by sequence of six numbers separated by colons.
Each number corresponds to 1 byte of the 6 byte address and is given by pair
of hexadecimal digits.
Eg: 8:0:2b:e4:b1:2 is the representation of 00001000 00000000 00101011
11100100 10110001 00000010
Each frame transmitted on an Ethernet is received by every adaptor connected
to the Ethernet.
In addition to unicast addresses an Ethernet address consisting of all 1s is treated as
broadcast address.
Similarly the address that has the first bit set to 1 but it is not the broadcast address
is called multicast address.
Carrier Sense in CSMA/CD means that all the nodes sense the medium to
check whether it is idle or busy.
If the carrier sensed is idle, then the node transmits the entire frame.
If the carrier sensed is busy, the transmission is postponed.
Collision Detect means that a node listens as it transmits and can therefore detect
when a frame it is transmitting has collided with a frame transmitted by another node.
Flowchart of CSMA/CD Operation
5.11 VLAN
Virtual Local Area Networks or Virtual LANs (VLANs) are a logical group of
computers that appear to be on the same LAN irrespective of the configuration of the
underlying physical network. Network administrators partition the networks to match the
functional requirements of the VLANs so that each VLAN comprise of a subset of ports on a
single or multiple switches or bridges. This allows computers and devices in a VLAN to
communicate in the simulated environment as if it is a separate LAN.
Features of VLANs
A VLAN forms sub-network grouping together devices on separate physical LANs.
VLAN's help the network manager to segment LANs logically into different
broadcast domains.
VLANs function at layer 2, i.e. Data Link Layer of the OSI model.
There may be one or more network bridges or switches to form multiple,
independent VLANs.
Using VLANs, network administrators can easily partition a single switched network
into multiple networks depending upon the functional and security requirements of
their systems.
VLANs eliminate the requirement to run new cables or reconfiguring
physical connections in the present network infrastructure.
VLANs help large organizations to re-partition devices aiming improved
traffic management.
Types of VLANs
Protocol VLAN − Here, the traffic is handled based on the protocol used. A switch or bridge
segregates, forwards or discards frames the come to it based upon the traffics protocol.
Port-based VLAN − This is also called static VLAN. Here, the network administrator assigns
the ports on the switch / bridge to form a virtual network.
Dynamic VLAN − Here, the network administrator simply defines network membership
according to device characteristics.
1. Flexibility: Within radio coverage, nodes can access each other as radio waves can
penetrate even partition walls.
2. Planning : No prior planning is required for connectivity as long as devices follow
standard convention
3. Design : Allows to design and develop mobile devices.
4. Robustness : Wireless network can survive disaster. If the devices survive,
communication can still be established.
The standard defines two kinds of services: the Basic Service Set (BSS) and
the Extended Service Set (ESS).
IEEE 802.11 defines the basic service set (BSS) as the building blocks of a
wireless LAN.
A basic service set is made of stationary or mobile wireless stations and an
optional central base station, known as the access point (AP).
An extended service set (ESS) is made up of two or more BSSs with APs.
In this case, the BSSs are connected through a distribution system, which is a
wired or a wireless network.
The distribution system connects the APs in the BSSs. The extended service set
uses two types of stations: mobile and stationary.
The mobile stations are normal stations inside a BSS.
The stationary stations are AP stations that are part of a wired LAN.
Wireless protocol would follow exactly the same algorithm as the Ethernet—Wait
until the link becomes idle before transmitting and back off should a collision
occur.
Each of the four nodes is able to send and receive signals that reach just the
nodes to its immediate left and right.
For example, B can exchange frames with A and C but it cannot reach D, while
C can reach B and D but not A.
Suppose B is sending to A. Node C is aware of this communication because it
hears B’s transmission.
If at the same time, C wants to transmit to node D.
It would be a mistake, however, for C to conclude that it cannot transmit to
anyone just because it can hear B’s transmission.
This is not a problem since C’s transmission to D will not interfere with A’s
ability to receive from B.
Bandwidth: All the factors are remaining constant, the greater the bandwidth
of a medium, the higher the data transmission rate of a signal.
5.15 SWITCHING
The technique of transferring the information from one computer network to
Advantages
It is suitable for long continuous transmission, since a continuous
transmission route is established, that remains throughout the conversation.
The dedicated path ensures a steady data rate of communication.
No intermediate delays are found once the circuit is established. So, they are
suitable for real time communication of both voice and data transmission.
Disadvantages
Circuit switching establishes a dedicated connection between the end parties.
This dedicated connection cannot be used for transmitting any other data, even
if the data load is very low.
Bandwidth requirement is high even in cases of low data volume.
There is underutilization of system resources. Once resources are allocated to a
particular connection, they cannot be used for other connections.