You are on page 1of 26

GURU BHYO NAMAHA:

7 LAYERED ARCHITECTURE
The Open Systems Interconnection model (OSI model) is a conceptual model that characterizes and
standardizes the communication functions of a telecommunication or computing system without regard to their
underlying internal structure and technology.

At each level N, two entities at the communicating devices (layer N peers) exchange protocol data units (PDUs) by
means of a layer N protocol. Each PDU contains a payload, called the service data unit (SDU), along with
protocol-related headers and/or footers.
At each level N, two entities at the communicating devices (layer N peers) exchange protocol data units (PDUs) by
means of a layer N protocol. Each PDU contains a payload, called the service data unit (SDU), along with
protocol-related headers and/or footers.
service data unit (SDU) is a unit of data that has been passed down from an OSI layer to a lower layer and that
has not yet been encapsulated into a protocol data unit (PDU) by the lower layer. It is a set of data that is sent by a
user of the services of a given layer, and is transmitted semantically unchanged to a peer service user.
It differs from a PDU in that the PDU specifies the data that will be sent to the peer protocol layer at the receiving
end, as opposed to being sent to a lower layer.
The SDU at any given layer, layer 'n', is the PDU of the layer above, layer 'n+1'. In effect the SDU is the 'payload' of
a given PDU. That is, the process of changing a SDU to a PDU, consists of an encapsulation process,
performed by the lower layer. All the data contained in the SDU becomes encapsulated within the PDU. The
layer n-1 adds headers or footers, or both, to the SDU, transforming it into a PDU of layer n-1. The
added headers or footers are part of the process used to make it possible to get data from a source to a
destination.
Protocol data unit
Piece of data passed between layers collectively known as PDU (protocol data unit). Layers have different terms to
describe it like (segment in transport layer, packet in network layer, frame at data link layer, and signal at
physical layer.)
PDU include data file and a consistent body of information attached onto data at each successive layer. This
information is called header and footer. It includes instructions on how to restore the file to its original state
when it receives to the target system.

As a PDU passes through the layers, a header (and footer only on data link layer) is added to the packet with
information to the peer layer on the destination system for reconstructing the data on its way back up through the
layers of the destination network.
Data Exchange Process
In data exchange process, participating computers work in reverse mode. Layers on receiving computer
perform the same task in reverse mode.
The receiving device takes delivery of, handles, and translates the data from the sending device at a particular
layer. For example on sending computer presentation layer compress the data, same presentation layer on
receiving computer decompress the data.
On sending computer

Sending application access the application layer.


Application provides data to the presentation layer.
Presentation layer format the data as per network requirement and forward it's to session layer.
Session layer initiate the connection and forward the data to the transport layer.
Transport layer broke down the large data file in smaller segments and add a header with control
information, which are bits designated to describe how to determine whether the data is complete,
uncorrupted, in the correct sequence, and so forth.
Segments are forwarded to the network layer. Network layer add its header, with logical address
and convert it in packet. Network layer forwards packet to data link layer.
Data link layer attach its header and footer to the packet and convert it in frame.
Frames are forwarded to the physical layers that convert them in signals. These signals are loaded
in media.

On receiving computer

Physical layer receive signals from media and convert them in frames. Frames are forwarded
to the data link layer.
Data link layer check the frame. All tampered frame are dropped here. If frame is correct, data link
layer strip down its header and footer from frame and hand over packet to network layer.
Network layer check the packet with its own implementations. If it's found everything fine with packet, it
strips down its header from packet and hand over segment to transport layer.
Transport layer again do the same job. It verifies the segments with its own protocol rules. Only the
verified segments are processed. Transport layer remove its header from verified segments and
reassemble the segments in data. Data is handed over the session layer.
Session layer keep track of open connection and forwarded the receiving data to presentation layer.
Presentation form the data in such a way that application layer use it.
Application layer on receiving computer find the appropriate application from the computer and open
data within particular application.

In nutshell
At the sending device, each layer breaks the data down into smaller packets and adds its own header.
At the receiving device, each layer strips off the header and builds the data packets into larger packets.
Each protocol layer is blind to the headers of any other protocol layer and cannot process them.

Layer 1: Physical Layer


The physical layer defines the electrical and physical specifications of the data connection. It is responsible for
transmission and reception of unstructured raw data in a physical medium

The Physical Layer :


1.
2.
3.
4.
5.
6.

It is the lowest layer of the OSI Model.


It activates, maintains and deactivates the physical connection.
It is responsible for transmission and reception of the unstructured raw data over network.
Voltages and data rates needed for transmission is defined in the physical layer.
It converts the digital/analog bits into electrical signal or optical signals.
Data encoding is also done in this layer.

Layer 2: Data Link Layer


The data link layer provides node-to-node data transfera link between two directly connected nodes. It detects
and possibly corrects errors that may occur in the physical layer. It, among other things, defines the protocol to
establish and terminate a connection between two physically connected devices. It also defines the protocol
for flow control between them.
IEEE 802 divides the data link layer into two sublayer.

Media Access Control (MAC) layer - responsible for controlling how devices in a network gain access to
medium and permission to transmit it.
Logical Link Control (LLC) layer - responsible for identifying Network layer protocols and then
encapsulating them and controls error checking and frame synchronization.

The Point-to-Point Protocol (PPP) is a data link layer that can operate over several different physical layers, such
as synchronous and asynchronous serial lines.
Main functions of data link layer are

Defining the Media Access Control (MAC) or hardware addresses


Defining the physical or hardware topology for connections
Defining how the network layer protocol is encapsulated in the data link layer frame
Providing both connectionless and connection-oriented services
Defines hardware (MAC) addresses as well as the communication process that occurs within a media.

MAC Address
MAC address is a 48 bit long layer two address. It is also known as hardware address. This address is burnt with
device by manufacturing company.
The first six hexadecimal digits of a MAC address represent its manufacture company.
MAC addresses only need to be unique in a broadcast domain.
You can have the same MAC address in different broadcast domains.
Frame
Data link layer receive packet from network layer and wrap it with layer two Header that is
known as frame. There are two specifications of Ethernet frame.
1.
2.

Ethernet II
802

