0% found this document useful (0 votes)
6 views

UNIT 3

The document discusses the Data Link Layer protocols, which are responsible for node-to-node delivery and ensuring reliable communication over physical links. It outlines the services provided by the Data Link Layer, including framing, error control, and flow control, along with various types of services such as unacknowledged connectionless and acknowledged connection-oriented services. Additionally, it covers framing methods, error control mechanisms, and the HDLC protocol, detailing its configurations and station types.

Uploaded by

boteonkar2019
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

UNIT 3

The document discusses the Data Link Layer protocols, which are responsible for node-to-node delivery and ensuring reliable communication over physical links. It outlines the services provided by the Data Link Layer, including framing, error control, and flow control, along with various types of services such as unacknowledged connectionless and acknowledged connection-oriented services. Additionally, it covers framing methods, error control mechanisms, and the HDLC protocol, detailing its configurations and station types.

Uploaded by

boteonkar2019
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

DATA LINK & NETWORK LAYER PROTOCOLS

3.1 Data Link Layer Protocol:-


The data link layer transforms the physical layer, a raw transmission facility to
a reliable link and is responsible for node to node delivery. It makes the physical
layer appear error free to the upper layer (Network layer). The responsibility of data
link layer includes framing, physical addressing, error flow control, error control and
access control.

DATA LINK LAYER DESIGN ISSUES:-


The data link layer has a number of specific functions it can carry out.
It includes :
1) Providing a well defined service
2) Dealing with transmission error
3) Regulating the flow of data so that slow receiver is not swamp by fast
senders.
It means if the data rate at which the data are absorb
The receiver is less than or more than the rate produced in the center.
To accomplish or to acquire above mentioned goals the data link layer takes
the packets it get from the network layer and encapsulates them into frames for
transmission.

SENDER RECEIVER

Packet Packet

HEADER PAYLOAD TRAILOR HEADER PAYLOAD TRAILOR

FRAME

SERVICES PROVIDED TO THE NETWORK LAYER:-


The function of data link layer is to provide service to the network layer. The
main service is transferring data from the network layer on the source machine to the
destination machine. On the source machine it is just an entity which may also call as
a process. This in network layer hands some bits to the data link layer for
transmission to the destination. Job of data link layer is to transmit the bits to the
destination so that they can be handed over to the network layer there at destination
machine.

1
According to these we can say that the actual data path of source and
destination machine is from network layer of destination machine. But for
simplification and ease of understanding the virtual communication between two
machines is considered from the network layer to data link layer of source machine
and from there directly to the data link layer of destination machine which forwards it
to the network layer to that machine.

SERVICES:-
The data link layer can be designed to offer various services. The actual
services offered can vary from system to system. The basic services are-
1) Unacknowledged connection less
2) Acknowledged connection less
3) Acknowledged connection oriented services

1. Unacknowledged connection less services:-


In these services the source machine sends independent frames to the
destination machine without having the destination machine to acknowledge them.
That means the sender is just sending the frames and receiver will not provide any
acknowledgement regarding the received or lost frame.
Here in this case no logical connection is established before or after frame
transmission. If a frame is lost due to noise on the line no attempt is made to detect
the loss or to recover from it in the data link layer.
Applications:-
1) This kind of service is appropriate for real time traffic such as noise in which
late data are worst than bad data.
2) Most LAN application also implement these services in the data link layer

2. Acknowledged connection less services:-


If it is considered in terms of reliability acknowledged connection less service
is best suited. When this service is offered there is still no logical connection used but
each frame sends its individual acknowledge. Due to these the sender knows
whether the frame has arrived correctly. If it is not arrived correctly within a specific
time interval it can be send again.

Application:-
When it is considered as a matter of reliability this service is useful over
unreliable channel such as wireless system.

2
3. Acknowledged connection oriented services:-
As the name suggests it is the connection oriented service. So in the first
phase the connection is established by having both sides initialize variables and
counters which are needed to keep track of which frame has been received and
which one have not.
In the second phase actual transmission of frames take place and in third and
final phase the connection is released freeing up the variables, buffer and other
resources used to maintain the connection.

Application:-
Most of the WAN subnet are implemented by this service such as in a WAN
routers connected by point to point leased telephone line.

Framing:
Since the physical layer merely accepts and transmits a stream of bits without any
regard to meaning or structure, it is upto the data link layer to create and recognize
frame boundaries. This can be accomplished by attaching special bit patterns to the
beginning and end of the frame. If these bit patterns can accidentally occur in data,
special care must be taken to make sure these patterns are not incorrectly
interpreted as frame delimiters. The four framing methods that are widely used are

• Character count
• Starting and ending characters, with character stuffing
• Starting and ending flags, with bit stuffing
• Physical layer coding violations

1. Character Count :

This method uses a field in the header to specify the number of characters in the
frame. When the data link layer at the destination sees the character count, it knows
how many characters follow, and hence where the end of the frame is. The
disadvantage is that if the count is garbled by a transmission error, the destination
will lose synchronization and will be unable to locate the start of the next frame. So,
this method is rarely used.

3
Fig 2.1: A Character Stream (a) Without errors (b) With one error

