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

2.unit 1 lecture notes

Uploaded by

vm4512
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)
21 views

2.unit 1 lecture notes

Uploaded by

vm4512
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/ 72

UNIT I FUNDAMENTALS & LINK LAYER

Building a network – Requirements – Topologies – OSI Model – TCP/IP architecture – Performance -


Link layer Services - Framing – Error Detection and Correction - Flow control

TOPIC PAGE
TOPIC
NUMBER NUMBER
1.1 Building a network 2
1.2 Requirements 5
1.3 Topologies 15
1.4 OSI Model 31
1.5 TCP/IP architecture 40
1.6 Performance 46
1.7 Link layer Services 49
1.8 Framing 53
1.9 Error Detection and Correction 57
1.10 Flow control 66

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC Page |1


1.1 BUILDING A NETWORK

Networks:
A network is a set of devices connected by a media link. Devices often referred to as nodes
can be a computer, printer, or any other devices capable of sending/ receiving data.
Distributed processing:
Here tasks are divided among multiple computers. Each separate computer handles a subset.
Advantages:
1. Security/ Encapsulation
2. Distributed database
3. Faster problem solving
4. Security through redundancy
5. Collaborative processing
Introduction to Data Communications:
It is the exchange of data between two devices through some transmission medium.
Types:
1. Local
2. Remote
1. Local:
If the devices are restricted in a geographical area.
2. Remote:
If the devices are farther away without any geographical restriction.
Fundamental Characteristics:
1. Delivery
2. Accuracy
3. Timeliness
Components:
Data communication systems are made up of five components.
1. Message
2. Sender
3. Receiver
4. Medium
5. Protocol

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC Page |2


1. Message:
This is the information to be communicated. It can consist of text, numbers, pictures, sound
or Video or any combination of these.
2. Sender:
It is the device that sends the data message. It may be a computer, workstation, telephone
Handset, video camera…
3. Receiver:
It is the device that receives the message. It may be a computer, workstation, telephone
handset, television…
4. Medium:
It is the physical path which a message travels from sender to receiver. It may consist of
twisted pair wire, coaxial cable, fiber optic cable, laser or radio waves.
5. Protocol:
It is a set of rules that governs data communication. It is a agreement between the
communication devices.
Application:
Major application areas
1. Business application
 Database resource
 Communication medium
 Electronic commerce
2. Home application
 Internet access
 Personal Communication
 Entertainment
 Electronic commerce
3. Mobile computers
 Taxis
 GIS
 Military applications
 Airport
 Banking

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC Page |3


Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC Page |4
1.2 REQUIREMENTS
Network connectivity
SWITCHING
Whenever we have multiple devices, we have the problem of how to connect them to make
one to one communication possible. Point to point connection between every pair of devices
are make the network very huge also cost inefficient.

A switched network consists of a series of interlinked nodes, called switches. Switches are
hardware and / or software devices capable of creating temporary connections between two
or more devices linked to the switch but not to each other.At broad level, switching can be
divided into two major categories:
Connectionless: The data is forwarded on behalf of forwarding tables. No previous
handshaking is required and acknowledgements are optional.
Connection Oriented: Before switching data to be forwarded to destination, there is a need
to pre-establish circuit along the path between both endpoints. Data is then forwarded on that
circuit. After the transfer is completed, circuits can be kept for future use or can be turned
Down immediately.
There are three methods in switching are,
1. Circuit switching
2. Packet switching
3. Message switching

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC Page |5


1. Circuit switching
When two nodes communicate with each other over a dedicated communication path, it is
called circuit switching. There 'is a need of pre-specified route from which data will travel
and no other data is permitted. In circuit switching, to transfer the data, circuit must be
established so that the data transfer can take place.
Circuits can be permanent or temporary. Applications which use circuit switching may have
to go through three phases:
 Establish a circuit
 Transfer the data
 Disconnect the circuit

Circuit switching today can use either of two technologies:


1. Space division switches
2. Time division switches
1. SPACE DIVISION SWITCHES
In space division switches, the paths in the circuit are separated from each other spatially. It is
very useful in analog networks.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC Page |6


Crossbar switches:
A crossbar switch connects n inputs to m outputs in a grid, using electronic micro switches at
each cross point. The major limitation is number of cross points required. To connect n inputs
to m outputs it needs n * m cross points.

Multistage switches:
It combines crossbar switches in several stages. The design of multistage switches are
depends on the number of stages and the number of switches required in each stage.
Normally the middle stage has fewer switches than the first and last stages. They provide
several options for connecting each pair of linked devices is known as multipath.
2. TIME DIVISION SWITCHES
Time division switches uses time division multiplexing to achieve switching. There are two
methods are,
1. Time slot interchange
2. TDM buds
Time slot interchange:
A time slot interchange is used to order the slots based on the desired connections. It consists
of random access memory with several memory locations. The RAM fills up the incoming
data from time slots in the order received. Slots are then sent out in an order based on the
decisions of a control unit.
Public Switched Telephone Network:
An example of a circuit switched network is the public switched telephone network. The
Switching centers are organized as five classes are,
 Regional office
 Sectional office
 Primary office
 Toll office
 End office

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC Page |7


DISADVANTAGES:
1. Circuit switching is less suited to data and other non voice communications.
2. Less data rate
3. Inflexible
4. No priorities allowed.
3. PACKET SWITCHING
In packet switched network, data are transmitted in discrete units of potentially variable
length blocks called packets. The maximum length of the packet is established by the
network. Longer transmission is broken up in to multiple packets.
There are two popular methods are,
1. Datagram approach
2. Virtual circuit approach
DATAGRAM APPROACH:
 In the datagram approach to packet switching, each packet is treated independently
from all there. Even when one packet represents just a piece of a multipacket
transmission, the networks treats it as though it existed alone. Packets in this
technology are referred to datagram.
 The datagram approach can be used to deliver four packets from station A to station
X. In this example, all four packets belong to same message but may go by different
paths to reach their destination.
 This approach can cause the datagram of a transmission to arrive at their destination
out of order .It is responsibility of transport layer in most protocols to reorder the data
grams before passing them on to the destination port.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC Page |8


 The link joining each pair of nodes can contain multiple channels. Each of these
channels is capable, in turn, of carrying data grams either from several different
sources or from one source. Multiplexing can be done using TDM or FDM.
 Devices A and B are sending data grams to devices X and Y. Some paths use one
channel while other uses more than one. As you can see, the bottom link is carrying
two packets from different sources in the same direction. The link on the right,
however, is carrying data grams in two directions.

VIRTUAL CIRCIUT APPROACH:


In the virtual circuit approach to packet switching, the relationship between all packets
belonging to a message or session is preserved. A single route is chosen between sender and
receiver at the beginning of the session. When the data are sent, all packets of the
transmission travel one after another along that route. Today, virtual circuit transmission is
implemented in two formats: switched virtual circuit (SVC) & permanent virtual circuit
(PVC).
SVC:
The switched virtual circuit (SVC) format is comparable conceptually to dial-up lines in
circuit switching. In this method, a virtual circuit is created whenever it is needed and exists
only for the duration of the specific exchange.
PVC:
Permanent virtual circuits (PVC) are comparable to leased lines in circuit switching. In this
method, the same virtual circuit is provided between two users on a continuous basis. The
circuit is dedicated to the specific users. No one else can use it &, because it is always in
place, it can be used without connection establishment & connection termination. Whereas
two SVC users may get a different route every time they request a connection, two PVC users
always get the same route.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC Page |9