Data Link Layer :


1.
2.
3.

Data link layer synchronizes the information which is to be transmitted over the physical layer.
The main function of this layer is to make sure data transfer is error free from one node
to another, over the physical layer.
Transmitting and receiving data frames sequentially is managed by this layer.

4.
5.

This layer sends and expects acknowledgements for frames received and sent respectively. Resending of
non-acknowledgement received frames is also handled by this layer.
This layer establishes a logical layer between two nodes and also manages the Frame traffic control over
the network. It signals the transmitting node to stop, when the frame buffers are full.

Layer 3: Network Layer


The network layer provides the functional and procedural means of transferring variable length data sequences
(called datagrams) from one node to another connected to the same network. It translates logical network
address into physical machine address.
A datagram is a basic transfer unit associated with a packet-switched network. The delivery, arrival time, and
order of arrival need not be guaranteed by the network.
A network is a medium to which many nodes can be connected, on which every node has an address and which
permits nodes connected to it to transfer messages to other nodes connected to it by merely providing the content
of a message and the address of the destination node and letting the network find the way to deliver the message
to the destination node, possibly routing it through intermediate nodes. If the message is too large to be
transmitted from one node to another on the data link layer between those nodes, the network may implement
message delivery by splitting the message into several fragments at one node, sending the fragments
independently, and reassembling the fragments at another node. It may, but need not, report delivery errors.
Message delivery at the network layer is not necessarily guaranteed to be reliable; a network
layer protocol may provide reliable message delivery, but it need not do so.
Network layer is responsible for providing logical address known as IP address. Router works on this layer. Main
functions of this layer are following:-

Define IP address
Find routes based on IP address to reach its destination
Connect different data link type together like as Token Ring, Serial, FDDI, Ethernet etc.

The Network Layer :


1.
2.
3.
4.

It routes the signal through different channels from one node to other.
It acts as a network controller. It manages the Subnet traffic.
It decides by which route data should take.
It divides the outgoing messages into packets and assembles the incoming packets into
messages for higher levels.

IP address
IP address a 32 bit long software address which made from two components:
Network component: - Defines network segment of device.
Host component :- Defines the specific device on a particular network segment
Subnet mask is used to distinguish between network component and host component.
IP packet
Network layer receive segment from transport layer and wrap it with IP header that is known as datagram.

Datagram
Datagram is just another name of packet. Network layer use datagram to transfer information between nodes.
Two types of packets are used at the Network layer: data and route updates.
Data packets
Data packets are used to transport the user data across the network. Protocols used by data packets are
known as routed protocol. For example IP and IPv6
Route update packets
These packets are used to update the route information within internetwork. Routers use these packets.
Protocols that send route update packets are called routing protocols; for example RIP, RIPv2, EIGRP, and OSPF
Routing is the process of selecting best paths in a network. In packet switching networks, routing directs packet
forwarding (the transit of logically addressed network packets from their source toward their ultimate
destination) through intermediate nodes. Intermediate nodes are typically network hardware devices such
as routers, bridges, gateways, firewalls, or switches.
A router[a] is a networking device that forwards data packets between computer networks. Routers perform the
traffic directing functions on the Internet. A data packet is typically forwarded from one router to another
through the networks that constitute the internetwork until it reaches its destination node.[2]
A router is connected to two or more data lines from different networks.[b] When a data packet comes in on one of
the lines, the router reads the address information in the packet to determine the ultimate destination. Then,
using information in its routing table or routing policy, it directs the packet to the next network on its journey.
This creates an overlay internetwork.
Layer 4: Transport Layer
The transport layer provides the functional and procedural means of transferring variable-length data
sequences from a source to a destination host via one or more networks, while maintaining the
quality of service functions. The protocols of the layer provide host-to-host communication services for
applications.[1] It provides services such as connection-oriented data stream support, reliability, flow control,
and multiplexing.
An example of a transport-layer protocol in the standard Internet stack is Transmission Control Protocol (TCP),
usually built on top of the Internet Protocol (IP).
The transport layer controls the reliability of a given link through flow control, segmentation/desegmentation,
and error control. Some protocols are state- and connection-oriented. This means that the transport layer can
keep track of the segments and retransmit those that fail. The transport layer also provides the acknowledgement
of the successful data transmission and sends the next data if no errors occurred. The transport layer creates
packets out of the message received from the application layer. Packetizing is a process of dividing the long
message into smaller messages.
Although not developed under the OSI Reference Model and not strictly conforming to the OSI definition of the
transport layer, the Transmission Control Protocol (TCP) and the User Datagram Protocol(UDP) of the Internet
Protocol Suite are commonly categorized as layer-4 protocols within OSI.
Transport Layer :
1.
2.
3.
4.

It decides if data transmission should be on parallel path or single path.


Functions such as Multiplexing, Segmenting or Splitting on the data are done by this layer
It receives messages from the Session layer above it, convert the message into smaller units and passes it
on to the Network layer.
Transport layer can be very complex, depending upon the network requirements.

Transport layer breaks the message (data) into small units so that they are handled more efficiently by the
network layer.

Transport layer provides following services: -

It sets up and maintains the connection between two devices.


It multiplexes connections that allow multiple applications to simultaneously send and receive data.
According to requirement data transmission method can be connection oriented or connection less.
For unreliable data delivery connection less method is used.
Connection less method uses UDP protocol.
For reliable data delivery connection oriented method is used.
Connection oriented method uses TCP protocol.
When Implemented a reliable connection, sequence numbers and acknowledgments (ACKs) are used.
Reliable connection controls flow through the uses of windowing or acknowledgements.

For exam purpose remember five main functions of transport layer.


1.
2.
3.
4.
5.

Segmentation
Connection management
Reliable and unreliable data delivery
Flow control
Connection multiplexing

Lets understand these functions in more depth


