Computer Networks
Computer Networks
Computer Networks
Introduction :
Data Communications:
In Data Communications, data generally are defined as information that is stored in digital
form. Data communications is the process of transferring digital information between two or
more points. Information is defined as the knowledge or intelligence. Data communications
can be summarized as the transmission, reception, and processing of digital information. 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. For example, let us assume that video packets are sent
every 30 ms. If some of the packets arrive with 30-ms delay and others with 40-ms delay, an
uneven quality in the video is the result.
2. Sender: The sender is the device that sends the data message. It can be a computer,
3. Receiver: The receiver is the device that receives the message. It can be a computer,
Communication Models:
1. Simplex Model:
Unidirectional communication from sender to receiver.
2. Half-Duplex Model:
Bidirectional communication, but not simultaneously.
3. Full-Duplex Model:
Bidirectional communication with simultaneous data exchange.
Challenges in Data Communication:
1. Noise:
Interference or disturbances that can affect the quality of the transmitted data.
2. Attenuation:
The loss of signal strength as it travels through a medium, leading to a decrease in
signal quality.
3. Delay:
The time taken for data to travel from the source to the destination, which can affect
real-time applications.
Networks, Network Types
What is a Network?
A network is a collection of interconnected devices and systems that are capable of sharing
and exchanging data. Networks enable communication and collaboration among devices,
facilitating the efficient transfer of information.
Types of Networks:
Covers a larger geographic area than a LAN but is smaller than a WAN, typically
within a city.
Connects multiple LANs within the same metropolitan area.
A network for personal devices, typically within the range of an individual person.
Examples include Bluetooth connections between devices.
A secure network created over the internet, allowing users to access a private
network remotely.
Ensures encrypted communication for secure data transfer.
Network Topologies:
1. Bus Topology:
2. Star Topology:
3. Ring Topology:
4. Mesh Topology:
Every device is connected to every other device in the network.
5. Hybrid Topology:
A combination of two or more different topologies.
Network Model:
Protocol Layering
Function:
Deals with the physical connection between devices.
Specifies the characteristics of the hardware, such as cables, connectors, and
transmission rates.
Examples:
Ethernet, USB, fiber optics.
Function:
Responsible for the reliable transmission of data frames between devices on the
same network.
Manages access to the physical medium.
Examples:
Ethernet, Wi-Fi, PPP (Point-to-Point Protocol).
Function:
Handles routing and forwarding of data packets between different networks.
Logical addressing, such as IP addresses, occurs at this layer.
Examples:
IP (Internet Protocol), ICMP (Internet Control Message Protocol).
Function:
Ensures end-to-end communication, reliability, and error recovery.
Segmentation and reassembly of data.
Examples:
TCP (Transmission Control Protocol), UDP (User Datagram Protocol).
Function:
Manages sessions or connections between applications on different devices.
Dialog control, synchronization, and data exchange.
Examples:
NetBIOS (Network Basic Input/Output System).
6. Presentation Layer (Layer 6):
Function:
Translates data between the application layer and the lower layers.
Handles data encryption, compression, and formatting.
Examples:
JPEG, GIF, SSL/TLS.
Function:
Provides network services directly to end-users or applications.
Interface between the application and the network.
Examples:
HTTP (Hypertext Transfer Protocol), FTP (File Transfer Protocol), DNS (Domain
Name System).
i) Protocol Layering:
A communication subsystem is a complex piece of Hardware and software. Early attempts
for implementing the software for such subsystems were based on a single, complex,
unstructured program with many interacting components. The resultant software was very
difficult to test and modify. To overcome such problem, the ISO has developed a layered
approach. In a layered approach, networking concept is divided into several layers, and each
layer is assigned a particular task. Therefore, we can say that networking tasks depend upon
the layers.
Layered Architecture
o The main aim of the layered architecture is to divide the design into small pieces.
o Each lower layer adds its services to the higher layer to provide a full set of services
to manage communications and run the applications.
o It provides modularity and clear interfaces, i.e., provides interaction between
subsystems.
o It ensures the independence between layers by providing the services from lower to
higher layer without defining how the services are implemented. Therefore, any
modification in a layer will not affect the other layers.
o The number of layers, functions, contents of each layer will vary from network to
network. However, the purpose of each layer is to provide the service from lower to a
higher layer and hiding the details from the layers of how the services are
implemented.
o The basic elements of layered architecture are services, protocols, and interfaces.
o Service: It is a set of actions that a layer provides to the higher layer.
o Protocol: It defines a set of rules that a layer uses to exchange the information
with peer entity. These rules mainly concern about both the contents and order
of the messages used.
o Interface: It is a way through which the message is transferred from one layer
to another layer.
o In a layer n architecture, layer n on one machine will have a communication with the
layer n on another machine and the rules used in a conversation are known as a layer-
n protocol
I NT ERNET L AYER
o An internet layer is the second layer of the TCP/IP model.
o An internet layer is also known as the network layer.
o The main responsibility of the internet layer is to send the packets from any network,
and they arrive at the destination irrespective of the route they take.
F OL L OWI N G AR E T HE P R O T OC OL S U SED I N T HI S L AY E R AR E :
IP Protocol: IP protocol is used in this layer, and it is the most significant part of the entire
TCP/IP suite.
ARP Protocol
o ARP request: When a sender wants to know the physical address of the device,
it broadcasts the ARP request to the network.
o ARP reply: Every device attached to the network will accept the ARP request
and process the request, but only recipient recognize the IP address and sends
back its physical address in the form of ARP reply. The recipient adds the
physical address both to its cache memory and to the datagram header
ICMP Protocol
o ICMP Reply: ICMP Reply is used to check whether the destination device is
responding or not.
o The core responsibility of the ICMP protocol is to report the problems, not correct
them. The responsibility of the correction lies with the sender.
o ICMP can send the messages only to the source, but not to the intermediate routers
because the IP datagram carries the addresses of the source and destination but not of
the router that it is passed to.
T RANS P O RT L AYER
The transport layer is responsible for the reliability, flow control, and correction of data
which is being sent over the network.
The two protocols used in the transport layer are User Datagram protocol and
Transmission control protocol.
o UDP does not specify which packet is lost. UDP contains only checksum; it does not
contain any ID of a data segment.
A P P LIC AT IO N L AYER
o An application layer is the topmost layer in the TCP/IP model.
o It is responsible for handling high-level protocols, issues of representation.
o This layer allows the user to interact with the application.
o When one application layer protocol wants to communicate with another application
layer, it forwards its data to the transport layer.
o There is an ambiguity occurs in the application layer. Every application cannot be
placed inside the application layer except those who interact with the communication
system. For example: text editor cannot be considered in application layer while web
browser using HTTP protocol to interact with the network where HTTP protocol is an
application layer protocol.
o HTTP: HTTP stands for Hypertext transfer protocol. This protocol allows us to
access the data over the world wide web. It transfers the data in the form of plain text,
audio, video. It is known as a Hypertext transfer protocol as it has the efficiency to
use in a hypertext environment where there are rapid j
o umps from one document to another.
o SNMP: SNMP stands for Simple Network Management Protocol. It is a framework
used for managing the devices on the internet by using the TCP/IP protocol suite.
o SMTP: SMTP stands for Simple mail transfer protocol. The TCP/IP protocol that
supports the e-mail is known as a Simple mail transfer protocol. This protocol is used
to send the data to another e-mail address.
o DNS: DNS stands for Domain Name System. An IP address is used to identify the
connection of a host to the internet uniquely. But, people prefer to use the names
instead of addresses. Therefore, the system that maps the name to the address is
known as Domain Name System.
o TELNET: It is an abbreviation for Terminal Network. It establishes the connection
between the local computer and remote computer in such a way that the local terminal
appears to be a terminal at the remote system.
o FTP: FTP stands for File Transfer Protocol. FTP is a standard internet protocol used
for transmitting the files from one computer to another computer.
OSI Model
o OSI stands for Open System Interconnection is a reference model that describes
how information from a software application in one computer moves through a
physical medium to the software application in another computer.
o OSI consists of seven layers, and each layer performs a particular network function.
o OSI model was developed by the International Organization for Standardization (ISO)
in 1984, and it is now considered as an architectural model for the inter-computer
communications.
o OSI model divides the whole task into seven smaller and manageable tasks. Each
layer is assigned a particular task.
o Each layer is self-contained, so that task assigned to each layer can be performed
independently.
There are the seven OSI layers. Each layer has different functions. A list of seven layers are
given below:
1. Physical Layer
2. Data-Link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
1) Physical layer
o The main functionality of the physical layer is to transmit the individual bits from one
node to another node.
o It is the lowest layer of the OSI model.
o It establishes, maintains and deactivates the physical connection.
o It specifies the mechanical, electrical and procedural network interface specifications.
o Line Configuration: It defines the way how two or more devices can be connected
physically.
o Data Transmission: It defines the transmission mode whether it is simplex, half-
duplex or full-duplex mode between the two devices on the network.
o Topology: It defines the way how network devices are arranged.
o Signals: It determines the type of the signal used for transmitting the information.
2) Data-Link Layer
o It is responsible for transferring the packets to the Network layer of the receiver that is
receiving.
o It identifies the address of the network layer protocol from the header.
o It also provides flow control.
o Media Access Control Layer
o A Media access control layer is a link between the Logical Link Control layer and the
network's physical layer.
o It is used for transferring the packets over the network.
o Framing: The data link layer translates the physical's raw bit stream into packets
known as Frames. The Data link layer adds the header and trailer to the frame. The
header which is added to the frame contains the hardware destination and source
address.
o Physical Addressing: The Data link layer adds a header to the frame that contains a
destination address. The frame is transmitted to the destination address mentioned in
the header.
o Flow Control: Flow control is the main functionality of the Data-link layer. It is the
technique through which the constant data rate is maintained on both the sides so that
no data get corrupted. It ensures that the transmitting station such as a server with
higher processing speed does not exceed the receiving station, with lower processing
speed.
o Error Control: Error control is achieved by adding a calculated value CRC (Cyclic
Redundancy Check) that is placed to the Data link layer's trailer which is added to the
message frame before it is sent to the physical layer. If any error seems to occurr, then
the receiver sends the acknowledgment for the retransmission of the corrupted frames.
o Access Control: When two or more devices are connected to the same
communication channel, then the data link layer protocols are used to determine
which device has control over the link at a given time.
3) Network Layer
o It is a layer 3 that manages device addressing, tracks the location of devices on the
network.
o It determines the best path to move data from source to the destination based on the
network conditions, the priority of service, and other factors.
o The Data link layer is responsible for routing and forwarding the packets.
o Routers are the layer 3 devices, they are specified in this layer and used to provide the
routing services within an internetwork.
o The protocols used to route the network traffic are known as Network layer protocols.
Examples of protocols are IP and Ipv6.
4) Transport Layer
o The Transport layer is a Layer 4 ensures that messages are transmitted in the order in
which they are sent and there is no duplication of data.
o The main responsibility of the transport layer is to transfer the data completely.
o It receives the data from the upper layer and converts them into smaller units known
as segments.
o This layer can be termed as an end-to-end layer as it provides a point-to-point
connection between source and destination to deliver the data reliably.
o It is a standard protocol that allows the systems to communicate over the internet.
o It establishes and maintains a connection between hosts.
o When data is sent over the TCP connection, then the TCP protocol divides the data
into smaller units known as segments. Each segment travels over the internet using multiple
routes, and they arrive in different orders at the destination. The transmission control protocol
reorders the packets in the correct order at the receiving end.
5) Session Layer
o Dialog control: Session layer acts as a dialog controller that creates a dialog between
two processes or we can say that it allows the communication between two processes
which can be either half-duplex or full-duplex.
o Synchronization: Session layer adds some checkpoints when transmitting the data in
a sequence. If some error occurs in the middle of the transmission of data, then the
transmission will take place again from the checkpoint. This process is known as
Synchronization and recovery.
6) Presentation Layer
o A Presentation layer is mainly concerned with the syntax and semantics of the
information exchanged between the two systems.
o It acts as a data translator for a network.
o This layer is a part of the operating system that converts the data from one
presentation format to another format.
o The Presentation layer is also known as the syntax layer.
o Translation: The processes in two systems exchange the information in the form of
character strings, numbers and so on. Different computers use different encoding
methods, the presentation layer handles the interoperability between the different
encoding methods. It converts the data from sender-dependent format into a common
format and changes the common format into receiver-dependent format at the
receiving end.
o Encryption: Encryption is needed to maintain privacy. Encryption is a process of
converting the sender-transmitted information into another form and sends the
resulting message over the network.
o Compression: Data compression is a process of compressing the data, i.e., it reduces
the number of bits to be transmitted. Data compression is very important in
multimedia such as text, audio, video.
7) Application Layer
o An application layer serves as a window for users and application processes to access
network service.
o It handles issues such as network transparency, resource allocation, etc.
o An application layer is not an application, but it performs the application layer
functions.
o This layer provides the network services to the end-users.
o File transfer, access, and management (FTAM): An application layer allows a user
to access the files in a remote computer, to retrieve the files from a computer and to
manage the files in a remote computer.
o Mail services: An application layer provides the facility for email forwarding and
storage.
o Directory services: An application provides the distributed database sources and is
used to provide that global information about various objects.
Data or information can be stored in two ways, analog and digital. For a computer to use the
data, it must be in discrete digital form.Similar to data, signals can also be in analog and
digital form. To transmit data digitally, it needs to be first converted to digital form.
D IG IT AL - T O -D IG IT AL C O NVERS IO N
This section explains how to convert digital data into digital signals. It can be done in two
ways, line coding and block coding. For all communications, line coding is necessary
whereas block coding is optional.
L INE C O DING
The process for converting digital data into digital signal is said to be Line Coding. Digital
data is found in binary format.It is represented (stored) internally as series of 1s and 0s.
Digital signal is denoted by discreet signal, which represents digital data.There are three
types of line coding schemes available:
U N I - P OL A R E N C ODI N G
Unipolar encoding schemes use single voltage level to represent data. In this case, to
represent binary 1, high voltage is transmitted and to represent 0, no voltage is transmitted. It
is also called Unipolar-Non-return-to-zero, because there is no rest condition i.e. it either
represents 1 or 0.
P OL A R E N C OD I N G
Polar encoding scheme uses multiple voltage levels to represent binary values. Polar
encodings is available in four types:
Bipolar encoding uses three voltage levels, positive, negative and zero. Zero voltage
represents binary 0 and bit 1 is represented by altering positive and negative voltages.
B LO C K C O DING
To ensure accuracy of the received data frame redundant bits are used. For example, in even-
parity, one parity bit is added to make the count of 1s in the frame even. This way the original
number of bits is increased. It is called Block Coding.
Block coding is represented by slash notation, mB/nB.Means, m-bit block is substituted with
n-bit block where n > m. Block coding involves three steps:
Division,
Substitution
Combination.
A NALO G - TO -D IG IT AL C O NVERS IO N
Microphones create analog voice and camera creates analog videos, which are treated is
analog data. To transmit this analog data over digital signals, we need analog to digital
conversion.
Analog data is a continuous stream of data in the wave form whereas digital data is discrete.
To convert analog wave into digital data, we use Pulse Code Modulation (PCM).
PCM is one of the most commonly used method to convert analog data into digital form. It
involves three steps:
Sampling
Quantization
Encoding.
S A M PLIN G
The analog signal is sampled every T interval. Most important factor in sampling is the rate at
which analog signal is sampled. According to Nyquist Theorem, the sampling rate must be at
least two times of the highest frequency of the signal.
Q U A N TI Z AT I ON
Sampling yields discrete form of continuous analog signal. Every discrete pattern shows the
amplitude of the analog signal at that instance. The quantization is done between the
maximum amplitude value and the minimum amplitude value. Quantization is approximation
of the instantaneous analog value.
E N C OD I N G
T RANS M IS S IO N M O DES
The transmission mode decides how data is transmitted between two computers.The binary
data in the form of 1s and 0s can be sent in two different modes: Parallel and Serial.
P A R A LLE L T R A N SM ISSIO N
The binary bits are organized in-to groups of fixed length. Both sender and receiver are
connected in parallel with the equal number of data lines. Both computers distinguish
between high order and low order data lines. The sender sends all the bits at once on all
lines.Because the data lines are equal to the number of bits in a group or data frame, a
complete group of bits (data frame) is sent in one go. Advantage of Parallel transmission is
high speed and disadvantage is the cost of wires, as it is equal to the number of bits sent in
parallel.
S E R I AL T R A N SMI SSI ON
In serial transmission, bits are sent one after another in a queue manner. Serial transmission
requires only one communication channel.
A SY N C HR ON OU S S ER I AL T R A N SMI SSI ON
It is named so because there’is no importance of timing. Data-bits have specific pattern and
they help receiver recognize the start and end data bits.For example, a 0 is prefixed on every
data byte and one or more 1s are added at the end.
S Y N C HR ON OU S S E RI A L T R A N SM I SSI ON
Bandwidth Utilization:
Multiplexing:
What is 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.
Why Multiplexing?
o The transmission medium is used to send the signal from sender to receiver. The
medium can only have one signal at a time.
o If there are multiple signals to share one medium, then the medium must be divided in
such a way that each signal is given some portion of the available bandwidth. For
example: If there are 10 signals and bandwidth of medium is100 units, then the 10
unit is shared by each signal.
o When multiple signals share the common medium, there is a possibility of collision.
Multiplexing concept is used to avoid such collision.
o Transmission services are very expensive.
Concept of Multiplexing
o The 'n' input lines are transmitted through a multiplexer and multiplexer combines the
signals to form a composite signal.
o The composite signal is passed through a Demultiplexer and demultiplexer separates a
signal to component signals and transfers them to their respective destinations.
Advantages of Multiplexing:
Multiplexing Techniques
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.
Advantages of FDM:
Disadvantages Of FDM:
Applications Of FDM:
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.
o Synchronous TDM
o Asynchronous TDM
Synchronous TDM
o A Synchronous TDM is a technique in which time slot is pre assigned 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.
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
S PREAD S PECTRUM
In other words, "Spread Spectrum is a technique in which the transmitted signals of specific
frequencies are varied slightly to obtain greater bandwidth as compared to initial bandwidth."
Now, spread spectrum technology is widely used in radio signals transmission because it can
easily reduce noise and other signal issues.
In this conventional wireless communication model, you can face at least two problems:
The spread spectrum model is used to overcome with this conventional communication
model. Here, the transmitted signal frequency is deliberately varied over a comparatively
large segment of the electromagnetic radiation spectrum. This variation is done according to a
specific but complicated mathematical function. If the receiver wants to intercept the signal,
it must be tuned to frequencies that vary precisely according to this function.
U S AG E OF S P READ S P EC T RUM
There are many reasons to use this spread spectrum technique for wireless communications.
The following are some reasons:
T YP ES OF S P READ S P EC T RUM
F R E QU E N C Y H OPP I N G S P RE A D S P EC T RU M (FHSS)
o The Frequency Hopping Spread Spectrum or FHSS allows us to utilize bandwidth
properly and maximum. In this technique, the whole available bandwidth is divided
into many channels and spread between channels, arranged continuously.
o The frequency slots are selected randomly, and frequency signals are transmitted
according to their occupancy.
o The transmitters and receivers keep on hopping on channels available for a particular
amount of time in milliseconds.
o So, you can see that it implements the frequency division multiplexing and time-
division multiplexing simultaneously in FHSS.
The Frequency Hopping Spread Spectrum or FHSS can also be classified into two
types:
o Slow Hopping: In slow hopping, multiple bits are transmitted on a specific frequency or
same frequency.
o Fast Hopping: In fast hopping, individual bits are split and then transmitted on different
frequencies.
A D V A N T A GE S OF F R E QU E NC Y H OPP IN G S PR E A D S P EC T R UM (FHSS)
The following are some advantages of frequency hopping spread spectrum (FHSS):
o The biggest advantage of Frequency Hopping Spread Spectrum or FHSS is its high
efficiency.
o The Frequency Hopping Spread Spectrum or FHSS signals are highly resistant to
narrowband interference because the signal hops to a different frequency band.
o It requires a shorter time for acquisition.
o It is highly secure. Its signals are very difficult to intercept if the frequency-hopping
pattern is not known; that's why it is preferred to use in Military services.
o We can easily program it to avoid some portions of the spectrum.
o Frequency Hopping Spread Spectrum or FHSS transmissions can share a frequency
band with many types of conventional transmissions with minimal mutual
interference. FHSS signals add minimal interference to narrowband communications,
and vice versa.
o It provides a very large bandwidth.
o It can be simply implemented as compared to DsSS.
The following are some disadvantages of Frequency Hopping Spread Spectrum (FHSS):
Following is the list of most used applications of Frequency Hopping Spread Spectrum or
FHSS:
o The Frequency Hopping Spread Spectrum or FHSS is used in wireless local area
networks (WLAN) standard for Wi-Fi.
o FHSS is also used in the wireless personal area networks (WPAN) standard for
Bluetooth.
D I R E CT S E QUE N CE S PR E A D S PE C T RU M (DSSS)
o In Direct Sequence Spread Spectrum or DSSS technique, the data that needs to be
transmitted is split into smaller blocks.
o After that, each data block is attached with a high data rate bit sequence and is
transmitted from the sender end to the receiver end.
o Data blocks are recombined again to generate the original data at the receiver's end,
which was sent by the sender, with the help of the data rate bit sequence.
o If somehow data is lost, then data blocks can also be recovered with those data rate
bits.
o The main advantage of splitting the data into smaller blocks is that it reduces the noise
and unintentional inference.
The Direct Sequence Spread Spectrum or DSSS can also be classified into two types:
A D V A N T A GE S OF D IR E CT S E QU E NC E S P R EA D S PE C TR U M (DSSS)
The following are some advantages of Direct Sequence Spread Spectrum or DSSS:
o Direct Sequence Spread Spectrum or DSSS is less reluctant to noise; that's why the
DSSS system's performance in the presence of noise is better than the FHSS system.
o In Direct Sequence Spread Spectrum or DSSS, signals are challenging to detect.
o It provides the best discrimination against multipath signals.
o In Direct Sequence Spread Spectrum, there are very few chances of jamming because
it avoids intentional interference such as jamming effectively.
D I SA D V A NT A GE S OF D I RE C T S E QUE N C E S P R EA D S PE CT R UM (DSSS)
The following are some disadvantages of Direct Sequence Spread Spectrum or DSSS:
o The Direct Sequence Spread Spectrum or DSSS system takes large acquisition time;
that's why its performance is slow.
o It requires wide-band channels with small phase distortion.
o In DSSS, the pseudo-noise generator generates a sequence at high rates.
A P P LI C AT I ON S OF D I RE CT S E QUE N CE S PRE A D S P E CT R UM (DSSS)
Following is the list of most used applications of Direct Sequence Spread Spectrum or DSSS:
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.
o Circuit establishment
o Data transfer
o Circuit Disconnect
S P A CE D I V I SI ON S WI T C HE S :
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.
o Crossbar Switch
o Multistage Switch
C R OSSB A R S WIT C H
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.
M U LT I STA GE S WI TC H
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.
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.
D A T A GR AM P A C KE T SWI TC HI N G :
V I R T U AL C I R CU IT S WIT C HIN G
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.
Introduction to Data Link Layer. Error Detection and Correction: Introduction, Block
Coding, Cyclic Codes, Checksum Data Link Control: DLC Services, Data-Link Layer
Protocols Media Access Control. Wired LANs: Ethernet-Ethernet Protocol,
Standard Ethernet: Characteristics, Addressing.
IntroductionData-linkLayer:
Data Link Layer is second layer of OSI Layered Model. This layer is one of the most
complicated layers and has complex functionalities and liabilities. Data link layer
hides the details of underlying hardware and represents itself to upper layer as the
medium to communicate.
Data link layer works between two hosts which are directly connected in some
sense. This direct connection could be point to point or broadcast. Systems on
broadcast network are said to be on same link. The work of data link layer tends to
get more complex when it is dealing with multiple hosts on single collision domain.
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.
• Logical Link Control: It deals with protocols, flow-control, and error control
• Media Access Control: It deals with actual control of media
Data link layer does many tasks on behalf of upper layer. These are:
• 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.
• Addressing
Data-link layer provides layer-2 hardware addressing mechanism. Hardware
address is assumed to be unique on the link. It is encoded into hardware at
the time of manufacturing.
• Synchronization
When data frames are sent on the link, both machines must be synchronized
in order to transfer to take place.
• Error Control
Sometimes signals may have encountered problem in transition and the bits
are flipped.These errors are detected and attempted to recover actual data
bits. It also provides error reporting mechanism to the sender.
• 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.
• Multi-Access
When host on the shared link tries to transfer the data, it has a high
probability of collision. Data-link layer provides mechanism such as
CSMA/CD to equip capability of accessing a shared media among multiple
Systems.
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.
Types of Errors
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.
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.
The number of affected bits depends on the duration of the noise and data rate.
o If two bits in one data unit are corrupted and two bits exactly the same
position in another data unit are also corrupted, then 2D Parity checker will
not be able to detect the error.
o This technique cannot be used to detect the 4-bit errors or more in some
cases.
Checksum
Checksum Generator
Suppose L is the total sum of the data segments, then the checksum would be ?L
1. The Sender follows the given steps:
2. The block unit is divided into k sections, and each of n bits.
3. All the k sections are added together by using one's complement to get the
sum.
4. The sum is complemented and it becomes the checksum field.
5. The original data and checksum field are sent across the network.
Checksum Checker
A Checksum is verified at the receiving side. The receiver subdivides the incoming
data into equal segments of n bits each, and all these segments are added
together, and then this sum is complemented. If the complement of the sum is
zero, then the data is accepted otherwise data is rejected.
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.
Let's understand this concept through an example:
CRC Generator
\
Error Correction
Error Correction codes are used to detect and correct the errors when data is
transmitted from the sender to the receiver.
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.
To determine the position of the bit which is in error, a technique developed by R.W
Hamming is Hamming code which can be applied to any length of the data unit
and uses the relationship between data units and redundant units.
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.
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.
The number of redundant bits is 3. The three bits are represented by r1, r2, r4. The
position of the redundant bits is calculated with corresponds to the raised power of
2. Therefore, their corresponding positions are 1, 21, 22.
1. The position of r1 = 1
2. The position of r2 = 2
3. The position of r4 = 4
Representation of Data on the addition of parity bits:
The r1 bit is calculated by performing a parity check on the bit positions whose
binary representation includes 1 in the first position.
We observe from the above figure that the bit positions that includes 1 in the first
position are 1, 3, 5, 7. Now, we perform the even-parity check at these bit positions.
The total number of 1 at these bit positions corresponding to r1 is even, therefore,
the value of the r1 bit is 0.
Determining r2 bit
The r2 bit is calculated by performing a parity check on the bit positions whose
binary representation includes 1 in the second position.
We observe from the above figure that the bit positions that includes 1 in the
second position are 2, 3, 6, 7. Now, we perform the even-parity check at these bit
positions. The total number of 1 at these bit positions corresponding to r2 is odd,
therefore, the value of the r2 bit is 1.
Determining r4 bit
The r4 bit is calculated by performing a parity check on the bit positions whose
binary representation includes 1 in the third position.
We observe from the above figure that the bit positions that includes 1 in the third
position are 4, 5, 6, 7. Now, we perform the even-parity check at these bit positions.
The total number of 1 at these bit positions corresponding to r4 is even, therefore,
the value of the r4 bit is 0.
Suppose the 4th bit is changed from 0 to 1 at the receiving end, then parity bits are
recalculated.
R1 bit
R2 bit
We observe from the above figure that the binary representation of r2 is 1001. Now,
we perform the even-parity check, the total number of 1s appearing in the r2 bit is
an even number. Therefore, the value of r2 is 0.
R4 bit
We observe from the above figure that the binary representation of r4 is 1011. Now,
we perform the even-parity check, the total number of 1s appearing in the r4 bit is
an odd number. Therefore, the value of r4 is 1.
o
Block Coding:
Cyclic Codes,
Checksum
o Line discipline
o Flow Control
o Error Control
Line Discipline
o Line Discipline is a functionality of the Data link layer that provides the
coordination among the link systems. It determines which device can send,
and when it can send the data.
END/ACK
END/ACK coordinates which device will start the transmission and whether the
recipient is ready or not.
Working of END/ACK
The transmitter transmits the frame called an Enquiry (ENQ) asking whether the
receiver is available to receive the data or not.
The receiver responses either with the positive acknowledgement(ACK) or with the
negative acknowledgement(NACK) where positive acknowledgement means that
the receiver is ready to receive the transmission and negative acknowledgement
means that the receiver is unable to accept the transmission.
o If the response to the ENQ is positive, the sender will transmit its data, and
once all of its data has been transmitted, the device finishes its
transmission with an EOT (END-of-Transmission) frame.
o If the response to the ENQ is negative, then the sender disconnects and
restarts the transmission at another time.
o If the response is neither negative nor positive, the sender assumes that the
ENQ frame was lost during the transmission and makes three attempts to
establish a link before giving up.
Poll/Select
The Poll/Select method of line discipline works with those topologies where one
device is designated as a primary station, and other devices are secondary stations.
Working of Poll/Select
o In this, the primary device and multiple secondary devices consist of a single
transmission line, and all the exchanges are made through the primary
device even though the destination is a secondary device.
o The primary device has control over the communication link, and the
secondary device follows the instructions of the primary device.
o The primary device determines which device is allowed to use the
communication channel. Therefore, we can say that it is an initiator of the
session.
o If the primary device wants to receive the data from the secondary device, it
asks the secondary device that they anything to send, this process is known
as polling.
o If the primary device wants to send some data to the secondary device, then
it tells the target secondary to get ready to receive the data, this process is
known as selecting.
Select
o The select mode is used when the primary device has something to send.
o When the primary device wants to send some data, then it alerts the
secondary device for the upcoming transmission by transmitting a Select
(SEL) frame, one field of the frame includes the address of the intended
secondary device.
o When the secondary device receives the SEL frame, it sends an
acknowledgement that indicates the secondary ready status.
o If the secondary device is ready to accept the data, then the primary device
sends two or more data frames to the intended secondary device. Once the
data has been transmitted, the secondary sends an acknowledgement
specifies that the data has been received.
Poll
o The Poll mode is used when the primary device wants to receive some data
from the secondary device.
o When a primary device wants to receive the data, then it asks each device
whether it has anything to send.
o Firstly, the primary asks (poll) the first secondary device, if it responds with
the NACK (Negative Acknowledgement) means that it has nothing to send.
Now, it approaches the second secondary device, it responds with the ACK
means that it has the data to send. The secondary device can send more
than one frame one after another or sometimes it may be required to send
ACK before sending each one, depending on the type of the protocol being
used.
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.
o Stop-and-wait
o Sliding window
Stop-and-wait
Advantage of Stop-and-wait
Disadvantage of Stop-and-wait
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
Sender Window
Stop-and-wait ARQ
Stop-and-wait ARQ is a technique used to retransmit the data in case of damaged
or lost frames.
This technique works on the principle that the sender will not transmit the next
frame until it receives the acknowledgement of the last transmitted frame.
o The sending device keeps a copy of the last transmitted frame until the
acknowledgement is received. Keeping the copy allows the sender to
retransmit the data if the frame is not received correctly.
o Both the data frames and the ACK frames are numbered alternately 0 and 1
so that they can be identified individually. Suppose data 1 frame
acknowledges the data 0 frame means that the data 0 frame has been
arrived correctly and expects to receive data 1 frame.
o If an error occurs in the last transmitted frame, then the receiver sends the
NAK frame which is not numbered. On receiving the NAK frame, sender
retransmits the data.
o It works with the timer. If the acknowledgement is not received within the
allotted time, then the sender assumes that the frame is lost during the
transmission, so it will retransmit the frame.
o Damaged Frame: When the receiver receives a damaged frame, i.e., the
frame contains an error, then it returns the NAK frame. For example, when
the data 0 frame is sent, and then the receiver sends the ACK 1 frame
means that the data 0 has arrived correctly, and transmits the data 1 frame.
The sender transmits the next frame: data 1. It reaches undamaged, and the
receiver returns ACK 0. The sender transmits the next frame: data 0. The
receiver reports an error and returns the NAK frame. The sender retransmits
the data 0 frame.
o Lost Frame: Sender is equipped with the timer and starts when the frame is
transmitted. Sometimes the frame has not arrived at the receiving end so
that it can be acknowledged neither positively nor negatively. The sender
waits for acknowledgement until the timer goes off. If the timer goes off, it
retransmits the last transmitted frame.
Sliding Window ARQ
o In this case, the sender keeps the copies of all the transmitted frames until
they have been acknowledged. Suppose the frames from 0 through 4 have
been transmitted, and the last acknowledgement was for frame 2, the
sender has to keep the copies of frames 3 and 4 until they receive correctly.
o The receiver can send either NAK or ACK depending on the conditions. The
NAK frame tells the sender that the data have been received damaged.
Since the sliding window is a continuous transmission mechanism, both
ACK and NAK must be numbered for the identification of a frame. The ACK
frame consists of a number that represents the next frame which the
receiver expects to receive. The NAK frame consists of a number that
represents the damaged frame.
o The sliding window ARQ is equipped with the timer to handle the lost
acknowledgements. Suppose then n-1 frames have been sent before
receiving any acknowledgement. The sender waits for the
acknowledgement, so it starts the timer and waits before sending any more.
If the allotted time runs out, the sender retransmits one or all the frames
depending upon the protocol used.
o Damaged Frame: When the frame is damaged, then the receiver sends a
NAK frame.
In the above figure, three frames have been transmitted before an error discovered
in the third frame. In this case, ACK 2 has been returned telling that the frames 0,1
have been received successfully without any error. The receiver discovers the error
in data 2 frame, so it returns the NAK 2 frame. The frame 3 is also discarded as it is
transmitted after the damaged frame. Therefore, the sender retransmits the frames
2,3.
o Lost Data Frame: In Sliding window protocols, data frames are sent
sequentially. If any of the frames is lost, then the next frame arrive at the
receiver is out of sequence. The receiver checks the sequence number of
each of the frame, discovers the frame that has been skipped, and returns
the NAK for the missing frame. The sending device retransmits the frame
indicated by NAK as well as the frames transmitted after the lost frame.
o Lost Acknowledgement: The sender can send as many frames as the
windows allow before waiting for any acknowledgement. Once the limit of
the window is reached, the sender has no more frames to send; it must wait
for the acknowledgement. If the acknowledgement is lost, then the sender
could wait forever. To avoid such situation, the sender is equipped with the
timer that starts counting whenever the window capacity is reached. If the
acknowledgement has not been received within the time limit, then the
sender retransmits the frame since the last ACK.
Selective-Reject ARQ
2. Virtual Communication :
The Data link layer generally provides or offers three types of services as
given below :
The data link protocols operate in the data link layer of the Open System
Interconnections (OSI) model, just above the physical layer.
The services provided by the data link protocols may be any of the following −
• Framing − The stream of bits from the physical layer are divided into data
frames whose size ranges from a few hundred to a few thousand bytes.
These frames are distributed to different systems, by adding a header to the
frame containing the address of the sender and the receiver.
• Flow Control − Through flow control techniques, data is transmitted in such
a way so that a fast sender does not drown a slow receiver.
• Error Detection and/or Correction − These are techniques of detecting and
correcting data frames that have been corrupted or lost during transmission.
• Multipoint transmission − Access to shared channels and multiple points
are regulated in case of broadcasting and LANs.
Common Data Link Protocols
A media access control is a network data transfer policy that determines how data is
transmitted between two computer terminals through a network cable. The media
access control policy involves sub-layers of the data link layer 2 in the OSI reference
model.
The essence of the MAC protocol is to ensure non-collision and eases the transfer of
data packets between two computer terminals. A collision takes place when two or
more terminals transmit data/information simultaneously. This leads to a breakdown of
communication, which can prove costly for organizations that lean heavily on data
transmission.
MediaAccessControlMethods
This network channel through which data is transmitted between terminal nodes to
avoid collision has three various ways of accomplishing this purpose. They include:
• Carriersense multipleaccesswith collision avoidance(CSMA/CA)
• Carriersense multipleaccesswith collision detection(CSMA/CD)
• Demandpriority
• Token passing
CarrierSenseMultipleAccesswithCollisionAvoidance(CSMA/CA)
Multiple access implies that many computers are attempting to transmit data. Collision
avoidance means that when a computer node transmitting data states its intention, the
other waits ata specific length of timebeforeresending the data.
CSMA/CA is data traffic regulation is slow and adds cost in having each computer node
signal its intention beforetransmitting data. It used only on Applenetworks.
A wired local area network is a local area network where the connectivity
between different components or elements of the LAN is done using wires
and cable. Well to implement the wired LANs various technologies were
introduced such as token ring, token bus, FDDI, ATM LANs, and Ethernet.
Among all these technologies only Ethernet survived the market as it has
the capability to update itself to meet the increasing requirements. So, in
this context, we will discuss wired local area networks in brief and how
the Ethernet technology succeeded in implementing wired LANs
Ethernet:
It offers a simple user interface that helps to connect various devices easily, such
as switches, routers, and computers. A local area network (LAN) can be created
with the help of a single router and a few Ethernet cables, which enable
communication between all linked devices. This is because an Ethernet port is
included in your laptop in which one end of a cable is plugged in and connect the
other to a router. Ethernet ports are slightly wider, and they look similar to
telephone jacks.
With lower-speed Ethernet cables and devices, most of the Ethernet devices are
backward compatible. However, the speed of the connection will be as fast as the
lowest common denominator. For instance, the computer will only have the
potential to forward and receive data at 10 Mbps if you attach a computer with a
10BASE-T NIC to a 100BASE-T network. Also, the maximum data transfer rate will
be 100 Mbps if you have a Gigabit Ethernet router and use it to connect the device.
The wireless networks replaced Ethernet in many areas; however, Ethernet is still
more common for wired networking. Wi-Fi reduces the need for cabling as it allows
the users to connect smartphones or laptops to a network without the required
cable. While comparing with Gigabit Ethernet, the faster maximum data transfer
rates are provided by the 802.11ac Wi-Fi standard. Still, as compared to a wireless
network, wired connections are more secure and are less prone to interference.
This is the main reason to still use Ethernet by many businesses and organizations.
The primary intention of developing the gigabit Ethernet was to full fill the user's
requirements, such as faster transfer of data, faster communication network, and
more.
Advantages of Ethernet
Disadvantages of Ethernet
Ethernet Standards
Ethernet Terminology
100: - The number indicates that the standard data transmission speed of this
media type is 100Mbps.
Base: - The indicates that the media uses a baseband technology for
transmission.
Key points
• The name of an Ethernet standard consists of three parts. The first part
contains a number, the second part contains a word (mostly Base), and the third
part contains a number or letters.
• The first part specifies the data transmission speed of the media.
• The second part indicates the technology or the method the media uses to
transmit data. The word 'Base' signifies a type of network that uses only one carrier
frequency for signaling and requires all network stations to share its use.
• The third part specifics the length or type of the cable that the media uses in
implementation. For example, if the standard contains a letter T in this part, it
means the standard uses twisted-pair cabling. Or if a standard contains a
number 5 in this part, it means the standard can span 500 meters long.
10Base2
This standard is also known as ThickNet. It also uses coaxial cabling and provides
10Mbps speed. It supports a maximum length of 500 meters. This standard is also
not used in modern networks.
10BaseT
10BaseT is one of the most common Ethernet standards used in Ethernet networks.
It uses UTP (Cat3 or higher) cables and Hubs. Hubs use a physical star topology
and a logical bus topology. Hubs repeat and forward signals to all nodes. Because
of Hubs, the 10BaseT networks are slow and susceptible to collisions.
This standard also specifies a rule about how many Hubs you can use in a network.
This rule specifies that a maximum of four hubs can be placed between
communicating workstations. This rule ensures that all stations on the network
can detect a collision.
Due to the slow data transmission speed and collision, modern networks do not
use the 10BaseT standard.
10BaseF
Due to the slow data transmission speed and expensive cabling, the 10BaseT
standard is also not used in modern networks.
100BaseT4
100BaseT4 was created to upgrade 10BaseT networks over Cat3 wiring to 100
Mbps without having to replace the wiring. Using four pairs of twisted pair wiring,
two of the four pairs are configured for half-duplex transmission (data can move in
only one direction at a time). The other two pairs are configured as simplex
transmission, which means data moves only in one direction on a pair all the time.
100BaseTX
100BaseTX is also known as Fast Ethernet. It transmits data at 100 Mbps. Fast
Ethernet works nearly identically to 10BaseT, including that it has a physical star
topology using a logical bus. 100BaseTX requires Cat5 or higher UTP cabling. It
uses two of the four-wire pairs: one to transmit data and the other to receive data.
100BaseFX
1000BaseT
1000BaseT is also known as Gigabit Ethernet. It uses Cat5 or higher grade UTP
cable. It uses all four pairs of the cable. It uses a physical star topology with a
logical bus. There is also 1000BaseF, which runs over multimode fiber optic
cabling. It supports both the full-duplex and half-duplex modes of data
transmission.
10GBaseT
This standard is also known as 10 Gigabit Ethernet. It uses Cat6 or higher grade
UTP cable. It uses all four pairs of the UTP cable. It provides 10 Gbps speed. It
operates only in full-duplex mode.
Characteristics of Ethernet:
Ethernet is a widely used networking technology that defines the rules for
organizing and formatting data for transmission over a network. Here are some key
characteristics of Ethernet in computer networks:
Physical Layer:
• Ethernet operates at the physical layer (Layer 1) and the data link layer
(Layer 2) of the OSI model.
• It specifies the electrical, mechanical, and functional characteristics of the
hardware, such as cables, connectors, and network interface cards (NICs).
Topology:
• Ethernet supports various topologies, including star, bus, ring, and hybrid
configurations.
• In a star topology, devices are connected to a central hub or switch, while a
bus topology involves a single communication channel shared by all devices.
Carrier Sense Multiple Access with Collision Detection (CSMA/CD):
• Traditional Ethernet uses CSMA/CD as a protocol to manage access to the
network medium.
• Before transmitting, a device listens to the network to check if it is clear. If a
collision is detected during transmission, devices involved in the collision
use a backoff algorithm and reattempt transmission after a random interval.
Frame Format:
MAC Address:
Data Rate:
• Ethernet supports various data rates, ranging from the original 10 Mbps
(Ethernet) to 100 Mbps (Fast Ethernet), 1 Gbps (Gigabit Ethernet), 10 Gbps,
40 Gbps, and 100 Gbps, with ongoing developments.
Switched Ethernet:
Frame Forwarding:
Standardization:
Ubiquity:
Ethernet Addressing:
Every Ethernet frame contains two addresses: source and destination. The source
address represents the device that generated it. The destination address
represents the recipients of the frame.
These terms define the purposes and functions of the Ethernet address. For
example, the terms hardware address and physical address indicate the address
belongs to an interface.
The terms MAC address and LAN address indicate the data link layer uses this
address in the LAN environment.
The term burned-in address (BIA) specifies a fact that indicates a permanent MAC
address has been encoded (burned into) the ROM chip on the NIC.
The term universal address indicates the address is unique in the universe.
Globally unique MAC addresses
The manufacturer uses the assigned code to generate MAC addresses for its
products. In each MAC address, it uses the assigned code as the first 3 bytes. It
uses the last 3 bytes to make the address unique. As a result, the MAC address of
every device in the universe is unique.
Layer-3 in the OSI model is called Network layer. Network layer manages options
pertaining to host and network addressing, managing sub-networks, and internetworking.
Network layer takes the responsibility for routing packets from source to destination
within or outside a subnet. Two different subnet may have different addressing schemes or
non-compatible addressing types. Same with protocols, two different subnet may be
operating on different protocols which are not compatible with each other. Network layer
has the responsibility to route the packets from source to destination, mapping different
addressing schemes and protocols.
Layer-3 Functionalities
Devices which work on Network Layer mainly focus on routing. Routing may include various
tasks aimed to achieve a single goal. These can be:
With its standard functionalities, Layer 3 can provide various features as:
Internet protocol is widely respected and deployed Network Layer protocol which helps to
communicate end to end devices over the internet. It comes in two flavors. IPv4 which has
ruled the world for decades but now is running out of address space. IPv6 is created to
replace IPv4 and hopefully mitigates limitations of IPv4 too.
Here are some of the types of delays that can occur in packet switching:
1. Transmission delay: This is the time it takes to transmit a packet over a link.
It is affected by the size of the packet and the bandwidth of the link.
2. Propagation delay: This is the time it takes for a packet to travel from the
source to the destination. It is affected by the distance between the two
nodes and the speed of light.
3. Processing delay: This is the time it takes for a packet to be processed
by a node, such as a router or switch. It is affected by the processing
capabilities of the node and the complexity of the routing algorithm.
4. Queuing delay: This is the time a packet spends waiting in a queue before it
can be transmitted. It is affected by the number of packets in the queue and
the priority of the packets.
while packet switching can introduce delays in the transmission process, it is generally
more efficient than circuit switching and can support a wider range of applications. To
minimize delays, various techniques can be used, such as optimizing routing algorithms,
increasing link bandwidth, and using quality of service (QoS) mechanisms to prioritize
certain types of traffic.
Advantages of Packet Switching over Circuit Switching:
• More efficient in terms of bandwidth, since the concept of reserving a circuit
is not there.
• Minimal transmission latency.
• More reliable as a destination can detect the missing packet.
• More fault tolerant because packets may follow a different path in case any
link is down, Unlike Circuit Switching.
• Cost-effective and comparatively cheaper to implement.
Disadvantage of Packet Switching over Circuit Switching:
• Packet Switching doesn’t give packets in order, whereas Circuit Switching
provides ordered delivery of packets because all the packets follow the same
path.
• Since the packets are unordered, we need to provide sequence numbers for
each packet.
• Complexity is more at each node because of the facility to follow multiple
paths.
• Transmission delay is more because of rerouting.
• Packet Switching is beneficial only for small messages, but for bursty data
(large messages) Circuit Switching is better.
Modes of Packet Switching:
All address information is only transferred during the setup phase. Once the route to a
destination is discovered, entry is added to the switching table of each intermediate
node. During data transfer, packet header (local header) may contain information such
as length, timestamp, sequence number, etc.
Connection-oriented switching is very useful in switched WAN. Some popular protocols
which use the Virtual Circuit Switching approach are X.25, Frame-Relay, ATM, and
MPLS(Multi-Protocol Label Switching).
2. Connectionless Packet Switching (Datagram): Unlike Connection-oriented packet
switching, In Connectionless Packet Switching each packet contains all necessary
addressing information such as source address, destination address, port numbers, etc.
In Datagram Packet Switching, each packet is treated independently. Packets belonging
A---R1---R2---B
A is the sender (start)
R1, R2 are two routers that store and forward data
B is receiver(destination)
To send a packet from A to B there are delays since this is a Store and Forward
network.
BANDWIDTH
LATENCY
Propagation Time
It is the time required for a bit to travel from the source to the destination.
Propagation time can be calculated as the ratio between the link length (distance) and
the propagation speed over the communicating medium. For example, for an electric
signal, propagation time is the time taken for the signal to travel through a wire.
Transmission Time
Transmission Time is a time based on how long it takes to send the signal down
the transmission line. It consists of time costs for an EM signal to propagate from one
side to the other, or costs like the training signals that are usually put on the front of a
packet by the sender, which helps the receiver synchronize clocks. The transmission
time of a message relies upon the size of the message and the bandwidth of the
channel.
Transmission time = Message size / Bandwidth
Queuing Time
Queuing time is a time based on how long the packet has to sit around in the
router. Quite frequently the wire is busy, so we are not able to transmit a packet
immediately. The queuing time is usually not a fixed factor, hence it changes with the
load thrust in the network. The more the traffic, the more likely a packet is stuck in the
queue, just sitting in the memory, waiting.
Processing Delay
Solution
The first bit is O. This is a class A address.
The first 2 bits are 1; the third bit is O. This is a class C address.
The first byte is 14 (between 0 and 127); the class is A.
The first byte is 252 (between 240 and 255); the class is E.
Classes and Blocks
One problem with classful addressing is that each class is divided into a fixed
number of blockswith each block having a fixed size as shown in Table 3.1.
The subnet mask can also be denoted using the decimal equivalents of the
binary patterns. Thedefault subnet masks for the different classes of networks
are as below in Table 3.3.1
c)
125.35.12.57 IP address
255.255.0.0 Mask
125.35.0.0 Sub-network address
(i.e. 128) So for byte-3 value use bite-wise AND operators. It is shown below.
120.14.22.16 IP address
255.255.128.0 Mask
125.14.0.0 Sub-network address
In the above example, the bite wise ANDing is done in between 22 and 128. It is as
follows.
22 Binary representation 00010110
128 Binary representation 10000000
00000000
Thus the sub-network address for this is 120.14.0.0.
Example 3.3.5 Finde the class of the following address.
a) 1.22.200.10 b) 241.240.200.2 c) 227.3.6.8 d) 180.170.0.2
Solution: a) 1.22.200.10 Class A IP address
241.240.200.2 Class E IP address
227.3.6.8 Class D IP address
180.170.0.2 Class B IP address
Example 3.3.6Find the retid and Hositd for the following.
a) 19.34.21.5 b) 190.13.70.10 c) 246.3.4.10 d) 201.2.4.2
Solution
a) netid => 19 Hostid => 13.70.10
b) netid => 190.13 Hostid => 70.10
No netid and No Hostid because 246.3.4.10 is the class E address.
netid =>201.2.4 Hostid =>2
Example 3.3.7: Consider sending a 3500 - byte datagram that has arrived at a router
R1that needs to be sent over a link that has an MTU size of 1000 bytes to R2. Then it has
CN : UNIT III Network Layer : Chennai Institute of Technology Page 11
to traverse a link with an MTU of 600 bytes. Let the identification number of the original
datagram be 465.
How many fragments are delivered at the destination ? Show the parameters associated
with eachof these fragments.
Solution: The maximum size of data field in each fragment = 680 (because there are 20
bytes IP header). Thusthe number of required fragments) = [3500 - 20/680] - 5.11 ~ 6.
Each fragment will have Identification number 465. Each fragment except the last
one will be of size 700 bytes (including IP header). The last datagram will be of size 360
bytes (including IP header). The offsets of the4 fragments will be 0, 85, 70, 255. Each or
the first 3 fragments will have flag=l; the last fragment will have flag=0.
Example 3.10
An ISP is granted a block of addresses starting with 190.100.0.0/16 (65,536 addresses).
The ISPneeds to distribute these addresses to three groups of customers as follows:
The first group has 64 customers; each needs 256 addresses.
The second group has 128 customers; each needs 128 addresses.
The third group has 128 customers; each needs 64 addresses.
Design the sub blocks and find out how many addresses are still available after these allocations.
Solution
Figure 3.11 shows the situation.
1. Datagram
Packets in the IPv4 layer are called datagrams. A datagram is a variable-length packet consisting
Header length (HLEN): This 4-bit field defines the total length of the datagram headerin 4-
bytewords.
Services: This 8-bit field has following service
With only 1 bit set at a time, we can have five different types of services.
Total length. This is a 16-bit field that defines the total length (header plus data) .
Identification. This field is used indicate types of fragmentation.
Flags. This field is used in fragmentation.
Fragmentation offset. This field is used indicate reassembly.
Time to live: A datagram has a limited lifetime in its travel through an internet.
Protocol: This 8-bit field defines the higher-level protocol that uses the servicesof
the IPv4 layer. An IPv4 datagram can encapsulate data from several higher-level
protocols such as TCP, UDP,ICMP, and IGMP.
Checksum: The checksum concept and its calculation.
Source address: This 32-bit field defines the IPv4 address of the source
Destination address: This 32-bit field defines the IPv4 address of the
destination
6
Example 3.12
An IPv4 packet has arrived with the first 8 bits as shown:
01000010The receiver discards the packet. Why?
Solution
There is an error in this packet. The 4 leftmost bits (0100) show the version, which is
correct. The next 4 bits (0010) show an invalid header length (2 x 4 =8). The minimum
number of bytes in the header must be 20. The packet has been corrupted in transmission.
Example 3.13
In an IPv4 packet, the value of HLEN is 1000 in binary. How many bytes of options are
being carried by this packet?
Solution
The HLEN value is 8, which means the total number of bytes in the header is 8 x 4, or 32
bytes.The first 20 bytes are the base header; the next 12 bytes are the options.
Fragmentation
A datagram can travel through different networks. Each router decapsulates the IPv4
datagram from the frame it receives, processes it, and then encapsulates it in another
frame
Checksum
First, the value of the checksum field is set to O. Then the entire header is divided into
16-bit sections and added together. The result (sum) is complemented and inserted into
the checksum field.
Options
The header of the IPv4 datagram is made of two parts: a fixed part and a variable part.
The fixed part is 20 bytes long The variable part comprises the options that can be a
maximum of 40 bytes. Options, as the name implies, are not required
No Operation
A no-operation option is a 1-byte option used as filler between options.
End of Option
7
An end-of-option option is a 1-byte option used for padding at the end of the option field.
Record Route
A record route option is used to record the Internet routers that handle the datagram.
Strict Source Route
A strict source route option is used by the source to predetermine a route for the
datagram as ittravels through the Internet.
Loose Source Route
Each router in the list must be visited, but the datagram can visit other routers as well.
Timestamp
A timestamp option is used to record the time of datagram processing by a router. .
3.7 IPv6:
The next-generation IP, or IPv6, has some advantages over IPv4 that can be
summarized asfollows:
Larger address space
Better header format
New options
Allowance for extension
Support for resource allocation
Support for more security
IPv6 addresses
A new notation has been devised for writing 16-byte addresses. They are written as
eightgroups of four hexadecimal digits with colons between the groups, like this
8000 : 0000 : 0000 : 0000 : 0123 : 4567 : 89AB : CDEF
Optimization
Leading zeros within a group can be omitted so 0123 can be written as 123.
One or more groups of 16 zero bits can be replaced by a pair of colons. The
address newbecomes
8000 : : 123 : 4567 : 89AB : CDEF
3.7.1 Address Types
IPv6 allows three types of addresses.
3.7.1.1 Unicast 2. Anycast 3. Multicast
Unicast: An identifier for a single interface. A packet sent to a unicast address is
delivered to the interface identified by that address.
Anycast: An identifier for a set of interfaces. A packet sent to an anycast
address isdelivered to one of the interfaces identified by the address.
Multicast: An identifier for a set of interfaces. A packet sent to a multicast
address isdelivered to all interfaces identified by that address.
8
Packet Format
Each packet is composed of a mandatory base header followed by the payload. The
payload consists of two parts: optional extension headers and data from an upper layer.
The base header occupies 40 bytes, whereas the extension headers and data from the
upper layer contain up to 65,535 bytes of information.
a. Base Header
These fields are as follows:
Version: This 4-bit field defines the version number of the IP. For IPv6, the value is 6.
Priority: The 4-bit priority field defines the priority of the packet.
Flow label: The flow label is a 3-byte (24-bit) field used for control the flow of data.
Payload length: The 2-byte payload length field defines the length of the IP
datagramexcludingthe base header.
Next header: The next header is an 8-bit field defining the header that follows thebase
header inthe datagram.
9
Hop limit: This 8-bit hop limit field used to indicate life time of the packet.
Source address: The source address field is a 16-byte (128-bit) Internet address
thatidentifiesthe original source of the datagram.
Destination address: The destination address field is a 16-byte (128-bit)
Internetaddress thatusually identifies the final destination of the datagram.
Priority: The priority field of the IPv6 packet defines the priority of each packet.
Comparison between IPv4 and IPv5
Sr. No. IPv4 IPv6
1. Header size is 32 bits Header size is 128 bits
2. It cannot support auto configuration. Supports auto configuration.
3. Cannot support real time application. Supports real time application.
4. No security at network layer. Provides security at network layer.
5. Throughput and delay is more. Throughput and delay is less.
Transition from IPv4 to IPv6
Three strategies have been devised by the IETF to help the transition.
1. Dual stack 2. Tunneling 3. Header translation
Dual Stack
All the host must run IPv4 and IPv6 simultaneously until all the Internet uses IPv6.
Fig. 3.27 shows the dual stack.
Fig. 3.30
The value of the protocol field in the IP datagram is 1 to indicate that the IP
datais an ICMP message.
3.7.1 Message Types
All ICMP messages fall in the following classes :
3.7.1.1 Error reporting 2. Query.
The error reporting messages report problems that a router or a host may
encounter whenit processes an IP packet.
The query messages, which occurs in pairs, help a host or a network manager
specific information from a router or another host.
The main functions associated with the ICMP are as follows:
Error reporting
Reachability
testing 3 Congestion
control
Route change notification
Performance measuring
Subnet addressing.
3.7.2 Message Format
Fig 3.31 shows the basic error message format. An ICMP message is encapsulated
into the data field of an IP packet. An ICMP header is 8 bytes long and a variable
size data section.
Fig. 3.41
Type field (8 bits): The type field indicates the type of ICMP message. A
timestamp message will have the number 13 and timestamp Reply message will
have the number 14.
Code field (8 bits): The code field is used by the different message formats to
indicatespecific error conditions
Checksum (16 bits): The checksum is the 16-bit ones complement..
Identifier and sequence number (16 bits each): The identifier and sequence
number may be used by the echo sender to aid in matching the replies with the
echo requests.
Originate timestamp (32 bits): The originate timestamp is the time in units of
32milliseconds from the source.
Receive timestamp (32 bits): The receive timestamp is the time in units of 32
milliseconds at the destination.
Transmit timestamp (32 bits): The transmit timestamp is the time in units of 32
milliseconds Timestamp Reply datagram was transmitted from the destination.
Example 3.5.1 An IP and ICMP packet comes back with the following information:
Original timestamp 46
Receiving time 59
Transmit time 60
Return time 67
Calculate sending time, receiving time and round-trip time.
Solution
Sending time Receive timestamp – Original
timestamp
59 – 46
13 milliseconds
Receiving time Returned time – Transmit time
67 – 60
7 milliseconds
Round-trip time Sending time + Receiving time
13 + 7 = 20 m milliseconds
3.7.6 Address Mask Request and Reply Messages
The address mask request is used by a host to determine what its address mask is
on a network. The address mask reply message is the reply from a router or a host
to thesource host with the correct address mask for the network.
Fig. 3.42 shows the format of the mask request and reply message format.
Fig. 3.42
Type field: The type field indicates the type of ICMP message. An address mask
request message will have the number 17 in the type field and an address
mask reply message will have the number 18.
Code field: The code field is used by the different message formats to indicate
specific error conditions..
Checksum: The checksum is the 16-bit ones's complement of the one's complement sum
Identifier and sequence number: The identifier and sequence number may be
used bythe echo sender to aid in matching the replies with the echo requests.
Address mask: The address mask field contains the 32 bit subnet mask for the
network(e.g. 255.255.255.0).
3.7.7 Router Solicitation and Advertisement
Fig. 3.43 shows the router solicitation message format.
Type : 10 Code : 0 Checksum
Identifier Sequence number
Fig. 3.43
Identifier and sequence number fields are not used.
Fig. 3.44 shows the router advertisement message format.
This is the reply that comes back from the previous request. Lifetime field
shows thenumber of seconds that the entries are considered to be valid.
Type : 9 Code : 0 Checksum
Number of addresses Address entry size Lifetime
Router address 1
Address preference 1
Router address 2
Address preference 2
Fig. 3.45
3.8 Routing table
A host or a router has a routing table with an entry for each destination or a combination
of destinations, to route IP packets. Routing table can be either static or dynamic or Static
Routing table:
Mask. This field defines the mask applied for the entry.
Network address. This field defines the network address to which the packet is
Reference count. This field gives the number of users of this route at the moment.
Use. This field shows the number of packets transmitted through this router for the
corresponding destination.
of Static Routing
Minimal CPU/Memory overhead.
controlling
mechanism if any faults in
networks.
algorithms for
routing the data packets.
3.4 Forwarding
Forwarding Techniques
autonomous system.
collection of interconnected AS’s.
Fig. 3.9.6
Network address : The address field defines the address of the destination network.
Bellman-Ford algorithm
Bellman-Ford algorithm is illustrated in the followingexample.
Solution :Step-1:
b. Database description
memory space
Simple to implement and support.
Fig. 3.11.1
Type: Type field indicates type of message. BGP defines four message type.
c) NOTIFICATION d) KEEPALIVE
BGP easily solves the count-to-infinity problem.
Multicast Routing
Routing Protocols
PIM-DM mode
Routers explicitly join and leave the group by using "Join" and "Leave" messages.
d)255.255.255.255
: : OF53:6382:AB00:67DB:BB27:7332 : Correct
7803:42F2:::88EC-D4BA:B75D:11CD : Incorrect because of two many (:)
UNIT IV
TRANSPORT LAYER
4.1 Introduction of Transport Layer
• A transport layer is responsibility for source to destination or end to end delivery of entire
message.
• Transport layer functions
1. This layer breaks messages into packets.
2. It performs error recovery if the lower layer are not adequately error free.
3. Function of flow control if not done adequately at the network layer.
4. Functions of multiplexing and demultiplexing sessions together.
5. This layer can be responsible for setting up and releasing connections across the network.
4.2 The Transport Services
• The transport entity that provides services to transport service users, whichmight be an
application process.
• The hardware and software within the transport layer that does the work is called the
transport entity. The following categories of service are useful for describing the transport
service.
1. Type of service
2. Quality of service
3. Data transfer
4. User interface
5. Connection management
6. Expedited delivery
7. Status reporting
8. Security
1. Type of service
• It provides two types of services connection-oriented and connectionless or datagram
service.
2. Quality of service
• The transport protocol entity should allow the transport service user to specify the quality
of transmission service to be provided.
• Following are the transport layer quality of service parameters.
a) Error and loss levels.
Page 1
b) Desired average and maximum delay.
c) Throughput.
d) Priority level.
e) Resilience.
3. Data transfer: It transfers data between two transport entities.
4. User Interface: There is not clear mechanism of the user interface to the transport
protocol should be standardized.
5. Connection management: If connection-oriented service is provided, the transport
entity is responsible for establishing and terminating connections.
6. Status reporting: It gives the following information.
a) Addresses.
b) Performance characteristics of a connection.
c) Class of protocol in use.
d) Current timer values.
7. Security: The transport entity may provide a variety of security services.
Page 2
Length. This is a 16-bit field that defines the total length of the user datagram, headerplus data.
Checksum. This field is used to detect errors.
3. Checksum
The UDP checksum calculation is different from the one for IP and ICMP. Here the checksum
includes three sections: a pseudoheader, the UDP header, and the data coming from the
application layer
4. UDP Operation:
UDP uses concepts common to the transport layer.
Page 3
Connectionless Services
UDP provides a connectionless service. This means that each user datagram sent by UDP is an
independent datagram. There is no relationship between the different user datagrams even if they
are coming from the same source process and going to the same destination program.
Flow and Error Control
UDP is a very simple, unreliable transport protocol. There is no flow control and hence no
window mechanism. The receiver may overflow with incoming messages. There is no error
control mechanism in UDP except for the checksum.
Encapsulation and Decapsulation
To send a message from one process to another, the UDP protocol encapsulates and
decapsulates messages in an IP datagram.
Queuing
In UDP, queues are associated with ports. (Figure 4.12).
At the client site, when a process starts, it requests a port number from the operating system.
Some implementations create both an incoming and an outgoing queue associated with each
process. Other implementations create only an incoming queue associated with each process.
5. Use of UDP
The following lists some uses of the UDP protocol:
UDP is suitable for a process that requires simple request-response communication with little
concern for flow and error control.
UDP is suitable for a process with internal flow and error control mechanisms.
UDP is a suitable transport protocol for multicasting.
UDP is used for some route updating protocols such as Routing Information Protocol (RIP).
4.4 TCP
TCP is a process-to-process (program-to-program) protocol. TCP is called a connection-
oriented, reliable transport protocol. TCP uses flow and error control mechanisms at the transport
level.
1. TCP Services
Page 4
The services offered by TCP to the processes at the application layer.
Process-to-Process Communication
TCP provides process-to-process communication using port numbers.
2. Stream Delivery Service
TCP is a stream-oriented protocol. TCP allows the sending process to deliver data as a stream of
bytes and allows the receiving process to obtain data as a stream of bytes. TCP creates an
environment in which the two processes seem to be connected by an imaginary "tube" that
carries their data across the Internet.
Page 5
There are two fields called the sequence number and the acknowledgment number. These two
fields refer to the byte number and not the segment number.
Byte Number
TCP numbers all data bytes that are transmitted in a connection. The bytes of data being
transferred in each connection are numbered by TCP. The numbering starts with a randomly
generated number.
Sequence Number
After the bytes have been numbered, TCP assigns a sequence number to each segment that is
being sent.
Acknowledgment Number
Communication in TCP is full duplex; when a connection is established, both parties can send
and receive data at the same time.
6. Flow Control
TCP provides flow control. The receiver of the data controls the amount of data that are to be
sent by the sender.
Error Control
To provide reliable service, TCP implements an error control mechanism
Congestion Control
TCP, takes into account congestion in the network. The amount of data sent by a sender is not
only controlled by the receiver (flow control), but is also determined by the level of congestion
in the network.
7. Segment
A packet in TCP is called a segment.
8. Format
The format of a segment is shown in Figure 4.16
Page 6
The segment consists of a 20- to 60-byte header.
Source port address. This is a 16-bit field that defines the port number of the
applicationprogram.
Destination port address. This is a 16-bit field that defines the port number of theapplication
program in the host that is receiving the segment.
Sequence number. This 32-bit field defines the number assigned to the first byte of
datacontained in this segment.
Acknowledgment number. This 32-bit field defines the byte number that the receiver ofthe
segment is expecting to receive from the other party.
Header length. This 4-bit field indicates the number of 4-byte words in the TCP header.The
length of the header can be between 20 and 60 bytes. Therefore, the value of this field can be
between 5 (5 x 4 =20) and 15 (15 x 4 =60).
Reserved. This is a 6-bit field reserved for future use.
Control. This field defines 6 different control bits or flags as shown in Figure 4.17.One or more
of these bits can be set at a time.
These bits enable flow control, connection establishment and termination, connection abortion,
and the mode of data transfer in TCP. A brief description of each bit is shown in Table 4.3
Window size. This field defines the size of the window, in bytes, that the other partymust
maintain.
Checksum. This 16-bit field contains the checksum.
Urgent pointer. This l6-bit field, which is valid, only if the urgent flag is set, is usedwhen the
segment contains urgent data.
Page 7
Options. There can be up to 40 bytes of optional information in the TCP header.
A TCP Connection
TCP is connection-oriented. A connection-oriented transport protocol establishes a virtual path
between the source and destination. All the segments belonging to a message are then sent over
this virtual path.
a. Connection Establishment
TCP transmits data in full-duplex mode. When two TCPs in two machines are connected,
they are able to send segments to each other simultaneously.
Three-Way Handshaking:
The connection establishment in TCP is called three way handshaking. Tthe three-way
handshaking process as shown in Figure 4.18.
1. The client sends the first segment, a SYN segment, in which only the SYN flag is set.
This segment is for synchronization of sequence numbers. It consumes one sequence number.
When the data transfer start, the sequence number is incremented by 1.
2. The server sends the second segment, a SYN +ACK segment, with 2 flag bits set:
SYN and ACK.
3. The client sends the third segment. This is just an ACK segment. It acknowledges the
receipt of the second segment with the ACK flag and acknowledgment number field.
b. Data Transfer
After connection is established, bidirectional data transfer can take place. The client and server
can both send data and acknowledgments. Figure 4.19 shows an example.
In this example, after connection is established (not shown in the figure), the client sends 2000
bytes of data in two segments. The server then sends 2000 bytes in one segment.
Page 8
The client sends one more segment. The first three segments carry both data and
acknowledgment, but the last segment carries only an acknowledgment because there are no
more data to be sent.
Pushing Data
The sending TCP uses a buffer to store the stream of data coming from the sending application
program. The sending TCP can select the segment size.
The application program at the sending site can request a push operation. This means that the
sending TCP must not wait for the window to be filled. It must create a segment and send it
immediately.
Urgent Data
On occasion an application program needs to send urgent bytes. This means that the sending
application program wants a piece of data to be read out of order by the receiving application
program.
c. Connection Termination
Any of the two parties involved in exchanging data (client or server) can close the connection,
although it is usually initiated by the client. Most implementations today allow two Options for
connection termination: three-way handshaking and four-way handshaking with a half-close
option.
Three-Way Handshaking
Most implementations today allow three-way handshaking for connection termination as shown
in Figure 4.20.
1. In a normal situation, the client TCP, after receiving a close command from the client process,
sends the first segment, a FIN segment in which the FIN flag is set.
Page 9
The FIN segment consumes one sequence number if it does not carry data.
2. The server TCP, after receiving the FIN segment, informs its process of the situation and
sends the second segment, a FIN +ACK segment, to confirm the receipt of the FIN segment from
the client and at the same time to announce the closing of the connection in the other direction.
The FIN +ACK segment consumes one sequence number if it does not carry data.
3. The client TCP sends the last segment, an ACK segment, to confirm the receipt of the FIN
segment from the TCP server. This segment contains the acknowledgment number, which is 1
plus the sequence number received in the FIN segment from the server.
Page 10
10. Flow Control
TCP uses a sliding window to handle flow control. The sliding window protocol used by TCP,
however, is something between the Go-Back-N and Selective Repeat sliding window.
The size of the window at one end is determined by the lesser of two values: receiver window
(rwnd) or congestion window (cwnd).
Page 11
ii. Retransmission After Three Duplicate ACK Segments
One segment is lost and the receiver receives so many out-of-order segments that they cannot be
saved (limited buffer size).
a. Normal Operation
The first scenario shows bidirectional data transfer between two systems, as in Figure .
The client TCP sends one segment; the server TCP sends three. The figure shows which rule
applies to each acknowledgment. There are data to be sent, so the segment displays the next byte
expected. When the client receives the first segment from the server, it does not have any more
data to send; it sends only an ACK segment
b. Lost Segment
In this scenario, we show what happens when a segment is lost or corrupted. A lost
segment and a corrupted segment are treated the same way by the receiver. A lost segment is
discarded somewhere in the network; a corrupted segment is discarded by the receiver itself.
Both are considered lost. Figure 4.24 shows a situation in which a segment is lost and discarded
by some router in the network, perhaps due to congestion.
Page 12
c. Fast Retransmission
In this scenario, we want to show the idea of fast retransmission. Our scenario is the same as the
second except that the RTO has a higher value (see Figure 4.25).
Example 4.5.1 With TCP's slow start and AIMD for congestion control, show how the
windowsize will vary for a transmission where every 5th packet is lost. Assume an advertised
window size of 50 MSS.
Solution: Since Slow Start is used, window size is increased by the number ofsegments
successfully sent. This happens until either threshold, value is reached or time out occurs.
In both of the above situations AIMD is used to avoid congestion. If threshold is reached,
window size will be increased linearly. If there is timeout, window size will be reduced to half.
Assuming the window size at the start of the slow start phase is 2 MSS and the threshold
at the start of the first transmission is 8 MSS.
Page 13
Window size for 1st transmission = 2 MSS
Window size for 2nd transmission = 4 MSS
Window size for 3rd transmission = 8 MSS
threshold reached, increase linearly (according to AIMD)
Window size for 4th transmission = 9 MSS
Window size for 5th transmission = 10 MSS
time out occurs, resend 5thwith window size starts with as slow start.
Window size for 6 th transmission = 2 MSS
Window size for 7 th transmission = 4 MSS
threshold reached, now increase linearly (according to AIMD)
Additive Increase: 5 MSS (since 8 MSS isn't permissible anymore)
Window size for 8th transmission = 5 MSS
Window size for 9th transmission = 6 MSS
Window size for 10th transmission = 7 MSS
This shows that window size is variable and time out occurs during the fifth transmission.
Example 4.5.2 Suppose you are hired to design a reliable byte-stream protocol that uses a sliding
window (like TCP). This protocol will run over a 50-Mbps network, the RTT of the network is
80ms and the maximum segment lifetime is 60 seconds. How many bits would you include in the
Advertised Window and Sequence Numfields of your protocol header ?
Solution
(50 103 )
The window size (in bytes) must be RTT Bandwidth = 8 (0.08) = 500 bytes
We need therefore, 12 bits for the advertized window (allows a maximum windowsize of
33554431 bytes)
4.6 Adaptive Retransmission
• TCPguarantees the reliable delivery of data, it retransmits each segment if an ACKis not
received in a certain period of time. TCP sets this timeout as a function of the RTT it
expects between the two ends of the connection.
• TCP uses an adaptive retransmission mechanism.
• Every time TCP sends a data segment, it records the time. When an ACK for that
segment arrives, TCP reads the time again and then takes the difference between these
two times as a sample RTT.
• TCP then computes an estimate RTT as a weighted average between the previous
estimate and this new sample.
Estimated RTT = α Estimated RTT + (1 - α) Sample RTT
Page 14
• Parameter αis selected to smooth the estimated RTT.
• TCP then uses Estimated RTT to compute the timeout in a rather conservativeway :
Timeout = 2 Estimated RTT
4.6.1 Karn / Partridge Algorithm
• The problem of the above algorithm is that, an ACK does not really acknowledge a
transmission it actually acknowledges the receipt of data. Fig. 4.6.1 shows associating the
ACK with / retransmission.
• If you assume that the ACK is for the original transmission but it was really for the
second, then the sample RTT is too large, which is shown in Fig. 4.6.1.
• If you assume that the ACK is for the second transmission but it was actually for the first,
then the sample RTT is too small.
Page 15
4.6.2 Jacobson / Karels Algorithm
• This algorithm is used by any end to end protocol.
• In this algorithm, the sender measures a new sample RTT as before. It then foldsthis new
sample into the timeout calculation as follows :
Difference = Sample RTT - Estimated RTT
Estimated RTT = Estimated RTT + ( Difference)
Deviation = Deviation + ( | Difference | - Deviation)
where is fraction between 0 and 1.
• TCP then computes the timeout value as a function and both Estimated RTT and
deviation as follows :
Timeout = µ Estimated RTT + Deviation
4.9.1 Comparison of TCP and UDP
Service/Features TCP UDP
Connection-oriented yes no
Full duplex yes yes
Reliable data transfer yes no
Partial-reliable data transfer no no
Ordered data delivery yes no
Unordered data delivery no yes
Flow control yes no
Congestion control yes no
ECN capable yes no
Selective ACKs optional no
Preservation of message boundaries no yes
Path MTU discovery yes no
Application PDU fragmentation yes no
Appliation PDU bundling yes no
Multistreaming no no
Multihoming no no
Protecting against SYN flooding attacks no Not applicable
Allows half-closed connections yes Not applicable
Rechability check yes no
Psuedo-header for checksum yes yes
Time wait state for 4-tuple Not applicable
Page 16
Questions and Answers
1. What are the advantages of using UDP over TCP? (Dec 10)
Ans: Does not include the overhead needed to detect reliability and maintain connection-
oriented semantics.
2. Give the approaches to improve the QoS. (May 11, Dec 17)
Ans: Approaches to QoS:
1. Fine-grained approaches, which provide QoS to individual applications or flows.
Integrated services, a QoS architecture developed in the IETF and often associated with
RSVP.
2. Coarse-grained approaches, which provide QoS to large classes of data or aggregated
traffic. Differentiated services which is probably the most widely deployedQoS
mechanism.
3. What is TCP ?(Dec 11)
Ans: TCP provides a connection oriented, reliable, byte stream service. The term connection-
oriented means the two applications using TCP must establish a TCP connection with each other
before they can exchange data.
4. Define congestion.( Dec 11)
Ans: When too many packets rushing to a node or a part of network, the network performance
degrades so this situation is called as congestion.
5. What do you mean by slow start in TCP congestion ?(May 16)
Ans: Slow-start is part of the congestion control strategy used by TCP, the data transmission
protocol used by many Internet applications. Slow-start is used in conjunction with other
algorithms to avoid sending more data than the network is capable oftransmitting, that is, to
avoid causing network congestion.
6 What do you mean by QoS ?(Dec14,15,16,18)
Ans: Quality of Service is used in some organizations to help provide an optimal end-user
experience for audio and video communications. QoS is most-commonly used on networks
where bandwidth is limited: with a large number of network packets competing: for a relatively
small amount of available bandwidth.
7. Why is UDP pseudo header included in UDP checksum calculation? What is the
effect of an invalid checksum at the receiving UDP?(May 13)
Ans: To verify that the user datagram has reached its correct destination. Since UDP is a
connectionless protocol, it does not throw any exceptions on receiving a invalid "checksum”
UDP message. The transport layer on the other hand, might drop it on receiving this packet
because of the wrong check sum.
Page 17
8. Suppose TCP operates over a 1-Gbps link, utilizing the full bandwidth continuously.
How long will it take for sequence numbers to wrap around, completely? Suppose
an added 32-bit timestamp field increments, 1000 times during this wrap around
time, how long will it take for the, timestamp filed to wraparound?(May 13,18)
Ans: TCPAdvertisedWindow is 16 bits, SequenceNum is 32 bits. At most there will by 232
bytes on the fly in this 1 Gbpslink. The corresponding transmission time is 2 32 8 / 1 109 =
34.36 sec. So it will take 34.36 sec to wrap around the sequence number.
Each increment of timestamp = 34.36 sec / 1000 = 34.36 ms,
So the total time can be expressed by this timestamp = 34.36 10-3 232 sec
= 1.48 108 sec = 4.68 year
So, by adding this timestamp, it will take 4.68 year to wrap around the sequence number.
9. Differentiate between delay and jitter.(Dec 13)
Ans: Delay is the time it takes a packet totravel across the network from source todestination.
Jitter is the fluctuation of end-to-end delay from packet to the next packet.
10. What is the difference between congestion control and flow control ?( Dec 15,17)
Ans. : i) Flow control is done by server machine whereas congestion control is done by
router.
ii) Flow control cannot block the bandwidth of medium whereas congestion control
blocks the bandwidth of the medium.
iii) Flow control affects less on network performance. Congestion control affects the
network performance.
iv) Flow control uses buffering whereas congestion control not used buffering.
11. List some ways to deal with congestion.
Ans. : Several ways to handle congestion
1. Packet elimination 2. Flow control
3. Buffer allocation 4. Choke packets
12. Define a network congestion.
Ans: When two or more nodes would simultaneously try to transmit packets to one node there is
a high probability that the number of packets would exceed the packet handling capacity of the
network and lead to congestion.
13. Define a segment
Ans: The term segment usually refers to an information unit whose source and destination are
transport layer entities.
14. Defineslow start.(May 14)
Ans. :Slow start is congestion control in TCP.
Page 18
15. When can an application make use of UDP ?( May 14)
Ans. : Fast data transmission and multicast operation. Q.51 Differentiate UDP and TCP.
16. Differentiate UDP and TCP (May 14,16)
Ans. :
Sr.No. UDP TCP
1. Connectionless Connection oriented
2. Connection is message stream. Connection is byte stream
3. Supports broadcasting Does not support broadcasting
17. List some of the quality of service parameters of transport layer.(May 15)
Ans. :ISO specifies eleven QoS parameters for transport layer
1. Connection establishment delay 2. Connection establishment failureprobability
3. Throughput 4. Transit delay
5. Residual error rate 6. Transfer failure probability
7. Connection release delay 8. Connection release failure probability
9. Protection 10. Priority
11. Resilience
18. How does transport layer perform duplication control? (May 15)
Ans: TCP uses a sequence number to identity each byte of data. It helps to avoid duplicate data
and disordering during transmission.
19. List the different phases used in TCP connection.(May 16)
Ans. : 1) TCP connection establishment
2) TCP connection termination
3) TCP connection release
20. How do fast retransmit mechanism of TCP works ?(May 17)
Ans: With fast retransmit, the sender retransmits the missing TCP segments before their
retransmission timers expire. Because the retransmission timers did not expire or for the missing
TCP segments, missing segments are received at the destination andacknowledged by the
receiver more quickly than they would have been without fast retransmit and the sender can
more quickly send later segments to the receiver. This process is known as fast recovery.
21. What are the services provided by Transport layer protocol ?(May 18)
Ans: The services provided by Transport layer protocol are
• Reliable communication over an unreliable channel
• It provides connection-oriented and connectionless services
• It provides logical communication between processes running on hosts.
Page 19
22. Define congestion control(May 18)
Ans: Congestion control refers to the mechanisms and techniques to control thecongestion and
keep the load below the capacity.
Page 20
lOMoARcPSD|351 717 46
lOMoARcPSD|351 717 46
APPLICATION LAYER
UNIT - V
Domain Name Space (DNS), DDNS, TELNET, EMAIL, File Transfer Protocol (FTP), WWW, HTTP, SNMP,
Bluetooth, Firewalls, Basic concepts of Cryptography.
DNS is a host name to IP address translation service. DNS is a distributed database implemented in a
hierarchy of name servers. It is an application layer protocol for message exchange between clients and
servers.
DNS Examples
There are various kinds of DOMAIN :
1. Generic domain : .com(commercial) .edu(educational) .mil(military) .org(non profit
organization) .net(similar to commercial) all these are generic domain.
2. Country domain .in (india) .us .uk
3. Inverse domain if we want to know what is the domain name of the website. Ip to domain name
mapping.So DNS can provide both the mapping for example to find the ip addresses of
geeksforgeeks.org then we have to type nslookup www.geeksforgeeks.org.
Advantages:
1. It saves time required by static addresses updates manually when network configuration changes.
2. It saves space as the number of addresses are used as required at one time rather than using one for
all the possible users of the IP address.
3. It is very comfortable for users point of view as any IP address changes will not affect any of their
lOMoARcPSD|351 717 46
activities.
4. It does not affect accessibility as changed IP addresses are configured automatically against URL’s.
Disadvantages:
1. It is less reliable due to lack of static IP addresses and domain name mappings.
2. Dynamic DNS services alone cannot make any guarantee about the device you are attempting to
connect is actually your own.
Telnet
This Protocol that allows you to connect to remote computers (called hosts) over a TCP/IP network (such
as the internet), Once your telnet client establishes a connection to the remote host, your client becomes a
virtual terminal, allowing you to communicate with the remote host from your computer
Modes of Operation:
Most telnet implementation operates in one of the following three modes.
Default Mode:
• If there is no other modes are invoked then this mode is used.
• Echoing is performed in this mode by client.
• In this mode, user types a character and client enchoes the character on the screen but it does not
send it until whole line is completed.
Character Mode:
• Each character typed in this mode is sent by client to server.
• Server in this type of mode is normally enchoes character back to be displayed on the client’s
screen.
Line Mode:
• Line editing like echoing, character erasing etc is done from the client side.
• Client will send the whole line to the server.
Electronic Mail
Email 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.
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.
must have client MTA and system MTA. It transfers 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.
3. 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.
4. 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 send 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.
• 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.
It is an application layer protocol which 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.
FTP Session :
When a 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.
Data Structures: FTP allows three types of data structures:
1. File Structure – In file-structure there is no internal structure and the file is considered to be a
continuous sequence of data bytes.
2. Record Structure – In record-structure the file is made up of sequential records.
3. Page Structure – In page-structure the file is made up of independent indexed pages.
History:
It is a project created, by Timothy Berner’s Lee in 1989, for researchers to work together effectively at
CERN. is an organisation, named World Wide Web Consortium (W3C), was developed for further
development in web. This organisation is directed by Tim Berner’s Lee, aka father of web.
Working of WWW:
The World Wide Web is based on several different technologies : Web browsers, Hypertext Markup
Language (HTML) and Hypertext Transfer Protocol (HTTP).
Web browser is used to access webpages. Web browsers can be defined as programs which display text,
data, pictures, animation and video on the Internet.
Some of the commonly used browsers are Internet Explorer, Opera Mini, Google Chrome.
Features of WWW:
• HyperText Information System
• Cross-Platform
• Distributed
• Open Standards and Open Source
• Uses Web Browsers to provide a single interface for many services
• Dynamic, Interactive and Evolving.
• “Web 2.0”
Components of Web
There are 3 components of web:
1. Uniform Resource Locator (URL): serves as system for resources on web.
2. Hypertexts Transfer Protocol (HTTP): specifies communication of browser and server.
3. Hyper Text Markup Language (HTML): defines structure, organization and content of
webpage.
lOMoARcPSD|351 717 46
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 as HyperText Markup Language
(HTML)
Characteristics of HTTP :
HTTP is IP based communication protocol which is used to deliver data from server to client or vice-
versa.
1. Server processes a request, which is raised by client and also server and client knows each other
only during current request and response period.
2. Any type of content can be exchanged as long as server and client are compatible with it.
3. Once data is exchanged then servers and client are no more connected with each other.
4. It is a request and response protocol based on client and server requirements.
5. It is connection less protocol because after connection is closed, server does not remember
anything about client and client does not remember anything about server.
6. It is stateless protocol because both client and server does not expecting anything from each other
but they are still able to communicate.
Advantages :
• Memory usage and CPU usage are low because of less simultaneous connections.
• Since there are few TCP connections hence network congestion are less.
• Since handshaking is done at initial connection stage, then latency is reduced because there is no
further need of handshaking for subsequent requests.
• The error can be reports without closing connection.
• HTTP allows HTTP pipe-lining of request or response.
Disadvantages :
• HTTP requires high power to establish communication and transfer data.
• HTTP is less secure, because it does not uses any encryption method like https use TLS to encrypt
normal http requests and response.
• HTTP is not optimized for cellular phone and it is too gabby.
• HTTP does not offer genuine exchange of data because it is less secure.
• Client does not close connection until it receives complete data from server and hence server needs
to wait for data completion and cannot be available for other clients during this time.
Simple Network Management Protocol (SNMP)
SNMP is an application layer protocol which uses UDP port number 161/162.SNMP is used to monitor
the network, detect network faults and sometimes even used to configure remote devices.
lOMoARcPSD|351 717 46
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, router, switches, servers etc.
3. Management Information Base –
MIB consists of information of resources that are to be managed. These information is organised
hierarchically. It consists of objects instances which are essentially variables.
SNMP messages –
Different variables are:
1. Get Request –
SNMP manager sends this message to request data from SNMP agent. It is simply used to retrieve data
from SNMP agent. In response to this, SNMP agent responds with requested value through response
message.
2. Get Next Request –
This message can be sent to discover what data is available on a SNMP agent. The SNMP manager
can request for data continuously until no more data is left. In this way, SNMP manager can take
knowledge of all the available data on SNMP agent.
3. Get Bulk Request –
This message is used to retrieve large data at once by the SNMP manager from SNMP agent. It is
introduced in SNMPv2c.
4. Set Request –
It is used by SNMP manager to set the value of an object instance on the SNMP agent.
5. Response –
It is a message send from agent upon a request from manager. When sent in response to Get messages,
it will contain the data requested. When sent in response to Set message, it will contain the newly set
value as confirmation that the value has been set.
6. Trap –
These are the message send by the agent without being requested by the manager. It is sent when a
fault has occurred.
7. Inform Request –
It was introduced in SNMPv2c, used to identify if the trap message has been received by the manager
lOMoARcPSD|351 717 46
or not. The agents can be configured to set trap continuously until it receives an Inform message. It is
same as trap but adds an acknowledgement that trap doesn’t provide.
SNMP security levels –
It defines the type of security algorithm performed on SNMP packets. These are used in only SNMPv3.
There are 3 security levels namely:
1. No Auth No Priv –
This (no authentication, no privacy) security level uses community string for authentication and no
encryption for privacy.
2. Auth No priv – This security level (authentication, no privacy) uses HMAC with Md5 for
authentication and no encryption is used for privacy.
3. Auth Priv – This security level (authentication, privacy) uses HMAC with Md5 or SHA for
authentication and encryption uses DES-56 algorithm.
Bluetooth
It is a Wireless Personal Area Network (WPAN) technology and is used for exchanging data over smaller
distances. This technology was invented by Ericson in 1994. It operates in the unlicensed, industrial,
scientific and medical (ISM) band at 2.4 GHz to 2.485 GHz. Maximum devices that can be connected at the
same time are 7. Bluetooth ranges upto 10 meters. It provides data rates upto 1 Mbps or 3 Mbps depending
upon the version.
Bluetooth Architecture:
The architecture of bluetooth defines two types of networks:
1. Piconet
2. Scatternet
lOMoARcPSD|351 717 46
Piconet:
Piconet is a type of bluetooth network that contains one primary node called master node and seven
active secondary nodes called slave nodes. Thus, we can say that there are total of 8 active nodes which
are present at a distance of 10 metres. The communication between the primary and secondary node can
be one-to-one or one-to-many. Possible communication is only between the master and slave; Slave-slave
communication is not possible. It also have 255 parked nodes, these are secondary nodes and cannot take
participation in communication unless it get converted to the active state.
Scatternet:
It is formed by using various piconets. A slave that is present in one piconet can be act as master or we
can say primary in other piconet. This kind of node can receive message from master in one piconet and
deliver the message to its slave into the other piconet where it is acting as a slave. This type of node is
refer as bridge node. A station cannot be master in two piconets.
Bluetooth protocol stack:
1. Radio (RF) layer:
It performs modulation/demodulation of the data into RF signals. It defines the physical characteristics
of bluetooth transceiver. It defines two types of physical link: connection-less and connection-
oriented.
2. Baseband Link layer:
It performs the connection establishment within a piconet.
3. Link Manager protocol layer:
It performs the management of the already established links. It also includes authentication and
encryption processes.
4. Logical Link Control and Adaption protocol layer:
It is also known as the heart of the bluetooth protocol stack. It allows the communication between
upper and lower layers of the bluetooth protocol stack. It packages the data packets received from
upper layers into the form expected by lower layers. It also performs the segmentation and
multiplexing.
5. SDP layer:
It is short for Service Discovery Protocol. It allows to discover the services available on another
bluetooth enabled device.
6. RF comm layer:
It is short for Radio Frontend Component. It provides serial interface with WAP and OBEX.
7. OBEX:
It is short for Object Exchange. It is a communication protocol to exchange objects between 2
devices.
lOMoARcPSD|351 717 46
8. WAP:
It is short for Wireless Access Protocol. It is used for internet access.
9. TCS:
It is short for Telephony Control Protocol. It provides telephony service.
10. Application layer:
It enables the user to interact with the application.
Advantages:
• Low cost.
• Easy to use.
• It can also penetrate through walls.
• It creates an adhoc connection immediately without any wires.
• It is used for voice and data transfer.
Disadvantages:
• It can be hacked and hence, less secure.
• It has slow data transfer rate: 3 Mbps.
• It has small range: 10 meters.
Firewall
A firewall is a network security device, either hardware or software-based, which monitors all incoming
and outgoing traffic and based on a defined set of security rules it accepts, rejects or drops that specific
traffic.
Accept : allow the traffic
Reject : block the traffic but reply with an “unreachable error”
Drop : block the traffic with no reply
A firewall establishes a barrier between secured internal networks and outside untrusted network, such as
the Internet.
Firewalls are generally of two types: Host-based and Network-based.
1. Host- based Firewalls : Host-based firewall is installed on each network node which controls
each incoming and outgoing packet. It is a software application or suite of applications, comes as a
part of the operating system. Host-based firewalls are needed because network firewalls cannot
provide protection inside a trusted network. Host firewall protects each host from attacks and
unauthorized access.
2. Network-based Firewalls : Network firewall function on network level. In other words, these
firewalls filter all incoming and outgoing traffic across the network. It protects the internal network by
lOMoARcPSD|351 717 46
filtering the traffic using rules defined on the firewall. A Network firewall might have two or more
network interface cards (NICs). A network-based firewall is usually a dedicated system with
proprietary software installed.
Cryptography
Cryptography is technique of securing information and communications through use of codes so that only
those person for whom the information is intended can understand it and process it. Thus preventing
unauthorized access to information. The prefix “crypt” means “hidden” and suffix graphy means
“writing”.
Domain name space is divided into three different sections: generic domains, country domains & inverse
domain.
Generic domain: Define registered hosts according to their generic behavior, uses genericsuffixes.
Country domain: Uses two characters to identify a country as the last suffix. Inverse domain: Finds the
domain name given the IP address.
FTP establishes two connections between the hosts. One connection is used for data transfer, the other for
control information. The control connection uses very simple rules of communication. The data connection
needs more complex rules due to the variety of data types transferred.
The client has three components: the user interface, the client control process, and the client data transfer
process. The server has two components: the server control process and the server data transfer process. The
control connection is made between the control processes. The data connection is made between the data
transfer processes.
The TCP/IP protocol supports electronic mail on the Internet is called Simple Mail Transfer (SMTP). It is a
system for sending messages to other computer users based on e-mail addresses. SMTP provides mail
exchange between users on the same or different computers.
lOMoARcPSD|351 717 46
6. What is the difference between a user agent (UA) and a mail transfer agent? (MTA)?
The UA prepares the message, creates the envelope, and puts the message in the envelope. The MTA transfers
the mail across the Internet.
MIME is a supplementary protocol that allows non-ASCII data to be sent through SMTP. MIME transforms
non-ASCII data at the sender site to NVT ASCII data and deliverers it to the client SMTP to be sent through
the Internet. The server SMTP at the receiving side receives the NVT ASCII data and delivers it to MIME to
be transformed back to the original data.
Workstations interact with the SMTP host which receives the mail on behalf of every host in the organization,
to retrieve messages b y using a client-server protocol such as Post Office Protocol , version 3(POP3).
Although POP3 is used to download messages from the server, the SMTP client still needed on the desktop to
forward messages from the workstation user to its SMTP mail server.
The documents in the WWW can be grouped into three broad categories: static, dynamic and active.
Static: Fixed-content documents that are created and stored in a server. Dynamic: Created by web server
whenever a browser requests the document. Active: A program to be run at the client side.
HTML is a computer language for specifying the contents and format of a web document. It allows additional
text to include codes that define fonts, layouts, embedded graphics and hypertext links.
CGI is a standard for communication between HTTP servers and executable programs. It is used in crating
dynamic documents.
lOMoARcPSD|351 717 46
Authentication: The receiver is sure of the sender’s identity and that an imposter has not sentthe message.
Integrity: The data must arrive at the receiver exactly as it was sent.
Non-Reputation: The receiver must able to prove that a received message came from a specificsender.
In secret key, the same key is used by both parties. The sender uses this key and an encryption algorithm to
encrypt data; the receiver uses the same key and the corresponding decryption algorithm to decrypt the data. In
public key, there are two keys: a private key and a public key. The private key is kept by the receiver. The
public key is announced to the public.
Digital Signature is an electronic signature that can be used to authenticate the identity of the sender of a
message or document and possibly to ensure that the original content of the message or document that has
been sent is unchanged. Digital signature is easily transportable, cannot be imitated by someone else, and can
be automatically time-stamped. The ability to ensure that the original signed message arrived means that the
sender cannot easily repudiate it later.
15. What are the advantages & disadvantages of public key encryption? Advantages:
a) Remove the restriction of a shared secret key between two entities. Here each entity can create a pair of
keys, keep the private one, and publicly distribute the other one.
b) The no. of keys needed is reduced tremendously. For one million users to communicate, only two
million keys are needed.
Disadvantage:
If you use large numbers the method to be effective. Calculating the cipher text using the long keys takes a lot
of time. So it is not recommended for large amounts of text.
lOMoARcPSD|351 717 46
15. What are the advantages & disadvantages of secret key encryption?
Advantage:
Secret Key algorithms are efficient: it takes less time to encrypt a message. The reason is that the key is
usually smaller. So it is used to encrypt or decrypt long messages.
Disadvantages:
a) Each pair of users must have a secret key. If N people in world want to use this method, there needs to
be N (N-1)/2 secret keys. For one million people to communicate, a half-billion secret keys are needed.
b) The distribution of the keys between two parties can be difficult.
Straight permutation: The no. of bits in the input and output are preserved.
Compressed permutation: The no. of bits is reduced (some of the bits are dropped).
Expanded permutation: The no. of bits is increased (some bits are repeated).
Transposition: A Character level encryption in which the characters retain their plaintext but theposition of
the character changes.
19. State the difference between fully qualified and partially qualified domain name