0% found this document useful (0 votes)
69 views93 pages

Lecture Note (CN) - 930272516

Uploaded by

pthrinesh42
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)
69 views93 pages

Lecture Note (CN) - 930272516

Uploaded by

pthrinesh42
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/ 93

LECTURE NOTES

ON

Computer Networks
(20CS503)
V Semester (R20 Regulation)

AUDISANKARA COLLEGE OF ENGINEERING & TECHNOLOGY GUDUR,


NELLORE D.T

Department of computer science and engineering


COMPUTER NETWORKS

B.Tech V Semester: Computer Science and Engineering


Course code Category Hours/week Credits Maximum Marks
L T P C CIA SEE TOTAL
20CS503 PC
3 0 0 3 30 70 100
Contact Classes: 60 Tutorial Classes: 0 Practical Classes: 0 Total Classes: 60
OBJECTIVES:
The courses should enable the students to
1. To study the foundational principles, architectures, and techniques employed in computer
networks.
2. To study the concepts of communication networks, protocols and their performance

UNIT-I DATA COMMUNICATION COMPONENTS Classes:12


Data communication Components Representation of data and its flow Networks , Various
Connection Topology, Protocols and Standards, OSI model, Transmission Media, LAN: Wired
LAN, Wireless LANs, Connecting LAN and Virtual LAN, Techniques for Physical Layer:
Transmission Media coppers, Twisted pair wireless, Switching and encoding Asynchronous
Communications, Narrow Brand Broad Brand ISDN and ATM.
UNIT-II DATA LINK LAYER AND MEDIUM ACCESS SUB Classes:12
LAYER
Data Link Layer and Medium Access Sub Layer: Error Detection and Error Correction -
Fundamentals, Block coding, Hamming Distance, CRC; Flow Control and Error control protocols
- Stop and Wait, Go back – N ARQ, Selective Repeat ARQ, Sliding Window, Piggybacking,
Random Access, Multiple access protocols -Pure ALOHA, Slotted ALOHA, CSMA/CD,
CDMA/CA
UNIT-III NETWORK LAYER Classes:12
Network Layer: Switching, Logical addressing – IPV4, IPV6; Address mapping – ARP, RARP,
BOOTP and DHCP–Delivery, Forwarding and Unicast Routing protocols.
UNIT-IV TRANSPORT LAYER Classes:12
Transport Layer: Process to Process Communication, User Datagram Protocol UDP),
Transmission Control Protocol (TCP), SCTP Congestion Control; Quality of Service, QoS
improving techniques: Leaky Bucket and Token Bucket algorithm.
UNIT-V APPLICATION LAYER Classes:12
Application Layer: Domain Name Space (DNS), DDNS, TELNET, EMAIL, File Transfer
Protocol (FTP), WWW, HTTP, SNMP, Bluetooth, Firewalls, Basic concepts of Cryptography

Text Books:
1. Data Communication and Networking, 4th Edition, Behrouz A. Forouzan, McGraw-
Hill.
Reference Books:
1. Data and Computer Communication, 8th Edition, William Stallings, Pearson Prentice
Hall India.
2. Computer Networks, 8th Edition, Andrew S. Tanenbaum, Pearson New
International Edition.
3. Vilas S Bagad and Irish A Dhotre Computer Networks, Technical Publications.

Web References:
1. http://computer.howstuffworks.com/computer-networking-channel.htm
2. https://www.geeksforgeeks.org/layers-osi-model/
3. https://www.wikilectures.eu/w/Computer_Network
E-Books:
1. http://www.freebookcentre.net/networking-books-download/Lecture-Notes-on-
Computer-Networks.html
2. http://www.freebookcentre.net/networking-books-download/Introduction-to-
Computer- Networks.html

Course Outcomes:
At the end of the course students able to:
1. Understanding the basic network infrastructure to learn the overall function of
networking systems
2. Analyze various wired and wireless transmission media for data communication
networks
3. Apply knowledge of different techniques of error detection and correction to detect
and solve error bit during data transmission
4. Analyze various routing algorithm and select an appropriate one for a routing design
5. Understand the concepts of Domain name space.
UNIT-I

DATA COMMUNICATION COMPONENTS

Representation of data and its flow networks:

• Bits, Bytes, Words


• Analog (continuous) vs. Digital (discrete); extra term: Pulse-code modulation (PCM)
• Representing Images (pixels, RGB, indexed colour / palette); Colour depth, Hi Colour (16-
bit), TrueColor (24-bit)
• Representing Sound (digitizing, sampling, quantization, CD) We will discuss image and
sound representation some more, after we consider

Data Communication:When we communicate, we are sharing information. This sharing can


be local or remote. Between individuals, local communication usually occurs face to face,
while remote communicationn takes place over distance.

Components: A data communications system has five components.

1. Message. The message is the information (data) to be communicated. Popular forms of


information include text, numbers, pictures, audio, and video.
2. Sender. The sender is the device that sends the data message. It can be a computer,
workstation, telephone handset, video camera, and so on.
3. Receiver. The receiver is the device that receives the message. It can be a computer,
workstation, telephone handset, television, and so on.
4. Transmission medium. The transmission medium is the physical path by which a
message travels from sender to receiver. Some examples of transmission media include
twisted-pair wire, coaxial cable, fiber-optic cable, and radio waves
5. Protocol. A protocol is a set of rules that govern data communications. It represents an
agreement between the communicating devices. Without a protocol, two devices may be
connected but not communicating, just as a person speaking French cannot be understood by
a person who speaks only Japanese.
DATA REPRESENTATION:

Information today comes in different forms such as text, numbers, images, audio, and video.
Text: In data communications, text is represented as a bit pattern, a sequence of bits (Os or
Is).
Different sets of bit patterns have been designed to represent text symbols. Each set is called
a code, and the process of representing symbols is called coding. Today, the prevalent coding
system is called Unicode, which uses 32 bits to represent a symbol or character used in any
language in the world.
The American Standard Code for Information Interchange (ASCII), developed some decades
ago in the United States, now constitutes the first 127 characters in Unicode and is also
referred to as Basic Latin.

Numbers: Numbers are also represented by bit patterns. However, a code such as ASCII is
not used to represent numbers; the number is directly converted to a binary number to
simplify mathematical operations. Appendix B discusses several different numbering
systems. Images: Images are also represented by bit patterns.

DATA FLOW:

• NETWORKS:- A network is a set of devices (often referred to as nodes) connected


by communication links. A node can be a computer, printer, or any other device
capable of sending and/or receiving data generated by other nodes on the network.
• Distributed Processing :-Most networks use distributed processing, in which a task is
divided among multiple computers. Instead of one single large machine being
responsible for all aspects of a process, separate computers (usually a personal
computer or workstation) handle a subset.
• Network Criteria:- A network must be able to meet a certain number of criteria. The
most important of these are performance, reliability, and security.
Type of Connection:

• A network is two or more devices connected through links. A link is a


communications pathway that transfers data from one device to another. For
visualization purposes, it is simplest to imagine any link as a line drawn between two
points. For communication to occur, two devices must be connected in some way to
the same link at the same time.
• There are two possible types of connections: point-to-point and multipoint. Point-to-
Point A point-to-point connection provides a dedicated link between two devices.
• The entire capacity of the link is reserved for transmission between those two
devices. Most point-to-point connections use an actual length of wire or cable to
connect the two ends, but other options, such as microwave or satellite links, are also
possible. When you change television channels by infrared remote control, you are
establishing a point-to-point connection between the remote control and the
television's control system.


TOPOLOGY:

The term topology refers to the way in which a network is laid out physically. One or more
devices connect to a link; two or more links form a topology. The topology of a network is
the geometric representation of the relationship of all the links and linking devices (usually
called nodes) to one another. There are four basic topologies possible: mesh, star, bus, and
ring

1.MESH:

In a mesh topology, every device has a dedicated point-to-point link to every other device.
The term dedicated means that the link carries traffic only between the two devices it
connects. To find the number of physical links in a fully connected mesh network with n
nodes, we first consider that each node must be connected to every other node. Node 1 must
be connected to n - I nodes, node 2 must be connected to n – 1 nodes, and finally node n must
be connected to n - 1 nodes. We need n(n - 1) physical links. However, if each physical link
allows communication in both directions (duplex mode), we can divide the number of links
by 2. In other words, we can say that in a mesh topology, we need n(n -1) /2 duplex-mode
links. To accommodate that many links, every device on the network must have n – 1
input/output (VO) ports to be connected to the other n - 1 stations
• Advantages:
• 1. The use of dedicated links guarantees that each connection can carry its own data
load, thus eliminating the traffic problems that can occur when links must be shared
by multiple devices.
• 2. A mesh topology is robust. If one link becomes unusable, it does not incapacitate
the entire system. Third, there is the advantage of privacy or security. When every
message travels along a dedicated line, only the intended recipient sees it. Physical
boundaries prevent other users from gaining access to messages. Finally, point-to-
point links make fault identification and fault isolation easy. Traffic can be routed to
avoid links with suspected problems. This facility enables the network manager to
discover the precise location of the fault and aids in finding its cause and solution.
• Disadvantages:
• 1. Disadvantage of a mesh are related to the amount of cabling because every device
must be connected to every other device, installation and reconnection are difficult.
• 2. Second, the sheer bulk of the wiring can be greater than the available space (in
walls, ceilings, or floors) can accommodate. Finally, the hardware required to connect
each link (I/O ports and cable) can be prohibitively expensive.

2.STAR:

• In a star topology, each device has a dedicated point-to-point link only to a central
controller, usually called a hub. The devices are not directly linked to one another.
Unlike a mesh topology, a star topology does not allow direct traffic between devices.
The controller acts as an exchange: If one device wants to send data to another, it
sends the data to the controller, which then relays the data to the other connected
device . A star topology is less expensive than a mesh topology. In a star, each device
needs only one link and one I/O port to connect it to any number of others. This factor
also makes it easy to install and reconfigure. Far less cabling needs to be housed, and
additions, moves, and deletions involve only one connection: between that device and
the hub.
3.BUS:

• The preceding examples all describe point-to-point connections. A bus topology, on


the other hand, is multipoint. One long cable acts as a backbone to link all the devices
in a network
• Nodes are connected to the bus cable by drop lines and taps. A drop line is a
connection running between the device and the main cable. A tap is a connector that
either splices into the main cable or punctures the sheathing of a cable to create a
contact with the metallic core. As a signal travels along the backbone, some of its
energy is transformed into heat. Therefore, it becomes weaker and weaker as it travels
farther and farther. For this reason there is a limit on the number of taps a bus can
support and on the distance between those taps

4.RING:

In a ring topology, each device has a dedicated point-to-point connection with only the two
devices on either side of it. A signal is passed along the ring in one direction, from device to
device, until it reaches its destination. Each device in the ring incorporates a repeater. When a
device receives a signal intended for another device, its repeater regenerates the bits and
passes them along
NETWORK TOPOLOGY

PROTOCOLS:

• In Order to make communication successful between devices , some rules and


procedures should be agreed upon at the sending and receiving ends of the
system. Such rules and procedures are called as Protocols . Different types of
protocols are used for different types of communication.

STANDARDS:

Standards are the set of rules for data communication that are needed for exchange of
information among devices. It is important to follow Standards which are created by
various Standard Organization like IEEE , ISO , ANSI etc

Types of Standards :
• Standards are of two types :
• De Facto Standard.
• De Jure Standard

• De Facto Standard : The meaning of the work ” De Facto ” is ” By Fact ” or “By


Convention”.
These are the standard s that have not been approved by any Organization , but have
been adopted as Standards because of it’s widespread use. Also , sometimes these
standards are often established by Manufacturers.
• For example : Apple and Google are two companies which established their own
rules on their products which are different . Also they use some same standard rules
for manufacturing for their products.
• De Jure Standard : The meaning of the word “De Jure” is “By Law” or
“By Regulations” .
Thus , these are the standards that have been approved by officially recognized body
like ANSI , ISO , IEEE etc. These are the standard which are important to follow if it
is required or needed.
• For example : All the data communication standard protocols like SMTP , TCP , IP
, UDP etc. are important to follow the same when we needed them.

OSI MODEL:

