0% found this document useful (0 votes)
9 views155 pages

Computer Networks Notes (1)

The document provides a comprehensive overview of computer networks, detailing the components, layers, and types of data communication. It covers the OSI model, various network topologies, protocols, and the distinctions between LAN, MAN, and WAN. Additionally, it discusses the advantages and disadvantages of each network type, as well as the roles of different network devices such as servers, clients, routers, and switches.
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)
9 views155 pages

Computer Networks Notes (1)

The document provides a comprehensive overview of computer networks, detailing the components, layers, and types of data communication. It covers the OSI model, various network topologies, protocols, and the distinctions between LAN, MAN, and WAN. Additionally, it discusses the advantages and disadvantages of each network type, as well as the roles of different network devices such as servers, clients, routers, and switches.
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/ 155

2050511-COMPUTER NETWORKS

UNIT – I Data Communications: Components – Direction of Data flow – Networks –


Components and Categories – Types of Connections – Topologies –Protocols and Standards
– ISO / OSI model,
Physical layer: Transmission modes, Multiplexing, Transmission Media, Switching, Circuit
Switched Networks, Datagram Networks, and Virtual Circuit Networks.

UNIT –II Data link layer: Introduction, Framing, and Error – Detection and Correction –
Parity – LRC CRC Hamming code, Flow and Error Control, Noiseless Channels, Noisy
Channels, HDLC, Point to Point Protocols. 111 Medium Access sub layer: ALOHA,
CSMA/CD, LAN Ethernet IEEE 802.3, IEEE 802.5 – IEEE 802.11, Random access,
Controlled access, Channelization.

UNIT -III Network layer: Logical Addressing, Internetworking, Tunneling, Address


mapping, ICMP, IGMP, Forwarding, Routing Protocols: Distance Vector Routing, Link state
Routing, Path vector Routing.

UNIT – IV Transport Layer: Process to Process Delivery, UDP, TCP: TCP Segments, TCP
Connection, TCP sliding window, Data Traffic, Congestion, Congestion Control, QoS, QoS
in Switched Networks.

UNIT – V Application Layer: Domain name space, DNS in internet, electronic mail, SMTP,
FTP, WWW, HTTP, SNMP.
DATA:It is defined as an information in digital form that can be transmitted (or) processed, the data
may be in any format such as text, images, symbols, video & signals and so on…
COMMUNICATION: Communication is referred to as exchanging information from one entity to
another entity in a meaningful way.
DATA COMMUNICATION: From the above 2 references we understand that data communication is
a process of exchanging data between 2 devices through a communication medium in a meaningful
way.

UNIT – I

Components Of A Data Communication:


A data communications system has five components.

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


forms ofinformation 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.

DIRECTION OF DATA FLOW/ DIRECTION OF COMMUNICATIONS:


Direction of data flow are broadly categorised into 3 types
i) simplex made/ communication
ii) Half – Duplex
iii) Full Duplex.
Simplex:
In simplex mode, the communication is unidirectional, as on a one-way street. Only
one of the two devices on a link can transmit; the other can only receive (see Figure
a). Keyboards and traditional monitors are examples of simplex devices. The
keyboard can only introduce input; the monitor can only accept output. The simplex
mode can use the entire capacity of the channel to send data in one direction.
Half-Duplex:
In half-duplex mode, each station can both transmit and receive, but not at the same
time. When one device is sending, the other can only receive, and vice versa The half-
duplex mode is like a one-lane road with traffic allowed in both directions.
When cars are traveling in one direction, cars going the other way must wait. In a half-
duplex transmission, the entire capacity of a channel is taken over by whichever of the two
devices is transmitting at the time. Walkie-talkies and CB (citizens band) radios are both
half-duplex systems.
The half-duplex mode is used in cases where there is no need for communication in both
directions at the same time; the entire capacity of the channel can be utilized for each
direction.
Full-Duplex:
In full-duplex both stations can transmit and receive simultaneously (see Figure c).
The full-duplex mode is like a tW<D-way street with traffic flowing in both directions at
the same time. In full-duplex mode, si~nals going in one direction share the capacity of the
link: with signals going in the other din~c~on. This sharing can occur in two ways: Either
the link must contain two physically separate t:nmsmissiIDn paths, one for sending and the
other for receiving;or the capacity of the ch:arillilel is divided between signals traveling in
both directions. One common example of full-duplex communication is the telephone
network. When two people are communicating by a telephone line, both can talk and listen
at the same time. The full-duplex mode is used when communication in both directions is
required all the time. The capacity of the channel, however, must be divided between the
two directions.

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.
Components of Computer Network

1. Server

A server is a computer that serves the data to other computers and users. The network
components can be in the form of a computer, a hardware device, or a computer program
that is loaded so that it can send data and any information to other computers.

The term “server” usually refers to a computer system that receives a request for a web
document and sends the request information to the client.

2. Client

The device that receives requests, and responses from the server, is called a client. When
the server and its clients work together on the computer, we call it the client/server
network.

3. Transmission media

Transmission media are the medium through which data is transferred from one device to
another in a network. Transmission media can be used either in a physical transmission
medium or wireless transmission medium.

Physical transmission medium includes the use of wires and cables like fiber optic cables,
coaxial cable, etc; and wireless transmission medium includes the use of unguided media like
infra-red waves, electromagnetic, microwaves, etc.

4. Hub

A hub is a device that splits a network connection among multiple computers. It works
similarly to a distribution center. When a computer requests information from one network or
from a specific computer, then it sends the request to the hub through a cable. The hub then
receives that request and transmits it to the entire network.

After that, every computer checks whether that network then belongs to them or not. If
belongs then it broadcasts if the request doesn’t belong it will be dropped.

However, such network components nowadays are very less in circulation and being replaced
by more advanced communication devices such as Routers and Switches. This hub is
basically a multiport repeater.

This hub is used to connect multiple connections that come from different branches, For
example, the connector in star topology is used to connect different stations for data access.
5. Switch

The switch is a component that helps devices to connect the networks so that they can
transfer data to other connected devices. These network switches are identical to network
hubs, but a switch has more advanced features than a hub. It doesn’t broadcast entire data on
the network like a hub.

The advanced features of the switch imply that the network switch first inspects the incoming
packet and determines its source, destination address, and routes after that sends the data at
the correct destination accordingly to that packet. A network switch is also called the
Switching hub, Bridging hub, and MAC bridge.

6. Router

The router is a hardware network component. Routers operate at the network layer of the OSI
(Open system interconnection) reference model, using them to send packets over the network
using a logical address.

Any data which travels from one network to another network as a Packet. The Router
receives such Packet data and forwards it to the Destination Device after analyzing hidden
information in the Data Packet. This Networking Device is used to connect different
networks either it is wired or wireless.

These networks are mainly seen in the house as Wi–Fi from which anyone can access the
Internet.

7. Repeater

A repeater is a powerful network component that is used to regenerate signals. With this, the
signal is fixed for a long time, so that the strength of the signal remains stable.

Repeater takes data signals from the communication medium and amplifies them and sends
them back to the communication medium. When the signal becomes weak, this device copies
the signal bit by bit and then regenerates it to its original strength for making the internet
connection stable.

A repeater is located in the first layer (physical layer) of the OSI layer. Repeaters are used in
cables that have to cover distances of up to 100 meters. These components receive signals
from cables like optical fibers, coaxial cables, and copper cables.

8. Bridges

This bridge is a device that has such functionality that it filters the content, for which it reads
MAC addresses of both source and destination. The bridge connects two LANs (Local Area
Network) using the same protocol. This device operates in the data link layer of the OSI
Model.

These network components are very useful for filtering the data load of traffic, for which they
divide them into segments or packets. The bridge controls the data traffic of LANs or other
networks. These bridges are actually passive devices, as there is no interaction between
bridged and paths of bridging.

9. Gateway

This gateway is a hardware device that acts as a “gate” within two networks. It can also be a
router, firewall, server, or any other device that enables traffic to flow in and out of the
network. Gateways are used to connect networks based on different protocols. As a bridge is
used to join two similar types of networks, similarly, the gateway is used to join two
dissimilar networks.

This gateway node is located at the edge of the network and all the data flows through it
which enters or exits the network. In addition, it can also translate received data that is
received from outside networks, into a format or protocol that can be identified by devices
within the internal network.

Types/Categories of Networks

o LAN(Local Area Network)


o PAN(Personal Area Network)
o MAN(Metropolitan Area Network)

LAN(Local Area Network)


o Local Area Network is a group of computers connected to each other in a small area
such as building, office.
o LAN is used for connecting two or more personal computers through a communication
medium such as twisted pair, coaxial cable, etc.
o It is less costly as it is built with inexpensive hardware such as hubs, network adapters,
and ethernet cables.
o The data is transferred at an extremely faster rate in Local Area Network.
o Local Area Network provides higher security.

Advantages of LAN
There are various advantages of LAN, which are as follows −

 Inexpensive transmission media.


 It can simplify the physical association of a device to the media.
 It is used to high data transmission rates.
o It is flexible and growth-oriented.
o It allows file locking.
o It provides full proof of the security system against illegal access to data.
Disadvantages of LAN
There are various disadvantages to LAN, which are as follows −

 LAN software needed a memory area in each of the mainframe used on the
network. This decreases the memory space available for the user’s program.
 Some security system should be executed if it is essential to protect private data.
 Some control on the part of the customer is lost. We have to share a printer with different
customers.
 Some current application programs will not run in a network environment.
MAN(Metropolitan Area Network)
o A metropolitan area network is a network that covers a larger geographic area by
interconnecting a different LAN to form a larger network.
o Government agencies use MAN to connect to the citizens and private industries.
o In MAN, various LANs are connected to each other through a telephone exchange line.
o The most widely used protocols in MAN are RS-232, Frame Relay, ATM, ISDN, OC-3,
ADSL, etc.
o It has a higher range than Local Area Network(LAN).

Uses Of Metropolitan Area Network:


o MAN is used in communication between the banks in a city.
o It can be used in an Airline Reservation.
o It can be used in a college within a city.
o It can also be used for communication in the military.

Advantages of MAN network


Some of the advantages of a Metropolitan Area Network are:
 It can send data in both directions at the same time.
 Metropolitan Area Network allows people to connect LANs.
 It is more comprehensive than a LAN and offers greater security than a WAN.
 Metropolitan Area Network usually encompasses several city blocks or an entire
city.
 It improves data handling efficiency while increasing data transfer speed.
 It facilitates the cost-effective sharing of shared resources such as printers.
 It provides an excellent backbone for a vast network, thus increasing WAN access.
 The implementation cost of a Metropolitan Area Network are lower than WAN since
it requires fewer resources.

Disadvantages of MAN network


Some of the disadvantages of a Metropolitan Area Network are:

 The data rate is slow in a Metropolitan Area Network compared to LAN.


 Compared to LAN, more cable is required to set up a Metropolitan Area Network.
 Because this network comprises multiple LANs, it is difficult to keep hackers out.
 These networks must be implemented by skilled technicians and network
administrators.
 This network’s implementation and management costs are higher than those of a
local area network.
 It is challenging to manage this network because it’s an extensive network of
numerous local area networks.
 As skilled technicians and network administrators are needed to implement this
network, the overall installation and management costs rise.

WAN(Wide Area Network)


o A Wide Area Network is a network that extends over a large geographical area such as
states or countries.
o A Wide Area Network is quite bigger network than the LAN.
o A Wide Area Network is not limited to a single location, but it spans over a large
geographical area through a telephone line, fibre optic cable or satellite links.
o The internet is one of the biggest WAN in the world.
o A Wide Area Network is widely used in the field of Business, government, and
education.
Examples Of Wide Area Network:
o Mobile Broadband: A 4G network is widely used across a region or country.
o Last mile: A telecom company is used to provide the internet services to the customers
in hundreds of cities by connecting their home with fiber.
o Private network: A bank provides a private network that connects the 44 offices. This
network is made by using the telephone leased line provided by the telecom company.

Advantages Of Wide Area Network:


Following are the advantages of the Wide Area Network:

o Geographical area: A Wide Area Network provides a large geographical area. Suppose
if the branch of our office is in a different city then we can connect with them through
WAN. The internet provides a leased line through which we can connect with another
branch.
o Centralized data: In case of WAN network, data is centralized. Therefore, we do not
need to buy the emails, files or back up servers.
o Get updated files: Software companies work on the live server. Therefore, the
programmers get the updated files within seconds.
o Exchange messages: In a WAN network, messages are transmitted fast. The web
application like Facebook, Whatsapp, Skype allows you to communicate with friends.
o Sharing of software and resources: In WAN network, we can share the software and
other resources like a hard drive, RAM.
o Global business: We can do the business over the internet globally.
o High bandwidth: If we use the leased lines for our company then this gives the high
bandwidth. The high bandwidth increases the data transfer rate which in turn increases
the productivity of our company.

Disadvantages of Wide Area Network:


The following are the disadvantages of the Wide Area Network:

o Security issue: A WAN network has more security issues as compared to LAN and
MAN network as all the technologies are combined together that creates the security
problem.
o Needs Firewall & antivirus software: The data is transferred on the internet which
can be changed or hacked by the hackers, so the firewall needs to be used. Some
people can inject the virus in our system so antivirus is needed to protect from such a
virus.
o High Setup cost: An installation cost of the WAN network is high as it involves the
purchasing of routers, switches.
o Troubleshooting problems: It covers a large area so fixing the problem is difficult.

Types of Connections
There are 2 types of connections in computer networks.They are:
Point-to-Point Communication

A point-to-point communication is also known as P2P. In the context of


telecommunication, it is an established connection between two nodes that may be
used to communicate back and forth. A basic telephone call, in which one phone is
connected to another, and both nodes can send and receive audio, is the most
common example of point-to-point communication.
These P2P connections were first established utilizing circuit-switched landlines in the
early days of telephony. However, point-to-point communication in modern networks
nowadays is made possible by complex fibre-optic networks. P2P connections of
various forms can transmit many types of data, including digital and analog signals.

The point-to-point connection is one of the line configuration methods that explains
how two communication devices are connected in a link. It is a unicast connection. A
dedicated link exists between each pair of sender and receiver. The entire channel's
capacity is reserved solely for packet transmission between the sender and receiver.

If a point-to-point connection is used to make a network, the packets must travel


through a number of intermediate devices. The length of the link between the many
intermediate devices may vary. As a result, in a point-to-point network finding the
shortest distance to reach the receiver is crucial.

Multipoint Communication:

Multi-point communication is the communication that occurs when a


communication channel is shared not just between two devices or nodes but also
between numerous devices or nodes participating in the conversation.

A multipoint connection is one that connects more than two devices together.
Multidrop line configuration is another name for the multipoint connection. Numerous
devices share a single link in a multipoint connection. As a result, it is possible to say
that all devices connected to the link temporarily share the channel capacity. The
devices use a turn-by-turn link, which is called a time-shared line configuration.

In a broadcast network, the packet transmitted by the sender is received and processed
by each device on the link. However, the receiver evaluates whether the packet belongs
to it or not based on the address field in the packet; if it does not, the packet is
discarded. If the packet belongs to the recipient, store it and respond appropriately to
the sender.

Topology

Topology defines the structure of the network of how all the components are
interconnected to each other. There are two types of topology: physical and logical
topology.

Physical topology is the geometric representation of all the nodes in a network.

Bus Topology
o The bus topology is designed in such a way that all the stations are connected through
a single cable known as a backbone cable.
o Each node is either connected to the backbone cable by drop cable or directly
connected to the backbone cable.
o When a node wants to send a message over the network, it puts a message over the
network. All the stations available in the network will receive the message whether it
has been addressed or not.
o The bus topology is mainly used in 802.3 (ethernet) and 802.4 standard networks.
o The configuration of a bus topology is quite simpler as compared to other topologies.
o The backbone cable is considered as a "single lane" through which the message is
broadcast to all the stations.

Advantages of Bus topology:


o Low-cost cable: In bus topology, nodes are directly connected to the cable without
passing through a hub. Therefore, the initial cost of installation is low.
o Moderate data speeds: Coaxial or twisted pair cables are mainly used in bus-based
networks that support upto 10 Mbps.
o Familiar technology: Bus topology is a familiar technology as the installation and
troubleshooting techniques are well known, and hardware components are easily
available.