2. Flag bytes with byte stuffing :

In this method, start and end of frames are recognized with the help of flag bytes.
Each frame starts with and ends with a flag byte. Two consecutive flag bytes
indicate the end of one frame and start of the next one. The flag bytes used in the
figure is named as "ESC" flag byte.

Fig: 2.2 (a) A Frame delimited by Flag Bytes (b) Examples of byte
sequences before and after stuffing

This framing method is only applicable in 8-bit character codes which is a major
disadvantage of this method as not all character codes use 8-bit characters e.g.
Unicode.

Starting and ending flags with bit stuffing:The third method allows data frames to
contain an arbitrary number of bits and allows character codes with an arbitrary
number of bits per character. At the start and end of each frame is a flag byte

4
consisting of the special bit pattern 01111110. Whenever the sender's data link layer
encounters five consecutive 1s in the data, it automatically stuffs a zero bit into the
outgoing bit stream. This technique is called bit stuffing. When the receiver sees five
consecutive 1s in the incoming data stream, followed by a zero bit, it automatically
destuffs the 0 bit. The boundary between two frames can be determined by locating
the flag pattern.

Fig 2.3 Bit Stuffing (a) Original Data (b) The data as they appear on the line (c) The
data as they are stored in the receiver’s memory after destuffing.

3. Physical layer coding violations

The final framing method is physical layer coding violations and is applicable to
networks in which the encoding on the physical medium contains some redundancy.
In such cases normally, a 1 bit is a high-low pair and a 0 bit is a low-high pair. The
combinations of low-low and high-high which are not used for data may be used for
marking frame boundaries.

ERROR CONTROL:-
As the problem of framing is solved by making start and end of each frame.
The next problem occur i.e. how to make sure all the frame are delivered to the
network layer at the destination and in proper order. If the sender is just sending the
frame without regard to whether they are arriving properly this system would work for
unacknowledged connection less service but not suitable for reliable connection
oriented service.
To make sure about the reliable delivery the mechanism implemented is to
provide the sender with some feedback about what is happening at the other end of
the line. Basically the protocol call for the receiver to send back special control
frames bearing positive or negative acknowledgement about the incoming frames. If

5
the sender receives the positive acknowledgement about a frame it knows the frame
has arrived safely and if negative acknowledgement is received by sender that
means something has gone wrong the frame must be transmitted again.
Another problem may occur in hardware due to which frame vanishes
completely. In that case the receiver will not react since it has no reason to react.
Due to this the protocol in which the sender transmits a frame and wait for an
acknowledgement positive or negative will hang forever if a frame loss due to
hardware problem.

Timer:-
By introducing timer into data link layer the sender will work as follows:
When a sender transmits a frame it also starts a timer and it is set to expire
after an interval long enough for the frame to reach the destination be processed
there and have the acknowledgement send back to the sender. Normally the frame
will be correctly received and the acknowledgement will get back before the timer
runs out in which case the timer will be canceled.
But if the situation will be worst that means if either the frame or the
acknowledgement is lost due to other reason the timer will go off alerting the sender.
A solution to the problem is just to retransmit the frame but when the frame is
transmitted multiple times there is dangerous that the receiver will accept the same
frame two or more times and pass it to the network layer more than ones. To prevent
these problem generally sequence numbers are assigned to outgoing frames so that
the receiver can distinguish retransmission from originals.
The timer and sequence number are implemented just to ensure that each
frame is ultimately passed to the network layer at the destination exactly ones, no
more and no less and this is an important duty of network layer.

Flow Control:

Consider a situation in which the sender transmits frames faster than the
receiver can accept them. If the sender keeps pumping out frames at high rate, at
some point the receiver will be completely swamped and will start losing some
frames. This problem may be solved by introducing flow control. Most flow control
protocols contain a feedback mechanism to inform the sender when it should
transmit the next frame. To control the flow of data due to occurrence of this problem,
two approaches are used.

1. Feedback-based Flow control


2. Rate-based Flow control

6
1. Feedback-based Flow Control:

In this case, the sender sends data according to the orders of receiver. The receiver
asks the sender to send data or only tells the current situation at the end of the
receiver.

2. Rate-based Flow Control:

In this case, no feedback of the receiver is required because its protocol has a built in
mechanism that does not allow the sender to send data at a very fast rate it limits the
sending rate of the sender.

Mechanisms for Flow Control:

• Stop and Wait Protocol:

This is the simplest flow control protocol in which the sender transmits
a frame and then waits for an acknowledgement, either positive or negative,
from the receiver before proceeding. If a positive acknowledgement is
received, the sender transmits the next packet; else it retransmits the same
frame. However, this protocol has one major flaw in it.

If a packet or an acknowledgement is completely destroyed in transit


due to a noise burst, a deadlock will occur because the sender cannot
proceed until it receives an acknowledgement. This problem may be solved
using timers on the sender's side. When the frame is transmitted, the timer is
set. If there is no response from the receiver within a certain time interval, the
timer goes off and the frame may be retransmitted.

• Sliding Window Protocols:

In spite of the use of timers, the stop and wait protocol still suffers
from a few drawbacks. Firstly, if the receiver had the capacity to accept more
than one frame, its resources are being underutilized. Secondly, if the
receiver was busy and did not wish to receive any more packets, it may
delay the acknowledgement. However, the timer on the sender's side may
go off and cause an unnecessary retransmission.

These drawbacks are overcome by the sliding window protocols.


In sliding window protocols the sender's data link layer maintains a 'sending
window' which consists of a set of sequence numbers corresponding to the
frames it is permitted to send. Similarly, the receiver maintains a 'receiving

7
window' corresponding to the set of frames it is permitted to accept. The
window size is dependent on the retransmission policy and it may differ in
values for the receiver's and the sender's window.

The sequence numbers within the sender's window represent the


frames sent but as yet not acknowledged. Whenever a new packet arrives
from the network layer, the upper edge of the window is advanced by one.
When an acknowledgement arrives from the receiver the lower edge is
advanced by one.

The receiver's window corresponds to the frames that the receiver's


data link layer may accept. When a frame with sequence number equal to
the lower edge of the window is received, it is passed to the network layer,
an acknowledgement is generated and the window is rotated by one. If
however, a frame falling outside the window is received, the receiver's data
link layer has two options.

It may either discard this frame and all subsequent frames until the
desired frame is received or it may accept these frames or buffer them until
the appropriate frame is received and then pass the frames to the network
layer in sequence.

In this simple example, there is a 4-byte sliding window. Moving from left to
right, the window "slides" as bytes in the stream are sent and acknowledged.

8
3.3 HDLC :
HDLC is a bit-oriented protocol. It was developed by the International
Organization for Standardization (ISO). It falls under the ISO standards ISO 3309 and
ISO 4335. It specifies a packetization standard for serial links. It has found itself being
used throughout the world. It has been so widely implemented because it supports both
half-duplex and full-duplex communication lines, point-to-point (peer to peer) and multi-
point networks, and switched or non-switched channels. HDLC supports several modes of
operation, including a simple sliding-window mode for reliable delivery. Since Internet
provides retransmission at higher levels (i.e., TCP), most Internet applications use
HDLC's unreliable delivery mode, Unnumbered Information.
Other benefits of HDLC are that the control information is always in the same
position, and specific bit patterns used for control differ dramatically from those in
representing data, which reduces the chance of errors. It has also led to many subsets.
Two subsets widely in use are Synchronous Data Link Control (SDLC) and Link Access
Procedure-Balanced (LAP-B).

HDLC Stations and Configurations


HDLC specifies the following three types of stations for data link control:
Primary Station
Secondary Station
Combined Station

Primary Station
Within a network using HDLC as its data link protocol, if a configuration is used
in which there is a primary station, it is used as the controlling station on the link. It has
the responsibility of controlling all other stations on the link (usually secondary stations).
A primary issues commands and secondary issues responses. Despite this important
aspect of being on the link, the primary station is also responsible for the organization of
data flow on the link. It also takes care of error recovery at the data link level (layer 2 of
the OSI model).
Secondary Station
If the data link protocol being used is HDLC, and a primary station is present, a
secondary station must also be present on the data link. The secondary station is under the
control of the primary station. It has no ability, or direct responsibility for controlling the
link. It is only activated when requested by the primary station. It only responds to the
primary station. The secondary station's frames are called responses. It can only send
response frames when requested by the primary station. A primary station maintains a
separate logical link with each secondary station.
Combined Station
A combined station is a combination of a primary and secondary station. On the
link, all combined stations are able to send and receive commands and responses without
any permission from any other stations on the link. Each combined station is in full
control of itself, and does not rely on any other stations on the link. No other stations can
control any combined station. May issue both commands and responses.
HDLC also defines three types of configurations for the three types of stations. The word
configuration refers to the relationship between the hardware devices on a link.
Following are the three configurations defined by HDLC:
Unbalanced Configuration
Balanced Configuration
Symmetrical Configuration

9
Unbalanced Configuration
The unbalanced configuration in an HDLC link consists of a primary station and one or
more secondary stations. The unbalanced condition arises because one station controls the
other stations. In an unbalanced configuration, any of the following can be used:
Full-Duplex or Half-Duplex operation
Point to Point or Multi-point networks
An example of an unbalanced configuration:

Figure 3.1 Unbalanced configuration


Balanced Configuration
The balanced configuration in an HDLC link consists of two or more combined stations.
Each of the stations has equal and complimentary responsibility compared to each other.
Balanced configurations can use only the following:
Full - Duplex or Half - Duplex operation
Point to Point networks

An example of a balanced configuration:

Figure 3.2 Balanced configuration


Symmetrical Configuration
This third type of configuration is not widely in use today. It consists of two independent
point-to-point, unbalanced station configurations as shown in Fig. 3.3. In this
configuration, each station has a primary and secondary status. Each station is logically
considered as two stations.

10
Figure 3.3 Symmetric Configuration

HDLC Operational Modes


A mode in HDLC is the relationship between two devices involved in an exchange; the
mode describes who controls the link. Exchanges over unbalanced configurations are
always conducted in normal response mode. Exchanges over symmetric or balanced
configurations can be set to specific mode using a frame design to deliver the command.
HDLC offers three different modes of operation. These three modes of operations are:

Normal Response Mode (NRM)


Asynchronous Response Mode (ARM)
Asynchronous Balanced Mode (ABM)

Normal Response Mode


This is the mode in which the primary station initiates transfers to the secondary station.
The secondary station can only transmit a response when, and only when, it is instructed
to do so by the primary station. In other words, the secondary station must receive explicit
permission from the primary station to transfer a response. After receiving permission
from the primary station, the secondary station initiates its transmission. This
transmission from the secondary station to the primary station may be much more than
just an acknowledgment of a frame. It may in fact be more than one information frame.
Once the last frame is transmitted by the secondary station, it must wait once again from
explicit permission to transfer anything, from the primary station. Normal Response
Mode is only used within an unbalanced configuration.

11
Asynchronous Response Mode
In this mode, the primary station doesn't initiate transfers to the secondary station. In fact,
the secondary station does not have to wait to receive explicit permission from the
primary station to transfer any frames. The frames may be more than just
acknowledgment frames. They may contain data, or control information regarding the
status of the secondary station. This mode can reduce overhead on the link, as no frames
need to be transferred in order to give the secondary station permission to initiate a
transfer. However, some limitations do exist. Due to the fact that this mode is
asynchronous, the secondary station must wait until it detects and idle channel before it
can transfer any frames. This is when the ARM link is operating at half-duplex. If the
ARM link is operating at full duplex, the secondary station can transmit at any time. In
this mode, the primary station still retains responsibility for error recovery, link setup, and
link disconnection.

Synchronous Balanced Mode

This mode is used in case of combined stations. There is no need for permission on the
part of any station in this mode. This is because combined stations do not require any sort
of instructions to perform any task on the link.

Normal Response Mode is used most frequently in multi-point lines, where the primary
station controls the link. Asynchronous Response Mode is better for point-to-point links,
as it reduces overhead. Asynchronous Balanced Mode is not used widely today. The
"asynchronous" in both ARM and ABM does not refer to the format of the data on the
link. It refers to the fact that any given station can transfer frames without explicit
permission or instruction from any other station.

12
HDLC Frame Structure :

Figure 3.4 HDLC Frame Structure


Size of different fields :
Field Name Size(in bits)
Flag Field( F ) 8 bits
Address Field( A ) 8 bits
Control Field( C ) 8 or 16 bits
Information Field( I ) OR Data Variable; Not used in some frames
Frame Check Sequence( FCS ) 16 or 32 bits
Closing Flag Field( F ) 8 bits

There are three different types of frames as shown in Fig. 3.5

Figure 3.5 HDLC Frame Types

The Flag field


Every frame on the link must begin and end with a flag sequence field (F). Stations
attached to the data link must continually listen for a flag sequence. The flag sequence is
an octet looking like 01111110. Flags are continuously transmitted on the link between
frames to keep the link active. Two other bit sequences are used in HDLC as signals for
the stations on the link. These two bit sequences are:

• Seven 1's, but less than 15 signal an abort signal. The stations on the link know
there is a problem on the link.
• 15 or more 1's indicate that the channel is in an idle state.

13
The time between the transmissions of actual frames is called the interframe time fill.
The interframe time fill is accomplished by transmitting continuous flags between frames.
The flags may be in 8 bit multiples.
HDLC is a code-transparent protocol. It does not rely on a specific code for
interpretation of line control. This means that if a bit at position N in an octet has a
specific meaning, regardless of the other bits in the same octet. If an octet has a bit
sequence of 01111110, but is not a flag field, HLDC uses a technique called bit-
stuffing to differentiate this bit sequence from a flag field as we have discussed in the
previous lesson.

At the receiving end, the receiving station inspects the incoming frame. If it detects 5
consecutive 1's it looks at the next bit. If it is a 0, it pulls it out. If it is a 1, it looks at the
8th bit. If the 8th bit is a 0, it knows an abort or idle signal has been sent. It then proceeds
to inspect the following bits to determine appropriate action. This is the manner in which
HDLC achieves code-transparency. HDLC is not concerned with any specific bit code
inside the data stream. It is only concerned with keeping flags unique.
The Address field
The address field (A) identifies the primary or secondary stations involvement in the
frame transmission or reception. Each station on the link has a unique address. In an
unbalanced configuration, the A field in both commands and responses refer to the
secondary station. In a balanced configuration, the command frame contains the
destination station address and the response frame has the sending station's address.

The Control field


HDLC uses the control field (C) to determine how to control the communications process.
This field contains the commands, responses and sequences numbers used to maintain the
data flow accountability of the link, defines the functions of the frame and initiates the
logic to control the movement of traffic between sending and receiving stations. There
three control field formats:

Information Transfer Format: The frame is used to transmit end-user data between two
devices.

Supervisory Format: The control field performs control functions such as


acknowledgment of frames, requests for re-transmission, and requests for temporary
suspension of frames being transmitted. Its use depends on the operational mode being
used.

Unnumbered Format: This control field format is also used for control purposes. It is
used to perform link initialization, link disconnection and other link control functions.