• OSI stands for Open System Interconnection is a reference model that describes
how information from a software application in one computer moves through a
physical medium to the software application in another computer.
• OSI consists of seven layers, and each layer performs a particular network function.
• OSI model was developed by the International Organization for Standardization (ISO)
in 1984, and it is now considered as an architectural model for the inter-computer
communications.
• OSI model divides the whole task into seven smaller and manageable tasks. Each
layer is assigned a particular task.
• Each layer is self-contained, so that task assigned to each layer can be performed
independently.

Characteristics of OSI Model:

• The OSI model is divided into two layers: upper layers and lower layers.
• The upper layer of the OSI model mainly deals with the application related issues, and
they are implemented only in the software. The application layer is closest to the end
user. Both the end user and the application layer interact with the software
applications. An upper layer refers to the layer just above another layer.
• The lower layer of the OSI model deals with the data transport issues. The data link
layer and the physical layer are implemented in hardware and software. The physical
layer is the lowest layer of the OSI model and is closest to the physical medium. The
physical layer is mainly responsible for placing the information on the physical
medium.
Functions of the OSI Layers:

• There are the seven OSI layers. Each layer has different functions. A list of seven
layers are given below:
1. Physical Layer
2. Data-Link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
TRANSMISSION MEDIA:

• Transmission media is a communication channel that carries the information from the
sender to the receiver. Data is transmitted through the electromagnetic signals.
• The main functionality of the transmission media is to carry the information in the
form of bits through LAN(Local Area Network).
• It is a physical path between transmitter and receiver in data communication.
• In a copper-based network, the bits in the form of electrical signals.
• In a fibre based network, the bits in the form of light pulses.
• In OSI(Open System Interconnection) phase, transmission media supports the Layer
1. Therefore, it is considered to be as a Layer 1 component.
• The electrical signals can be sent through the copper wire, fibre optics, atmosphere,
water, and vacuum.
• The characteristics and quality of data transmission are determined by the
characteristics of medium and signal.
• Transmission media is of two types are wired media and wireless media. In wired
media, medium characteristics are more important whereas, in wireless media, signal
characteristics are more important.
• Different transmission media have different properties such as bandwidth, delay, cost
and ease of installation and maintenance.
• The transmission media is available in the lowest layer of the OSI reference model,
i.e., Physical layer.

• Bandwidth: All the factors are remaining constant, the greater the bandwidth of a
medium, the higher the data transmission rate of a signal.
• Transmission impairment: When the received signal is not identical to the
transmitted one due to the transmission impairment. The quality of the signals will get
destroyed due to transmission impairment.
• Interference: An interference is defined as the process of disrupting a signal when it
travels over a communication medium on the addition of some unwanted signal.

Causes Of Transmission Impairment:

• Attenuation: Attenuation means the loss of energy, i.e., the strength of the signal
decreases with increasing the distance which causes the loss of energy.
• Distortion: Distortion occurs when there is a change in the shape of the signal. This
type of distortion is examined from different signals having different frequencies.
Each frequency component has its own propagation speed, so they reach at a different
time which leads to the delay distortion.
• Noise: When data is travelled over a transmission medium, some unwanted signal is
added to it which creates the noise.

Classification Of Transmission Media:


1.Guided Media
• It is defined as the physical medium through which the signals are transmitted. It is
also known as Bounded media.
Types Of Guided media:
Twisted pair:
• Twisted pair is a physical media made up of a pair of cables twisted with each other.
A twisted pair cable is cheap as compared to other transmission media. Installation of
the twisted pair cable is easy, and it is a lightweight cable. The frequency range for
twisted pair cable is from 0 to 3.5KHz.
• A twisted pair consists of two insulated copper wires arranged in a regular spiral
pattern.
Types of Twisted pair

1.Unshielded Twisted Pair:


• An unshielded twisted pair is widely used in telecommunication. Following are the
categories of the unshielded twisted pair cable:
• Category 1: Category 1 is used for telephone lines that have low-speed data.
• Category 2: It can support upto 4Mbps.
• Category 3: It can support upto 16Mbps.
• Category 4: It can support upto 20Mbps. Therefore, it can be used for long-distance
communication.
• Category 5: It can support upto 200Mbps

2.Shielded Twisted Pair

• A shielded twisted pair is a cable that contains the mesh surrounding the wire that
allows the higher transmission rate.
Characteristics Of Shielded Twisted Pair:
• The cost of the shielded twisted pair cable is not very high and not very low.
• An installation of STP is easy.
• It has higher capacity as compared to unshielded twisted pair cable.
• It has a higher attenuation.
• It is shielded that provides the higher data transmission rate.

Coaxial Cable
• Coaxial cable is very commonly used transmission media, for example, TV wire is
usually a coaxial cable.
• The name of the cable is coaxial as it contains two conductors parallel to each other.
• It has a higher frequency as compared to Twisted pair cable.
• The inner conductor of the coaxial cable is made up of copper, and the outer
conductor is made up of copper mesh. The middle core is made up of non-conductive
cover that separates the inner conductor from the outer conductor.
• The middle core is responsible for the data transferring whereas the copper mesh
prevents from the EMI(Electromagnetic interference).
• Coaxial cable is of two types:
1. Baseband transmission: It is defined as the process of transmitting a single signal at
high speed.
2. Broadband transmission: It is defined as the process of transmitting multiple signals
simultaneously.

Fibre Optic:
• Fibre optic cable is a cable that uses electrical signals for communication.
• Fibre optic is a cable that holds the optical fibres coated in plastic that are used to
send the data by pulses of light.
• The plastic coating protects the optical fibres from heat, cold, electromagnetic
interference from other types of wiring.
• Fibre optics provide faster data transmission than copper wires.
2.UnGuided Transmission
• An unguided transmission transmits the electromagnetic waves without using any
physical medium. Therefore it is also known as wireless transmission.
• In unguided media, air is the media through which the electromagnetic energy can
flow easily.
• Unguided transmission is broadly classified into three categories:
• Radio waves
• Radio waves are the electromagnetic waves that are transmitted in all the directions of
free space.
• Radio waves are omnidirectional, i.e., the signals are propagated in all the directions.
• The range in frequencies of radio waves is from 3Khz to 1 khz.
• In the case of radio waves, the sending and receiving antenna are not aligned, i.e., the
wave sent by the sending antenna can be received by any receiving antenna.
• An example of the radio wave is FM radio.

MICRO WAVES:

Terrestrial Microwave Transmission


• Terrestrial Microwave transmission is a technology that transmits the focused beam of
a radio signal from one ground-based microwave transmission antenna to another.
• Microwaves are the electromagnetic waves having the frequency in the range from
1GHz to 1000 GHz.
• Microwaves are unidirectional as the sending and receiving antenna is to be aligned,
i.e., the waves sent by the sending antenna are narrowly focussed.
• In this case, antennas are mounted on the towers to send a beam to another antenna
which is km away.
• It works on the line of sight transmission, i.e., the antennas mounted on the towers are
the direct sight of each other.

Characteristics of Microwave:
• Frequency range: The frequency range of terrestrial microwave is from 4-6 GHz to
21-23 GHz.
• Bandwidth: It supports the bandwidth from 1 to 10 Mbps.
• Short distance: It is inexpensive for short distance.
• Long distance: It is expensive as it requires a higher tower for a longer distance.
• Attenuation: Attenuation means loss of signal. It is affected by environmental
conditions and antenna size.

Satellite Microwave Communication


• A satellite is a physical object that revolves around the earth at a known height.
• Satellite communication is more reliable nowadays as it offers more flexibility than
cable and fibre optic systems.
• We can communicate with any point on the globe by using satellite communication.

Infrared
• An infrared transmission is a wireless technology used for communication over short
ranges.
• The frequency of the infrared in the range from 300 GHz to 400 THz.
• It is used for short-range communication such as data transfer between two cell
phones, TV remote operation, data transfer between a computer and cell phone resides
in the same closed area.
Characteristics Of Infrared:
It supports high bandwidth, and hence the data rate will be very high.
• Infrared waves cannot penetrate the walls. Therefore, the infrared communication in
one room cannot be interrupted by the nearby rooms.
• An infrared communication provides better security with minimum interference.
• Infrared communication is unreliable outside the building because the sun rays will
interfere with the infrared waves.

LAN:

• A Local Area Network (LAN) is a private network that connects computers and
devices within a limited area like a residence, an office, a building or a campus. On a
small scale, LANs are used to connect personal computers to printers. However,
LANs can also extend to a few kilometers when used by companies, where a large
number of computers share a variety of resources like hardware (e.g. printers,
scanners, audiovisual devices etc), software (e.g. application programs) and data.

The distinguishing features of LAN are:

• Network size is limited to a small geographical area, presently to a few kilometers.


• Data transfer rate is generally high. They range from 100 Mbps to 1000 Mbps.
• In general, a LAN uses only one type of transmission medium, commonly category 5
coaxial cables.
• A LAN is distinguished from other networks by their topologies. The common
topologies are bus, ring, mesh, and star.
• The number of computers connected to a LAN is usually restricted. In other words,
LANs are limitedly scalable.
• IEEE 802.3 or Ethernet is the most common LAN. They use a wired medium in
conjuncture with a switch or a hub. Originally, coaxial cables were used for
communications. But now twisted pair cables and fiber optic cables are also used.
Ethernet’s speed has increased from 2.9 Mbps to 400 Gbps.
WIRED LAN:

WIRELESS LAN(WLAN):

• Wireless LANs use high-frequency radio waves instead of cables for


communications. They provide clutter free homes, offices and other networked
places. They have an Access Point or a wireless router or a base station for
transferring packets to and from the wireless computers and the internet. Most
WLANs are based on the standard IEEE 802.11 or WiFi.

CONNECTING LAN:
VIRTUAL LAN(VLAN):

• Virtual LANs are a logical group of computers that appear to be on the same LAN
irrespective of the configuration of the underlying physical network. Network
administrators partition the networks to match the functional requirements of the
VLANs so that each VLAN comprise a subset of ports on a single or multiple
switches. This allows computers and devices on a VLAN to communicate in the
simulated environment as if it is a separate LAN.

TRANSMISSION MEDIA COPPERS:

• In data communication, transmission media acts as a physical lane among transmitter


& receiver. The form of bits varies based on the type of network like for copper-based
network; the bits are in electrical signals form whereas, in a fiber network, the bits are
in the light signals form.
TWISTED PAIR WIRELESS:

• Twisted pair is a physical media made up of a pair of cables twisted with each other.
A twisted pair cable is cheap as compared to other transmission media. Installation of
the twisted pair cable is easy, and it is a lightweight cable. The frequency range for
twisted pair cable is from 0 to 3.5KHz.
A twisted pair consists of two insulated copper wires arranged in a regular spiral pattern
SWITCHING AND ENCODING ASYNCHRONOUS COMMUNICATION:

• n large networks, there can be multiple paths from sender to receiver. The switching
technique will decide the best route for data transmission.
• Switching technique is used to connect the systems for making one-to-one
communication.

Circuit Switching:

• Circuit switching is a switching technique that establishes a dedicated path between


sender and receiver.
• In the Circuit Switching Technique, once the connection is established then the
dedicated path will remain to exist until the connection is terminated.
• Circuit switching in a network operates in a similar way as the telephone works.
• A complete end-to-end path must exist before the communication takes place.
• In case of circuit switching technique, when any user wants to send the data, voice,
video, a request signal is sent to the receiver then the receiver sends back the
acknowledgment to ensure the availability of the dedicated path. After receiving the
acknowledgment, dedicated path transfers the data.
• Circuit switching is used in public telephone network. It is used for voice
transmission.
• Fixed data can be transferred at a time in circuit switching technology.

Space Division Switches:

• Space Division Switching is a circuit switching technology in which a single


transmission path is accomplished in a switch by using a physically separate set of
crosspoints.
• Space Division Switching can be achieved by using crossbar switch. A crossbar
switch is a metallic crosspoint or semiconductor gate that can be enabled or disabled
by a control unit.
• The Crossbar switch is made by using the semiconductor. For example, Xilinx
crossbar switch using FPGAs.
• Space Division Switching has high speed, high capacity, and nonblocking switches.
• Space Division Switches can be categorized in two ways:
• Crossbar Switch
• Multistage Switch

Crossbar Switch:
• The Crossbar switch is a switch that has n input lines and n output lines. The crossbar
switch has n2 intersection points known as crosspoints.