o Limited failure: A failure in one node will not have any effect on other nodes.

Disadvantages of Bus topology:


o Extensive cabling: A bus topology is quite simpler, but still it requires a lot of cabling.
o Difficult troubleshooting: It requires specialized test equipment to determine the
cable faults. If any fault occurs in the cable, then it would disrupt the communication
for all the nodes.
o Signal interference: If two nodes send the messages simultaneously, then the signals
of both the nodes collide with each other.
o Reconfiguration difficult: Adding new devices to the network would slow down the
network.
o Attenuation: Attenuation is a loss of signal leads to communication issues. Repeaters
are used to regenerate the signal.

Ring Topology
o Ring topology is like a bus topology, but with connected ends.
o The node that receives the message from the previous computer will retransmit to the
next node.
o The data flows in one direction, i.e., it is unidirectional.
o The data flows in a single loop continuously known as an endless loop.
o It has no terminated ends, i.e., each node is connected to other node and having no
termination point.
o The data in a ring topology flow in a clockwise direction.
o The most common access method of the ring topology is token passing.
o Token passing: It is a network access method in which token is passed from
one node to another node.
o Token: It is a frame that circulates around the network

Advantages of Ring topology:


o Network Management: Faulty devices can be removed from the network without
bringing the network down.
o Product availability: Many hardware and software tools for network operation and
monitoring are available.
o Cost: Twisted pair cabling is inexpensive and easily available. Therefore, the installation
cost is very low.
o Reliable: It is a more reliable network because the communication system is not
dependent on the single host computer.
Disadvantages of Ring topology:
o Difficult troubleshooting: It requires specialized test equipment to determine the
cable faults. If any fault occurs in the cable, then it would disrupt the communication
for all the nodes.
o Failure: The breakdown in one station leads to the failure of the overall network.
o Reconfiguration difficult: Adding new devices to the network would slow down the
network.
o Delay: Communication delay is directly proportional to the number of nodes. Adding
new devices increases the communication delay.

Star Topology

o Star topology is an arrangement of the network in which every node is connected to


the central hub, switch or a central computer.
o The central computer is known as a server, and the peripheral devices attached to the
server are known as clients.
o Coaxial cable or RJ-45 cables are used to connect the computers.
o Hubs or Switches are mainly used as connection devices in a physical star topology.
o Star topology is the most popular topology in network implementation.

Advantages of Star topology


o Efficient troubleshooting: Troubleshooting is quite efficient in a star topology as
compared to bus topology. In a bus topology, the manager has to inspect the
kilometers of cable. In a star topology, all the stations are connected to the centralized
network. Therefore, the network administrator has to go to the single station to
troubleshoot the problem.
o Network control: Complex network control features can be easily implemented in the
star topology. Any changes made in the star topology are automatically
accommodated.
o Limited failure: As each station is connected to the central hub with its own cable,
therefore failure in one cable will not affect the entire network.
o Familiar technology: Star topology is a familiar technology as its tools are cost-
effective.
o Easily expandable: It is easily expandable as new stations can be added to the open
ports on the hub.
o Cost effective: Star topology networks are cost-effective as it uses inexpensive coaxial
cable.
o High data speeds: It supports a bandwidth of approx 100Mbps. Ethernet 100BaseT is
one of the most popular Star topology networks.

Disadvantages of Star topology


o A Central point of failure: If the central hub or switch goes down, then all the
connected nodes will not be able to communicate with each other.
o Cable: Sometimes cable routing becomes difficult when a significant amount of
routing is required.

Mesh topology

o Mesh technology is an arrangement of the network in which computers are


interconnected with each other through various redundant connections.
o There are multiple paths from one computer to another computer.
o It does not contain the switch, hub or any central computer which acts as a central
point of communication.
o The Internet is an example of the mesh topology.
o Mesh topology is mainly used for WAN implementations where communication
failures are a critical concern.
o Mesh topology is mainly used for wireless networks.
o Mesh topology can be formed by using the formula:
Number of cables = (n*(n-1))/2;

Where n is the number of nodes that represents the network.

Mesh topology is divided into two categories:

o Fully connected mesh topology

o Partially connected mesh topology

o Full Mesh Topology: In a full mesh topology, each computer is connected to all the
computers available in the network.
o Partial Mesh Topology: In a partial mesh topology, not all but certain computers are
connected to those computers with which they communicate frequently.

Advantages of Mesh topology:

Reliable: The mesh topology networks are very reliable as if any link breakdown will
not affect the communication between connected computers.

Fast Communication: Communication is very fast between the nodes.

Easier Reconfiguration: Adding new devices would not disrupt the communication
between other devices.

Disadvantages of Mesh topology


o Cost: A mesh topology contains a large number of connected devices such as a router
and more transmission media than other topologies.
o Management: Mesh topology networks are very large and very difficult to maintain
and manage. If the network is not monitored carefully, then the communication link
failure goes undetected.
o Efficiency: In this topology, redundant connections are high that reduces the efficiency
of the network.

Hybrid Topology

o The combination of various different topologies is known as Hybrid topology.


o A Hybrid topology is a connection between different links and nodes to transfer the
data.
o When two or more different topologies are combined together is termed as Hybrid
topology and if similar topologies are connected with each other will not result in
Hybrid topology. For example, if there exist a ring topology in one branch of ICICI bank
and bus topology in another branch of ICICI bank, connecting these two topologies
will result in Hybrid topology.
Advantages of Hybrid Topology
o Reliable: If a fault occurs in any part of the network will not affect the functioning of
the rest of the network.
o Scalable: Size of the network can be easily expanded by adding new devices without
affecting the functionality of the existing network.
o Flexible: This topology is very flexible as it can be designed according to the
requirements of the organization.
o Effective: Hybrid topology is very effective as it can be designed in such a way that the
strength of the network is maximized and weakness of the network is minimized.

Disadvantages of Hybrid topology


o Complex design: The major drawback of the Hybrid topology is the design of the
Hybrid network. It is very difficult to design the architecture of the Hybrid network.
o Costly Hub: The Hubs used in the Hybrid topology are very expensive as these hubs
are different from usual Hubs used in other topologies.
o Costly infrastructure: The infrastructure cost is very high as a hybrid network requires
a lot of cabling, network devices, etc.

Protocols

A protocol is basically a synonym for the rule. In Computer Networks, basically,


communication occurs between entities in different systems. An entity is anything
that is capable of sending or receiving information. Any two entities cannot simply
send bitstreams to each other and expect to be understood.

The entities must need to agree on a protocol in order of occurrence of the


communication.

A Protocol is a set of rules that mainly govern data communications. The protocol
mainly defines what is communicated, how it is communicated, and when it is
communicated.

Key elements of a Protocol

The key elements of a protocol are as given below:

 Syntax This term mainly refers to the structure or format of the data which
simply means the order in which data is presented. For example, A simple
protocol might expect the first 8 bits of data to be the address of the sender,
then the second 8 bits to be the address of the receiver, and then the rest of
the stream to be the message itself.
 Semantics This term mainly refers to the meaning of each section of bits. How
does a particular pattern to be interpreted, and On the basis of interpretation
what action is to be taken? For example, does an address identify the route to
be taken or the final destination of the message?
 Timing This term mainly refers to two characteristics: At what time the data
should be sent and how fast data can be sent. For example, if a sender
produces data at 100 Mbps but the receiver can process data at only 1 Mbps,
the transmission will overload the receiver and there will be some data loss.

Standards

Standards are essential in creating and maintaining an open and creative market for
the equipment manufacturers and they also guarantee the national and international
interoperability of the data, telecommunication technology, and process.

Standards are mainly used to provide guidelines to manufacturers, vendors,


government agencies, and also to other service providers in order to ensure the kind
of interconnectivity that is necessary for today's marketplace and also in international
communications.

ISO / OSI model

Layer 1: Physical Layer

At the lowest layer of the OSI reference model, the physical layer is
responsible for transmitting unstructured data bits across the
network between the physical layers of the sending and receiving devices.
In other words, it takes care of the transmission of raw bit streams.

Layer 2: Data Link Layer

The data link layer corrects any errors that may have occurred at the
physical layer. It ensures that any data transfer is error-free between nodes
over the physical layer. It is responsible for reliable transmission of data
frames between connected nodes.

The data is packaged into frames here and transferred node-to-node. The
data layer has the following sub-layers

 Media Access Control (MAC): The MAC address layer is


responsible for flow control and multiplexing devices transmissions
over the network.
 Logical link control (LLC): The LLC layer provides error control
and flow control over the physical medium and identifies line
protocols.

Layer 3: Network Layer

The network layer receives frames from the data link


layer and delivers them to the intended destination based on
the addresses inside the frame. It also handles packet routing. The network
layer locates destinations using logical addresses like the IP. Routers are a
crucial component at this layer as they route information to where it needs
to go between different networks.

The main functions of the Network layer are:

 Routing: The network layer protocols determine which routes from


source to destination.
 Logical Addressing: The network layer defines an addressing
scheme to uniquely identify devices. The network layer places the IP
addresses from the sender and receiver in the header.

Layer 4: Transport Layer

The transport layer is responsible for delivering, error checking, flow


control, and sequencing data packets. It regulates the sequencing,
size, and transfer of data between systems and hosts. It gets the data from
the session layer and breaks it into transportable segments.

Two examples of the Transport Layer are the UDP (User Datagram
Protocol) and TCP (Transmission Control Protocol) that is build on top of
the Internet Protocol (IP model), which work at layer 3.

Layer 5: Session Layer

The session layer will create communication channels, called sessions,


between different devices. This layer is responsible for opening those
sessions and ensuring that they’re functional during data transfer.

In other words, the session layer is responsible for establishing, managing,


and terminating communication sessions with the lower layers with the
presentation and application layer. It is also responsible
for authentication and reconnections, and it can set checkpoints during a
data transfer.

Layer 6: Presentation Layer


The presentation layer is responsible for ensuring that the data
is understandable for the end system or useful for later stages. It
translates or formats data based on the application’s syntax or semantics. It
also manages any encryption or decryption required by the application
layer. It is also called the syntax layer.

Layer 7: Application Layer

The application layer is where the user directly interacts with a software
application, so it is closest to the end user. When the user wants to
transmit files or pictures, this layer interacts with the application
communicating with the network. The application layer identifies
resources, communication partners, and synchronizes communication.

Other functions of the application layer are the Network Virtual Terminal
and FTAM-File transfer access, and mail/directory services. The protocol
used depends on the information the user wants to send. Some common
protocols include:

 POP3 or SMTP for emails


 FTP for emails
 Telnet for controlling remote devices

Transmission modes
o The way in which data is transmitted from one device to another device is known
as transmission mode.
o The transmission mode is also known as the communication mode.
o Each communication channel has a direction associated with it, and transmission media
provide the direction. Therefore, the transmission mode is also known as a directional
mode.
o The transmission mode is defined in the physical layer.

The Transmission mode is divided into three categories:


o Simplex mode
o Half-duplex mode
o Full-duplex mode

Simplex mode

o In Simplex mode, the communication is unidirectional, i.e., the data flow in one
direction.
o A device can only send the data but cannot receive it or it can receive the data but
cannot send the data.
o This transmission mode is not very popular as mainly communications require the two-
way exchange of data. The simplex mode is used in the business field as in sales that
do not require any corresponding reply.
o The radio station is a simplex channel as it transmits the signal to the listeners but
never allows them to transmit back.
o Keyboard and Monitor are the examples of the simplex mode as a keyboard can only
accept the data from the user and monitor can only be used to display the data on the
screen.
o The main advantage of the simplex mode is that the full capacity of the communication
channel can be utilized during transmission.

Advantage of Simplex mode:


o In simplex mode, the station can utilize the entire bandwidth of the communication
channel, so that more data can be transmitted at a time.
Disadvantage of Simplex mode:
o Communication is unidirectional, so it has no inter-communication between devices.

Half-Duplex mode

o In a Half-duplex channel, direction can be reversed, i.e., the station can transmit and
receive the data as well.
o Messages flow in both the directions, but not at the same time.
o The entire bandwidth of the communication channel is utilized in one direction at a
time.
o In half-duplex mode, it is possible to perform the error detection, and if any error
occurs, then the receiver requests the sender to retransmit the data.
o A Walkie-talkie is an example of the Half-duplex mode. In Walkie-talkie, one party
speaks, and another party listens. After a pause, the other speaks and first party listens.
Speaking simultaneously will create the distorted sound which cannot be understood.

Advantage of Half-duplex mode:


o In half-duplex mode, both the devices can send and receive the data and also can
utilize the entire bandwidth of the communication channel during the transmission of
data.

Disadvantage of Half-Duplex mode:


o In half-duplex mode, when one device is sending the data, then another has to wait,
this causes the delay in sending the data at the right time.

Full-duplex mode
o In Full duplex mode, the communication is bi-directional, i.e., the data flow in both the
directions.
o Both the stations can send and receive the message simultaneously.
o Full-duplex mode has two simplex channels. One channel has traffic moving in one
direction, and another channel has traffic flowing in the opposite direction.
o The Full-duplex mode is the fastest mode of communication between devices.
o The most common example of the full-duplex mode is a telephone network. When two
people are communicating with each other by a telephone line, both can talk and listen
at the same time.

Advantage of Full-duplex mode:


o Both the stations can send and receive the data at the same time.

Disadvantage of Full-duplex mode:


o If there is no dedicated path exists between the devices, then the capacity of the
communication channel is divided into two parts.

Multiplexing
Multiplexing is a technique used to combine and send the multiple data streams over
a single medium. The process of combining the data streams is known as multiplexing
and hardware used for multiplexing is known as a multiplexer.

Multiplexing is achieved by using a device called Multiplexer (MUX) that combines n


input lines to generate a single output line. Multiplexing follows many-to-one, i.e., n
input lines and one output line.

Demultiplexing is achieved by using a device called Demultiplexer (DEMUX) available


at the receiving end. DEMUX separates a signal into its component signals (one input
and n outputs). Therefore, we can say that demultiplexing follows the one-to-many
approach.

Advantages of Multiplexing:
o More than one signal can be sent over a single medium.
o The bandwidth of a medium can be utilized effectively.

Multiplexing Techniques

Frequency-division Multiplexing (FDM)


o It is an analog technique.
o Frequency Division Multiplexing is a technique in which the available bandwidth of
a single transmission medium is subdivided into several channels.

o In the above diagram, a single transmission medium is subdivided into several


frequency channels, and each frequency channel is given to different devices. Device 1
has a frequency channel of range from 1 to 5.
o The input signals are translated into frequency bands by using modulation techniques,
and they are combined by a multiplexer to form a composite signal.
o The main aim of the FDM is to subdivide the available bandwidth into different
frequency channels and allocate them to different devices.
o Using the modulation technique, the input signals are transmitted into frequency
bands and then combined to form a composite signal.
o The carriers which are used for modulating the signals are known as sub-carriers. They
are represented as f1,f2..fn.
o FDM is mainly used in radio broadcasts and TV networks.

Advantages Of FDM:

o FDM is used for analog signals.


o FDM process is very simple and easy modulation.
o A Large number of signals can be sent through an FDM simultaneously.
o It does not require any synchronization between sender and receiver.

Disadvantages Of FDM:

o FDM technique is used only when low-speed channels are required.


o It suffers the problem of crosstalk.
o A Large number of modulators are required.
o It requires a high bandwidth channel.

Applications Of FDM:

o FDM is commonly used in TV networks.


o It is used in FM and AM broadcasting. Each FM radio station has different frequencies,
and they are multiplexed to form a composite signal. The multiplexed signal is
transmitted in the air.

Wavelength Division Multiplexing (WDM)


o Wavelength Division Multiplexing is same as FDM except that the optical signals are
transmitted through the fibre optic cable.
o WDM is used on fibre optics to increase the capacity of a single fibre.
o It is used to utilize the high data rate capability of fibre optic cable.
o It is an analog multiplexing technique.
o Optical signals from different source are combined to form a wider band of light with
the help of multiplexer.
o At the receiving end, demultiplexer separates the signals to transmit them to their
respective destinations.
o Multiplexing and Demultiplexing can be achieved by using a prism.
o Prism can perform a role of multiplexer by combining the various optical signals to
form a composite signal, and the composite signal is transmitted through a fibre
optical cable.
o Prism also performs a reverse operation, i.e., demultiplexing the signal.