14
The Poll/Final Bit (P/F)
The 5th bit position in the control field is called the poll/final bit, or P/F bit. It can only
be recognized when it is set to 1. If it is set to 0, it is ignored. The poll/final bit is used to
provide dialogue between the primary station and secondary station. The primary station
uses P=1 to acquire a status response from the secondary station. The P bit signifies a
poll. The secondary station responds to the P bit by transmitting a data or status frame to
the primary station with the P/F bit set to F=1. The F bit can also be used to signal the
end of a transmission from the secondary station under Normal Response Mode.
The Information field or Data field
This field is not always present in a HDLC frame. It is only present when the
Information Transfer Format is being used in the control field. The information field
contains the actually data the sender is transmitting to the receiver in an I-Frame and
network management information in U-Frame.
The Frame check Sequence field
This field contains a 16-bit, or 32-bit cyclic redundancy check bits. It is used for error
detection

X.25:

X.25 is a packet switched Wide Area Network protocol.


X.25 is an interface between Data Terminal Equipment (DTE) and Data
Circuit terminating Equipment (DCE), for terminal operation in the packet mode on
public data networks.

The X.25 is an end to end protocol the actual movement of packets through
the network is invisible to the user. The user looks the network as a cloud through
which each packet passes on its way to the receiving DTE.

15
X.25 defines how a packet mode terminal can be connected to a packet
network for the exchange of data. It describes position necessary for establishing or
maintaining or terminating connection. It also describes set of services called facilities
to provide functions such as reverse charge, call direct and direct control.
X.25 is known as Subscriber Network Interface (SNI) protocol. It defines how
the user’s DTE communicates with the network and how the packets are sent over that
network using DCE. It uses a virtual circuit approach to packet switching (SVC and
PVC) and uses asynchronous (Statistical) TDM to multiplex the packets.

X.25 Layers
X.25 protocol specifies three layers,
1) Physical layer
2) Frame layer
3) Packet layer
These layers define function at the physical, data link layer and
network layer of the OSI model. Following diagram shows relationship between X.25
layers and OSI layers,

1) Physical layer:-
At the physical layer, X.25 specifies protocol called ‘X.21’ or ‘X.21
BIS’, which has been specifically define for X.25 by the ITU-T. X.21,
however, is similar enough to other physical layer protocols such as
EIA-32 that X.25 is able to support them as well.
2) Frame layer:-
At the frame layer X.25 provides with the link controls using a bit-
oriented protocol called Link Access Procedure, Balanced (LAPB)
which is a subset of HDLC.
Following figure shows the general format of LAPB packet.

16
The flag, address and control, FCS fields are exactly the same as in HDLC. As
the communication here is point to point and in a Asynchronous Balanced Mode
(ABM), the only two addresses which are 00000001 and 00000011. The first
address that is 00000001 is for a command issued by a DTE and response to this
command. Another address 00000011 is for a command issued by a DCE and
response to this command. Following figure shows two addresses are used in the
frame (Data Link) layer.

Three categories of frames-


1) I-Frames
I-frames are used to encapsulate PLP packets from the network
layer.
2) S-Frames
S-Frames used for flow and error control in the frame layer.
3) U-Frames
U-Frames are used to set-up and disconnect the links between
DTE and DCE.

17
The three packets most frequently used by LAPB in this category are SABM (Set
Asynchronous Balanced Mode) or ESABM (Extended Set Asynchronous Balanced
Mode). This ESABM mode is used when the extended address mode is used another
two packets are UA (Unnumbered Acknowledgement) and DISC (DISConnect).

Frame Layer Phases


In the frame layer a communication between a DTE and DTC involves three
phases
1) Link Set-up
2) Packet Transfer
3) Link Disconnect

1) Link Set-up:-
The link between DTE and DCE must be set-up before packets from
the packet layer can be transferred either the DTE or DCE can set-up
the link by sending an SADM frame, the responding party sends a UA
frame to show that link is actually set.
2) Transferring data:-
After the link has been established, two parties can send and receive
network layer packets (data and control) using I-frames and S-frames.
3) Link disconnect:-
When the network layer no longer needs the link, one of the party can
issue disconnect (DISC) frame to request disconnection. The other
party can answer with a UA frame.

18
Packet Layer:-
The network layer in X.25 is called as Packet Layer Protocol (PLP). This layer
is responsible for establishing the connection, transferring data and terminating the
connection in addition it is responsible for creating virtual circuits and negotiating
network services between two DTE where the frame layer is responsible for making a
connection between DTE and DCE. Packet layer is responsible for making a
connection between two DTE (end to end connection).
Here X.25 uses flow and error control at two levels,
1) Frame layer
2) Packet layer
Flow and error control between a DTE and DCE link are under the inspection of the
frame layer. End to end flow and error control between two DTE’s (end to end are
under the inspection of packet layer). Following diagram shows the difference
between frame layer and packet layer domain of responsibility.

Virtual Circuits
X.25 protocol is a packet switched virtual circuit network. The virtual circuit
in X.25 are created vat the network layer, this means that a physical connection
establish between a DTE and DCE can carry several virtual circuits at the network
layer with each circuit responsible for carrying either data or control information. This
concept is called in-band signaling. Following diagram shows an X.25 in which three
circuits have been created between DTE A and three other DTEs.