Multistage Switch:

• Multistage Switch is made by splitting the crossbar switch into the smaller units and
then interconnecting them.
• It reduces the number of crosspoints.
• If one path fails, then there will be an availability of another path

Message Switching:

• Message Switching is a switching technique in which a message is transferred as a


complete unit and routed through intermediate nodes at which it is stored and
forwarded.
• In Message Switching technique, there is no establishment of a dedicated path
between the sender and receiver.
• The destination address is appended to the message. Message Switching provides a
dynamic routing as the message is routed through the intermediate nodes based on the
information available in the message.
• Message switches are programmed in such a way so that they can provide the most
efficient routes.
• Each and every node stores the entire message and then forward it to the next node.
This type of network is known as store and forward network.
• Message switching treats each message as an independent entity.
Packet Switching:

• The packet switching is a switching technique in which the message is sent in one go,
but it is divided into smaller pieces, and they are sent individually.
• The message splits into smaller pieces known as packets and packets are given a
unique number to identify their order at the receiving end.
• Every packet contains some information in its headers such as source address,
destination address and sequence number.
• Packets will travel across the network, taking the shortest path as possible.
• All the packets are reassembled at the receiving end in correct order.
• If any packet is missing or corrupted, then the message will be sent to resend the
message.
• If the correct order of the packets is reached, then the acknowledgment message will
be sent.

ENCODING:

It is the process of converting the data or a given sequence of characters, symbols, alphabets
etc., into a specified format, for the secured transmission of data. Decoding is the reverse
process of encoding which is to extract the information from the converted format

Data Encoding:

• Encoding is the process of using various patterns of voltage or current levels to


represent 1s and 0s of the digital signals on the transmission link.
The common types of line encoding are Unipolar, Polar, Bipolar, and Manchester

Encoding Techniques:

The data encoding technique is divided into the following types, depending upon the type of
data conversion.
• Digital data to Digital signals − These are in this section. There are several ways to
map digital data to digital signals
• Digital data to Analog signals − The modulation techniques such as Amplitude Shift
Keying ASK Frequency Shift Keying FSK , fall under this category.
• Analog data to Analog signals − The modulation techniques such as Amplitude
Modulation, Frequency Modulation and Phase Modulation of analog signals, fall
under this category.

1.POLAR ENCODING:

• Polar encoding is an encoding design that needs two voltage methods — one is
positive, and the second is negative.
• An average voltage method is decreased using both techniques, and the unipolar
encoding scheme’s DC component is removed.
• In Manchester and differential encoding, each bit includes both +ve and –ve voltage.
Therefore, the DC component removed.

Types of Polar Encoding:


• There are two types of Polar Encoding which are as follows −
• NRZ
• NRZ represents Non-Return to Zero Code. In this coding, the signal level remains
consistent during a bit duration.
• There are three approaches used in NRZ are −
• Non-Return to Zero Level (NRZ-L)
• In this coding system, the bit id represented by a voltage level. This voltage level
remains constant during bit duration, as shown in the figure for data 110010111.

• Non-Return to Zero Mark (NRZ-M)


In this encoding, '1' stands for mark and '0' for space. The signal level changes only for mark,
i.e., for '1'. The figure shows an NRZ-M code for data 11001011

• Non-Return to Zero Space (NRZ-S)


This encoding is very much similar to the non-return to zero marks. The only change is that
the signal changes only for space, i.e., for '0' and remain constant for mark, i.e., '1'. The figure
shows the NRZ-S code for the data 11001011
RZ
• RZ stands for Return to zero Code. In digital transmission, the clock can be extracted
if bits are continuously transmitted. If the data contains a continuous string of zeroes
or ones, then in non-return to zero codes, the electrical signals will not have any level
transition. A level change will not be there in codes.
• The return to zero codes overcome the above limitations of NRZ codes. These codes
are the combination of NRZ-L code and a clock signal.
• There are four types of return to zero codes which are as follows −

Manchester Code:

• A negative to positive describes binary '1', and a positive to negative transitions


shows binary '0'. So whatever be the bit sequence, each bit duration will have
one transition, i.e., change-of-level. So at receiving end, the clock circuit faces no
problems regarding level transitions.
• This code is widely used in Local Area Network (LANs). It is also known as
Biphase-L code, and an example for data bit 00110010 is shown in the figure −

Biphase–M Code:

• n this coding system, there is continually a transition at the starting of the bit
interval. The mark, i.e., binary '1', has an extra transition in the bit interval
center.
• The figure shows an example of data bit 11001011 using Biphase-M code −
Biphase –S Code:

• This coding system is similar to the Biphase-M code system. There is continually
a transformation at the starting of the bit interval. The only alteration is that
space, i.e., '0', has an extra transition in the middle of the bit interval except for
'1' as in Biphase-M code.
• The figure shows an example of data bit 11001011 using BIphase-S Code −

Differential Manchester Code:

• This coding system is continually a change in the middle of the bit interval. Space
or binary '0' has an additional transition at the starting of the bit interval.
• The figure shows an example of data bit 01001011 using differential-Manchester
code
Example 1 − Show the NRZ-L code for data byte 10110100

Example 2 − Show the NRZ-S code for data byte 00010100

NARROW BRAND BOARD BRAND ISDN &ATM:

These are a set of communication standards for simultaneous digital transmission of voice,
video, data, and other network services over the traditional circuits of the public switched
telephone network. Before Integrated Services Digital Network (ISDN), the telephone system
was seen as a way to transmit voice, with some special services available for data. The main
feature of ISDN is that it can integrate speech and data on the same lines, which were not
available in the classic telephone system

ISDN is a circuit-switched telephone network system, but it also provides access to packet-
switched networks that allows digital transmission of voice and data. This results in
potentially better voice or data quality than an analog phone can provide. It provides a
packet-switched connection for data in increments of 64 kilobit/s. It provided a maximum of
128 kbit/s bandwidth in both upstream and downstream directions. A greater data rate was
achieved through channel bonding. Generally, ISDN B-channels of three or four BRIs (six to
eight 64 kbit/s channels) are bonded

INTERFACE AND SERVICES OF ISDN:

• Basic Rate Interface (BRI) –


• Primary Rate Interface (PRI) –
• Broadband-ISDN (B-ISDN) –
SERVICES
• Bearer Services –
• Teleservices –
Supplementary Service –

Principle of ISDN:

• The ISDN works based on the standards defined by ITU-T (formerly CCITT).
The Telecommunication Standardization Sector (ITU-T) coordinates standards
for telecommunications on behalf of the International Telecommunication Union
(ITU) and is based in Geneva, Switzerland. The various principles of ISDN as
per ITU-T recommendation are:
• To support switched and non-switched applications

• To support voice and non-voice applications

• Reliance on 64-kbps connections

• Intelligence in the network

• Layered protocol architecture


Variety of configurations

Advantages of ISDN:
• ISDN channels have a reliable connection.
• ISDN is used to facilitate the user with multiple digital channels.
• It has faster data transfer rate.
Disadvantages of ISDN:
• ISDN lines costlier than the other telephone system.
• It requires specialized digital devices.
• It is less flexible.

ATM:

• Interworking between narrow band and broad band traffic in an ATM network is
provided by a narrow band switch having a point to multipoint capability. Narrow
band channels are mapped to time slots in broad band virtual circuits by providing a
mapping between channel addresses and virtual circuit payloads. The narrow band
traffic is interfaced to the broad band ATM network via a network of adaptive virtual
junctors each of which comprises an n×64 kbit/s connection so that the cell assembly
delay is reduced by a factor of 1/n. this overcomes the assembly delay problem
without the need to resort to unproductive padding. Further, by providing dynamic
capacity adjustment of the virtual circuits between the junctors, maximum use is made
of the available capacity without the need for the permanent reservation of capacity
which may be unused for much of the time.
UNIT-II

DATA LINK LAYER AND MEDIUM ACCESS SUB LAYER

ERROR DETECTION & CORRECTION FUNDAMENTALS:

• Error correction and error detection techniques are work on the data-link layer. The
data link layer ensures the frames are sent from the sender to the receiver with
accuracy. Error correction is more difficult than error detection.

Error:
• An error is a situation when the data send by the sender and receive by the receiver,
but that data doesn't match the sender data.
• For example, the sender sends the 0101010 data, and the receiver receives the
1101010.

Types of Error
1. Single bit error
2. Burst error

Single-bit error: In the single-bit error, only one bit is changed in the frame. For example,
the sender sends the data (01010100) in the frame, and the receiver receives the data
(11010100) in the frame

Burst error: In the burst error, one or more than one bits is changed in the frame. For
example, the sender sends the data (01010100) in the frame, and the receiver receives the
data (11010100) in the frame
Redundancy
• The main concept of error detection and error correction is redundancy. To the error
detection and error correction, redundancy adds some extra redundant bits in the bits.
The sender adds these redundant bits, and the receiver eliminates these redundant bits.

Coding
• Redundancy is achieved by way of various coding schemes. The sender introduces
redundant bits by establishing a connection between the redundant bits and the actual
data bits. The receiver checks the relationship between the redundant bits and the
actual data bits to detect the error. Coding schemes can be divided into two
categories: block coding and convolution coding. Block coding is less complex than
the convolution coding.

Error Detection:

Error detection is the method of identifying errors. To identify these errors, it uses some
redundancy codes. Redundancy codes added in actual data, and it has transmitted by the
sender. These codes are known as error detection codes
Types of error detection techniques:

1.Parity Checking

• Parity Checking is also known as the Vertical redundancy check (VRC). Parity
checking is a very simple technique. There are two cases in the parity checking
techniques:

• Even parity: If the number of 1's is even in the frame, 0 is added in the frame. The
even-parity example shown in the figure below.

• Odd parity: If the number of 1's is odd in the frame, 1 is added in the frame. The
odd-parity example shown in the figure below.
2.Cyclic Redundancy Check:

• The cyclic redundancy check was developed by W-Wesley Peterson in 1961. It is a


technique that is used to find errors in digital-data. The cyclic redundancy check is
very easy to implement in hardware. It can be analyzed mathematically. The cyclic
redundancy check is more effective than VRC and LRC techniques in detecting
errors. VRC and LRC are based at the binary-addition, whereas the CRC is based at
the binary-division.

The important points of CRC are following in the below.

• If the remainder is non-zero arrives after doing the Binary Division, that data is not
error-free.
• If the remainder zero arrives after doing binary division, that data is error-free.

Error Correction:

• Error correction is more difficult than error detection. Error correction codes are used
to detect and correct errors when transmitting data from the sender to the receiver.
• It can be done in two ways:
1. Backward Error Correction
2. Forward Error Correction

Backward Error Correction: If the receiver receives an error in the received data, it
tells the sender to retransmit the data again.

Forward Error Correction: If the receiver finds an error in the received data, the error
correction codes correct these errors automatically

BLOCK CODING:

• In block coding, we divide our message into blocks, each of k bits, called data words.
We add r redundant bits to each block to make the length n = k + r. The resulting n-bit
blocks are called code words.
• For example, we have a set of data words, each of size k, and a set of code words,
each of size of n. With k bits, we can create a combination of 2k data words, with n
bits; we can create a combination of 2n code words. Since n > k, the number of
possible code words is larger than the number of possible data words.
• The block coding process is one-to-one; the same data word is always encoded as the
same code word. This means that we have 2n-2k code words that are not used. We
call these code words invalid or illegal. The following figure shows the situation.

Error Detection

• If the following two conditions are met, the receiver can detect a change in the
original code word by using Block coding technique.
• 1. The receiver has (or can find) a list of valid code words.
• 2. The original code word has changed to an invalid one.

• The sender creates code words out of data words by using a generator that applies the
rules and procedures of encoding (discussed later). Each code word sent to the
receiver may change during transmission. If the received code word is the same as
one of the valid code words, the word is accepted; the corresponding data word is
extracted for use.
• If the received code word is not valid, it is discarded. However, if the code word is
corrupted during transmission but the received word still matches a valid code word,
the error remains undetected. This type of coding can detect only single errors. Two
or more errors may remain undetected.