Circuit Switched Connection Vs Virtual circuit Connection:
Although it seems that a circuit-switched connection & a virtual-circuit connection are the
same, there are differences:
Paths versus route:
A circuit-switched connection creates a path between points. The physical path is created by
setting the switches for the duration of the dial(dial-up line) or the duration of the lease(lease
line).A virtual circuit connection creates a route between two points. This means each switch
creates an entry in its routing table for the duration of the session (SVC) or duration of the
lease (PVC).
Dedicated versus sharing:
In a circuit-switched connection, the links that make a path are dedicated; they cannot be used
by other connections. In a virtual circuit connection, the links that make a route can be shared
by other connections.

Message Switching
This technique was somewhere in middle of circuit switching and packet switching. In
message switching, the whole message is treated as a data unit and is switching / transferred
in its entirety.

Switch working on message switching, first receives the whole message and buffers it until
there are resources available to transfer it to the next hop. If the next hop is not having
enough resource to accommodate large size message, the message is stored and switch waits.
This technique was considered substitute to circuit switching. As in circuit switching the
whole path is blocked for two entities only. Message switching is replaced by packet
switching.
Message switching has the following drawbacks:
Every switch in transit path needs enough storage to accommodate entire message. Because
of store-and-forward technique and waits included until resources are available, message
switching is very slow. Message switching was not a solution for streaming media and real-
time applications.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 10


CATEGORIES OF NETWORKS
1. Local Area Network
2. Metropolitan Area Network
3. Metropolitan Area Network
Personal Area Network
A Personal Area Network (PAN) is smallest network which is very personal to a user. This
may include Bluetooth enabled devices or infra-red enabled devices. PAN has connectivity
range up to 10 meters. PAN may include wireless computer keyboard and mouse, Bluetooth
enabled headphones, wireless printers and TV remotes.
For example, Piconet is Bluetooth-enabled Personal Area Network which may contain up to 8
devices connected together in a master-slave fashion.

1. Local Area Network


A computer network spanned inside a building and operated under single administrative
system is generally termed as Local Area Network (LAN). Usually, LAN covers an
organization’ offices, schools, colleges or universities. LAN provides a useful way of sharing
the resources between end users. The resources such as printers, file servers, scanners, and
internet are easily sharable among computers.

LANs are composed of inexpensive networking and routing equipment. It may contain local
servers serving file storage and other locally shared applications. It mostly operates on private
IP addresses and does not involve heavy routing. LAN works under its own local domain and
controlled centrally. LAN uses either Ethernet or Token-ring technology Ethernet is most

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 11


widely employed LAN technology and uses Star topology, while Token ring is rarely
seen.LAN can be wired, wireless, or in both forms at once.

2. Metropolitan Area Network


The Metropolitan Area Network (MAN) generally expands throughout a city such as cable
TV network. Metro Ethernet is a service which is provided by ISPs. This service enables its
users to expand their Local Area Networks. For example, MAN can help an organization to
connect all of its offices in a city.

Backbone of MAN is high-capacity and high-speed fiber optics. MAN works in between
Local Area Network and Wide Area Network. MAN provides uplink for LANs to WANs or
internet.
3. Wide Area Network
As the name suggests, the Wide Area Network (WAN) covers a wide area which may span
across provinces and even a whole country. Generally, telecommunication networks are Wide
Area Network. These networks provide connectivity to MANs and LANs. Since they are
equipped with very high speed backbone, WANs use very expensive network equipment.

WAN may use advanced technologies such as Asynchronous Transfer Mode (ATM), Frame
Relay, and Synchronous Optical Network (SONET). WAN may be managed by multiple
administrations.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 12


TYPE OF CONNECTION:
There are two types are,
1. Point to point
2. Multi point
1. Point To Point:
It provides a dedicated link between two devices of the channel. The entire capacity of the
channel is reserved for transmission between those two devices.
2. Multipoint:
More than two devices can share a link by using this type of connection. It also called as
multidrop. The capacity channel is shared either temporary or spatially. It simultaneously use,
it is spatially shared. If it takes turns, it is time shared line configuration.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 13


Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 14
1.3 TOPOLOGIES

Topology refers to the way a network is laid out either physically or logically. Two or
more devices connect to a link two or more links form a topology. It is the geographical
representation of the relationship of all the links and linking devices to each other.
1. Bus
2. Star
3. Ring
4. Mesh
5. Tree
6. Hybrid Topology
1. Bus Topology
In case of Bus topology, all devices share single communication line or cable. Bus topology
may have problem while multiple hosts sending data at the same time. Therefore, Bus
topology either uses CSMA/CD technology or recognizes one host as Bus Master to solve the
issue. It is one of the simple forms of networking where a failure of a device does not affect
the other devices. But failure of the shared communication line can make all other devices
stop functioning.

Both ends of the shared channel have line terminator. The data is sent in only one direction
and as soon as it reaches the extreme end, the terminator removes the data from the line.
Advantages: Disadvantages:
1. Ease of installation. 1. Difficult reconfiguration and fault
isolation.
2. Less cabling.
2. Difficult to add new devices.
3. Signal reflection at top can degradation
in quality
4. If any fault in backbone can stops all
transmission.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 15


2. Star Topology

All hosts in Star topology are connected to a central device, known as hub device, using a
point-to-point connection. That is, there exists a point to point connection between hosts and
hub. The hub device can be any of the following:
Layer-1 device such as hub or repeater
Layer-2 device such as switch or bridge
Layer-3 device such as router or gateway

As in Bus topology, hub acts as single point of failure. If hub fails,


connectivity of all hosts to all other hosts fails. Every communication between hosts, takes
place through only the hub. Star topology is not expensive as to connect one more host, only
one cable is required and configuration is simple.
Advantages:
1. Less expensive then mesh since each device is connected only to the hub.
2. Installation and configuration are easy.
3. Less cabling is need then mesh.
4. Robustness.
5. Easy to fault identification & isolation.

Disadvantages:
1. Even it requires less cabling then mesh when compared with other topologies it still large.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 16


3. Ring Topology

In ring topology, each host machine connects to exactly two other machines, creating a
circular network structure. When one host tries to communicate or send message to a host
which is not adjacent to it, the data travels through all intermediate hosts. To connect one
more host in the existing structure, the administrator may need only one more extra cable.
Failure of any host results in failure of the whole ring. Thus, every connection in the ring is a
point of failure. There are methods which employ one more backup ring.

Advantages:
1. Easy to install.
2. Easy to reconfigure.
3. Fault identification is easy.
Disadvantages:
1. Unidirectional traffic.
2. Break in a single ring can break entire network.

4. Mesh Topology

In this type of topology, a host is connected to one or multiple hosts. This topology has hosts
in point-to-point connection with every other host or may also have hosts which are in point-
to-point connection to few hosts only.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 17


Hosts in Mesh topology also work as relay for other hosts which do not have direct point-to
point links. Mesh technology comes into two types:
Full Mesh: All hosts have a point-to-point connection to every other host in the network.
Thus for every new host n(n-1)/2 connections are required. It provides the most reliable
network structure among all network topologies.
Partially Mesh: Not all hosts have point-to-point connection to every other host. Hosts
connect to each other in some arbitrarily fashion. This topology exists where we need to
provide reliability to some hosts out of all.
Advantages: Disadvantages:
1. They use dedicated links so each link 1. The amount of cabling and the number
can only carry its own data load. So traffic IO ports required are very large. Since
problem can be avoided. every device is connected to each other
2. It is robust. If anyone link get damaged devices through dedicated links.
it cannot affect others 2. The sheer bulk of wiring is larger than
3. It gives privacy and security the available space
4. Fault identification and fault isolation 3. Hardware required to connect each
are easy. device is highly expensive.