Time Division Multiplexing


o It is a digital technique.
o In Frequency Division Multiplexing Technique, all signals operate at the same time with
different frequency, but in case of Time Division Multiplexing technique, all signals
operate at the same frequency with different time.
o In Time Division Multiplexing technique, the total time available in the channel is
distributed among different users. Therefore, each user is allocated with different time
interval known as a Time slot at which data is to be transmitted by the sender.
o A user takes control of the channel for a fixed amount of time.
o In Time Division Multiplexing technique, data is not transmitted simultaneously rather
the data is transmitted one-by-one.
o In TDM, the signal is transmitted in the form of frames. Frames contain a cycle of time
slots in which each frame contains one or more slots dedicated to each user.
o It can be used to multiplex both digital and analog signals but mainly used to multiplex
digital signals.

There are two types of TDM:

o Synchronous TDM
o Asynchronous TDM

Synchronous TDM
o A Synchronous TDM is a technique in which time slot is preassigned to every device.
o In Synchronous TDM, each device is given some time slot irrespective of the fact that
the device contains the data or not.
o If the device does not have any data, then the slot will remain empty.
o In Synchronous TDM, signals are sent in the form of frames. Time slots are organized
in the form of frames. If a device does not have data for a particular time slot, then the
empty slot will be transmitted.
o The most popular Synchronous TDM are T-1 multiplexing, ISDN multiplexing, and
SONET multiplexing.
o If there are n devices, then there are n slots.
Concept Of Synchronous TDM

In the above figure, the Synchronous TDM technique is implemented. Each device is
allocated with some time slot. The time slots are transmitted irrespective of whether
the sender has data to send or not.

Disadvantages Of Synchronous TDM:

o The capacity of the channel is not fully utilized as the empty slots are also transmitted
which is having no data. In the above figure, the first frame is completely filled, but in
the last two frames, some slots are empty. Therefore, we can say that the capacity of
the channel is not utilized efficiently.
o The speed of the transmission medium should be greater than the total speed of the
input lines. An alternative approach to the Synchronous TDM is Asynchronous Time
Division Multiplexing.

Asynchronous TDM
o An asynchronous TDM is also known as Statistical TDM.
o An asynchronous TDM is a technique in which time slots are not fixed as in the case of
Synchronous TDM. Time slots are allocated to only those devices which have the data
to send. Therefore, we can say that Asynchronous Time Division multiplexor transmits
only the data from active workstations.
o An asynchronous TDM technique dynamically allocates the time slots to the devices.
o In Asynchronous TDM, total speed of the input lines can be greater than the capacity
of the channel.
o Asynchronous Time Division multiplexor accepts the incoming data streams and
creates a frame that contains only data with no empty slots.
o In Asynchronous TDM, each slot contains an address part that identifies the source of
the data.

o The difference between Asynchronous TDM and Synchronous TDM is that many slots
in Synchronous TDM are unutilized, but in Asynchronous TDM, slots are fully utilized.
This leads to the smaller transmission time and efficient utilization of the capacity of
the channel.
o In Synchronous TDM, if there are n sending devices, then there are n time slots. In
Asynchronous TDM, if there are n sending devices, then there are m time slots where
m is less than n (m<n).
o The number of slots in a frame depends on the statistical analysis of the number of
input lines.

Concept Of Asynchronous TDM


In the above diagram, there are 4 devices, but only two devices are sending the data,
i.e., A and C. Therefore, the data of A and C are only transmitted through the
transmission line.

Frame of above diagram can be represented as:

The above figure shows that the data part contains the address to determine the
source of the data.

Transmission media
o Transmission media is a communication channel that carries the information from the
sender to the receiver. Data is transmitted through the electromagnetic signals.
o The main functionality of the transmission media is to carry the information in the form
of bits through LAN(Local Area Network).

Classification Of Transmission 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.

The degree of reduction in noise interference is determined by the number of turns


per foot. Increasing the number of turns per foot decreases noise interference.

Coaxial Cable
o Coaxial cable is very commonly used transmission media, for example, TV wire is usually
a coaxial cable.
o The name of the cable is coaxial as it contains two conductors parallel to each other.
o It has a higher frequency as compared to Twisted pair cable.
o 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.
o The middle core is responsible for the data transferring whereas the copper mesh
prevents from the EMI(Electromagnetic interference).

Fibre Optic
o Fibre optic cable is a cable that uses electrical signals for communication.
o Fibre optic is a cable that holds the optical fibres coated in plastic that are used to send
the data by pulses of light.
o The plastic coating protects the optical fibres from heat, cold, electromagnetic
interference from other types of wiring.
o Fibre optics provide faster data transmission than copper wires.

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
o Circuit switching is a switching technique that establishes a dedicated path between
sender and receiver.
o In the Circuit Switching Technique, once the connection is established then the
dedicated path will remain to exist until the connection is terminated.
o Circuit switching in a network operates in a similar way as the telephone works.
o A complete end-to-end path must exist before the communication takes place.
o 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.
o Circuit switching is used in public telephone network. It is used for voice transmission.
o Fixed data can be transferred at a time in circuit switching technology.

Communication through circuit switching has 3 phases:

o Circuit establishment
o Data transfer
o Circuit Disconnect
Circuit Switching can use either of the two technologies:

Space Division Switches:


o 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.
o 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.
o The Crossbar switch is made by using the semiconductor. For example, Xilinx crossbar
switch using FPGAs.
o Space Division Switching has high speed, high capacity, and nonblocking switches.

Space Division Switches can be categorized in two ways:

o Crossbar Switch
o 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.

Disadvantage of Crossbar switch:

The number of crosspoints increases as the number of stations is increased. Therefore,


it becomes very expensive for a large switch. The solution to this is to use a multistage
switch.

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

Advantages Of Circuit Switching:

o In the case of Circuit Switching technique, the communication channel is dedicated.


o It has fixed bandwidth.

Disadvantages Of Circuit Switching:

o Once the dedicated path is established, the only delay occurs in the speed of data
transmission.
o It takes a long time to establish a connection approx 10 seconds during which no data
can be transmitted.
o It is more expensive than other switching techniques as a dedicated path is required
for each connection.
o It is inefficient to use because once the path is established and no data is transferred,
then the capacity of the path is wasted.
o In this case, the connection is dedicated therefore no other data can be transferred
even if the channel is free.

Message Switching
o 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.
o In Message Switching technique, there is no establishment of a dedicated path
between the sender and receiver.
o 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.
o Message switches are programmed in such a way so that they can provide the most
efficient routes.
o 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.
o Message switching treats each message as an independent entity.
Advantages Of Message Switching

o Data channels are shared among the communicating devices that improve the
efficiency of using available bandwidth.
o Traffic congestion can be reduced because the message is temporarily stored in the
nodes.
o Message priority can be used to manage the network.
o The size of the message which is sent over the network can be varied. Therefore, it
supports the data of unlimited size.

Disadvantages Of Message Switching

o The message switches must be equipped with sufficient storage to enable them to
store the messages until the message is forwarded.
o The Long delay can occur due to the storing and forwarding facility provided by the
message switching technique.

Packet Switching
o 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.
o The message splits into smaller pieces known as packets and packets are given a
unique number to identify their order at the receiving end.
o Every packet contains some information in its headers such as source address,
destination address and sequence number.
o Packets will travel across the network, taking the shortest path as possible.
o All the packets are reassembled at the receiving end in correct order.
o If any packet is missing or corrupted, then the message will be sent to resend the
message.
o If the correct order of the packets is reached, then the acknowledgment message will
be sent.

Approaches Of Packet Switching:


There are two approaches to Packet Switching:

Datagram Packet switching:


o It is a packet switching technology in which packet is known as a datagram, is
considered as an independent entity. Each packet contains the information about the
destination and switch uses this information to forward the packet to the correct
destination.
o The packets are reassembled at the receiving end in correct order.
o In Datagram Packet Switching technique, the path is not fixed.
o Intermediate nodes take the routing decisions to forward the packets.
o Datagram Packet Switching is also known as connectionless switching.

Virtual Circuit Switching


o Virtual Circuit Switching is also known as connection-oriented switching.
o In the case of Virtual circuit switching, a preplanned route is established before the
messages are sent.
o Call request and call accept packets are used to establish the connection between
sender and receiver.
o In this case, the path is fixed for the duration of a logical connection.

Let's understand the concept of virtual circuit switching through a diagram:


o In the above diagram, A and B are the sender and receiver respectively. 1 and 2 are the
nodes.
o Call request and call accept packets are used to establish a connection between the
sender and receiver.
o When a route is established, data will be transferred.
o After transmission of data, an acknowledgment signal is sent by the receiver that the
message has been received.

Expected Questions :

1. Describe ISO OSI model with a neat sketch.

2. Compare and contrast the ISO OSI model with TCP/IP model.

3. Explain Novel NetWare and the ARPANET.

4. Explain the working of X.21

5. Explain this network structure

6. Explain different types of transmission media used in data communication

7. Give advantages and disadvantages of fiber optic cable over metallic cable

8. Draw the B-ISDN reference model and explain the functions of each layer.

9. Explain about ATM. What are the advantages of using fixed length cells.
10. Explain X.25 network.

11. What are the applications of networks?

12. Write the difference between B-ISDN and N-ISDN

13. Explain the following items a) IMP b) HOST c) Subnet

14. What are the advantages of layered architecture

15. Explain the goals of a computer network


UNIT-II

UNIT-II Data link layer: Introduction, Framing, and Error – Detection


and Correction – Parity – LRC CRC Hamming code, Flow and Error
Control, Noiseless Channels, Noisy Channels, HDLC, Point to Point
Protocols. 111 Medium Access sub layer: ALOHA, CSMA/CD, LAN
Ethernet IEEE 802.3, IEEE 802.5 – IEEE 802.11, Random access,
Controlled access, Channelization.

Introduction about Data Link layer:-

❖ Data Link Layer is second layer of OSI Layered Model.


❖ The communication channel that connects the adjacent nodes is known as
links.
❖ In order to move the datagram from source to the destination.

❖ The main responsibility of the Data Link Layer is to transfer the datagram
across an individual link.
❖ The Data link layer protocol defines the format of the packet exchanged
across the nodes as well as the actions such as Error detection,
retransmission, flow control, and random access.
❖ The Data Link Layer protocols are Ethernet, token ring, FDDI and PPP.
❖ Data link layer is responsible for converting data stream to signals bit by
bit and to send that over the underlying hardware.
❖ At the receiving end, Data link layer picks up data from hardware which
are in the form of electrical signals, assembles them in a recognizable
frame format, and hands over to upper layer.
❖ Data link layer has two sub-layers:
❖ Logical Link Control: It deals with protocols, flow-control, and error
control
❖ Media Access Control: It deals with actual control of media

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Functionality of Data-link Layer: -

• 1. Framing

• Data-link layer takes packets from Network Layer and encapsulates


them into Frames.
• Then, it sends each frame bit-by-bit on the hardware.
• At receiver’ end, data link layer picks up signals from hardware
and assembles them into frames.

2. Reliable delivery:
• Data Link Layer provides a reliable delivery service,
i.e., transmits the network layer datagram without any error.
• A reliable delivery service is accomplished with transmissions and
acknowledgements.

• 3. Flow Control
• Stations on same link may have different speed or capacity.
• Data-link layer ensures flow control that enables both machine to
exchange data on same speed.

4. Error detection:

• Data Link Layer protocol provides a mechanism to detect one or more


errors.
• This is achieved by adding error detection bits in the frame and then
receiving node can perform an error check.

5.Error correction:

Error correction is similar to the Error detection, except that receiving


node not only detect the errors but also determine where the errors have
occurred in the frame.

• 6.Half-Duplex & Full-Duplex:


• In a Full-Duplex mode, both the nodes can transmit the data at the same
time.
• In a Half-Duplex mode, only one node can transmit the data at the same
time.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Framing in Data Link Layer
In the physical layer, data transmission involves synchronised transmission of
bits from the source to the destination. The data link layer packs these bits into
frames.
Data-link layer takes the packets from the Network Layer and encapsulates
them into frames. If the frame size becomes too large, then the packet may be
divided into small sized frames. Smaller sized frames makes flow control and
error control more efficient.
Then, it sends each frame bit-by-bit on the hardware. At receiver’s end, data
link layer picks up signals from hardware and assembles them into frames.

Parts of a Frame

A frame has the following parts –


• Frame Header – It contains the source and the destination addresses of the
frame.
• Payload field – It contains the message to be delivered.
• Trailer – It contains the error detection and error correction bits.
• Flag – It marks the beginning and end of the frame.

Types of Framing

Framing can be of two types, fixed sized framing and variable sized framing.
Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM
Fixed-sized Framing
Here the size of the frame is fixed and so the frame length acts as delimiter of
the frame. Consequently, it does not require additional boundary bits to identify
the start and end of the frame.
Example − ATM cells.
Variable – Sized Framing
Here, the size of each frame to be transmitted may be different. So additional
mechanisms are kept to mark the end of one frame and the beginning of the
next frame.
It is used in local area networks.
Two ways to define frame delimiters in variable sized framing are −
• Length Field − Here, a length field is used that determines the size of the
frame. It is used in Ethernet (IEEE 802.3).
• End Delimiter − Here, a pattern is used as a delimiter to determine the
size of frame. It is used in Token Rings. If the pattern occurs in the
message, then two approaches are used to avoid the situation –

o Byte – Stuffing − A byte is stuffed in the message to differentiate
from the delimiter. This is also called character-oriented framing.
o Bit – Stuffing − A pattern of bits of arbitrary length is stuffed in the
message to differentiate from the delimiter. This is also called bit –
oriented framing.
Error Detection

When data is transmitted from one device to another device, the system does not
guarantee whether the data received by the device is identical to the data
transmitted by another device.

An Error is a situation when the message received at the receiver end is not
identical to the message transmitted.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Types Of Errors

Errors can be classified into two categories:

o Single-Bit Error
o Burst Error

Single-Bit Error:

The only one bit of a given data unit is changed from 1 to 0 or from 0 to 1.

In the above figure, the message which is sent is corrupted as single-bit, i.e., 0
bit is changed to 1.

Types of Errors

There may be three types of errors:


• Single bit error

In a frame, there is only one bit, anywhere though, which is corrupt.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


• Multiple bits error

Frame is received with more than one bits in corrupted state.


• Burst error

Frame contains more than1 consecutive bits corrupted.

Single-Bit Error does not appear more likely in Serial Data Transmission. For
example, Sender sends the data at 10 Mbps, this means that the bit lasts only for
1 ?s and for a single-bit error to occurred, a noise must be more than 1 ?s.

Single-Bit Error mainly occurs in Parallel Data Transmission. For example, if


eight wires are used to send the eight bits of a byte, if one of the wire is noisy,
then single-bit is corrupted per byte.

Burst Error:

The two or more bits are changed from 0 to 1 or from 1 to 0 is known as Burst
Error.

The Burst Error is determined from the first corrupted bit to the last corrupted
bit.

The duration of noise in Burst Error is more than the duration of noise in
Single-Bit.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Burst Errors are most likely to occur in Serial Data Transmission.

The number of affected bits depends on the duration of the noise and data rate.

Error Detecting Techniques:

The most popular Error Detecting Techniques are:

o Single parity check


o Two-dimensional parity check
o Checksum
o Cyclic redundancy check

Single Parity Check

o Single Parity checking is the simple mechanism and inexpensive to detect


the errors.
o In this technique, a redundant bit is also known as a parity bit which is
appended at the end of the data unit so that the number of 1s becomes
even. Therefore, the total number of transmitted bits would be 9 bits.
o If the number of 1s bits is odd, then parity bit 1 is appended and if the
number of 1s bits is even, then parity bit 0 is appended at the end of the
data unit.
o At the receiving end, the parity bit is calculated from the received data
bits and compared with the received parity bit.
o This technique generates the total number of 1s even, so it is known as
even-parity checking.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Drawbacks Of Single Parity Checking
o It can only detect single-bit errors which are very rare.
o If two bits are interchanged, then it cannot detect the errors.

Error Correction by Data link layer in Computer Networks.