Segmentation
Segmentation is the process of breaking large data file into smaller files that can be accommodated by network.
To understand this process thinks about a 700 MB movie that you want to download from internet. You have
2MBPS internet connection. How will you download a 700MB movie on 2MBPS internet connection?
In this case segmentation process is used. On server transport layer breaks 700MB movie in smaller size of
segments (less than your internet connection speed). Assume that 700Mb movie is divided in 700 segments. Each
segment has file size of 1Mb that your PC can easily download at current connection speed. Now your PC will
download 700 small files instead of one large file. So next time when you see download progress bar in browser,
think it about segment receiver progress bar. Once your browser receives all segments from server, it will pop up
a message indicating download is completed. Transport layer at your PC will merge all segments back in a single
700Mb movie file. End user will never know how a 700Mb movie makes its way through the 2Mbps connection
line.
Connection management
Transport layer setup, maintain and tear down connections for session layer. Actual mechanic of connection is
controlled by transport layer. Transport layer use two protocols for connection management UDP and TCP.
UDP
UDP is a connection less protocol. Connection-less transmission is said to be unreliable. Now, don't get worried
about the term "unreliable" this doesn't mean that the data isn't going to get its destination; its only means that it
isn't guaranteed to get its destination. Think of your options when you are sending a postcard, put it in the
mailbox, and chances are good that it will get where it's supposed to go but there is no guarantee. There is always
a chance of missing in the way. On the other hand, it's cheap.
TCP
TCP is a connection oriented protocol. Connection-oriented transmission is said to be reliable. Think TCP as
registry AD facility available in Indian post office. For this level of service, you have to buy extra ticket and put a
bunch of extra labels on it to track where it is going and where it has been. You get a receipt when it is delivered.
In this method you have a guaranteed delivery. All of this costs you morebut it is reliable!
Reliability

Reliability means guaranteed data delivery. To insure delivery of each single segment, connection oriented
method is used. In this approach before sending any segments three way handshake process is done.
Once connection is established data transmission will be initiated. To provide maximum reliability it includes
following functions:-

Detect lost packets and resend them


Detect packets that arrived out of order and reorder them
Recognize duplicate packets and drop extra packets
Avoid congestion by implementing flow control

Flow control
The transport layer implements two flow control methods:

Ready/not ready signals


Windowing

Ready / not ready signals method


In this method sender sends data according to its buffer size. Receiver receives data in its buffer. When receivers
buffer get filled, it send a not ready signal to sender, so sender can stop transmitting more segments. Receivers
send ready signal when it becomes ready to receive next segments. This method has two problems.

First, the receiver may respond to the sender with a not ready signal only when its buffer fills up. While
this message is on its way to the sender, the sender is still sending segments to the receiver, which the
receiver will have to drop because its buffer space is full.
The second problem with the uses of this method is that once the receiver is ready to receive more
segments, it must first send a ready signal to the sender, which must be received before sender can send
more segments.

Windowing
In windowing a window size is defined between sender and receiver. Sender host will wait for an
acknowledgement signal after sending the segments equal to the window size. If any packet lost in the way,
receiver will respond with acknowledgement for lost packet. Sender will send lost packet again. Window size is
automatically set during the three step handshake process. It can be adjust anytime throughout the lifetime of
connection.
Connection Multiplexing/Application Mapping
Connection multiplexing feature allows multiple applications to connect at a time. For example a server performs
a number of functions like email, FTP, DNS, Web service, file service, data service etc. Suppose server has a single
IP address, how will it perform all these different functions for all the hosts that want to connect with it? To make
this possible transport layer assigns a unique set of numbers for each connection. These numbers are called port
or socket numbers. These port numbers allow multiple applications to send and receive data simultaneously.
Transport layer services are conveyed to an application via a programming interface to the transport layer
protocols. The services may include the following features:

Connection-oriented communication: It is normally easier for an application to interpret a connection as


a data stream rather than having to deal with the underlying connection-less models, such as
the datagram model of the User Datagram Protocol (UDP) and of the Internet Protocol (IP).
Same order delivery: The network layer doesn't generally guarantee that packets of data will arrive in the
same order that they were sent, but often this is a desirable feature. This is usually done through the use of
segment numbering, with the receiver passing them to the application in order. This can cause head-of-line
blocking.
Reliability: Packets may be lost during transport due to network congestion and errors. By means of an error
detection code, such as a checksum, the transport protocol may check that the data is not corrupted, and

verify correct receipt by sending an ACK or NACK message to the sender. Automatic repeat
request schemes may be used to retransmit lost or corrupted data.
Flow control: The rate of data transmission between two nodes must sometimes be managed to prevent a
fast sender from transmitting more data than can be supported by the receiving data buffer, causing a buffer
overrun. This can also be used to improve efficiency by reducing buffer underrun.
Congestion avoidance: Congestion control can control traffic entry into a telecommunications network, so as
to avoid congestive collapse by attempting to avoid oversubscription of any of the processing
or link capabilities of the intermediate nodes and networks and taking resource reducing steps, such as
reducing the rate of sendingpackets. For example, automatic repeat requests may keep the network in a
congested state; this situation can be avoided by adding congestion avoidance to the flow control,
including slow-start. This keeps the bandwidth consumption at a low level in the beginning of the
transmission, or after packet retransmission.
Multiplexing: Ports can provide multiple endpoints on a single node. For example, the name on a postal
address is a kind of multiplexing, and distinguishes between different recipients of the same location.
Computer applications will each listen for information on their own ports, which enables the use of more than
one network service at the same time. It is part of the transport layer in the TCP/IP model, but of the session
layer in the OSI model.

Layer 5: Session Layer[edit]


The session layer controls the dialogues (connections) between computers. It establishes, manages and
terminates the connections between the local and remote application
The Session Layer :
1.
2.

Session layer manages and synchronize the conversation between two different applications.
Transfer of data from source to destination session layer streams of data are marked and are
resynchronized properly, so that the ends of the messages ar

Layer 6: Presentation Layer[edit]


The presentation layer establishes context between application-layer entities
It is sometimes called the syntax layer.
Presentation layer prepares the data. It takes data from application layer and marks it with formatting code such
as .doc, .jpg, .txt, .avi etc. These file extensions make it easy to realize that particular file is formatted with
particular type of application. With formatting presentation layer also deals with compression and encapsulation.
It compresses (on sending computer) and decompresses (on receiving computer) the data file. This layer can also
encapsulate the data, but its uncommon as this can be done by lower layers more effectively.
Session layer deals with connections. It establishes, manages, and terminates sessions between two
communicating nodes. This layer provides its services to the presentation layer. Session layer also synchronizes
dialogue between the presentation layers of the two hosts and manages their data exchange.
The Presentation Layer :
1.
2.
3.
4.