Example:
A mesh network has 8 devices. Calculate total number of cable links and IO ports needed.
Solution:
Number of devices = 8
Number of links = n (n-1)/2
= 8(8-1)/2
= 28
Number of port/device = n-1
= 8-1 = 7
5. Tree Topology
Also known as Hierarchical Topology, this is the most common form of network topology in
use presently. This topology imitates as extended Star topology and inherits properties of bus
topology. This topology divides the network in to multiple levels/layers of network. Mainly
in LANs, a network is bifurcated into three types of network devices. The lowermost is
access-layer where computers are attached. The middle layer is known as distribution layer,
which works as mediator between upper layer and lower layer. The highest layer is known as
core layer, and is central point of the network, i.e. root of the tree from which all nodes fork.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 18


All neighbouring hosts have point-to-point connection between them. Similar to the Bus
topology, if the root goes down, then the entire network suffers even though it is not the
single point of failure. Every connection serves as point of failure, failing of which divides
the network into unreachable segment.
Advantages:
1. Can connect more than star.
2. The distance can be increased.
3. Can isolate and prioritize communication between different computers.

6. Hybrid Topology

A network structure whose design contains more than one topology is said to be hybrid
topology. Hybrid topology inherits merits and demerits of all the incorporating topologies.
The above picture represents an arbitrarily hybrid topology. The combining topologies may
contain attributes of Star, Ring, Bus, and Daisy-chain topologies. Most WANs are connected
by means of Dual-Ring topology and networks connected to them are mostly Star topology
networks. Internet is the best example of largest Hybrid topology.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 19


Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 20
TRANSMISSION MEDIA
The media, over which the information between two computer systems is sent, called
transmission media. Transmission media comes in two forms.
1.Guided Media
All communication wires/cables are guided media, such as UTP, coaxial cables, and fibre
Optics. In this media, the sender and receiver are directly connected and the information is
send (guided) through it. Ex. Twisted pair, Coaxial Cable, Fibre Optics
2.Unguided Media
Wireless or open air space is said to be unguided media, because there is no connectivity
between the sender and receiver. Information is spread over the air, and anyone including the
actual recipient may collect the information. Ex. Satellite Communication
1.Guided Media
1.1Twisted Pair Cable
A twisted pair cable is made of two plastic insulated copper wires twisted together to form a
single media. Out of these two wires, only one carries actual signal and another is used for
ground reference. The twists between wires are helpful in reducing noise (electromagnetic
interference) and crosstalk.

There are two types of twisted pair cables:


Shielded Twisted Pair (STP) Cable
Unshielded Twisted Pair (UTP) Cable
STP cables comes with twisted wire pair covered in metal foil. This makes it more indifferent
to noise and crosstalk.
UTP has seven categories, each suitable for specific use. In computer networks, Cat-5, Cat-
5e, and Cat-6 cables are mostly used. UTP cables are connected by RJ45 connectors. Coaxial
Cable Coaxial cable has two wires of copper. The core wire lies in the centre and it is made
of solid conductor. The core is enclosed in an insulating sheath. The second wire is wrapped

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 21


around over the sheath and that too in turn encased by insulator sheath. This all is covered by
plastic cover.

Because of its structure, the coax cable is capable of carrying high frequency signals than that
of twisted pair cable. The wrapped structure provides it a good shield against noise and cross
talk.
1.2 Coaxial cables
provide high bandwidth rates of up to 450 mbps.
There are three categories of coax cables namely,
RG-59 (Cable TV), RG-58 (Thin Ethernet), and RG-11 (Thick Ethernet).
RG stands for Radio Government.
Cables are connected using BNC connector and BNC-T. BNC terminator is used to terminate
the wire at the far ends.
Power Lines
Power Line communication (PLC) is Layer-1 (Physical Layer) technology which uses power
cables to transmit data signals. In PLC, modulated data is sent over the cables. The receiver
on the other end de-modulates and interprets the data. Because power lines are widely
deployed, PLC can make all powered devices controlled and monitored. PLC works in half-
duplex.
There are two types of PLC:
 Narrow band PLC
 Broad band PLC
Narrow band PLC provides lower data rates up to 100s of kbps, as they work at lower
frequencies (3-5000 kHz).They can be spread over several kilometres.
Broadband PLC provides higher data rates up to 100s of Mbps and works at higher
frequencies (1.8 – 250 MHz).They cannot be as much extended as Narrowband PLC.

1.3 Fiber Optics


Fiber Optic works on the properties of light. When light ray hits at critical angle it tends to
refracts at 90 degree. This property has been used in fiber optic. The core of fiber optic cable
is made of high quality glass or plastic. From one end of it light is emitted, it travels through
it and at the other end light detector detects light stream and converts it to electric data. Fiber
Optic provides the highest mode of speed. It comes in two modes, one is single mode fiber

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 22


and second is multimode fiber. Single mode fiber can carry a single ray of light whereas mul
timode is capable of carrying multiple beams of light.
Fiber Optic also comes in unidirectional and bidirectional capabilities. To connect and access
fiber optic special type of connectors are used. These can be Subscriber Channel (SC),
Straight Tip (ST), or MT-RJ.

2.Unguided (Wireless Transmission)


Wireless transmission is a form of unguided media. Wireless communication involves no
physical link established between two or more devices, communicating wirelessly. Wireless
signals are spread over in the air and are received and interpreted by appropriate antennas.
When an antenna is attached to electrical circuit of a computer or wireless device, it converts
the digital data into wireless signals and spread all over within its frequency range. The
receptor on the other end receives these signals and converts them back to digital data. A
little part of electromagnetic spectrum can be used for wireless transmission.

Radio frequency is easier to generate and because of its large wavelength it can penetrate
through walls and structures alike. Radio waves can have wavelength from 1 mm – 100,000
km and have frequency ranging from 3 Hz (Extremely Low Frequency) to 300 GHz
(Extremely High Frequency). Radio frequencies are sub-divided into six bands. Radio waves
at lower frequencies can travel through walls whereas higher RF can travel in straight line
and bounce back. The power of low frequency waves decreases sharply as they cover long
distance. High frequency radio waves have more power. Lower frequencies such as VLF, LF,
MF bands can travel on the ground up to 1000 kilometers, over the earth’s surface.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 23


Radio waves of high frequencies are prone to be absorbed by rain and other obstacles. They
use Ionosphere of earth atmosphere. High frequency radio waves such as HF and VHF
bands are spread upwards. When they reach Ionosphere, they are refracted back to the earth.

2.1 Microwave Transmission


Electromagnetic waves above 100 MHz tend to travel in a straight line and signals over them
can be sent by beaming those waves towards one particular station. Because Microwaves
travels in straight lines, both sender and receiver must be aligned to be strictlyin line-of-sight.
Microwaves can have wavelength ranging from 1 mm – 1 meter and frequency ranging from
300 MHz to 300 GHz. Microwave antennas concentrate the waves making a beam of it. As
shown in picture above, multiple antennas can be aligned to reach farther. Microwaves have
higher frequencies and do not penetrate wall like obstacles. Microwave transmission depends
highly upon the weather conditions and the frequency it is using.
2.2 Infrared Transmission
Infrared wave lies in between visible light spectrum and microwaves. It has wavelength of
700-nm to 1-mm and frequency ranges from 300-GHz to 430-THz. Infrared wave is used for
very short range communication purposes such as television and it’s remote. Infrared travels
in a straight line hence it is directional by nature. Because of high frequency range, Infrared
cannot cross wall-like obstacles.
Light Transmission
Highest most electromagnetic spectrum which can be used for data transmission is light or
optical signaling. This is achieved by means of LASER. Because of frequency light uses, it
tends to travel strictly in straight line.Hence the sender and receiver must be in the line-of-
sight. Because laser transmission is unidirectional, at both ends of communication the laser
and the photo-detector needs to be installed. Laser beam is generally 1mm wide hence it is a
work of precision to align two far receptors each pointing to lasers source.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 24