In Error Detection, the receiver only needs to know that the received codeword
is invalid; But in Error Correction the receiver needs to guess the Original
codeword that is sent. In this way, error Correction is much more difficult than
Error Detection.

The need for redundant bits is more during error correction rather than for error
detection.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Let us take a look at the Structure of the encoder and decoder in the Error
Correction:

Figure: Structure of the Encoder and Decoder in the Error Correction

In order to detect or correct the errors, there is a need to send some extra bits
along with the data. These extra bits are commonly known as Redundant bits.

As we had learned in the previous tutorial that original data is divided into
segments of k bits; it is referred to as dataword. When we add r redundant bits
to each block in order to make the length;n=k+r then it is referred to
as Codeword.

There are two ways to handle the error correction:

1. Whenever an error discovered, the receiver can have the sender in order
to retransmit the entire data unit. This technique is known as
the Backward Error correction technique. This technique is simple and
inexpensive in the case of wired transmission like fiber optics; there is no
expense in retransmitting the data. In the case of wireless transmission,
retransmission costs too much thus forward error correction technique is
used then.
2. The receiver can use an error-correcting code that automatically contains
certain errors. This technique is known as the Forward Error
Correction technique.

In order to correct the errors, one has to know the exact position of the error.
For example, In case if we want to calculate a single-bit error, the error
correction code then mainly determines which one of seven bits is in the error.

In order to achieve this, we have to add some additional redundant bits.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Suppose r (as the redundant bits) and d indicates the total number of data bits. In
order to calculate the redundant bits(r), the given formula is used;

2r= d+r+1

Error correction is mainly done with the help of the Hamming code.

Hamming Code

It is a technique developed by R.W. hamming. This can be applied to data units


of any length. This code mainly uses the relationship between data and
redundancy bits.

The hamming code technique, which is an error-detection and error-


correction technique, was proposed by R.W. Hamming. Whenever a data
packet is transmitted over a network, there are possibilities that the data bits
may get lost or damaged during transmission.

Let's understand the Hamming code concept with an example:

Let's say you have received a 7-bit Hamming code which is 1011011.

First, let us talk about the redundant bits.

The redundant bits are some extra binary bits that are not part of the original
data, but they are generated & added to the original data bit. All this is done to
ensure that the data bits don't get damaged and if they do, we can recover them.

Now the question arises, how do we determine the number of redundant bits to
be added?

We use the formula, 2r >= m+r+1; where r = redundant bit & m = data bit.

From the formula we can make out that there are 4 data bits and 3 redundancy
bits, referring to the received 7-bit hamming code.

What is Parity Bit?

To proceed further we need to know about parity bit, which is a bit appended
to the data bits which ensures that the total number of 1's are even (even parity)
or odd (odd parity).

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


While checking the parity, if the total number of 1's are odd then write the value
of parity bit P1(or P2 etc.) as 1 (which means the error is there ) and if it is even
then the value of parity bit is 0 (which means no error).

Hamming Code in Error Detection

As we go through the example, the first step is to identify the bit position of the
data & all the bit positions which are powers of 2 are marked as parity bits (e.g.
1, 2, 4, 8, etc.). The following image will help in visualizing the received
hamming code of 7 bits.

First, we need to detect whether there are any errors in this received hamming
code.

Step 1: For checking parity bit P1, use check one and skip one method, which
means, starting from P1 and then skip P2, take D3 then skip P4 then take D5,
and then skip D6 and take D7, this way we will have the following bits,

As we can observe the total number of bits is odd so we will write the value of
parity bit as P1 = 1. This means the error is there.

Step 2: Check for P2 but while checking for P2, we will use the check two and
skip two methods, which will give us the following data bits. But remember
since we are checking for P2, so we have to start our count from P2 (P1 should
not be considered).

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


As we can observe that the number of 1's are even, then we will write the value
of P2 = 0. This means there is no error.

Step 3: Check for P4 but while checking for P4, we will use the check four
and skip four methods, which will give us the following data bits. But
remember since we are checking for P4, so we have started our count from
P4(P1 & P2 should not be considered).

As we can observe that the number of 1's is odd, then we will write the value
of P4 = 1. This means the error is there.

So, from the above parity analysis, P1 & P4 are not equal to 0, so we can clearly
say that the received hamming code has errors.

Hamming Code: Error Correction

Since we found that the received code has an error, so now we must correct
them. To correct the errors, use the following steps:

Now the error word E will be:

Now we have to determine the decimal value of this error word 101 which is 5
(22 *1 + 21 * 0 + 20 *1 = 5).

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


We get E = 5, which states that the error is in the fifth data bit. To correct it, just
invert the fifth data bit.

So the correct data will be:

Cyclic Redundancy Check (CRC)

CRC is a redundancy error technique used to determine the error.

Following are the steps used in CRC for error detection:

o In CRC technique, a string of n 0s is appended to the data unit, and this n


number is less than the number of bits in a predetermined number, known
as division which is n+1 bits.
o Secondly, the newly extended data is divided by a divisor using a process
is known as binary division. The remainder generated from this division
is known as CRC remainder.
o Thirdly, the CRC remainder replaces the appended 0s at the end of the
original data. This newly generated unit is sent to the receiver.
o The receiver receives the data followed by the CRC remainder. The
receiver will treat this whole unit as a single unit, and it is divided by the
same divisor that was used to find the CRC remainder.

If the resultant of this division is zero which means that it has no error, and the
data is accepted.

If the resultant of this division is not zero which means that the data consists of
an error. Therefore, the data is discarded.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Let's understand this concept through an example:

Suppose the original data is 11100 and divisor is 1001.

CRC Generator
o A CRC generator uses a modulo-2 division. Firstly, three zeroes are
appended at the end of the data as the length of the divisor is 4 and we
know that the length of the string 0s to be appended is always one less
than the length of the divisor.
o Now, the string becomes 11100000, and the resultant string is divided by
the divisor 1001.
o The remainder generated from the binary division is known as CRC
remainder. The generated value of the CRC remainder is 111.
o CRC remainder replaces the appended string of 0s at the end of the data
unit, and the final string would be 11100111 which is sent across the
network.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


CRC Checker
o The functionality of the CRC checker is similar to the CRC generator.
o When the string 11100111 is received at the receiving end, then CRC
checker performs the modulo-2 division.
o A string is divided by the same divisor, i.e., 1001.
o In this case, CRC checker generates the remainder of zero. Therefore, the
data is accepted.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM
Error Correction

Error Correction codes are used to detect and correct the errors when data is
transmitted from the sender to the receiver.

Error Correction can be handled in two ways:

o Backward error correction: Once the error is discovered, the receiver


requests the sender to retransmit the entire data unit.
o Forward error correction: In this case, the receiver uses the error-
correcting code which automatically corrects the errors.

A single additional bit can detect the error, but cannot correct it.

For correcting the errors, one has to know the exact position of the error. For
example, If we want to calculate a single-bit error, the error correction code will
determine which one of seven bits is in error. To achieve this, we have to add
some additional redundant bits.

Suppose r is the number of redundant bits and d is the total number of the data
bits. The number of redundant bits r can be calculated by using the formula:

2r>=d+r+1

The value of r is calculated by using the above formula. For example, if the
value of d is 4, then the possible smallest value that satisfies the above relation
would be 3.

Hamming Code

Parity bits: The bit which is appended to the original data of binary bits so that
the total number of 1s is even or odd.

Even parity: To check for even parity, if the total number of 1s is even, then
the value of the parity bit is 0. If the total number of 1s occurrences is odd, then
the value of the parity bit is 1.

Odd Parity: To check for odd parity, if the total number of 1s is even, then the
value of parity bit is 1. If the total number of 1s is odd, then the value of parity
bit is 0.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Algorithm of Hamming code:
o An information of 'd' bits are added to the redundant bits 'r' to form d+r.
o The location of each of the (d+r) digits is assigned a decimal value.
o The 'r' bits are placed in the positions 1,2,.....2k-1.
o At the receiving end, the parity bits are recalculated. The decimal value of
the parity bits determines the position of an error.

Relationship b/w Error position & binary number.

Let's understand the concept of Hamming code through an example:

Suppose the original data is 1010 which is to be sent.

Total number of data bits 'd' = 4


Number of redundant bits r : 2r >= d+r+1
2r>= 4+r+1
Therefore, the value of r is 3 that satisfies the above relation.
Total number of bits = d+r = 4+3 = 7;

LRC:-
It is also known as 2-D parity check. In this method, data which the user want to
send is organised into tables of rows and columns. A block of bit is divided into
table or matrix of rows and columns. In order to detect an error, a redundant bit
is added to the whole block and this block is transmitted to receiver. The
receiver uses this redundant row to detect error. After checking the data for
errors, receiver accepts the data and discards the redundant row of bits.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Example :
If a block of 32 bits is to be transmitted, it is divided into matrix of four rows
and eight columns which as shown in the following figure :

Figure: LRC

In this matrix of bits, a parity bit (odd or even) is calculated for each column. It
means 32 bits data plus 8 redundant bits are transmitted to receiver. Whenever
data reaches at the destination, receiver uses LRC to detect error in data.
Advantage :
LRC is used to detect burst errors.
Example : Suppose 32 bit data plus LRC that was being transmitted is hit by a
burst error of length 5 and some bits are corrupted as shown in the following
figure :

Figure : Burst error & LRC

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


The LRC received by the destination does not match with newly corrupted
LRC. The destination comes to know that the data is erroneous, so it discards
the data.
Disadvantage:
The main problem with LRC is that, it is not able to detect error if two bits in a
data unit are damaged and two bits in exactly the same position in other data
unit are also damaged.
Example: If data 110011 010101 is changed to 010010110100.

Figure : Two bits at same bit position damaged in 2 data units

In this example 1st and 6th bit in one data unit is changed . Also the 1st and 6th
bit in second unit is changed.

Flow Control

When a data frame (Layer-2 data) is sent from one host to another over a single
medium, it is required that the sender and receiver should work at the same
speed. That is, sender sends at a speed on which the receiver can process and
accept the data.
If sender is sending too fast the receiver may be overloaded, (swamped) and
data may be lost.
Two types of mechanisms can be deployed to control the flow:
• Stop and Wait
This flow control mechanism forces the sender after transmitting a data
frame to stop and wait until the acknowledgement of the data-frame sent
is received.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


• Sliding Window
In this flow control mechanism, both sender and receiver agree on the
number of data-frames after which the acknowledgement should be sent.
As we learnt, stop and wait flow control mechanism wastes resources, this
protocol tries to make use of underlying resources as much as possible.

Flow Control

o It is a set of procedures that tells the sender how much data it can transmit
before the data overwhelms the receiver.
o The receiving device has limited speed and limited memory to store the
data. Therefore, the receiving device must be able to inform the sending
device to stop the transmission temporarily before the limits are reached.
o It requires a buffer, a block of memory for storing the information until
they are processed.

Two methods have been developed to control the flow of data:

o Stop-and-wait
o Sliding window

Stop-and-wait
Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM
o In the Stop-and-wait method, the sender waits for an acknowledgement
after every frame it sends.
o When acknowledgement is received, then only next frame is sent. The
process of alternately sending and waiting of a frame continues until the
sender transmits the EOT (End of transmission) frame.

Advantage of Stop-and-wait

The Stop-and-wait method is simple as each frame is checked and


acknowledged before the next frame is sent.

Stop-and-wait technique is inefficient to use as each frame must travel


across all the way to the receiver, and an acknowledgement travels all
the way before the next frame is sent. Each frame sent and received uses
the entire time needed to traverse the link.

Sliding Window

o The Sliding Window is a method of flow control in which a sender can


transmit the several frames before getting an acknowledgement.
o In Sliding Window Control, multiple frames can be sent one after the
another due to which capacity of the communication channel can be
utilized efficiently.
o A single ACK acknowledge multiple frames.
o Sliding Window refers to imaginary boxes at both the sender and receiver
end.
o The window can hold the frames at either end, and it provides the upper
limit on the number of frames that can be transmitted before the
acknowledgement.
o Frames can be acknowledged even when the window is not completely
filled.
o The window has a specific size in which they are numbered as modulo-n
means that they are numbered from 0 to n-1. For example, if n = 8, the
frames are numbered from 0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,0,1........
o The size of the window is represented as n-1. Therefore, maximum n-1
frames can be sent before acknowledgement.
o When the receiver sends the ACK, it includes the number of the next
frame that it wants to receive. For example, to acknowledge the string of
Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM
frames ending with frame number 4, the receiver will send the ACK
containing the number 5. When the sender sees the ACK with the number
5, it got to know that the frames from 0 through 4 have been received.

Error Control

When data-frame is transmitted, there is a probability that data-frame may be


lost in the transit or it is received corrupted. In both cases, the receiver does not
receive the correct data-frame and sender does not know anything about any
loss. In such case, both sender and receiver are equipped with some protocols
which helps them to detect transit errors such as loss of data-frame. Hence,
either the sender retransmits the data-frame or the receiver may request to
resend the previous data-frame.
Requirements for error control mechanism:
• Error detection - The sender and receiver, either both or any, must
ascertain that there is some error in the transit.
• Positive ACK - When the receiver receives a correct frame, it should
acknowledge it.
• Negative ACK - When the receiver receives a damaged frame or a
duplicate frame, it sends a NACK back to the sender and the sender must
retransmit the correct frame.
• Retransmission: The sender maintains a clock and sets a timeout period.
If an acknowledgement of a data-frame previously transmitted does not
arrive before the timeout the sender retransmits the frame, thinking that
the frame or it’s acknowledgement is lost in transit.

There are three types of techniques available which Data-link layer may deploy
to control the errors by Automatic Repeat Requests (ARQ):
• Stop-and-wait ARQ

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


The following transition may occur in Stop-and-Wait ARQ:
• The sender maintains a timeout counter.
• When a frame is sent, the sender starts the timeout counter.
• If acknowledgement of frame comes in time, the sender transmits the next
frame in queue.
• If acknowledgement does not come in time, the sender assumes that either
the frame or its acknowledgement is lost in transit. Sender retransmits the
frame and starts the timeout counter.
• If a negative acknowledgement is received, the sender retransmits the
frame.

Go-Back-N ARQ
Stop and wait ARQ mechanism does not utilize the resources at their best.When
the acknowledgement is received, the sender sits idle and does nothing. In Go-
Back-N ARQ method, both sender and receiver maintain a window.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


The sending-window size enables the sender to send multiple frames without
receiving the acknowledgement of the previous ones.

The receiving-window enables the receiver to receive multiple frames and


acknowledge them. The receiver keeps track of incoming frame’s sequence
number.

When the sender sends all the frames in window, it checks up to what sequence
number it has received positive acknowledgement.
If all frames are positively acknowledged, the sender sends next set of frames. If
sender finds that it has received NACK or has not receive any ACK for a
particular frame, it retransmits all the frames after which it does not receive any
positive ACK.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Selective Repeat ARQ
In Go-back-N ARQ, it is assumed that the receiver does not have any buffer
space for its window size and has to process each frame as it comes. This
enforces the sender to retransmit all the frames which are not acknowledged.

In Selective-Repeat ARQ, the receiver while keeping track of sequence


numbers, buffers the frames in memory and sends NACK for only frame which
is missing or damaged.
The sender in this case, sends only packet for which NACK is received.

Stop and Wait Protocol

Before understanding the stop and Wait protocol, we first know about the error
control mechanism. The error control mechanism is used so that the received
data should be exactly same whatever sender has sent the data. The error control
mechanism is divided into two categories, i.e., Stop and Wait ARQ and sliding
window. The sliding window is further divided into two categories, i.e., Go

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Back N, and Selective Repeat. Based on the usage, the people select the error
control mechanism whether it is stop and wait or sliding window.

What is Stop and Wait protocol?

Here stop and wait means, whatever the data that sender wants to send, he sends
the data to the receiver. After sending the data, he stops and waits until he
receives the acknowledgment from the receiver. The stop and wait protocol is a
flow control protocol where flow control is one of the services of the data link
layer.

It is a data-link layer protocol which is used for transmitting the data over the
noiseless channels. It provides unidirectional data transmission which means
that either sending or receiving of data will take place at a time. It provides
flow-control mechanism but does not provide any error control mechanism.