Presentation layer takes care that the data is sent in such a way that the receiver will understand the
information (data) and will be able to use the data.
While receiving the data, presentation layer transforms the data to be ready for the application layer.
Languages(syntax) can be different of the two communicating systems. Under this condition
presentation layer plays a role of translator.
It perfroms Data compression, Data encryption, Data conversion etc.

Layer 7: Application Layer[edit]


The application layer is the OSI layer closest to the end user, which means both the OSI application layer and the
user interact directly with the software application. This layer interacts with software applications that implement
a communicating component. Such application programs fall outside the scope of the OSI model.

Application layer provides platform to send and receive data over the network. All applications and utilities that
communicate with network fall in this layer. For examples
Application Layer :
1.
2.
3.

It is the topmost layer.


Transferring of files disturbing the results to the user is also done in this layer. Mail services, directory
services, network resource etc are services provided by application layer.
This layer mainly holds application programs to act upon the received and to be sent data.

Browsers :- Mozilla Firefox, Internet Explorer, Google Chrome etc


Email clients: - Outlook Express, Mozilla Thunderbird etc.
FTP clients :- Filezilla, sFTP, vsFTP
Application layer protocols that we should know for exam are following:
DNS (Domain Naming System) Used to translate the name with IP address and vice versa.
HTTP (Hypertext Transfer Protocol) Used to browse web pages.
FTP (File Transfer Protocol) Used to reliably sends/retrieves files.
Merits of OSI reference model:
1.
2.
3.
4.

OSI model distinguishes well between the services, interfaces and protocols.
Protocols of OSI model are very well hidden.
Protocols can be replaced by new protocols as technology changes.
Supports connection oriented services as well as connectionless service.

Demerits of OSI reference model:


1.
2.
3.

Model was devised before the invention of protocols.


Fitting of protocols is tedious task.
It is just used as a reference model.

Comparison with TCP/IP model[edit]


The design of protocols in the TCP/IP model of the Internet does not concern itself with strict hierarchical
encapsulation and layering.[16] RFC 3439 contains a section entitled "Layering considered harmful".[17] TCP/IP
does recognize four broad layers of functionality which are derived from the operating scope of their contained
protocols: the scope of the software application; the end-to-end transport connection; the internetworking range;
and the scope of the direct links to other nodes on the local network.[18]
Despite using a different concept for layering than the OSI model, these layers are often compared with the OSI
layering scheme in the following way:

The Internet application layer includes the OSI application layer, presentation layer, and most of the
session layer.
Its end-to-end transport layer includes the graceful close function of the OSI session layer as well as the
OSI transport layer.
The internetworking layer (Internet layer) is a subset of the OSI network layer.
The link layer includes the OSI data link layer and sometimes the physical layers, as well as some
protocols of the OSI's network layer.

TCP/IP Reference Model


TCP/IP protocol model is another popular layer model that describes network standards. For CCNA exam you
should be aware about this model as well. This model has same names of layers as OSI reference model has. Don't
be confuse with same name, layers at both model have different functionality in each model.
Let's see how TCP/IP model is different from OSI reference model
Application layer:
TCP/IP model combine the functionality of application layer, presentation layer and session layer from OSI
model in single application layer. In TCP/IP model application layer do all tasks those are performed by upper
layers in OSI model. Application layer deals with high level protocols, including data presentation, compression
and dialog control.
Transport layer:
In TCP/IP model transport layer provides quality of services. TCP protocol is used for reliable data delivery. Flow
control and error correction methods are used for guaranteed data delivery.
Internet layer:
In TCP/IP model Internet layer provide all the functionality that network layer provides in OSI model. Internet
layer is responsible for finding the correct path for datagram [packet].
Network access layer:
Name of this layer may confuse you as OSI model has a layer of same name. In TCP/IP model network access
layer deals with LAN and WAN protocols and all the functionality provided by physical and data link layer in OSI
model.

Flow and Error Control Techniques


Search this Search

Flow Control: Flow control coordinates that amount of data that can be sent before receiving
acknowledgement.
It is one of the most important duties of the data link layer.
Flow control tells the sender how much data to send.
It makes the sender wait for some sort of an acknowledgment (ACK) before continuing to send more
data.
Flow Control Techniques: Stop-and-wait, and Sliding Window
Error Control: Error control in the data link layer is based on ARQ (automatic repeat request), which is the retransmission
of data.

The term error control refers to methods of error detection and retransmission.

Anytime an error is detected in an exchange, specified frames are retransmitted. This process is called
ARQ.

To ensure reliable communication, there needs to exist flow control (managing the amount of data the sender sends), and
error control (that data arrives at the destination error free).
Flow and error control needs to be done at several layers.
For node-to-node links, flow and error control is carried out in the data-link layer.
For end-point to end-point, flow and error control is carried out in the transport layer.
Flow & Error control:

Error Detection and ARQ (error detection with retransmissions) must be combined with methods that intelligently
limit the number of outstanding (unACKed) frames.
Flow & Error control techniques: Stop-and-Wait ARQ, Go-Back-N ARQ, and Selective Repeat ARQ

Flow Control Techniques:


One important aspect of data link layer is flow control.
Flow control refers to a set of procedures used to restrict the amount of data the sender can send before waiting for
acknowledgement.

Stop and Wait Flow control:


The sender has to wait for an acknowledgment of every frame that it sends.
Only when a acknowledgment has been received is the next frame sent. This process continues until the sender
transmits an End of Transmission (EOT) frame.
Wait flow control, the receiver indicates its readiness to receive data for each frame.
In Stop-and-Wait