Lasers cannot penetrate obstacles such as walls, rain, and thick fog. Additionally, laser beam
is distorted by wind, atmosphere temperature, or variation in temperature in the path. Laser is
safe for data transmission as it is very difficult to tap 1mm wide laser without interrupting the
communication channel.
Multiplexing
Multiplexing is a technique to mix and send multiple data streams over a single medium. This
technique requires system hardware called multiplexer (MUX) for multiplexing the streams
and sending them on a medium, and de-multiplexer (DMUX) which takes information from
the medium and distributes to different destinations.

Laser works as Tx (transmitter) and photo-detectors works as Rx (receiver).

ENCODING METHODS
1. Digital-to-Digital Conversion
2. Analog to digital conversion
3. Digital-to-Analog Conversion
Digital-to-Digital Conversion
This section explains how to convert digital data into digital signals. It can be done in two
ways, line coding and block coding. For all communications, line coding is necessary
whereas block coding is optional.
Line Coding The process for converting digital data into digital signal is said to be Line
Coding. Digital data is found in binary format. It is represented ( stored) internally as series
of 1s and 0s.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 25


Digital signal is denoted by discreet signal, which represents digital data. There are
three types of line coding schemes available:

Uni-polar Encoding
Unipolar encoding schemes use single voltage level to represent data. In this case, to
represent binary 1, high voltage is transmitted and to represent 0, no voltage is transmitted. It
is also called Unipolar-Non-return-to-zero, because there is no rest condition i.e. it either
represents 1 or 0.
Polar Encoding
Polar encoding scheme uses multiple voltage levels to represent binary values. Polar
encodings is available in four types:
Polar Non-Return to Zero (Polar NRZ)
It uses two different voltage levels to represent binary values. Generally, positive voltage
represents 1 and negative value represents 0. It is also NRZ because there is no rest condition.
NRZ scheme has two variants: NRZ-L and NRZ-I.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 26


NRZ-L changes voltage level at when a different bit is encountered whereas NRZ-I changes
voltage when a 1 is encountered.
Return to Zero (RZ)
Problem with NRZ is that the receiver cannot conclude when a bit ended and when the next
bit is started, in case when sender and receiver’s clock are not synchronized.

RZ uses three voltage levels, positive voltage to represent 1, negative voltage


to represent 0 and zero voltage for none. Signals change during bits not between bits.
Manchester
This encoding scheme is a combination of RZ and NRZ-L. Bit time is divided into two
halves. It transits in the middle of the bit and changes phase when a different bit is
encountered.
Differential Manchester
This encoding scheme is a combination of RZ and NRZ-I. It also transit at the middle of the
bit but changes phase only when 1 is encountered.
Bipolar Encoding
Bipolar encoding uses three voltage levels, positive, negative and zero. Zero voltage
represents binary 0 and bit 1 is represented by altering positive and negative voltages.

Block Coding

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 27


To ensure accuracy of the received data frame redundant bits are used. For example, in even-
parity, one parity bit is added to make the count of 1s in the frame even. This way the original
number of bits is increased. It is called Block Coding. Block coding is represented by slash
notation, mB/nB.Means, m-bit block is substituted with n-bit block where n > m. Block
coding involves three steps:
 Division,
 Substitution
 Combination
After block coding is done, it is line coded for transmission.

Analog-to-Digital Conversion
Microphones create analog voice and camera creates analog videos, which are treated is
analog data. To transmit this analog data over digital signals, we need analog to digital
conversion. Analog data is a continuous stream of data in the wave form whereas digital data
is discrete. To convert analog wave into digital data, we use Pulse Code Modulation
(PCM).PCM is one of the most commonly used methods to convert analog data into digital
form. It involves three steps:
 Sampling
 Quantization
 Encoding.
 Sampling

The analog signal is sampled every T interval. Most important factor in sampling is the rate at
which analog signal is sampled. According to Nyquist Theorem, the sampling rate must be at least
two times of the highest frequency of the signal.
Quantization

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 28


Sampling yields discrete form of continuous analog signal. Every discrete pattern shows the
amplitude of the analog signal at that instance. The quantization is done between the maximum
amplitude value and the minimum amplitude value. Quantization is approximation of the
instantaneous analog value.

In encoding, each approximated value is then converted into binary format.


Digital-to-Analog Conversion
When data from one computer is sent to another via some analog carrier, it is first convertedinto
analog signals. Analog signals are modified to reflect digital data. An analog signal is characterized
by its amplitude, frequency, and phase. There are three kinds of digital-toanalog conversions:
Amplitude Shift Keying
In this conversion technique, the amplitude of analog carrier signal is modified to reflect binary data.

When binary data represents digit 1, the amplitude is held; otherwise it is set to 0. Both frequency and
phase remain same as in the original carrier signal.
Frequency Shift Keying

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 29


In this conversion technique, the frequency of the analog carrier signal is modified to reflect binary
data.

This technique uses two frequencies, f1 and f2. One of them, for example f1, is chosen to represent
binary digit 1 and the other one is used to represent binary digit 0. Both amplitude and phase of the
carrier wave are kept intact.
Phase Shift Keying
In this conversion scheme, the phase of the original carrier signal is altered to reflect the binary data.
When a new binary symbol is encountered, the phase of the signal is altered.
Amplitude and frequency of the original carrier signal is kept intact.
Quadrature Phase Shift Keying
QPSK alters the phase to reflect two binary digits at once. This is done in two different phases. The
main stream of binary data is divided equally into two sub-streams. The serial
data is converted in to parallel in both sub-streams and then each stream is converted to digital signal
using NRZ technique. Later, both the digital signals are merged together.
Analog-to-Analog Conversion
Analog signals are modified to represent analog data. This conversion is also known as Analog
Modulation. Analog modulation is required when bandpass is used. Analog to analog conversion can
be done in three ways:

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 30


Amplitude Modulation
In this modulation, the amplitude of the carrier si gnal is modified to reflect the analog data.

Amplitude modulation is implemented by means of a multiplier. The amplitude of modulating signal


(analog data) is multiplied by the amplitude of carrier frequency, which then reflects analog data.The
frequency and phase of carrier signal remain unchanged.
Frequency Modulation
In this modulation technique, the frequency of the carrier signal is modified to reflect the change in
the voltage levels of the modulating signal (analog data).

The amplitude and phase of the carrier signal are not altered.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 31


Phase Modulation
In the modulation technique, the phase of carrier signal is modulated in order to reflect the change in
voltage (amplitude) of analog data signal.

Phase modulation is practically similar to Frequency Modulation, but in Phase modulation frequency
of the carrier signal is not increased. Frequency of carrier is signal is changed (made dense and
sparse) to reflect voltage change in the amplitude of modulating signal.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 32


1.4 LAYERING AND PROTOCOL

To reduce the complexity of getting all the functions maintained by one a new technique
called layering technology was introduced. In this, the architecture contains several layers and each
layer is responsible for certain functions. The general idea is that the services offered by underlying
hardware, and then add a sequence of layers, each providing a higher level of service. The services
provided at the higher layers are implemented in terms of the services provided by the lower layers. A
simple network has two layers of abstraction sandwiched between the application program and the
underlying hardware.
ISO / OSI MODEL:
Open System Interconnect is an open standard for all communication systems. OSI model
is established by International Standard Organization (ISO). This model has seven layers:

ISO refers International Standards Organization was established in 1947, it is a multinational body
dedicated to worldwide agreement on international standards.
OSI refers to Open System Interconnection that covers all aspects of network communication. It is a
standard of ISO.
Here open system is a model that allows any two different systems to communicate regardless of their
underlying architecture. Mainly, it is not a protocol it is just a model.
OSI MODEL
The open system interconnection model is a layered framework. It has seven separate but interrelated
layers. Each layer having unique responsibilities.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 33