19
Virtual Circuit Identifier
Each virtual circuit in X.25 should be identified by the packet. The virtual
circuit identifier in X.25 is called as Logical Channel Number (LCN). When virtual
circuit is established between two DTEs there is always a pair of LCNs one defining
the virtual circuit between the local DTE and DCE and the other one between the
remote DTE and the remote DTE.
Reason for having the two different LCNs is to make LCN domain local. This
allows the set of LCNs for each local connection to be small and consequently the
LCN field to be short. A global LCN would require a lager set of LCNs and
consequently a longer LCN field. The local LCN allows the same set of LCNs to be
used by two different pairs of DTE, DCE links without confusion.
Following diagram shows the LCN in an X.25 networks.

20
X.25 uses both permanent and switch virtual circuits (PVCs and SVCs). PVCs
are established by X.25network provider. They are similar to leased line telephone
networks. The LCNs are permanently assigned by the network provider.
SVCs are established at each session the network layer uses a control packet to
set-up a connection. After a set-up is established both DTE and DCE links are
assigned an LCN number.After the data transfer the virtual circuit is disconnected and
the LCNs are no longer valid.
Virtual circuit establishment and release at network layer are different from
link set-up and link disconnect at the frame layer. In a typical situation following five
events occur:
1) Link is set-up between local DTE and DCE and also between remote DTE and
DCE.
2) The virtual circuit is established between local DTE and DCE and also
between remote DTE and DCE.
3) Data are transferred between two DTEs
4) Virtual circuit is released
5) The link is disconnected.
LCN Assignment:
X.25 allows up to 4096 (2^25) LCNs. Figure shows how these LCNs
are assigned. The one way LCNs are used for simplex communication; the two
way LCNs are used for duplex communication.
PLP Packets
The general format of PLP packet shown in figure has 3 or 4 bytes of header
and an optional information field.

Fig. LCN assignment

21
Fig.PLP packet format

1. General Format Identifier:-


The General Format Identifier is a 4 bit field. The first bit
called the Q(Qualifier) bit, defines the source of control
information: o for PLP, 1 for other high level protocols. The D
(Delivery) bit defines which device should acknowledge the
packet; 0 for local DCE, 1 for remote DTE. The last two bits of
the GFI indicate s the size of the sequence numbers fields. If
these bits are 01, the sequence numbers are only 3 bit modulo 8
(0 to 7), if these bits are 10, the sequence number has 7 bit
modulo 128 (0 to 127).
2. Logical Channel Number:-
The Logical Channel Number is a12 bit field that identifies the
virtual circuit chosen for a given transmission. The protocol
originally defines a LGCN (Logical Group Channel Number)
of 4 bits and an LCN (Logical Channel Number) of 8 bits to
give a sense of hierarchy to the Virtual Circuit Identifier. But
today, the combination is normally referred to as LCN.
3. Packet Type Identifier:-
The PTI defines the type of packet. The contents of this field
are different for each packet.

22
POINT–TO–POINT PROTOCOL

Internet users need to connect their home computers to the computer of an


internet service provider to access the internet. But there are a lot of individuals who
need to connect to a computer from home, but they do not want to go through the
internet. The majority of these users have either a dial-up or a leased telephone line.
The telephone line provides a physical link, but to control & manage the transfer of
data, there is a need for point-to-point link protocol.

TRANSITION STATES
The different phases through which a PPP connection goes con be described
using a transition state diagram:

Detect carrier
Idle

Drop carrier Fail


Establishing
link

Success
Terminating link

Fail
Authentication
Finish

Success
Networking
(exchanging user data &
control)

1> IDLE STATE:


The idle state means that the link is not being used. There is no active
carrier & the line is quiet.

2> ESTABLISHING STATE:


When one of the end points starts the communication, the connection goes
into establishing state. In this state, option is negotiated between the two
parties. If the negotiation is successful, the system goes to the
authenticating state. The LCP packets are used for this purpose. Several
packets may be exchanged during this state.

3> AUTHENTICATING STATE:


The authenticating state is optional, the two end points may decide, during
the establishing state, not to go through this state. However, if they decide
to proceed with authentication, they send several authentication packets. If
the result is successful, the connection goes to the networking state;
otherwise it goes to the terminating state.

23
4> NETWORKING STATE:
The networking state is the heart of the transition states. When a
connection reaches this state, the exchange of user control & data packets
can be started. The connection remains in this until one of the end points
want to terminate the connection.

5> TERMINATING STATE:


When the connection is in the terminating state, several packets are
exchanged between the two ends for closing the link.

PPP LAYERS:

A variation
DATA LINK LAYER
of HLDC

PHYSICAL ANSI
LAYER Standards

PPP has only Physical & Datalink layers. This means that a protocol that
wants to use the services of PPP should have other layers.

PHYSICAL LAYER:
No specific protocol is defined for the physical layer in PPP. Instead, it is
left to the implementer to use whatever is available. PPP supports any of
the protocols recognized by ANSI.

DATALINK LAYER:
At the datalink layer, PPP employs a version of HLDC. Figure shows the
format of PPP frame.