For every frame that is sent, there needs to be an acknowledgment, which takes a similar amount of propagation
time
ime to get back to the sender.
Only one frame can be in transmission at a time. This leads to inefficiency if propagation delay is much longer
than the transmission delay
Advantages of Stop and Wait:
Wait
o Its simple and each frame is checked and acknowledged well.
w
Disadvantages of Stop and Wait:
Wait
o Only one frame can be in transmission at a time.
o It is inefficient, if the distance between devices is long. Reason is propagation delay is much longer than
the transmission delay.
o The time spent for waiting acknowledgements
acknowledge
between each frame can add significant amount to the
total transmission time.

Sliding Window Flow Control:


It works by having the sender and receiver have a window of frames.
Each frame has to be numbered in relation to the sliding window. For a window of size n, frames get a number
from 0 to n 1. Subsequent frames get a number mod n.
The sender can send as many frames as would fit into a window.
The receiver, upon receiving enough frames, will respond with an acknowledgment of all frames up to a certain
point in the window. It is called slide.

This 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.
For example, if n = 8, the frames are numbered 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1so on. The size of
the window is (n -1) = 7.
When the receiver sends an ACK, it includes the number of the next frame it expects to receive. When the receiver
sends an ACK containing the number 5, it means all frames upto number 4 have been received.
If the window size is sufficiently large the sender can continuously transmit packets:
packets
o If W >= (2a+1), sender can transmit continuously. (Efficiency =1)
o If W < (2a+1), sender can transmit W frames every (2a+1) time units.
units (Efficiency = W/(1+2a))

Error Control Techniques:

Many factors including line noise can alter or wipe out one or more bits of a given data unit.

Reliable systems must have mechanism for detecting and correcting such errors.

Error detection and correction are implemented either at the data link layer or the transport layer of the
OSI model.

Error Detection

Error detection uses the concept of redundancy, which means adding extra bits for detecting errors at
the destination.

Checking function performs the action that the received bit stream passes the checking criteria, the data
portion of the data unit is accepted else rejected.

Vertical Redundancy Check (VRC)


(VRC

In this technique, a redundant bit, called parity bit, is appended to every data unit, so that the total
number of 1s in the unit (including the parity bit) becomes even.

If number of 1s are already even in data, then parity bit will be 0.

Some systems may use odd parity checking, where the number of 1s should be odd. The principle is
the same, the calculation is different.

Checksum

There are two algorithms involved in this process, checksum generator at sender end and checksum
checker at receiver end.

The sender follows these steps


step
o

The data unit is divided into k sections each of n bits.

All sections are added together using 1s complement to get the sum.

The sum is complemented and becomes the checksum.

The checksum is sent with the data.

The receiver follows these steps


o

The received unit is divided into k sections each of n bits.

All sections are added together using 1s complement to get the sum.

The sum is complemented.


complemented

If the result is zero, the data are accepted, otherwise they are rejected.

Cyclic Redundancy Check (CRC):


(CRC)

CRC is based on binary division.


division

A sequence of redundant bits called 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.

At its destination, the incoming data unit is divided by the same number. If at this step there is no
remainder, the data unit is assumed to be intact and therefore is accepted.

Error Correction:

Error correction in data link layer is implemented simply anytime.

An error is detected in an exchange, a negative acknowledgement NAK is returned and the specified
frames are retransmitted. This process is called Automatic Repeat Request (ARQ)
(ARQ).

Retransmission of data happens in three Cases: Damaged frame, Lost frame and Lost
acknowledgement.

Flow and Error Control Techniques (ARQ schemes):

Stop and Wait ARQ:

Include re-transmission
transmission of data in case of lost or damaged
damage framer.

It is addition to the basic flow control mechanism with re-transmissions.


re

(i) Sender sends an information frame to receiver.


(ii) Sender waits for an ACK before sending the next frame.
(iii) Receiver sends an ACK if frame is correctly received.
(iv)
iv) If no ACK arrives within time-out,
time
sender will resend the frame.
Time-out period > Rround trip time

If an error is discovered in a data frame, indicating that it has been corrupted in transit, a NAK frame is
returned. NAK frames, which are numbered, tell the sender to retransmit the last frame sent.

Piggybacking: In bidirectional communications, both parties send & acknowledge data, i.e. both parties
implement flow control. Outstanding ACKs are placed in the header of information frames, piggybacking can save

bandwidth since the overhead from a data frame and an ACK frame (addresses, CRC, etc) can be combined into
just one frame.

Sliding Window ARQ:

To cover retransmission of lost or damaged frames, some features are added to the basic flow control
mechanism of sliding window.

A Sender may send multiple frames as allowed by the window size.

The sending device keeps copies of all transmitted frames, until they have been acknowledged.

In addition to ACK frames, the receiver has the option of returning a NAK frame, if the data have been
received damaged. NAK frame tells the sender to retransmit a damaged frame.

Here, both ACK and NAK frames must be numbered for identification.

ACK frames carry the number of next frame expected.

NAK frames on the other hand, carry the number of the damaged frame itself.

If the last ACK was numbered 3, an ACK 6 acknowledges the receipt of frames 3, 4 and 5 as well.

If data frames 4 and 5 are received damaged, both NAK 4 and NAK 5 must be returned.

Like stop and wait ARQ, the sending device in sliding window ARQ is equipped with a timer to enable
it to handle lost acknowledgements.

Sliding window ARQ is two types: Go-back-n ARQ, and Selective Reject ARQ.

There are two ACK processing methods in sliding windows:

Selective ACK: The ACK N message acknowledges only the frame with sequence number N

Cumulative ACK: The ACK N message acknowledges all frames with sequence number <= N

(i) Go-back-n ARQ:


The sliding window method using cumulative ACK is known as the Go-Back-N ARQ protocol.
Receiver window size is 1.
In this method, if one frame is lost or damaged all frames sent, since the last frame acknowledged are
retransmitted.
NAK number refer to the next expected frame number.
For example, sender may send frames 1,2,3,4 and get an NAK with a value of 2. The NAK acknowledges

everything that came before it, and asks for frame 2 (and subsequent frames) to be resent.
Example: In the following figure, frame 2 has an error, then all subsequent frames are discarded. After timeout
sender sends all frames from frame 2.

Damaged/Error Frame:
o In go-back-n ARQ, The receiver sends the NAK for this frame along with that frame number, that it
expects to be retransmitted.