The figure shown below shows the layers involved when a message sent from A to B pass through
some intermediate devices.
 Both the devices A and B are formed by the framed architecture. And the intermediate nodes
only having the layers are physical, Data link and network. In every device each layer gets the
services from the layer just below to it. When the device is connected to some other device
the layer of one device communicates with the corresponding layer of another device. This is
known as peer to peer process.
 Each layer in the sender adds its own information to the message. This information is known
is header and trailers. When the information added at the beginning of the data is known as
header. Whereas added at the end then it called as trailer. Headers added at layers 2, 3, 4, 5, 6.
Trailer added at layer 2.
 Each layer is connected with the next layer by using interfaces. Each interface defines what
information and services a layer must provide for the layer above it.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 34


FUNCTIONS OF THE LAYERS
PHYSICAL LAYER

It coordinates the functions required to carry a bit stream over a physical medium. Encoding to be
transmitted, bits must be encoded into signals, electrical or optical. Data rate it defines the
transmission rate (number of bits sent per second).
Physical topology It defines how devices are connected (mesh, star, ring, bus or hybrid) Transmission
mode Defines the direction of transmission between two devices: simplex, half-duplex, or full-duplex
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 the interface and the transmission
medium.
The functions are,
1. Physical Characteristics of Interfaces and Media:
2. Representation of Bits
3. Data Rate
4. Synchronization of Bits
5. Line Configuration
6. Physical Topology
7. Transmission Mode

DATALINK LAYER

Datalink layer responsible for node-to-node delivery.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 35


The data link layer transforms a raw transmission facility to a reliable link.
Framing: The bit stream is divided into manageable data units called frames.
Physical addressing: Header contains physical address of sender and receiver
Flow control: If receiving rate is less than the transmission rate, flow control mechanism avoids
sender overwhelming the receiver.
Error control: Redundant information is put as tailor to detect and retransmit damaged/lost frames
and to recognize duplicate frames.
Access control: When two or more devices are connected to the same link, link layer protocols
determines which device has control over the link at any given time.

Network Layer
When the sender is in one network and the receiver is in some other network then the
network layer has the responsibility for the source to destination delivery.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 36


It is responsible for source-to-destination delivery of a data unit called packet. Logical
addressing: A packet is identified across the network using logical addressing system
provided by network layer and is used to identify the end systems. Routing: Routers prepare
routing table to send packets to their destination.

Transport Layer

Transport layer is responsible for process-to-process delivery of the entire message.

Port addressing: It includes a service-point or port address so that a process from one computer
communicates to a specific process on the other computer.
Segmentation and reassembly: A message is divided into transmittable segments, each containing a
sequence number. These numbers enable the transport layer to reassemble the message correctly at the
destination and to identify which were lost / corrupted.
Connection control: Protocols can be either connectionless or connection-oriented.
Session Layer
It establishes, maintains, and synchronizes interaction among communicating systems.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 37


Presentation Layer
It is concerned with syntax and semantics of the information exchanged between peers.

The responsibilities are,


1. Translation
2. Encryption
3. Compression
Translation: Because different computers use different encoding systems, the presentation layer is
responsible for interoperability between these encoding methods.
Encryption: To carry sensitive information, a system ensures privacy by encrypting the message
before sending and decrypting at the receiver end.
Compression: Data compression reduces the number of bits contained in the information. It is
particularly important in multimedia transmission.
APPLICATION LAYER
The application layer enables the user to access the network. It provides interfaces between the users
to the network.

The responsibilities are,


1. Network Virtual Terminal
2. File Transfer, Access, and Management
3. Mail Services
4. Directory Services

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 38


Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 39
1.5 TCP/IP INTERNET ARCHITECTURE

Internet uses TCP/IP protocol suite, also known as Internet suite. This defines Internet
Model which contains four layered architecture. OSI Model is general communication model
but Internet Model is what the internet uses for all its communication. The internet is
independent of its underlying network architecture so is its Model.
This model has the following layers:
Application Layer: This layer defines the protocol which enables user to interact with the
network. For example, FTP, HTTP etc.
Transport Layer: This layer defines how data should flow between hosts. Major protocol at
this layer is Transmission Control Protocol (TCP). This layer ensures data delivered between
hosts is in-order and is responsible for end-to-end delivery.
Internet Layer: Internet Protocol (IP) works on this layer. This layer facilitates host
addressing and recognition. This layer defines routing.
Link Layer: This layer provides mechanism of sending and receiving actual data. Unlike its
OSI Model counterpart, this layer is independent of underlying network architecture and
hardware.T he internet architecture evolved out of experiences with an earlier packet
switched network called the ARPANET. Both the Internet and the ARPANET were funded
by the Advanced Research Projects Agency (ARPA).
The Internet and ARPANET were around before the OSI architecture, and the experience
gained from building them was a major influence on the OSI reference model. Instead of
having seven layers, a four layer model is often used in Internet.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 40


Internet uses TCP/IP protocol suite, also known as Internet suite. This defines Internet Model
which contains four layered architecture.
OSI Model is general communication model but Internet Model is what the internet uses for
all its communication. The internet is independent of its underlying network architecture so is
its Model. This model has the following layers:

At the lowest level are a wide variety of network protocols, denoted NET1, NET2 and so on.
The second layer consists of a single protocol the Internet Protocol IP. It supports the
interconnection of multiple networking technologies into a single, logical internetwork. The
third layer contains two main protocols the Transmission Control Protocol (TCP) and User
Datagram Protocol (UDP).
TCP provides a reliable byte stream channel, and UDP provides unreliable datagram delivery
channel. They are called as end to end protocol they can also be referred as transport
protocols. Running above the transport layer, a range of application protocols such as FTP,
TFTP, Telnet, and SMTP that enable the interoperation of popular applications.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 41


NETWORK SOFTWARE

How to implement network software is an essential part of understanding computer networks. In


many respects, network applications and network protocols are very similar—the way an application
engages the services of the network is pretty much the same as the way a high level protocol invokes
the services of a low-level protocol.
Application Programming Interface (Sockets)
Most network protocols are implemented in software (especially those high in the protocol stack), and
nearly all computer systems implement their network protocols as part of the operating system, when
we refer to the interface ―exported by the network,‖ we are generally
referring to the interface that the OS provides to its networking subsystem. This interface is often
called the network application programming interface (API). The advantage of industry-wide support
for a single API is that applications can be easilyported from one OS to another, and that developers
can easily write applications for multiple OSs. Just because two systems support the same network
API does not mean that their file system, process, or graphic interfaces are the same. Still,
understanding a widely adopted API like UNIX sockets gives us a good place to start. Each protocol
provides a certain set of services, and the API provides a syntax by which those services can be
invoked in this particular OS.
int socket(int domain, int type, int protocol)
int bind(int socket, struct sockaddr *address, int addr_len)
int listen(int socket, int backlog)
int accept(int socket, struct sockaddr *address, int *addr_len)
int connect(int socket, struct sockaddr *address, intaddr_len)
int send(int socket, char *message, int msg_len, int flags)
int recv(int socket, char *buffer, int buf_len, int flags)
The implementation of a simple client/server program that uses the socket interface to send
messages over a TCP connection is discussed. The program also uses other Unix networking
utilities, Our application allows a user on one machine to type in and send text to a user on
another machine. It is a simplified version of the Unix talk program, which is similar to the
program at the core of a web chat room. Client program :
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#define SERVER_PORT 5432
#define MAX_LINE 256

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 42