The idea behind the usage of this frame is that when the sender sends the frame
then he waits for the acknowledgment before sending the next frame.

Primitives of Stop and Wait Protocol

The primitives of stop and wait protocol are:

Sender side

Rule 1: Sender sends one data packet at a time.

Rule 2: Sender sends the next packet only when it receives the acknowledgment
of the previous packet.

Therefore, the idea of stop and wait protocol in the sender's side is very simple,
i.e., send one packet at a time, and do not send another packet before receiving
the acknowledgment.

Receiver side

Rule 1: Receive and then consume the data packet.

Rule 2: When the data packet is consumed, receiver sends the acknowledgment
to the sender.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Therefore, the idea of stop and wait protocol in the receiver's side is also very
simple, i.e., consume the packet, and once the packet is consumed, the
acknowledgment is sent. This is known as a flow control mechanism.

Working of Stop and Wait protocol

The above figure shows the working of the stop and wait protocol. If there is a
sender and receiver, then sender sends the packet and that packet is known as a
data packet. The sender will not send the second packet without receiving the
acknowledgment of the first packet. The receiver sends the acknowledgment for
the data packet that it has received. Once the acknowledgment is received, the
sender sends the next packet. This process continues until all the packet are not
sent. The main advantage of this protocol is its simplicity but it has some
disadvantages also. For example, if there are 1000 data packets to be sent, then
all the 1000 packets cannot be sent at a time as in Stop and Wait protocol, one
packet is sent at a time.

Disadvantages of Stop and Wait protocol

The following are the problems associated with a stop and wait protocol:

1. Problems occur due to lost data

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Suppose the sender sends the data and the data is lost. The receiver is waiting
for the data for a long time. Since the data is not received by the receiver, so it
does not send any acknowledgment. Since the sender does not receive any
acknowledgment so it will not send the next packet. This problem occurs due to
the lost data.

In this case, two problems occur:

o Sender waits for an infinite amount of time for an acknowledgment.


o Receiver waits for an infinite amount of time for a data.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


2. Problems occur due to lost acknowledgment

Suppose the sender sends the data and it has also been received by the receiver.
On receiving the packet, the receiver sends the acknowledgment. In this case,
the acknowledgment is lost in a network, so there is no chance for the sender to
receive the acknowledgment. There is also no chance for the sender to send the
next packet as in stop and wait protocol, the next packet cannot be sent until the
acknowledgment of the previous packet is received.

In this case, one problem occurs:

o Sender waits for an infinite amount of time for an acknowledgment.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


3. Problem due to the delayed data or acknowledgment

Suppose the sender sends the data and it has also been received by the receiver.
The receiver then sends the acknowledgment but the acknowledgment is
received after the timeout period on the sender's side.

As the acknowledgment is received late, so acknowledgment can be wrongly


considered as the acknowledgment of some other data packet.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Data link layer protocols are divided into two categories based on whether the
transmission channel is noiseless or noisy.
The data link layer protocol is diagrammatically represented below −

Noiseless Channels

There are two noiseless channels which are as follows −


• Simplex channel
• Stop & wait channel
Let us consider an ideal channel where no frames are lost, duplicated, or
corrupted. We introduce two protocols for this type of channel. These two
protocols are as follows −
•Protocol that does not use flow control.
• Protocol that uses the flow control.
Now let us consider the Protocols that do not use flow control −

Simplest Protocol

Step 1 − Simplest protocol that does not have flow or error control.
Step 2 − It is a unidirectional protocol where data frames are traveling in one
direction that is from the sender to receiver.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Step 3 − Let us assume that the receiver can handle any frame it receives with a
processing time that is small enough to be negligible, the data link layer of the
receiver immediately removes the header from the frame and hands the data
packet to its network layer, which can also accept the packet immediately.

Stop-and-Wait Protocol

Step 1 − If the data frames that arrive at the receiver side are faster than they
can be processed, the frames must be stored until their use.
Step 2 − Generally, the receiver does not have enough storage space, especially
if it is receiving data from many sources. This may result in either discarding of
frames or denial of service.
Step 3 − To prevent the receiver from becoming overwhelmed with frames, the
sender must slow down. There must be ACK from the receiver to the sender.
Step 4 − In this protocol the sender sends one frame, stops until it receives
confirmation from the receiver, and then sends the next frame.
Step 5 − We still have unidirectional communication for data frames, but
auxiliary ACK frames travel from the other direction. We add flow control to
the previous protocol.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Noisy Channels

There are three types of requests for the noisy channels, which are as follows −
• Stop & wait Automatic Repeat Request.
• Go-Back-N Automatic Repeat Request.
• Selective Repeat Automatic Repeat Request.
Noiseless channels are generally non-existent channels. We can ignore the error
or we need to add error control to our protocols.

Stop and Wait Automatic Repeat Request

Step 1 − In a noisy channel, if a frame is damaged during transmission, the


receiver will detect with the help of the checksum.
Step 2 − If a damaged frame is received, it will be discarded, and the
transmitter will retransmit the same frame after receiving a proper
acknowledgement.
Step 3 − If the acknowledgement frame gets lost and the data link layer on 'A'
eventually times out. Not having received an ACK, it assumes that its data
frame was lost or damaged and sends the frame containing packet 1 again. This
duplicate frame also arrives at the data link layer on 'B', thus part of the file will
be duplicated and protocol is said to be failed.
Step 4 − To solve this problem, assign a sequence number in the header of the
message.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Step 5 − The receiver checks the sequence number to determine if the message
is a duplicate since only the message is transmitted at any time.
Step 6 − The sending and receiving station needs only a 1-bit alternating
sequence of '0' or '1' to maintain the relationship of the transmitted message and
its ACK/ NAK.
Step 7 − A modulo-2 numbering scheme is used where the frames are
alternatively labelled with '0' or '1' and positive acknowledgements are of the
form ACK 0 and ACK 1.
Normal operation of Stop & Wait ARQ is given below −

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Stop & Wait ARQ with Lost frame is as follows −

Go-Back-N ARQ

To improve the transmission efficiency, we need more than one frame to be


outstanding to keep the channel busy while the sender is waiting for
acknowledgement.
There are two protocols developed for achieving this goal and they are as
follows −
• Go – Back - N – Automatic – Repeat Request
• Sliding window protocol
Go-Back-N ARQ
Step 1 − In this protocol we can send several frames before receiving
acknowledgements.
Step 2 − we keep a copy of these frames until the acknowledgment arrives.
Step 3 − Frames from a sending station are numbered sequentially. However,
we need to include the sequence number of each frame in the header; we need
to set a limit.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Step 4 − If the header of the frame allows m bits for the sequence number, the
sequence numbers range from 0 to 2m-1. We can also repeat the sequence
numbers.
Example
For m = 2, the range of sequence numbers is: 0 to 3, i.e.
0,1,2,3, 0,1,2,3,…
The Go-Back-N ARQ is shown below in diagram format −

Point - to - Point Protocol (PPP) is a communication protocol of the data link


layer that is used to transmit multiprotocol data between two directly connected
(point-to-point) computers. It is a byte - oriented protocol that is widely used in
broadband communications having heavy loads and high speeds. Since it is a
data link layer protocol, data is transmitted in frames.

Services Provided by PPP

The main services provided by Point - to - Point Protocol are −


• Defining the frame format of the data to be transmitted.
• Defining the procedure of establishing link between two points and
exchange of data.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


• Stating the method of encapsulation of network layer data in the frame.
• Stating authentication rules of the communicating devices.
• Providing address for network communication.
• Providing connections over multiple links.
• Supporting a variety of network layer protocols by providing a range os
services.

Components of PPP

Point - to - Point Protocol is a layered protocol having three components −


• Encapsulation Component − It encapsulates the datagram so that it can
be transmitted over the specified physical layer.
• Link Control Protocol (LCP) − It is responsible for establishing,
configuring, testing, maintaining and terminating links for transmission. It
also imparts negotiation for set up of options and use of features by the
two endpoints of the links.
• Authentication Protocols (AP) − These protocols authenticate endpoints
for use of services. The two authentication protocols of PPP are −
o Password Authentication Protocol (PAP)
o Challenge Handshake Authentication Protocol (CHAP)
• Network Control Protocols (NCPs) − These protocols are used for
negotiating the parameters and facilities for the network layer. For every
higher-layer protocol supported by PPP, one NCP is there. Some of the
NCPs of PPP are −
o Internet Protocol Control Protocol (IPCP)
o OSI Network Layer Control Protocol (OSINLCP)
o Internetwork Packet Exchange Control Protocol (IPXCP)
o DECnet Phase IV Control Protocol (DNCP)
o NetBIOS Frames Control Protocol (NBFCP)
o IPv6 Control Protocol (IPV6CP)

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


PPP Frame

PPP is a byte - oriented protocol where each field of the frame is composed of
one or more bytes. The fields of a PPP frame are −
• Flag − 1 byte that marks the beginning and the end of the frame. The bit
pattern of the flag is 01111110.
• Address − 1 byte which is set to 11111111 in case of broadcast.
• Control − 1 byte set to a constant value of 11000000.
• Protocol − 1 or 2 bytes that define the type of data contained in the
payload field.
• Payload − This carries the data from the network layer. The maximum
length of the payload field is 1500 bytes. However, this may be negotiated
between the endpoints of communication.
• FCS − It is a 2 byte or 4 bytes frame check sequence for error detection.
The standard code used is CRC (cyclic redundancy code)

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Byte Stuffing in PPP Frame − Byte stuffing is used is PPP payload field
whenever the flag sequence appears in the message, so that the receiver does
not consider it as the end of the frame. The escape byte, 01111101, is stuffed
before every byte that contains the same byte as the flag byte or the escape
byte. The receiver on receiving the message removes the escape byte before
passing it onto the network layer

Data Link Layer

The data link layer is used in a computer network to transmit the data between
two devices or nodes. It divides the layer into parts such as data link
control and the multiple access resolution/protocol. The upper layer has the
responsibility to flow control and the error control in the data link layer, and
hence it is termed as logical of data link control. Whereas the lower sub-layer
is used to handle and reduce the collision or multiple access on a channel.
Hence it is termed as media access control or the multiple access resolutions.

Following are the types of multiple access protocol that is subdivided into the
different process as:

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


A. Random Access Protocol

In this protocol, all the station has the equal priority to send the data over a
channel. In random access protocol, one or more stations cannot depend on
another station nor any station control another station.

Depending on the channel's state (idle or busy), each station transmits the data
frame.

However, if more than one station sends the data over a channel, there may be a
collision or data conflict.

Due to the collision, the data frame packets may be lost or changed. And hence,
it does not receive by the receiver end.

Following are the different methods of random-access protocols for


broadcasting frames on the channel.

o Aloha
o CSMA
o CSMA/CD
o CSMA/CA

ALOHA Random Access Protocol

It is designed for wireless LAN (Local Area Network) but can also be used in a
shared medium to transmit data. Using this method, any station can transmit
data across a network simultaneously when a data frameset is available for
transmission.

Aloha Rules

1. Any station can transmit data to a channel at any time.


2. It does not require any carrier sensing.
3. Collision and data frames may be lost during the transmission of data
through multiple stations.
4. Acknowledgment of the frames exists in Aloha. Hence, there is no
collision detection.
5. It requires retransmission of data after some random amount of time.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Pure Aloha

Whenever data is available for sending over a channel at stations, we use Pure
Aloha. In pure Aloha, when each station transmits data to a channel without
checking whether the channel is idle or not, the chances of collision may occur,
and the data frame can be lost.

When any station transmits the data frame to a channel, the pure Aloha waits for
the receiver's acknowledgment.

If it does not acknowledge the receiver end within the specified time, the
station waits for a random amount of time, called the backoff time (Tb).

And the station may assume the frame has been lost or destroyed. Therefore, it
retransmits the frame until all the data are successfully transmitted to the
receiver.

1. The total vulnerable time of pure Aloha is 2 * Tfr.


2. Maximum throughput occurs when G = 1/ 2 that is 18.4%.
3. Successful transmission of data frame is S = G * e ^ - 2 G.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


As we can see in the figure above, there are four stations for accessing a shared
channel and transmitting data frames. Some frames collide because most
stations send their frames at the same time. Only two frames, frame 1.1 and
frame 2.2, are successfully transmitted to the receiver end. At the same time,
other frames are lost or destroyed. Whenever two frames fall on a shared
channel simultaneously, collisions can occur, and both will suffer damage. If the
new frame's first bit enters the channel before finishing the last bit of the second
frame. Both frames are completely finished, and both stations must retransmit
the data frame.

Slotted Aloha

The slotted Aloha is designed to overcome the pure Aloha's efficiency because
pure Aloha has a very high possibility of frame hitting. In slotted Aloha, the
shared channel is divided into a fixed time interval called slots. So that, if a
station wants to send a frame to a shared channel, the frame can only be sent at
the beginning of the slot, and only one frame is allowed to be sent to each slot.
And if the stations are unable to send data to the beginning of the slot, the
station will have to wait until the beginning of the slot for the next time.
However, the possibility of a collision remains when trying to send a frame at
the beginning of two or more station time slot.

1. Maximum throughput occurs in the slotted Aloha when G = 1 that is


37%.
Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM
2. The probability of successfully transmitting the data frame in the slotted
Aloha is S = G * e ^ - 2 G.
3. The total vulnerable time required in slotted Aloha is Tfr.

CSMA (Carrier Sense Multiple Access)

It is a carrier sense multiple access based on media access protocol to sense


the traffic on a channel (idle or busy) before transmitting the data.

It means that if the channel is idle, the station can send data to the channel.
Otherwise, it must wait until the channel becomes idle. Hence, it reduces the
chances of a collision on a transmission medium.

CSMA Access Modes

1-Persistent: In the 1-Persistent mode of CSMA that defines each node, first
sense the shared channel and if the channel is idle, it immediately sends the
data. Else it must wait and keep track of the status of the channel to be idle and
broadcast the frame unconditionally as soon as the channel is idle.

Non-Persistent: It is the access mode of CSMA that defines before transmitting


the data, each node must sense the channel, and if the channel is inactive, it
immediately sends the data. Otherwise, the station must wait for a random time

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


(not continuously), and when the channel is found to be idle, it transmits the
frames.

P-Persistent: It is the combination of 1-Persistent and Non-persistent modes.


The P-Persistent mode defines that each node senses the channel, and if the
channel is inactive, it sends a frame with a P probability. If the data is not
transmitted, it waits for a (q = 1-p probability) random time and resumes the
frame with the next time slot.

O- Persistent: It is an O-persistent method that defines the superiority of the


station before the transmission of the frame on the shared channel. If it is found
that the channel is inactive, each station waits for its turn to retransmit the data.

CSMA/ CD

It is a carrier sense multiple access/ collision detection network protocol to


transmit data frames.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


The CSMA/CD protocol works with a medium access control layer.

Therefore, it first senses the shared channel before broadcasting the frames, and
if the channel is idle, it transmits a frame to check whether the transmission was
successful.

If the frame is successfully received, the station sends another frame.

If any collision is detected in the CSMA/CD, the station sends a jam/ stop
signal to the shared channel to terminate data transmission.

After that, it waits for a random time before sending a frame to a channel.

CSMA/ CA

It is a carrier sense multiple access/collision avoidance network protocol for


carrier transmission of data frames.

It is a protocol that works with a medium access control layer.

When a data frame is sent to a channel, it receives an acknowledgment to check


whether the channel is clear.

If the station receives only a single (own) acknowledgments, that means the
data frame has been successfully transmitted to the receiver.

But if it gets two signals (its own and one more in which the collision of
frames), a collision of the frame occurs in the shared channel.

Detects the collision of the frame when a sender receives an acknowledgment


signal.

Following are the methods used in the CSMA/ CA to avoid the collision:

Interframe space: In this method, the station waits for the channel to become
idle, and if it gets the channel is idle, it does not immediately send the data.
Instead of this, it waits for some time, and this time period is called
the Interframe space or IFS. However, the IFS time is often used to define the
priority of the station.

Contention window: In the Contention window, the total time is divided into
different slots. When the station/ sender is ready to transmit the data frame, it
chooses a random slot number of slots as wait time. If the channel is still busy,
it does not restart the entire process, except that it restarts the timer only to send
data packets when the channel is inactive.
Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM
Acknowledgment: In the acknowledgment method, the sender station sends the
data frame to the shared channel if the acknowledgment is not received ahead of
time.