After sending NAK, the receiver discards all the frames that it receives, after a damaged frame.
The receiver does not send any ACK (acknowledgement) for the discarded frames.
After the sender receives the NAK for the damaged frame, it retransmits all the frames onwards the
frame number referred by NAK.
Lost frame:
o In go-back-n ARQ, Receiver easily detects the loss of a frame as the newly received frame is received
out of sequence.
o The receiver sends the NAK for the lost frame and then the receiver discards all the frames received after
a lost frame.
o The receiver does not send any ACK for that discarded frames.
o After the sender receives the NAK for the lost frame, it retransmits the lost frame referred by NAK and
also retransmits all the frames which it has sent after the lost frame.
Lost Acknowledgement:
o In go-back-n ARQ, If the sender does not receive any ACK or if the ACK is lost or damaged in between
the transmission.
o The sender waits for the time to run out and as the time run outs, the sender retransmits all the frames for
which it has not received the ACK.
o The sender identifies the loss of ACK with the help of a timer.
o The ACK number, like NAK number, shows the number of the frame, that receiver expects to be the
next in sequence.
o The window size of the receiver is 1 as the data link layer only require the frame which it has to send
next to the network layer.
o The sender window size is equal to w. If the error rate is high, a lot of bandwidth is lost wasted.

o
o

(ii) Selective Reject ARQ:

Selective Repeat ARQ overcomes the limitations of Go-Back-N by adding two new features:

Receiver window > 1 frame: Out-of-order but error-free frames can be accepted

Retransmission mechanism is modified: Only individual frames are retransmitted

In this method, only specific damaged or lost frame is re-transmitted.

Sender only retransmits frames for which a NAK is received.

NAK number refer to the frame lost.

If a frame is corrupted in transmit, a NAK is returned and the frame is resent out of sequence.

The sender needs to maintain all data that hasnt been aknowledged yet.

The receiving device must be able to sort the frames it has and insert the retransmitted frame into its
proper place in the sequence.

It has advantage that few re-transmissions than go-back-n. But complexity at sender and receiver is involved.

Example: Frame 2 has an error, so receiver maintains buffer to store the next frames.

Damaged frames:
o If a receiver receives a damaged frame, it sends the NAK for the frame in which error or damage is
detected.

The NAK number, like in go-back-n also indicate the acknowledgement of the previously received
frames and error in the current frame.
o The receiver keeps receiving the new frames while waiting for the damaged frame to be replaced.
o The frames that are received after the damaged frame are not be acknowledged until the damaged frame
has been replaced.
Lost Frame:
o As in a selective repeat protocol, a frame can be received out of order and further they are sorted to
maintain a proper sequence of the frames.
o While sorting, if a frame number is skipped, the receiver recognise that a frame is lost and it sends NAK
for that frame to the sender.
o After receiving NAK for the lost frame the sender searches that frame in its window and retransmits that
frame.
o If the last transmitted frame is lost then receiver does not respond and this silence is a negative
acknowledgement for the sender.
Lost Acknowledgement:
o If the sender does not receive any ACK or the ACK is lost or damaged in between the transmission.
o The sender waits for the time to run out and as the time run outs, the sender retransmit all the frames for
which it has not received the ACK.
o The sender identifies the loss of ACK with the help of a timer.

Concept of Layering
Search this Search

OSI (Open System Interconnection) Model

The OSI model is a reference tool for understanding data communication between hosts with help of
seven layers approach in communication process.

Each layer performs specific functions to support the layers above it and uses services of the layers
below it.

Physical Layer:

The physical layer coordinates the functions required to transmit a bit stream over a physical medium.

It deals with the mechanical and electrical specifications of interface and transmission medium.

It also defines the procedures and functions that physical devices and interfaces have to perform for
transmission to occur.

Ethernet network interface card performs functions at both the physical layer and the data link lay
layer.

Functions of Physical Layer:

Physical layer defines characteristics of the interface between the devices and the transmission
medium.

It defines the type of transmission medium.

It defines the transmission rate (the number of bits sent each second).

It performs synchronisation of sender and receiver clocks.

It is concerned with the connection of devices to the medium.

1.

Point-to-point configuration: Two devices are connected together through dedicated link.

2.

Multipoint configuration: A link is shared between several devices

It is concerned with the physical topology.

It defines the direction of transmission called as transmission mode (simplex, half duplex or duplex).

It transmits bit stream over the communication channel.

Hardware Used: Repeater and Hub.

Data Unit: Bit stream

Data Link Layer:

The data link layer transforms the physical layer, a raw transmission facility, to a reliable link.

It is responsible for Node-to-Node delivery.

It makes the physical layer appear error free to the Network layer.

Functions of Data Link Layer:

Data Framing: Division of stream of bits received from network layer into manageable data units
called frames. Segmentation of upper layer datagrams (packets) into frames.

Flow Control: It is to manage communication between a high speed transmitter with the low speed
receiver.

Error Control: It provides mechanism to detect and re-transmit damaged or lost frames and to prevent
duplication of frames. To achieve error control, a trailer is added at the end of a frame.

Access Control: Gives mechanism to determine which device has control over the link at any given
time, if two or more devices are connected to the same link.

Physical Addressing: Adding a header to the frame to define the physical address of the sender
(source address) and/or receiver (destination address) of the frame.

Hardware Used: Bridges and switches.

Data Unit: Frames

Protocol Used: Simplex protocol, stop and wait protocol, sliding window, HDLC (High Level Data
Link Control), SDLC, NDP, ISDN, ARP, PSL, OSPF and NDP.

Network Layer:

Network layer is responsible for source to destination delivery of a packet possibly across multiple
networks (links).

If the two systems are connected to the same link, there is usually no need for a network layer.

If the two systems are attached to different networks (links) with connecting devices between networks,
there is often a need of the network layer to accomplish source to destination delivery.

Functions of the Network Layer:

Logical Addressing: If packet passes the network boundary, we need logical addressing system to
distinguish the source and destination systems.

Routing: Independent networks or links are connected together with the help of routers or gateways.
Routers route the packets to their final destination. Network layer is responsible for providing routing
mechanism.

Hardware Used: Routers

Data Units: Packets