int
main(int argc, char * argv[])
{
FILE *fp;
struct hostent *hp;
struct sockaddr_in sin;
char *host;
char buf[MAX_LINE];
int s;
int len;
if (argc==2) {
host = argv[1];
}
else {
fprintf(stderr, "usage: simplex-talk host\n");
exit(1);
}
/* translate host name into peer’s IP address */
hp = gethostbyname(host);
if (!hp) {
fprintf(stderr, "simplex-talk: unknown host: %s\n", host);
exit(1);
}
/* build address data structure */
bzero((char *)&sin, sizeof(sin));

sin.sin_family = AF_INET;
bcopy(hp->h_addr, (char *)&sin.sin_addr, hp->h_length);
sin.sin_port = htons(SERVER_PORT);
/* active open */

if ((s = socket(PF_INET, SOCK_STREAM, 0)) < 0)


{perror("simplex-talk: socket"); exit(1);
}
if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
perror("simplex-talk: connect"); close(s);
exit(1);
}

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 43


/* main loop: get and send lines of text */
while (fgets(buf, sizeof(buf), stdin)) {
buf[MAX_LINE-1] = ’\0’;
len = strlen(buf) + 1;
send(s, buf, len, 0);
}
}
Server Program :
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#define SERVER_PORT 5432
#define MAX_PENDING 5
#define MAX_LINE 256
int
main()
{
struct sockaddr_in sin;
char buf[MAX_LINE];
int len;
int s, new_s;
/* build address data structure */
bzero((char *)&sin, sizeof(sin));
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = INADDR_ANY;
sin.sin_port = htons(SERVER_PORT);
/* setup passive open */
if ((s = socket(PF_INET, SOCK_STREAM, 0)) < 0) {

}
if ((bind(s, (struct sockaddr *)&sin, sizeof(sin))) < 0) {
perror("simplex-talk: bind"); exit(1);
}
listen(s, MAX_PENDING);
/* wait for connection, then receive and print text */
while(1) {

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 44


if ((new_s = accept(s, (struct sockaddr *)&sin, &len)) < 0) {
perror("simplex-talk: accept"); exit(1);
}
while (len = recv(new_s, buf, sizeof(buf), 0))
fputs(buf, stdout);
close(new_s);
}}

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 45


1.6 FACTORS AFFECT PERFORMANCE OF THE NETWORK

Bandwidth and Latency


Performance of a network is m easured in terms of bandwidth and latency.
Bandwidth refers to number of bits that can be transmitted over the network within a certain period of
time (throughput).Bandwidth also determines how long it takes to transmit each bit.
For example, each bit on a 1-Mbps link is 1μs wide, whereas each bit on a 2-Mbps link is 0.5μs wide.
Latency refers to how long it takes for the message to travel to the other end (delay). It is a factor of
propagation delay, transmission time and queuing delay
Latency = Propagation + Transmit + Queue Speed of light propagation depends on medium
(vacuum/copper cable/optical fiber) in which it travels and distance.
Propagation = Distance / Speed of Light
Transmission time depends upon bandwidth and packet size.
Transmit = Size / Bandwidth
Queuing delay occurs at switches and routers, since packets are stored before forwarded. Round Trip
Time (RTT) is time taken for the message to travel to the other end and get back. For applications that
have minimal data transfer, latency dominates performance, Whereas for bulk data transfers,
bandwidth dominates performance.
Delay × Bandwidth Product

Consider a pipe, in which bandwidth is given by diameter and delay corresponds to length of the pipe.
The delay × bandwidth product specifies the number of bits in transit. It corresponds to how much the
sender should transmit before the first bit is received at the other end. If receiver signals the sender to
stop, it would still receive RTT × bandwidth of data. For example, for a cross-country fiber with 10
Gbps bandwidth, distance of 4000 km, the RTT is 40 ms and RTT × bandwidth is 400 Mb.

High-Speed Networks
The bandwidths available on today’s networks are increasing at a dramatic rate, and there is eternal
optimism that network bandwidth will continue to improve. This causes network designers to start
thinkingabout what happens in the limit or, stated another way, what is the impact on network design
of having infinite bandwidth available.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 46


Although high-speed networks bring a dramatic change in the bandwidth available to applications, in
many respects their impact on how we think about networking comes in what does not change as
bandwidth increases: the speed of light. To quote Scotty from Star Trek, ―Ye cannae change the laws
of physics.‖4 In other words, ―high speed‖ does not mean that latency improves at the same rate as
bandwidth; the transcontinental
RTT of a 1-Gbps link is the same 100 ms as it is for a 1-Mbps link.
To appreciate the significance of ever-increasing bandwidth in the face of fixed latency, consider what
is required to transmit a 1-MB file over a 1-Mbps network versus over a 1-Gbps network, both of
which have an RTT of 100 ms. In the case of the 1-Mbps network, it takes 80 round-trip times to
transmit the file; during each RTT, 1.25% of the file is sent. In contrast, the same 1-MB file doesn’t
even come close to filling 1 RTT’s worth of the 1-Gbps link, which has a delay bandwidth product of
12.5 MB.
Perhaps the best way to understand the relationship between throughput and latency is to return to
basics. The effective end-to-end throughput that can be achieved over a network is given by the
simple relationship Throughput = TransferSize/TransferTime
where TransferTime includes not only the elements of one-way Latency identified earlier in this
section, but also any additional time spent requesting or setting up the transfer. Generally,we represent
this relationshipas
TransferTime = RTT+1/Bandwidth×TransferSize
We useRTT in this calculation to account for a request message being sent across the network and the
data being sent back. For example, consider a situation where a user wants to fetch a 1-MB file across
a 1-Gbps networkwith a round-trip time of 100 ms. The TransferTime includes both the transmit time
for 1 MB (1/1 Gbps×1 MB = 8 ms) and the 100-ms RTT, for
a total transfer time of 108 ms. This means that the effective throughput will be
1 MB/108 ms = 74.1 Mbps
not 1 Gbps. Clearly, transferring a larger amount of data will help improve the effective throughput,
where in the limit an infinitely large transfer size will cause the effective throughput to approach the
network bandwidth. On the other hand, having to endure more than 1 RTT—for example, to
retransmit missing packets—will hurt the effective throughput for any transfer of finite size and will
be most noticeable for small transfers.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 47


Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 48
1.7 LINK LAYER SERVICES

It has several functions like Data link layer is one of the OSI layers which define the packet format
exchanged between the nodes.
 Framing
 Link access
 Flow control
 Reliable delivery
 Error detection
 Error correction
 Half duplex
 Full duplex
Data link layer design issues:
The data link layer has a number of specific functions it can carry out. These functions include
 Providing a well-defined service interface to the network layer
 Dealing with transmission errors.
 Regulating the flow of data. So, that slow receivers are not swamped by fast senders.

To achieve these goals, the data link layer takes the packets it gets from the network layer and
encapsulates them into frames for transmission.
Each frame contains a frame header, a payload field for holding the packet and a frame trailer.The
relationship betwe en packets and frames is represented below:

The function of the data link layer is to provide services to the network Layer. The principal
service is transferring data from the network layer on the source machine to network layer on
the destination machine. On the source machine is an entity, call it a process in the network
layer for transmission to the destination. The job of data link layer is to transmit the bits to
the destination machine. So, they can be handed over to the network layer.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 49


The function of the data link layer is to provide services to the network Layer.The principal service is
transferring data from the network layer on the source machine to network layer on the destination
machine. On the source machine is an entity, call it a process in the network layer for transmission to
the destination. The job of data link layer is to transmit the bits to the destination machine. So, they
can be handed over to the network layer.