Controlled Access Protocols


In controlled access, the stations seek information from one another to find
which station has the right to send. It allows only one node to send at a time, to
avoid collision of messages on shared medium. The three controlled-access
methods are:
1. Reservation
2. Polling
3. Token Passing
Reservation
• In the reservation method, a station needs to make a reservation before
sending data.
• The time line has two kinds of periods:
1. Reservation interval of fixed time length
2. Data transmission period of variable frames.
• If there are M stations, the reservation interval is divided into M slots, and
each station has one slot.
• Suppose if station 1 has a frame to send, it transmits 1 bit during the slot 1.
No other station is allowed to transmit during this slot.
th
• In general, i station may announce that it has a frame to send by inserting a
1 bit into i th slot. After all N slots have been checked, each station knows
which stations wish to transmit.
• The stations which have reserved their slots transfer their frames in that
order.
• After data transmission period, next reservation interval begins.
• Since everyone agrees on who goes next, there will never be any collisions.

The following figure shows a situation with five stations and a five-slot
reservation frame. In the first interval, only stations 1, 3, and 4 have made
reservations. In the second interval, only station 1 has made a

reservation.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Polling
• Polling process is similar to the roll-call performed in class. Just like the
teacher, a controller sends a message to each node in turn.
• In this, one acts as a primary station(controller) and the others are secondary
stations. All data exchanges must be made through the controller.
• The message sent by the controller contains the address of the node being
selected for granting access.
• Although all nodes receive the message but the addressed one responds to it
and sends data, if any. If there is no data, usually a “poll reject”(NAK)
message is sent back.
• Problems include high overhead of the polling messages and high
dependence on the reliability of the controller.

Token Passing
• In token passing scheme, the stations are connected logically to each other in
form of ring and access to stations is governed by tokens.
• A token is a special bit pattern or a small message, which circulate from one
station to the next in some predefined order.
• In Token ring, token is passed from one station to another adjacent station in
the ring whereas incase of Token bus, each station uses the bus to send the
token to the next station in some predefined order.
• In both cases, token represents permission to send. If a station has a frame
queued for transmission when it receives the token, it can send that frame

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


before it passes the token to the next station. If it has no queued frame, it
passes the token simply.
• After sending a frame, each station must wait for all N stations (including
itself) to send the token to their neighbours and the other N – 1 stations to
send a frame, if they have one.
• There exists problems like duplication of token or token is lost or insertion
of new station, removal of a station, which need be tackled for correct and
reliable operation of this scheme.

Channelization :-

Channelization is a multiple-access method in which the available bandwidth of


a link is shared in time, frequency, or through code, between different stations.
The three channelization protocols are FDMA, TDMA, and CDMA.

The Frequency-Division Multiple Access (FDMA):

In frequency-division multiple access (FDMA), the available bandwidth is


divided into frequency bands. Each station is allocated a band to send its data.
In other words, each band is reserved for a specific station, and it belongs to the
station all the time.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Each station also uses a bandpass filter to confine the transmitter frequencies.
To prevent station interferences, the allocated bands are separated from one
another by small guard bands. The following figure shows the idea of FDMA.

Time-Division Multiple Access (TDMA):


In time-division multiple access (TDMA), the stations share the bandwidth of
the channel in time.
Each station is allocated a time slot during which it can send data. Each station
transmits its data in is assigned time slot.
The following figure shows the idea behind TDMA.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


The main problem with TDMA lies in achieving synchronization between the
different stations.
Each station needs to know the beginning of its slot and the location of its slot.
This may be difficult because of propagation delays introduced in the system if
the stations are spread over a large area.
To compensate for the delays, we can insert guard times.
Synchronization is normally accomplished by having some synchronization bits
at the beginning of each slot.

Code-Division Multiple Access (CDMA):


CDMA simply means communication with different codes.
CDMA differs from FDMA because only one channel occupies the entire
bandwidth of the link.
It differs from TDMA because all stations can send data simultaneously; there is
no timesharing.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Implementation:

Let us assume we have four stations 1, 2, 3, and 4 connected to the same


channel. The data from station 1 are d1 , from station 2 are d2, and so on. The
code assigned to the first station is c1, to the second is c2, and so on. We
assume that the assigned codes have two properties.
1. If we multiply each code by another, we get 0.
2. If we multiply each code by itself, we get 4 (the number of stations).
With these two properties in mind, how the above four stations can send data
using the same common channel, as shown in the following figure.

Station 1 multiplies (a special kind of multiplication, as we will see) its data by


its code to get d1.c1. Station 2 multiplies its data by its code to get d2.c2. And
so on. The data that go on the channel are the sum of all these terms, as shown
in the box.

Any station that wants to receive data from one of the other three multiplies the
data on the channel by the code of the sender. For example, suppose stations 1
and 2 are talking to each other. Station 2 wants to hear what station 1 is saying.
It multiplies the data on the channel by c1 the code of station1.
Because (c1.c1) is 4, but (c2 . c1), (c3. c1), and (c4 .c1) are all 0s, station 2
divides the result by 4 to get the data from station1.

data =(d1.c1+d2.c2+d3.c3+d4.c4).c1

= c1. d1. c1+ c1. d2. c2+ c1. d3. c3+ c1. d4. c4= 4d1

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


High-level Data Link Control (HDLC)

High-level Data Link Control (HDLC) is a group of communication protocols


of the data link layer for transmitting data between network points or nodes.
Since it is a data link protocol, data is organized into frames.
A frame is transmitted via the network to the destination that verifies its
successful arrival. It is a bit - oriented protocol that is applicable for both point
- to - point and multipoint communications.

Transfer Modes

HDLC supports two types of transfer modes, normal response mode and
asynchronous balanced mode.
• Normal Response Mode (NRM) − Here, two types of stations are there,
a primary station that send commands and secondary station that can
respond to received commands. It is used for both point - to - point and
multipoint communications.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


• Asynchronous Balanced Mode (ABM) − Here, the configuration is
balanced, i.e. each station can both send commands and respond to
commands. It is used for only point - to - point communications.

HDLC Frame

HDLC is a bit - oriented protocol where each frame contains up to six fields.
The structure varies according to the type of frame. The fields of a HDLC
frame are −
• Flag − It is an 8-bit sequence that marks the beginning and the end of the
frame. The bit pattern of the flag is 01111110.
• Address − It contains the address of the receiver. If the frame is sent by
the primary station, it contains the address(es) of the secondary station(s).
If it is sent by the secondary station, it contains the address of the primary
station. The address field may be from 1 byte to several bytes.
• Control − It is 1 or 2 bytes containing flow and error control information.
• Payload − This carries the data from the network layer. Its length may
vary from one network to another.
• FCS − It is a 2 byte or 4 bytes frame check sequence for error detection.
The standard code used is CRC (cyclic redundancy code)

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Types of HDLC Frames

There are three types of HDLC frames. The type of frame is determined by the
control field of the frame −
• I-frame − I-frames or Information frames carry user data from the
network layer. They also include flow and error control information that is
piggybacked on user data. The first bit of control field of I-frame is 0.
• S-frame − S-frames or Supervisory frames do not contain information
field. They are used for flow and error control when piggybacking is not
required. The first two bits of control field of S-frame is 10.
• U-frame − U-frames or Un-numbered frames are used for myriad
miscellaneous functions, like link management. It may contain an
information field, if required. The first two bits of control field of U-frame
is 11.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


IEEE 802.3 Standard:-

Ethernet is a set of technologies and protocols that are used primarily in LANs.
It was first standardized in 1980s by IEEE 802.3 standard.
IEEE 802.3 defines the physical layer and the medium access control (MAC)
sub-layer of the data link layer for wired Ethernet networks.
Ethernet is classified into two categories: classic Ethernet and switched
Ethernet.
Classic Ethernet is the original form of Ethernet that provides data rates
between 3 to 10 Mbps. The varieties are commonly referred as 10BASE-X.
Here, 10 is the maximum throughput, i.e. 10 Mbps, BASE denoted use of
baseband transmission, and X is the type of medium used. Most varieties of
classic Ethernet have become obsolete in present communication scenario.
A switched Ethernet uses switches to connect to the stations in the LAN. It
replaces the repeaters used in classic Ethernet and allows full bandwidth
utilization.

IEEE 802.3 Popular Versions


There are a number of versions of IEEE 802.3 protocol. The most popular ones
are -
• IEEE 802.3: This was the original standard given for 10BASE-5.
• It used a thick single coaxial cable into which a connection can be tapped
by drilling into the cable to the core.
• Here, 10 is the maximum throughput, i.e. 10 Mbps, BASE denoted use of
baseband transmission, and 5 refers to the maximum segment length of
500m.
• IEEE 802.3a: This gave the standard for thin coax (10BASE-2), which is
a thinner variety where the segments of coaxial cables are connected by
BNC connectors.
• The 2 refers to the maximum segment length of about 200m (185m to be
precise).
• IEEE 802.3i: This gave the standard for twisted pair (10BASE-T) that
uses unshielded twisted pair (UTP) copper wires as physical layer
medium.
• The further variations were given by IEEE 802.3u for 100BASE-TX,
100BASE-T4 and 100BASE-FX.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


• IEEE 802.3i: This gave the standard for Ethernet over Fiber (10BASE-F)
that uses fiber optic cables as medium of transmission.

Frame Format of Classic Ethernet and IEEE 802.3

The main fields of a frame of classic Ethernet are -


• Preamble: It is the starting field that provides alert and timing pulse for
transmission.
• In case of classic Ethernet it is an 8 byte field and in case of IEEE 802.3 it
is of 7 bytes.
• Start of Frame Delimiter: It is a 1 byte field in a IEEE 802.3 frame that
contains an alternating pattern of ones and zeros ending with two ones.
• Destination Address: It is a 6 byte field containing physical address of
destination stations.
• Source Address: It is a 6 byte field containing the physical address of the
sending station.
• Length: It a 7 bytes field that stores the number of bytes in the data field.
• Data: This is a variable sized field carries the data from the upper layers.
The maximum size of data field is 1500 bytes.
• Padding: This is added to the data to bring its length to the minimum
requirement of 46 bytes.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


• CRC: CRC stands for cyclic redundancy check. It contains the error

detection.

IEEE 802.3 Standard

The IEEE 802.3 standard is popularly called as Ethernet or CSMA/CD (Carrier


Sense Multiple Access/Collision Detect).
Ethernet is a LAN architecture developed by XEROX and extended by DEC,
IC and Xerox. It is specified by IEEE 802.3, and it defines two categories such
as Baseband and Broadband.
Standard Ethernet network facilitates CSMA/CD. When a station needs to send,
it listens to the wire. If the wire is busy, the station waits just before it goes idle,
otherwise, it sends directly.
If two or more stations together begin sending on an idle cable, they will
collide. All colliding stations then remove their transmission, wait a random
time, and continue the whole process all over again.

IEEE 802.5 Standard

Token ring is the IEEE 802.5 standard for a token-passing ring in transmission
networks.
In a token ring, a special bit pattern, known as a token, circulates around the
ring when all the stations are idle.
Token Ring is formed by the nodes connected in ring format.
The principle used in the token ring network is that a token is circulating in the
ring, and whichever node grabs that token will have the right to transmit the
data.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


The token ring is the most convenient network in the workstation environment.
All the stations are connected in the structure of a ring.
Therefore, the token is deleted from the network by adjusting a single bit in the
token. After finishing the transmission, the station restores the tokens and
inserts them into the network.

Differences

The major differences between IEEE 802.3 and IEEE 802.5 are as follows −

IEEE 802.3 IEEE 802.5

The maximum size of the frame The maximum size of the frame in
in 802.3 is 1572 bytes. 802.5 is variable.

The maximum size of the data There is no limit on the maximum size
field is 0 to 1500 bytes. of the data that can be sent.

There is no provision of setting Priorities are possible.


the properties.

This protocol is very simple. This protocol is very difficult as


compared to IEEE 802.3 Standard.

The minimum frame size It can support shorter frames as well.


required is 64 bytes.

There is no control maintenance. A designated monitor station performs


maintenance.

The cable length is 50m to The cable length is 50 m to 1000m.


2000m.

Wireless LANs are those Local Area Networks that use high frequency radio
waves instead of cables for connecting the devices in LAN. Users connected by

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


WLANs can move around within the area of network coverage. Most WLANs
are based upon the standard IEEE 802.11 or WiFi.

IEEE 802.11 Architecture

The components of an IEEE 802.11 architecture are as follows


1) Stations (STA) − Stations comprise all devices and equipments that are
connected to the wireless LAN. A station can be of two types:
• Wireless Access Pointz (WAP) − WAPs or simply access points (AP)
are generally wireless routers that form the base stations or access.
• Client. − Clients are workstations, computers, laptops, printers,
smartphones, etc.
Each station has a wireless network interface controller.
2) Basic Service Set (BSS) −A basic service set is a group of stations
communicating at physical layer level. BSS can be of two categories depending
upon mode of operation:
• Infrastructure BSS − Here, the devices communicate with other devices
through access points.
• Independent BSS − Here, the devices communicate in peer-to-peer basis
in an ad hoc manner.
3) Extended Service Set (ESS) − It is a set of all connected BSS.
4) Distribution System (DS) − It connects access points in ESS.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


Advantages of WLANs

• They provide clutter free homes, offices and other networked places.
• The LANs are scalable in nature, i.e. devices may be added or removed
from the network at a greater ease than wired LANs.
• The system is portable within the network coverage and access to the
network is not bounded by the length of the cables.
• Installation and setup is much easier than wired counterparts.
• The equipment and setup costs are reduced.

Disadvantages of WLANs

• Since radio waves are used for communications, the signals are noisier
with more interference from nearby systems.
• Greater care is needed for encrypting information. Also, they are more
prone to errors. So, they require greater bandwidth than the wired LANs.
• WLANs are slower than wired LANs.

Computer Networks UNIT-2 prepared by K.TRIVENI ,Dept of CSE-MLRITM


UNIT – 3
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:
The word “internetworking,” which combines the words “inter” and “networking,” denotes a connection
between completely distinct nodes/segments. This connection is made possible by intermediary hardware
like routers or gateways. Private, public, commercial, industrial, and governmental networks frequently
connect to one another. Therefore, a degree of internetwork could be a collection of several networks that
operate as a single large network and are connected by intermediate networking devices. The trade, goods,
and methods used to address the difficulty of creating and managing internet works are referred to as
internetworking.

How does it Internetworking?


Every network node or phase is built using a similar protocol or a communication logic, such as TCP
(Transfer Control Protocol) or IP (Internet Protocol), to enable communication. It is referred to as
“internetworking” when a network interacts with another network using ongoing communication protocols.

A simple extension of a LAN is the use of a switch or hub to join two local area networks, but connecting
them via a router is an example of internetworking. The OSI-ISO model’s Layer 3 (Network Layer) enforces
internetworking. The internet is the most prominent famous example of internetworking.

Types of Internetworking
Internetworking primarily consists of three units: Extranet, Internet, and Intranet.

Extranet
It’s a network of the internetwork with a confined scope to one organisation or institution but with limited
links to one or more other networks on occasion; however, this is not always the case. It is the lowest degree
of internet usage and is typically prohibited in extremely private areas. An extranet may also be referred to
as a MAN, WAN, or another type of network, but it cannot include a single local area network; rather, it
must make at least one mention of an external network.

Internet
Internet is a specific internetworking that connects governmental, academic, public, and private networks on
a global scale. It is also the location of the World Wide Web (WWW) and is referred to as the “Internet” to
distinguish it from other generic internetworking. Internet users and their service providers utilise IP
addresses obtained from address registries that control assignments.

Intranet
This computer network can be a collection of interconnected networks that employ the Internet Protocol and
IP-based software like web browsers as well as FTP tools, all of which are controlled by a single body entity.
This body entity blocks access to the computer network for the rest of the world and only allows a select few
users. This network most frequently refers to the internal network of a business or other enterprise. To
provide users with browseable data, a large computer network can typically have its own internet server.

Internetwork Addressing
The internetwork addresses set up devices singly or collectively. Depending on the protocol family and
because of the OSI layer, addressing strategies vary. DLL, MAC addresses, and network-layer addresses are
the three types of internetwork address area units that are typically employed.