Protocols Used: IP (Internet, Protocol), NAT (Network Address Translation), ARP (Address
Resolution Protocol), ICMP (Internet control Message Protocol), BGP (Border Gateway Protocol),
RARP (Reverse Address Resolution Protocol), DHCP (Dynamic Host Configuration Protocol),
BOOTP and OSPF.

Transport Layer:

The transport layer is responsible for- source to destination (end-to-end) delivery of the entire message.

Network layer does not recognise any relationship between the packets delivered.

Network layer treats each packet independently, as though each packet belonged to a separate message, whether or
not it does. The transport layer ensures that the whole message arrives intact and in order.

Functions of Transport Layer:

Service Point Addressing: The transport layer header must include a type of address called service
point address (or part address).

Segmentation and Reassembly: A message is divided into transmittable segments, each segment
containing a sequence number.

Flow Control Flow: control at this layer is performed end to end rather than across a single link.

Error Control: This layer performs an end to end error control by ensuring that the entire message at
the receiving transport layer without error (damage, loss or duplication). Error correction is usually
achieved through retransmission.

Connection Control: Transport layer can deliver the segments using either connection oriented or
connection less approach.
Hardware Used: Transport Gateway
Data Unit: Segments
Protocol Used: TCP (Transmission Control Protocol) for connection oriented approach and UDP
(User Datagram Protocol) for connection less approach.

Session Layer:

The session layer is the network dialog controller.

It establishes, maintains and synchronises the interaction between communicating systems.

It also plays important role in keeping applications data separate.

Functions of Session Layer:


Specific responsibilities of the session-layer include the following.

Dialog Control: Session layer allows the communication between two processes to take place either in
half duplex or full duplex. It allows applications functioning on devices to establish, manage and
terminate a dialog through a network.

Synchronization: The session layer allows a process to add check points (synchronization points) into
a stream of data.

Presentation Layer:

It is responsible for how an application formats data to be sent out onto the network.
It basically allows an application to read and understan the message.

Functions of Presentation Layer:

Translation: Different systems use different encoding system, so the presentation layer provides interoperability
between these different encoding methods. This layer at the sender end changes the information from sender
dependent format into a common format. The presentation layer at receiver end changes the common format into
its receiver dependent format.
Encryption and Decryption: This layer provides encryption and decryption mechanism to assure privacy to carry
sensitive information. Encryption means sender transforms the original information to another form and at the
receiver end, decryption mechanism reverses the new form of data into its original form.
Compression: This layer uses compression mechanism to reduce the number of bits to be transmitted. Data
compression becomes important in the transmission of multimedia such as text, audio and video.

Application Layer:

This layer enables the user, whether human or software, to access the network.
It provides user interfaces and support for services such as electronic mail, remote file access and transfer shared
database management and other types of distributed information services.
Examples: Telnet. FTP etc

Functions of Application Layer:

Network Virtual Terminal: It is a software version of a physical terminal and allows a user to logon to a remote
host. To do so, the application creates a software emulation of a terminal at the remote host.
File Transfer, Access and Management: It allows a user to access files, retrieve files, manage files or control
files in a remote computer.
Mail Services: It provides Electronic messaging (e-mail storage and forwarding).
Directory Services: It provides distributed database sources and access for global information about various
objects and services.

Types of Networks: Mainly three types of network based on their coverage areas: LAN, MAN and WAN.

LAN: It is a local area network typically interconnects hosts that are up to a few or maybe a few tens of
kilo meters apart.

MAN: It is a metropolitan area network typically interconnects devices that are up to a few hundred
kilo meters apart

WAN: It is a wide area network interconnect hosts that can be located anywhere on Earth

LAN (Local Area Network)

LAN is privately owned network within a single building or campus.

LANs can be small, linking as few as three computers, but often link hundreds of computers used by
thousands of people (like in some IT office, etc.)

Examples of LAN technology: Ethernet, Token Ring and Fibber Distributed Data Interconnect
(FDDI).

MAN (Metropolitan Area Network)

A MAN covers a city.

An example of MAN is cable television network in city.

It may be a single network such as cable TV network by means of connecting a number of LANs into a
larger network.

Resources may be shared LAN to LAN as well as device to device.

A MAN can be owned by a private company or it may be a service provided by a public company such
as local telephone company.
company

Telephone companies provide a popular MAN service called (SMDS) Switched Multi
Multi-megabit Data
Services.

WAN (Wide Area Network)

A wide area network or WAN spans a large geographical area often a country.

Internet It is also known as network of networks.

The Internet is a system of linked networks that are world wide in scope and facilitate data
communication services such as remote login, file transfer, electronic mail, World Wide Web and
newsgroups etc.

Characteristics of Networking:
Topology: The geometrical arrangement of the computers or nodes.
Protocols: How they communicate.
mmunicate.
Medium: Through which medium.
Network Topology

Network topology is the arrangement of the various elements of a computer or biological network.

Essentially it is the topological structure of a network, and may be depicted physically or logically.

Physical topology refers to the placement of the networks various components, inducing device
location and cable installation, while logical topology shows how data flows within a network,

regardless of its physical design.


design
Network topology can be classified as Bus topology, Star topology, Ring topology, Mesh topology and
Tree topology.

Bus Topology: In bus topology, each node is directly connected to a common cable.

In bus topology at the first, the message will go through the bus then one user can communicate with
other.

The drawback of this topology is that if the network cable breaks, the entire network will be down.

Star Topology: In this topology, each node has a dedicated set of wires connecting it to a central network hub.
Since, all traffic passes through the hub, it becomes a central point for isolating network problems and
gathering network statistics.

Ring Topology: A ring topology features a logically closed loop. Data packets travel in a single direction
around the ring from one network device to the next. Each network device acts as a repeater to keep the signal
strong enough as it travels.

Mesh Topology: In mesh topology, each system is connected to all other systems in the network.

In bus topology at the first, the message will go through the bus then one user can communicate with
other.

In star topology, first the message will go to the hub then that message will go to other user.

In ring topology, user can communicate as randomly.

In mesh topology, any user can directly communicate with other users.

Tree Topology: In this type of network topology, in which a central root is connected to two or more nodes that
are one level lower in hierarchy.