For example consider the following table of data words and Code words:
Assume the sender encodes the data word 01 as 011 and sends it to the receiver. Consider the
following cases:
1. The receiver receives O11. It is a valid code word. The receiver extracts the data word 01
from it.
2. The code word is corrupted during transmission, and 111 is received (the leftmost bit is
corrupted). This is not a valid code word and is discarded.
3. The code word is corrupted during transmission, and 000 is received (the right two bits are
corrupted). This is a valid code word. The receiver incorrectly extracts the data word 00. Two
corrupted bits have made the error undetectable

Error Correction:

• Error correction is much more difficult than error detection. In error detection, the
receiver needs to know only that the received code word is invalid, in error correction
the receiver needs to find (or guess) the original code word sent. So, we need more
redundant bits for error correction than for error detection.

• Assume the data word is 01. The sender consults the table (or uses an algorithm) to
create the code word 01011. The code word is corrupted during transmission, and
01001 is received (error in the second bit from the right). First, the receiver finds that
the received code word is not in the table. This means an error has occurred.
(Detection must come before correction.) The receiver, assuming that there is only 1
bit corrupted, uses the following strategy to guess the correct data word.

1. Comparing the received code word with the first code word in the table (01001
versus 00000), the receiver decides that the first code word is not the one that was
sent because there are two different bits.
2. By the same reasoning, the original code word cannot be the third or fourth one in
the table.
3. The original code word must be the second one in the table because this is the only
one that differs from the received code word by 1 bit. The receiver replaces 01001
with 01011 and consults the table to find the data word 01.

Hamming Distance:

• The central concepts in coding for error control are 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. We show the Hamming distance between
two words x and y as d(x, y).
• The Hamming distance can easily be found if we apply the XOR operation on the two
words and count the number of 1s in the result. Note that the Hamming distance is a
value greater than zero.

• 1. The Hamming distance d(000, 011) is 2 because 000 ⊕ 011 is 011 (two 1s).
• 2. The Hamming distance d(10101, 11110) is 3 because 10101 ⊕ 11110 is 01011
(three 1s).

Minimum Hamming Distance:

• 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. To find this value, we find the Hamming distances between all words and
select the smallest one.

Hamming Distance and Error

When a code word is corrupted during transmission, the Hamming distance between the sent
and received code words is the number of bits affected by the error. In other words, the
Hamming distance between the received code word and the sent code word is the number of
bits that are corrupted during transmission

• For example, if the code word 00000 is sent and 01101 is received, 3 bits are in error
and the Hamming distance between the two is d(00000, 01101) =3.

Minimum Distance for Error Detection:

• To find the minimum Hamming distance in a code if we want to be able to detect up


to s errors. If S errors occur during transmission, the Hamming distance between the
sent code word and received code word is S. If our code is to detect up to S errors, the
minimum distance between the valid codes must be s + 1, so that the received code
word does not match a valid code word.

Minimum Distance for Error Correction:

• Error correction is more complex than error detection, a decision is involved. When a
received code word is not a valid code word, the receiver needs to decide which valid
code word was actually sent. The decision is based on the concept of territory, an
exclusive area surrounding the code word. Each valid code word has its own territory.
We use a geometric approach to define each territory. We assume that each valid
Code word has a circular territory with a radius of t and that the valid code word is at
the center.

EXAMPLE:

• For example, suppose a code word x is corrupted by t bits or less. Then this corrupted
code word is located either inside or on the perimeter of this circle. If the receiver
receives a code word that belongs to this territory, it decides that the original code
word is the one at the center. Note that we assume that only up to t errors have
occurred; otherwise, the decision is wrong. The following Figure shows this
geometric interpretation. Some texts use a sphere to show the distance between all
valid block codes.

Hamming Codes:

• The Hamming codes were originally designed with dmin = 3, which means that they
can detect up to two errors or correct one single error. But there are some Hamming
codes that can correct more than one error.
• First let us find the relationship between n and k in a Hamming code. We need to
choose an integer m >= 3. The values of n and k are then calculated from mas n = 2m
– 1 and k= n-m. The number of check bits r =m.
• For example, if m=3, then n= 7 and k= 4. This is a Hamming code C(7, 4) with
dmin =3. The following Table shows the data words and code words for this code.

The following figure shows the structure of the encoder and decoder for this example
Cyclic Codes:

• Cyclic codes are special linear block codes with one extra property. In a cyclic code,
if a code word is cyclically shifted (rotated), the result is another code word. For
example, if 1011000 is a code word and we cyclically left-shift, then 0110001 is also
a code word.
• In this case, if we call the bits in the first word a0 to a6 and the bits in the second
word b0 to b6, we can shift the bits by using the following:
• b1=a0 b2=a1 b3=a2 b4=a3 b5=a4 b6=a5 b0=a6

Cyclic Redundancy Checks (CRC):

• The Cyclic Redundancy Checks (CRC) is the most powerful method for Error-
Detection and Correction. It is given as a kbit message and the transmitter creates an
(n – k) bit sequence called frame check sequence. The out coming frame, including n
bits, is precisely divisible by some fixed number. Modulo 2 Arithmetic is used in this
binary addition with no carries, just like the XOR operation.
• Redundancy means duplicacy. The redundancy bits used by CRC are changed by
splitting the data unit by a fixed divisor. The remainder is CRC.

Qualities of CRC

• It should have accurately one less bit than the divisor.


• Joining it to the end of the data unit should create the resulting bit sequence precisely
divisible by the divisor.
Process:
• A string of n 0s is added to the data unit. The number n is one smaller than the
number of bits in the fixed divisor.
• The new data unit is divided by a divisor utilizing a procedure known as binary
division; the remainder appearing from the division is CRC.
• The CRC of n bits interpreted in phase 2 restores the added 0s at the end of the data
unit.

Example
• Message D = 1010001101 (10 bits)
• Predetermined P = 110101 (6 bits)
• FCS R = to be calculated 5 bits
• Hence, n = 15 K = 10 and (n – k) = 5
• The message is generated through 25:accommodating 1010001101000
• The product is divided by P.
• The remainder is inserted to 25D to provide T = 101000110101110 that is sent.
• Suppose that there are no errors, and the receiver gets T perfect. The received frame is
divided by P.

Because there is no remainder there is no error

The following table shows an example of a CRC code which shows both the linear and cyclic
properties of this code.
PROTOCOLS:

Data Link Control


• Data-link control is the main function of the data link layer. It deals with the
configuration and coordination for connection between two neighboring nodes: node-
to-node communication. The task of the data link layer includes error-control,
software-implemented protocols, flow-control, and framing that provide efficient and
smooth transmission of frames between nodes.

Framing
The data link layer separates the bit-stream obtained from the network layer into usable data
units called frames

Flow control
• Flow control is one of the essential duties of the data link layer. It manages the
amount of data that can be sent before obtaining confirmation. Flow control is a set of
methods that tell the sender how much data it can transmit before the receiver is
overloaded. Any receiving device has limited speed and limited memory for the
process of incoming data and storage of the incoming data.

Error control
• Error control includes both methods of error detection and error correction. The error
control helps the receiver to notify the sender of any lost frames or damaged frames
during the transmission. It allows to retransmission of those frames by the sender. At
the data link layer, error control is often easily implemented: whenever an error is
detected at the frames, those frames are re-transmitted.
• Protocols
• The protocols usually use one of the common programming languages to execute the
software. Protocols are divided into two categories: Noiseless channel and Noisy
channel. The diagram of protocols structure is shown below

 Noiseless channel
• The noiseless channel is divided into two sub-categories: Simplest protocol and Stop-
and-Wait protocol. The first protocol of this channel does not use flow control, but the
second protocol uses flow control.

1.Simplest Protocol
• In this protocol, it doesn't use the flow and error control. It is a unidirectional protocol
where data frames only travel from sender to receiver in one direction. The design of
the simplest protocol with no flow control or error control is shown below.

For example: The simplest protocol is very simple. The sender sends frames in the sequence
without really knowing about the receiver. In this protocol to send three frames, there are
three events at the sender and three events at the receiver. These events are shown below in
the figure
2.Stop-and-Wait Protocol
• The sender sends a frame in the Stop-and-Wait protocol, and it stops until when the
receiver receives the data and then sends the next frame. In this protocol, adds the
flow control. This protocol is a unidirectional protocol for data frames, but auxiliary
ACK (Acknowledgment) frames travel from other directions. The design of the Stop-
and-Wait protocol is shown below.

For example: The stop-and-wait protocol is very simple. The sender transmits a frame and
wait for the receiver response. The sender transmits the next frame after arrives the ACK of
the previous frame.
Note that sending three frames in this example involves the sender in six events and the
receiver in three events. These events are shown below in the figure
Noisy Channels
• The noisy channel is divided into three sub-categories:
1. Stop-and-Wait automatic repeat request
2. Go-back-N automatic repeat request
3. Selective repeat automatic repeat request

Stop-and-Wait Automatic Repeat Request:

• Stop-and-wait automatic repeat request is a protocol that is used in tele-


communications to transfer the data between two connected systems.
• In the stop-and-wait automatic repeat request protocol, the sender sends one frame at
a time. The sender transmits a frame and waits for the receiver response. The sender
transmits the next frame after it arrives acknowledgment (ACK) signal of the previous
frame. When the acknowledgment (ACK) does not reach the sender within a specified
time, the sender sends the same frame again.
• At the end of each frame, the sender adds redundancy bits. At the receiver-end, these
redundancy bits are used to check the damage of the frames.
In this protocol, we need a sequence number for the frames. The design of the Stop-and-Wait
ARQ protocol is shown below

The example of Stop-and-Wait ARQ is shown below in the figure


Go-Back-N ARQ

• Go-Back-N ARQ protocol is also known as Go-Back-N Automatic Repeat Request. It


is a data link layer protocol that uses a sliding window method. In this, if any frame is
corrupted or lost, all subsequent frames have to be sent again.
• The size of the sender window is N in this protocol. For example, Go-Back-8, the size
of the sender window, will be 8. The receiver window size is always 1.
• If the receiver receives a corrupted frame, it cancels it. The receiver does not accept a
corrupted frame. When the timer expires, the sender sends the correct frame again.
The design of the Go-Back-N ARQ protocol is shown below.

The example of Go-Back-N ARQ is shown below in the figure.


Selective Repeat ARQ

• Selective Repeat ARQ is also known as the Selective Repeat Automatic Repeat
Request. It is a data link layer protocol that uses a sliding window method. The Go-
back-N ARQ protocol works well if it has fewer errors. But if there is a lot of error in
the frame, lots of bandwidth loss in sending the frames again. So, we use the Selective
Repeat ARQ protocol. In this protocol, the size of the sender window is always equal
to the size of the receiver window. The size of the sliding window is always greater
than 1.
• If the receiver receives a corrupt frame, it does not directly discard it. It sends a
negative acknowledgment to the sender. The sender sends that frame again as soon as
on the receiving negative acknowledgment. There is no waiting for any time-out to
send that frame. The design of the Selective Repeat ARQ protocol is shown below.

The example of the Selective Repeat ARQ protocol is shown below in the figure
Sliding Window Protocol:

• The sliding window is a technique for sending multiple frames at a time. It controls
the data packets between the two devices where reliable and gradual delivery of data
frames is needed. It is also used in TCP (Transmission Control Protocol).
• In this technique, each frame has sent from the sequence number. The sequence
numbers are used to find the missing data in the receiver end. The purpose of the
sliding window technique is to avoid duplicate data, so it uses the sequence number.
• Types of Sliding Window Protocol
• Sliding window protocol has two types:
1. Go-Back-N ARQ
2. Selective Repeat ARQ

Piggybacking:

• It is used to increase the performance of the bidirectional protocols. In piggybacking,


if node A sends a data to node B, it can also give the node-A information about the
frame coming (or lost) from node B. if node B sends a data to node A, it can also give
the node B information about the frame coming from node A.

Multiple Access Control:

Multiple Access Control: The data link layer is separated into two sub-layers. The upper sub-
layer is responsible for flow control and error control that is called the logical link control
layer. The lower sub-layer is responsible for multiple access resolution that is called media
access control (MAC). The Sub-layer of the data link layer is shown in the figure below
CLASSIFICATION:

Random Access Protocol:

• n the Random access protocol, all systems are equal. No anyone system can depend
and control another system. However, if more than one station attempts to transmit
the data, there is an access conflict—collision, due to which the frames are either lost
or changed.
Random access protocol is divided into two categories; firstly, aloha, and second CSMA
(carrier sense multiple access). CSMA is later further divided into two parallel methods;
CSMA/CD and CSMA/CA. When a collision is detected, CSMA/CD tells the station what to
do. CSMA/CA attempts to stop a collision

1. Aloha:
ALOHA is a Multiple Access Protocol which is used for random access in the
network. Aloha was designed for the wireless local area network (WLAN), which is
also known as the radio broadcast. In this method, any user can transmit the data at
any time.
Type of Aloha
1. Pure Aloha
2. Slotted Aloha

• Pure Aloha: Pure aloha is also called the original aloha protocol. It's a simple but
elegant protocol, i.e., whenever the system has a data frame to send, it transmits the
data frame continuously. Due to which the risk of collision is very high in this aloha
method. Shown in below pure aloha.

• The maximum throughput occurs at G = 1/2, which is 18.4%.


• In Pure Aloha, the probability of successful transmission of the data frame is S= G*
e^-2G
• In Pure Aloha, vulnerable time is: 2 * Tfr

• Slotted Aloha: Slotted aloha was developed to improve the efficiency of the Pure
Aloha. In this Aloha, the time of the systems is divided into slots so that the system
can send only one frame to a slot, and this frame can only be sent at the beginning of
the slot. If a system cannot send a frame at the beginning of the slot, then it has to
wait for the next slot to start. If two systems try to transmit the frame at the beginning
of a time slot. But it is better than pure Aloha because it has less chance of collision.
Shown in below slotted aloha.

• In Slotted Aloha, maximum throughput occurs at G = 1, which is 37%.


• In Slotted Aloha, the probability of successful transmission of the data frame: S=G*
e^-G
• In Slotted Aloha, vulnerable time is: Tfr

2. CSMA (Carrier Sense Multiple Access):

CSMA was developed to improve performance and minimize the chance of


collision. Each station is required to test the state of the medium before transmission.
In other words, CSMA is based on the principle “sense before transmit.” CSMA can
reduce the risk of collision, but it cannot remove it.
CSMA primary access mode:

• Persistent: The 1-persistent method is very easy and quick. In this method, after
the station finds the line empty, it immediately transmits its frame. The chances of
the collision are very high in this method because two or more stations immediately
transmit their frames as soon as the line is found empty.
• Non-Persistent: In the non-persistent method, if found the line is empty, it transmits
the frames immediately. If the line isn't clear, it waits for a random period and detects
the line again. This approach decreases the risk of a collision.
• P-Persistent: This method is a combination of 1-Persistent and Non-Persistent
advantages. The p-persistent approach decreases the risk of collision and increases
performance.
• In the P-Persistent approach, the following steps follow after the station finds the line-
empty:
1. With probability (p), the station transmits its frame.
2. With probability (q = 1 ? p), the station waits for the starting of the next time slot and
re-test the line.
3. If the line is empty, it goes to step 1.
4. If the line is not empty, it behaves as though a collision has happened, and it uses the
back-off process.

In later, CSMA is divided into two parallel methods: CSMA/CD and CSMA/CA. When a
collision is detected, CSMA/CD tells the station what to do, and CSMA/CA attempts to stop
a collision
CSMA/CD (Carrier Sense Multiple Access with Collision Detection)

•CSMA/CD is a carrier communication network protocol that operates in the Multiple


Access Control layer.
• In this approach, the station tracks the medium after transmitting a frame to see
whether the transmission was successful or not. If so, the station work is completed.
But, if there is a collision, the frame is re-sent.
CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance)

• CSMA/CA is used in wireless networks because CSMA cannot detect the collision, so
CSMA/CA is the only solution to collision avoidance.
• In CSMA/CA, Collisions are avoided by the use of three techniques:
1. Interframe space
2. Contention window
3. Acknowledgment

• Interframe space: If a station detects the idle channel, the station does not send the
frame immediately. It waits for a time period. That time period is called IFS time. IFS
is often used to describe the station's priority.
• Contention window: The contention window is the sum of time that is split into
slots. When a station is ready to send a frame, it can choose a random number of slots
as the Wait time. According to the binary exponential back-off strategy, the number
of slots in the window changes. There are shown in the figure below.
• Acknowledgment: Positive acknowledgment or time-out timer helps to guarantee a
successful transmission.
UNIT-III

NETWORK LAYER

Network Layer:

• The Network Layer is the third layer of the OSI model.


• It handles the service requests from the transport layer and further forwards the
service request to the data link layer.
• The network layer translates the logical addresses into physical addresses
• It determines the route from the source to the destination and also manages the traffic
problems such as switching, routing and controls the congestion of data packets.
The main role of the network layer is to move the packets from sending host to the receiving
host

The main functions performed by the network layer are:

Routing: When a packet reaches the router's input link, the router will move the packets to
the router's output link. For example, a packet from S1 to R1 must be forwarded to the next
router on the path to S2.

Logical Addressing: The data link layer implements the physical addressing and network
layer implements the logical addressing. Logical addressing is also used to distinguish
between source and destination system. The network layer adds a header to the packet which
includes the logical addresses of both the sender and the receiver.

Internetworking: This is the main role of the network layer that it provides the logical
connection between different types of networks.

Fragmentation: The fragmentation is a process of breaking the packets into the smallest
individual data units that travel through different networks.

Forwarding & Routing:

• In Network layer, a router is used to forward the packets. Every router has a
forwarding table. A router forwards a packet by examining a packet's header field and
then using the header field value to index into the forwarding table. The value stored
in the forwarding table corresponding to the header field value indicates the router's
outgoing interface link to which the packet is to be forwarded.

For example, the router with a header field value of 0111 arrives at a router, and then router
indexes this header value into the forwarding table that determines the output link interface is
2. The router forwards the packet to the interface 2. The routing algorithm determines the
values that are inserted in the forwarding table. The routing algorithm can be centralized or
decentralized.
Services Provided by the Network Layer:

Guaranteed delivery: This layer provides the service which guarantees that the packet will
arrive at its destination.

Guaranteed delivery with bounded delay: This service guarantees that the packet will be
delivered within a specified host-to-host delay bound.

In-Order packets: This service ensures that the packet arrives at the destination in the order
in which they are sent.

Guaranteed max jitter: This service ensures that the amount of time taken between two
successive transmissions at the sender is equal to the time between their receipt at the
destination.

Security services: The network layer provides security by using a session key between the
source and destination host. The network layer in the source host encrypts the payloads of
datagrams being sent to the destination host. The network layer in the destination host would
then decrypt the payload. In such a way, the network layer maintains the data integrity and
source authentication services.

SWITCHING:

• When a user accesses the internet or another computer network outside their
immediate location, messages are sent through the network of transmission media.
This technique of transferring the information from one computer network to another
network is known as switching.
• Switching in a computer network is achieved by using switches. A switch is a small
hardware device which is used to join multiple computers together with one local area
network (LAN).
• Network switches operate at layer 2 (Data link layer) in the OSI model.
• Switching is transparent to the user and does not require any configuration in the
home network.

• Switches are used to forward the packets based on MAC addresses.


• A Switch is used to transfer the data only to the device that has been addressed. It
verifies the destination address to route the packet appropriately.
• It is operated in full duplex mode.
• Packet collision is minimum as it directly communicates between source and
destination.
• It does not broadcast the message as it works with limited bandwidth.

Advantages of Switching:

• Switch increases the bandwidth of the network.


• It reduces the workload on individual PCs as it sends the information to only that
device which has been addressed.
• It increases the overall performance of the network by reducing the traffic on the
network.
• There will be less frame collision as switch creates the collision domain for each
connection.
Disadvantages of Switching:

• A Switch is more expensive than network bridges.


• A Switch cannot determine the network connectivity issues easily.
• Proper designing and configuration of the switch are required to handle multicast
packets.

Switching Modes:

• The layer 2 switches are used for transmitting the data on the data link layer, and it
also performs error checking on transmitted and received frames.
• The layer 2 switches forward the packets with the help of MAC address.
• Different modes are used for forwarding the packets known as Switching modes.
• In switching mode, Different parts of a frame are recognized. The frame consists of
several parts such as preamble, destination MAC address, source MAC address, user's
data, FCS.

There are three types of switching modes:


• Store-and-forward
• Cut-through
• Fragment-free
1.Store-and-forward:

• Store-and-forward is a technique in which the intermediate nodes store the received


frame and then check for errors before forwarding the packets to the next node.
• The layer 2 switch waits until the entire frame has received. On receiving the entire
frame, switch store the frame into the switch buffer memory. This process is known
as storing the frame.
• When the frame is stored, then the frame is checked for the errors. If any error found,
the message is discarded otherwise the message is forwarded to the next node. This
process is known as forwarding the frame.
• CRC (Cyclic Redundancy Check) technique is implemented that uses a number of bits
to check for the errors on the received frame.
• The store-and-forward technique ensures a high level of security as the destination
network will not be affected by the corrupted frames.
• Store-and-forward switches are highly reliable as it does not forward the collided
frames.

2.Cut-through Switching:

• Cut-through switching is a technique in which the switch forwards the packets after
the destination address has been identified without waiting for the entire frame to be
received.
• Once the frame is received, it checks the first six bytes of the frame following the
preamble, the switch checks the destination in the switching table to determine the
outgoing interface port, and forwards the frame to the destination.
• It has low latency rate as the switch does not wait for the entire frame to be received
before sending the packets to the destination.
• It has no error checking technique. Therefore, the errors can be sent with or without
errors to the receiver.
• A Cut-through switching technique has low wait time as it forwards the packets as
soon as it identifies the destination MAC address.
• In this technique, collision is not detected, if frames have collided will also be
forwarded

3.Fragment-free Switching:

• A Fragment-free switching is an advanced technique of the Cut-through Switching.


• A Fragment-free switching is a technique that reads atleast 64 bytes of a frame before
forwarding to the next node to provide the error-free transmission.
• It combines the speed of Cut-through Switching with the error checking functionality.
• This technique checks the 64 bytes of the ethernet frame where addressing
information is available.
A collision is detected within 64 bytes of the frame, the frames which are collided will not be
forwarded further

Switching techniques:

• In large networks, there can be multiple paths from sender to receiver. The switching
technique will decide the best route for data transmission.
• Switching technique is used to connect the systems for making one-to-one
communication.

Classification Of Switching Techniques:

Circuit Switching:

• Circuit switching is a switching technique that establishes a dedicated path between


sender and receiver.
• In the Circuit Switching Technique, once the connection is established then the
dedicated path will remain to exist until the connection is terminated.
• Circuit switching in a network operates in a similar way as the telephone works.
• A complete end-to-end path must exist before the communication takes place.
• In case of circuit switching technique, when any user wants to send the data, voice,
video, a request signal is sent to the receiver then the receiver sends back the
acknowledgment to ensure the availability of the dedicated path. After receiving the
acknowledgment, dedicated path transfers the data.
• Circuit switching is used in public telephone network. It is used for voice
transmission.
• Fixed data can be transferred at a time in circuit switching technology.
Message Switching:

• Message Switching is a switching technique in which a message is transferred as a


complete unit and routed through intermediate nodes at which it is stored and
forwarded.
• In Message Switching technique, there is no establishment of a dedicated path
between the sender and receiver.
• The destination address is appended to the message. Message Switching provides a
dynamic routing as the message is routed through the intermediate nodes based on the
information available in the message.
• Message switches are programmed in such a way so that they can provide the most
efficient routes.
• Each and every node stores the entire message and then forward it to the next node.
This type of network is known as store and forward network.
• Message switching treats each message as an independent entity.

Packet Switching:

• The packet switching is a switching technique in which the message is sent in one go,
but it is divided into smaller pieces, and they are sent individually.
• The message splits into smaller pieces known as packets and packets are given a
unique number to identify their order at the receiving end.
• Every packet contains some information in its headers such as source address,
destination address and sequence number.
• Packets will travel across the network, taking the shortest path as possible.
• All the packets are reassembled at the receiving end in correct order.
• If any packet is missing or corrupted, then the message will be sent to resend the
message.
• If the correct order of the packets is reached, then the acknowledgment message will
be sent
Network Layer: Logical Addressing:

• The IP address is a 32 bit long, and it provides us a maximum of 2 32 addersses. These


addresses are known as IPv4 addresses.
• The IP address is a 128 bit long, and it provides us a maximum of 2128 addresses.
These addresses are known as IPv6 addresses.

IPv4 Addresses (Internet Protocol version 4):

IPv4 address is a 32 bit long. IPv4 is a connectionless protocol that is used in packet-switch
layer networks, such as the internet. These addresses are specific and universal. In other
words, every address defines one and only one device on the internet. In IPv4, two devices
cannot have the same address at the same time
Address Space

• The address space is the overall number of addresses used by the protocol. If N bits
are used in the protocol, that means the number of addresses is 2 N.
• For example, 32 bits are used in the IPv4 address. Which means the address space of
IPv4 is 232 or 4,294,967,296.
Notation of IPv4

• There are two types of common notation: binary notation and dotted-decimal notation,
as shown in the figure below.

Note: Each byte is 8 bits, and each byte range is 0 to 255 in the dotted decimal notation.
Let take an example to better understand binary notation and dotted decimal notation.

Example 1. Change from the binary notation to dotted-decimal notation the following IPv4
addresses.
• 10000011 00010011 00001011 10000000
• 10001110 10000001 11000011 10000001
Solution
• 131.19.11.128
• 142.129.195.129

Example 2. Change from the dotted-decimal notation to binary notation the following IPv4
addresses.
1. 128.12.12.248
2. 192.128.1.250
Solution
• 10000000 00001100 00001100 00000111
• 11000000 10000000 00000001 11111010

Example 3. Find the mistakes in the following IPv4 addresses.


• 124.201.3.1.52
• 01.200.128.123
• 300.142.210.64
• 10110011.32.16.8
• -31.12.210.128
Solution
• No more than four numbers can be given.
• No leading zero is needed in the address (01).
• Each number must be equivalent to or below 255.
• The combination of binary notation and dotted-decimal notation is not permitted.
• Each number must be greater than 0.

Classful Addressing:

• The address space is split into five classes in the classful addressing: A, B, C, D, and
E. If the address is given in the binary notation, the first few bits describe the class. If
the address is given in the dotted-decimal notation, the first byte describes the class.
Both notation figures are shown below.

Example 1. Find the class of the following IPv4 addresses.


• 00001010 00110011 11001100 10101000
• 11101010 11000100 01010001 10101110
• 135.21.201.12
• 193.12.12.200
Solution
• This is the class A address because the first bit is 0.
• This is the class D address because of the first four bits are 1110.
• This is the class B address because the first byte is 135.
This is the class C address because the first byte is 193

Classless Addresses:

• Classless addresses were designed to prevent wastage of IP addresses. The block of


IPv4 addresses can be defined as a.b.c.d/n. where a.b.c.d represents the address, and n
represents the mask, such as 128.12.12.39/27.
• Some important points
• In the block, addresses must be continuous.
• In the block, the number of addresses must be a power of 2 (1,2,4,8,16...n).
• The first address must be divisible by the number of addresses.
• There are some important rules to find the first, last, and number of addresses in a
block. Those rules are given below.
• You can find the first address of the block by setting 0's to the rightmost 32-n bits.
• You can find the last address of the block by setting 1's to the rightmost 32-n bits.
• You can find the number of addresses in the block by using the formula 2 32-n

Example 1. Find the first address


• 195.16.17.30/28
• 128.12.11.68/26
Solution 1.
• The binary representation of the given address is 11000011 00010000 00010001
00011110.
• The rightmost 32 - 28 bits to 0's, get 11000011 00010000 00010001 00010000 or
195.16.17.16.
Solution 2.
• The binary representation of the given address is 10000000 00001100 00001011
01000100.
• The rightmost 32 - 26 bits to 0's, get 10000000 00001100 00001011 01000000 or
128.12.11.64.

Example 2. Find the last address


• 192.20.20.28/24
• 128.145.15.10/30
Solution 1.
• The binary representation of the given address is 11000000 00010100 00010100
00011100.
• The rightmost 32 - 24 bits to 1's, get 11000000 00010100 00010100 11111111 or
192.20.20.255.
Solution 2.
• The binary representation of the given address is 10000000 10010001 00001111
00001010.
• The rightmost 32 - 30 bits to 1's, get 10000000 10010001 00001111 00001011 or
128.145.15.11.

IPv6 (Internet Protocol version 6):

• It is the latest version of IPv4 and has better and enhanced functionality. IPv6 was
developed by the IETF (Internet-Engineering-Task-Force) in 1999. It is 128 bits long,
which has 2^128 address space, which is much more than IPv4. IPv6 is unique and
universally similar to the IPv4. In other words, every address defines only one device
on the internet.
Notation of IPv6

• IPv6 defines the hexadecimal colon notation, which 128 bits long. These bits are
divided into eight sections, which are shown below in the figure.
IPv6 Datagram Format:
Address Mapping:

Address Mapping: Internet is made of a combination of physical networks connected


together by internetworking devices such as routers. A logical address is an internetwork
address. A physical address is a local address. It is usually implemented in hardware (but not
always), so it is called a physical address. The physical address and the logical address are
two different identifiers. This address information can be achieved through static and
dynamic mapping

Static mapping: In static mapping, it creates a table that contains a logical address with a
physical address.

Dynamic mapping: When a machine knows one of two addresses (logical or physical)
through dynamic mapping, it may use this protocol to find the other one address. There are
designed two protocols for done dynamic mapping.
Address Resolution Protocol (ARP)
Reverse Address Resolution Protocol (RARP)

Address Resolution Protocol (ARP):

• It is a dynamic mapping protocol that is used to find out the physical address
associated with the logical address and then sent it to the data link layer. The working
of ARP is shown below in the figure.

• Firstly, the client broadcasts the ARP request packet to all the hosts in the network.
• In this ARP request packet, stores the logical address and physical address of the
client and the IP address of the receiver.
• Each host receives this ARP request packet, but only the one who is the authorized
host completes the ARP service.
• Finally, the authorized host sends the ARP response packet to the client in which its
physical address is stored.

Note: ARP request is broadcast, and ARP response is unicast.

ARP Packet Format:

Reverse Address Resolution Protocol (RARP):

• It is a dynamic mapping protocol that is the opposite of ARP. It is used to find out the
logical address of the machine associated with the physical address. The working of
RARP is shown below in the figure
• Firstly, the client broadcasts the RARP request packet to all the hosts in the network.
• The physical address of the client is stored in this RARP request packet.
• Each host receives this RARP request packet, but only the one who is the authorized
host completes the RARP service. This authorized host is called the RARP server.
• RARP server sends the RARP response packet to the client in which its logical
address is stored.
• RARP is not used nowadays, it was replaced by BOOTP (Bootstrap protocol), and
now BOOTP has been replaced by DHCP (dynamic host configuration protocol).

BOOTP:

• BOOTP stands for Bootstrap Protocol. It is a computer networking protocol that is


used to assign IP addresses to network devices in a network. In other words, it is an
internet protocol that is used by the client to obtain the IP address from the server. It
was defined in RFC 951 and 1084. It was designed to replace RARP (resource
address resolution protocol).

Working of BOOTP:

• When the Bootstrap protocol started by the client, it does not have an IP address.
Therefore, it broadcasts a message in the network, and Its MAC address is inside this
message. This message is called "BOOTP request," and takes this request by the
BOOTP server. The server then provides the following information in reply to the
client.
• It provides the IP address, subnet mask, and gateway address of the client.
• It also provides the IP address and hostname of the server.
• When the client receives the BOOTP server information, it configures and initializes
the TCP/IP protocol stack and then connects to the server that has the boot image. The
client loads this boot image and starts the operating system.

DHCP:

• DHCP stands for Dynamic Host Configuration Protocol. It is designed to provide the
static and dynamic address allocation that can be done manual or automatic. It was
designed to replace the BOOTP (Bootstrap Protocol)

FORWARDING ROUTING PROTOCOLS:

• Forwarding means to place the packet in its route to its destination. Forwarding
requires a host or a router to have a routing table. When a host has a packet to send or
when a router has received a packet to be forwarded, it looks at this table to find the
route to the final destination.

Unicast Routing Protocol:

• Unicast Routing Protocol: Unicast is a point to point communication arrangement


that only occurs between the sender and receiver.
• Routing Information Protocol
• RIP is an open standard protocol that can work with any company's router. RIP is a
classful routing protocol; therefore, it does not support VLSM (variable length subnet
mask).
• The RIP is a distance-vector protocol. It is used in small networks. In this, the hop
count is used as a matrix to determine the most appropriate path (s). So that data
packets may reach the destination from that path. In this protocol, the maximum
number of hops count can only be up to 15. The hop count 16 is considered infinite.
The hop count 16 is used to indicate networks that cannot be accessed.

Note: It uses UDP port 250 for the routings table updates.

Distance Vector Routing:

• Let take an example to understand the distance-vector routing protocol better.


In this example, is a network consisting of four routers A, B, C, and D. The weights are
shown in the edges. And the weights could be distances or costs or delays
EXAMPLE:

• Step 1: Every router prepares its routing table using its information. Every table of the
router is shown below.
• At Router A

Destination Distance Next Hop


A 0 A
B 2 B

C 8 C

D 1 D

• At Router B

Destination Distance Next Hop


A 2 A
B 0 B

C 5 C
D Infinite -

• At Router C

Destination Distance Next Hop


A 8 A

B 5 B
C 0 C
D 3 D
• At Router D
Destination Distance Next Hop
A 1 A
B Infinite -

C 3 C

D 0 D

• Step 2:
• Every router shares its distance vector with its neighbors obtained in Step-01.
• Every router prepares a new routing table after exchanging of distance vectors.
At Router A new table

• Cost (A -- B) = 2 Cost (A -- C) = 8 Cost (A -- D) = 1


• Cost of reaching destination
• B from router A = min {2+0, 8+5, 1+?} = 2 via B.
• C from router A = min {2+5, 8+0, 1+3} = 4 via C.
D from router A = min {2+?, 8+3, 1+0} = 1 via D

Destination Distance Next Hop


A 0 A
B 2 B

C 4 D

D 1 D

• At Router B new table:


• Cost (B -- A) = 2 Cost (B -- C) = 5
• Cost of reaching destination
• A from router B = min {2+0, 5+8} = 2 via A.
• C from router B = min {2+8, 5+0} = 5 via C.
• D from router B = min {2+1, 5+3} = 3 via D.
Destination Distance Next Hop
A 2 A
B 0 B

C 5 C

D 3 A

At Router C new table:

• Cost (C -- A) = 8 Cost (C -- B) = 5 Cost (C -- D) = 3


• Cost of reaching destination
• A from router C = min {8+0, 5+2, 3+1} = 4 via A.
• B from router C = min {8+2, 5+0, 3+?} = 5 via B.
• D from router C = min {8+1, 5+?, 3+0} = 3 via D.

Destination Distance Next Hop


A 4 D
B 5 B

C 0 C
D 3 A

At Router D new table:


• Cost (D -- A) = 1 Cost (D -- C) = 3
• Cost of reaching destination
• A from router D = min {1+0, 3+8} = 1 via A.
• B from router D = min {1+2, 3+5} = 3 via B.
C from router D = min {1+8, 3+0} = 3 via

Destination Distance Next Hop


A 1 A
B 3 A

C 3 C
D 0 D

Final routing tables of every router


UNIT-IV

TRANSPORT LAYER

Transport layer:

o Transport Layer is the second layer in the TCP/IP model and the fourth layer in
the OSI model. It is an end-to-end layer used to deliver messages to a host. It is
termed an end-to-end layer because it provides a point-to-point connection rather
than hop-to- hop, between the source host and destination host to deliver the services
reliably. The unit of data encapsulation in the Transport Layer is a segment.
o Working of Transport Layer:
o The transport layer takes services from the Network layer and provides services to
the Application layer
o At the sender’s side: The transport layer receives data (message) from the Application
layer and then performs Segmentation, divides the actual message into segments, adds
source and destination’s port numbers into the header of the segment, and transfers
the message to the Network layer.
o At the receiver’s side: The transport layer receives data from the Network layer,
reassembles the segmented data, reads its header, identifies the port number, and
forwards the message to the appropriate port in the Application layer.