DLL Addresses
All the physical network associations of network devices are clearly identified by a data-link layer address.
Area units are frequently used as physical addresses or hardware addresses in data-link addresses. Data-link
addresses can occasionally be found within a flat address space and are pre-configured with a fixed
relationship to a particular device. End systems typically only have one data-link address since they only
have one physical network association. As a result of having many physical network connections, routers
and other internetworking equipment frequently have various data-link addresses.

MAC Addresses
Data-link layer addresses are included in MAC addresses. MAC addresses create network entities in LANs
that use the data-link layer’s IEEE MAC addresses. For each local area network interface, a unique MAC
address designates a particular area unit. MAC addresses are expressed as twelve hexadecimal numbers and
are forty-eight bits long. The Organisational Unique Identifier (OUI) is made up of the first 12 hexadecimal
digits, which are typically managed by the IEEE and identify the maker or seller.

The interface serial variety or the other price set by a specific merchant would be represented by the final
half a dozen positional notation digits. When an interface card initialises, MAC addresses are routinely traced
into RAM from ROM, where they are known as burned-in addresses (abbreviated as BIAs).

Network Layer Addresses


The network addresses can occasionally be seen in both gradable address areas and the more common virtual
or logical address area units. The relationship between the network address and the tool is logical and
flexible; it typically depends either on the properties of the physical network or on groupings without any
physical foundation. For each network-layer protocol that a finished system supports, a network-layer
address is required. For each supported network-layer protocol, routers and other internetworking devices
require a single network-layer address for every physical network association.
Tunnelling:
Tunnelling is a protocol for transferring data securely from one network to another. Using a method known
as encapsulation, Tunnelling allows private network communications to be sent across a public network,
such as the Internet. Encapsulation enables data packets to appear general to a public network when they are
private data packets, allowing them to pass unnoticed.

When data is tunnelled, it is split into smaller parts called packets, as it travels through the tunnel. The
packets are encrypted via the tunnel, and another process known as encapsulation takes place. For
transmission, private network data and protocol details are encased in public network transmission units.
The units have the appearance of public data, allowing them to be sent via the Internet. Encapsulation
enables packets to reach their intended destination. De-capsulation and decryption take place at the final
destination.

Tunnelling is possible thanks to a variety of procedures, including −

 Point-to-Point Tunnelling Protocol (PPTP)


 Layer Two Tunnelling Protocol (L2TP)

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)
ICMP:
ICMP or Internet Control Message Protocol is one of the major protocols of the TCP/IP. ICMP is a
mechanism used by the host, routers, and gateways to send error messages back to the sender. As the IP
does not provide any mechanism for error reporting and control, ICMP has been designed to compensate
for these deficiencies of the IP. However, it only reports the error and doesn't correct the error.

The Format of an ICMP message

o The first field specifies the type of the message.


o The second field specifies the reason for a particular message type.
o The checksum field covers the entire ICMP message.

The ICMP messages are divided into two categories:

1. Error Message

2. Query Message

Error Message

The error messages report the problems which may be faced by the hosts or routers when they process
the IP packet.

Query Message

The ICMP protocol can diagnose some network problems also. Query messages help the hosts to get
some specific information from a router or another host.

IGMP:
o IGMP stands for Internet Group Message Protocol.
o The IP protocol supports two types of communication:
o Unicasting: It is a communication between one sender and one receiver. Therefore, we can say that
it is one-to-one communication.
o Multicasting: Sometimes the sender wants to send the same message to a large number of receivers
simultaneously. This process is known as multicasting which has one-to-many communication.
o The IGMP protocol is used by the hosts and router to support multicasting.
o The IGMP protocol is used by the hosts and router to identify the hosts in a LAN that are the
members of a group.
o IGMP is a part of the IP layer, and IGMP has a fixed-size message.
o The IGMP message is encapsulated within an IP datagram.

The Format of IGMP message

Where,

Type: It determines the type of IGMP message. There are three types of IGMP message: Membership Query,
Membership Report and Leave Report.

Maximum Response Time: This field is used only by the Membership Query message. It determines the
maximum time the host can send the Membership Report message in response to the Membership Query
message.

Checksum: It determines the entire payload of the IP datagram in which IGMP message is encapsulated.

Forwarding & Routing: (“Refer: examples for better understanding”)


Forwarding refers to the router-local action of transferring packet from an input link interface to the
appropriate output link interface.

Routing refers to the network-wide process that determines the end-to-end paths that packets take from
source to destination.

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.
Routing Protocols:
Routing Protocols are the set of defined rules used by the routers to communicate between source &
destination. They do not move the information to the source to a destination, but only update the routing
table that contains the information.

Network Router protocols helps you to specify way routers communicate with each other. It allows the
network to select routes between any two nodes on a computer network.

Types of Routing Protocols

There are mainly two types of Network Routing Protocols

 Static
 Dynamic

Static Routing Protocols

Static routing protocols are used when an administrator manually assigns the path from source to the
destination network. It offers more security to the network.

Advantages

 No overhead on router CPU.


 No unused bandwidth between links.
 Only the administrator is able to add routes

Disadvantages

 The administrator must know how each router is connected.


 Not an ideal option for large networks as it is time intensive.
 Whenever link fails all the network goes down which is not feasible in small networks.
Dynamic Routing Protocols

Dynamic routing protocols are another important type of routing protocol. It helps routers to add
information to their routing tables from connected routers automatically. These types of protocols also
send out topology updates whenever the network changes’ topological structure.

Advantage:

 Easier to configure even on larger networks.


 It will be dynamically able to choose a different route in case if a link goes down.
 It helps you to do load balancing between multiple links.

Disadvantage:

 Updates are shared between routers, so it consumes bandwidth.


 Routing protocols put an additional load on router CPU or RAM.

Distance Vector Routing Protocol (DVR):


Distance Vector Protocols advertise their routing table to every directly connected neighbour at specific
time intervals using lots of bandwidths and slow converge.

In the Distance Vector routing protocol, when a route becomes unavailable, all routing tables need to be
updated with new information.

Example – Consider 3-routers X, Y and Z as shown in figure. Each router have their routing table.
Every routing table will contain distance to the destination nodes.

Consider router X , X will share it routing table to neighbors and neighbors will share it routing table to
it to X and distance from node X to destination will be calculated using bellmen- ford equation.
Dx(y) = min { C(x,v) + Dv(y)} for each node y ∈ N
As we can see that distance will be less going from X to Z when Y is intermediate node(hop) so it will
be update in routing table X.

Similarly for Z also –

Finally the routing table for all –

Advantages of Distance Vector routing –


 It is simpler to configure and maintain than link state routing.
Disadvantages of Distance Vector routing –
 It is slower to converge than link state.
 It is at risk from the count-to-infinity problem.
 It creates more traffic than link state since a hop count change must be propagated to all routers
and processed on each router. Hop count updates take place on a periodic basis, even if there are
no changes in the network topology, so bandwidth-wasting broadcasts still occur.
 For larger networks, distance vector routing results in larger routing tables than link state since
each router must know about all other routers. This can also lead to congestion on WAN links.

Link State Routing Protocol: (For example, refer YouTube)


While distance-vector routers use a distributed algorithm to compute their routing tables, link-state
routing uses link-state routers to exchange messages that allow each router to learn the entire network
topology. Based on this learned topology, each router is then able to compute its routing table by using
the shortest path computation.
Features of link state routing protocols –
 Link state packet – A small packet that contains routing information.

 Link state database – A collection of information gathered from the link-state packet.

 Shortest path first algorithm (Dijkstra algorithm) – A calculation performed on the


database results in the shortest path

 Routing table – A list of known paths and interfaces.


Advantages:

 This protocol maintains separate tables for both the best route and the backup routes, so it has
more knowledge of the inter-network than any other distance vector routing protocol.
 Concept of triggered updates are used, so it does not consume any unnecessary bandwidth.
 Partial updates will be triggered when there is a topology change, so it does not need to update
where the whole routing table is exchanged.

Path Vector Protocol: (For example, refer YouTube)


Path vector (PV) protocols, such as BGP, are used across domains aka autonomous systems. In a path
vector protocol, a router does not just receive the distance vector for a particular destination from its
neighbour; instead, a node receives the distance as well as path information (aka BGP path attributes),
that the node can use to calculate (via the BGP path selection process) how traffic is routed to the
destination AS.

Border Gateway Protocol (BGP):


BGP is the last routing protocol of the Internet, which is classified as a DPVP (distance path vector
protocol). The full form of BGP is the Border Gateway Protocol.

This type of routing protocol sends updated router table data when changes are made. Therefore, there is
no auto-discovery of topology changes, which means that the user needs to configure BGP manually.

Expected Questions:

1 Explain the working of Go-Back-N-ARQ sliding window


protocol.
2 Explain in detail about linear block codes.
3 Briefly explain about Stop and wait ARQ protocol.
4 Write a short technical note on HDLC.
5 Calculate CRC ,if the message is x7+x5+1 and the generator
polynomial is x3+1.
6 Compare and contrast flow control and error control.
7 Explain the concept of selective Repeat ARQ protocol.
8 What do you mean by stop and wait protocol ? Explain.
9 Explain in detail checksum with an example.
10 Explain in detail about simple parity and hamming code
techniques.
11 Explain the concept of framing.
12 Discuss the frame format of Point- to- Point protocol.
13 Draw and explain the fields of HDLC frame format.
14 What is a Sliding Window Protocol? Explain .
15 What are the functions of Data link layer ?
16 Explain the noisy channels.
17 Define Hamming distance and minimum hamming distance.
18 Explain about PPP.
19 Explain about flow control mechanisms.
20 Discuss different issues in data link layer.
UNIT-4
Process to Process Delivery:

The data link layer is responsible for delivery of frames between two neigh boring
nodes over a link. This is called node-to-node delivery. The network layer is
responsible for delivery of datagrams between two hosts. This is called host-to-
host delivery. Real communication takes place between two processes
(application programs). We need process-to-process delivery. The transport layer
is responsible for process-to-process delivery-the delivery of a packet, part of a
message, from one process to another. Figure 4.1 shows these three types of
deliveries and their domains

1. Client/Server Paradigm
Although there are several ways to achieve process-to-process communication,
the most common one is through the client/server paradigm. A process on the
local host, called a client, needs services from a process usually on the remote
host, called a server. Both processes (client and server) have the same name. For
example, to get the day and time from a remote machine, we need a Daytime
client process running on the local host and a Daytime server process running on
a remote machine. For communication, we must define the following:
1. Local host
2. Local process
3. Remote host
4. Remote process
2. Addressing
Whenever we need to deliver something to one specific destination among many,
we need an address. At the data link layer, we need a MAC address to choose one
node among several nodes if the connection is not point-to-point. A frame in the
data link layer needs a Destination MAC address for delivery and a source address
for the next node's reply.
Figure 4.2 shows this concept.

The IP addresses and port numbers play different roles in selecting the final
destination of data. The destination IP address defines the host among the
different hosts in the world. After the host has been selected, the port number
defines one of the processes on this particular host (see Figure 4.3).
3.Multiplexing and Demultiplexing

The addressing mechanism allows multiplexing and demultiplexing by the


transport layer
Multiplexing
At the sender site, there may be several processes that need to send packets.
However, there is only one transport layer protocol at any time. This is a many-
to-one relationship and requires multiplexing.

Demultiplexing
At the receiver site, the relationship is one-to-many and requires demultiplexing.
The transport layer receives datagrams from the network layer. After error
checking and dropping of the header, the transport layer delivers each message to
the appropriate process based on the port number.

UDP
o UDP stands for User Datagram Protocol.
o UDP is a simple protocol and it provides non sequenced 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
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.
o TCP is a connection-oriented protocol, which means that it first establishes the
connection between the sender and receiver in the form of a handshake. After both
the connections are verified, it begins transmitting packets. It makes the transmission
process error-free and ensures the delivery of data. It is an important part of the
communication protocols used to interconnect network devices on the internet. The
whole internet system relies on this network.
o TCP is one of the most common protocols that ensure end-to-end delivery. It
guarantees the security and integrity of the data being transmitted. It always establishes
a secure connection between the sender and receiver. The transmitter is the server, and
the receiver is known as the client. We can also say that the data transmission occurs
between the server and client. Hence, TCP is used in most of the high-level protocols,
such as FTP (File Transfer Protocol)

Features Of TCP protocol


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.
o TCP Connection (A 3-way handshake)
o Handshake refers to the process to establish connection between the client and
server. Handshake is simply defined as the process to establish a
communication link. To transmit a packet, TCP needs a three way handshake
before it starts sending data. The reliable communication in TCP is termed
as PAR (Positive Acknowledgement Re-transmission). When a sender sends the
data to the receiver, it requires a positive acknowledgement from the receiver
confirming the arrival of data. If the acknowledgement has not reached the
sender, it needs to resend that data. The positive acknowledgement from the
receiver establishes a successful connection.
o Here, the server is the server and client is the receiver. The above diagram shows
3 steps for successful connection. A 3-way handshake is commonly known as
SYN-SYN-ACK and requires both the client and server response to exchange
the data. SYN means synchronize Sequence Number and ACK
means acknowledgment. Each step is a type of handshake between the sender
and the receiver.
o The diagram of a successful TCP connection showing the three handshakes is
shown below:

o
o The three handshakes are discussed in the below steps:
o Step 1: SYN
o SYN is a segment sent by the client to the server. It acts as a connection
request between the client and server. It informs the server that the client wants
to establish a connection. Synchronizing sequence numbers also helps
synchronize sequence numbers sent between any two devices, where the same
SYN segment asks for the sequence number with the connection request.
o Step 2: SYN-ACK
o It is an SYN-ACK segment or an SYN + ACK segment sent by the server. The
ACK segment informs the client that the server has received the connection
request and it is ready to build the connection. The SYN segment informs the
sequence number with which the server is ready to start with the segments.
o Step 3: ACK
o ACK (Acknowledgment) is the last step before establishing a successful TCP
connection between the client and server. The ACK segment is sent by the client
as the response of the received ACK and SN from the server. It results in the
establishment of a reliable data connection.
o After these three steps, the client and server are ready for the data
communication process. TCP connection and termination are full-duplex, which
means that the data can travel in both the directions simultaneously.

What is a TCP Window?

A TCP window is the amount of unacknowledged data a sender can send on a particular
connection before it gets an acknowledgment back from the receiver, that it has received some
of the data.

TCP Sliding Window

The working of the TCP sliding window mechanism can be explained as below.

The sending device can send all packets within the TCP window size (as specified in
the TCP header) without receiving an ACK, and should start a timeout timer for each of
them.
The receiving device should acknowledge each packet it received, indicating the sequence
number of the last well-received packet. After receiving the ACK from the receiving device,
the sending device slides the window to right side.

In this case, the sending device can send up to 5 TCP Segments without receiving an
acknowledgement from the receiving device. After receiving the acknowledgement for
Segment 1 from the receiving device, the sending device can slide its window one TCP
Segment to the right side and the sending device can transmit segment 6 also.

If any TCP Segment lost while its journey to the destination, the receiving device cannot
acknowledge the sender. Consider while transmission, all other Segments reached the
destination except Segment 3. The receiving device can acknowledge up to Segment 2. At the
sending device, a timeout will occur and it will re-transmit the lost Segment 3. Now the
receiving device has received all the Segments, since only Segment 3 was lost. Now the
receiving device will send the ACK for Segment 5, because it has received all the Segments to
Segment 5.
Acknowledgement (ACK) for Segment 5 ensures the sender the receiver has succesfully
received all the Segments up to 5.

TCP uses a byte level numbering system for communication. If the sequence number for a TCP
segment at any instance was 5000 and the Segment carry 500 bytes, the sequence number for
the next Segment will be 5000+500+1. That means TCP segment only carries the sequence
number of the first byte in the segment.

The Window size is expressed in number of bytes and is determined by the receiving device
when the connection is established and can vary later. You might have noticed when
transferring big files from one Windows machine to another, initially the time remaining
calculation will show a large value and will come down later.

We have four catagories in above example.

1) Bytes already sent and acknowledged (upto Byte 20).


2) Bytes sent but not acknowledged (Bytes 21-24).