Hardware/Networking Devices: Networking hardware may also be known as network equipment computer
networking devices.

Network Interface Card (NIC):


(NIC)
o

NIC provides a physical connection between the networking cable and the computers internal
bus.

Each computer on a network must have a network card.

NICs come in three basic varieties 8 bit, 16 bit and 32 bit.

The larger number of bits that can be transferred to NIC, the faster the NIC can transfer data to
network cable.

Repeater:
o

Repeaters are used to connect together two Ethernet segments of any media type.

In larger designs, signal quality begins to deteriorate as segments exceed their maximum
length.

Signal transmission is always attached with energy loss. So, a periodic refreshing of the
signals is required.
required

Hubs:
o

A hub is a device used to connect a PC to the network

Hubs are actually multiport repeaters.

A hub takes any incoming signal and repeats it out all ports.

Bridges:
o

When the size of the LAN is difficult to manage, it is necessary to breakup the network.

The function of the bridge is to connect separate networks together.

Bridges do not forward bad or misaligned packets.

Switch:
o

Switches are an expansion of the concept of bridging.

Switches are used to connect multiple devices on the same network within a building or
campus.

Cut through switches examine the packet destination address, only before forwarding it onto
its destination segment, while a store and forward switch accepts and analyzes the entire
packet before forwarding it to its destination.

It takes more time to examine the entire packet, but it allows catching certain packet errors
and keeping them from propagating through the network.

Routers:
o

Routers are used to tie multiple networks together.

Router forwards packets from one LAN (or WAN) network to another.

It is also used at the edges of the networks to connect to the Internet.

Routers analyze the data being sent over a network, change how it is packaged, and send it to
another network, or over a different type of network.

Gateway:
o

Gateway acts like an entrance between two different networks.

Gateway in organisations is the computer that routes the traffic from a work station to the
outside network that is serving web pages.

ISP (Internet Service Provider) is the gateway for Internet service at homes.

Types of Internet Connections

Broadband:
o Broadband internet connections provide high-speed internet that is always on and allows for
more data to be transmitted than the traditional dial-up connections.
o Unlike dial-up services, it does not block phone lines and you do not have to reconnect to the
network each time you log off.
o There are various types of broadband technologies, including digital subscriber line (DSL),
cable modems, fibers, wireless broadband connections, and Satellite connections.
Wi-Fi:
o Wi-Fi is a play on the term Hi-Fi and represents a wireless internet connection.
o More specifically, it is a wireless local area network (WLAN) that allows devices to connect
wirelessly to the internet.
o It utilizes 2.4 GHz and 5.0 GHz radio waves to connect Wi-Fi enabled gadgets (computers,
gaming systems, mobile phones, and even some cameras) to the internet without the need for
cumbersome wires.
WiMAX:
o WiMAX is a more advanced form of wireless internet technology than Wi-Fi.
o It aims to provide the high speeds of broadband connections, the large coverage of phone
networks, and the convenience of Wi-Fi into one package.
o The implementation of WiMAX would allow DSL and cable modem users to ditch their wired
internet connections in favor of a high-speed, wireless alternative.

Data Transfer Modes: There are mainly three modes of data transfer.

Simplex: Data transfer only in one direction e.g., radio broadcasting.

Half Duplex: Data transfer in both direction, but not simultaneously e.g., talk back radio.

Full Duplex or Duplex: Data transfer in both directions, simultaneously e.g., telephone

Data representation: Information comes in different forms such as text, numbers, images, audio and video.

Text: Text is represented as a bit pattern. The number of bits in a pattern depends on the number of
symbols in the language.

ASCII: The American National Standards Institute developed a code called the American Standard
code for Information Interchange .This code uses 7 bits for each symbol.

Extended ASCII: To make the size of each pattern 1 byte (8 bits), the ASCII bit patterns are
augmented with an extra 0 at the left.

Unicode: To represent symbols belonging to languages other than English, a code with much greater
capacity is needed. Unicode uses 16 bits and can represent up to 65,536 symbols.

ISO: The international organization for standardization known as ISO has designed a code using a 32bit pattern. This code can represent up to 4,294,967,296 symbols.

Numbers: Numbers are also represented by using bit patterns. ASCII is not used to represent numbers.
The number is directly converted to a binary number.

Images: Images are also represented by bit patterns. An image is divided into a matrix of pixels, where
each pixel is a small dot. Each pixel is assigned a bit pattern. The size and value of the pattern depends
on the image. The size of the pixel depends on what is called the resolution.

Audio: Audio is a representation of sound. Audio is by nature different from text, numbers or images.
It is continuous not discrete

1.

2.

3.

Video: Video can be produced either a continuous entity or it can be a combination of images.

Classification of Networks: Networks are classified into the following types.


Peer-to-peer networks:
o All computers on a peer-to-peer network can be considered equal.
o Peer-to-peer networks are popular as home networks and for use in small companies because they are
inexpensive and easy to install.
o Most operating systems (the software that runs the basic computer functionality) come with peer-topeer networking capability built in.
Server-based networks:
o A dedicated server is one that, for all practical purposes, operates solely as a server.
o A dedicated server on a server-based network services its network clients by storing data, applications,
and other resources, and then providing access to those resources when called for by a client.
o When a client requests a resource such as a document, the server sends the whole resource (the
document) over the network to the client, where it is processed and later returned to the server for
continued storage.
o Server-based networks offer central control and are designed for secured operations.
Client-based networks:
o A client-based network takes better advantage of the servers powerful processors and of the
increasingly powerful computers used in typical workstations.
o A clientbased network utilizes a client workstations power in processing some functions locally while
requesting additional processing from a server whenever it is needed for increased speed.
Protocols:
It define the rules that govern the communications between two computers connected to the network.
Roles include addressing and routing of messages, error detection and recovery, sequence and flow
controls etc.
A protocol specification consists of the syntax, which defines the kinds and formats of the messages
exchanged, and the semantic, which specifies the action taken by each entity when specific events
occur.
Protocols are designed based on a layered architecture such as the OSI reference model.
Example: HTTP protocol for communication between web browsers and servers.

You might also like