o The transport layer is represented by two protocols: TCP and UDP.


o The IP protocol in the network layer delivers a datagram from a source host to the
destination host.
o Nowadays, the operating system supports multiuser and multiprocessing
environments, an executing program is called a process. When a host sends a
message to other host means that source process is sending a process to a
destination process. The transport layer protocols define some connections to
individual ports known as protocol ports.
o An IP protocol is a host-to-host protocol used to deliver a packet from source host
to the destination host while transport layer protocols are port-to-port protocols
that work on the top of the IP protocols to deliver the packet from the originating
port to the IP services, and from IP services to the destination port.
o Each port is defined by a positive integer address, and it is of 16 bits.
Transport Layer: Process to Process Communication:

Process to process delivery:


 While Data Link Layer requires the MAC address (48 bits address contained inside
the Network Interface Card of every host machine) of source-destination hosts to
correctly deliver a frame and the Network layer requires the IP address for appropriate
routing of packets, in a similar way Transport Layer requires a Port number to
correctly deliver the segments of data to the correct process amongst the multiple
processes running on a particular host. A port number is a 16-bit address used to
identify any client-server program uniquely.

End-to-end Connection between hosts:


 The transport layer is also responsible for creating the end-to-end Connection between
hosts for which it mainly uses TCP and UDP. TCP is a secure, connection-orientated
protocol that uses a handshake protocol to establish a robust connection between two
end hosts. TCP ensures reliable delivery of messages and is used in various
applications. UDP, on the other hand, is a stateless and unreliable protocol that
ensures best-effort delivery. It is suitable for applications that have little concern with
flow or error control and requires sending the bulk of data like video conferencing. It
is often used in multicasting protocols.

Multiplexing and Demultiplexing:


 Multiplexing allows simultaneous use of different applications over a network that is
running on a host. The transport layer provides this mechanism which enables us to
send packet streams from various applications simultaneously over a network. The
transport layer accepts these packets from different processes differentiated by their
port numbers and passes them to the network layer after adding proper headers.
Similarly, Demultiplexing is required at the receiver side to obtain the data coming
from various processes. Transport receives the segments of data from the network
layer and delivers it to the appropriate process running on the receiver’s machine.

 Congestion Control:
 Congestion is a situation in which too many sources over a network attempt to send
data and the router buffers start overflowing due to which loss of packets occur. As a
result retransmission of packets from the sources increases the congestion further. In
this situation, the Transport layer provides Congestion Control in different ways. It
uses open loop congestion control to prevent the congestion and closed-loop
congestion control to remove the congestion in a network once it occurred. TCP
provides AIMD- additive increase multiplicative decrease, leaky bucket technique for
congestion control.

Data integrity and Error correction:


 The transport layer checks for errors in the messages coming from the application
layer by using error detection codes, computing checksums, it checks whether the
received data is not corrupted and uses the ACK and NACK services to inform the
sender if the data has arrived or not and checks for the integrity of data.

Flow control:
 The transport layer provides a flow control mechanism between the adjacent layers of
the TCP/IP model. TCP also prevents data loss due to a fast sender and slow receiver
by imposing some flow control techniques. It uses the method of sliding window
protocol which is accomplished by the receiver by sending a window back to the
sender informing the size of data it can receive.

Transport Layer protocols:

The transport layer is represented by two protocols: TCP and UDP.

 UDP(User Datagram Protocol):

UDP:
o UDP stands for User Datagram Protocol.
o UDP is a simple protocol and it provides nonsequenced transport functionality.
o UDP is a connectionless protocol.
o This type of protocol is used when reliability and security are less important than speed
and size.
o UDP is an end-to-end transport level protocol that adds transport-level addresses,
checksum error control, and length information to the data from the upper layer.
o The packet produced by the UDP protocol is known as a user datagram.

User Datagram Format:

The user datagram has a 16-byte header which is shown below:


Where,

o Source port address: It defines the address of the application process that has
delivered a message. The source port address is of 16 bits address.
o Destination port address: It defines the address of the application process that
will receive the message. The destination port address is of a 16-bit address.
o Total length: It defines the total length of the user datagram in bytes. It is a 16-bit
field.
o Checksum: The checksum is a 16-bit field which is used in error detection.

Disadvantages of UDP protocol

o UDP provides basic functions needed for the end-to-end delivery of a transmission.
o It does not provide any sequencing or reordering functions and does not specify the
damaged packet when reporting an error.
o UDP can discover that an error has occurred, but it does not specify which packet has been
lost as it does not contain an ID or sequencing number of a particular data segment.

TCP: Transmission Control Protocol


o TCP stands for Transmission Control Protocol.
o It provides full transport layer services to applications.
o It is a connection-oriented protocol means the connection established between both the
ends of the transmission. For creating the connection, TCP generates a virtual circuit
between sender and receiver for the duration of a transmission.
Features Of TCP protocol:
o Stream data transfer: TCP protocol transfers the data in the form of contiguous stream
of bytes. TCP group the bytes in the form of TCP segments and then passed it to the IP
layer for transmission to the destination. TCP itself segments the data and forward to the
IP.
o Reliability: TCP assigns a sequence number to each byte transmitted and expects a
positive acknowledgement from the receiving TCP. If ACK is not received within a timeout
interval, then the data is retransmitted to the destination.
The receiving TCP uses the sequence number to reassemble the segments if they arrive
out of order or to eliminate the duplicate segments.
o Flow Control: When receiving TCP sends an acknowledgement back to the sender
indicating the number the bytes it can receive without overflowing its internal buffer. The
number of bytes is sent in ACK in the form of the highest sequence number that it can
receive without any problem. This mechanism is also referred to as a window mechanism.
o Multiplexing: Multiplexing is a process of accepting the data from different applications
and forwarding to the different applications on different computers. At the receiving end,
the data is forwarded to the correct application. This process is known as demultiplexing.
TCP transmits the packet to the correct application by using the logical channels known
as ports.
o Logical Connections: The combination of sockets, sequence numbers, and window sizes,
is called a logical connection. Each connection is identified by the pair of sockets used by
sending and receiving processes.
o Full Duplex: TCP provides Full Duplex service, i.e., the data flow in both the directions at
the same time. To achieve Full Duplex service, each TCP should have sending and
receiving buffers so that the segments can flow in both the directions. TCP is a connection-
oriented protocol. Suppose the process A wants to send and receive the data from process
B. The following steps occur:
o Establish a connection between two TCPs.
o Data is exchanged in both the directions.
o The Connection is terminated.

TCP Segment Format:


Where,

o Source port address: It is used to define the address of the application program
in a source computer. It is a 16-bit field.
o Destination port address: It is used to define the address of the application
program in a destination computer. It is a 16-bit field.
o Sequence number: A stream of data is divided into two or more TCP segments.
The 32-bit sequence number field represents the position of the data in an original
data stream.
o Acknowledgement number: A 32-field acknowledgement number acknowledge
the data from other communicating devices. If ACK field is set to 1, then it specifies
the sequence number that the receiver is expecting to receive.
o Header Length (HLEN): It specifies the size of the TCP header in 32-bit words.
The minimum size of the header is 5 words, and the maximum size of the header
is 15 words. Therefore, the maximum size of the TCP header is 60 bytes, and the
minimum size of the TCP header is 20 bytes.
o Reserved: It is a six-bit field which is reserved for future use.
o Control bits: Each bit of a control field functions individually and independently.
A control bit defines the use of a segment or serves as a validity check for other
fields.

There are total six types of flags in control field:


o URG: The URG field indicates that the data in a segment is urgent.
o ACK: When ACK field is set, then it validates the acknowledgement number.
o PSH: The PSH field is used to inform the sender that higher throughput is needed so if
possible, data must be pushed with higher throughput.
o RST: The reset bit is used to reset the TCP connection when there is any confusion occurs
in the sequence numbers.
o SYN: The SYN field is used to synchronize the sequence numbers in three types of
segments: connection request, connection confirmation ( with the ACK bit set ), and
confirmation acknowledgement.
o FIN: The FIN field is used to inform the receiving TCP module that the sender has finished
sending data. It is used in connection termination in three types of segments: termination
request, termination confirmation, and acknowledgement of termination confirmation.
o Window Size: The window is a 16-bit field that defines the size of the window.
o Checksum: The checksum is a 16-bit field used in error detection.
o Urgent pointer: If URG flag is set to 1, then this 16-bit field is an offset from the
sequence number indicating that it is a last urgent data byte.
o Options and padding: It defines the optional fields that convey the additional
information to the receiver.

SCTP Congestion Control; Quality of Service:

o SCTP stands for Stream Control Transmission Protocol.


o It is a connection- oriented protocol in computer networks which provides a full-duplex
association i.e., transmitting multiple streams of data between two end points at the same time
that have established a connection in network. It is sometimes referred to as next generation
TCP or TCPng, SCTP makes it easier to support telephonic conversation on Internet. A
telephonic conversation requires transmitting of voice along with other data at the same time
on both ends, SCTP protocol makes it easier to establish reliable connection.
o SCTP is also intended to make it easier to establish connection over wireless network and
managing transmission of multimedia data. SCTP is a standard protocol (RFC 2960) and is
developed by Internet Engineering Task Force (IETF).

Features of SCTP:

o There are various features of SCTP, which are as follows −


o Transmission Sequence Number
o The unit of data in TCP is a byte. Data transfer in TCP is controlled by numbering bytes by
using a sequence number. On the other hand, the unit of data in SCTP is a DATA chunk that
may or may not have a one-to-one relationship with the message coming from the process
because of fragmentation.
o Stream Identifier
o In TCP, there is only one stream in each connection. In SCTP, there may be several streams
in each association. Each stream in SCTP needs to be identified by using a stream identifier
(SI). Each data chunk must carry the SI in its header so that when it arrives at the destination,
it can be properly placed in its stream. The 51 is a 16-bit number starting from O.
o Stream Sequence Number
o When a data chunk arrives at the destination SCTP, it is delivered to the appropriate stream
and in the proper order. This means that, in addition to an SI, SCTP defines each data chunk
in each stream with a stream sequence number (SSN).

Packets
o In TCP, a segment carries data and control information. Data is carried as a collection of
bytes; control information is defined by six control flags in the header. The design of SCTP is
totally different: data is carried as data chunks; control information is carried as control
chunks.

Flow Control
o Like TCP, SCTP implements flow control to avoid overwhelming the receiver.
o Error Control
o Like TCP, SCTP implements error control to provide reliability. TSN numbers and
acknowledgement numbers are used for error control.

Congestion Control
o Like TCP, SCTP implements congestion control to determine how many data chunks can be
injected into the network.

QoS improving techniques: Leaky Bucket and Token Bucket algorithm.:

 Leaky Bucket Algorithm:


 Let see the working condition of Leaky Bucket Algorithm −

 Leaky Bucket Algorithm mainly controls the total amount and the rate of the traffic
sent to the network.
 Step 1 − Let us imagine a bucket with a small hole at the bottom where the rate at
which water is poured into the bucket is not constant and can vary but it leaks from
the bucket at a constant rate.
 Step 2 − So (up to water is present in the bucket), the rate at which the water leaks
does not depend on the rate at which the water is input to the bucket.
 Step 3 − If the bucket is full, additional water that enters into the bucket that spills
over the sides and is lost.
 Step 4 − Thus the same concept applied to packets in the network. Consider that data
is coming from the source at variable speeds. Suppose that a source sends data at 10
Mbps for 4 seconds. Then there is no data for 3 seconds. The source again transmits
data at a rate of 8 Mbps for 2 seconds. Thus, in a time span of 8 seconds, 68 Mb data
has been transmitted.
 That’s why if a leaky bucket algorithm is used, the data flow would be 8 Mbps for 9
seconds. Thus, the constant flow is maintained.

Token bucket algorithm:

 Token bucket algorithm is one of the techniques for congestion control


algorithms. When too many packets are present in the network it causes packet delay
and loss of packet which degrades the performance of the system. This situation is
called congestion.
 The network layer and transport layer share the responsibility for handling
congestions. One of the most effective ways to control congestion is trying to reduce
the load that transport layer is placing on the network. To maintain this network and
transport layers have to work together.

 The leaky bucket algorithm enforces output patterns at the average rate, no matter