3) Bytes the receiver is ready to accept (Bytes 25-28).

4) Bytes the receiver is not ready to accept (Byte 29 onwards).

The Send Window is the sum of Bytes sent but not acknowledged and Bytes the
Congestion Control Algorithms
What is Congestion?
When too many packets are present in the subnet performance degrades. This
situation is called
Congestion.
The number of packets dumped into the subnet are within its carrying
capacity, they are all
delivered.
However, if the traffic increases too far, the routers are unable to cope and
begin losing packets.
At very high traffic, performance collapse completely and almost no packets
are delivered.

What factors will lead to congestion?


1. Three or four input lines and only one output line queue will build up.
If there is insufficient memory to hold all of them, packets will lost.
Adding infinite memory congestion gets worse, because by the time packets
get to the
front of the queue, the time out and duplicates have been sent.
2. Slow processors (routers) can cause congestion.
* A slow processor perform the book keeping tasks very slow, queues will
build up.
3. Low band-width lines also cause congestion
* Upgrading lines but not changing the processor and vice-versa shifts the
bottleneck.
This problem will persist until all components are in balance.

What is the difference between Congestion control


and Flow control?

Congestion control is global issue and flow control is local


issue.
Ex:

 Consider a network with a capacity of 1000Gbps on


which a super computer is trying to transfer a file to
a personal computer at 1Gbps.Here a flow control is
needed.
* Consider a network with 1Mbps lines and 1000 large
computers, more than half are trying to transfer files a
100kbps to the other half. The problem is here is the total
offered traffic exceeds than the network handle.
Congestion control refers to the techniques used to control
or prevent congestion. Congestion control techniques can be
broadly classified into two categories:

Open Loop Congestion Control


Open loop congestion control policies are applied to prevent
congestion before it happens. The congestion control is
handled either by the source or the destination.
Policies adopted by open loop congestion control –

1. Retransmission Policy :
It is the policy in which retransmission of the packets
are taken care of. If the sender feels that a sent packet
is lost or corrupted, the packet needs to be
retransmitted. This transmission may increase the
congestion in the network.
To prevent congestion, retransmission timers must be
designed to prevent congestion and also able to
optimize efficiency.

2. Window Policy :
The type of window at the sender’s side may also
affect the congestion. Several packets in the Go-back-
n window are re-sent, although some packets may be
received successfully at the receiver side. This
duplication may increase the congestion in the network
and make it worse.
Therefore, Selective repeat window should be adopted
as it sends the specific packet that may have been
lost.

3. Discarding Policy :
A good discarding policy adopted by the routers is that
the routers may prevent congestion and at the same
time partially discard the corrupted or less sensitive
packages and also be able to maintain the quality of a
message.
In case of audio file transmission, routers can discard
less sensitive packets to prevent congestion and also
maintain the quality of the audio file.

4. Acknowledgment Policy :
Since acknowledgements are also the part of the load
in the network, the acknowledgment policy imposed by
the receiver may also affect congestion. Several
approaches can be used to prevent congestion related
to acknowledgment.
The receiver should send acknowledgement for N
packets rather than sending acknowledgement for a
single packet. The receiver should send an
acknowledgment only if it has to send a packet or a
timer expires.

5. Admission Policy :
In admission policy a mechanism should be used to
prevent congestion. Switches in a flow should first
check the resource requirement of a network flow
before transmitting it further. If there is a chance of a
congestion or there is a congestion in the network,
router should deny establishing a virtual network
connection to prevent further congestion.
All the above policies are adopted to prevent congestion
before it happens in the network.

Closed Loop Congestion Control


Closed loop congestion control techniques are used to treat or
alleviate congestion after it happens. Several techniques are
used by different protocols; some of them are:

1. Backpressure :
Backpressure is a technique in which a congested node stops
receiving packets from upstream node. This may cause the
upstream node or nodes to become congested and reject
receiving data from above nodes. Backpressure is a node-to-
node congestion control technique that propagate in the
opposite direction of data flow. The backpressure technique
can be applied only to virtual circuit where each node has
information of its above upstream node.

In above diagram the 3rd node is congested and stops


receiving packets as a result 2nd node may be get congested
due to slowing down of the output data flow. Similarly 1st node
may get congested and inform the source to slow down.

2. Choke Packet Technique :


Choke packet technique is applicable to both virtual networks
as well as datagram subnets. A choke packet is a packet sent
by a node to the source to inform it of congestion. Each router
monitors its resources and the utilization at each of its output
lines. Whenever the resource utilization exceeds the threshold
value which is set by the administrator, the router directly
sends a choke packet to the source giving it a feedback to
reduce the traffic. The intermediate nodes through which the
packets has traveled are not warned about congestion.

3. Implicit Signaling :
In implicit signaling, there is no communication between the
congested nodes and the source. The source guesses that
there is congestion in a network. For example when sender
sends several packets and there is no acknowledgment for a
while, one assumption is that there is a congestion.

4. Explicit Signaling :
In explicit signaling, if a node experiences congestion it can
explicitly sends a packet to the source or destination to inform
about congestion. The difference between choke packet and
explicit signaling is that the signal is included in the packets
that carry data rather than creating a different packet as in
case of choke packet technique.
Explicit signaling can occur in either forward or backward
direction.
 Forward Signaling : In forward signaling, a signal is
sent in the direction of the congestion. The destination
is warned about congestion. The receiver in this case
adopt policies to prevent further congestion.
 Backward Signaling : In backward signaling, a signal
is sent in the opposite direction of the congestion. The
source is warned about congestion and it needs to
slow down.

Quality-of-Service (QoS) refers to traffic control mechanisms


that seek to either differentiate performance based on
application or network-operator requirements or provide
predictable or guaranteed performance to applications,
sessions, or traffic aggregates. Basic phenomenon for QoS
means in terms of packet delay and losses of various kinds.
Need for QoS –
 Video and audio conferencing require bounded delay
and loss rate.
 Video and audio streaming requires bounded packet
loss rate, it may not be so sensitive to delay.
 Time-critical applications (real-time control) in which
bounded delay is considered to be an important factor.
 Valuable applications should be provided better
services than less valuable applications.
QoS Specification –
QoS requirements can be specified as:
1. Delay
2. Delay Variation(Jitter)
3. Throughput
4. Error Rate
• Delay
Delay of a message from source to destination is a very important
characteristic. However, delay can be tolerated differently by the
different applications.
For example: The time delay cannot be tolerated in audio
conferencing (needs a minimum time delay), while the time
delay in the e-mail or file transfer has less importance.
• Jitter
The jitter is the variation in the packet delay. If the difference
between delays is large, then it is called as high jitter. On the
contrary, if the difference between delays is small, it is known as
low jitter. Real time audio and video applications cannot tolerate
high jitter.
Example: Case1: If 3 packets are sent at times 0, 1, 2 and received
at 10, 11, 12. Here, the delay is same for all packets and it is
acceptable for the telephonic conversation. Case2: If 3 packets 0,
1, 2 are sent and received at 31, 34, 39, so the delay is different for
all packets. In this case, the time delay is not acceptable for the
telephonic conversation.
• Bandwidth
Bandwidth is measured by bits per second. Different applications
need the different bandwidth.
For example: Video conferencing needs more bandwidth in
comparison to that of sending an e-mail.
• Throughput
Amount of data transferred from one place to another or
processed in a specified amount of time. Data transfer rate for
networks are measured in terms of throughput (in terms of Kbps,
Mbps).
Expected Questions:
1 Explain the basic difference between IEEE 802.3 and
switched Ethernet, as far as implementation is concerned.
2 Explain the two techniques for implementing Ethernet
switches.
3 List out the different categories of Fast Ethernet?
4 List out the Objectives of The Gigabit Ethernet Alliance?
5 Describe in detail MAC.
6 Explain in detail about CSMA/CD.
7 Explain in detail about CSMA/CA with a neat diagram.
8 Explain in what situations contention based MAC protocols
are suitable?
9 Define vulnerable period? How it affects the performance in
MAC protocols?
10 Describe the different types of cabling supported by Ethernet
standard?
11 Describe wireless LANs?
12 Write about Channel Access on links.
13 Explain about Gigabit Ethernet .
14 Define controlled access and explain reservation and
polling methods.
15 Explain CSMA/CD with neat diagram?
16 Describe about different categories of Fast Ethernet?
17 Explain about FDMA and TDMA in detail?
18 Compare and contrast a random access protocol, controlled
access protocol and channelization.
19 Explain in detail about IEEE standards .
20 Explain the concept of Polling.
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.
Functions of Application layer:
• Identifying communication partners: The application layer
identifies the availability of communication partners for an application
with data to transmit.
• Determining resource availability: The application layer
determines whether sufficient network resources are available for the
requested communication.
• Synchronizing communication: All the communications occur
between the applications requires cooperation which is managed by
an application layer.
Services of Application layer
• File Transfer, Access, and Management (FTAM): An application
allows a user to access files in a remote computer, to retrieve files
from a computer and to manage files in a remote computer. FTAM
defines a hierarchical virtual file in terms of file structure, file
attributes and the kind of operations performed on the files and their
attributes.
• Addressing: To obtain communication between client and server,
there is a need for addressing. When a client made a request to the
server, the request contains the server address and its own address.
The server response to the client request, the request contains the
destination address, i.e., client address. To achieve this kind of
addressing, DNS is used.
• Mail Services: An application layer provides Email forwarding and
Application Layer Protocols:
• DNS
• SMTP
• FTP
• WWW
• HTTP
• SNMP
Domain Name Space:
• Alternatively referred to as a namespace, a domain namespace is a
name service provided by the Internet for Transmission Control
Protocol networks/Internet Protocol (TCP/IP). DNS is broken up into
domains, a logical organization of computers that exist in a larger
network. Below is an example of the hierarchy of domain naming on
the Internet.
DNS
DNS in the Internet

• DNS is a protocol that can be used in different platform.


• Domain Name Space is divided into different sections in
the Internet: Generic domain, country domain and
inverse domain.
Generic Domains
Inverse Domains
Country Domains
Domain Names
• Country DomainsCountry domain uses two character
country abbreviations.
• Second labels can be more specific, national
designation.
• For example, for Australia the country domain is “au”,
Inida is .in, UK is .uk etc.

• Generic Domains
• The generic domains define registered hosts according
to their generic behavior.
Domain Names
• Inverse DomainsInverse domain is used to map an
address to a name.
• For example, a client send a request to the server for
performing a particular task, server finds a list of
authorized client. The list contains only IP addresses of
the client.
• The server sends a query to the DNS server to map an
address to a name to determine if the client is on the
authorized list.
• This query is called an inverse query.
Electronic Mail
• 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. These are explained
as following below.
Electronic Mail
1.User Agent (UA) : The UA is normally a program which is used to
send and receive mail. Sometimes, it is called as mail reader. It accepts
variety of commands for composing, receiving and replying to
messages as well as for manipulation of the mailboxes.
2.Message Transfer Agent (MTA) : MTA is actually responsible for
transfer of mail from one system to another. To send a mail, a system
must have client MTA and system MTA. It transfer mail to mailboxes
of recipients if they are connected in the same machine. It delivers
mail to peer MTA if destination mailbox is in another machine. The
delivery from one MTA to another MTA is done by Simple Mail
Transfer Protocol.
Electronic Mail
Electronic Mail
Mailbox : It is a file on local hard drive to collect mails. Delivered mails are
present in this file. The user can read it delete it according to his/her
requirement. To use e-mail system each user must have a mailbox . Access to
mailbox is only to owner of mailbox.
Spool file : This file contains mails that are to be sent. User agent appends
outgoing mails in this file using SMTP. MTA extracts pending mail from
spool file for their delivery. E-mail allows one name, an alias, to represent
several different e-mail addresses. It is known as mailing list, Whenever user
have to sent a message, system checks recipient’s name against alias database.
If mailing list is present for defined alias, separate messages, one for each
entry in the list, must be prepared and handed to MTA. If for defined alias,
there is no such mailing list is present, name itself becomes naming address
and a single message is delivered to mail transfer entity.
Services provided by E-mail system :

• Composition – The composition refer to process that creates


messages and answers. For composition any kind of text editor can
be used.
• Transfer – Transfer means sending procedure of mail i.e. from the
sender to recipient.
• Reporting – Reporting refers to confirmation for delivery of mail. It
help user to check whether their mail is delivered, lost or rejected.
• Displaying – It refers to present mail in form that is understand by
the user.
• Disposition – This step concern with recipient that what will
recipient do after receiving mail i.e save mail, delete before reading
or delete after reading.
SMTP
• SMTP is an application layer protocol. The client who wants to
send the mail opens a TCP connection to the SMTP server and
then sends the mail across the connection. The SMTP server is
an always-on listening mode. As soon as it listens for a TCP
connection from any client, the SMTP process initiates a
connection through port 25. After successfully establishing a
TCP connection the client process sends the mail instantly.
SMTP Models
The SMTP model is of two types:
1.End-to-end method
2.Store-and- forward method
The end-to-end model is used to communicate between different
organizations whereas the store and forward method is used within an
organization. An SMTP client who wants to send the mail will contact
the destination’s host SMTP directly, in order to send the mail to the
destination. The SMTP server will keep the mail to itself until it is
successfully copied to the receiver’s SMTP.
The client SMTP is the one that initiates the session so let us call it
client- SMTP and the server SMTP is the one that responds to the
session request so let us call it receiver-SMTP. The client- SMTP will
start the session and the receiver-SMTP will respond to the request.
SMTP
FTP
• File Transfer Protocol(FTP) is an application layer protocol that moves files
between local and remote file systems. It runs on the top of TCP, like HTTP. To
transfer a file, 2 TCP connections are used by FTP in parallel: control connection
and data connection.
• control connection
For sending control information like user identification, password, commands to
change the remote directory, commands to retrieve and store files, etc., FTP
makes use of a control connection. The control connection is initiated on port
number 21.
data connection
For sending the actual file, FTP makes use of a data connection. A data connection
is initiated on port number 20.
FTP sends the control information out-of-band as it uses a separate control
connection. Some protocols send their request and response header lines and the
data in the same TCP connection. For this reason, they are said to send their
control information in-band. HTTP and SMTP are such examples.
FTP
FTP
• FTP Session :
When an FTP session is started between a client and a server,
the client initiates a control TCP connection with the server-side.
The client sends control information over this. When the server
receives this, it initiates a data connection to the client-side.
Only one file can be sent over one data connection. But the
control connection remains active throughout the user session.
As we know HTTP is stateless i.e. it does not have to keep track
of any user state. But FTP needs to maintain a state about its
user throughout the session.
WWW
• When most of us talk about using the "Internet", we're typically
talking about a specific part of the Internet: the World Wide
Web (WWW, or simply, the Web).
• The Web is a massive network of webpages, programs, and
files that are accessible via URLs.
• We call it a web because of its vast interconnectedness.
Starting from one URL, such as http://wikipedia.org, we can
follow links to eventually reach millions of webpages from
across the globe.
HTTP
• HTTP stands for HyperText Transfer Protocol. It is invented by Tim
Berner. HyperText is the type of text which is specially coded with the help
of some standard coding language called HyperText Markup Language
(HTML).
• The protocols that are used to transfer hypertext between two computers is
known as HyperText Transfer Protocol.
HTTP provides standard between a web browser and web server to establish
communication. It is set of rules for transferring data from one computer to
another. Data such as text, images, and other multimedia files are shared on
the World Wide Web. Whenever a web user opens their web browser, user
indirectly uses HTTP. It is an application protocol which is used for
distributed, collaborative, hypermedia information systems.
HTTP
SNMP
• Simple Network Management Protocol (SNMP) –
SNMP is an application layer protocol that uses UDP port number 161/162.SNMP is used to monitor
the network, detect network faults, and sometimes even used to configure remote devices.
• SNMP components –
There are 3 components of SNMP:

1. SNMP Manager –
It is a centralized system used to monitor network. It is also known as Network Management Station
(NMS)

2. SNMP agent –
It is a software management software module installed on a managed device. Managed devices
can be network devices like PC, routers, switches, servers, etc.

3. Management Information Base –


MIB consists of information on resources that are to be managed. This information is organized
hierarchically. It consists of objects instances which are essentially variables.
SNMP

You might also like