The data link layer can be designed to offer various services. The actual services offered can vary
from system to system.
The possibilities that are commonly provide are
1. Unacknowledged connectionless service.
2. Acknowledged connectionless service.
3. Acknowledged connection oriented service.
1. Unacknowledged connectionless service:
It consists of having the source machine send independent frames to the destination machine without
having the destination machine acknowledge them. No logical connection is established beforehand or
released afterward. If a frame is lost due to noise on the line, no attempt is made to detect the loss
recover from it in the data link layer. Most LANs use unacknowledged connectionless service in the
data link layer.
2. Acknowledged connectionless service:
When this service is offered, there are still no logical connections used. But each frame sent is
individually acknowledged. In this way, the sender knows whether a frame has arrived correctly. If it
has not arrived within a specified time interval, it can be sent again. This service is useful over
unreliable channels like wireless systems.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 50


3. Acknowledged connection oriented service:

The most sophisticated service the data link layer can provide to the network layer connection
oriented service. With this service, the source and destination machines establish a connection before
any data are transferred. Each frame sent over the connection is numbered and the data link layer
guarantee that each frame sent is indeed received. Also, it assures that each frame is received exactly
once and that all frames are received in the right order.
(b) Framing:
The incoming data unit from network layer is splitted into more number of small data units.
(c) Error control:
It is provided as a function in order to find the error and to resend the lost or damaged data frame.
Also error control is used to overcome the duplication problem.
(d) Flow control:
If the rate at which data are taken by the destination entity is less than sender rate then a flow control
concept is employed to stop the overwhelming or destination entity.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 51


Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 52
1.8 Framing

To transmit frames over the node it is necessary to mention start and end of each frame.
There are three techniques to solve this frame
 Byte-Oriented Protocols (BISYNC, PPP, DDCMP)
 Bit-Oriented Protocols (HDLC)
 Clock-Based Framing (SONET)
1.8.1 Byte Oriented protocols
In this, view each frame as a collection of bytes (characters) rather than a collection of bits. Such a
byte-oriented approach is exemplified by the BISYNC (Binary Synchronous Communication)
protocol and the DDCMP (Digital Data Communication Message Protocol) Sentinel Approach the
BISYNC protocol i illustrates the sentinel approach to framing; its frame format is the beginning of a
frame is denoted by sending a special SYN (synchronization) character.

Fig: BISYNC Frame format

The data portion of the frame is then contained between special sentinel characters: STX (start of text)
and ETX (end of text).
The SOH (start of header) field serves much the same purpose as the STX field.
The frame format also includes a field labeled CRC (cyclic redundancy check) that is used to detect
transmission errors.
The problem with the sentinel approach is that the ETX character might appear in the data portion of
the frame.
BISYNC overcomes this problem by ―escaping‖ the ETX character by preceding it with a DLE (data-
link-escape) character whenever it appears in the body of a frame; the DLE character is also escaped
(by preceding it with an extra DLE) in the frame body. This approach is called character stuffing.
Point-to-Point Protocol (PPP)
The more recent Point-to-Point Protocol (PPP). The format of PPP frame is

Fig: PPP Frame Format

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 53


The Flag field has 01111110 as starting sequence. The Address and Control fields usually contain
default values The Protocol field is used for demultiplexing. The frame payload size can he
negotiated, but it is 1500 bytes by default. The PPP frame format is unusual in that several of the field
sizes are negotiated rather than fixed. Negotiation is conducted by a protocol called LCP (Link
Control Protocol). LCP sends control messages encapsulated in PPP frames—such messages are
denoted by an LCP identifier in the PPP Protocol.

Byte-Counting Approach

The number of bytes contained in a frame can he included as a field in the frame header. DDCMP
protocol is used for this approach. The frame format is COUNT Field specifies how many bytes are
contained in the frame’s body. Sometime count field will be corrupted during transmission, so the
receiver will accumulate as many bytes as the COUNT field indicates. This is sometimes called a
framing error. The receiver will then wait until it sees the next SYN character.

Fig: DDCMP frame format

1.8.2 Bit-Oriented Protocols (HDLC)


In this, frames are viewed as collection of bits. High level data link protocol is used. The format is

Fig: HDLC Frame Format


HDLC denotes both the beginning and the end of a frame with the distinguished bit sequence
01111110. This sequence might appear anywhere in the body of the frame, it can be avoided by bit
stuffing. On the sending side, any time five consecutive 1’s have been transmitted from the body of
the message (i.e., excluding when the sender is trying to transmit the distinguished 01111110
sequence), the sender inserts a 0 before transmitting the next bit. On the receiving side, five
consecutive 1’s arrived, the receiver makes its decision based on the next bit it sees (i.e., the bit
following the five is). If the next bit is a 0, it must have been stuffed, and so the receiver removes it.
If the next bit is a 1, then one of two things is true, either this is the end-of-frame marker or an error
has been introduced into the bit stream.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 54


By looking at the next bit, the receiver can distinguish between these two cases: If it sees a 0 (i.e., the
last eight bits it has looked at are 01111110), then it is the end-of- frame marker.
If it sees a 1 (i.e., the last eight bits it has looked at are 01111111), then there must have been an error
and the whole frame is discarded.

1.8.3 Clock-Based Framing (SONET)

Synchronous Optical Network Standard is used for long distance transmission of data over optical
network.It supports multiplexing of several low speed links into one high speed links.An STS-1 frame
is used in this method.

It is arranged as nine rows of 90 bytes each, and the first 3 bytes of each row are overhead,with the
rest being available for data.The first 2 bytes of the frame contain a special bit pattern, and it is these
bytes that enable the receiver to determine where the frame starts.The receiver looks for the special bit
pattern consistently, once in every 810 bytes, since each frame is 9 x 90 = 810 bytes long

The STS-N frame can he thought of as consisting of N STS-1 frames, where the bytes from these
frames are interleaved; that is, a byte from the first frame is transmitted, then a byte from the second
frame is transmitted, and so on. Payload from these STS-1 frames can he linked together to form a
larger STS-N payload, such a link is denoted STS-Nc. One of the bits in overhead is used for this
purpose.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 55


Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 56
1.9 ERROR DETECTION AND ERROR CORRECTION TECHNIQUE

Data can be corrupted during transmission. For reliable communication, errors must be
detected and corrected.
Types of Errors
1. Single-bit error
2. Burst Error
1.Single-bit error
The term Single-bit error means that only one bit of a given data unit (such as byte, character,
data unit or packet) is changed from 1 to 0 or from 0 to 1.

2. Burst Error
The term Burst Error means that two or more bits in the data unit have changed from 1 to 0 or
from 0 to 1.

Redundancy One method is to send every data twice, so that receiver checks every bit of two copies
and detect error.
Drawbacks
Sends n-redundant bits for n-bit message. Many errors are undetected if both the copies are corrupted.
Instead of adding entire data, some bits are appended to each unit. This is called redundant bit
because the bits added will not give any new information. These bits are called error detecting codes.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 57


The three error detecting techniques are:
1. Parity check
2. Check sum algorithm
3. Cyclic Redundancy Check

1.Parity Check
Simple parity check Only one redundant bit, called parity bit is added to every data unit so that the
total number of 1’s in unit become even (or odd).
Two Dimensional Parity
It is based on simple parity. It performs calculation for each bit position across each byte in the frame.
This adds extra parity byte for entire frame, in addition to a parity bit for each byte.

Fig: Tw o-dimensional parity


For example frame containing 6 bytes of data. In this third bit of the parity byte is 1 since
there are an odd number of 1’s is in the third bit across the 6 bytes in the frame. In this case,
14 bits of redundant information are added with original information.
2. Check sum algorithm

In the sender side all the words are added and then transmit the result of sum called checksum
with the data.

The receiver performs the same calculation on the received data and compares the result with
the received checksum.

If any transmitted data, including the checksum itself, is corrupted, then the results will not
match, so the receiver knows that an error occurred. Instead of sending the checksum as such,
one’s complement of that sum will be send to the receiver. If the receiver gets the result as
zero then it will be the correct one.In this, we can represent unsigned number from 0 to 2 n

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 58


