Lecture Notes
Lecture Notes
COMPUTER NETWORKS
DATA COMMUNICATIONS
Data communications are the exchange of data between two devices via some form of
transmission medium such as a wire cable. For data communications to occur, the
communicating devices must be part of a communication system made up of a combination of
hardware (physical equipment) and software (programs). The effectiveness of a data
communications system depends on four fundamental characteristics: delivery, accuracy,
timeliness, and jitter.
1. Delivery. The system must deliver data to the correct destination. Data must be received by
the intended device or user and only by that device or user.
2. Accuracy. The system must deliver the data accurately. Data that have been altered in
transmission and left uncorrected are unusable.
3. Timeliness. The system must deliver data in a timely manner. Data delivered late are useless.
In the case of video and audio, timely delivery means delivering data as they are produced, in the
same order that they are produced, and without significant delay. This kind of delivery is called
real-time transmission.
4. Jitter. Jitter refers to the variation in the packet arrival time. It is the uneven delay in the
delivery of audio or video packets.
Components:
A data communications system has five components.
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. 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. 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.
Network Criteria
A network must be able to meet a certain number of criteria. The most important of these are
performance, reliability, and security.
Performance:
Performance can be measured in many ways, including transit time and response time. Transit
time is the amount of time required for a message to travel from one device to another. Response
time is the elapsed time between an inquiry and a response. The performance of a network
depends on a number of factors, including the number of users, the type of transmission medium,
the capabilities of the connected hardware, and the efficiency of the software.
Reliability:
Network reliability is measured by the frequency of failure, the time it takes a link to recover
from a failure, and the network's robustness in a catastrophe.
Security:
Network security issues include protecting data from unauthorized access, protecting data from
damage and development, and implementing policies and procedures for recovery from breaches
and data losses.
PHYSICAL STRUCTURES
Multipoint
A multipoint (also called multidrop) connection is one in which more than two specific devices
share a single link. In a multipoint environment, the capacity of the channel is shared, either
spatially or temporally. If several devices can use the link simultaneously, it is a spatially shared
connection. If users must take turns, it is a timeshared connection.
1. Mesh: In a mesh topology, every device has a dedicated point-to-point link to every other
device. The term dedicated means that the link carries traffic only between the two devices it
connects. To find the number of physical links in a fully connected mesh network with n nodes,
we first consider that each node must be connected to every other node. Node 1 must be
connected to n - I nodes, node 2 must be connected to n – 1 nodes, and finally node n must be
connected to n - 1 nodes. We need n(n - 1) physical links. However, if each physical link allows
communication in both directions (duplex mode), we can divide the number of links by 2. In
other words, we can say that in a mesh topology, we need n(n -1) /2 duplex-mode links. To
accommodate that many links, every device on the network must have n – 1 input/output ports to
be connected to the other n - 1 stations.
Advantages:
1. The use of dedicated links guarantees that each connection can carry its own data load, thus
eliminating the traffic problems that can occur when links must be shared by multiple devices.
2. A mesh topology is robust. If one link becomes unusable, it does not incapacitate the entire
system.
Disadvantages:
1. Disadvantage of a mesh are related to the amount of cabling because every device must be
connected to every other device.
3. The sheer bulk of the wiring can be greater than the available space (in walls, ceilings, or
floors) can accommodate.
4. The hardware required to connect each link (I/O ports and cable) can be prohibitively
expensive.
Advantages:
1. A star topology is less expensive than a mesh topology. In a star, each device needs only one
link and one I/O port to connect it to any number of others.
2. Easy to install and reconfigure.
3. Far less cabling needs to be housed, and additions, moves, and deletions involve only one
connection: between that device and the hub.
4. Other advantage include robustness. If one link fails, only that link is affected. All other links
remain active. This factor also lends itself to easy fault identification and fault isolation. As long
as the hub is working, it can be used to monitor link problems and bypass defective links.
Disadvantages:
One big disadvantage of a star topology is the dependency of the whole topology on one single point,
the hub. If the hub goes down, the whole system is dead. Although a star requires far less cable than a
mesh, each node must be linked to a central hub. For this reason, often more cabling is required in a
star than in some other topologies (such as ring or bus).
Characteristics of Signals:
1. Peak Amplitude
The peak amplitude of a signal is the absolute value of its highest intensity, proportional to the
energy it carries. For electric signals, peak amplitude is normally measured in volts. Figure
below shows two signals and their peak amplitudes.
I. A sine wave with a phase of 0° starts at time 0 with a zero amplitude. The amplitude is
increasing.
II. A sine wave with a phase of 90° starts at time 0 with a peak amplitude. The amplitude is
decreasing.
III. A sine wave with a phase of 180° starts at time 0 with a zero amplitude. The amplitude is
decreasing.
We send 1 bit per level in part a of the figure and 2 bits per level in part b of the figure. In
general, if a signal has L levels, each level needs log2L bits.
Bit Rate
Most digital signals are nonperiodic, and thus period and frequency are not appropriate
characteristics. Another term-bit rate is used to describe digital signals. The bit rate is the
number of bits sent in 1s, expressed in bits per second (bps). Figure 3.16 shows the bit rate for
two signals.
1. Attenuation
Attenuation means a loss of energy. When a signal, simple or composite, travels through a
medium, it loses some of its energy in overcoming the resistance of the medium. That is why a
wire carrying electric signals gets warm, if not hot, after a while. Some of the electrical energy in
the signal is converted to heat. To compensate for this loss, amplifiers are used to amplify the
signal. Attenuation is measured in terms of Decibels.
The decibel (dB) measures the relative strengths of two signals or one signal at two different
points. Note that the decibel is negative if a signal is attenuated and positive if a signal is
amplified.
dB=10log10 P2/P1
Variables PI and P2 are the powers of a signal at points 1 and 2, respectively.
2. Distortion:
Distortion means that the signal changes its form or shape. Distortion can occur in a composite
signal made of different frequencies. Each signal component has its own propagation speed
through a medium and, therefore, its own delay in arriving at the final destination. Differences in
delay may create a difference in phase if the delay is not exactly the same as the period duration.
In other words, signal components at the receiver have phases different from what they had at the
3. Noise
Noise is another cause of impairment. Several types of noise, such as thermal noise, induced
noise, crosstalk, and impulse noise, may corrupt the signal. Thermal noise is the random motion
of electrons in a wire which creates an extra signal not originally sent by the transmitter. Induced
noise comes from sources such as motors and appliances. These devices act as a sending
antenna, and the transmission medium acts as the receiving antenna. Crosstalk is the effect of
one wire on the other. One wire acts as a sending antenna and the other as the receiving antenna.
Impulse noise is a spike (a signal with high energy in a very short time) that comes from power
lines, lightning, and so on.
DIGITAL-TO-ANALOG CONVERSION
Digital-to-analog conversion is the process of changing one of the characteristics of an analog
signal based on the information in digital data. Figure 5.1 shows the relationship between the
digital information, the digital-to-analog modulating process, and the resultant analog signal.
A sine wave is defined by three characteristics: amplitude, frequency, and phase. When we vary
anyone of these characteristics, we create a different version of that wave. So, by changing one
characteristic of a simple electric signal, we can use it to represent digital data. Any of the three
characteristics can be altered in this way, giving us at least three mechanisms for modulating
digital data into an analog signal: amplitude shift keying (ASK), frequency shift keying (FSK),
and phase shift keying (PSK).
Aspects of Digital-to-Analog Conversion
Before we discuss specific methods of digital-to-analog modulation, two basic issues
must be reviewed: bit and baud rates and the carrier signal.
Data Element Versus Signal Element
Data element as the smallest piece of information to be exchanged, the bit. We also defined a
signal element as the smallest unit of a signal that is constant.
Transmission of binary data across a link can be accomplished in either parallel or serial mode. In
parallel mode, multiple bits are sent with each clock tick. In serial mode, 1 bit is sent with each clock
tick.
Parallel Transmission
• Binary data, consisting of 1s and 0s, may be organized into groups of n bits each. Computers
produce and consume data in groups of bits much as we conceive of and use spoken language
in the form of words rather than letters.
• By grouping, we can send data n bits at a time instead of 1. This is called parallel transmission.
The mechanism for parallel transmission is a conceptually simple one: Use n wires to send n
bits at one time. That way each bit has its own wire, and all n bits of one group can be
transmitted with each clock tick from one device to another. Typically, the eight wires are
bundled in a cable with a connector at each end.
• The advantage of parallel transmission is speed. Parallel transmission can increase the transfer
speed by a factor of n over serial transmission. But there is a significant disadvantage: cost.
Parallel transmission requires n communication lines (wires in the example) just to transmit
the data stream. Because this is expensive, parallel transmission is usually limited to short
distances.
Serial Transmission
• In serial transmission one bit follows another, so we need only one communication channel
rather than n to transmit data between two communicating devices. The advantage of serial
over parallel transmission is that with only one communication channel, serial transmission
reduces the cost of transmission over parallel by roughly a factor of n.
• Since communication within devices is parallel, conversion devices are required at the
interface between the sender and the line (parallel-to-serial) and between the line and the
receiver (serial-to-parallel).
Advantages of Circuit Switching
The main advantage of circuit switching is that a committed transmission channel
is established between the computers which give a guaranteed data rate.
In circuit switching, there is no delay in data flow because of the dedicated
transmission path.
Reliability: Circuit switching provides a high level of reliability since the dedicated
communication path is reserved for the entire duration of the communication. This
ensures that the data will be transmitted without any loss or corruption.
Quality of service: Circuit switching provides a guaranteed quality of service,
which means that the network can prioritize certain types of traffic, such as voice
and video, over other types of traffic, such as email and web browsing.
Security: Circuit switching provides a higher level of security compared to packet
switching since the dedicated communication path is only accessible to the two
communicating parties. This can help prevent unauthorized access and data
breaches.
Ease of management: Circuit switching is relatively easy to manage since the
communication path is pre-established and dedicated to a specific communication.
This can help simplify network management and reduce the risk of errors.
Compatibility: Circuit switching is compatible with a wide range of devices and
protocols, which means that it can be used with different types of networks and
applications. This makes it a versatile technology for various industries and use
cases.
Disadvantages of Circuit Switching
Limited scalability: Circuit switching is not well-suited for large-scale networks
with many nodes, as it requires a dedicated communication path between each pair
of nodes. This can result in a high degree of complexity and difficulty in managing
the network.
Vulnerability to failures: Circuit switching relies on a dedicated communication
path, which can make the network vulnerable to failures, such as cable cuts or
switch failures. In the event of a failure, the communication path must be re-
established, which can result in delays or loss of data.
Limited Flexibility: Circuit switching is not flexible as it requires a dedicated
circuit between the communicating devices. The circuit cannot be used Waste of
Resources for any other purpose until the communication is complete, which limits
the flexibility of the network.
Waste of Resources: Circuit switching reserves the bandwidth and network
resources for the duration of the communication, even if there is no data being
transmitted. This results in the wastage of resources and inefficient use of the
network.
Expensive: Circuit switching is an expensive technology as it requires dedicated
communication paths, which can be costly to set up and maintain. This makes it less
feasible for small-scale networks and applications.
Susceptible to Failure: Circuit switching is susceptible to failure as it relies on a
dedicated communication path. If the path fails, the entire communication is
disrupted. This makes it less reliable than other networking technologies, such
as packet switching.
Not suitable for high traffic: Circuit switching is not suitable for high traffic,
where data is transmitted intermittently at irregular intervals. This is because a
dedicated circuit needs to be established for each communication, which can result
in delays and inefficient use of resources.
Delay and latency: Circuit switching requires the establishment of a dedicated
communication path, which can result in delay and latency in establishing the path
and transmitting data. This can impact the real-time performance of applications,
such as voice and video.
High cost: Circuit switching requires the reservation of resources, which can result
in a high cost, particularly in large-scale networks. This can make circuit switching
less practical for some applications.
No prioritization: Circuit switching does not provide any mechanism for
prioritizing certain types of traffic over others.
Difference between Circuit Switching and Packet Switching
In-circuit switching, each data unit In Packet switching, each data unit just knows
knows the entire path address which is the final destination address intermediate path is
provided by the source. decided by the routers.
Circuit Switching Packet Switching
The delay between data units in circuit The delay between data units in packet
switching is uniform. switching is not uniform.
Circuit switching is not convenient for Packet switching is suitable for handling
handling bilateral traffic. bilateral traffic.
OSI MODEL
The OSI (Open Systems Interconnection) Model is a set of rules that explains how different
computer systems communicate over a network. OSI Model was developed by the International
Organization for Standardization (ISO). The OSI Model consists of 7 layers and each layer has
specific functions and responsibilities. This layered approach makes it easier for different
devices and technologies to work together. OSI Model provides a clear structure for data
transmission and managing network issues. The OSI Model is widely used as a reference to
understand how network systems function.
Layers of the OSI Model
There are 7 layers in the OSI Model and each layer has its specific role in handling data. All
the layers are mentioned below:
Physical Layer
Network Layer
Transport Layer
Session Layer
Presentation Layer
Application Layer
The lowest layer of the OSI reference model is the Physical Layer. It is responsible for the
actual physical connection between the devices. The physical layer contains information in the
form of bits. Physical Layer is responsible for transmitting individual bits from one node to the
next. When receiving data, this layer will get the signal received and convert it into 0s and 1s
and send them to the Data Link layer, which will put the frame back together. Common physical
layer devices are Hub, Repeater, Modem, and Cables.
Physical Layer
Bit Synchronization: The physical layer provides the synchronization of the bits by
providing a clock. This clock controls both sender and receiver thus providing
synchronization at the bit level.
Bit Rate Control: The Physical layer also defines the transmission rate i.e. the number
of bits sent per second.
Physical Topologies: Physical layer specifies how the different, devices/nodes are
arranged in a network i.e. bus topology, star topology, or mesh topology.
Transmission Mode: Physical layer also defines how the data flows between the two
connected devices. The various transmission modes possible are Simplex, half-duplex
and full duplex.
The data link layer is responsible for the node-to-node delivery of the message. The main
function of this layer is to make sure data transfer is error-free from one node to another, over
the physical layer. When a packet arrives in a network, it is the responsibility of the DLL to
transmit it to the Host using its MAC address. Packet in the Data Link layer is referred to as
Frame. Switches and Bridges are common Data Link Layer devices.
The Receiver’s MAC address is obtained by placing an ARP (Address Resolution Protocol)
request onto the wire asking, “Who has that IP address?” and the destination host will reply
with its MAC address.
Framing: Framing is a function of the data link layer. It provides a way for a sender to
transmit a set of bits that are meaningful to the receiver. This can be accomplished by
attaching special bit patterns to the beginning and end of the frame.
Physical Addressing: After creating frames, the Data link layer adds physical
addresses (MAC addresses) of the sender and/or receiver in the header of each frame.
Error Control: The data link layer provides the mechanism of error control in which
it detects and retransmits damaged or lost frames.
Flow Control: The data rate must be constant on both sides else the data may get
corrupted thus, flow control coordinates the amount of data that can be sent before
receiving an acknowledgment.
The network layer works for the transmission of data from one host to the other located in
different networks. It also takes care of packet routing i.e. selection of the shortest path to
transmit the packet, from the number of routes available. The sender and receiver’s
IP address are placed in the header by the network layer. Segment in the Network layer is
referred to as Packet. Network layer is implemented by networking devices such as routers and
switches.
Logical Addressing: To identify each device inter-network uniquely, the network layer
defines an addressing scheme. The sender and receiver’s IP addresses are placed in the
header by the network layer. Such an address distinguishes each device uniquely and
universally.
The transport layer provides services to the application layer and takes services from the
network layer. The data in the transport layer is referred to as Segments. It is responsible for
the end-to-end delivery of the complete message. The transport layer also provides the
acknowledgment of the successful data transmission and re-transmits the data if an error is
found. Protocols used in Transport Layer are TCP, UDP NetBIOS, PPTP.
At the sender’s side, the transport layer receives the formatted data from the upper layers,
performs Segmentation, and also implements Flow and error control to ensure proper data
transmission. It also adds Source and Destination port number in its header and forwards the
segmented data to the Network Layer.
Generally, this destination port number is configured, either by default or manually. For
example, when a web application requests a web server, it typically uses port number
80, because this is the default port assigned to web applications. Many applications
have default ports assigned.
At the Receiver’s side, Transport Layer reads the port number from its header and forwards the
Data which it has received to the respective application. It also performs sequencing and
reassembling of the segmented data.
Segmentation and Reassembly: This layer accepts the message from the (session)
layer and breaks the message into smaller units. Each of the segments produced has a
header associated with it. The transport layer at the destination station reassembles the
message.
Service Point Addressing: To deliver the message to the correct process, the transport
layer header includes a type of address called service point address or port address.
Thus, by specifying this address, the transport layer makes sure that the message is
delivered to the correct process.
Connection-Oriented Service
Connectionless Service
Session Layer in the OSI Model is responsible for the establishment of connections,
management of connections, terminations of sessions between two devices. It also provides
authentication and security. Protocols used in the Session Layer are NetBIOS, PPTP.
Session Establishment, Maintenance, and Termination: The layer allows the two
processes to establish, use, and terminate a connection.
Synchronization: This layer allows a process to add checkpoints that are considered
synchronization points in the data. These synchronization points help to identify the
error so that the data is re-synchronized properly, and ends of the messages are not cut
prematurely, and data loss is avoided.
Dialog Controller: The session layer allows two systems to start communication with
each other in half-duplex or full duplex.
Example
Let us consider a scenario where a user wants to send a message through some Messenger
application running in their browser. The “Messenger” here acts as the application layer which
provides the user with an interface to create the data. This message or so-called Data is
compressed, optionally encrypted (if the data is sensitive), and converted into bits (0’s and 1’s)
so that it can be transmitted.
Communication in Session Layer
The presentation layer is also called the Translation layer. The data from the application layer
is extracted here and manipulated as per the required format to transmit over the network.
Protocols used in the Presentation Layer are JPEG, MPEG, GIF, TLS/SSL, etc.
Encryption/ Decryption: Data encryption translates the data into another form or code.
The encrypted data is known as the ciphertext, and the decrypted data is known as plain
text. A key value is used for encrypting as well as decrypting data.
Compression: Reduces the number of bits that need to be transmitted on the network.
At the very top of the OSI Reference Model stack of layers, we find the Application layer which
is implemented by the network applications. These applications produce the data to be
transferred over the network. This layer also serves as a window for the application services to
access the network and for displaying the received information to the user. Protocols used in
the Application layer are SMTP, FTP, DNS, etc.
Application Layer
File Transfer Access and Management (FTAM): This application allows a user to
access files in a remote host, retrieve files in a remote host, and manage or control files
from a remote computer.
Directory Services: This application provides distributed database sources and access
for global information about various objects and services.
When we transfer information from one device to another, it travels through 7 layers of OSI
model. First data travels down through 7 layers from the sender’s end and then climbs back 7
layers on the receiver’s end.
Data Link Layer: Packets are framed and sent to the next device.
Physical Layer: Frames are converted into bits and transmitted physically.
Protocol Data
Layer Working Unit Protocols
Establishing Physical
1 – Physical
Connections between Bits USB, SONET/SDH, etc.
Layer
Devices.
Transmission of data
3 – Network from one host to another,
Packets IP, ICMP, IGMP, OSPF, etc.
Layer located in different
networks.
Establishes Connection,
5 – Session Maintenance, Ensures
Data NetBIOS, RPC, PPTP, etc.
Layer Authentication and
Ensures security.
Protocol Data
Layer Working Unit Protocols
TCP/IP Model
The original TCP/IP protocol uses four layers host-to-network, Internet, Transport, and
Application layer.
The host-to-network layer is equivalent to the combination of physical and data link layers in
the OSI model.
The Internet layer in TCP/IP is equivalent to the Network layer of the OSI model. And the
Application layer does the job of the Session, Presentation, and Application layers with the
Transport layer in TCP/IP.
In the TCP/IP model, the first four layers provide physical standards, network interface,
internetworking, and transport functions.
The first topmost layers (application, presentation, and session layers) in the OSI model are
represented in TCP/IP by a single layer called the application layer.
In the Transport layer, the TCP/IP model defines three protocols Transmission Control Protocol
(TCP), User Datagram Protocol (UDP), and the Stream Control Transmission Protocol (SCTP).
TCP/IP Protocol
The following diagram illustrates the mapping of the TCP/IP Protocol Suite to the OSI
Reference Model:
TCP/IP Protocol Suite to OSI Model
1. Application Layer
In TCP/IP, the Application layer protocols provide services to the application software running
on a computer. The application layer uses HTTP, POP3, and SMTP protocols. The application
layer provides an interface between the software running on a computer and the network itself.
2. Transport Layer
In TCP/IP, the Transport layer includes transmission control protocol (TCP) and user datagram
protocol (UDP). TCP provides services to the application layer that reside above the transport
layer or higher within the TCP/IP model.
The Internet layer in the TCP/IP model is the Network Layer 3 of the OSI model. It stores the
IP addresses and the routing data. When data is transmitted from a node on one LAN to a node
on a different LAN, the Internet Layer is used. IPv4, IPv6, ICMP, and routing protocols (among
others) are the Internet Layer TCP/IP protocols.
In TCP/IP, the Host-to-Network layer is also called the network interface or link layer. It
provides services to the upper layer within the model. When a hosts or routers IP process
chooses to send an IP packet to a different router or host, that host or router then uses the link-
layer details to send that packet to the next host/router.
This layer is the lowermost layer of the TCP/IP model; it is concerned with the physical
transmission of data. It is like a combination of the data link layer and physical layer of the OSI
model.