Flag Address Control Protocol Data & FCS Flag


padding

1 byte 1 byte 1 byte 1 or 2 bytes variable 2 or 4 bytes 1 byte

1> FLAG FIELD:


The flag field, like the one in HLDC, identifies the boundaries of a PPP
frame its value is 01111110.
2> ADDRESS FIELD:
Because PPP is used for a point-to-point connection, it uses the broadcast
address of HLDC, 11111111 to avoid a datalink address in the protocol.
3> CONTROL FIELD:
The control field uses the format of u-frame in HLDC. The value
is11000000 to show that the frame does not contain any sequence numbers
& that there is no flow & error control.
4> PROTOCOL FIELD:
The protocol field defines what is being carried in the data field, user data
or other information.

24
5> DATA FIELD:
This field carries either the user data or other information.
6> FCS:
The frame check sequence field, as in HLDC is simply a two-byte or four-
byte CRC.

LINK CONROL PROTOCOL:

The link control protocol [LCP] is responsible for establishing, maintaining,


configuring & terminating links. It also provides negotiating mechanisms to set option
between the two end points. Both end points of the link must reach an agreement
about the options before the link can be established.
All LCP packets are carried in the payload field of the PPP frame. What
defines the frame as one carrying an LCP packet is the value of the protocol field,
which should be set to CO216 <fig shows the format of LCP packet>

Flag Address Control Protocol Payload FCS Flag

Code IP Length Information from


some LCP
packets
1 byte 1 byte 2 bytes Variable

Fig: LCP packet


1> CODE:
This field defines the type of LCP packet.
2> ID:
This field holds a value used to match a request with the reply. One end
point inserts a value in this field, which will be copied in the reply packet.
3> LENGTH:
This field defines the length of the whole LCP packet.
4> INFORMATION:
This field contains extra information needed for some LCP packets.

AUTHENTICATION:
Authentication plays a very important role in PPP because PPP is designed
for use over dial-up links where verification of user identity is necessary.
Authentication means validating the identity of user who needs to access a
set of resources.
1> PASSWORD AUTHENTICATION PROTOCOL (PAP)
2> CALLENGE HANDSHAKE AUTHENTICATION PROTOCOL
(CHAP)

25
PAP:
The PAP is an authentication procedure with two-step process.
1> The user who wants to access a system sends an authentication
identification (usually the username) and a password.
2> The system checks the validity of the identification & password &
either accepts or denies connection.
For those systems that require more security, PAP is not enough; a third
party to the link can easily pick-up the password & access the system
resources fig shows the idea of PAP.

Point-to-point physical link


USER SYS

Authenticate-request packet

USERNAME & PASSWORD

ACCEPT OR REJECT

Authenticate-ack or authenticate –nak


packet
CHAP:

The CHAP is a three-way handshaking authentication protocol that provides


more security than PPP. In this method the password is kept secret; it is never
sent on-line.
1> The system sends to the user a challenge packet containing a challenge
value, usually a few bytes.
2> The user applies a predefined function that takes the challenge value &
the users own password and creates a result. The user sends the result
in the response packet to the system.
3> The system does the same. It applies the same function to the password
of the user and the challenge value to create a result. If created result is
the same as the result sent in the response packet, access is granted,
otherwise, it denies.
CHAP is more secure than PPP, especially if the system continuously
changes the challenge value. Even if the intruder learns the challenge value
& the result, the password is still secret. Fig shows the idea of CHAP

26
Network layer protocol

Internetwork Protocol (IP)

IP is an unreliable connectionless datagram protocol and best effort delivery


service. The tem best–effort means that IP provides no error checking or tracking.IP
assumes the unreliability of the underlying layers and does it’s best to get a
transmission through to its destination but with no guarantees.
If reliability is important, IP must be paired with a reliable protocol such as
TCP.An example of a more commonly understand best-effort delivery service is the
post office. The post office does it’s best to deliver the mail but does not always
succeed. If unregistered letter is lost, it is up to the sender or would be recipient to
discover the loss and rectify the problem. The post office itself does not keep track of
every letter and cannot notify a sender loss or damage.
An example of a situation similar to pairing IP with a protocol that contains
reliability function is self-addressed stamped postcard included in a letter mailed
through the post office. When the letter is delivered, the receiver mails the postcard
back to the sender to indicate success. If the sender never receives the postcard, he
or she assumes the letter was lost and sends out another copy.
IP translates data in packets called datagram each of which is transported
separately. Datagrams may travel along different routes and may arrive out of
sequence or duplicated. IP does not keep track of routes and has no facility for
reordering datagrams once they arrive. Because it is a connectionless service, IP
does not create virtual circuits for delivering. There is no call setup to alert the
receiver to an incoming transmission.
The limited functionality of IP should not be considered a weakness, however.
IP provides transmission function that frees the user to add only those facilities
necessary for a given application and thereby allow for maximum efficiency.

27
Datagram:
Packets in the IP layer are called datagrams.

VER HLEN Service Total length