using n bits. If the number has more than n bits, the extra leftmost bits need to be added to the
n rightmost bits. Data can be divided in to 16 bit word and the Checksum is initialized to
zero.

3. Cyclic Redundancy Check


It uses small number of redundant bits to detect errors.
Divisor is calculated by the polynomial functions under two conditions

a. It should not be divisible by x


b. It should be divisible by x+1
Consider the original message as M(x) - n+1 bits
Divisor C(x) – K bits
Original sent message = M(x) + k-1 bits

Steps
Append k-1 zeros with M(x) – P(x)
Divide P(x) by C(x)
Subtract the remainder from T(x)
Subtraction is made by making XOR operation
Eg: 100100 by 1101

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 59


Error

ERROR CORRECTION
Error Correction can be handled in two ways
1. When an error is discovered, the receiver can have the sender to retransmit the entire data
unit.
2. A receiver can use an error correcting code, which automatically correct certain errors.
Error correcting codes are more sophisticated than error-detection codes and require more
redundancy bits.In single bit error detection only two states are sufficient.
1) Error
2) No error
Two states are not enough to detect an error but not to correct it.
Redundancy Bits
To calculate the number of redundancy bit(r) required to correct a given number of data bits
(m), we must find a relationship between m and r.
Add m bits of data with r bits. The length of the resulting code is m+r.
Data and Redundancy bits

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 60


The total number of bits are m+r, then r must be able to indicate at least m+r+1 different states. r bits
can indicate 2r different states. Therefore 2r must be equal to or greater than m+r+1
2 r>=m+r+1
For example if the value of m is 7 the smallest r value that can satisfy this equation is 4.
Relationship between data and redundancy bits
Number of Data Bits Number of redundancy Bits(r) Total bits (m+r)
(m)
1 2 3
2 3 5
3 3 6
4 3 7
5 4 9
6 4 10
7 4 11

Hamming Code
R.W. Hamming provides a practical solution for the error correction. Positioning the
Redundancy Bits For example, a seven-bit ASCII code requires four redundancy bits that can
be added to the end of the data or intersperse with the original data bits. These redundancy
bits are placed in positions 1, 2, 4 and 8. We refer these bits as r1, r2, r3 and r4
Position of redundancy bits in Hamming code

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 61


The combination used to calculate each of the four r values for a seven-bit data sequence are
as follows
The r1 bit is calculated using all bits positions whose binary representation include a 1 in the
rightmost position
r2 is calculated using all bit position with a 1 in the second position and so on
r1: bits 1,3,5,7,9,11
r2: bits 2, 3, 6, 7, 10, 11
r3: bits 4, 5, 6, 7
r4: bits 8, 9, 10, 11
Redundancy bits calculation

Calculating the r values


Place each bit of the original character in its appropriate position in the 11-bit unit. Calculate
the even parities for the various bit combination.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 62


The parity value for each combination is the value of the corresponding r bit. For example, The value
of r1 is calculated to provide even parity for a combination of bits 3,5,7,9 and 11. The value
of r2 is calculated to provide even parity with bits 3, 6, 7, 10 and 11. The value of r3 is
calculated to provide even parity with bits 4, 5, 6 and 7. The value of r4 is calculated to
provide even parity with bits 8, 9, 10 and 11.

The receiver takes the transmission and recalculates four new data using the same set of bits
used by the sender plus the relevant parity (r) bit for each set.
Error detection

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 63


Then it assembles the new parity values into a binary number in order of r position (r8, r4, r2,
r1).This step gives us the binary number 0111(7 in decimal) which is the precise location of
the bit in error. Once the bit is identified, the receiver can reverse its value and correct the
error. Hamming Distance One of the central concepts in coding for error control is the idea of
the Hamming distance.
The Hamming distance between two words (of the same size) is the number of differences
Between the corresponding bits. The Hamming distance between two words x and y is d(x, y).

The Hamming distance can be found by applying the XOR operation on the two words and
Count the number of 1’s in the result. In a set of words, the minimum Hamming distance is
the smallest Hamming distance between all possible pairs. We use dmin to define the
minimum Hamming distance in a coding scheme.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 64


Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 65
1.10 FLOW CONTROL

It refers to a set of procedures used to restrict the amount of data flow between sending and
Receiving stations. It tells the sender how much data it can transmit before it must wait for an
Acknowledgement from the receiver.
There are two methods are used. They are,

1.9.1. Stop and wait


1.9.2. Sliding window

1.9.1 STOP AND WAIT:


In this method the sender waits for acknowledgment after every frame it sends. Only after an
Acknowledgment has been received, and then the sender sends the next frame. The advantage
is simplicity. The disadvantage is inefficiency

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 66


1.9.2 SLIDING WINDOW:

In this method, the sender can transmit several frames before needing an acknowledgment.
The receiver acknowledges only some of the frames, using a single ACK to confirm the
receipt of multiple data frames.
The sliding window refers to imaginary boxes at both the sender and receiver. This window
Provides the upper limit on the number of frames that can be transmitted before requiring an
Acknowledgement. To identify each frame the sliding window scheme introduces the
sequence number. The frames are numbered as 0 to n-1. And the size of the window is n-1.
Here the size of the window is 7 and the frames are numbered as 0,1,2,3,4,5,6,7.

SENDER WINDOW:
At the beginning the sender’s window contains n-1 frames. As frames are sent out the left
Boundary of the window moves inward, shrinking the size of the window. Once an ACK
receives the window expands at the right side boundary to allow in a number of new frames
equal to number of frames acknowledged by that ACK.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 67


ERROR CONTROL

Error control is implemented in such a way that every time an error is detected, a negative
acknowledgement is returned and the specified frame is retransmitted. This process is called
Automatic Repeat Request (ARQ).
The error control is implemented with the flow control mechanism. So there are two types in
error control. They are,
1. Stop and wait ARQ
2. Sliding window ARQ
1. STOP AND WAIT ARQ:
It is a form of stop and wait flow control, extended to include retransmission of data in case
of lost or damaged frames.
DAMAGED FRAME:
When a frame is discovered by the receiver to contain an error, it returns a NAK frame and
the sender retransmits the last frame.

LOST DATA FRAME:


The sender is equipped with a timer that starts every time a data frame is transmitted. If the
frame lost in transmission the receiver can never acknowledge it. The sending device waits
for an ACK or NAK frame until its timer goes off, then it tries again. It retransmits the last
data frame.

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 68


LOST ACKNOWLEDGEMENT:
The data frame was received by the receiver but the acknowledgement was lost in
transmission. The sender waits until the timer goes off, then it retransmits the data frame. The
receiver gets a duplicated copy of the data frame. So it knows the acknowledgement was lost
so it discards the second copy.

WINDOW ARQ
It is used to send multiple frames per time. The number of frame is according to the window
size. The sliding window is an imaginary box which is reside on both sender and receiver
side.It has two types. They are,
1. Go-Back-n ARQ

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 69


2. Selective Reject ARQ

GO-BACK-N ARQ:
In this method, if one frame is lost or damaged, all frames sent since the last frame
Acknowledged or retransmitted.
DAMAGED FRAME:

LOST FRAME:

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 70


LOST ACK:

SELECTIVE REPEAT ARQ

Selective repeat ARQ re transmits only the damaged or lost frames instead of sending
multiple frames. The selective transmission increases the efficiency of transmission and is
more suitable for noisy link. The receiver should have sorting mechanism
DAMAGED FRAME:

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 71


LOST FRAME

LOST ACK

***ALL THE BEST ***

Unit 1- CS 17403 -CN Dr.S.GNANAVEL AP (SS)/ CSE REC P a g e | 72

You might also like