how busy the traffic is. So, to deal with the more traffic, we need a flexible algorithm
so that the data is not lost. One such approach is the token bucket algorithm.
 Let us understand this algorithm step wise as given below −
• Step 1 − In regular intervals tokens are thrown into the bucket f.
• Step 2 − The bucket has a maximum capacity f.
• Step 3 − If the packet is ready, then a token is removed from the bucket, and the
packet is sent.
• Step 4 − Suppose, if there is no token in the bucket, the packet cannot be sent.
UNIT-V

APPLICATION LAYER

Application Layer:

• The application layer in the OSI model is the closest layer to the end user which
means that the application layer and end user can interact directly with the software
application.

The application layer programs are based on client and servers

Application layer is the top most layer in OSI and TCP/IP layered model. This layer exists in
both layered Models because of its significance, of interacting with user and user applications.
This layer is for applications which are involved in communication system.
A user may or may not directly interacts with the applications. Application layer is where the
actual communication is initiated and reflects. Because this layer is on the top of the layer stack,
it does not serve any other layers. Application layer takes the help of Transport and all layers
below it to communicate or transfer its data to the remote host.
When an application layer protocol wants to communicate with its peer application layer
protocol on remote host, it hands over the data or information to the Transport layer. The
transport layer does the rest with the help of all the layers below it

There’is an ambiguity in understanding Application Layer and its protocol. Not every user
application can be put into Application Layer. except those applications which interact with
the communication system. For example, designing software or text-editor cannot be
considered as application layer programs.
On the other hand, when we use a Web Browser, which is actually using Hyper Text Transfer
Protocol (HTTP) to interact with the network. HTTP is Application Layer protocol.
Another example is File Transfer Protocol, which helps a user to transfer text based or binary
files across the network. A user can use this protocol in either GUI based software like FileZilla
or CuteFTP and the same user can use FTP in Command Line mode.
Hence, irrespective of which software you use, it is the protocol which is considered at
Application Layer used by that software. DNS is a protocol which helps user application
protocols such as HTTP to accomplish its work.

Two remote application processes can communicate mainly in two different fashions:
 Peer-to-peer: Both remote processes are executing at same level and they
exchange data using some shared resource.
 Client-Server: One remote process acts as a Client and requests some resource
from another application process acting as Server.
In client-server model, any process can act as Server or Client. It is not the type of machine,
size of the machine, or its computing power which makes it server; it is the ability of serving
request that makes a machine a server.

Domain Name Space (DNS):

• DNS stands for Domain Name System.


• DNS is a directory service that provides a mapping between the name of a host on the
network and its numerical address.
• DNS is required for the functioning of the internet.
• Each node in a tree has a domain name, and a full domain name is a sequence of
symbols specified by dots.
• DNS is a service that translates the domain name into IP addresses. This allows the
users of networks to utilize user-friendly names when looking for other hosts instead
of remembering the IP addresses.
• For example, suppose the FTP site at EduSoft had an IP address of 132.147.165.50,
most people would reach this site by specifying ftp.EduSoft.com. Therefore, the
domain name is more reliable than IP address.

DNS is a TCP/IP protocol used on different platforms. The domain name space is divided
into three different sections: generic domains, country domains, and inverse domain.

DDNS:

 The Dynamic Domain Name System (DDNS) is a protocol that provides DNS
extensions that allow DNS servers to accept requests to dynamically add, update, and
delete entries in the DNS database.
• A DDNS server can serve both static and dynamic domains at the same time, since
DDNS is a functional superset of existing DNS servers.
• Rather than allowing any server to change its DNS records, the secure version of
DDNS authenticates update requests from DDNS hosts using critical public security
and digital signatures.
• Dynamic DNS was created to address the problem of frequent IP changes. For
example, when you search for a domain name, you'll get a dynamic IP address
mapped to that domain. The Internet Service Provider (ISP) provides this dynamic IP
address.
• When the same domain is searched again later, the ISP may be given a different IP
address from the IP address pool, resulting in a different IP address being returned.
• When the IP address changes, the DDNS system refreshes the DNS database, which is
always up to date with the domain-IP mapping. The outside world will be able to
access the domain name at all times without having to worry about IP changes.

Advantages :
1. It saves time required by static addresses updates manually when
network configuration changes.
2. It saves space as the number of addresses are used as required at one
time rather than using one for all the possible users of the IP address.
3. It is very comfortable for users point of view as any IP address
changes will not affect any of their activities.
4. It does not affect accessibility as changed IP addresses are configured
automatically against URL’s.

Disadvantages :

1. t is less reliable due to lack of static IP addresses and domain name


mappings.
2. Dynamic DNS services alone can not make any guarantee about the
device you are attempting to connect is actually your own.
Uses :
1. It is used for Internet access devices such as routers.
2. It is used for security appliance manufacturers and even required for
IP-based security appliances like DVRs.

TELNET(Terminal Network):

• The main task of the internet is to provide services to users. For example,
users want to run different application programs at the remote site and
transfers a result to the local site. This requires a client-server program
such as FTP, SMTP. But this would not allow us to create a specific
program for each demand.
• The better solution is to provide a general client-server program that lets
the user access any application program on a remote computer.
Therefore, a program that allows a user to log on to a remote computer. A
popular client-server program Telnet is used to meet such demands.
Telnet is an abbreviation for Terminal Network.
• Telnet provides a connection to the remote computer in such a way that a
local terminal appears to be at the remote side.

There are two types of login:

i) Local Login

o When a user logs into a local computer, then it is known as local login.
o When the workstation running terminal emulator, the keystrokes entered by the
user are accepted by the terminal driver. The terminal driver then passes these
characters to the operating system which in turn, invokes the desired application
program.
o However, the operating system has special meaning to special characters. For
example, in UNIX some combination of characters have special meanings such as
control character with "z" means suspend. Such situations do not create any
problem as the terminal driver knows the meaning of such characters. But, it can
cause the problems in remote login.

2) Remote Login

• When the user wants to access an application program on a remote


computer, then the user must perform remote login.

How remote login occurs


At the local site

The user sends the keystrokes to the terminal driver, the characters are then sent
to the TELNET client. The TELNET client which in turn, transforms the characters
to a universal character set known as network virtual terminal characters and
delivers them to the local TCP/IP stack

At the remote site

The commands in NVT forms are transmitted to the TCP/IP at the remote machine.
Here, the characters are delivered to the operating system and then pass to the
TELNET server. The TELNET server transforms the characters which can be
understandable by a remote computer. However, the characters cannot be directly
passed to the operating system as a remote operating system does not receive the
characters from the TELNET server. Therefore it requires some piece of software
that can accept the characters from the TELNET server. The operating system then
passes these characters to the appropriate application program.

Network Virtual Terminal (NVT):

o The network virtual terminal is an interface that defines how data and commands
are sent across the network.
o In today's world, systems are heterogeneous. For example, the operating system
accepts a special combination of characters such as end-of-file token running a
DOS operating system ctrl+z while the token running a UNIX operating system
is ctrl+d.
o TELNET solves this issue by defining a universal interface known as network
virtual interface.
o The TELNET client translates the characters that come from the local terminal into
NVT form and then delivers them to the network. The Telnet server then
translates the data from NVT form into a form which can be understandable by a
remote computer.

EMAIL:

• Electronic Mail (e-mail) is one of most widely used services of Internet. This service allows
an Internet user to send a message in formatted manner (mail) to the other Internet user in any
part of world. Message in mail not only contain text, but it also contains images, audio and
videos data. The person who is sending mail is called sender and person who receives mail is
called recipient. It is just like postal mail service.
Components of E-Mail System : The basic components of an email system are : User Agent (UA),
Message Transfer Agent (MTA), Mail Box, and Spool file

File Transfer Protocol (FTP):

• FTP stands for File transfer protocol.


• FTP is a standard internet protocol provided by TCP/IP used for transmitting the files
from one host to another.
• It is mainly used for transferring the web page files from their creator to the computer
that acts as a server for other computers on the internet.
• It is also used for downloading the files to computer from other servers.

Objectives of FTP
• It provides the sharing of files.
• It is used to encourage the use of remote computers.
• It transfers the data more reliably and efficiently.

Mechanism of FTP:

There are two types of connections in FTP:


FTP CONNECTIONS:

• Control Connection: The control connection uses very simple rules for
communication. Through control connection, we can transfer a line of command or
line of response at a time. The control connection is made between the control
processes. The control connection remains connected during the entire interactive
FTP session.
• Data Connection: The Data Connection uses very complex rules as data types may
vary. The data connection is made between data transfer processes. The data
connection opens when a command comes for transferring the files and closes when
the file is transferred.

WWW, HTTP:

 World Wide Web(WWW), which is also known as a Web, is a collection of websites


or web pages stored in web servers and connected to local computers through the
internet. These websites contain text pages, digital images, audios, videos, etc. Users
can access the content of these sites from any part of the world over the internet using
their devices such as computers, laptops, cell phones, etc. The WWW, along with
internet, enables the retrieval and display of text and media to your device.

 HTTP represents "Hypertext Transfer Protocol." HTTP is the protocol that can
transfer information over the network. It is the Internet protocol suite method and
defines commands and functions used for sharing web page data.
 HTTP uses a server-client model. A client, for example, maybe a laptop or telephone
device. The HTTP server is frequently a web host running web server software, such
as Apache or IIS.
 HTTP also represents commands such as GET and POST, which are used to handle
submissions on websites. The CONNECT command can act as a fast connection that
is encrypted using a secure socket layer (SSL).
SNMP:

• SNMP stands for Simple Network Management Protocol.


• SNMP is a framework used for managing devices on the internet.
• It provides a set of operations for monitoring and managing the internet.

• SNMP has two components Manager and agent.


• The manager is a host that controls and monitors a set of agents such as routers.
• It is an application layer protocol in which a few manager stations can handle a set of
agents.
• The protocol designed at the application level can monitor the devices made by
different manufacturers and installed on different physical networks.

Bluetooth:

• Bluetooth technology is a high speed and low powered wireless technology designed
to connect phones or other portable equipment for communication or file
transmissions.
• This is based on mobile computing technology.

FIREWALL:

 A firewall can be defined as a special type of network security device or a software


program that monitors and filters incoming and outgoing network traffic based on a
defined set of security rules. It acts as a barrier between internal private networks and
external sources (such as the public Internet).

 The primary purpose of a firewall is to allow non-threatening traffic and prevent


malicious or unwanted data traffic for protecting the computer from viruses and
attacks. A firewall is a cybersecurity tool that filters network traffic and helps users
block malicious software from accessing the Internet in infected computers.
Basic concepts of Cryptography:

Cryptography refers to the science and art of transforming messages to make them secure and
immune to attacks. It is a method of storing and transmitting data in a particular form so that
only those for whom it is intended can read and process it. Cryptography not only protects
data from theft or alteration but can also be used for user authentication

• COMPONENTS : There are various components of cryptography which are as


follows-

 Plaintext and Ciphertext:

 The original message, before being transformed, is called plaintext. After the message
is transformed, it is called ciphertext. An encryption algorithm transforms the
plaintext into ciphertext; a decryption algorithm transforms the ciphertext back into
plaintext
The sender uses an encryption algorithm, and the receiver uses a decryption algorithm

 Cipher:
 We refer to encryption and decryption algorithms as ciphers. The term cipher is also
used to refer to different categories of algorithms in cryptography. This is not to say
that every sender-receiver pair needs their very own unique cipher for secure
communication. On the contrary, one cipher can serve millions of communicating
pairs.
 Key:
 A key is a number (or a set of numbers) that the cipher, as an algorithm, operates on.
To encrypt a message, we need an encryption algorithm, an encryption key, and
plaintext. These create the ciphertext. To decrypt a message, we need a decryption
algorithm, a decryption key, and the ciphertext. These reveal the original plaintext.
Types of cryptography:

 There are two types of cryptography which are as follows −

 Symmetric Key Cryptography : In symmetric-key cryptography, the same key is used


by both parties. The sender uses this key and an encryption algorithm to encrypt data;
the receiver uses the same key and the corresponding decryption algorithm to decrypt
the data.

 Asymmetric-Key Cryptography: In asymmetric or public-key cryptography, there are


two keys: a private key and a public key. The private key is kept by the receiver. The
public key is announced to the public.

You might also like