4 4 bits type 16 bits
bits 8 bits
Identification Flags Fragmentation
16 bits 3 bits offset
13 bits
Time to Protocol Header checksum
live 8 bits 16 bits
8 bits
Source IP Address
Destination IP Address
Option
F
Fig: IP Datagram Structure
IP datagram
Fig. shows the IP datagram format. A datagram is a variable-length
packet consisting of two parts: header and data. The header can be from 20 to 60
bytes and contains information essential to routing and delivery. It is customary in
TCP/IP to show the header in four byte sections. A brief description of each field is in
order.

1. Version: The first field defines the version number of IP. The current version is
IPV4 with a binary vale of 0100.

2. Header length [HLEN]: The HLEN field defines the length of header in multiples of
4 bytes. The 4 bit can represent a number between 0 and 15, which when
multiplied by 4, gives a maximum of 60 bytes.

3. Service type: The service type field defines how the datagram should be handled.
It includes bits that define the priority of the datagram. It also contains bits that
specify the type of service the sender desires such as the level of throughput,
reliability and delay.

4. Total length: Defines the total length of the IP datagram. It is a 2-byte field (16 bits)
and can define up to 65,535 bytes.

28
5. Identification: The identification field is used in fragmentation. A datagram when
passing through different networks may be divided into fragments to match the
network frame size. When this happens, each fragment is identical with a
sequence number in this field.

6. Flags: The bits in the flag field deal with fragmentation (The datagram can or can
not be fragmented; can me first, middle or last fragment).

7. Fragmentation offset: The fragmentation offset is a pointer that shows the offset of
the data in the original datagram.

8. Time-to-live: The Time-to-live field defines the number of hops a datagram can
travel before it is discarded. The source host, when it creates the datagram, sets
this field to an initial value. Then as the datagram travels through the Internet,
router by router, each router decrements this value by 1. If this value becomes 0
before the datagram reaches its final destination the datagram is discarded. This
prevents a datagram from going back and fourth forever between routers.

9. Protocol: The protocol field defines which upper-layer protocol data are
encapsulated in the datagram (TCP, UDP, etc.);

10. Header checksum: This is 16-bit field used to check the integrity of the header,
not the rest of the packet.

11. Source address: The source address field is a 4 byte (32-bit). It identifies the
original source of the datagram.

12. Destination address: The Destination address field is a 4-byte (32-bit) Internet
address. It identifies the final destination of the datagram.

13. Options: This option field gives more functionality to the IP datagram. It can carry
fields that control routing, timing, management, alignment.

IPV6
The network layer that is present in use in commonly referred to as IPv4. Although IPv4
is well designed and has helped the internet to grow rapidly, it has some deficiencies,
These deficiencies has made it unsuitable for the fast growing internet. To overcome
these deficiencies, Internet Protocol, Version 6 protocol has been proposed and it has
evolved into a standard. Important features of IPv6 are highlighted below:
• IPv6 uses 128-bit address instead of 32-bit address to provide larger address space
• Uses more flexible header format, which simplifies and speeds up the routing process
• Basic header followed by extended header
• Resource Allocation options, which was not present in IPv4
• Provision of new/future protocol options
• Support for security with the help of encryption and authentication
• Support for fragmentation at source

IPv4 IPv6
IPv4 has 32-bit address IPv6 has 128-bit address length
length
It Supports Manual and It supports Auto and renumbering
DHCP address configuration address configuration
n IPv4 end to end connection In IPv6 end to end connection integrity
integrity is Unachievable is Achievable

29
Security feature is dependent IPSEC is inbuilt security feature in the
on application IPv6 protocol
Address representation of IPv4 Address Representation of IPv6 is in
in decimal hexadecimal
In IPv4 checksum field is In IPv6 checksum field is not available
available
has broadcast Message In IPv6 multicast and any cast message
Transmission Scheme transmission scheme is available
In IPv4 Encryption and In IPv6 Encryption and Authentication
Authentication facility are provided
not provided

Address resolution protocol:

Address resolution protocol (ARP) associates an IP address with the physical


address. On a typical physical network, such as a LAN each device on a link is
identified by a physical or station address.
Physical addresses have local jurisdiction and cannot be changes.
ARP is used to find the physical address of the node when its internet
address is known.
Anytime a host, or a router, needs to find the physical address of another host
on its network, it format an ARP query packet, but only the intended recipient
recognizes its internet address and sends back its physical address. The host
holding the datagram adds the address of the target host both to its cache memory,
and to the datagram header and sends the datagram on its way.

ARP REQUEST

ARP REQUEST: Looking for the physical address of a node whose IP address is
141.23.56.23.

ARP RESPONSE

ARP Response: The node you are looking for and my physical address is
A46EF45983AB.

Reverse Address Resolution Protocol (RARP)


The Reverse Address Resolution Protocol (RARP) allows a host to discover its
internet
30
Address when it knows only its physical address. The question here is, why do we
need RARP? A host is supported to have its internet address stored on its hard disk,
but what if the host is diskless computer? or what if the comp is being connected to
the network for the first time.
RARP works much like ARP. The host wishing to retrieve its internet address
broadcast an RARP query packet that contains its physical address to every host on
its physical network. A server on the network recognizes the RARP packet and
returns the host’s internet address.

31

You might also like