CC and Network Merged Notes PDF
CC and Network Merged Notes PDF
1. INTRODUCTION
A computer network is a set of devices connected through links. A node can be computer,
printer, or any other device capable of sending or receiving the data. The links connecting the
nodes are known as communication channels.
Computer Network uses distributed processing in which task is divided among several
computers. Instead, a single computer handles an entire task, each separate computer handles
a subset.
o Security: It provides limited interaction that a user can have with the entire system.
For example, a bank allows the users to access their own accounts through an ATM
without allowing them to access the bank's entire database.
o Faster problem solving: Multiple computers can solve the problem faster than a
single machine working alone.
o Security through redundancy: Multiple computers running the same program at the
same time can provide the security through redundancy. For example, if four
computers run the same program and any computer has a hardware error, then other
computers can override it.
Page 1
Computer Communication and Networks
NIC is a device that helps the computer to communicate with another device. The network
interface card contains the hardware addresses, the data-link layer protocol use this address to
identify the system on the network so that it transfers the data to the correct destination.
There are two types of NIC: wireless NIC and wired NIC.
o Wireless NIC: All the modern laptops use the wireless NIC. In Wireless NIC, a
connection is made using the antenna that employs the radio wave technology.
o Wired NIC: Cables use the wired NIC to transfer the data over the medium.
Hub
Hub is a central device that splits the network connection into multiple devices. When
computer requests for information from a computer, it sends the request to the Hub. Hub
distributes this request to all the interconnected computers.
Switches
Switch is a networking device that groups all the devices over the network to transfer the data
to another device. A switch is better than Hub as it does not broadcast the message over the
Page 2
Computer Communication and Networks
network, i.e., it sends the message to the device for which it belongs to. Therefore, we can
say that switch sends the message directly from source to the destination.
Cable is a transmission media that transmits the communication signals. There are three
types of cables:
o Twisted pair cable: It is a high-speed cable that transmits the data over 1Gbps or
more.
o Coaxial cable: Coaxial cable resembles like a TV installation cable. Coaxial cable is
more expensive than twisted pair cable, but it provides the high data transmission
speed.
o Fibre optic cable: Fibre optic cable is a high-speed cable that transmits the data using
light beams. It provides high data transmission speed as compared to other cables. It is
more expensive as compared to other cables, so it is installed at the government level.
Router
Router is a device that connects the LAN to the internet. The router is mainly used to connect
the distinct networks or connect the internet to multiple computers.
Modem
Modem connects the computer to the internet over the existing telephone line. A modem is
not integrated with the computer motherboard. A modem is a separate part on the PC slot
found on the motherboard.
Page 3
Computer Communication and Networks
Network Structures:
Network structure is a term used to describe the method of how data on a network is
organized and viewed.
A computer network is a structure that makes available to a data processing user at one place
some data processing function or service performed at another place. Such a computer
network is exemplified superficially in Fig. 1. In this case one of the end users is a person
sitting at a terminal. The other end user is a specific application program running on a
computer. The network consists of a number of boxes or nodes, among them the terminal (A)
and the computer (B), and includes also the intervening transmission lines connecting the
nodes
Page 4
Computer Communication and Networks
Network Architectures:
Computer Network Architecture is defined as the physical and logical design of the software,
hardware, protocols, and media of the transmission of data. Simply we can say that how
computers are organized and how tasks are allocated to the computer.
o Peer-To-Peer network
o Client/Server network
Peer-To-Peer network
o Peer-To-Peer network is a network in which all the computers are linked together
with equal privilege and responsibilities for processing the data.
Page 5
Computer Communication and Networks
o In the case of Peer-To-Peer network, it does not contain the centralized system .
Therefore, it cannot back up the data as the data is different in different locations.
Client/Server Network
o Client/Server network is a network model designed for the end users called clients, to
access the resources such as songs, video, etc. from a central computer known as
Server.
o The central controller is known as a server while all other computers in the network
are called clients.
o A server performs all the major operations such as security and network management.
o A server is responsible for managing all the resources such as files, directories,
printer, etc.
o All the clients communicate with each other through a server. For example, if client1
wants to send some data to client 2, then it first sends the request to the server for the
Page 6
Computer Communication and Networks
permission. The server sends the response to the client 1 to initiate its communication
with the client 2.
o A Client/Server network has a dedicated server that improves the overall performance
of the whole system.
o Security is better in Client/Server network as a single server administers the shared
resources.
o It also increases the speed of the sharing resources.
Topologies:
Page 7
Computer Communication and Networks
A Network Topology is the arrangement with which computer systems or network devices
are connected to each other.
Topology defines the structure of the network of how all the components are interconnected
to each other. There are two types of topology: physical and logical topology.
Bus Topology:
Bus topology is a network type in which every computer and network device is connected
to a single cable. It transmits the data from one end to another in a single direction. No bi-
directional feature is in bus topology. It is a multi-point connection and a non-robust
topology because if the backbone fails the topology crashes.
Page 8
Computer Communication and Networks
o The bus topology is designed in such a way that all the stations are connected through
a single cable known as a backbone cable.
o Each node is either connected to the backbone cable by drop cable or directly
connected to the backbone cable.
o When a node wants to send a message over the network, it puts a message over the
network. All the stations available in the network will receive the message whether it
has been addressed or not.
o The bus topology is mainly used in 802.3 (ethernet) and 802.4 standard networks.
o The configuration of a bus topology is quite simpler as compared to other topologies.
o The backbone cable is considered as a "single lane" through which the message is
broadcast to all the stations.
Page 9
Computer Communication and Networks
Ring Topology:
Page 10
Computer Communication and Networks
Less secure.
Tree topology:
o Tree topology combines the characteristics of bus topology and star topology.
o A tree topology is a type of structure in which all the computers are connected with
each other in hierarchical fashion.
o The top-most node in tree topology is known as a root node, and all other nodes are
the descendants of the root node.
o There is only one path exists between two nodes for the data transmission. Thus, it
forms a parent-child hierarchy.
Star topology:
Page 11
Computer Communication and Networks
Mesh Topology:
Page 12
Computer Communication and Networks
Page 13
Computer Communication and Networks
Hybrid topology:
Page 14
Computer Communication and Networks
The infrastructure cost is very high as hybrid network requires a lot of cabling,
network devices.
A computer network is a group of computers linked to each other that enables the computer
to communicate with another computer and share their resources, data, and applications.
A computer network can be categorized by their size. A computer network is mainly of four
types:
Page 15
Computer Communication and Networks
Page 16
Computer Communication and Networks
Wireless Personal Area Network: Wireless Personal Area Network is developed by simply
using wireless technologies such as WiFi, Bluetooth. It is a low range network.
Wired Personal Area Network: Wired Personal Area Network is created by using the USB.
o Body Area Network: Body Area Network is a network that moves with a
person. For example, a mobile network moves with a person. Suppose a person
establishes a network connection and then creates a connection with another device to
share the information.
o Offline Network: An offline network can be created inside the home, so it is also
known as a home network. A home network is designed to integrate the devices such
as printers, computer, television but they are not connected to the internet.
o Small Home Office: It is used to connect a variety of devices to the internet and to a
corporate network using a VPN
o Government agencies use MAN to connect to the citizens and private industries.
Page 17
Computer Communication and Networks
o In MAN, various LANs are connected to each other through a telephone exchange
line.
o The most widely used protocols in MAN are RS-232, Frame Relay, ATM, ISDN, OC-
3, ADSL, etc.
o It has a higher range than Local Area Network(LAN).
Page 18
Computer Communication and Networks
o Private network: A bank provides a private network that connects the 44 offices.
This network is made by using the telephone leased line provided by the telecom
company.
Page 19
Computer Communication and Networks
o Security issue: A WAN network has more security issues as compared to LAN and
MAN network as all the technologies are combined together that creates the security
problem.
o Needs Firewall & antivirus software: The data is transferred on the internet which
can be changed or hacked by the hackers, so the firewall needs to be used. Some
people can inject the virus in our system so antivirus is needed to protect from such a
virus.
o High Setup cost: An installation cost of the WAN network is high as it involves the
purchasing of routers, switches.
Page 20
Computer Communication and Networks
Page 21
Computer Communication and Networks
The lowest layer of the OSI reference model is the physical layer. It is responsible for the
actual physical connection between the devices. The physical layer contains information in
the form of bits. It is responsible for transmitting individual bits from one node to the next.
When receiving data, this layer will get the signal received and convert it into 0s and 1s and
send them to the Data Link layer, which will put the frame back together.
1. Bit synchronization: The physical layer provides the synchronization of the bits by
providing a clock. This clock controls both sender and receiver thus providing
synchronization at bit level.
2. Bit rate control: The Physical layer also defines the transmission rate i.e. the number of
bits sent per second.
3. Physical topologies: Physical layer specifies the way in which the different,
devices/nodes are arranged in a network i.e. bus, star, or mesh topology.
4. Transmission mode: Physical layer also defines the way in which the data flows
between the two connected devices. The various transmission modes possible are
Simplex, half-duplex and full-duplex.
* Hub, Repeater, Modem, Cables are Physical Layer devices.
** Network Layer, Data Link Layer, and Physical Layer are also known as Lower Layers
or Hardware Layers.
Page 22
Computer Communication and Networks
The packet received from the Network layer is further divided into frames depending on the
frame size of NIC(Network Interface Card). DLL also encapsulates Sender and Receiver’s
MAC address in the header.
1. Framing: Framing is a function of the data link layer. It provides a way for a sender to
transmit a set of bits that are meaningful to the receiver. This can be accomplished by
attaching special bit patterns to the beginning and end of the frame.
2. Physical addressing: After creating frames, the Data link layer adds physical addresses
(MAC address) of the sender and/or receiver in the header of each frame.
3. Error control: Data link layer provides the mechanism of error control in which it
detects and retransmits damaged or lost frames.
4. Flow Control: The data rate must be constant on both sides else the data may get
corrupted thus, flow control coordinates the amount of data that can be sent before
receiving acknowledgement.
5. Access control: When a single communication channel is shared by multiple devices,
the MAC sub-layer of the data link layer helps to determine which device has control
over the channel at a given time.
* Packet in Data Link layer is referred to as Frame.
** Data Link layer is handled by the NIC (Network Interface Card) and device drivers of
host machines.
*** Switch & Bridge are Data Link Layer devices.
Page 23
Computer Communication and Networks
transmit the packet, from the number of routes available. The sender & receiver’s IP
addresses are placed in the header by the network layer.
1. Routing: The network layer protocols determine which route is suitable from source to
destination. This function of the network layer is known as routing.
2. Logical Addressing: In order to identify each device on internetwork uniquely, the
network layer defines an addressing scheme. The sender & receiver’s IP addresses are
placed in the header by the network layer. Such an address distinguishes each device
uniquely and universally.
* Segment in Network layer is referred to as Packet.
Generally, this destination port number is configured, either by default or manually. For
example, when a web application makes a request to a web server, it typically uses port
Page 24
Computer Communication and Networks
number 80, because this is the default port assigned to web applications. Many applications
have default ports assigned.
At receiver’s side: Transport Layer reads the port number from its header and forwards the
Data which it has received to the respective application. It also performs sequencing and
reassembling of the segmented data.
The functions of the transport layer are as follows:
1. Segmentation and Reassembly: This layer accepts the message from the (session)
layer, and breaks the message into smaller units. Each of the segments produced has a
header associated with it. The transport layer at the destination station reassembles the
message.
2. Service Point Addressing: In order to deliver the message to the correct process, the
transport layer header includes a type of address called service point address or port
address. Thus by specifying this address, the transport layer makes sure that the message
is delivered to the correct process.
The services provided by the transport layer :
In this type of transmission, the receiving device sends an acknowledgement, back to the
source after a packet or group of packets is received. This type of transmission is reliable
and secure.
Page 25
Computer Communication and Networks
1. Session establishment, maintenance, and termination: The layer allows the two
processes to establish, use and terminate a connection.
2. Synchronization: This layer allows a process to add checkpoints which are considered
synchronization points into the data. These synchronization points help to identify the
error so that the data is re-synchronized properly, and ends of the messages are not cut
prematurely and data loss is avoided.
3. Dialog Controller: The session layer allows two systems to start communication with
each other in half-duplex or full-duplex.
**All the below 3 layers(including Session Layer) are integrated as a single layer in the
TCP/IP model as “Application Layer”.
**Implementation of these 3 layers is done by the network application itself. These are also
known as Upper Layers or Software Layers.
Scenario:
Let us consider a scenario where a user wants to send a message through some Messenger
application running in his browser. The “Messenger” here acts as the application layer
which provides the user with an interface to create the data. This message or so-called Data
is compressed, encrypted (if any secure data), and converted into bits (0’s and 1’s) so that it
can be transmitted.
Page 26
Computer Communication and Networks
network.
The functions of the presentation layer are :
Translation: For example, ASCII to EBCDIC.
Encryption/ Decryption: Data encryption translates the data into another form or code.
The encrypted data is known as the ciphertext and the decrypted data is known as plain
text. A key value is used for encrypting as well as decrypting data.
Compression: Reduces the number of bits that need to be transmitted on the network.
7. Application Layer (Layer 7) :
At the very top of the OSI Reference Model stack of layers, we find the Application layer
which is implemented by the network applications. These applications produce the data,
which has to be transferred over the network. This layer also serves as a window for the
application services to access the network and for displaying the received information to
the user.
The OSI Model we just looked at is just a reference/logical model. It was designed to
describe the functions of the communication system by dividing the communication
procedure into smaller and simpler components. But when we talk about the TCP/IP model,
it was designed and developed by Department of Defense (DoD) in 1960s and is based on
standard protocols. It stands for Transmission Control Protocol/Internet Protocol.
Page 27
Computer Communication and Networks
The TCP/IP model is a concise version of the OSI model. It contains four layers, unlike
seven layers in the OSI model. The layers are:
1. Process/Application Layer
2. Host-to-Host/Transport Layer
3. Internet Layer
4. Network Access/Link Layer
The diagrammatic comparison of the TCP/IP and OSI model is as follows :
TCP/IP OSI
Page 28
Computer Communication and Networks
The first layer is the Process layer on the behalf of the sender and Network Access layer on
the behalf of the receiver. During this article, we will be talking on the behalf of the
receiver.
This layer corresponds to the combination of Data Link Layer and Physical Layer of the
OSI model. It looks out for hardware addressing and the protocols present in this layer
allows for the physical transmission of data.
We just talked about ARP being a protocol of Internet layer, but there is a conflict about
declaring it as a protocol of Internet Layer or Network access layer. It is described as
residing in layer 3, being encapsulated by layer 2 protocols.
2. Internet Layer –
Page 29
Computer Communication and Networks
This layer parallels the functions of OSI’s Network layer. It defines the protocols which are
responsible for logical transmission of data over the entire network. The main protocols
residing at this layer are :
1. IP – stands for Internet Protocol and it is responsible for delivering packets from the
source host to the destination host by looking at the IP addresses in the packet headers.
IP has 2 versions:
IPv4 and IPv6. IPv4 is the one that most of the websites are using currently. But IPv6 is
growing as the number of IPv4 addresses are limited in number when compared to the
number of users.
2. ICMP – stands for Internet Control Message Protocol. It is encapsulated within IP
datagrams and is responsible for providing hosts with information about network
problems.
3. ARP – stands for Address Resolution Protocol. Its job is to find the hardware address of
a host from a known IP address. ARP has several types: Reverse ARP, Proxy ARP,
Gratuitous ARP and Inverse ARP.
3. Host-to-Host Layer –
This layer is analogous to the transport layer of the OSI model. It is responsible for end-to-
end communication and error-free delivery of data. It shields the upper-layer applications
from the complexities of data. The two main protocols present in this layer are :
4. Application Layer –
Page 30
Computer Communication and Networks
This layer performs the functions of top three layers of the OSI model: Application,
Presentation and Session Layer. It is responsible for node-to-node communication and
controls user-interface specifications. Some of the protocols present in this layer are:
HTTP, HTTPS, FTP, TFTP, Telnet, SSH, SMTP, SNMP, NTP, DNS, DHCP, NFS, X
Window, LPD. Have a look at Protocols in Application Layer for some information about
these protocols. Protocols other than those present in the linked article are :
1. HTTP and HTTPS – HTTP stands for Hypertext transfer protocol. It is used by the
World Wide Web to manage communications between web browsers and servers.
HTTPS stands for HTTP-Secure. It is a combination of HTTP with SSL(Secure Socket
Layer). It is efficient in cases where the browser need to fill out forms, sign in,
authenticate and carry out bank transactions.
2. SSH – SSH stands for Secure Shell. It is a terminal emulations software similar to
Telnet. The reason SSH is more preferred is because of its ability to maintain the
encrypted connection. It sets up a secure session over a TCP/IP connection.
3. NTP – NTP stands for Network Time Protocol. It is used to synchronize the clocks on
our computer to one standard time source. It is very useful in situations like bank
transactions. Assume the following situation without the presence of NTP. Suppose you
carry out a transaction, where your computer reads the time at 2:30 PM while the server
records it at 2:28 PM. The server can crash very badly if it’s out of sync.
Page 31
Computer Communication and Networks
2.PHYSICAL LAYER
Transmission media:
o Transmission media is a communication channel that carries the information from the
sender to the receiver. Data is transmitted through the electromagnetic signals.
o The main functionality of the transmission media is to carry the information in the
form of bits through LAN(Local Area Network).
o It is a physical path between transmitter and receiver in data communication.
o In a copper-based network, the bits in the form of electrical signals.
o In a fibre based network, the bits in the form of light pulses.
o In OSI(Open System Interconnection) phase, transmission media supports the Layer
1. Therefore, it is considered to be as a Layer 1 component.
o The electrical signals can be sent through the copper wire, fibre optics, atmosphere,
water, and vacuum.
o The characteristics and quality of data transmission are determined by the
characteristics of medium and signal.
o Transmission media is of two types are wired media and wireless media. In wired
media, medium characteristics are more important whereas, in wireless media, signal
characteristics are more important.
o Different transmission media have different properties such as bandwidth, delay, cost
and ease of installation and maintenance.
o The transmission media is available in the lowest layer of the OSI reference model,
i.e., Physical layer.
o Bandwidth: All the factors are remaining constant, the greater the bandwidth of a
medium, the higher the data transmission rate of a signal.
o Transmission impairment: When the received signal is not identical to the
transmitted one due to the transmission impairment. The quality of the signals will get
destroyed due to transmission impairment.
o Interference: An interference is defined as the process of disrupting a signal when it
travels over a communication medium on the addition of some unwanted signal.
Page 32
Computer Communication and Networks
Guided Media
It is defined as the physical medium through which the signals are transmitted. It is also
known as Bounded media.
Twisted pair:
Twisted pair is a physical media made up of a pair of cables twisted with each other. A
twisted pair cable is cheap as compared to other transmission media. Installation of the
twisted pair cable is easy, and it is a lightweight cable. The frequency range for twisted pair
cable is from 0 to 3.5KHz.
A twisted pair consists of two insulated copper wires arranged in a regular spiral pattern.
Page 33
Computer Communication and Networks
The degree of reduction in noise interference is determined by the number of turns per foot.
Increasing the number of turns per foot decreases noise interference.
An unshielded twisted pair is widely used in telecommunication. Following are the categories
of the unshielded twisted pair cable:
o Category 1: Category 1 is used for telephone lines that have low-speed data.
o Category 2: It can support upto 4Mbps.
o Category 3: It can support upto 16Mbps.
o Category 4: It can support upto 20Mbps. Therefore, it can be used for long-distance
communication.
o It is cheap.
o Installation of the unshielded twisted pair is easy.
o It can be used for high-speed LAN.
Page 34
Computer Communication and Networks
Disadvantage:
o This cable can only be used for shorter distances because of attenuation.
A shielded twisted pair is a cable that contains the mesh surrounding the wire that allows the
higher transmission rate.
o The cost of the shielded twisted pair cable is not very high and not very low.
o An installation of STP is easy.
o It has higher capacity as compared to unshielded twisted pair cable.
o It has a higher attenuation.
o It is shielded that provides the higher data transmission rate.
Disadvantages
Coaxial Cable
o Coaxial cable is very commonly used transmission media, for example, TV wire is
usually a coaxial cable.
o The name of the cable is coaxial as it contains two conductors parallel to each other.
o It has a higher frequency as compared to Twisted pair cable.
o The inner conductor of the coaxial cable is made up of copper, and the outer
conductor is made up of copper mesh. The middle core is made up of non-conductive
cover that separates the inner conductor from the outer conductor.
o The middle core is responsible for the data transferring whereas the copper mesh
prevents from the EMI(Electromagnetic interference).
Page 35
Computer Communication and Networks
Fibre Optic
o Fibre optic cable is a cable that uses electrical signals for communication.
o Fibre optic is a cable that holds the optical fibres coated in plastic that are used to
send the data by pulses of light.
o The plastic coating protects the optical fibres from heat, cold, electromagnetic
interference from other types of wiring.
o Fibre optics provide faster data transmission than copper wires.
Page 36
Computer Communication and Networks
o Core: The optical fibre consists of a narrow strand of glass or plastic known as a core.
A core is a light transmission area of the fibre. The more the area of the core, the more
light will be transmitted into the fibre.
o Cladding: The concentric layer of glass is known as cladding. The main functionality
of the cladding is to provide the lower refractive index at the core interface as to cause
the reflection within the core so that the light waves are transmitted through the fibre.
o Jacket: The protective coating consisting of plastic is known as a jacket. The main
purpose of a jacket is to preserve the fibre strength, absorb shock and extra fibre
protection.
o Greater Bandwidth: The fibre optic cable provides more bandwidth as compared
copper. Therefore, the fibre optic carries more data as compared to copper cable.
o Faster speed: Fibre optic cable carries the data in the form of light. This allows the
fibre optic cable to carry the signals at a higher speed.
o Longer distances: The fibre optic cable carries the data at a longer distance as
compared to copper cable.
o Better reliability: The fibre optic cable is more reliable than the copper cable as it is
immune to any temperature changes while it can cause obstruct in the connectivity of
copper cable.
o Thinner and Sturdier: Fibre optic cable is thinner and lighter in weight so it can
withstand more pull pressure than copper cable.
Page 37
Computer Communication and Networks
UnGuided Transmission
o An unguided transmission transmits the electromagnetic waves without using any
physical medium. Therefore it is also known as wireless transmission.
o In unguided media, air is the media through which the electromagnetic energy can
flow easily.
Radio waves
o Radio waves are the electromagnetic waves that are transmitted in all the directions of
free space.
o Radio waves are omnidirectional, i.e., the signals are propagated in all the directions.
o The range in frequencies of radio waves is from 3Khz to 1 khz.
o In the case of radio waves, the sending and receiving antenna are not aligned, i.e., the
wave sent by the sending antenna can be received by any receiving antenna.
o A Radio wave is useful for multicasting when there is one sender and many receivers.
o An FM radio, television, cordless phones are examples of a radio wave.
Page 38
Computer Communication and Networks
o Radio transmission is mainly used for wide area networks and mobile cellular phones.
o Radio waves cover a large area, and they can penetrate the walls.
o Radio transmission provides a higher transmission rate.
Microwaves
o Terrestrial microwave
o Satellite microwave communication.
o In this case, antennas are mounted on the towers to send a beam to another antenna
which is km away.
o It works on the line of sight transmission, i.e., the antennas mounted on the towers are
the direct sight of each other.
Characteristics of Microwave:
Page 39
Computer Communication and Networks
o Frequency range: The frequency range of terrestrial microwave is from 4-6 GHz to
21-23 GHz.
o Bandwidth: It supports the bandwidth from 1 to 10 Mbps.
o Short distance: It is inexpensive for short distance.
o Long distance: It is expensive as it requires a higher tower for a longer distance.
o Attenuation: Attenuation means loss of signal. It is affected by environmental
conditions and antenna size.
Advantages Of Microwave:
o A satellite is a physical object that revolves around the earth at a known height.
o Satellite communication is more reliable nowadays as it offers more flexibility than
cable and fibre optic systems.
Page 40
Computer Communication and Networks
o We can communicate with any point on the globe by using satellite communication.
The satellite accepts the signal that is transmitted from the earth station, and it amplifies the
signal. The amplified signal is retransmitted to another earth station.
o The coverage area of a satellite microwave is more than the terrestrial microwave.
o The transmission cost of the satellite is independent of the distance from the centre of
the coverage area.
o Satellite designing and development requires more time and higher cost.
o The Satellite needs to be monitored and controlled on regular periods so that it
remains in orbit.
o The life of the satellite is about 12-15 years. Due to this reason, another launch of the
satellite has to be planned before it becomes non-functional.
Infrared
o An infrared transmission is a wireless technology used for communication over short
ranges.
o The frequency of the infrared in the range from 300 GHz to 400 THz.
o It is used for short-range communication such as data transfer between two cell
phones, TV remote operation, data transfer between a computer and cell phone resides
in the same closed area.
Page 41
Computer Communication and Networks
Characteristics Of Infrared:
o It supports high bandwidth, and hence the data rate will be very high.
o Infrared waves cannot penetrate the walls. Therefore, the infrared communication in
one room cannot be interrupted by the nearby rooms.
o An infrared communication provides better security with minimum interference.
o Infrared communication is unreliable outside the building because the sun rays will
interfere with the infrared waves.
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.
Page 42
Computer Communication and Networks
History of Multiplexing
o Multiplexing technique is widely used in telecommunications in which several
telephone calls are carried through a single wire.
o Multiplexing originated in telegraphy in the early 1870s and is now widely used in
communication.
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:
o More than one signal can be sent over a single medium.
o The bandwidth of a medium can be utilized effectively.
Multiplexing Techniques
Page 43
Computer Communication and Networks
Page 44
Computer Communication and Networks
Advantages Of FDM:
Disadvantages Of FDM:
Applications Of FDM:
Page 45
Computer Communication and Networks
o Wavelength Division Multiplexing is same as FDM except that the optical signals are
transmitted through the fibre optic cable.
o WDM is used on fibre optics to increase the capacity of a single fibre.
o It is used to utilize the high data rate capability of fibre optic cable.
o It is an analog multiplexing technique.
o Optical signals from different source are combined to form a wider band of light with
the help of multiplexer.
o At the receiving end, demultiplexer separates the signals to transmit them to their
respective destinations.
o Multiplexing and Demultiplexing can be achieved by using a prism.
o Prism can perform a role of multiplexer by combining the various optical signals to
form a composite signal, and the composite signal is transmitted through a fibre
optical cable.
Page 46
Computer Communication and Networks
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 preassigned to every device.
o In Synchronous TDM, each device is given some time slot irrespective of the fact that
the device contains the data or not.
o If the device does not have any data, then the slot will remain empty.
o In Synchronous TDM, signals are sent in the form of frames. Time slots are organized
in the form of frames. If a device does not have data for a particular time slot, then the
empty slot will be transmitted.
o The most popular Synchronous TDM are T-1 multiplexing, ISDN multiplexing, and
SONET multiplexing.
o If there are n devices, then there are n slots.
Page 47
Computer Communication and Networks
In the above figure, the Synchronous TDM technique is implemented. Each device is
allocated with some time slot. The time slots are transmitted irrespective of whether the
sender has data to send or not.
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.
Page 48
Computer Communication and Networks
Asynchronous TDM
o An asynchronous TDM is also known as Statistical TDM.
o An asynchronous TDM is a technique in which time slots are not fixed as in the case
of Synchronous TDM. Time slots are allocated to only those devices which have the
data to send. Therefore, we can say that Asynchronous Time Division multiplexor
transmits only the data from active workstations.
o An asynchronous TDM technique dynamically allocates the time slots to the devices.
o In Asynchronous TDM, total speed of the input lines can be greater than the capacity
of the channel.
o Asynchronous Time Division multiplexor accepts the incoming data streams and
creates a frame that contains only data with no empty slots.
o In Asynchronous TDM, each slot contains an address part that identifies the source of
the data.
o The difference between Asynchronous TDM and Synchronous TDM is that many
slots in Synchronous TDM are unutilized, but in Asynchronous TDM, slots are fully
utilized. This leads to the smaller transmission time and efficient utilization of the
capacity of the channel.
o In Synchronous TDM, if there are n sending devices, then there are n time slots. In
Asynchronous TDM, if there are n sending devices, then there are m time slots where
m is less than n (m<n).
o The number of slots in a frame depends on the statistical analysis of the number of
input lines.
Page 49
Computer Communication and Networks
In the above diagram, there are 4 devices, but only two devices are sending the data, i.e., A
and C. Therefore, the data of A and C are only transmitted through the transmission line.
The above figure shows that the data part contains the address to determine the source of the
data.
Switching:
Switching is process to forward packets coming in from one port to a port leading towards the
destination. When data comes on a port it is called ingress, and when data leaves a port or
goes out it is called egress. A communication system may include number of switches and
nodes. At broad level, switching can be divided into two major categories:
Page 50
Computer Communication and Networks
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.
Circuit Switching
o Circuit switching is a switching technique that establishes a dedicated path between
sender and receiver.
o In the Circuit Switching Technique, once the connection is established then the
dedicated path will remain to exist until the connection is terminated.
o Circuit switching in a network operates in a similar way as the telephone works.
o A complete end-to-end path must exist before the communication takes place.
o In case of circuit switching technique, when any user wants to send the data, voice,
video, a request signal is sent to the receiver then the receiver sends back the
acknowledgment to ensure the availability of the dedicated path. After receiving the
acknowledgment, dedicated path transfers the data.
o Circuit switching is used in public telephone network. It is used for voice
transmission.
o Fixed data can be transferred at a time in circuit switching technology.
Page 51
Computer Communication and Networks
o Circuit establishment
o Data transfer
o Circuit Disconnect
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.
Page 52
Computer Communication and Networks
Message Switching
o Message Switching is a switching technique in which a message is transferred as a
complete unit and routed through intermediate nodes at which it is stored and
forwarded.
o In Message Switching technique, there is no establishment of a dedicated path
between the sender and receiver.
o The destination address is appended to the message. Message Switching provides a
dynamic routing as the message is routed through the intermediate nodes based on the
information available in the message.
o Message switches are programmed in such a way so that they can provide the most
efficient routes.
o Each and every node stores the entire message and then forward it to the next node.
This type of network is known as store and forward network.
o Data channels are shared among the communicating devices that improve the
efficiency of using available bandwidth.
o Traffic congestion can be reduced because the message is temporarily stored in the
nodes.
o Message priority can be used to manage the network.
o The size of the message which is sent over the network can be varied. Therefore, it
supports the data of unlimited size.
Page 53
Computer Communication and Networks
o The message switches must be equipped with sufficient storage to enable them to
store the messages until the message is forwarded.
o The Long delay can occur due to the storing and forwarding facility provided by the
message switching technique.
Packet Switching
o The packet switching is a switching technique in which the message is sent in one go,
but it is divided into smaller pieces, and they are sent individually.
o The message splits into smaller pieces known as packets and packets are given a
unique number to identify their order at the receiving end.
o Every packet contains some information in its headers such as source address,
destination address and sequence number.
o Packets will travel across the network, taking the shortest path as possible.
o All the packets are reassembled at the receiving end in correct order.
o If any packet is missing or corrupted, then the message will be sent to resend the
message.
o If the correct order of the packets is reached, then the acknowledgment message will
be sent.
Page 54
Computer Communication and Networks
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.
Page 55
Computer Communication and Networks
o In the above diagram, A and B are the sender and receiver respectively. 1 and 2 are
the nodes.
o Call request and call accept packets are used to establish a connection between the
sender and receiver.
o When a route is established, data will be transferred.
o After transmission of data, an acknowledgment signal is sent by the receiver that the
message has been received.
o If the user wants to terminate the connection, a clear signal is sent for the termination.
Node takes routing decisions to forward Node does not take any routing decision.
the packets.
Congestion cannot occur as all the packets Congestion can occur when the node is busy, and it
travel in different directions. does not allow other packets to pass through.
o Reliable: If any node is busy, then the packets can be rerouted. This ensures that the
Packet Switching technique provides reliable communication.
o Efficient: Packet Switching is an efficient technique. It does not require any
established path prior to the transmission, and many users can use the same
communication channel simultaneously, hence makes use of available bandwidth very
efficiently.
The data link layer is the hardware layer, and information at this layer is in the
form of frames. The datalink layer is mainly used to define the format of the
data. The position of the data link layer is second in the internet model and stays
between the network and physical layer as you can see in the following diagram.
It takes services from the physical layer and provides services to the network
layer. The primary function of this layer is data synchronization. The data link
layer is further divided into two sub- layers as follows.
The data link layer is supposed to carry out many specified functions. It is
responsible for effective data communication between two directly connected
transmitting and receiving stations.
The data link layer has to carry out several specific functions and the following
are the main design issues of data link layer:
Data transfer
Frame synchronization
Flow control
Error control
Addressing
Link management.
The data link layer provides a well-defined service interface to the network
layer. The principle of services is to transfer data from the network layer on the
source machine to the network layer on the destination machine.
The transfer is done through DDL(Dynamic - link layer). The data link layer takes
services from the physical layer and provides well-defined services to the
network layer.
Frame Synchronization
Frame synchronization is one form the design issues of data link layer. The
source machine sends data in a block called frame to the destination machine.
The starting and ending of each frame must be recognized by the destination
machine.
For frame recognization, every frame comprises three parts, such as frame
header, payload field (contains data packet from the network layer) and trailer.
Flow Control
The source machine should not send a data frame at a fast data rate as compared
to the destination machine receiving data rate. When the sender sends the data at
a high speed, the slow receiver cannot able to handle it and the frame can lose in
such cases.
There are two types of techniques that are used for flow control as follows.
Error Control
The errors made in bits during transmission from source to destination machines
must be detected and corrected. The data link layer ensures error -free data
transmission. For this, two types of error control techniques are used in the data
link layer are as follows.
Addressing
Addressing is also one of the design issues of data link layer. On a multipoint
line, the identity of the individual machines must be specified while transmitting
the data frames. Each frame comprises a header in which the source and
destination addresses are placed.
Link Management
The initiation, maintenance and termination of the link between the source and
destination is required for the effective exchange of data. The data link layer of
the OSI Model handles proper link management of connected devices.
Error Detection
When data is transmitted from one device to another device, the system does not guarantee
whether the data received by the device is identical to the data transmitted by another device.
An Error is a situation when the message received at the receiver end is not identical to the
message transmitted.
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 In this technique, a redundant bit is also known as a parity bit which is appended at
the end of the data unit so that the number of 1s becomes even. Therefore, the total
number of transmitted bits would be 9 bits.
o If the number of 1s bits is odd, then parity bit 1 is appended and if the number of 1s
bits is even, then parity bit 0 is appended at the end of the data unit.
o At the receiving end, the parity bit is calculated from the received data bits and
compared with the received parity bit.
o This technique generates the total number of 1s even, so it is known as even-parity
checking.
Checksum
Checksum Generator
A Checksum is generated at the sending side. Checksum generator subdivides the data into
equal segments of n bits each, and all these segments are added together by using one's
complement arithmetic. The sum is complemented and appended to the original data, known
as checksum field. The extended data is transmitted across the network.
Suppose L is the total sum of the data segments, then the checksum would be ?L
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.
Polynomial codes:
A polynomial code is a linear code having a set of valid code words that comprises of
polynomials divisible by a shorter fixed polynomial is known as generator polynomial.
They are used for error detection and correction during the transmission of data as well as
storage of data.
At the destination, the incoming data unit is divided by the same number. If at this step
there is no remainder, the data unit is assumed to be correct and is therefore accepted.
A remainder indicates that the data unit has been damaged in transit and therefore must
be rejected.
Example :
Error Correction
Error Correction codes are used to detect and correct the errors when data is transmitted from
the sender to the receiver.
o Backward error correction: Once the error is discovered, the receiver requests the
sender to retransmit the entire data unit.
o Forward error correction: In this case, the receiver uses the error-correcting code
which automatically corrects the errors.
A single additional bit can detect the error, but cannot correct it.
For correcting the errors, one has to know the exact position of the error. For example, If we
want to calculate a single-bit error, the error correction code will determine which one of
seven bits is in error. To achieve this, we have to add some additional redundant bits.
Suppose r is the number of redundant bits and d is the total number of the data bits. The
number of redundant bits r can be calculated by using the formula:
2r>=d+r+1
The value of r is calculated by using the above formula. For example, if the value of d is 4,
then the possible smallest value that satisfies the above relation would be 3.
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.
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.
2r>= 4+r+1
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
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
We observe from the above figure that the binary representation of r1 is 1100. Now, we
perform the even-parity check, the total number of 1s appearing in the r1 bit is an even
number. Therefore, the value of r1 is 0.
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 The binary representation of redundant bits, i.e., r4r2r1 is 100, and its corresponding
decimal value is 4. Therefore, the error occurs in a 4th bit position. The bit value must
be changed from 1 to 0 to correct the error.
Elementary Data Link protocols are classified into three categories, as given below −
The main problem here is how to prevent the sender from flooding the receiver. The general
solution for this problem is to have the receiver send some sort of feedback to sender, the
process is as follows −
Step1 − The receiver send the acknowledgement frame back to the sender telling the sender
that the last received frame has been processed and passed to the host.
Step 3 − The sender after sending the sent frame has to wait for an acknowledge frame from
the receiver before sending another frame.
This protocol is called Simplex Stop and wait protocol, the sender sends one frame and waits
for feedback from the receiver. When the ACK arrives, the sender sends the next frame.
After a frame has been transmitted, the timer is started for a finite time. Before the timer
expires, if the acknowledgement is not received , the frame gets retransmitted, when the
acknowledgement gets corrupted or sent data frames gets damaged, how long the sender
should wait to transmit the next frame is infinite.
Sliding window protocols are data link layer protocols for reliable and sequential delivery of
data frames. The sliding window is also used in Transmission Control Protocol.
In this protocol, multiple frames can be sent by a sender at a time before receiving an
acknowledgment from the receiver. The term sliding window refers to the imaginary boxes
to hold frames. Sliding window method is also known as windowing.
Working Principle
In these protocols, the sender has a buffer called the sending window and the receiver has
buffer called the receiving window.
The size of the sending window determines the sequence number of the outbound frames. If
the sequence number of the frames is an n-bit field, then the range of sequence numbers that
can be assigned is 0 to 2 −1. Consequently, the size of the sending window is 2 −1. Thus in
order to accommodate a sending window size of 2 −1, a n-bit sequence number is chosen.
The sequence numbers are numbered as modulo-n. For example, if the sending window size
is 4, then the sequence numbers will be 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, and so on. The number of
bits in the sequence number is 2 to generate the binary sequence 00, 01, 10, 11.
The size of the receiving window is the maximum number of frames that the receiver can
accept at a time. It determines the maximum number of frames that the sender can send
before receiving acknowledgment.
Example
Suppose that we have sender window and receiver window each of size 4. So the sequence
numbering of both the windows will be 0,1,2,3,0,1,2 and so on. The following diagram
shows the positions of the windows after sending the frames and receiving
acknowledgments.
Go – Back – N ARQ
Go – Back – N ARQ provides for sending multiple frames before receiving the
acknowledgment for the first frame. It uses the concept of sliding window, and so is
also called sliding window protocol. The frames are sequentially numbered and a finite
number of frames are sent. If the acknowledgment of a frame is not received within the
time period, all frames starting from that frame are retransmitted.
NETWORK LAYER
o It handles the service requests from the transport layer and further forwards the
service request to the data link layer.
o The network layer translates the logical addresses into physical addresses
o It determines the route from the source to the destination and also manages the traffic
problems such as switching, routing and controls the congestion of data packets.
o The main role of the network layer is to move the packets from sending host to the
receiving host.
o Routing: When a packet reaches the router's input link, the router will move the
packets to the router's output link. For example, a packet from S1 to R1 must be
forwarded to the next router on the path to S2.
o Logical Addressing: The data link layer implements the physical addressing and
network layer implements the logical addressing. Logical addressing is also used to
distinguish between source and destination system. The network layer adds a header
to the packet which includes the logical addresses of both the sender and the receiver.
o Internetworking: This is the main role of the network layer that it provides the
logical connection between different types of networks.
In Network layer, a router is used to forward the packets. Every router has a forwarding table.
A router forwards a packet by examining a packet's header field and then using the header
field value to index into the forwarding table. The value stored in the forwarding table
corresponding to the header field value indicates the router's outgoing interface link to which
the packet is to be forwarded.
For example, the router with a header field value of 0111 arrives at a router, and then router
indexes this header value into the forwarding table that determines the output link interface is
2. The router forwards the packet to the interface 2. The routing algorithm determines the
values that are inserted in the forwarding table. The routing algorithm can be centralized or
decentralized.
o Guaranteed delivery: This layer provides the service which guarantees that the
packet will arrive at its destination.
o Guaranteed delivery with bounded delay: This service guarantees that the packet
will be delivered within a specified host-to-host delay bound.
o In-Order packets: This service ensures that the packet arrives at the destination in
the order in which they are sent.
o Guaranteed max jitter: This service ensures that the amount of time taken between
two successive transmissions at the sender is equal to the time between their receipt at
the destination.
o Security services: The network layer provides security by using a session key
between the source and destination host. The network layer in the source host
encrypts the payloads of datagrams being sent to the destination host. The network
layer in the destination host would then decrypt the payload. In such a way, the
network layer maintains the data integrity and source authentication services.
Network layer is majorly focused on getting packets from the source to the destination,
routing error handling and congestion control.
Before learning about design issues in the network layer, let’s learn about it’s various
functions.
Addressing:
Maintains the address at the frame header of both source and destination and performs
addressing to detect various devices in network.
Packeting:
This is performed by Internet Protocol. The network layer converts the packets from its
upper layer.
Routing:
It is the most important functionality. The network layer chooses the most relevant and
best path for the data transmission from source to destination.
Inter-networking:
It works to deliver a logical connection across multiple devices.
Network layer design issues:
The network layer comes with some design issues they are described as follows:
1. Store and Forward packet switching:
The host sends the packet to the nearest router. This packet is stored there until it has fully
arrived once the link is fully processed by verifying the checksum then it is forwarded to
the next router till it reaches the destination. This mechanism is called “Store and Forward
packet switching.”
2. Services provided to Transport Layer:
Through the network/transport layer interface, the network layer transfers it’s services to
the transport layer. These services are described below.
But before providing these services to the transfer layer following goals must be kept in
mind :-
Offering services must not depend on router technology.
The transport layer needs to be protected from the type, number and topology of the
available router.
The network addresses for the transport layer should use uniform numbering pattern
also at LAN and WAN connections.
Based on the connections there are 2 types of services provided :
Connectionless – The routing and insertion of packets into subnet is done individually.
No added setup is required.
Connection-Oriented – Subnet must offer reliable service and all the packets must be
transmitted over a single route.
3. Implementation of Connectionless Service:
Packet are termed as “datagrams” and corresponding subnet as “datagram subnets”. When
the message size that has to be transmitted is 4 times the size of the packet, then the
network layer divides into 4 packets and transmits each packet to router via. a few
protocol.Each data packet has destination address and is routed independently irrespective
of the packets.
4. Implementation of Connection Oriented service:
To use a connection-oriented service, first we establishes a connection, use it and then
release it. In connection-oriented services, the data packets are delivered to the receiver in
the same order in which they have been sent by the sender.
It can be done in either two ways :
from the sender to the receiver. A virtual path is established here. While, other
connections may also be using the same path.
Routing algorithm
o In order to transfer the packets from source to the destination, the network layer must
determine the best route through which packets can be transmitted.
o Whether the network layer provides datagram service or virtual circuit service, the
main job of the network layer is to provide the best route. The routing protocol
provides this job.
o The routing protocol is a routing algorithm that provides the best path from the source
to the destination. The best path is the path that has the "least-cost path" from source
to the destination.
o Routing is the process of forwarding the packets from source to the destination but the
best route to send the packets is determined by the routing algorithm.
o This algorithm makes the routing decisions based on the topology and network traffic.
o The main parameters related to this algorithm are hop count, distance and estimated
transit time.
Flooding: In case of flooding, every incoming packet is sent to all the outgoing links except
the one from it has been reached. The disadvantage of flooding is that node may contain
several copies of a particular packet.
Shortest path: In this algorithm, to select a route, the algorithm discovers the shortest path
between two nodes. It can use multiple hops, the geographical area in kilometres or labelling
of arcs for measuring path length.
In this algorithm, to select a route, the algorithm discovers the shortest path between two
nodes. It can use multiple hops, the geographical area in kilometres or labelling of arcs for
measuring path length.
The labelling of arcs can be done with mean queuing, transmission delay for a standard test
packet on an hourly basis, or computed as a function of bandwidth, average distance traffic,
communication cost, mean queue length, measured delay or some other factors.
In shortest path routing, the topology communication network is defined using a directed
weighted graph. The nodes in the graph define switching components and the directed arcs in
the graph define communication connection between switching components. Each arc has a
weight that defines the cost of sharing a packet between two nodes in a specific direction.
This cost is usually a positive value that can denote such factors as delay, throughput, error
rate, financial costs, etc. A path between two nodes can go through various intermediary
nodes and arcs. The goal of shortest path routing is to find a path between two nodes that has
the lowest total cost, where the total cost of a path is the sum of arc costs in that path.
For example, Dijikstra uses the nodes labelling with its distance from the source node along
the better-known route. Initially, all nodes are labelled with infinity, and as the algorithm
proceeds, the label may change. The labelling graph is displayed in the figure.
Given a graph and a source vertex in the graph, find the shortest paths from the source to
all vertices in the given graph.
Examples:
Input: src = 0, the graph is shown below.
Output: 0 4 12 19 21 11 9 8 14
Explanation: The distance from 0 to 1 = 4.
The minimum distance from 0 to 2 = 12. 0->1->2
The minimum distance from 0 to 3 = 19. 0->1->2->3
The minimum distance from 0 to 4 = 21. 0->7->6->5->4
The minimum distance from 0 to 5 = 11. 0->7->6->5
The minimum distance from 0 to 6 = 9. 0->7->6
The minimum distance from 0 to 7 = 8. 0->7
The minimum distance from 0 to 8 = 14. 0->1->2->8
Create a set sptSet (shortest path tree set) that keeps track of vertices included in the
shortest-path tree, i.e., whose minimum distance from the source is calculated and
finalized. Initially, this set is empty.
Assign a distance value to all vertices in the input graph. Initialize all distance values
as INFINITE. Assign the distance value as 0 for the source vertex so that it is picked
first.
While sptSet doesn’t include all vertices
Pick a vertex u which is not there in sptSet and has a minimum distance
value.
Include u to sptSet.
Then update distance value of all adjacent vertices of u.
To update the distance values, iterate through all adjacent
vertices.
For every adjacent vertex v, if the sum of the distance value of u
(from source) and weight of edge u-v, is less than the distance
value of v, then update the distance value of v.
Illustration:
To understand the Dijkstra’s Algorithm lets take a graph and find the shortest path from
source to all nodes.
Consider below graph and src = 0
Step 1:
The set sptSet is initially empty and distances assigned to vertices are {0, INF, INF,
INF, INF, INF, INF, INF} where INF indicates infinite.
Now pick the vertex with a minimum distance value. The vertex 0 is picked, include it
in sptSet. So sptSet becomes {0}. After including 0 to sptSet, update distance values of
its adjacent vertices.
Adjacent vertices of 0 are 1 and 7. The distance values of 1 and 7 are updated as 4 and
8.
The following subgraph shows vertices and their distance values, only the vertices with
finite distance values are shown. The vertices included in SPT are shown in green colour.
Step 2:
Pick the vertex with minimum distance value and not already included in SPT (not in
sptSET). The vertex 1 is picked and added to sptSet.
So sptSet now becomes {0, 1}. Update the distance values of adjacent vertices of 1.
The distance value of vertex 2 becomes 12.
Step 3:
Pick the vertex with minimum distance value and not already included in SPT (not in
sptSET). Vertex 7 is picked. So sptSet now becomes {0, 1, 7}.
Update the distance values of adjacent vertices of 7. The distance value of vertex 6 and
8 becomes finite (15 and 9 respectively).
Step 4:
Pick the vertex with minimum distance value and not already included in SPT (not in
sptSET). Vertex 6 is picked. So sptSet now becomes {0, 1, 7, 6}.
Update the distance values of adjacent vertices of 6. The distance value of vertex 5 and
8 are updated.
We repeat the above steps until sptSet includes all vertices of the given graph. Finally, we
get the following Shortest Path Tree (SPT).
Dijkstra’s Algorithm
Initializations −
o Remove from Q, the node, u having the smallest dist[u] and which is not in S.
In the first run, dist[s] is removed.
o Add u to S, marking u as visited.
o For each node v which is adjacent to u, update dist[v] as −
If (dist[u] + weight of edge u-v) < dist[v], Then
Update dist[v] = dist[u] + weight of edge u-v
The array dist[] contains the shortest path from s to every other node.
The following figure shows steps to find shortest using Dijkstra algorithm
Optimality principle:
It states that if router J is on the optimal path from router I to router K, then the
optimal path from J to K also falls along the same route. To see this, call the part
of the route from I to Jr1 and the rest of the route r2. If a route better than r2
existed from J to K, it could be concatenated with r1 to improve the route from I
to K, contradicting our statement that r1r2 isoptimal.
As a direct consequence of the optimality principle, we can see that the set of
optimal routesfrom all sources to a given destination form a tree rooted at the
destination. Such a tree is called a sink tree
Flooding:
Another static algorithm is flooding, in which every incoming packet is sent out
on everyoutgoing line except the one it arrived on.
Characteristics –
All possible routes between Source and Destination are tried. A packet will always get
through if the path exists
As all routes are tried, there will be at least one route which is the shortest
Hop-Count –
A hop counter may be contained in the packet header which is decremented at each hop.
with the packet being discarded when the counter becomes zero
The sender initializes the hop counter. If no estimate is known, it is set to the full
diameter of the subnet.
Keep track of the packets which are responsible for flooding using a sequence number.
Avoid sending them out a second time.
Selective Flooding:
Routers do not send every incoming packet out on every line, only on those lines that go in
approximately in the direction of the destination.
Link state routing is a technique in which each router shares the knowledge of its
neighborhood with every other router in the internetwork.
o Knowledge about the neighborhood: Instead of sending its routing table, a router
sends the information about its neighborhood only. A router broadcast its identities
and cost of the directly attached links to other routers.
o Flooding: Each router sends the information to every other router on the internetwork
except its neighbors. This process is known as Flooding. Every router that receives
the packet sends the copies to all its neighbors. Finally, each and every router receives
a copy of the same information.
o Information sharing: A router sends the information to every other router only when
the change occurs in the information.
Reliable Flooding
Route Calculation
Each node uses Dijkstra's algorithm on the graph to calculate the optimal routes to all nodes.
o The Link state routing algorithm is also known as Dijkstra's algorithm which is used
to find the shortest path from one node to every other node in the network.
o The Dijkstra's algorithm is an iterative, and it has the property that after kth iteration of
the algorithm, the least cost paths are well known for k destination nodes.
o c( i , j): Link cost from node i to node j. If i and j nodes are not directly linked, then
c(i , j) = ∞.
o D(v): It defines the cost of the path from source code to destination v that has the least
cost currently.
o P(v): It defines the previous node (neighbor of v) along with current least cost path
from source to v.
Algorithm
Initialization
N = {A} // A is a root node.
if v adjacent to A
loop
find w not in N such that D(w) is a minimum.
Add w to N
In the above algorithm, an initialization step is followed by the loop. The number of times the
loop is executed is equal to the total number of nodes available in the network.
Step 1:
The first step is an initialization step. The currently known least cost path from A to its
directly attached neighbors, B, C, D are 2,5,1 respectively. The cost from A to B is set to 2,
from A to D is set to 1 and from A to C is set to 5. The cost from A to E and F are set to
infinity as they are not directly linked to A.
Step 2:
In the above table, we observe that vertex D contains the least cost path in step 1. Therefore,
it is added in N. Now, we need to determine a least-cost path through D vertex.
1. v = B, w = D
2. D(B) = min( D(B) , D(D) + c(D,B) )
3. = min( 2, 1+2)>
4. = min( 2, 3)
5. The minimum value is 2. Therefore, the currently shortest path from A to B is 2.
1. v = C, w = D
2. D(B) = min( D(C) , D(D) + c(D,C) )
3. = min( 5, 1+3)
4. = min( 5, 4)
5. The minimum value is 4. Therefore, the currently shortest path from A to C is 4.</p>
1. v = E, w = D
2. D(B) = min( D(E) , D(D) + c(D,E) )
3. = min( ∞, 1+1)
4. = min(∞, 2)
5. The minimum value is 2. Therefore, the currently shortest path from A to E is 2.
Note: The vertex D has no direct link to vertex E. Therefore, the value of D(F) is infinity.
Step 3:
In the above table, we observe that both E and B have the least cost path in step 2. Let's
consider the E vertex. Now, we determine the least cost path of remaining vertices through E.
1. v = B, w = E
2. D(B) = min( D(B) , D(E) + c(E,B) )
3. = min( 2 , 2+ ∞ )
4. = min( 2, ∞)
5. The minimum value is 2. Therefore, the currently shortest path from A to B is 2.
1. v = C, w = E
2. D(B) = min( D(C) , D(E) + c(E,C) )
3. = min( 4 , 2+1 )
4. = min( 4,3)
5. The minimum value is 3. Therefore, the currently shortest path from A to C is 3.
1. v = F, w = E
2. D(B) = min( D(F) , D(E) + c(E,F) )
3. = min( ∞ , 2+2 )
4. = min(∞ ,4)
5. The minimum value is 4. Therefore, the currently shortest path from A to F is 4.
Step 4:
In the above table, we observe that B vertex has the least cost path in step 3. Therefore, it is
added in N. Now, we determine the least cost path of remaining vertices through B.
1. v = C, w = B
2. D(B) = min( D(C) , D(B) + c(B,C) )
3. = min( 3 , 2+3 )
4. = min( 3,5)
5. The minimum value is 3. Therefore, the currently shortest path from A to C is 3.
1. v = F, w = B
2. D(B) = min( D(F) , D(B) + c(B,F) )
3. = min( 4, ∞)
4. = min(4, ∞)
5. The minimum value is 4. Therefore, the currently shortest path from A to F is 4.
Step 5:
In the above table, we observe that C vertex has the least cost path in step 4. Therefore, it is
added in N. Now, we determine the least cost path of remaining vertices through C.
1. v = F, w = C
2. D(B) = min( D(F) , D(C) + c(C,F) )
3. = min( 4, 3+5)
4. = min(4,8)
5. The minimum value is 4. Therefore, the currently shortest path from A to F is 4.
5 ADEBC 4,E
Final table:
5 ADEBC 4,E
6 ADEBCF
Disadvantage:
Heavy traffic is created in Line state routing due to Flooding. Flooding can cause an infinite
looping, this problem can be solved by using Time-to-leave field
A state occurring in network layer when the message traffic is so heavy that it slows down
network response time.
Effects of Congestion
As delay increases, performance decreases.
If delay increases, retransmission occurs, making situation worse.
Congestion Control refers to techniques and mechanisms that can either prevent congestion,
before it happens, or remove congestion, after it has happened. Congestion control
mechanisms are divided into two categories, one category prevents the congestion from
happening and the other category removes congestion after it has taken place.
1. Open loop
2.Closedloop
• In this method, policies are used to prevent the congestion before it happens.
• The various methods used for open loop congestion control are:
Retransmission Policy
• The sender retransmits a packet, if it feels that the packet it has sent is lost or corrupted.
• However retransmission in general may increase the congestion in the network. But we
need to implement good retransmission policy to prevent congestion.
• The retransmission policy and the retransmission timers need to be designed to optimize
efficiency and at the same time prevent the congestion.
Window Policy
• To implement window policy, selective reject window method is used for congestion
control.
• Selective reject method sends only the specific lost or damaged packets.
Acknowledgement Policy
• The acknowledgement policy imposed by the receiver may also affect congestion.
• If the receiver does not acknowledge every packet it receives it may slow down the sender
and help prevent congestion.
• Acknowledgments also add to the traffic load on the network. Thus, by sending fewer
acknowledgements we can reduce load on the network.
Discarding Policy
• A router may discard less sensitive packets when congestion is likely to happen.
• Such a discarding policy may prevent congestion and at the same time may not harm the
integrity of the transmission.
Admission Policy
• Switches in a flow first check the resource requirement of a flow before admitting it to the
network.
• A router can deny establishing a virtual circuit connection if there is congestion in the
“network or if there is a possibility of future congestion.
• Closed loop congestion control mechanisms try to remove the congestion after it happens.
• The various methods used for closed loop congestion control are:
Backpressure
• Back pressure is a node-to-node congestion control that starts with a node and propagates,
in the opposite direction of data flow.
The backpressure technique can be applied only to virtual circuit networks. In such virtual
circuit each node knows the upstream node from which a data flow is coming.
n this method of congestion control, the congested node stops receiving data from the
immediate upstream node or nodes.
• This may cause the upstream node on nodes to become congested, and they, in turn, reject
data from their upstream node or nodes.
• As shown in fig node 3 is congested and it stops receiving packets and informs its
upstream node 2 to slow down. Node 2 in turns may be congested and informs node 1 to
slow down. Now node 1 may create congestion and informs the source node to slow down.
In this way the congestion is alleviated. Thus, the pressure on node 3 is moved backward to
the source to remove the congestion.
Choke Packet:
• In this method of congestion control, congested router or node sends a special type of
packet called choke packet to the source to inform it about the congestion.
• Here, congested node does not inform its upstream node about the congestion as in
backpressure method.
• In choke packet method, congested node sends a warning directly to the source
station i.e. the intermediate nodes through which the packet has traveled are not warned.
Implicit Signaling
• In implicit signaling, there is no communication between the congested node or nodes and
the source.
• The source guesses that there is congestion somewhere in the network when it does not
receive any acknowledgment. Therefore the delay in receiving an acknowledgment is
interpreted as congestion in the network.
Explicit Signaling
• In this method, the congested nodes explicitly send a signal to the source or destination to
inform about the congestion.
• Explicit signaling is different from the choke packet method. In choke packed method, a
separate packet is used for this purpose whereas in explicit signaling method, the signal is
included in the packets that carry data .
• Explicit signaling can occur in either the forward direction or the backward direction .
• In backward signaling, a bit is set in a packet moving in the direction opposite to the
congestion. This bit warns the source about the congestion and informs the source to slow
down.
• In forward signaling, a bit is set in a packet moving in the direction of congestion. This bit
warns the destination about the congestion. The receiver in this case uses policies such as
slowing down the acknowledgements to remove the congestion.
LeakyBucketAlgorithm
• It is a traffic shaping mechanism that controls the amount and the rate of the traffic sent to
the network.
• A leaky bucket algorithm shapes bursty traffic into fixed rate traffic by averaging the data
rate.
• The rate at which the water is poured into the bucket is not fixed and can vary but it leaks
from the bucket at a constant rate. Thus (as long as water is present in bucket), the rate at
which the water leaks does not depend on the rate at which the water is input to the bucket.
• Also, when
the bucket is full, any additional water that enters into the bucket spills over the sides and is
lost.
• The same concept can be applied to packets in the network. Consider that data is coming
from the source at variable speeds. Suppose that a source sends data at 12 Mbps for 4
seconds. Then there is no data for 3 seconds. The source again transmits data at a rate of 10
Mbps for 2 seconds. Thus, in a time span of 9 seconds, 68 Mb data has been transmitted.
If a leaky bucket algorithm is used, the data flow will be 8 Mbps for 9 seconds. Thus
constant flow is maintained.
• The leaky bucket algorithm allows only an average (constant) rate of data flow. Its major
problem is that it cannot deal with bursty data.
• A leaky bucket algorithm does not consider the idle time of the host. For example, if the
host was idle for 10 seconds and now it is willing to sent data at a very high speed for
another 10 seconds, the total data transmission will be divided into 20 seconds and average
data rate will be maintained. The host is having no advantage of sitting idle for 10 seconds.
• To overcome this problem, a token bucket algorithm is used. A token bucket algorithm
allows bursty data transfers.
• A token bucket algorithm is a modification of leaky bucket in which leaky bucket contains
tokens.
• In this algorithm, a token(s) are generated at every clock tick. For a packet to be
transmitted, system must remove token(s) from the bucket.
• Thus, a token bucket algorithm allows idle hosts to accumulate credit for the future in formof tokens.
• For example, if a system generates 100 tokens in one clock tick and the host is idle for 100ticks. The
bucket will contain 10,000 tokens.
Now, if the host wants to send bursty data, it can consume all 10,000 tokens at once forsending 10,000
cells or bytes.
Thus a host can send bursty data as long as bucket is not empty.
o Each of the applications in the application layer has the ability to send a message by
using TCP or UDP. The application communicates by using either of these two protocols.
Both TCP and UDP will then communicate with the internet protocol in the internet
layer. The applications can read and write to the transport layer. Therefore, we can say
that communication is a two-way process.
The services provided by the transport layer are similar to those of the data link layer. The data
link layer provides the services within a single network while the transport layer provides the
services across an internetwork made up of many networks. The data link layer controls the
physical layer while the transport layer controls all the lower layers.
The services provided by the transport layer protocols can be divided into five categories:
o End-to-end delivery
o Addressing
o Reliable delivery
o Flow control
o Multiplexing
End-to-end delivery:
The transport layer transmits the entire message to the destination. Therefore, it ensures the end-
to-end delivery of an entire message from a source to the destination.
Reliable delivery:
The transport layer provides reliability services by retransmitting the lost and damaged packets.
o Error control
o Sequence control
o Loss control
o Duplication control
Error Control
o The primary role of reliability is Error Control. In reality, no transmission will be 100
percent error-free delivery. Therefore, transport layer protocols are designed to provide
error-free transmission.
o The data link layer also provides the error handling mechanism, but it ensures only node-
to-node error-free delivery. However, node-to-node reliability does not ensure the end-to-
end reliability.
o The data link layer checks for the error between each network. If an error is introduced
inside one of the routers, then this error will not be caught by the data link layer. It only
detects those errors that have been introduced between the beginning and end of the link.
Therefore, the transport layer performs the checking for the errors end-to-end to ensure
that the packet has arrived correctly.
Sequence Control
o The second aspect of the reliability is sequence control which is implemented at the
transport layer.
o On the sending end, the transport layer is responsible for ensuring that the packets
received from the upper layers can be used by the lower layers. On the receiving end, it
ensures that the various segments of a transmission can be correctly reassembled.
Loss Control
Loss Control is a third aspect of reliability. The transport layer ensures that all the fragments of a
transmission arrive at the destination, not some of them. On the sending end, all the fragments of
transmission are given sequence numbers by a transport layer. These sequence numbers allow
the receiver?s transport layer to identify the missing segment.
Duplication Control
Duplication Control is the fourth aspect of reliability. The transport layer guarantees that no
duplicate data arrive at the destination. Sequence numbers are used to identify the lost packets;
similarly, it allows the receiver to identify and discard duplicate segments.
Flow Control
Flow control is used to prevent the sender from overwhelming the receiver. If the receiver is
overloaded with too much data, then the receiver discards the packets and asking for the
retransmission of packets. This increases network congestion and thus, reducing the system
performance. The transport layer is responsible for flow control. It uses the sliding window
protocol that makes the data transmission more efficient as well as it controls the flow of data so
that the receiver does not become overwhelmed. Sliding window protocol is byte oriented rather
than frame oriented.
Multiplexing
Addressing
o According to the layered model, the transport layer interacts with the functions of the
session layer. Many protocols combine session, presentation, and application layer
protocols into a single layer known as the application layer. In these cases, delivery to the
session layer means the delivery to the application layer. Data generated by an
application on one machine must be transmitted to the correct application on another
machine. In this case, addressing is provided by the transport layer.
o The transport layer provides the user address which is specified as a station or port. The
port variable represents a particular TS user of a specified station known as a Transport
Service access point (TSAP). Each station has only one transport entity.
o The transport layer protocols need to know which upper-layer protocols are
communicating.
UDP
Where,
o Source port address: It defines the address of the application process that has delivered
a message. The source port address is of 16 bits address.
o Destination port address: It defines the address of the application process that will
receive the message. The destination port address is of a 16-bit address.
o Total length: It defines the total length of the user datagram in bytes. It is a 16-bit field.
o Checksum: The checksum is a 16-bit field which is used in error detection.
o UDP can discover that an error has occurred, but it does not specify which packet has
been lost as it does not contain an ID or sequencing number of a particular data segment.
Definition TCP establishes a virtual circuit UDP transmits the data directly to the
before transmitting the data. destination computer without verifying
whether the receiver is ready to receive or
not.
acknowledgement It waits for the acknowledgement It neither takes the acknowledgement, norit
of data and has the ability to retransmits the damaged frame.
resend the lost packets.
TCP stands for Transmission Control Protocol. It is a transport layer protocol that facilitates
the transmission of packets from source to destination. It is a connection-oriented protocol that
means it establishes the connection prior to the communication that occurs between the
computing devices in a network. This protocol is used with an IP protocol, so together, they are
referred to as a TCP/IP.
The main functionality of the TCP is to take the data from the application layer. Then it divides
the data into a several packets, provides numbering to these packets, and finally transmits these
packets to the destination. The TCP, on the other side, will reassemble the packets and transmits
them to the application layer. As we know that TCP is a connection-oriented protocol, so the
connection will remain established until the communication is not completed between the sender
and the receiver.
TCP is a transport layer protocol as it is used in transmitting the data from the sender to the
receiver.
o Reliable
TCP is a reliable protocol as it follows the flow and error control mechanism. It also supports the
acknowledgment mechanism, which checks the state and sound arrival of the data. In the
acknowledgment mechanism, the receiver sends either positive or negative acknowledgment to
the sender so that the sender can get to know whether the data packet has been received or needs
to resend.
This protocol ensures that the data reaches the intended receiver in the same order in which it is
sent. It orders and numbers each segment so that the TCP layer on the destination side can
reassemble them based on their ordering.
o Connection-oriented
It is a connection-oriented service that means the data exchange occurs only after the connection
establishment. When the data transfer is completed, then the connection will get terminated.
o Full duplex
It is a full-duplex means that the data can transfer in both directions at the same time.
o Stream-oriented
TCP is a stream-oriented protocol as it allows the sender to send the data in the form of a stream
of bytes and also allows the receiver to accept the data in the form of a stream of bytes. TCP
creates an environment in which both the sender and receiver are connected by an imaginary
tube known as a virtual circuit. This virtual circuit carries the stream of bytes across the internet.
In the layered architecture of a network model, the whole task is divided into smaller tasks. Each
task is assigned to a particular layer that processes the task. In the TCP/IP model, five layers
are application layer, transport layer, network layer, data link layer, and physical layer. The
transport layer has a critical role in providing end-to-end communication to the directly
application processes. It creates 65,000 ports so that the multiple applications can be accessed at
the same time. It takes the data from the upper layer, and it divides the data into smaller packets
and then transmits them to the network layer.
Working of TCP
In TCP, the connection is established by using three-way handshaking. The client sends the
segment with its sequence number. The server, in return, sends its segment with its own
sequence number as well as the acknowledgement sequence, which is one more than the client
sequence number. When the client receives the acknowledgment of its segment, then it sends the
acknowledgment to the server. In this way, the connection is established between the client and
the server.
Advantages of TCP
Disadvantage of TCP
It increases a large amount of overhead as each segment gets its own TCP header, so
fragmentation by the router increases the overhead.
o Source port: It defines the port of the application, which is sending the data. So, this
field contains the source port address, which is 16 bits.
o Destination port: It defines the port of the application on the receiving side. So, this
field contains the destination port address, which is 16 bits.
o Sequence number: This field contains the sequence number of data bytes in a particular
session.
o Acknowledgment number: When the ACK flag is set, then this contains the next
sequence number of the data byte and works as an acknowledgment for the previous data
received. For example, if the receiver receives the segment number 'x', then it responds
'x+1' as an acknowledgment number.
o HLEN: It specifies the length of the header indicated by the 4-byte words in the header.
The size of the header lies between 20 and 60 bytes. Therefore, the value of this field
would lie between 5 and 15.
o Reserved: It is a 4-bit field reserved for future use, and by default, all are set to zero.
o Flags
There are six control bits or flags:
1. URG: It represents an urgent pointer. If it is set, then the data is processed
urgently.
2. ACK: If the ACK is set to 0, then it means that the data packet does not contain
an acknowledgment.
3. PSH: If this field is set, then it requests the receiving device to push the data to
the receiving application without buffering it.
4. RST: If it is set, then it requests to restart a connection.
5. SYN: It is used to establish a connection between the hosts.
6. FIN: It is used to release a connection, and no further data exchange will happen.
o Window size
It is a 16-bit field. It contains the size of data that the receiver can accept. This field is
used for the flow control between the sender and receiver and also determines the amount
of buffer allocated by the receiver for a segment. The value of this field is determined by
the receiver.
o Checksum
It is a 16-bit field. This field is optional in UDP, but in the case of TCP/IP, this field is
mandatory.
o Urgentpointer
It is a pointer that points to the urgent data byte if the URG flag is set to 1. It defines a
value that will be added to the sequence number to get the sequence number of the last
urgent byte.
o Options
It provides additional options. The optional field is represented in 32-bits. If this field
contains the data less than 32-bit, then padding is required to obtain the remaining bits.
Services of TCP:
Following are some of the services offered by the Transmission Control Protocol (TCP) to the
processes at the application layer:
TCP is a stream-oriented protocol. It enables the sending process to deliver data as a stream of
bytes and the receiving process to acquire data as a stream of bytes.
TCP creates a working environment so that the sending and receiving procedures are connected
by an imaginary "tube", as shown in the figure below:
The sending and receiving processes cannot produce and receive data at the same speed. Hence,
TCP needs a buffer for storage.
There are two methods of buffers used in each dissection, which are as follows:
Sending Buffer
Receiving Buffer
A buffer can be implemented by using a circular array of 1-byte location, as shown in the figure
below. The figure shows the movement of data in one direction on the sending side.
Empty Locations.
Locations that contain the bytes which have been sent, but not acknowledged. These bytes
are kept in the buffer till an acknowledgment is received.
The location that contains the bytes which are to be sent by the sending TCP
In practice, the TCP may send only a port of data due to the slowness of the receiving process or
congestion in the network.
The buffer at the receiver is divided into two parts as mentioned below:
Buffering is used to handle the difference between the speed of data transmission and data
consumption. But only buffering is not enough.
We need one more step before sending the data on the Internet Protocol (IP) layer as a TCP
service provider. It needs to send data in the form of packets and not as a stream of bytes.
At the transport layer, TCP groups several bytes into a packet and this is called a segment. A
header is added to each segment to exercise control.
The segment is encapsulated in an IP diagram and then transmitted. The entire operation is
transparent to the receiving process. The segment may be deceived out of order, lost or
corrupted when it receives the receiving end.
The figure given below shows how the segments are created from the bytes in the buffers:
The segments are not of the same size. Each segment can carry hundreds of bytes.
Full-Duplex Service
TCP offers a full-duplex service where the data can flow in both directions simultaneously. Each
TCP will then have a sending buffer and receiving buffer. The TCP segments are sent in both
directions.
Connection-Oriented Service
We are already aware that the TCP is a connection-oriented protocol. When a process wants to
communicate (send and receive) with another process (process -2), the sequence of operations is
as follows:
Reliable Service
TCP is a reliable transport protocol. It uses an acknowledgment mechanism for checking the
safe and sound arrival of data.
Requirement: Every host is identified by the IP address but remembering numbers is very
difficult for the people also the IP addresses are not static therefore a mapping is required to
change the domain name to the IP address. So DNS is used to convert the domain name of the
websites to their numerical IP address.
An application layer protocol defines how the application processes running on different
systems, pass the messages to each other.
o DNS is a service that translates the domain name into IP addresses. This allows the users
of networks to utilize user-friendly names when looking for other hosts instead of
remembering the IP addresses.
o For example, suppose the FTP site at EduSoft had an IP address of 132.147.165.50, most
people would reach this site by specifying ftp.EduSoft.com. Therefore, the domain name
is more reliable than IP address.
DNS is a TCP/IP protocol used on different platforms. The domain name space is divided into
three different sections: generic domains, country domains, and inverse domain.
Generic Domains
Label Description
Country Domain
The format of country domain is same as a generic domain, but it uses two-character country
abbreviations (e.g., us for the United States) in place of three character organizational
abbreviations.
Inverse Domain
The inverse domain is used for mapping an address to a name. When the server has received a
request from the client, and the server contains the files of only authorized clients. To determine
whether the client is on the authorized list or not, it sends a query to the DNS server and ask for
mapping an address to the name.
Working of DNS
o Client requests contain a name which is converted into an IP address known as a forward
DNS lookups while requests containing an IP address which is converted into a name
known as reverse DNS lookups.
o DNS implements a distributed database to store the name of all the hosts available on the
internet.
o If a client like a web browser sends a request containing a hostname, then a piece of
software such as DNS resolver sends a request to the DNS server to obtain the IP address
of a hostname. If DNS server does not contain the IP address associated with a hostname,
then it forwards the request to another DNS server. If IP address has arrived at the
resolver, which in turn completes the request over the internet protocol.
Electronic mail:
E-mail is defined as the transmission of messages on the Internet. It is one of the most commonly
used features over communications networks that may contain text, files, images, or other
Email messages are conveyed through email servers; it uses multiple protocols within
the TCP/IP suite. For example, SMTP is a protocol, stands for simple mail transfer protocol and
used to send messages whereas other protocols IMAP or POP are used to retrieve messages from
a mail server. If you want to login to your mail account, you just need to enter a valid email
address, password, and the mail servers used to send and receive messages.
Although most of the webmail servers automatically configure your mail account, therefore, you
only required to enter your email address and password. However, you may need to manually
configure each account if you use an email client like Microsoft Outlook or Apple Mail. In
addition, to enter the email address and password, you may also need to enter incoming and
outgoing mail servers and the correct port numbers for each one.
The email was developed to support rich text with custom formatting, and the original email
standard is only capable of supporting plain text messages. In modern times, email
supports HTML (Hypertext markup language), which makes it capable of emails to support the
same formatting as websites. The email that supports HTML can contain links, images, CSS
layouts, and also can send files or "email attachments" along with messages. Most of the mail
servers enable users to send several attachments with each message. The attachments were
typically limited to one megabyte in the early days of email. Still, nowadays, many mail servers
are able to support email attachments of 20 megabytes or more in size.
In 1971, as a test e-mail message, Ray Tomlinson sent the first e-mail to himself. This email was
contained the text "something like QWERTYUIOP." However, the e-mail message was still
transmitted through ARPANET, despite sending the e-mail to himself. Most of the electronic
mail was being sent as compared to postal mail till 1996.
Advantages of Email
o Email offers users the benefit of accessing email from anywhere at any time if they have
an Internet connection.
o Email offers you an incurable communication process, which enables you to send a
response at a convenient time. Also, it offers users a better option to communicate easily
regardless of different schedules users.
o Speed and simplicity: Email can be composed very easily with the correct information
and contacts. Also, minimum lag time, it can be exchanged quickly.
o Mass sending: You can send a message easily to large numbers of people through email.
o Email exchanges can be saved for future retrieval, which allows users to keep important
conversations or confirmations in their records and can be searched and retrieved when
they needed quickly.
o Email provides a simple user interface and enables users to categorize and filter their
messages. This can help you recognize unwanted emails like junk and spam mail. Also,
users can find specific messages easily when they are needed.
Disadvantages of Email
o Information Overload: As it is very easy to send email to many people at a time, which
can create information overload. In many modern workplaces, it is a major problem
where it is required to move a lot of information and impossible to tell if an email is
important. And, email needs organization and upkeep. The bad feeling is one of the other
problems with email when you returned from vacation and found hundreds of unopened
emails in your inbox.
o Viruses: Although there are many ways to travel viruses in the devices, email is one of
the common ways to enter viruses and infect devices. Sometimes when you get a mail, it
might be the virus come with an attached document. And, the virus can infect the system
when you click on the email and open the attached link. Furthermore, an anonymous
person or a trusted friend or contact can send infected emails.
o Pressure to Respond: If you get emails and you do not answer them, the sender can get
annoyed and think you are ignoring them. Thus, this can be a reason to make pressure on
your put to keep opening emails and then respond in some way.
o Time Consuming: When you get an email and read, write, and respond to emails that
can take up vast amounts of time and energy. Many modern workers spend their most
time with emails, which may be caused to take more time to complete work.
o Insecure: There are many hackers available that want to gain your important
information, so email is a common source to seek sensitive data, such as political,
financial, documents, or personal messages. In recent times, there have various high-
profile cases occurred that shown how email is insecure about information theft.
o It is a program used for sending messages to other computer users based on e-mail
addresses.
o It provides a mail exchange between users on the same or different computers, and it also
supports:
World Wide Web, which is also known as a Web, is a collection of websites or web pages stored
in web servers and connected to local computers through the internet. These websites contain
text pages, digital images, audios, videos, etc. Users can access the content of these sites from
any part of the world over the internet using their devices such as computers, laptops, cell
phones, etc. The WWW, along with internet, enables the retrieval and display of text and media
to your device.
The building blocks of the Web are web pages which are formatted in HTML and connected by
links called "hypertext" or hyperlinks and accessed by HTTP. These links are electronic
connections that link related pieces of information so that users can access the desired
information quickly. Hypertext offers the advantage to select a word or phrase from text and thus
to access other pages that provide additional information related to that word or phrase.
A web page is given an online address called a Uniform Resource Locator (URL). A particular
collection of web pages that belong to a specific URL is called a website,
e.g., www.facebook.com, www.google.com, etc. So, the World Wide Web is like a huge
electronic book whose pages are stored on multiple servers across the world.
Small websites store all of their WebPages on a single server, but big websites or organizations
place their WebPages on different servers in different countries so that when users of a country
search their site they could get the information quickly from the nearest server.
So, the web provides a communication platform for users to retrieve and exchange information
over the internet. Unlike a book, where we move from one page to another in a sequence, on
World Wide Web we follow a web of hypertext links to visit a web page and from that web page
to move to other web pages. You need a browser, which is installed on your computer, to access
the Web.
Some people use the terms 'internet' and 'World Wide Web' interchangeably. They think they are
the same thing, but it is not so. Internet is entirely different from WWW. It is a worldwide
network of devices like computers, laptops, tablets, etc. It enables users to send emails to other
users and chat with them online. For example, when you send an email or chatting with someone
online, you are using the internet.
But, when you have opened a website like google.com for information, you are using the World
Wide Web; a network of servers over the internet. You request a webpage from your computer
using a browser, and the server renders that page to your browser. Your computer is called a
client who runs a program (web browser), and asks the other computer (server) for the
information it needs.
The World Wide Web was invented by a British scientist, Tim Berners-Lee in 1989. He was
working at CERN at that time. Originally, it was developed by him to fulfill the need of
automated information sharing between scientists across the world, so that they could easily
share the data and results of their experiments and studies with each other.
1. Uniform Resource Locator (URL): serves as a system for resources on the web.
2. HyperText Transfer Protocol (HTTP): specifies communication of browser and server.
3. Hyper Text Markup Language (HTML): defines the structure, organisation and content
of a webpage.
Now, we have understood that WWW is a collection of websites connected to the internet so that
people can search and share information. Now, let us understand how it works!
The Web works as per the internet's basic client-server format as shown in the following image.
The servers store and transfer web pages or information to user's computers on the network when
requested by the users. A web server is a software program which serves the web pages
requested by web users using a browser. The computer of a user who requests documents from a
server is known as a client. Browser, which is installed on the user' computer, allows users to
view the retrieved documents.
All the websites are stored in web servers. Just as someone lives on rent in a house, a website
occupies a space in a server and remains stored in it. The server hosts the website whenever a
user requests its WebPages, and the website owner has to pay the hosting price for the same.
The moment you open the browser and type a URL in the address bar or search something on
Google, the WWW starts working. There are three main technologies involved in transferring
information (web pages) from servers to clients (computers of users). These technologies include
Hypertext Markup Language (HTML), Hypertext Transfer Protocol (HTTP) and Web browsers.
HTML is a standard markup language which is used for creating web pages. It describes the
structure of web pages through HTML elements or tags. These tags are used to organize the
pieces of content such as 'heading,' 'paragraph,' 'table,' 'Image,' and more. You don't see HTML
tags when you open a webpage as browsers don't display the tags and use them only to render the
content of a web page. In simple words, HTML is used to display text, images, and other
resources through a Web browser.
Web Browser:
A web browser, which is commonly known as a browser, is a program that displays text, data,
pictures, videos, animation, and more. It provides a software interface that allows you to click
hyperlinked resources on the World Wide Web. When you double click the Browser icon
installed on your computer to launch it, you get connected to the World Wide Web and can
search Google or type a URL into the address bar.
In the beginning, browsers were used only for browsing due to their limited potential. Today,
they are more advanced; along with browsing you can use them for e-mailing, transferring
multimedia files, using social media sites, and participating in online discussion groups and
more. Some of the commonly used browsers include Google Chrome, Mozilla Firefox, Internet
Explorer, Safari, and more.
Hyper Text Transfer Protocol (HTTP) is an application layer protocol which enables WWW to
work smoothly and effectively. It is based on a client-server model. The client is a web browser
which communicates with the web server which hosts the website. This protocol defines how
messages are formatted and transmitted and what actions the Web Server and browser should
take in response to different commands. When you enter a URL in the browser, an HTTP
command is sent to the Web server, and it transmits the requested Web Page.
When we open a website using a browser, a connection to the web server is opened, and
the browser communicates with the server through HTTP and sends a request. HTTP is
carried over TCP/IP to communicate with the server. The server processes the browser's
request and sends a response, and then the connection is closed. Thus, the browser
retrieves content from the server for the user.